=bmesh= merge from trunk at r36529
authorJoseph Eagar <joeedh@gmail.com>
Sun, 8 May 2011 23:43:18 +0000 (23:43 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Sun, 8 May 2011 23:43:18 +0000 (23:43 +0000)
525 files changed:
build_files/cmake/example_scripts/make_quicky.py
doc/BL-license.txt [new file with mode: 0644]
doc/bf-members.txt [new file with mode: 0644]
doc/blender.1 [new file with mode: 0644]
extern/libopenjpeg/CMakeLists.txt
intern/SoundSystem/CMakeLists.txt [new file with mode: 0644]
intern/SoundSystem/Makefile [new file with mode: 0644]
intern/SoundSystem/SConscript [new file with mode: 0644]
intern/SoundSystem/SND_C-api.h [new file with mode: 0644]
intern/SoundSystem/SND_CDObject.h [new file with mode: 0644]
intern/SoundSystem/SND_DependKludge.h [new file with mode: 0644]
intern/SoundSystem/SND_DeviceManager.h [new file with mode: 0644]
intern/SoundSystem/SND_IAudioDevice.h [new file with mode: 0644]
intern/SoundSystem/SND_Object.h [moved from intern/container/CTR_HashedPtr.h with 59% similarity]
intern/SoundSystem/SND_Scene.h [new file with mode: 0644]
intern/SoundSystem/SND_SoundListener.h [new file with mode: 0644]
intern/SoundSystem/SND_SoundObject.h [new file with mode: 0644]
intern/SoundSystem/SND_Utils.h [new file with mode: 0644]
intern/SoundSystem/SND_WaveCache.h [new file with mode: 0644]
intern/SoundSystem/SND_WaveSlot.h [new file with mode: 0644]
intern/SoundSystem/SND_test/Makefile [new file with mode: 0644]
intern/SoundSystem/SND_test/SND_test.c [new file with mode: 0644]
intern/SoundSystem/SoundDefines.h [new file with mode: 0644]
intern/SoundSystem/dummy/Makefile [new file with mode: 0644]
intern/SoundSystem/dummy/SND_DummyDevice.cpp [new file with mode: 0644]
intern/SoundSystem/dummy/SND_DummyDevice.h [new file with mode: 0644]
intern/SoundSystem/intern/Makefile [new file with mode: 0644]
intern/SoundSystem/intern/SND_AudioDevice.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_AudioDevice.h [new file with mode: 0644]
intern/SoundSystem/intern/SND_C-api.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_CDObject.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_DeviceManager.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_IdObject.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_IdObject.h [new file with mode: 0644]
intern/SoundSystem/intern/SND_Scene.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_SoundListener.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_SoundObject.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_Utils.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_WaveCache.cpp [new file with mode: 0644]
intern/SoundSystem/intern/SND_WaveSlot.cpp [new file with mode: 0644]
intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp [new file with mode: 0644]
intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp [new file with mode: 0644]
intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp [new file with mode: 0644]
intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj [new file with mode: 0644]
intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj [new file with mode: 0644]
intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj [new file with mode: 0644]
intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj [new file with mode: 0644]
intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj [new file with mode: 0644]
intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj [new file with mode: 0644]
intern/SoundSystem/openal/Makefile [new file with mode: 0644]
intern/SoundSystem/openal/SND_OpenALDevice.cpp [new file with mode: 0644]
intern/SoundSystem/openal/SND_OpenALDevice.h [new file with mode: 0644]
intern/SoundSystem/openal/pthread_cancel.cpp [new file with mode: 0644]
intern/SoundSystem/sdl/Makefile [new file with mode: 0644]
intern/SoundSystem/sdl/SND_SDLCDDevice.cpp [new file with mode: 0644]
intern/SoundSystem/sdl/SND_SDLCDDevice.h [new file with mode: 0644]
intern/decimation/SConscript
intern/elbeem/intern/elbeem.h [new file with mode: 0644]
intern/ghost/GHOST_C-api.h
intern/ghost/GHOST_IEvent.h
intern/ghost/GHOST_ISystem.h
intern/ghost/GHOST_IWindow.h
intern/ghost/intern/GHOST_C-api.cpp
intern/ghost/intern/GHOST_DisplayManagerCocoa.h
intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
intern/ghost/intern/GHOST_Event.h
intern/ghost/intern/GHOST_EventButton.h
intern/ghost/intern/GHOST_EventCursor.h
intern/ghost/intern/GHOST_EventKey.h
intern/ghost/intern/GHOST_EventManager.cpp
intern/ghost/intern/GHOST_EventManager.h
intern/ghost/intern/GHOST_EventTrackpad.h
intern/ghost/intern/GHOST_EventWheel.h
intern/ghost/intern/GHOST_System.cpp
intern/ghost/intern/GHOST_System.h
intern/ghost/intern/GHOST_SystemCocoa.h
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_WindowCocoa.h
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/guardedalloc/MEM_guardedalloc.h
intern/guardedalloc/SConscript
intern/guardedalloc/intern/mallocn.c
intern/guardedalloc/intern/mmap_win.c
intern/itasc/kdl/frameacc.hpp
intern/itasc/kdl/framevel.hpp
intern/opennl/superlu/sgstrf.c
intern/string/SConscript
release/scripts/export_cal3d.py [new file with mode: 0644]
release/scripts/modules/bpy/app.py [new file with mode: 0644]
release/scripts/modules/bpy_ops.py [new file with mode: 0644]
release/scripts/modules/dynamic_menu.py [new file with mode: 0644]
release/scripts/op/add_mesh_torus.py [new file with mode: 0644]
release/scripts/op/animsys_update.py [new file with mode: 0644]
release/scripts/op/console_python.py [new file with mode: 0644]
release/scripts/op/fcurve_euler_filter.py [new file with mode: 0644]
release/scripts/op/image.py [new file with mode: 0644]
release/scripts/op/mesh.py [new file with mode: 0644]
release/scripts/op/nla.py [new file with mode: 0644]
release/scripts/op/object.py [new file with mode: 0644]
release/scripts/op/object_align.py [new file with mode: 0644]
release/scripts/op/object_randomize_transform.py [new file with mode: 0644]
release/scripts/op/presets.py [new file with mode: 0644]
release/scripts/op/screen_play_rendered_anim.py [new file with mode: 0644]
release/scripts/op/sequencer.py [new file with mode: 0644]
release/scripts/op/uv.py [new file with mode: 0644]
release/scripts/op/uvcalc_follow_active.py [new file with mode: 0644]
release/scripts/op/uvcalc_smart_project.py [new file with mode: 0644]
release/scripts/op/vertexpaint_dirt.py [new file with mode: 0644]
release/scripts/op/wm.py [new file with mode: 0644]
release/scripts/presets/interaction/maya.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/templates/operator.py [new file with mode: 0644]
release/scripts/uv_from_adjacent.py [new file with mode: 0644]
release/windows/installer/01.installer.bmp [deleted file]
source/blender/CMakeLists.txt
source/blender/SConscript
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_bmesh.h
source/blender/blenkernel/BKE_cdderivedmesh.h
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_idcode.h [changed mode: 0644->0755]
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/BKE_subsurf.h
source/blender/blenkernel/BKE_tessmesh.h [new file with mode: 0644]
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/BKE_verse.h [new file with mode: 0644]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/BME_Customdata.c
source/blender/blenkernel/intern/BME_conversions.c
source/blender/blenkernel/intern/BME_eulers.c
source/blender/blenkernel/intern/BME_mesh.c
source/blender/blenkernel/intern/BME_structure.c
source/blender/blenkernel/intern/BME_tools.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/booleanops.c [new file with mode: 0644]
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/editderivedbmesh.c [new file with mode: 0644]
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/idcode.c [changed mode: 0644->0755]
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/modifiers_bmesh.c [new file with mode: 0644]
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/sca.c
source/blender/blenkernel/intern/seqcache.c [changed mode: 0644->0755]
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/verse_bitmap_node.c [new file with mode: 0644]
source/blender/blenkernel/intern/verse_geometry_node.c [new file with mode: 0644]
source/blender/blenkernel/intern/verse_method.c [new file with mode: 0644]
source/blender/blenkernel/intern/verse_node.c [new file with mode: 0644]
source/blender/blenkernel/intern/verse_object_node.c [new file with mode: 0644]
source/blender/blenkernel/intern/verse_session.c [new file with mode: 0644]
source/blender/blenkernel/nla_private.h
source/blender/blenlib/BLI_arithb.h [new file with mode: 0644]
source/blender/blenlib/BLI_array.h [new file with mode: 0644]
source/blender/blenlib/BLI_cellalloc.h [new file with mode: 0644]
source/blender/blenlib/BLI_edgehash.h
source/blender/blenlib/BLI_editVert.h
source/blender/blenlib/BLI_fileops.h
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/BLI_math_color.h
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_mempool.h
source/blender/blenlib/BLI_scanfill.h
source/blender/blenlib/BLI_smallhash.h [new file with mode: 0755]
source/blender/blenlib/BLI_sparsemap.h [new file with mode: 0755]
source/blender/blenlib/BLI_threads.h
source/blender/blenlib/BLI_utildefines.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/blenlib/intern/BLI_cellalloc.c [new file with mode: 0644]
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/BLI_mempool.c
source/blender/blenlib/intern/edgehash.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/pbvh.c
source/blender/blenlib/intern/rct.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/threads.c
source/blender/blenloader/SConscript
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/SConscript
source/blender/bmesh/CMakeLists.txt [new file with mode: 0644]
source/blender/bmesh/SConscript [new file with mode: 0644]
source/blender/bmesh/bmesh.h [new file with mode: 0644]
source/blender/bmesh/bmesh_class.h [new file with mode: 0644]
source/blender/bmesh/bmesh_error.h [new file with mode: 0644]
source/blender/bmesh/bmesh_filters.h [new file with mode: 0644]
source/blender/bmesh/bmesh_iterators.h [new file with mode: 0644]
source/blender/bmesh/bmesh_marking.h [new file with mode: 0644]
source/blender/bmesh/bmesh_operator_api.h [new file with mode: 0644]
source/blender/bmesh/bmesh_operators.h [new file with mode: 0644]
source/blender/bmesh/bmesh_queries.h [new file with mode: 0644]
source/blender/bmesh/bmesh_walkers.h [new file with mode: 0644]
source/blender/bmesh/editmesh_tools.c [moved from source/blender/editors/mesh/editmesh_tools.c with 56% similarity]
source/blender/bmesh/intern/bmesh_construct.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_eulers.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_filters.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_interp.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_iterators.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_marking.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_mesh.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_mods.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_newcore.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_opdefines.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_operators.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_operators_private.h [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_polygon.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_private.h [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_queries.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_structure.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_structure.h [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_to_editmesh.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_walkers.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_walkers_impl.c [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_walkers_private.h [new file with mode: 0644]
source/blender/bmesh/intern/editmesh_to_bmesh.c [new file with mode: 0644]
source/blender/bmesh/intern/in-progress/BME_conversions.c [new file with mode: 0644]
source/blender/bmesh/operators/bevel.c [new file with mode: 0644]
source/blender/bmesh/operators/bmesh_dupeops.c [new file with mode: 0644]
source/blender/bmesh/operators/connectops.c [new file with mode: 0644]
source/blender/bmesh/operators/createops.c [new file with mode: 0644]
source/blender/bmesh/operators/dissolveops.c [new file with mode: 0644]
source/blender/bmesh/operators/edgesplitop.c [new file with mode: 0644]
source/blender/bmesh/operators/extrudeops.c [new file with mode: 0644]
source/blender/bmesh/operators/join_triangles.c [new file with mode: 0644]
source/blender/bmesh/operators/mesh_conv.c [new file with mode: 0644]
source/blender/bmesh/operators/mirror.c [new file with mode: 0644]
source/blender/bmesh/operators/primitiveops.c [new file with mode: 0644]
source/blender/bmesh/operators/removedoubles.c [new file with mode: 0644]
source/blender/bmesh/operators/subdivideop.c [new file with mode: 0644]
source/blender/bmesh/operators/subdivideop.h [new file with mode: 0644]
source/blender/bmesh/operators/triangulateop.c [new file with mode: 0644]
source/blender/bmesh/operators/utils.c [new file with mode: 0644]
source/blender/bmesh/tools/BME_bevel.c [new file with mode: 0644]
source/blender/bmesh/tools/BME_dupe_ops.c [new file with mode: 0644]
source/blender/bmesh/tools/BME_duplicate.c [new file with mode: 0644]
source/blender/bmesh/tools/BME_extrude.c [new file with mode: 0644]
source/blender/bmesh/tools/BME_weld.c [new file with mode: 0644]
source/blender/editors/animation/SConscript
source/blender/editors/armature/SConscript
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/poseobject.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/SConscript
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/datafiles/SConscript
source/blender/editors/gpencil/SConscript
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_toolmode.h [new file with mode: 0755]
source/blender/editors/include/ED_util.h
source/blender/editors/include/ED_uvedit.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/SConscript
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/CMakeLists.txt
source/blender/editors/mesh/SConscript
source/blender/editors/mesh/bmesh_select.c [new file with mode: 0644]
source/blender/editors/mesh/bmesh_selecthistory.c [new file with mode: 0644]
source/blender/editors/mesh/bmesh_tools.c [new file with mode: 0644]
source/blender/editors/mesh/bmeshutils.c [new file with mode: 0644]
source/blender/editors/mesh/editbmesh_add.c [new file with mode: 0644]
source/blender/editors/mesh/editbmesh_bvh.c [new file with mode: 0644]
source/blender/editors/mesh/editbmesh_bvh.h [new file with mode: 0644]
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh.c [deleted file]
source/blender/editors/mesh/editmesh_add.c [deleted file]
source/blender/editors/mesh/editmesh_lib.c [deleted file]
source/blender/editors/mesh/editmesh_loop.c [deleted file]
source/blender/editors/mesh/editmesh_mods.c [deleted file]
source/blender/editors/mesh/knifetool.c [new file with mode: 0755]
source/blender/editors/mesh/loopcut.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/CMakeLists.txt
source/blender/editors/object/SConscript
source/blender/editors/object/object_add.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/SConscript
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/render/CMakeLists.txt
source/blender/editors/render/SConscript
source/blender/editors/render/render_shading.c
source/blender/editors/screen/CMakeLists.txt
source/blender/editors/screen/Makefile [new file with mode: 0644]
source/blender/editors/screen/SConscript
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/SConscript
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_api/CMakeLists.txt
source/blender/editors/space_api/SConscript
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/SConscript
source/blender/editors/space_file/Makefile [new file with mode: 0644]
source/blender/editors/space_image/CMakeLists.txt
source/blender/editors/space_image/Makefile [new file with mode: 0644]
source/blender/editors/space_image/SConscript
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_header.c [new file with mode: 0644]
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/CMakeLists.txt
source/blender/editors/space_info/Makefile [new file with mode: 0644]
source/blender/editors/space_info/SConscript
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_node/SConscript
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_view3d/CMakeLists.txt
source/blender/editors/space_view3d/SConscript
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/CMakeLists.txt
source/blender/editors/transform/SConscript
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/CMakeLists.txt
source/blender/editors/util/SConscript
source/blender/editors/util/crazyspace.c
source/blender/editors/util/ed_util.c
source/blender/editors/util/editmode_undo.c
source/blender/editors/uvedit/CMakeLists.txt
source/blender/editors/uvedit/SConscript
source/blender/editors/uvedit/uvedit_buttons.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_intern.h
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_parametrizer.h
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/makesdna/DNA_color_types.h
source/blender/makesdna/DNA_customdata_types.h
source/blender/makesdna/DNA_key_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesdna/intern/SConscript
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_animviz.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_mesh_api.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_pose_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/makesrna/rna_cleanup/rna_properties.txt
source/blender/makesrna/rna_cleanup/rna_update.sh
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/MOD_modifiertypes.h
source/blender/modifiers/SConscript
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_cast.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_multires.c
source/blender/modifiers/intern/MOD_ngoninterp.c [new file with mode: 0644]
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_particlesystem.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_subsurf.c
source/blender/modifiers/intern/MOD_surface.c
source/blender/modifiers/intern/MOD_util.c
source/blender/modifiers/intern/MOD_util.h
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/nodes/intern/SHD_nodes/SHD_output.c
source/blender/python/BPY_menus.c [new file with mode: 0644]
source/blender/python/BPY_menus.h [new file with mode: 0644]
source/blender/python/Makefile [new file with mode: 0644]
source/blender/python/epy_doc_gen.py [new file with mode: 0644]
source/blender/python/generic/bpy_internal_import.h
source/blender/python/intern/Makefile [new file with mode: 0644]
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.h
source/blender/python/intern/bpy_ui.c [new file with mode: 0644]
source/blender/python/intern/bpy_ui.h [new file with mode: 0644]
source/blender/python/simple_enum_gen.py
source/blender/readblenfile/intern/BLO_readblenfile.c
source/blender/render/SConscript
source/blender/render/intern/include/raycounter.h
source/blender/render/intern/include/rayobject.h
source/blender/render/intern/raytrace/reorganize.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/strand.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blenderplayer/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/SConscript
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Ketsji/KXNetwork/SConscript
source/gameengine/Ketsji/SConscript
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/SConscript

index a4e0d3371f16e5de9cd417f4c17c4a82f950c781..058502548675eb2a44cca999076feeb659c699ab 100755 (executable)
@@ -20,7 +20,6 @@
 
 # <pep8 compliant>
 
-
 def print_help(targets):
     print("CMake quicky wrapper, no valid targets given.")
     print(" * targets can contain a subset of the full target name.")
@@ -37,11 +36,11 @@ def print_help(targets):
     for t in targets:
         print("    %s" % t)
     print("...exiting")
-
+    
 
 def main():
     targets = set()
-
+    
     # collect targets
     makefile = open("Makefile", "r")
     for line in makefile:
@@ -55,12 +54,13 @@ def main():
 
         line = line.split(":", 1)[0]
 
-        if "/" in line:  # cmake terget options, dont need these
+        if "/" in line: # cmake terget options, dont need these
             continue
 
         targets.add(line)
     makefile.close()
 
+
     # remove cmake targets
     bad = set([
         "help",
@@ -75,9 +75,10 @@ def main():
         "depend",
         "cmake_check_build_system",
         ])
-
+        
     targets -= set(bad)
 
+
     # parse args
     targets = list(targets)
     targets.sort()
@@ -105,7 +106,7 @@ def main():
                     print("    %s" % t)
                 print("...aborting.")
                 return
-
+    
     # execute
     cmd = "make %s %s blender/fast" % (" ".join(args), " ".join(targets_new))
     print("cmake building with targets: %s" % " ".join(targets_new))
diff --git a/doc/BL-license.txt b/doc/BL-license.txt
new file mode 100644 (file)
index 0000000..3f07976
--- /dev/null
@@ -0,0 +1,35 @@
+Blender License (the "BL", see http://www.blender.org/BL/ ).
+
+Copyright (C) 2002-2005 Blender Foundation. All Rights Reserved.
+
+This text supersedes the previous BL description, called Blender License 1.0.
+
+When the Blender source code was released in 2002, the Blender Foundation reserved 
+the right to offer licenses outside of the GNU GPL. This so-called "dual license" 
+model was chosen to provide potential revenues for the Blender Foundation. 
+
+The BL has not been activated yet. Partially because;
+
+- there has to be a clear benefit for Blender itself and its community of 
+  developers and users.
+- the developers who have copyrighted additions to the source code need to approve 
+  the decision.
+- the (c) holder NaN Holding has to approve on a standard License Contract
+
+But most important; 
+
+- the Blender Foundation is financially healthy, based on community support
+  (e-shop sales), sponsoring and subsidy grants
+- current focus for the Blender Foundation is to not set up any commercial
+  activity related to Blender development.
+- the GNU GPL provides sufficient freedom for third parties to conduct business
+  with Blender
+
+For these reasons we've decided to cancel the BL offering for an indefinite period.
+
+Third parties interested to discuss usage or exploitation of Blender can email 
+license@blender.org for further information.
+
+Ton Roosendaal
+Chairman Blender Foundation.
+June 2005
diff --git a/doc/bf-members.txt b/doc/bf-members.txt
new file mode 100644 (file)
index 0000000..41aad8b
--- /dev/null
@@ -0,0 +1,1393 @@
+Blender Foundation Members 
+
+Special thanks to the following people, who have supported the Blender Foundation
+by donating at least USD 50 to pay for opening the Blender sources: 
+(in chronological order):
+
+Bradley Keyes 
+Robert Knop 
+Thomas Brown 
+Adam Goodenough 
+Steven Tally 
+Jason Tally 
+Alan Taylor 
+Pascal COMPAGNON 
+Christopher Koppler 
+Matthew P. Carter
+Gideon Vaala 
+F.O. Bossert 
+Frank Mayhar 
+Peter Volgyesi 
+Mark E. Nelmes
+Peter Lammers 
+Craig Maloney 
+daniel e vertseegh
+Freek Zijlmans 
+Anthony Ogden 
+Anders Dys 
+Gerald Saunders 
+Fernando Cordas 
+Joshua Smith 
+Max R. Huskins
+imarend
+Olaf Arnold 
+Eric Van Hensbergen
+Christian Reichlin 
+brian moore 
+Anthony Walker 
+Carsten H\9afer 
+Raymond Fordham 
+David Megginson 
+Jason Schmidt 
+Christopher Walden 
+Robert van Straten
+Daniel Schwartz 
+ekzakt
+Jellybean
+Streit Eric 
+Bob Ippolito 
+Keith Frederick 
+Ryan Heimbuch 
+Martin Hess 
+Shigeo Yoshida 
+Rens Houben 
+Jun IIO 
+Derek Gladding 
+Adam Wendt 
+Habib Loew 
+Jani Turkia 
+Warren Landon 
+Chip Lynch 
+Hans Ruedisueli 
+Keith Jones 
+Eugenio Mario Longo
+Philippe Tanguay 
+nekurai
+Ricardo Kustner 
+Peter Van Loock
+Jun-ichi OKAMURA 
+alain dejoux 
+dario trombino 
+Kenneth Johansson 
+Felix Schwarz 
+Eugenio Diaz 
+Aoki Katsutoshi 
+Norman J. Harman Jr. 
+Ralf Habel 
+Ken Payne 
+DEBEUX Sylvain 
+Douglas Philips 
+Lai Che Hung
+Johan Bolmsj\9a 
+Aaron Mitchell 
+Teinye Horsfall 
+Martin Marbach 
+Jason Poole 
+Cesar Delgado 
+Gareth Clay 
+Paul Wasserman 
+Joeri Sebrechts 
+Johannes Lehtinen 
+Marcio L. Teixeira
+James A. Peltier
+George E. Nimmer III 
+Matthew Fite 
+Ken Sedgwick 
+Gary Baltzell 
+lukas schroeder 
+Dan Lyke 
+Mark Thorpe 
+A.D. Arul Nirai Selvan 
+Herbert P\9atzl 
+Andy Payne 
+LAFFITTE Benoit (KenjForce)
+James Ertle 
+Tom Turelinckx 
+Rigo Ketelings 
+Bryan Green 
+Suzuki Akihiro 
+Mason Staugler 
+Guillaume Randon 
+francois Gombault 
+Harald Thelen 
+Graziano Roccon 
+Jonathan DuBois 
+Jason Luros 
+Drew M. Snyder
+Jesse DeFer 
+Michael Keith 
+Gaetano Tinat 
+Ferris McCormick 
+Sherman Boyd 
+Thomas C Anth Jr 
+Joseph Catto 
+Damian Soto 
+John Walsh 
+Stephen Rosman 
+Ross Hopkins 
+Robert Wenzlaff 
+Joe Galat 
+LinuxFrench.NET
+Thomas Erichsen 
+Gary E. Deschaines
+Denis McCarthy 
+Michael Dowman 
+John (J5) Palmieri
+alphawolf
+Peter Paul Fink
+Charles F. McKnight
+Avi Schwartz 
+Jim Witte 
+Jens Ansorg 
+William Bate 
+Ron Romano 
+Marc Schraffenberger 
+Steve Thompson 
+Martin Whitaker 
+Kendall Dugger 
+Brice Due 
+Simon Vogl 
+Bernd Koestler 
+cl\8ement CORDIER 
+CreationAnimation.com
+Pete Carss 
+HERSEN Antoine 
+Charles R. Tersteeg
+James T Burnett
+Shawn Legrand 
+David Choice 
+patrick amaru 
+David Eck 
+Gabriel Welsche 
+Henning von Zitzewitz
+Chris Impink 
+Den Giles 
+Jon Cisewski 
+Ricki Myers 
+Luis Collado 
+Robert G. Watkins
+Rainer Perl 
+YAGI, Toshiki 
+Bruno Nitrosso 
+Athalyba / Blender Brasil 
+Dave Whittington 
+Darryl Luscombe 
+Benjamin A Moore
+Andreas Kollegger 
+Stamatis Logos 
+Ray Kelm 
+Albrecht Jacobs 
+Mirko Horstmann 
+Ranjit Mathew 
+Jaron Blackburn 
+Antonio Hui 
+Scott Moore 
+CSN media 
+Scott Carle 
+Ted Milker 
+Lars Brinkhoff 
+Louise Edwards 
+Alex Ruano 
+Art Rozenbaum 
+Manuel Hossfeld 
+Brandon Ehle 
+Lou Bruce 
+ROMASZEWSKI
+cadic jean-yves 
+Ralf Pietersz 
+KAZY
+serge Jadot 
+Herv\8e LOUINET 
+Tom Houtman 
+Magnus K\9a\9ahler 
+Martin Sinnaeve 
+Kevin Yank 
+Tomoichi Iriyama 
+THIBAULT
+Dr Steven J. Baines 
+Hans-Peter Berger 
+Jeffrey D. Holland
+Philip XP Talbot
+Peter Haight 
+Krister Bruhwel 
+the Smoos 
+Hohenegger Michael 
+Alejandro Gabriel y Galan 
+Boyer
+Alwin Eilers 
+Tyberghein Jorrit 
+Jaroslav Benkovsky 
+Gianluigi Belli 
+Naoki Abe 
+NOTTE Jean-Pierre 
+Jack Way 
+Bj\9arn Westlin 
+Mitch Magee 
+wizoptic
+Jake Edge 
+David Hoover 
+Xabier Go\96
+Daniel Fort 
+Erik Noteboom 
+Pavel Vostatek 
+Javier Belanche Alonso
+Jeffrey Blank 
+Nathan Ryan 
+Peter Wrangell 
+Josef Sie¬ß 
+Timm Krumnack 
+Steve Martin 
+Shigeru Matsumoto 
+Marko Kohtala 
+Aleix Conchillo 
+Curtis Smith 
+Tatjana Svizensky 
+Matt Graham 
+Karo Launonen 
+Nikolaj Brandt Jensen
+Jean-Michel Smith 
+Nathan Clegg 
+Joaquim Carvalho 
+Bomholt
+Martin Imobersteg 
+Jordan
+Justin Warwick 
+barussaud
+Eric Molbert 
+Ben Berck 
+Jacco van Beek
+Dominic Agoro-Ombaka 
+Colin Foster 
+Sascha Adler 
+Stuart Duncan 
+Brendon Smith 
+S\8ebastien COLLETTE 
+Clemens Auer 
+Kay Fricke 
+Fabian Fagerholm 
+Norman Lin 
+Aaron Digulla 
+Camilo Moreno 
+Detlev Reppin 
+Denis NICOLAS 
+Armin Antons 
+Darren Heighington 
+Mario Latronico 
+Frank Meier 
+Joerg Frochte 
+Matthew Ingle 
+Anters
+Bjoern C. Schaefer
+STEMax
+Jeff Cox 
+Trevor Ratliff 
+Matt Henley 
+Fran\8dois VALETTE 
+Rob Saunders 
+Mike Luethi 
+Rami Aubourg-Kaires 
+Matthew Thomas 
+Allan Jacobsen 
+Adam Lowe 
+David Hostetler 
+Lo\95c Vigneras 
+Dan Reiland 
+Pedro D\92az del Arco 
+Pierre Beyssac 
+Chris Davey 
+YOSHIAKI Nishino 
+Cyber Perk 
+Fabrizio Cali 
+Harunobu Yoda 
+Gerrit Jan Baarda
+LarstiQ
+Ico Doornekamp 
+Emiel den Biesen
+Willem Zwarthoed 
+Carl Giesberts 
+Buzz
+lieve vanderschaeve 
+Margreet de Brie
+hans verwaal 
+Saskia van Dijk
+Martin Gosch 
+Alexander Konopka 
+Thomas Gebert 
+Gerard de Vries
+Hans Lambermont 
+Kim Beumer 
+Kay Thust 
+Alexander Jung 
+Tony Corlett 
+Olivier Thouverey 
+Hideo Nomoto 
+Giel Peters 
+Ray Poynter 
+Edoardo Galvagno 
+Pim Feijen 
+Hua-lun Li 
+William Reynish 
+Bryan Carpenter 
+Jim Scott 
+NGUYEN Fabien 
+Dave Stone 
+Andy Kugyelka 
+Andrew Ross 
+MerieJean-Christophe
+Marko Mestrovic 
+Jack
+Lars Gunnar West
+Wile E. Coyote
+Rick Clark 
+Carlos A. Duque
+Franck Barnier 
+Matt Shirley 
+Viktor Zacek 
+Peter Williamson 
+Chema Celorio 
+Paul Cleveland 
+Guo-Rong Koh 
+Andrew Potter 
+Daniel Smeltzer 
+Cativo
+Dmitri Bichko 
+Jeremy Brinkley 
+Stephen Saville 
+Michael Proto 
+Kurt Korbatits 
+Ruan Muller 
+Mike Beggs 
+Beat Schiess 
+Sven Marcel Buchholz
+Enrique Monfort 
+Simon Posnjak 
+Steven Ahkim 
+theGyre
+William Marble 
+Allen Smith 
+Joshua SS Miller
+Mike Edwards (PinkFreud)
+Mark D. Butala
+Auriea Harvey&Michael Samyn
+Randy Newman 
+Leslie Spring 
+Marc Schefer 
+Dean Edmonds 
+David Whitehouse 
+Tim Humphrey 
+Phillip Richdale 
+Jason McHugh 
+Claudio de Sario
+Artur Kedzierski 
+Richard Garcia 
+Isaac Rivas Alvarez
+Kiernan Holland 
+Holger Malessa 
+Masanori Okuda 
+Andrea Maracci 
+Kai-Peter B\8ackman 
+Gregg Patton 
+Luis M Ibarra
+Julian Green 
+Christian Bender 
+Mark Winkelman 
+Ebbe L. Nielsen
+Carlos Orozco 
+magnetHead
+Kr\9fckel Oliver 
+Thomas Ingham 
+Wes Devauld 
+Uwe Steinmann 
+Jesus Gonzalez 
+DenMeridiS
+Marc Hofer 
+Marko Mestrovic 
+Leslie Owen Everett
+Knut Bueltemann 
+Eric Garaventa 
+Wolfram Schwenzer 
+Edwin Brouwer 
+mauro ujetto 
+Franck Vibert 
+Daniel Pacheco 
+Justin Shumaker 
+Steve Wallace 
+Forensic Engineering Inc.
+Steve Mackay 
+NDNWarrior
+Christopher Gray 
+Darius Clarke (Socinian)
+Jean-S\8ebastien SEVESTRE 
+Douglas Fellows 
+Craig Symons 
+Quincin Gonjon 
+Brian B. Kelley
+Kie Brooks 
+Scott Whitney 
+kwbrads
+Keijiro Takahashi 
+Geno Ruffalo 
+Zzeb
+Peter Dohnt 
+Jeff E Schram
+ernst bunders 
+Nobutoshi Shigemori 
+Mariano Aured 
+Rab Gordon 
+Kurt Maurer 
+Ron Cavagnaro (doogs)
+Johan Bjorklund 
+Cyril M. Hansen
+JOSEPH GRACI 
+Rafael Rubio 
+fabrice meynard 
+Emilio Aguirre 
+Mark Lewis 
+Markus Q. Roberts
+Christoher Bartak 
+Peter Truog 
+Eric Dynowski 
+Philipp G\9fhring 
+Pierre-Yves RANNO 
+Jason Nollan (Cluh)
+Launay Jean-Claude 
+Wayne Buckhanan 
+Jan Magne Landsvik
+Douglas Dragan Njegovan
+Brian David Hale
+Randal Walser 
+Matthew A. Nicholson
+Thomas
+Phillip Kinsley 
+Jerome Zago 
+David Rosky 
+TROJANI Cedric 
+David Polston 
+Patrick Mullen 
+Tetsuya Okuno 
+Bodo J\8ager 
+Leon Brooks 
+Cedric Adjih 
+Michael L. Fisher
+Dan Tomalesky 
+Sky Schulz 
+Scott Brickert 
+James Purdon 
+Miles Langham 
+N Yiannakoulias 
+Stephen Swaney 
+www.artwave.nl
+Take Vos 
+sspickle
+Denis Oliver Kropp
+Gustavo
+rodgers whittington jr
+George Dvorak 
+Norman J Davis, Jr. 
+Javier Velazquez 
+John Tougas 
+John Howland 
+Steve Organek 
+Jano Lukac 
+David Cardon 
+Mick Balaban 
+Michael Kaufman 
+Viper Expo 
+Chassoulier
+Sjoerd Zaalberg van Zelst 
+B. Douglas Hilton
+Benoit CANTAGREL 
+Kai Fischer 
+Mark Osborne 
+Michael Hollenbeck 
+iconjunky
+luca de giorgi
+Jonathan Mullen 
+Javier Fernandez-Ivern 
+Reuben Burgess 
+Olivier Scalbert 
+claudio luis Rogers
+Jeremy Peterson 
+Mark Streutker 
+Lourens Veen 
+Neil Davis 
+John McGurk 
+Stephen Teegarden 
+Dave LeCompte 
+Michael Lang 
+Mortal_Enemy
+Arigo Stanescu 
+Vincent Stoessel 
+Adrian Virnig 
+Chris Dixon 
+Travis Cole 
+M\8crten M\8crtensson 
+Evan Scott 
+Mark Coletti 
+Ken Burke 
+Karl Holland 
+ScRaze
+Wilco Wilbrink 
+chris montijn 
+Michael Wagenmann 
+Viktor Pracht 
+henrik wilming 
+Jim Evins 
+Christophe Massaloux 
+Marc Sommer 
+Luc Stepniewski 
+Eric M. Clark
+Iain Russell 
+Thomas Bleicher 
+Anthony Zishka 
+Jefferson Dubrule 
+Esa Piiril\8a 
+Bill Thiede 
+William Anderson 
+Alexander Kittel 
+Joe Tennies 
+Sam Cable 
+Christian Peper 
+Joshua Frederick 
+Steve Sutton 
+Pete Toscano 
+Michael Zucchi 
+Peter Degenhardt 
+Horizont Entertainment 
+Olivier Bornet 
+Richard D. Laudenslager
+sha
+John DiLauro 
+John Miller 
+Frederic Crozat 
+Matt Welland 
+Paul Calc\8e 
+Joe Prochilo 
+Justin Shafer 
+Joe Croft 
+Detlef Mueller 
+Raschbacher Thomas 
+Alain Gallo 
+Phuoc Ngo 
+Krabat
+Derek Harmison 
+S\8ebastien Devine 
+Kenneth P. Stox
+Wade Felde 
+Kai Groshert 
+Michael Soibelman 
+janine dalisda-davis 
+Philippe Raxhon 
+Daniel Sheridan 
+Michael Pressler 
+Daniel Lundqvist 
+Tim Oertel 
+James Ahlschwede 
+William Henstrom 
+PETIT-PHAR Patrice 
+Marc-Aurele DARCHE 
+Wei-ju Wu 
+Robert Wilson 
+Gerald Severs 
+Alejandro Conty Estevez
+Tetsuya Yatagai 
+David Dolder 
+Luigi Cristiano 
+Posse Press / Romain Canonge
+Vania Smrkovski 
+Bartosch Pixa 
+Dr. Jens Rosenboom
+Gunnar Stahl 
+Robert Kroeger 
+Martin Forisch 
+Guillermina Manon 
+Randal D. Adams
+Kevin Reagh (kevin3D)
+Wolfgang K\9fhn 
+BEAUSOLEIL Arnaud 
+Stan Jakubek 
+Klaus Brand 
+Holger Mueller 
+Fankhauser
+Jon McCallum 
+Rob Olsen 
+Joel Davis 
+Kenneth Bledsoe 
+James F. Campanella
+Jens Kilian 
+wim hendrix 
+Karri Kaksonen 
+Luis Roldan 
+Jason L. Shiffer
+Jacco Marks 
+Dale Schoeck 
+Agustin Catalan 
+A. T. Meinen
+Kamiel Wanrooij 
+Samuel Seay 
+Mike Schaudies 
+Robert Sherwood 
+Fernando Villalon Panzano
+J\9arg Roschke 
+Carl Symons 
+Peter Pichler 
+Alan Heckart 
+seth nagy 
+pelletier
+Jeff Kowalczyk 
+LIONEL ALLORGE 
+Bhishma Patel 
+Richard Rowell 
+Barbara Seaton 
+Aschwin van der Woude 
+William J Black
+Kars Meyboom 
+Glen Nakamura 
+Jim Belcher 
+Tim Scott 
+mea van amstel
+Robert-Reinder Nederhoed 
+Neil Hunt 
+WizardNx
+Brad Choate 
+scott schoen 
+Dan Merillat 
+Martin Krueger 
+Samuel Greenfeld 
+Damon Tkoch 
+Colin Millar 
+Mike Roseman 
+Patrick Trussell 
+Hans-Peter Bock 
+Daniel Haertle 
+Wiremu Te Kani
+Joep Mathijssen 
+LATRY
+Witold Hazuka 
+geoff marshall 
+dave howard 
+Jan Zielinski 
+Fernando Buelna Sanchez
+Timo Mihaljov 
+Allard Willem van den Brul
+T.J.T van Kooten
+Thijs van der Vossen 
+Antonio de Santis
+Jama Poulsen 
+Robert Emanuele 
+Timothy Lord 
+Tom Parker 
+Jarrod Willard 
+Leon Merts 
+Tom Dow 
+Eric Anholt 
+mercier
+Marc van Kempen
+wim van hoydonck
+Joe Hacobian 
+Jose Luis Fresquet Febrer 
+toni calmardo 
+Sam Littlewood 
+Charles Wardlaw 
+Javier Rodriguez 
+Michael C. Schwab
+Corey Bell 
+Emmanuel Preveraud de La Boutresse
+Davide Desogus 
+Larry Phillips 
+Marko Teiste 
+John Roesink 
+Legrand Johan 
+Jeff Boody 
+James Turner 
+Peter Petrakis 
+Ravi Ravindran 
+dickie
+Rene Geerlings 
+Richard Braakman 
+Arthur Frenslich 
+Carsten Schmidt 
+Ronny Martin 
+Erwin Kuiper 
+Lopez-Garcia, Juan-Carlos 
+Rau, Bernhard 
+Stephen Uithoven 
+Ken Beyer 
+Matjaz Jakopec 
+Eckhard M. J\8ager
+Mike Siebach 
+John Harger 
+Justin W. Carper
+Markus Weber 
+Elena Grandi 
+Arndt Heuvel 
+Miguel Cancela Da Fonseca 
+Kirk Lancaster 
+Phillip Elliott 
+Chris Halsall 
+Andre Voitel 
+benjamin scheers 
+Robinder S. Bains
+David Brunton 
+David Brown 
+Craig Duncan 
+du Song 
+Ben Wart 
+Eryk Kedzierski 
+Ronald Hayden 
+Raymond de Vries
+David Johnson 
+Kenichi Fujihiro 
+WANG
+Chris Weber 
+Christian Lehmann 
+DENDIEVEL Stephane 
+Bryan Jaycox 
+Karl Bartel 
+Ralph Howes 
+Matthew J. Stott
+Omar Priego 
+\81ke Westerstr\9a
+Imago Viva 
+James E Hill
+Rune Myrland 
+James Hill 
+Nick
+Ramiro Santos 
+Giuseppe Chiesa 
+Philippe Ney 
+Tom Woodyard 
+Jim Gray 
+Jim Newman 
+Robert I Black III 
+Peter Marouelli 
+Ian Roberts 
+Guy Van Rentergem
+Jose Luis Perez Rubio 
+Gabriel Mainberger 
+Klein Poelhuis 
+Luke Sargeant 
+Edomaur
+robert stok 
+Karl J. Smith
+Harry Splinter 
+Paul Boese 
+Dave Mata 
+piet visser 
+Nicolas Christin 
+Erik Zidowecki 
+Markus Michael Egger
+Edward R. Helwig
+Alyx Flannery 
+raphael betemps 
+Masahiro Takahata 
+Claude Bilat 
+Mario Palomo 
+Neipi
+Grethus Bode 
+Jan M\9fller 
+Mark Pearson 
+Stanislav Osicka 
+DataCare Solutions AG
+Russell Elliott 
+Antonio Campos 
+bordeaux samuel 
+Herman Vereycken 
+Sergio Avila 
+George Dobrozemsky 
+Ocie Mitchell 
+Ryuuji Kusajima 
+Nick Austin 
+Edward Wei 
+Gregg Tavares 
+Aaron Bredon 
+Hideki Suzuki 
+josef radinger 
+Robert Friemer 
+J\9arg Zastrau 
+Burton Bicksler 
+Kimmo M\9as\9a 
+Robert F Johnson
+Mark Johnson 
+Avi Bercovich 
+Mike Armitage 
+Roy Jones 
+Kathleen Sinnott 
+Per-Erik Westerberg 
+Reid Ellis 
+Phillip J. Birmingham
+Ken Jordan 
+Duffaud
+Marco Ardito 
+Simon Suter 
+Tobias Huelsdau 
+Winfried Engl\8ander 
+Stephen Groundwater 
+Joel Ray Holveck
+Mag. Tibor Rudas
+Hartmut Wolf 
+Douglas Jones 
+brett hartshorn 
+Beat M\8agert 
+Javon Prince 
+bri
+James Klicman 
+Harvey Fong 
+jeroen v.d. Meulen
+Wim Vandersmissen 
+Carlos Moreno Rodr\92guez
+Trausti Kristjansson 
+Larry Snyder 
+olivier
+jip
+Thomas Hintz 
+Daan van der Munnik 
+gideon
+jared
+Erick I. Jimenez Alvarado 
+John Martinez 
+Daniel Stephens 
+Alaric Haag 
+Michael Edwards 
+Sam Tregillus 
+Joe Pribele 
+Jeffry Archambeault 
+robert schiffers 
+shane smith 
+elout de kok
+Felix Esser 
+Dietrich Lange 
+Richard Clark 
+errol garner 
+Jose M Cerqueira Esteves 
+Jeroen Janssen 
+Sven Meyer 
+Mike Bayer 
+Arash Vahdat 
+Bernd Hoppe 
+Tobias Geiger 
+Ronnie Stevens 
+W. van Ophoven
+Artem Baguinski 
+Peter Morse 
+Nicholas Phillips 
+Leo Mannhart 
+philippe eygonnet 
+Hans Klerk 
+wes uchida 
+Guido Winkelmann 
+Doug Ferguson 
+Robert Lindsay 
+John Lovgren 
+Rogers Cadenhead 
+Philippe Crassous 
+Dirk Krause 
+lexpattison
+Fred Roberts 
+Njin-Zu Chen 
+GUILLON Marc 
+Felix Klock 
+Ernesto Salas Rodr\92guez
+Pavel Roskin 
+Jaap
+Stefan Maass 
+Adam Bower 
+Gary Thomas 
+Chris Gottbrath 
+seyssel claude 
+Chris Winberry 
+Chip Collier 
+Balint Reczey 
+Nuno Sucena Almeida
+Landon Bradshaw 
+Chua Mei Ling
+JC Hythloday 
+Dustin Knie 
+artshow
+Ralf Gauglitz 
+Ted Schundler 
+Bernard Hurley 
+delerue
+Dirk Behrens 
+Doc Holiday 
+Wouter Kerkhoven 
+Andreas B\9fttner 
+James Black 
+Nicholas Ward 
+David Oberbeck 
+The Shizit 
+Erich Moog 
+James Amendolagine 
+Alex Penner 
+Dieter Finkenzeller 
+giol franco 
+Tobias Regenbrecht 
+Ryan Dewalt 
+Spencer Cathey 
+Benoit SERRA 
+System Impuls 
+Jason Tranter 
+macherb
+LCC Consulting AG
+Ivan So 
+Cori Verschoor 
+Henauer Pascal 
+Chris Bilderback 
+Eddie Sheffield 
+DEHEN Pierre 
+henk van den toorn 
+Ian Whitworth 
+Ruud H.G. van Tol 
+Pierre Lo Cicero
+Srinivas Digumarty 
+digitalvelocity¨
+Alan J Booth
+Tony OBrien 
+Douglas Toltzman 
+Christophe BOUCHET 
+Paul Robertson 
+SCHNEIDER Philippe 
+Jason Cunliffe 
+Dick Damian 
+Charles Hakari 
+jeff knowlton 
+Kevyn Shortell 
+robin
+Craig Spitzer 
+Jeffrey Van Ness
+Lucas Vergnettes 
+Wolfgang Michaelis 
+Luis Jim\8enez Linares
+Julian Eden 
+Ms Lilo von Hanffstengel 
+Kurt B. Kaiser
+Mark Ping 
+Comb\8ee
+Diego Matho 
+MELIN Philippe 
+Damian Sobieralski 
+Luigino Masarati 
+Leonard Wikberg III
+Tom Howsman 
+Christopher R Marquard
+Claus Munk 
+Chris D'Iorio 
+Graphics Solutions Pty Ltd 
+Bernd Stein 
+Jose Angel Vallejo Pinto 
+Matthew William Turner
+Kelly A. Flinn
+Hai T. Nguyen
+Tim Formica 
+Kevin Purrington 
+Andreas Lindenblatt 
+Brian Musker 
+Diego Silvio Novo
+Close Pierre-Yves 
+Wayne Pierce 
+Hattan Lee 
+Didier PEYRET 
+Jacquelin GAZEAU 
+Kenneth Balmer 
+Robert Hwang 
+Gaertner, Klaus 
+Peter Gumieniak 
+Simon Pigot 
+Ian Thompson 
+Jason Southwell 
+Stephan
+Robert Kuehn 
+IUT Mesures Physiques:gilbert Garnier CAEN France 
+Nigel I Phillip
+powermacg4
+Joan Touzet 
+Mike Mormando 
+katsuhiko ebisawa 
+Baheux Tony 
+Randi Joseph 
+Rick Comeau 
+michiel van der kley 
+Thijs Seelen 
+Robert Roos 
+ton
+david seccombe 
+Joshua Eckert 
+Joshua Newman 
+Paolo Sammicheli 
+Gentilini Bruno 
+Martin Herren 
+STRAPPAZON Mathias 
+Steven Gibbs 
+Florian Kruesch 
+Wesley Blijlevens 
+Fabianne Balvedi 
+Colin Henry 
+Mark Deepak Puttnam
+LE GOULVEN 
+evolutie
+Stephane Portha 
+Robert Gentner 
+David B. Camhy
+Ren\8e Foucart 
+Coyok Drio 
+Mark Ng 
+klein michael 
+Antonin Kral 
+Edward Jomisko 
+Wouter de Mik
+Matteo De Simone
+Gal Barak 
+Thomas Dyar 
+Nathan Allworth 
+Dean Giberson 
+Larry Cummings 
+Eric Augustine 
+IngieBee
+Michael Velikanje 
+Andre M. Czausov
+H@dj
+Thorsten Burghaus 
+Renzo Lauper 
+Martin White 
+Ferdinand Strixner 
+Neil Mannall 
+Maxime Wacker 
+Gal Buki 
+Rene Christen 
+Andreas Neukoetter 
+DAVID JOHNSON 
+John Walton 
+Volker Mische 
+Michel Vilain 
+Luigi/Blender Brasil 
+Clifton A. Cross
+Kent B. Mein (SirDude)
+Anne Postma 
+Matt Runion 
+Bob Tackett 
+stanislas nanchen 
+Jorge Monteiro 
+S68
+Ville Kaajakari 
+Adrien Rebollo 
+Al Curatolo 
+Frank Rutten 
+Dierk Dohmann 
+Roel Spruit 
+Rob Coldwell 
+Yann Vernier 
+Haunt_House (PH) 
+Ravinder Singh Bhara
+Erik Augustijns 
+Ryan Earle Freckleton
+Andreas Sturm 
+matt mullin 
+MOREAUX Denis 
+Brendan Stromberger 
+Hideki Saito 
+Christian Ullrich 
+Courty Didier 
+Steve Newton 
+Brecht Van Lommel
+Jasper Op de Coul 
+Stuart MacKinnon 
+Dietrich Dietz - the IMaGiNation project (IMGN)
+Tina Hirsch 
+John R Thorp
+Fr\8ed\8eric Bouvier 
+LINETTE
+Felix Rabe 
+Chay Adamou 
+nick harron 
+stephen john ford
+Kino
+Daniel Sj\9alie 
+Matthias Derer 
+Alain VALLETON 
+Kervin Pierre 
+Mike Laughton 
+Frank van Puffelen
+Andreas Dluzewski 
+Christofer Edvardsen 
+Maciek Szczyglowski 
+Rakesh Ravuri 
+Robert Schouwenburg 
+Bob Bayens 
+Devas73
+Mika Saari 
+Robert Ives 
+Adam McBride 
+IAN ROSS 
+Uriah Liggett 
+stefan fischer 
+Didac Miro 
+Tim Barlow 
+G. T. Blackwell
+Tim Weaver 
+Dalet
+Erwin Vervacke 
+Benjamin Eduardo Rodriguez Berumen 
+Ozono Multimedia s.l.l.
+James Kersey 
+Michael DeLuca 
+Mark Swann 
+Andreas Altenburger 
+John Smith 
+Simon de Haan
+David Gregory 
+Harald Krummeck 
+E Warren McNee
+Marc-Andre Levesque 
+Satoshi Yamasaki 
+Rolf-Dieter Klein 
+J. Deetman 
+Helge Walter 
+Roland Str\8clberg 
+Nicolas Morenas (Caronte)
+Simon Clarke 
+Maigrot Michel 
+Rod Robinson 
+Kevin Cozens 
+Germ\87n Alonso (taz)
+Martin Stegeman 
+Henrik Jordfald Olsen
+Mitchell Skinner 
+Michael Lei 
+Spiridon G. Kontarakis
+Bas Denissen 
+Loic Dachary 
+Michael Rutter 
+Thorsten Schl\9fter 
+hijothema
+Andreas Hauser 
+Holger Haase 
+Danilo Duina 
+Matthias Thurau 
+Flavio Curti 
+Ian Beardslee 
+Cristina Lozano Ballester
+Jason Roberson 
+Victor Lim 
+andreas palsson 
+Richard Charvat 
+James Ezell 
+Florian Eggenberger 
+John J. Marshall
+Paul Lunneberg 
+Peter Wolkerstorfer 
+Gerhard Siegesmund 
+Nat Budin 
+NDNChief
+Dave Leeak 
+Michael Siebecker 
+Jan Walter 
+John Aughey 
+Corey Rice 
+Darren F. Coolen
+tony principali 
+Joe Kimmes 
+Pekka Karvonen 
+Rick Kimball 
+Christopher Capoccia 
+Bertram Zeller 
+Vanpoucke Alexandre 
+Bassam Kurdali 
+Michael Baker 
+Michael Schwemmle 
+Ford "fullback" Roberts
+Lama Angelo 
+Kevin Roeder 
+oliv
+pinhead_66
+Zach Millis 
+Ryan C. Stallings
+Adam LaJeunesse 
+Satish Goda 
+Erik Haagsman 
+Lorenzo Moro 
+Nathan Letwory 
+stephan f. haupt
+Alex Papadopoulos 
+Gianluigi Berrone 
+andrea casentini 
+David Randall Simpson
+Jason Oppel 
+Mark Bloomfield 
+Alexander Ehrath 
+Owen Swerkstrom 
+Aurelio Caliaro 
+Karsten Dambekalns 
+Eddy MOUSSA 
+Bernd Roetter 
+Roland Hess 
+Luis Eduardo P. Gervasio 
+Pierre-Luc Robert (bedsitter)
+Andreu Cuartiella 
+Nathan Vegdahl 
+Scott Ross 
+Jacob Kafka 
+Mario Bolte 
+Wolfgang Draxinger 
+Starr Kline 
+John Lullie 
+Chiffi Cosimo 
+Morgan McMillian 
+Stefan H\9fbner 
+Loic de MONTAIGNAC
+Andr\8es Castillo 
+Francesco Anselmo 
+Ingo Guenther 
+James C. Davis, Jr. 
+Claudio Andaur 
+Caleb Williams 
+Orest Dubay 
+Adam Casto 
+David
+Joost Burger 
+Ken Hahn 
+Mark Herring 
+Stig Oeveraas 
+Robert Rainthorpe 
+Martin Middleton 
+Simon Sedgwick 
+Joseph Firestine 
+Miguel Melo 
+Wooster Dennis 
+Gary Lucas 
+Johannes Schwarz 
+Mark Dalton 
+Mike Norton 
+Michael Schardt 
+jean-michel soler 
+Chris Bracewell 
+Ross Dawson 
+Tim De Graeve
+Adam Wiseman 
+Luiz Olsson Barbosa
+Donna Carey 
+Auke van Balen
+Mike Birdsong 
+Martin Curran 
+Shawn M. Murray
+Roy Simmons 
+Malik
+Teguh Pangestu 
+Mats Holmberg 
+Julien Jehannet 
+Michael A. Nelson
+Axel Cushing 
+erik vogan 
+Datenflug GmbH 
+KC Roeyer 
+Ryan J. Parker
+Robert E. Meuse
+Alex Heizer 
+Netsail Ltd / Mats Holmberg
+Jonathan Lawman 
+Seikoh Hokama 
+Perry Faulkner 
+Will Hanson 
+Lyubomir Pavlov Kovachev
+Ennio Quattrini 
+Marcelo "xfer" Alves
+Joseph Winston IV
+Jorge Otero Rueda
+Timothy Murakami 
+Matthew Johnson 
+Erik Rombouts 
+Petr Vlk 
+Thomas Dammann 
+Henrik Turkerud 
+Erlend Hamberg 
+Arnaud Lebegue 
+Kevin O'Brien 
+Michael Buettner 
+Engel A. Sanchez
+Alexander Hilgert 
+FAUGE Thierry 
+Wulf Huesken 
+John M. Adams
+Dell'Aiera Pol 
+Waylena McCully 
+Russell Smith 
+Luke Titley 
+marinus meijers 
+Henry Kaminski 
+Alistair Riddoch 
+Daniel N\9fmm 
+Matthew Meadows 
+Bjoern Paschen 
+Paul Fredrickson 
+Gavin Baker 
+Jan Illetschko 
+Aaron C. McLeod
+Thomas Muldowney 
+Cheyenne Cloud, LLC
+Helmut A. Goettl
+Martin A. Boegelund
+Beno\94t Cousson 
+Scott Brooks 
+Ferlet Patrice 
+Aaron Porterfield 
+Ivan Florentin 
+Scott Isaacson 
+Rui Paulo Sanguinheira Diogo 
+Jason Saville 
+Active-Websight GbR 
+Bryon Roche 
+Gustavo Mu\96oz 
+Christopher Gillanders 
+Phil Frost Tate
+Gilles Gonon 
+Kay
+James C. Franklin
+Luis Enrique Caama\96o Navas 
+Alexander "estartu" Felder
+Marc Ledermann 
+vrijschrift.org
+Holger Weihe 
+Peter Cammaert 
+Andres Meyer 
+Tony Arnett 
+Adam Hughes 
+Tony Farley 
+Dmitriy Teresh 
+Maickel Swart 
+Peter den Bak
+Steve Bennett 
+Romain Rubi 
+John Bolt 
+Michael Gaston 
+Philip Brown 
+Wasi
+Mike Hirst 
+Lloyd J Robinson, Jr 
+Charles Rinker 
+Nick Vogtmann 
+Frank van Beek
+Bruce Mitchener 
+ROBERTO A. RUIZ VIAL 
+Maurizio Sibaud 
+Ron Bolger 
+Nathan Parton 
+Andrew Fry 
+VINCENT St\8ephane 
+Yan Yan 
+Justin L Graham
+Wade Beasley 
+Salvador Mata Rodriguez
+Jan Tiemersma 
+Luis A. R. Fernandez 
+Jacob Moy 
+Stefano Francesi 
+Jochen Hanne 
+David Stephenson 
+Brent O'Dell 
+Mike Kasprzak 
+Tom Thompson 
+David Fung 
+Radoslav Dejanovic 
+James H. Cloos, Jr. 
+Karl Erlandsen (LethalSideParting)
+Kari Pulli
+Dave Shemano
diff --git a/doc/blender.1 b/doc/blender.1
new file mode 100644 (file)
index 0000000..43ac563
--- /dev/null
@@ -0,0 +1,338 @@
+.TH "BLENDER" "1" "June 27, 2010" "Blender Blender 2\&.52 (sub 5) "
+
+.SH NAME
+blender \- a 3D modelling and rendering package
+.SH SYNOPSIS
+.B blender [args ...] [file] [args ...]
+.br
+.SH DESCRIPTION
+.PP
+.B blender
+is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
+
+Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
+
+http://www.blender.org
+.SH OPTIONS
+
+Blender 2.52 (sub 5) Build
+Usage: blender [args ...] [file] [args ...]
+.br
+.SS "Render Options:"
+
+.TP
+.B \-b or \-\-background <file>
+.br
+Load <file> in background (often used for UI\-less rendering)
+.br
+
+.TP
+.B \-a or \-\-render\-anim
+.br
+Render frames from start to end (inclusive)
+.br
+
+.TP
+.B \-S or \-\-scene <name>
+.br
+Set the active scene <name> for rendering
+.br
+
+.TP
+.B \-f or \-\-render\-frame <frame>
+.br
+Render frame <frame> and save it.
+.br
++<frame> start frame relative, \-<frame> end frame relative.
+.br
+
+.TP
+.B \-s or \-\-frame\-start <frame>
+.br
+Set start to frame <frame> (use before the \-a argument)
+.br
+
+.TP
+.B \-e or \-\-frame\-end <frame>
+.br
+Set end to frame <frame> (use before the \-a argument)
+.br
+
+.TP
+.B \-j or \-\-frame\-jump <frames>
+.br
+Set number of frames to step forward after each rendered frame
+.br
+
+.TP
+.B \-o or \-\-render\-output <path>
+.br
+Set the render path and file name.
+.br
+Use // at the start of the path to
+.br
+    render relative to the blend file.
+.br
+The # characters are replaced by the frame number, and used to define zero padding.
+.br
+    ani_##_test.png becomes ani_01_test.png
+.br
+    test\-######.png becomes test\-000001.png
+.br
+    When the filename does not contain #, The suffix #### is added to the filename
+.br
+The frame number will be added at the end of the filename.
+.br
+    eg: blender \-b foobar.blend \-o //render_ \-F PNG \-x 1 \-a
+.br
+    //render_ becomes //render_####, writing frames as //render_0001.png//
+.br
+
+.TP
+.B \-E or \-\-engine <engine>
+.br
+Specify the render engine
+.br
+use \-E help to list available engines
+.br
+
+.IP
+
+.SS "Format Options:"
+
+.TP
+.B \-F or \-\-render\-format <format>
+.br
+Set the render format, Valid options are...
+.br
+    TGA IRIS JPEG MOVIE IRIZ RAWTGA
+.br
+    AVIRAW AVIJPEG PNG BMP FRAMESERVER
+.br
+(formats that can be compiled into blender, not available on all systems)
+.br
+    HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS
+.br
+
+.TP
+.B \-x or \-\-use\-extension <bool>
+.br
+Set option to add the file extension to the end of the file
+.br
+
+.TP
+.B \-t or \-\-threads <threads>
+.br
+Use amount of <threads> for rendering in background
+.br
+[1\-BLENDER_MAX_THREADS], 0 for systems processor count.
+.br
+
+.IP
+
+.SS "Animation Playback Options:"
+
+.TP
+.B \-a <options> <file(s)>
+.br
+Playback <file(s)>, only operates this way when not running in background.
+.br
+    \-p <sx> <sy> Open with lower left corner at <sx>, <sy>
+.br
+    \-m Read from disk (Don't buffer)
+.br
+    \-f <fps> <fps\-base> Specify FPS to start with
+.br
+    \-j <frame> Set frame step to <frame>
+.br
+
+.IP
+
+.SS "Window Options:"
+
+.TP
+.B \-w or \-\-window\-border
+.br
+Force opening with borders (default)
+.br
+
+.TP
+.B \-W or \-\-window\-borderless
+.br
+Force opening with without borders
+.br
+
+.TP
+.B \-p or \-\-window\-geometry <sx> <sy> <w> <h>
+.br
+Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>
+.br
+
+.IP
+
+.SS "Game Engine Specific Options:"
+
+.TP
+.B \-g Game Engine specific options
+.br
+\-g fixedtime Run on 50 hertz without dropping frames
+.br
+\-g vertexarrays Use Vertex Arrays for rendering (usually faster)
+.br
+\-g nomipmap No Texture Mipmapping
+.br
+\-g linearmipmap Linear Texture Mipmapping instead of Nearest (default)
+.br
+
+.IP
+
+.SS "Misc Options:"
+
+.TP
+.B \-d or \-\-debug
+.br
+Turn debugging on
+.br
+
+.IP
+* Prints every operator call and their arguments
+.br
+* Disables mouse grab (to interact with a debugger in some cases)
+.br
+* Keeps python sys.stdin rather then setting it to None
+.br
+
+.TP
+.B \-\-debug\-fpe
+.br
+Enable floating point exceptions
+.br
+
+.IP
+
+.TP
+.B \-nojoystick
+.br
+Disable joystick support
+.br
+
+.TP
+.B \-noglsl
+.br
+Disable GLSL shading
+.br
+
+.TP
+.B \-noaudio
+.br
+Force sound system to None
+.br
+
+.TP
+.B \-setaudio
+.br
+Force sound system to a specific device
+.br
+NULL SDL OPENAL JACK
+.br
+
+.IP
+
+.TP
+.B \-h or \-\-help
+.br
+Print this help text and exit
+.br
+
+.IP
+
+.TP
+.B \-y or \-\-enable\-autoexec
+.br
+Enable automatic python script execution (default)
+.br
+
+.TP
+.B \-Y or \-\-disable\-autoexec
+.br
+Disable automatic python script execution (pydrivers, pyconstraints, pynodes)
+.br
+
+.IP
+
+.TP
+.B \-P or \-\-python <filename>
+.br
+Run the given Python script (filename or Blender Text)
+.br
+
+.TP
+.B \-\-python\-console
+.br
+Run blender with an interactive console
+.br
+
+.TP
+.B \-v or \-\-version
+.br
+Print Blender version and exit
+.br
+
+.TP
+.B \-\-
+.br
+Ends option processing, following arguments passed unchanged. Access via python's sys.argv
+.br
+
+.SS "Other Options:"
+
+.TP
+.B /?
+.br
+Print this help text and exit (windows only)
+.br
+
+.TP
+.B \-R
+.br
+Register .blend extension (windows only)
+.br
+
+.SS "Argument Parsing:"
+
+    arguments must be separated by white space. eg
+        "blender \-ba test.blend"
+    ...will ignore the 'a'
+        "blender \-b test.blend \-f8"
+    ...will ignore 8 because there is no space between the \-f and the frame value
+.br
+.SS "Argument Order:"
+
+Arguments are executed in the order they are given. eg
+        "blender \-\-background test.blend \-\-render\-frame 1 \-\-render\-output /tmp"
+    ...will not render to /tmp because '\-\-render\-frame 1' renders before the output path is set
+        "blender \-\-background \-\-render\-output /tmp test.blend \-\-render\-frame 1"
+    ...will not render to /tmp because loading the blend file overwrites the render output that was set
+        "blender \-\-background test.blend \-\-render\-output /tmp \-\-render\-frame 1" works as expected.
+.br
+.br
+.SH "ENVIRONMENT VARIABLES"
+  \fIHOME\fR Store files such as .blender/ .B.blend .Bfs .Blog here.
+  \fIBLENDERPATH\fR System directory to use for data files and scripts.
+                For this build of blender the default \fIBLENDERPATH\fR is...
+                "/usr/local/share/blender/2.5"
+                setting the \fIBLENDERPATH\fR will override this
+  \fITMP\fR or \fITMPDIR\fR Store temporary files here.
+  \fIPYTHONHOME\fR Path to the python directory, eg. /usr/lib/python.
+.br
+.br
+
+.br
+.SH SEE ALSO
+.B yafaray(1)
+
+.br
+.SH AUTHORS
+This manpage was written for a Debian GNU/Linux system by Daniel Mester
+<mester@uni-bremen.de> and updated by Cyril Brulebois
+<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.
index c5ba1363246cd59fac110130cf162a9ad0bbf30f..774d32ef4a2cf82fe99351ea11685cf8002c309e 100644 (file)
@@ -74,3 +74,4 @@ set(SRC
 )
 
 blender_add_lib(extern_openjpeg "${SRC}" "${INC}")
+
diff --git a/intern/SoundSystem/CMakeLists.txt b/intern/SoundSystem/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9a370af
--- /dev/null
@@ -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): 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/Makefile b/intern/SoundSystem/Makefile
new file mode 100644 (file)
index 0000000..4d346f6
--- /dev/null
@@ -0,0 +1,70 @@
+# -*- 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 = SoundSystem
+SOURCEDIR = intern/SoundSystem
+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
+
+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)
+ifeq ($(OS),darwin)
+       ranlib $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
+endif
+       @../tools/cpifdiff.sh *.h $(NAN_SOUNDSYSTEM)/include/
+
+
diff --git a/intern/SoundSystem/SConscript b/intern/SoundSystem/SConscript
new file mode 100644 (file)
index 0000000..256b790
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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
new file mode 100644 (file)
index 0000000..f8e439a
--- /dev/null
@@ -0,0 +1,354 @@
+/**
+ * $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
new file mode 100644 (file)
index 0000000..c79f62d
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * 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_DependKludge.h b/intern/SoundSystem/SND_DependKludge.h
new file mode 100644 (file)
index 0000000..06d4ec9
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * SND_DependKludge.h
+ *
+ * who needs what?
+ *
+ * $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 HAVE_CONFIG_H
+
+#ifndef NO_SOUND
+
+#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
+
+#endif /* NO_SOUND */
+
+#endif /* HAVE_CONFIG_H */
diff --git a/intern/SoundSystem/SND_DeviceManager.h b/intern/SoundSystem/SND_DeviceManager.h
new file mode 100644 (file)
index 0000000..708db03
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..d6b3936
--- /dev/null
@@ -0,0 +1,343 @@
+/**
+ * $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
+
similarity index 59%
rename from intern/container/CTR_HashedPtr.h
rename to intern/SoundSystem/SND_Object.h
index 0291535d7185c6928ab4533fa3fb5cd932a2a96a..f23827974e3fb2e62f4db9b0a7e1b361ad44c609 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * SND_Object.h
+ *
+ * Abstract sound object
+ *
  * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
@@ -15,7 +19,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * 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): none yet.
  *
  * ***** END GPL LICENSE BLOCK *****
- *
  */
 
-/** \file container/CTR_HashedPtr.h
- *  \ingroup ctr
- */
+#ifndef __SND_OBJECT_H
+#define __SND_OBJECT_H
 
-#ifndef CTR_HASHEDPTR_H
-#define CTR_HASHEDPTR_H
+#include "GEN_List.h"
+#include "MT_Matrix3x3.h"
+#include "SoundDefines.h"
 
-#include <stdlib.h>
-
-inline unsigned int CTR_Hash(void *inDWord)
-{
-       size_t key = (size_t)inDWord;
-       return (unsigned int)(key ^ (key>>4));
-}
+/**
+ *   SND_Object is an interface class for soundobjects, listeners and other
+ *   kinds of sound related thingies. 
+ */
 
-class CTR_HashedPtr
+class SND_Object : public GEN_Link
 {
-       void* m_valptr;
 public:
-       CTR_HashedPtr(void* val) : m_valptr(val) {};
-       unsigned int hash() const { return CTR_Hash(m_valptr);};
-       inline friend bool operator ==(const CTR_HashedPtr & rhs, const CTR_HashedPtr & lhs) { return rhs.m_valptr == lhs.m_valptr;};
-       void *getValue() const { return m_valptr; }
+       SND_Object() {};
+       virtual ~SND_Object() {};
 };
 
-#endif //CTR_HASHEDPTR_H
+#endif //__SND_OBJECT_H
 
diff --git a/intern/SoundSystem/SND_Scene.h b/intern/SoundSystem/SND_Scene.h
new file mode 100644 (file)
index 0000000..bb3ff93
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..2f6a6e8
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..7bd43fb
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..82b7c69
--- /dev/null
@@ -0,0 +1,111 @@
+/**
+ * $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
new file mode 100644 (file)
index 0000000..2c45779
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..75cddfa
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..279eeac
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# $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
new file mode 100644 (file)
index 0000000..0d19dc2
--- /dev/null
@@ -0,0 +1,154 @@
+/*  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
new file mode 100644 (file)
index 0000000..5238507
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * 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/Makefile b/intern/SoundSystem/dummy/Makefile
new file mode 100644 (file)
index 0000000..829135d
--- /dev/null
@@ -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) 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 = DummySoundSystem
+DIR = $(OCGDIR)/intern/$(LIBNAME)
+
+include nan_compile.mk
+
+CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+
+CPPFLAGS += -I$(NAN_STRING)/include    
+CPPFLAGS += -I$(NAN_MOTO)/include
+CPPFLAGS += -I../intern
+CPPFLAGS += -I..
+CPPFLAGS += -I.
diff --git a/intern/SoundSystem/dummy/SND_DummyDevice.cpp b/intern/SoundSystem/dummy/SND_DummyDevice.cpp
new file mode 100644 (file)
index 0000000..672c73e
--- /dev/null
@@ -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 *****
+ * SND_DummyDevice derived from SND_IAudioDevice
+ */
+
+#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_DummyDevice.h"
+
+SND_DummyDevice::SND_DummyDevice()
+{
+}
+
+SND_DummyDevice::~SND_DummyDevice()
+{
+#ifdef ONTKEVER
+       printf("SND_DummyDevice destructor");
+#endif
+}
+
+
diff --git a/intern/SoundSystem/dummy/SND_DummyDevice.h b/intern/SoundSystem/dummy/SND_DummyDevice.h
new file mode 100644 (file)
index 0000000..988f731
--- /dev/null
@@ -0,0 +1,93 @@
+/**
+ * $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/Makefile b/intern/SoundSystem/intern/Makefile
new file mode 100644 (file)
index 0000000..7684b6b
--- /dev/null
@@ -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): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+#
+
+LIBNAME = SoundSystem
+DIR = $(OCGDIR)/intern/SoundSystem
+
+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 += -I..
+CPPFLAGS += -I.
diff --git a/intern/SoundSystem/intern/SND_AudioDevice.cpp b/intern/SoundSystem/intern/SND_AudioDevice.cpp
new file mode 100644 (file)
index 0000000..4a5c0e2
--- /dev/null
@@ -0,0 +1,242 @@
+/**
+ * $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
new file mode 100644 (file)
index 0000000..54e8fee
--- /dev/null
@@ -0,0 +1,115 @@
+/**
+ * $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
new file mode 100644 (file)
index 0000000..0984626
--- /dev/null
@@ -0,0 +1,392 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..089e0d5
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..c4bc887
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..b261442
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..86611b0
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..af1b43a
--- /dev/null
@@ -0,0 +1,544 @@
+/*
+* 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
new file mode 100644 (file)
index 0000000..26163e8
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..7a244b5
--- /dev/null
@@ -0,0 +1,508 @@
+/*
+ * 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
new file mode 100644 (file)
index 0000000..dbc3135
--- /dev/null
@@ -0,0 +1,424 @@
+/*
+ * 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))
+               {
+