Final merge of HEAD (bf-blender) into the orange branch.
authorChris Want <cwant@ualberta.ca>
Sat, 28 Jan 2006 16:35:18 +0000 (16:35 +0000)
committerChris Want <cwant@ualberta.ca>
Sat, 28 Jan 2006 16:35:18 +0000 (16:35 +0000)
Here are my notes on things to look out for as potential problem
spots:

source/blender/blenkernel/intern/displist.c:
+ is initfastshade(void) supposed to be empty? I had
to make it empty to get the merged tree to compile.

source/blender/python/api2_2x/Armature.c:
+ went with the version that had Armature_getLayers()

source/blender/python/api2_2x/Object.c
+ went with the version of Object_getPose() from bf-blender.
(#ifdef 0-ed the other version)

source/blender/python/api2_2x/Pose.[ch]
+ had problems linking due to no Pose_Init() ... copied these
two files straight from bf-blender.

source/blender/src/drawview.c:
+ view3d_panel_properties() had things shifted a few things shifted
a few pixels, otherwise, things were painless

source/blender/src/splash.jpg.c:
+ went with bf-blender version (orange is dead)

source/gameengine:
+ went with bf-blender version -- does not compile due to IMB_rect* stuff,
Ton should look into this.

424 files changed:
SConstruct
bin/.blender/.Blanguages
extern/bFTGL/src/Makefile
extern/bullet/Bullet/BLI_Bullet.dsp
extern/bullet/Bullet/Bullet3_vc8.vcproj
extern/bullet/Bullet/CollisionShapes/OptimizedBvh.cpp
extern/bullet/Bullet/CollisionShapes/SphereShape.cpp
extern/bullet/Bullet/CollisionShapes/SphereShape.h
extern/bullet/Bullet/NarrowPhaseCollision/CollisionMargin.h [new file with mode: 0644]
extern/bullet/BulletDynamics/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp
extern/bullet/BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp
extern/bullet/BulletDynamics/ConstraintSolver/Point2PointConstraint.h
extern/bullet/SConscript
extern/bullet/make/msvc_7_0/Bullet3_vc7.vcproj
intern/SoundSystem/openal/SND_OpenALDevice.cpp
intern/bmfont/intern/BMF_BitmapFont.cpp
intern/boolop/intern/BOP_Face2Face.cpp
intern/boolop/intern/BOP_Interface.cpp
intern/boolop/intern/BOP_Mesh.cpp
intern/boolop/intern/BOP_Mesh.h
intern/bsp/intern/BSP_CSGMesh_CFIterator.h
intern/bsp/intern/CSG_BooleanOps.cpp
intern/elbeem/SConscript
intern/elbeem/intern/blenderdummy.cpp
intern/elbeem/intern/cfglexer.cpp
intern/elbeem/make/msvc_7_0/elbeem.vcproj
intern/ghost/GHOST_ITimerTask.h
intern/ghost/GHOST_IWindow.h
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/iksolver/intern/IK_Solver.cpp
intern/iksolver/intern/TNT/cmat.h
intern/iksolver/intern/TNT/fmat.h
intern/iksolver/intern/TNT/fspvec.h
intern/iksolver/intern/TNT/vec.h
intern/iksolver/intern/TNT/vecadaptor.h
intern/make/msvc_6_0/intern.dsw
intern/opennl/extern/ONL_opennl.h
intern/opennl/intern/opennl.c
intern/string/intern/STR_String.cpp
po/Makefile
projectfiles/blender/BPY_python/BPY_python.dsp
projectfiles/blender/blender.dsw
projectfiles/blender/blenkernel/BKE_blenkernel.dsp
projectfiles/blender/blenlib/BLI_blenlib.dsp
projectfiles/blender/imbuf/BL_imbuf.dsp
projectfiles/blender/radiosity/BRA_radiosity.dsp
projectfiles/blender/render/BRE_render.dsp
projectfiles/blender/src/BL_src.dsp
projectfiles/gameengine/ketsji/KX_ketsji.dsp
projectfiles_vc7/blender/BPY_python/BPY_python.vcproj
projectfiles_vc7/blender/blender.sln
projectfiles_vc7/blender/blender.vcproj
projectfiles_vc7/blender/imbuf/BL_imbuf.vcproj
projectfiles_vc7/blender/makesdna/DNA_makesdna.vcproj
projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
release/Makefile
release/VERSION
release/datafiles/blenderbuttons
release/scripts/Apply_def.py
release/scripts/Axiscopy.py
release/scripts/DirectX8Exporter.py
release/scripts/ac3d_export.py
release/scripts/ac3d_import.py
release/scripts/batch_name_edit.py [new file with mode: 0644]
release/scripts/bevel_center.py
release/scripts/bpymodules/meshtools.py
release/scripts/bpymodules/svg2obj.py
release/scripts/bvh2arm.py
release/scripts/bvh_export.py
release/scripts/bvh_import.py
release/scripts/clean_mesh.py [new file with mode: 0644]
release/scripts/console.py
release/scripts/hotkeys.py
release/scripts/lightwave_export.py
release/scripts/lightwave_import.py
release/scripts/nendo_export.py
release/scripts/nendo_import.py
release/scripts/obj_export.py
release/scripts/obj_import.py
release/scripts/off_export.py
release/scripts/off_import.py
release/scripts/radiosity_export.py
release/scripts/radiosity_import.py
release/scripts/raw_export.py
release/scripts/raw_import.py
release/scripts/save_theme.py
release/scripts/skin.py
release/scripts/slp_import.py
release/scripts/tex2uvbaker.py
release/scripts/truespace_export.py
release/scripts/truespace_import.py
release/scripts/uv_export.py
release/scripts/videoscape_export.py
release/scripts/vrml97_export.py
release/scripts/wings_export.py
release/scripts/wings_import.py
release/scripts/x3d_export.py
source/Makefile
source/blender/Makefile
source/blender/SConscript
source/blender/avi/intern/endian.c
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_bad_level_calls.h
source/blender/blenkernel/BKE_colortools.h [new file with mode: 0644]
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/BKE_displist.h
source/blender/blenkernel/BKE_effect.h
source/blender/blenkernel/BKE_font.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_group.h
source/blender/blenkernel/BKE_icons.h [moved from source/blender/render/intern/include/zbuf_types.h with 57% similarity]
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/BKE_node.h [new file with mode: 0644]
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/BKE_world.h
source/blender/blenkernel/BKE_writeavi.h
source/blender/blenkernel/SConscript
source/blender/blenkernel/bad_level_call_stubs/stubs.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/Makefile
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/colortools.c [new file with mode: 0644]
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/icons.c [new file with mode: 0644]
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/node.c [new file with mode: 0644]
source/blender/blenkernel/intern/node_composit.c [new file with mode: 0644]
source/blender/blenkernel/intern/node_shaders.c [new file with mode: 0644]
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/world.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/BLI_editVert.h
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/BLI_jitter.h [moved from source/blender/include/BSE_buttons.h with 66% similarity]
source/blender/blenlib/SConscript
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/dynlib.c
source/blender/blenlib/intern/jitter.c [moved from source/blender/render/intern/source/jitter.c with 80% similarity]
source/blender/blenlib/intern/rct.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/util.c
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/iff.h
source/blender/blenpluginapi/intern/pluginapi.c
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/SConscript
source/blender/imbuf/intern/IMB_allocimbuf.h
source/blender/imbuf/intern/Makefile
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/amiga.c
source/blender/imbuf/intern/anim.c
source/blender/imbuf/intern/anim5.c
source/blender/imbuf/intern/bitplanes.c
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/filter.c
source/blender/imbuf/intern/imageprocess.c
source/blender/imbuf/intern/iris.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/openexr/Makefile [new file with mode: 0644]
source/blender/imbuf/intern/openexr/SConscript [new file with mode: 0644]
source/blender/imbuf/intern/openexr/openexr_api.cpp [new file with mode: 0644]
source/blender/imbuf/intern/openexr/openexr_api.h [moved from source/blender/render/intern/include/jitter.h with 70% similarity]
source/blender/imbuf/intern/radiance_hdr.c
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/rotate.c
source/blender/imbuf/intern/scaling.c
source/blender/imbuf/intern/targa.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/imbuf/intern/writeimage.c
source/blender/include/BDR_drawobject.h
source/blender/include/BDR_unwrapper.h
source/blender/include/BIF_editarmature.h
source/blender/include/BIF_editgroup.h
source/blender/include/BIF_editmesh.h
source/blender/include/BIF_editnla.h
source/blender/include/BIF_editsima.h
source/blender/include/BIF_glutil.h
source/blender/include/BIF_interface.h
source/blender/include/BIF_interface_icons.h [moved from source/blender/render/intern/include/outerRenderLoop.h with 66% similarity]
source/blender/include/BIF_meshtools.h
source/blender/include/BIF_outliner.h
source/blender/include/BIF_poseobject.h
source/blender/include/BIF_previewrender.h
source/blender/include/BIF_renderwin.h
source/blender/include/BIF_resources.h
source/blender/include/BIF_screen.h
source/blender/include/BIF_space.h
source/blender/include/BIF_spacetypes.h
source/blender/include/BIF_toets.h
source/blender/include/BIF_toolbox.h
source/blender/include/BIF_writeimage.h
source/blender/include/BSE_drawview.h
source/blender/include/BSE_editipo.h
source/blender/include/BSE_filesel.h
source/blender/include/BSE_headerbuttons.h
source/blender/include/BSE_node.h [new file with mode: 0644]
source/blender/include/BSE_sequence.h
source/blender/include/BSE_view.h
source/blender/include/blendef.h
source/blender/include/butspace.h
source/blender/include/interface.h
source/blender/include/mydevice.h
source/blender/include/transform.h
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/DNA_color_types.h [new file with mode: 0644]
source/blender/makesdna/DNA_effect_types.h
source/blender/makesdna/DNA_group_types.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_nla_types.h
source/blender/makesdna/DNA_node_types.h [new file with mode: 0644]
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_world_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/python/SConscript
source/blender/python/api2_2x/Armature.c
source/blender/python/api2_2x/Bone.h
source/blender/python/api2_2x/NLA.c
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/Texture.c
source/blender/python/api2_2x/Types.c
source/blender/python/api2_2x/Types.h
source/blender/python/api2_2x/sceneRender.c
source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/quicktime_export.h
source/blender/radiosity/SConscript
source/blender/radiosity/extern/include/radio.h
source/blender/radiosity/extern/include/radio_types.h
source/blender/radiosity/intern/source/Makefile
source/blender/radiosity/intern/source/radfactors.c
source/blender/radiosity/intern/source/radio.c
source/blender/radiosity/intern/source/radrender.c
source/blender/render/SConscript
source/blender/render/extern/include/RE_pipeline.h [new file with mode: 0644]
source/blender/render/extern/include/RE_render_ext.h [new file with mode: 0644]
source/blender/render/extern/include/RE_shader_ext.h [new file with mode: 0644]
source/blender/render/extern/include/render.h [deleted file]
source/blender/render/intern/include/RE_callbacks.h [deleted file]
source/blender/render/intern/include/envmap.h
source/blender/render/intern/include/errorHandler.h [deleted file]
source/blender/render/intern/include/gammaCorrectionTables.h
source/blender/render/intern/include/initrender.h
source/blender/render/intern/include/pixelblending.h
source/blender/render/intern/include/pixelshading.h
source/blender/render/intern/include/renderHelp.h [deleted file]
source/blender/render/intern/include/render_types.h [moved from source/blender/render/extern/include/render_types.h with 52% similarity]
source/blender/render/intern/include/rendercore.h
source/blender/render/intern/include/renderdatabase.h [new file with mode: 0644]
source/blender/render/intern/include/renderpipeline.h [moved from source/blender/render/intern/include/renderPreAndPost.h with 57% similarity]
source/blender/render/intern/include/shadbuf.h
source/blender/render/intern/include/texture.h
source/blender/render/intern/include/vanillaRenderPipe.h [deleted file]
source/blender/render/intern/include/vanillaRenderPipe_types.h [deleted file]
source/blender/render/intern/include/zblur.h [deleted file]
source/blender/render/intern/include/zbuf.h
source/blender/render/intern/include/zbufferdatastruct.h [deleted file]
source/blender/render/intern/include/zbufferdatastruct_types.h [deleted file]
source/blender/render/intern/source/RE_callbacks.c [deleted file]
source/blender/render/intern/source/convertblender.c [new file with mode: 0644]
source/blender/render/intern/source/edgeRender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/errorHandler.c [deleted file]
source/blender/render/intern/source/gammaCorrectionTables.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/pipeline.c [new file with mode: 0644]
source/blender/render/intern/source/pixelblending.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/ray.c
source/blender/render/intern/source/renderHelp.c [deleted file]
source/blender/render/intern/source/renderPreAndPost.c [deleted file]
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/texture.c
source/blender/render/intern/source/vanillaRenderPipe.c [deleted file]
source/blender/render/intern/source/zblur.c [deleted file]
source/blender/render/intern/source/zbuf.c
source/blender/render/intern/source/zbufferdatastruct.c [deleted file]
source/blender/renderconverter/intern/convertBlenderScene.c
source/blender/src/Makefile
source/blender/src/SConscript
source/blender/src/blenderbuttons.c
source/blender/src/butspace.c
source/blender/src/buttons_editing.c
source/blender/src/buttons_logic.c
source/blender/src/buttons_object.c
source/blender/src/buttons_scene.c
source/blender/src/buttons_shading.c
source/blender/src/drawaction.c
source/blender/src/drawarmature.c
source/blender/src/drawimage.c
source/blender/src/drawimasel.c
source/blender/src/drawipo.c
source/blender/src/drawnla.c
source/blender/src/drawnode.c [new file with mode: 0644]
source/blender/src/drawobject.c
source/blender/src/drawoops.c
source/blender/src/drawseq.c
source/blender/src/drawtime.c
source/blender/src/drawview.c
source/blender/src/edit.c
source/blender/src/editaction.c
source/blender/src/editarmature.c
source/blender/src/editconstraint.c
source/blender/src/editface.c
source/blender/src/editgroup.c
source/blender/src/editimasel.c
source/blender/src/editipo.c
source/blender/src/editmesh.c
source/blender/src/editmesh_lib.c
source/blender/src/editmesh_mods.c
source/blender/src/editmesh_tools.c
source/blender/src/editnla.c
source/blender/src/editnode.c [new file with mode: 0644]
source/blender/src/editobject.c
source/blender/src/editscreen.c
source/blender/src/editsima.c
source/blender/src/edittime.c
source/blender/src/editview.c
source/blender/src/filesel.c
source/blender/src/fluidsim.c
source/blender/src/glutil.c
source/blender/src/header_action.c
source/blender/src/header_buttonswin.c
source/blender/src/header_image.c
source/blender/src/header_info.c
source/blender/src/header_ipo.c
source/blender/src/header_node.c [new file with mode: 0644]
source/blender/src/header_oops.c
source/blender/src/header_script.c
source/blender/src/header_sound.c
source/blender/src/header_text.c
source/blender/src/header_view3d.c
source/blender/src/headerbuttons.c
source/blender/src/imasel.c
source/blender/src/interface.c
source/blender/src/interface_draw.c
source/blender/src/interface_icons.c [new file with mode: 0644]
source/blender/src/interface_panel.c
source/blender/src/meshtools.c
source/blender/src/mywindow.c
source/blender/src/outliner.c
source/blender/src/parametrizer.c [new file with mode: 0644]
source/blender/src/parametrizer.h [new file with mode: 0644]
source/blender/src/parametrizer_intern.h [new file with mode: 0644]
source/blender/src/poseobject.c
source/blender/src/preview.blend.c [new file with mode: 0644]
source/blender/src/previewrender.c
source/blender/src/renderwin.c
source/blender/src/resources.c
source/blender/src/screendump.c
source/blender/src/seqaudio.c
source/blender/src/sequence.c
source/blender/src/space.c
source/blender/src/spacetypes.c
source/blender/src/toets.c
source/blender/src/toolbox.c
source/blender/src/transform_conversions.c
source/blender/src/transform_generics.c
source/blender/src/transform_manipulator.c
source/blender/src/unwrapper.c
source/blender/src/usiblender.c
source/blender/src/view.c
source/blender/src/vpaint.c
source/blender/src/writeavicodec.c
source/blender/src/writeimage.c
source/blender/src/writemovie.c
source/blender/yafray/intern/export_File.cpp
source/blender/yafray/intern/export_Plugin.cpp
source/blender/yafray/intern/yafray_Render.h
source/creator/SConscript
source/creator/creator.c
source/kernel/gen_system/GEN_HashedPtr.cpp
source/nan_compile.mk
source/nan_definitions.mk
source/nan_link.mk
tools/scons/bs/bs_dirs.py
tools/scons/bs/bs_libs.py

index 240079f519080cc8c2bf7a66c7bced642d2130f3..f9fef1f1a49cd89268f34756d51c9f222a241a93 100644 (file)
@@ -54,8 +54,8 @@ if os.path.isdir (bs_globals.root_build_dir) == 0:
        os.makedirs (bs_globals.root_build_dir+os.sep+'source')
 
 # Blender version.
-version='2.41'
-shortversion = '241' # for wininst target -> nsis installer creation
+version='2.40-alpha1'
+shortversion = '240alpha1' # for wininst target -> nsis installer creation
 
 sdl_env = Environment (ENV = os.environ)
 freetype_env = Environment (ENV = os.environ)
@@ -64,9 +64,10 @@ env = Environment (ENV = os.environ)
 if sys.platform == 'linux2' or sys.platform == 'linux-i386':
        use_international = 'true'
        use_gameengine = 'true'
-       use_openal = 'true'
+       use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'true'
        use_sumo = 'true'
        use_ode = 'false'
        use_bullet = 'true'
@@ -95,6 +96,12 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
        png_lib = ['png']
        png_libpath = ['/usr/lib']
        png_include = ['/usr/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['/usr/lib']
@@ -152,11 +159,12 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
 
 elif sys.platform == 'darwin':
        use_international = 'true'
-       use_gameengine = 'true'
+       use_gameengine = 'false'
        use_openal = 'true'
        use_fmod = 'false'
-       use_openal = 'true'
+       use_openal = 'false'
        use_quicktime = 'true'
+       use_openexr = 'true'
        use_precomp = 'true'
        use_sumo = 'true'
        use_ode = 'false'
@@ -176,7 +184,7 @@ elif sys.platform == 'darwin':
        fink_path = '/sw/'
        # TODO : try -mpowerpc -mpowerpc-gopt -mpowerpc-gfxopt optims
        #           doing actual profiling
-       extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-mpowerpc', '-mtune=G5']
+       extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc', '-mtune=G4']
        
        # , '-malign-natural'] malign is causing problems with jpeg lib but worth a 1-2% speedup
        #'-force_cpusubtype_ALL', '-mpowerpc-gpopt', 
@@ -198,6 +206,12 @@ elif sys.platform == 'darwin':
        png_lib = ['libpng']
        png_libpath = [darwin_precomp + 'png/lib']
        png_include = [darwin_precomp + 'png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/local/lib']
+       openexr_include = ['/usr/local/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['libjpeg']
        jpeg_libpath = [darwin_precomp + 'jpeg/lib']
@@ -275,10 +289,11 @@ elif sys.platform == 'darwin':
 
 elif sys.platform == 'cygwin':
        use_international = 'false'
-       use_gameengine = 'true'
-       use_openal = 'true'
+       use_gameengine = 'false'
+       use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'true'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
@@ -309,6 +324,12 @@ elif sys.platform == 'cygwin':
        png_lib = ['png']
        png_libpath = ['#../lib/windows/png/lib']
        png_include = ['#../lib/windows/png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['#../lib/windows/jpeg/lib']
@@ -365,6 +386,7 @@ elif sys.platform == 'win32':
        use_openal = 'true'
        use_fmod = 'false'
        use_quicktime = 'true'
+       use_openexr = 'true'
        use_bullet = 'true'
        use_sumo = 'true'
        use_ode = 'false'
@@ -417,6 +439,12 @@ elif sys.platform == 'win32':
        png_lib = ['libpng_st']
        png_libpath = ['#../lib/windows/png/lib']
        png_include = ['#../lib/windows/png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['libjpeg']
        jpeg_libpath = ['#../lib/windows/jpeg/lib']
@@ -477,6 +505,7 @@ elif string.find (sys.platform, 'sunos') != -1:
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
@@ -505,6 +534,12 @@ elif string.find (sys.platform, 'sunos') != -1:
        png_lib = ['png']
        png_libpath = []
        png_include = []
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = []
@@ -561,6 +596,7 @@ elif string.find (sys.platform, 'irix') != -1:
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
@@ -597,6 +633,12 @@ elif string.find (sys.platform, 'irix') != -1:
        png_lib = ['png']
        png_libpath = [irix_precomp + '/png/lib']
        png_include = [irix_precomp + '/png/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = [irix_precomp + '/jpeg/lib']
@@ -657,6 +699,7 @@ elif sys.platform=='openbsd3':
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
@@ -684,6 +727,12 @@ elif sys.platform=='openbsd3':
        png_lib = ['png']
        png_libpath = ['/usr/local/lib']
        png_include = ['/usr/local/include/libpng']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['/usr/local/lib']
@@ -742,6 +791,7 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
        use_openal = 'false'
        use_fmod = 'false'
        use_quicktime = 'false'
+       use_openexr = 'false'
        use_sumo = 'false'
        use_ode = 'false'
        use_bullet = 'false'
@@ -769,6 +819,12 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
        png_lib = ['png']
        png_libpath = ['/usr/local/lib']
        png_include = ['/usr/local/include']
+       # OpenEXR library information
+       if use_openexr == 'true':
+               defines += ['WITH_OPENEXR']
+       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
+       openexr_libpath = ['/usr/lib']
+       openexr_include = ['/usr/include/OpenEXR']
        # jpeg library information
        jpeg_lib = ['jpeg']
        jpeg_libpath = ['/usr/local/lib']
@@ -870,6 +926,7 @@ else:
        config.write ("USE_OPENAL = %r\n"%(use_openal))
        config.write ("USE_FMOD = %r\n"%(use_fmod))
        config.write ("USE_QUICKTIME = %r\n"%(use_quicktime))
+       config.write ("USE_OPENEXR = %r\n"%(use_openexr))
        config.write ("USE_FLUIDSIM = %r\n"%(use_fluidsim))
        config.write ("\n# Compiler information.\n")
        config.write ("HOST_CC = %r\n"%(env_dict['CC']))
@@ -896,6 +953,9 @@ else:
        config.write ("PNG_INCLUDE = %r\n"%(png_include))
        config.write ("PNG_LIBPATH = %r\n"%(png_libpath))
        config.write ("PNG_LIBRARY = %r\n"%(png_lib))
+        config.write ("OPENEXR_INCLUDE = %r\n"%(openexr_include))
+        config.write ("OPENEXR_LIBPATH = %r\n"%(openexr_libpath))
+        config.write ("OPENEXR_LIBRARY = %r\n"%(openexr_lib))
        config.write ("JPEG_INCLUDE = %r\n"%(jpeg_include))
        config.write ("JPEG_LIBPATH = %r\n"%(jpeg_libpath))
        config.write ("JPEG_LIBRARY = %r\n"%(jpeg_lib))
@@ -982,6 +1042,9 @@ user_options.AddOptions (
                (BoolOption ('USE_QUICKTIME',
                                        'Set to 1 to add support for QuickTime.',
                                        'false')),
+               (BoolOption ('USE_OPENEXR',
+                                        'Set to 1 to add support for OpenEXR.',
+                                        'false')),
                (BoolOption ('USE_FLUIDSIM', # NT test new
                                        'Set to 0 to disable compilation of fluid simulation library El\'Beem.',
                                        'true')),
@@ -1008,6 +1071,9 @@ user_options.AddOptions (
                ('PNG_INCLUDE', 'Include directory for png header files.'),
                ('PNG_LIBPATH', 'Library path where the png library is located.'),
                ('PNG_LIBRARY', 'png library name.'),
+                ('OPENEXR_INCLUDE', 'Include directory for OpenEXR header files.'),
+                ('OPENEXR_LIBPATH', 'Library path where the OpenEXR libraries are located.'),
+                ('OPENEXR_LIBRARY', 'OpenEXR library names.'),
                ('JPEG_INCLUDE', 'Include directory for jpeg header files.'),
                ('JPEG_LIBPATH', 'Library path where the jpeg library is located.'),
                ('JPEG_LIBRARY', 'jpeg library name.'),
index 76115a0b18991ac76efc216afc3f07d4c55e091b..d9c6086b0e2a223ad887d6dbb0401dcd7cc061c5 100644 (file)
@@ -13,6 +13,4 @@ Brazilian Portuguese:pt_br
 Simplified Chinese:zh_CN
 Russian:ru_RU
 Croatian:hr_HR
-Serbian:sr
-Ukrainian:uk
 Polish:pl_PL
index 3fa3e9139ab0fa0e60da5e16a2bb894c09547656..064480fbd16be74bf9a02e4c30e8cbdbc1501341 100644 (file)
@@ -46,7 +46,6 @@ CCSRCS =  FTBitmapGlyph.cpp FTCharmap.cpp FTContour.cpp FTExtrdGlyph.cpp \
 
 include nan_compile.mk 
 CPPFLAGS += -I../include
-CPPFLAGS += -I/usr/X11R6/include
 CPPFLAGS += -I$(NAN_FREETYPE)/include -I$(NAN_FREETYPE)/include/freetype2 
 
 install: all debug
index dad314f72baac8d278286b7a16a5f67661515bb6..48b6e8bb3354c13854fc2c79b7bb7e1ebc150aea 100644 (file)
@@ -159,6 +159,10 @@ SOURCE=.\NarrowPhaseCollision\BU_VertexPoly.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\NarrowPhaseCollision\CollisionMargin.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\NarrowPhaseCollision\ContinuousConvexCollision.cpp
 # End Source File
 # Begin Source File
@@ -199,14 +203,6 @@ SOURCE=.\NarrowPhaseCollision\GjkPairDetector.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\NarrowPhaseCollision\ManifoldContactAddResult.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\NarrowPhaseCollision\ManifoldContactAddResult.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\NarrowPhaseCollision\ManifoldPoint.h
 # End Source File
 # Begin Source File
@@ -311,18 +307,6 @@ SOURCE=.\CollisionShapes\BoxShape.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\CollisionShapes\BvhTriangleMeshShape.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\CollisionShapes\BvhTriangleMeshShape.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\CollisionShapes\CollisionMargin.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\CollisionShapes\CollisionShape.cpp
 # End Source File
 # Begin Source File
@@ -355,14 +339,6 @@ SOURCE=.\CollisionShapes\ConvexShape.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\CollisionShapes\ConvexTriangleCallback.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\CollisionShapes\ConvexTriangleCallback.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\CollisionShapes\CylinderShape.cpp
 # End Source File
 # Begin Source File
@@ -371,14 +347,6 @@ SOURCE=.\CollisionShapes\CylinderShape.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\CollisionShapes\EmptyShape.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\CollisionShapes\EmptyShape.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\CollisionShapes\MinkowskiSumShape.cpp
 # End Source File
 # Begin Source File
@@ -395,14 +363,6 @@ SOURCE=.\CollisionShapes\MultiSphereShape.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\CollisionShapes\OptimizedBvh.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\CollisionShapes\OptimizedBvh.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\CollisionShapes\PolyhedralConvexShape.cpp
 # End Source File
 # Begin Source File
@@ -435,22 +395,10 @@ SOURCE=.\CollisionShapes\StridingMeshInterface.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\CollisionShapes\TriangleCallback.cpp
-# End Source File
-# Begin Source File
-
 SOURCE=.\CollisionShapes\TriangleCallback.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\CollisionShapes\TriangleIndexVertexArray.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\CollisionShapes\TriangleIndexVertexArray.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\CollisionShapes\TriangleMesh.cpp
 # End Source File
 # Begin Source File
index 4c8bc67557bf175bfa5e82fb3c97d83076a3da86..b9046f451e5f2eafdbb35563cc30b87c606ca8db 100644 (file)
@@ -42,7 +42,6 @@
                                Optimization="0"
                                AdditionalIncludeDirectories=".;..\LinearMath"
                                PreprocessorDefinitions="_DEBUG;_LIB;WIN32;BUM_INLINED;USE_ALGEBRAIC"
-                               ExceptionHandling="0"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="1"
                                UsePrecompiledHeader="0"
                                RelativePath=".\NarrowPhaseCollision\GjkPairDetector.h"
                                >
                        </File>
-                       <File
-                               RelativePath=".\NarrowPhaseCollision\ManifoldContactAddResult.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\NarrowPhaseCollision\ManifoldContactAddResult.h"
-                               >
-                       </File>
                        <File
                                RelativePath=".\NarrowPhaseCollision\ManifoldPoint.h"
                                >
                                RelativePath=".\CollisionShapes\ConvexShape.h"
                                >
                        </File>
-                       <File
-                               RelativePath=".\CollisionShapes\ConvexTriangleCallback.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\CollisionShapes\ConvexTriangleCallback.h"
-                               >
-                       </File>
                        <File
                                RelativePath=".\CollisionShapes\CylinderShape.cpp"
                                >
                                RelativePath=".\CollisionShapes\CylinderShape.h"
                                >
                        </File>
-                       <File
-                               RelativePath=".\CollisionShapes\EmptyShape.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\CollisionShapes\EmptyShape.h"
-                               >
-                       </File>
                        <File
                                RelativePath=".\CollisionShapes\MinkowskiSumShape.cpp"
                                >
                                RelativePath=".\CollisionShapes\StridingMeshInterface.h"
                                >
                        </File>
-                       <File
-                               RelativePath=".\CollisionShapes\TriangleCallback.cpp"
-                               >
-                       </File>
                        <File
                                RelativePath=".\CollisionShapes\TriangleCallback.h"
                                >
                                >
                        </File>
                </Filter>
-               <File
-                       RelativePath=".\CollisionShapes\BvhTriangleMeshShape.cpp"
-                       >
-               </File>
-               <File
-                       RelativePath=".\CollisionShapes\BvhTriangleMeshShape.h"
-                       >
-               </File>
-               <File
-                       RelativePath=".\CollisionShapes\OptimizedBvh.cpp"
-                       >
-               </File>
-               <File
-                       RelativePath=".\CollisionShapes\OptimizedBvh.h"
-                       >
-               </File>
-               <File
-                       RelativePath=".\CollisionShapes\TriangleIndexVertexArray.cpp"
-                       >
-               </File>
-               <File
-                       RelativePath=".\CollisionShapes\TriangleIndexVertexArray.h"
-                       >
-               </File>
        </Files>
        <Globals>
        </Globals>
index a07e2919bd66815cae8155ce93c6e8a505bb1160..fe3a51883ec378f3c537ea0717faaf389a5dac6c 100644 (file)
@@ -84,30 +84,28 @@ void OptimizedBvh::Build(StridingMeshInterface* triangles)
 
 OptimizedBvhNode*      OptimizedBvh::BuildTree (NodeArray&     leafNodes,int startIndex,int endIndex)
 {
-       OptimizedBvhNode* internalNode;
 
-       int splitAxis, splitIndex, i;
        int numIndices =endIndex-startIndex;
-       int curIndex = m_curNodeIndex;
-
        assert(numIndices>0);
 
+       int curIndex = m_curNodeIndex;
+
        if (numIndices==1)
        {
                return new (&m_contiguousNodes[m_curNodeIndex++]) OptimizedBvhNode(leafNodes[startIndex]);
        }
        //calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
        
-       splitAxis = CalcSplittingAxis(leafNodes,startIndex,endIndex);
+       int splitAxis = CalcSplittingAxis(leafNodes,startIndex,endIndex);
 
-       splitIndex = SortAndCalcSplittingIndex(leafNodes,startIndex,endIndex,splitAxis);
+       int splitIndex = SortAndCalcSplittingIndex(leafNodes,startIndex,endIndex,splitAxis);
 
-       internalNode = &m_contiguousNodes[m_curNodeIndex++];
+       OptimizedBvhNode* internalNode = &m_contiguousNodes[m_curNodeIndex++];
        
        internalNode->m_aabbMax.setValue(-1e30f,-1e30f,-1e30f);
        internalNode->m_aabbMin.setValue(1e30f,1e30f,1e30f);
        
-       for (i=startIndex;i<endIndex;i++)
+       for (int i=startIndex;i<endIndex;i++)
        {
                internalNode->m_aabbMax.setMax(leafNodes[i].m_aabbMax);
                internalNode->m_aabbMin.setMin(leafNodes[i].m_aabbMin);
@@ -125,23 +123,21 @@ OptimizedBvhNode* OptimizedBvh::BuildTree (NodeArray&     leafNodes,int startIndex,i
 
 int    OptimizedBvh::SortAndCalcSplittingIndex(NodeArray&      leafNodes,int startIndex,int endIndex,int splitAxis)
 {
-       int i;
        int splitIndex =startIndex;
        int numIndices = endIndex - startIndex;
-       float splitValue;
 
        SimdVector3 means(0.f,0.f,0.f);
-       for (i=startIndex;i<endIndex;i++)
+       for (int i=startIndex;i<endIndex;i++)
        {
                SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
                means+=center;
        }
        means *= (1.f/(float)numIndices);
        
-       splitValue = means[splitAxis];
+       float splitValue = means[splitAxis];
        
        //sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
-       for (i=startIndex;i<endIndex;i++)
+       for (int i=startIndex;i<endIndex;i++)
        {
                SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
                if (center[splitAxis] > splitValue)
@@ -163,20 +159,19 @@ int       OptimizedBvh::SortAndCalcSplittingIndex(NodeArray&      leafNodes,int startIndex,
 
 int    OptimizedBvh::CalcSplittingAxis(NodeArray&      leafNodes,int startIndex,int endIndex)
 {
-       int i;
-
        SimdVector3 means(0.f,0.f,0.f);
-       SimdVector3 variance(0.f,0.f,0.f);
        int numIndices = endIndex-startIndex;
 
-       for (i=startIndex;i<endIndex;i++)
+       for (int i=startIndex;i<endIndex;i++)
        {
                SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
                means+=center;
        }
        means *= (1.f/(float)numIndices);
                
-       for (i=startIndex;i<endIndex;i++)
+       SimdVector3 variance(0.f,0.f,0.f);
+
+       for (int i=startIndex;i<endIndex;i++)
        {
                SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
                SimdVector3 diff2 = center-means;
@@ -185,18 +180,18 @@ int       OptimizedBvh::CalcSplittingAxis(NodeArray&      leafNodes,int startIndex,int endI
        }
        variance *= (1.f/       ((float)numIndices-1)   );
        
-       return variance.maxAxis();
+       int biggestAxis = variance.maxAxis();
+       return biggestAxis;
+
 }
 
 
        
 void   OptimizedBvh::ReportAabbOverlappingNodex(NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
 {
-       int i;
-
        if (aabbMin.length() > 1000.f)
        {
-               for (i=0;i<m_leafNodes.size();i++)
+               for (int i=0;i<m_leafNodes.size();i++)
                {
                        const OptimizedBvhNode& node = m_leafNodes[i];
                        nodeCallback->ProcessNode(&node);
@@ -210,10 +205,10 @@ void      OptimizedBvh::ReportAabbOverlappingNodex(NodeOverlapCallback* nodeCallback,
 
 void   OptimizedBvh::WalkTree(OptimizedBvhNode* rootNode,NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
 {
-       bool isLeafNode, aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
+       bool aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
        if (aabbOverlap)
        {
-               isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
+               bool isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
                if (isLeafNode)
                {
                        nodeCallback->ProcessNode(rootNode);
@@ -230,9 +225,8 @@ int maxIterations = 0;
 
 void   OptimizedBvh::WalkStacklessTree(OptimizedBvhNode* rootNode,NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
 {
-       int escapeIndex, curIndex = 0;
+       int curIndex = 0;
        int walkIterations = 0;
-       bool aabbOverlap, isLeafNode;
 
        while (curIndex < m_curNodeIndex)
        {
@@ -240,8 +234,8 @@ void        OptimizedBvh::WalkStacklessTree(OptimizedBvhNode* rootNode,NodeOverlapCallb
                assert (walkIterations < m_curNodeIndex);
 
                walkIterations++;
-               aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
-               isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
+               bool aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
+               bool isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
                
                if (isLeafNode && aabbOverlap)
                {
@@ -254,7 +248,7 @@ void        OptimizedBvh::WalkStacklessTree(OptimizedBvhNode* rootNode,NodeOverlapCallb
                        curIndex++;
                } else
                {
-                       escapeIndex = rootNode->m_escapeIndex;
+                       int escapeIndex = rootNode->m_escapeIndex;
                        rootNode += escapeIndex;
                        curIndex += escapeIndex;
                }
index 37d34a659482b269059b5fcc8ed5dd2a020a8ec0..bbffb8137dec201ab99f5989e609acce1e6a2cf8 100644 (file)
@@ -22,7 +22,14 @@ SphereShape ::SphereShape (SimdScalar radius)
 
 SimdVector3    SphereShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
 {
-       return SimdVector3(0.f,0.f,0.f);
+       float radius = m_radius - GetMargin();
+
+       SimdScalar len = vec.length2();
+       if (SimdFabs(len) < 0.0001f)
+       {
+               return SimdVector3(m_localScaling[0] * radius,m_localScaling[1]*radius,m_localScaling[2]*radius);
+       } 
+       return vec *  (m_localScaling*(radius / SimdSqrt(len)));
 }
 
 SimdVector3    SphereShape::LocalGetSupportingVertex(const SimdVector3& vec)const
@@ -30,31 +37,38 @@ SimdVector3 SphereShape::LocalGetSupportingVertex(const SimdVector3& vec)const
        SimdVector3 supVertex;
        supVertex = LocalGetSupportingVertexWithoutMargin(vec);
 
-       SimdVector3 vecnorm = vec;
-       if (SimdFuzzyZero(vecnorm .length2()))
+       if ( GetMargin()!=0.f )
        {
-               vecnorm.setValue(-1.f,-1.f,-1.f);
-       } 
-       vecnorm.normalize();
-       supVertex+= GetMargin() * vecnorm;
+               SimdVector3 vecnorm = vec;
+               if (vecnorm .length2() == 0.f)
+               {
+                       vecnorm.setValue(-1.f,-1.f,-1.f);
+               } 
+               vecnorm.normalize();
+               supVertex+= GetMargin() * vecnorm;
+       }
        return supVertex;
 }
 
-
+/*
 //broken due to scaling
 void SphereShape::GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
 {
        const SimdVector3& center = t.getOrigin();
-       SimdVector3 extent(GetMargin(),GetMargin(),GetMargin());
+       SimdScalar radius = m_radius;
+       
+       SimdVector3 extent = m_localScaling*radius;
+       extent+= SimdVector3(GetMargin(),GetMargin(),GetMargin());
+
        aabbMin = center - extent;
        aabbMax = center + extent;
 }
-
+*/
 
 
 void   SphereShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
 {
-       SimdScalar elem = 0.4f * mass * GetMargin()*GetMargin();
+       SimdScalar elem = 0.4f * mass * m_radius*m_radius;
        inertia[0] = inertia[1] = inertia[2] = elem;
 
 }
\ No newline at end of file
index 235af6c4db2ae665eba9d3e1acf80c27831eca2b..82c00ea43ebbcce0bc913c28e6007ad9f12eb934 100644 (file)
@@ -20,7 +20,7 @@ class SphereShape : public ConvexShape
 
 {
        SimdScalar m_radius;
-       
+
 public:
        SphereShape (SimdScalar radius);
        
@@ -31,7 +31,7 @@ public:
 
        virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
 
-       virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
+       //virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
 
        virtual int     GetShapeType() const { return SPHERE_SHAPE_PROXYTYPE; }
 
@@ -40,18 +40,6 @@ public:
        //debugging
        virtual char*   GetName()const {return "SPHERE";}
 
-       virtual void    SetMargin(float margin)
-       {
-               ConvexShape::SetMargin(margin);
-       }
-       virtual float   GetMargin() const
-       {
-               //to improve gjk behaviour, use radius+margin as the full margin, so never get into the penetration case
-               //this means, non-uniform scaling is not supported anymore
-               return m_localScaling[0] * m_radius + ConvexShape::GetMargin();
-       }
-
-
 };
 
 
diff --git a/extern/bullet/Bullet/NarrowPhaseCollision/CollisionMargin.h b/extern/bullet/Bullet/NarrowPhaseCollision/CollisionMargin.h
new file mode 100644 (file)
index 0000000..41009dc
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef COLLISION_MARGIN_H
+#define COLLISION_MARGIN_H
+
+//used by Gjk and some other algorithms
+
+#define CONVEX_DISTANCE_MARGIN 0.04f// 0.1f//;//0.01f
+
+
+
+#endif //COLLISION_MARGIN_H
+
index a7375e78d384274be9f489f93d3a85cfcdf67bf8..f7e41e61824fcb9f1ca21158d5bfa51fbd21618c 100644 (file)
@@ -153,7 +153,7 @@ void ConvexConcaveCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,Broadp
                
                if (m_convex.IsConvexShape())
                {
-                       float collisionMarginTriangle = triangleMesh->GetMargin();
+                       float collisionMarginTriangle = 0.02f;//triangleMesh->GetMargin();
                                        
                        m_boxTriangleCallback.SetTimeStepAndCounters(timeStep,stepCount, collisionMarginTriangle,useContinuous);
 #ifdef USE_BOX_TRIANGLE
index 81b75e6e1b8f28c9d408fe25270a611088639083..9471c1faf7c35473d412267586ff56477cd29cb3 100644 (file)
 
 
 static RigidBody s_fixed(MassProps(0,SimdVector3(0.f,0.f,0.f)),0.f,0.f,1.f,1.f);
-static int gConstraintId = 1;
 
 Point2PointConstraint::Point2PointConstraint():
 m_rbA(s_fixed),m_rbB(s_fixed)
 {
-       m_constraintId = gConstraintId++;//just create some unique ID for now
-
        s_fixed.setMassProps(0.f,SimdVector3(0.f,0.f,0.f));
 }
 
 Point2PointConstraint::Point2PointConstraint(RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB)
 :m_rbA(rbA),m_rbB(rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB)
 {
-       m_constraintId = gConstraintId++;//just create some unique ID for now
+
 }
 
 
@@ -35,7 +32,6 @@ Point2PointConstraint::Point2PointConstraint(RigidBody& rbA,const SimdVector3& p
 :m_rbA(rbA),m_rbB(s_fixed),m_pivotInA(pivotInA),m_pivotInB(rbA.getCenterOfMassTransform()(pivotInA))
 {
        s_fixed.setMassProps(0.f,SimdVector3(1e10f,1e10f,1e10f));
-       m_constraintId = gConstraintId++;//just create some unique ID for now
 }
 
 void   Point2PointConstraint::BuildJacobian()
index 59b7a5576c46963f1e3d0af0095e5cbfc0b3368d..82b4dcc83dbc5074b5b5868879f2f81764ebb04e 100644 (file)
@@ -27,7 +27,6 @@ class Point2PointConstraint
        SimdVector3     m_pivotInA;
        SimdVector3     m_pivotInB;
        
-       int     m_constraintId;
 public:
 
        Point2PointConstraint(RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB);
@@ -51,11 +50,6 @@ public:
                return m_rbB;
        }
 
-       int GetConstraintId()
-       {
-               return m_constraintId;
-       }
-
 
 };
 
index 453d18aff6d1e10b73b8505e2a1779142b2dda0a..ae3763d6e45690385315c58484d0d86855d72290 100644 (file)
@@ -57,13 +57,7 @@ bullet_sources = ['Bullet/BroadphaseCollision/BroadphaseProxy.cpp',
                                'Bullet/CollisionShapes/StridingMeshInterface.cpp',
                                'Bullet/CollisionShapes/TriangleMesh.cpp',
                                'Bullet/CollisionShapes/TriangleMeshShape.cpp',
-                               'Bullet/CollisionShapes/BvhTriangleMeshShape.cpp',
-                               'Bullet/CollisionShapes/ConvexTriangleCallback.cpp',
-                               'Bullet/CollisionShapes/EmptyShape.cpp',
-                               'Bullet/CollisionShapes/OptimizedBvh.cpp',
-                               'Bullet/CollisionShapes/TriangleCallback.cpp',
-                               'Bullet/CollisionShapes/TriangleIndexVertexArray.cpp',
-                                                                                       
+                               
                                'Bullet/NarrowPhaseCollision/BU_AlgebraicPolynomialSolver.cpp',
                                'Bullet/NarrowPhaseCollision/BU_Collidable.cpp',
                                'Bullet/NarrowPhaseCollision/BU_CollisionPair.cpp',
@@ -79,8 +73,7 @@ bullet_sources = ['Bullet/BroadphaseCollision/BroadphaseProxy.cpp',
                                'Bullet/NarrowPhaseCollision/RaycastCallback.cpp',
                                'Bullet/NarrowPhaseCollision/SubSimplexConvexCast.cpp',
                                'Bullet/NarrowPhaseCollision/VoronoiSimplexSolver.cpp',
-                               'Bullet/NarrowPhaseCollision/ManifoldContactAddResult.cpp',
-                                                               
+                               
                                'BulletDynamics/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp',
                                'BulletDynamics/CollisionDispatch/ConvexConvexAlgorithm.cpp',
                                'BulletDynamics/CollisionDispatch/EmptyCollisionAlgorithm.cpp',
index 60c6b02a92418df00991d8a1d0dafc12646fc164..f0cd96247d288254db2176e1b1d12334a86bd9d8 100644 (file)
@@ -716,6 +716,9 @@ ECHO Done
                                <File
                                        RelativePath="..\..\Bullet\NarrowPhaseCollision\BU_VertexPoly.h">
                                </File>
+                               <File
+                                       RelativePath="..\..\Bullet\NarrowPhaseCollision\CollisionMargin.h">
+                               </File>
                                <File
                                        RelativePath="..\..\Bullet\NarrowPhaseCollision\ContinuousConvexCollision.h">
                                </File>
@@ -793,9 +796,6 @@ ECHO Done
                                                        ObjectFile="$(IntDir)/$(InputName)1.obj"/>
                                        </FileConfiguration>
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\BvhTriangleMeshShape.cpp">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\CollisionShape.cpp">
                                        <FileConfiguration
@@ -904,9 +904,6 @@ ECHO Done
                                                        ObjectFile="$(IntDir)/$(InputName)1.obj"/>
                                        </FileConfiguration>
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\ConvexTriangleCallback.cpp">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\CylinderShape.cpp">
                                        <FileConfiguration
@@ -934,9 +931,6 @@ ECHO Done
                                                        ObjectFile="$(IntDir)/$(InputName)1.obj"/>
                                        </FileConfiguration>
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\EmptyShape.cpp">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\MinkowskiSumShape.cpp">
                                        <FileConfiguration
@@ -991,9 +985,6 @@ ECHO Done
                                                        ObjectFile="$(IntDir)/$(InputName)1.obj"/>
                                        </FileConfiguration>
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\OptimizedBvh.cpp">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\PolyhedralConvexShape.cpp">
                                        <FileConfiguration
@@ -1102,12 +1093,6 @@ ECHO Done
                                                        ObjectFile="$(IntDir)/$(InputName)1.obj"/>
                                        </FileConfiguration>
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\TriangleCallback.cpp">
-                               </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\TriangleIndexVertexArray.cpp">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\TriangleMesh.cpp">
                                        <FileConfiguration
@@ -1169,12 +1154,6 @@ ECHO Done
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\BoxShape.h">
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\BvhTriangleMeshShape.h">
-                               </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\CollisionMargin.h">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\CollisionShape.h">
                                </File>
@@ -1187,24 +1166,15 @@ ECHO Done
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\ConvexShape.h">
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\ConvexTriangleCallback.h">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\CylinderShape.h">
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\EmptyShape.h">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\MinkowskiSumShape.h">
                                </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\MultiSphereShape.h">
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\OptimizedBvh.h">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\PolyhedralConvexShape.h">
                                </File>
@@ -1220,9 +1190,6 @@ ECHO Done
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\TriangleCallback.h">
                                </File>
-                               <File
-                                       RelativePath="..\..\Bullet\CollisionShapes\TriangleIndexVertexArray.h">
-                               </File>
                                <File
                                        RelativePath="..\..\Bullet\CollisionShapes\TriangleMesh.h">
                                </File>
index 98eed6bb1040839ba978618e610b12618c9942b3..28421b9f2e4ee573532fb64c2fc0269abce8a0ac 100644 (file)
@@ -231,12 +231,8 @@ SND_OpenALDevice::SND_OpenALDevice()
                        m_context = alcCreateContext(dev, NULL);
 
                        if (m_context) {
-#ifdef AL_VERSION_1_1
-               alcMakeContextCurrent((ALCcontext*)m_context);
-#else
-                       alcMakeContextCurrent(m_context);
-#endif
-                       m_audio = true;
+                               alcMakeContextCurrent((ALCcontext*)m_context);
+                               m_audio = true;
                                m_device = dev;
 #ifdef __linux__
                                /*
@@ -343,11 +339,7 @@ SND_OpenALDevice::~SND_OpenALDevice()
        
        if (m_context) {
                MakeCurrent();
-#ifdef AL_VERSION_1_1
                alcDestroyContext((ALCcontext*)m_context);
-#else
-               alcDestroyContext(m_context);
-#endif
                m_context = NULL;
        }
        
@@ -418,7 +410,7 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
                                        waveslot->SetFileSize(size);
                                        
                                        /* what was (our) buffer? */
-                                       int buffer = waveslot->GetBuffer();
+                                       buffer = waveslot->GetBuffer();
                                        
                                        /* get some info out of the sample */
                                        SND_GetSampleInfo((signed char*)memlocation, waveslot);
@@ -427,14 +419,9 @@ SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name,
                                        
                                        /* load the sample into openal */
 #if defined(OUDE_OPENAL) || defined (__APPLE__)
-                                       alutLoadWAVMemory((char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate);                             //      openal_2.12
-#else
-#ifdef AL_VERSION_1_1                                  
-                                       alutLoadWAVMemory((ALbyte*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate, &loop);//  openal_2.14+
+                                       alutLoadWAVMemory((ALbyte *)memlocation, &sampleformat, &data, &numberofsamples, &samplerate);                          //      openal_2.12
 #else
-                                        alutLoadWAVMemory((signed char*)memlocation, &sampleformat, &data, &numberofsamples, &samplerate, &loop);//  openal_2.14+
-                                        
-#endif 
+                                       alutLoadWAVMemory((ALbyte *)memlocation, &sampleformat, &data, &numberofsamples, &samplerate, &loop);// openal_2.14+
 #endif
                                        /* put it in the buffer */
                                        alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate);
index 7997a94344b93d0f0df68f2bdd9bde38fda6c811..bbba2c978dd71597ab4d6568bb089b87e17af3c5 100644 (file)
 #include "BMF_BitmapFont.h"
 
 
-#ifdef __APPLE__        
-#include <stdio.h>
-
-static int needs_nvidia_rasterpos_workaround(void)
-{
-       static int well_is_it= -1;
-       
-       if (well_is_it==-1)
-       {
-               well_is_it= (strncmp((char *)glGetString(GL_RENDERER), "NVIDIA GeForce 6800", 18) == 0);
-               if ( well_is_it != 0)
-               {
-                       const GLubyte* vers = glGetString(GL_VERSION);
-                       const GLubyte* v = vers;
-                       int major = 0, minor = 0, sub = 0;
-                       
-                       //advance to the '-'
-                       while ((*v != 0) && (*v!='-'))
-                               v++;
-                       
-                       if (*v == '-')
-                       {
-                               int i = 0;
-                               v++;
-                               
-                               while ((v[i] <= '9') && (v[i] >= '0'))
-                               {
-                                       major *=10;
-                                       major += v[i]-'0';
-                                       i++;
-                               }
-                               
-                               if (v[i] == '.')
-                               {
-                                       i++;
-                                       while ((v[i] <= '9') && (v[i] >= '0'))
-                                       {
-                                               minor *=10;
-                                               minor += v[i]-'0';
-                                               i++;
-                                       }
-                               }
-                               else
-                                       major = -1;
-                               
-                               if (v[i] == '.')
-                               {
-                                       i++;
-                                       while ((v[i] <= '9') && (v[i] >= '0'))
-                                       {
-                                               sub *=10;
-                                               sub += v[i]-'0';
-                                               i++;
-                                       }
-                               }
-                               else
-                                       minor = -1;
-                       }
-
-                       //OS X 10.4.3 is the first version that contained the fix for this problem
-                       // and the 6800's driver version in it is 1.4.16.  So anything after that
-                       // doesn't need the workaround
-
-                       if ( (major == -1) || (minor == -1))
-                       //If anything went wrong don't do the workaround
-                       //
-                               well_is_it = 0;
-                       else if ( (major <= 1) && (minor <= 4) && (sub < 16))
-                               well_is_it = 1;
-                       else
-                               well_is_it = 0;
-               }       
-       }
-
-       return well_is_it;
-}
-
-
-#endif
-
 BMF_BitmapFont::BMF_BitmapFont(BMF_FontData* fontData)
 : m_fontData(fontData)
 {
@@ -154,19 +74,7 @@ void BMF_BitmapFont::DrawString(char* str)
        GLint alignment;
        unsigned char c;
 
-#ifdef __APPLE__        
-     GLint vp[4];  // hack stuff        
-     GLubyte nullm = 0;      // hack stuff      
-        
-     if(needs_nvidia_rasterpos_workaround()) {  // was is_a_really_crappy_nvidia_card()
-             glGetIntegerv(GL_VIEWPORT, vp);   // hack stuff    
-        
-             glBitmap(1, 1, 0, 0, -vp[0], vp[1], &nullm);       
-        
-         }      
- #endif
-       glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
+       glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        
        while ( (c = (unsigned char) *str++) ) {
index bdd3637a5986bcbe0c918a1eb115874a245cf1c2..08928935f33da85c5869a70a4687746dc3c4ad26 100644 (file)
@@ -146,7 +146,7 @@ void BOP_mergeVertexs(BOP_Mesh *mesh, unsigned int firstFace);
  * @param facesB set of faces from object B
  */
 void BOP_Face2Face(BOP_Mesh *mesh, BOP_Faces *facesA, BOP_Faces *facesB)
-{
+{              
        for(unsigned int idxFaceA=0;idxFaceA<facesA->size();idxFaceA++) {
                BOP_Face *faceA = (*facesA)[idxFaceA];
                MT_Plane3 planeA = faceA->getPlane();
@@ -160,28 +160,28 @@ void BOP_Face2Face(BOP_Mesh *mesh, BOP_Faces *facesA, BOP_Faces *facesB)
                        idxFaceB<facesB->size() && (faceA->getTAG() != BROKEN) && (faceA->getTAG() != PHANTOM);) {
                        BOP_Face *faceB = (*facesB)[idxFaceB];
                        if ((faceB->getTAG() != BROKEN) && (faceB->getTAG() != PHANTOM)) {
-                               BOP_BBox boxB(mesh->getVertex(faceB->getVertex(0))->getPoint(),
-                                                         mesh->getVertex(faceB->getVertex(1))->getPoint(),
-                                                         mesh->getVertex(faceB->getVertex(2))->getPoint());
-                               if (boxA.intersect(boxB)) {
+                         BOP_BBox boxB(mesh->getVertex(faceB->getVertex(0))->getPoint(),
+                                       mesh->getVertex(faceB->getVertex(1))->getPoint(),
+                                       mesh->getVertex(faceB->getVertex(2))->getPoint());
+                         if (boxA.intersect(boxB)) {
 
-                                       MT_Plane3 planeB = faceB->getPlane();
-                                       if (BOP_containsPoint(planeB,p1) && 
-                                               BOP_containsPoint(planeB,p2) && 
-                                               BOP_containsPoint(planeB,p3)) {
-                                               if (BOP_orientation(planeB,planeA)>0) {
-                                                       BOP_intersectCoplanarFaces(mesh,facesB,faceA,faceB,false);
-                                               }
-                                       }
-                                       else {
-                                               BOP_intersectNonCoplanarFaces(mesh,facesA,facesB,faceA,faceB);
-                                       }
-                               }                         
+                           MT_Plane3 planeB = faceB->getPlane();
+                           if (BOP_containsPoint(planeB,p1) && 
+                               BOP_containsPoint(planeB,p2) && 
+                               BOP_containsPoint(planeB,p3)) {
+                             if (BOP_orientation(planeB,planeA)>0) {
+                               BOP_intersectCoplanarFaces(mesh,facesB,faceA,faceB,false);
+                             }
+                           }
+                           else {
+                             BOP_intersectNonCoplanarFaces(mesh,facesA,facesB,faceA,faceB);
+                           }
+                         }                       
                        }
                        if (faceB->getTAG()==BROKEN){
-                               facesB->erase(facesB->begin()+idxFaceB);
+                         facesB->erase(facesB->begin()+idxFaceB);
                        }else
-                               idxFaceB++;
+                         idxFaceB++;
                }
        }
        
index 1ef394963ac03387033464336286ff408c2ef6f6..02945340d55e25dd34c0405a764e154955b1597f 100644 (file)
@@ -92,9 +92,9 @@ BoolOpState BOP_performBooleanOperation(BoolOpType                    opType,
                                                                                CSG_VertexIteratorDescriptor  obBVertices,
                                                                                CSG_InterpolateUserFaceVertexDataFunc interpFunc)
 {
-#ifdef DEBUG
+       #ifdef DEBUG
        cout << "BEGIN BOP_performBooleanOperation" << endl;
-#endif
+       #endif
 
        // Set invert flags depending on boolean operation type:
        // INTERSECTION: A^B = and(A,B)
@@ -121,9 +121,6 @@ BoolOpState BOP_performBooleanOperation(BoolOpType                    opType,
        // Add B-mesh into C-mesh
        BOP_addMesh(&meshC, &meshBFacesId, &materials, obBProps, obBFaces, obBVertices, invertMeshB);
 
-       if (!meshC.isClosedMesh())
-               return BOP_NO_SOLID;
-
        // Perform the intersection boolean operation.
        BoolOpState result = BOP_intersectionBoolOp(&meshC, &meshAFacesId, &meshBFacesId, 
                                                                                                invertMeshA, invertMeshB);
@@ -131,9 +128,9 @@ BoolOpState BOP_performBooleanOperation(BoolOpType                    opType,
        // Invert the output mesh if is required
        *outputMesh = BOP_exportMesh(&meshC, &materials, outputProps, invertMeshC);
 
-#ifdef DEBUG
+       #ifdef DEBUG
        cout << "END BOP_performBooleanOperation" << endl;
-#endif
+       #endif
        
        return result;
 }
@@ -154,13 +151,13 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh*  meshC,
                                                                   bool       invertMeshA,
                                                                   bool       invertMeshB)
 {
-#ifdef DEBUG
+       #ifdef DEBUG
        BOP_Chrono chrono;
        float t = 0.0f;
        float c = 0.0f;
        chrono.start();  
        cout << "---" << endl;
-#endif
+       #endif
 
        // Create BSPs trees for mesh A & B
        BOP_BSPTree bspA;
@@ -171,10 +168,10 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh*  meshC,
        bspB.addMesh(meshC, *facesB);
        bspB.computeBox();
        
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "Create BSP     " << c << endl; 
-#endif
+       #endif
 
        unsigned int numVertices = meshC->getNumVertexs();
        
@@ -187,54 +184,54 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh*  meshC,
        if ((0.25*facesB->size()) > bspA.getDeep())
          BOP_meshFilter(meshC, facesB, &bspA);
        
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "mesh Filter    " << c << endl; 
-#endif
+       #endif
 
        // Face 2 Face
        BOP_Face2Face(meshC,facesA,facesB);
 
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "Face2Face      " << c << endl;
-#endif
+       #endif
 
        // BSP classification
        BOP_meshClassify(meshC,facesA,&bspB);
        BOP_meshClassify(meshC,facesB,&bspA);
        
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "Classification " << c << endl;
-#endif
+       #endif
        
        // Process overlapped faces
        BOP_removeOverlappedFaces(meshC,facesA,facesB);
        
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "Remove overlap " << c << endl;
-#endif
+       #endif
 
        // Sew two meshes
        BOP_sew(meshC,facesA,facesB);
 
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "Sew            " << c << endl;
-#endif
+       #endif
 
        // Merge faces
        BOP_Merge::getInstance().mergeFaces(meshC,numVertices);
 
-#ifdef DEBUG
+       #ifdef DEBUG
        c = chrono.stamp(); t += c;
        cout << "Merge faces    " << c << endl;
        cout << "Total          " << t << endl;
        // Test integrity
        meshC->testMesh();
-#endif
+       #endif
        
        return BOP_OK;
 }
index a7e7ef61e435e2fa2d84942187eb1ed2b73db347..24d5b3fb6a90b64df4cadd8865750a8ab36d99b8 100644 (file)
@@ -553,23 +553,6 @@ BOP_Index BOP_Mesh::replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex)
        return newIndex;
 }
 
-bool BOP_Mesh::isClosedMesh()
-{
-       for(unsigned int i=0; i<m_edges.size(); i++) {
-               BOP_Edge *edge = m_edges[i];
-               BOP_Indexs faces = edge->getFaces();
-               unsigned int count = 0;
-               const BOP_IT_Indexs facesEnd = faces.end();
-               for(BOP_IT_Indexs it = faces.begin();it!=facesEnd;it++) {
-                       if (m_faces[*it]->getTAG()!=BROKEN)
-                               count++;
-               }
-
-               if ((count%2)!=0) return false;
-       }
-
-       return true;
-}
 
 
 /** ***************************************************************************
index adc92c915594e9d50523b4173257fdc89ea6c258..6751df7c4e76058f12db0be546c4111acd447290 100644 (file)
@@ -82,7 +82,6 @@ public:
        unsigned int getNumVertexs(BOP_TAG tag);
        unsigned int getNumFaces(BOP_TAG tag);
        BOP_Index replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex);
-       bool isClosedMesh();
        
        // Debug functions
        void print();
index 77ba076885f9a64227c4c1d46afc4a6b463dfafe..453e6e20ea7346ffa919b84f9c5d6e04d986ed83 100755 (executable)
@@ -178,6 +178,7 @@ BSP_CSGMesh_FaceIt_Fill(
        // assume CSG_IteratorPtr is of the correct type.
        BSP_CSGMesh_FaceIt * face_it = (BSP_CSGMesh_FaceIt *)it;                
        // essentially iterating through a triangle fan here.
+       const int tri_index = face_it->face_triangle;
 
        if (face_it->pos->m_verts.size()>3) {
                // QUAD
index 9ea0ef60be51e72e3b5278e98d315e7f68346d80..6c9fecd88e14feb7703b5061cf10b350ae5b7757 100755 (executable)
  * Implementation of external api for CSG part of BSP lib interface.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "../extern/CSG_BooleanOps.h"
 #include "BSP_CSGMesh_CFIterator.h"
 #include "BSP_CSGMeshBuilder.h"
@@ -43,7 +47,7 @@
 #include "../../boolop/extern/BOP_Interface.h"
 #include <iostream>
 using namespace std;
-#include "BSP_MeshPrimitives.h"
+#include "BSP_MeshPrimitives.h";
 
 struct BSP_MeshInfo {
        BSP_CSGMesh *output_mesh;
@@ -99,20 +103,22 @@ CSG_DescibeOperands(
 /**
  * Compute the boolean operation, UNION, INTERSECION or DIFFERENCE
  */
-int
+       int
 CSG_PerformBooleanOperation(
-                                                       CSG_BooleanOperation                 *operation,
-                                                       CSG_OperationType                     op_type,
-                                                       CSG_FaceIteratorDescriptor            obAFaces,
-                                                       CSG_VertexIteratorDescriptor          obAVertices,
-                                                       CSG_FaceIteratorDescriptor            obBFaces,
-                                                       CSG_VertexIteratorDescriptor          obBVertices,
-                                                       CSG_InterpolateUserFaceVertexDataFunc interp_func
+       CSG_BooleanOperation                 *operation,
+       CSG_OperationType                     op_type,
+       CSG_FaceIteratorDescriptor            obAFaces,
+       CSG_VertexIteratorDescriptor          obAVertices,
+       CSG_FaceIteratorDescriptor            obBFaces,
+       CSG_VertexIteratorDescriptor          obBVertices,
+       CSG_InterpolateUserFaceVertexDataFunc interp_func
 ){
        if (operation == NULL) return 0;
        BSP_MeshInfo * mesh_info = static_cast<BSP_MeshInfo *>(operation->CSG_info);
        if (mesh_info == NULL) return 0;
 
+       bool success = 1;
+
        obAFaces.Reset(obAFaces.it);
        obBFaces.Reset(obBFaces.it);
        obAVertices.Reset(obAVertices.it);
@@ -122,39 +128,33 @@ CSG_PerformBooleanOperation(
        
        switch( op_type ) {
        case e_csg_union:
-               boolType = BOP_UNION;
-               break;
+         boolType = BOP_UNION;
+         break;
        case e_csg_difference:
-               boolType = BOP_DIFFERENCE;
-               break;
+         boolType = BOP_DIFFERENCE;
+         break;
        default:
-               boolType = BOP_INTERSECTION;
-               break;
+         boolType = BOP_INTERSECTION;
+         break;
        }
 
-       BoolOpState boolOpResult;
        try {
-               boolOpResult= BOP_performBooleanOperation( boolType,
-                                                                                                  mesh_info->output_descriptor,
-                                                                                                  (BSP_CSGMesh**) &(mesh_info->output_mesh),
-                                                                                                  mesh_info->obB_descriptor,
-                                                                                                  obBFaces,
-                                                                                                  obBVertices,
-                                                                                                  mesh_info->obA_descriptor,
-                                                                                                  obAFaces,
-                                                                                                  obAVertices,
-                                                                                                  interp_func );
+       BOP_performBooleanOperation( boolType,
+                                    mesh_info->output_descriptor,
+                                    (BSP_CSGMesh**) &(mesh_info->output_mesh),
+                                        mesh_info->obB_descriptor,
+                                        obBFaces,
+                                        obBVertices,
+                                        mesh_info->obA_descriptor,
+                                    obAFaces,
+                                    obAVertices,
+                                    interp_func );
        }
        catch(...) {
                return 0;
        }
 
-       switch (boolOpResult) {
-       case BOP_OK: return 1;
-       case BOP_NO_SOLID: return -2;
-       case BOP_ERROR: return 0;
-       default: return 1;
-       }
+       return success;
 }
 
        int
index 5d30b58a98230ac8a14332934360deeb08912632..3ef20b9be3af4aa302a94a4ce6d510c2135d82cb 100644 (file)
@@ -10,8 +10,6 @@ elbeem_env.Append(CPPDEFINES= [('ELBEEM_BLENDER',1)] );
 if use_fluidsim=='false':
        # print "El'Beem Fluid Simulation Disabled..." # debug
        elbeem_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
-       elbeem_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-       elbeem_env.Append(CPPDEFINES= 'ELBEEM_DUMMIES');
        # dummy interface build
        Sources = [ 
                "intern/utilities.cpp",
index 3111c9359dd6264b509e94420cf9f86d0413d023..4d672dee528bcecf9d2b9a944aeb0bf030bd5b8f 100644 (file)
@@ -9,30 +9,11 @@
  *
  *****************************************************************************/
  
-#ifdef ELBEEM_DUMMIES
-
 #include <stdlib.h>
-#include "ntl_vector3dim.h"
 
 extern "C" 
 int performElbeemSimulation(char *cfgfilename) {
-       return 1; // dummy
+       return 1;
 };
 
-// dummies from intern/elbeem/intern/solver_interface.cpp
-// for utilities.cpp
-
-void initGridSizes(int &sizex, int &sizey, int &sizez,
-               ntlVec3Gfx &geoStart, ntlVec3Gfx &geoEnd, 
-               int mMaxRefine, bool parallel) 
-{
-       // dummy
-}
-
-void calculateMemreqEstimate( int resx,int resy,int resz, int refine,
-               double *reqret, string *reqstr) {
-       *reqret =  0.0; // dummy
-}
-
-#endif // ELBEEM_DUMMIES
 
index 0bc9d96b5b23e98ec1f5ff3516de466a111c9d9c..472c692945111eaa05abda780fb238d8fedc855f 100644 (file)
@@ -430,16 +430,16 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    4,    1,    5,    6,    1,    1,    1,    1,    1,
-        1,    7,    8,    1,    9,   10,   11,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,   12,   13,   14,    1,
-       15,    1,    1,    1,   18,   19,   20,   21,   22,   23,
-       24,   25,   26,   27,   28,   29,   30,   31,   32,   33,
-       34,   35,   36,   37,   38,   39,   40,   41,   42,   34,
-        1,   16,    1,    1,   17,    1,   18,   19,   20,   21,
-
-       22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
-       32,   33,   34,   35,   36,   37,   38,   39,   40,   41,
-       42,   34,   43,    1,   44,    1,    1,    1,    1,    1,
+        1,    7,    1,    1,    8,    9,   10,   11,   11,   11,
+       11,   11,   11,   11,   11,   11,   11,   12,   13,    1,
+       14,    1,    1,    1,   17,   18,   19,   20,   21,   22,
+       23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
+       33,   34,   35,   36,   37,   38,   39,   40,   41,   33,
+        1,   15,    1,    1,   16,    1,   17,   18,   19,   20,
+
+       21,   22,   23,   24,   25,   26,   27,   28,   29,   30,
+       31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
+       41,   33,   42,    1,   43,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -456,103 +456,103 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static yyconst flex_int32_t yy_meta[45] =
+static yyconst flex_int32_t yy_meta[44] =
     {   0,
-        1,    2,    3,    4,    1,    1,    1,    5,    5,    6,
-        5,    6,    5,    2,    1,    5,    6,    6,    6,    6,
+        1,    2,    3,    4,    1,    1,    1,    5,    6,    5,
+        6,    5,    2,    1,    5,    6,    6,    6,    6,    6,
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
-        6,    6,    1,    1
+        6,    1,    1
     } ;
 
-static yyconst flex_int16_t yy_base[575] =
+static yyconst flex_int16_t yy_base[576] =
     {   0,
-        0,    0,   44,    0,   87,  130,  713,  714,   95,  714,
-      102,    0,    0,   84,  700,   96,   90,   85,   91,   92,
-       86,   83,  122,  689,   82,   85,  101,  111,  133,  118,
-      137,  128,  125,  677,  136,  124,  166,  167,  173,    0,
-      174,    0,  704,  177,  173,  714,  181,  185,  188,  191,
-      192,  703,    0,  695,  187,  694,  714,    0,  188,  668,
-      685,  175,  670,  665,  681,  180,  659,  167,  178,  190,
-      192,  678,  676,  668,  667,  657,  655,  200,  661,  653,
-      659,  666,  657,  182,  653,  657,  656,  658,  661,  652,
-      714,  660,  649,  191,  638,  205,  661,  199,  660,  641,
-
-      208,  643,  636,  639,  637,  231,  235,  236,  240,    0,
-      241,    0,  667,  666,  245,    0,  246,  714,    0,  644,
-      643,  229,  642,  645,  631,  637,  633,  632,  714,  625,
-      625,  628,  626,  620,  631,  627,  632,  714,  621,  617,
-      630,  625,  608,  619,  612,  617,  624,  609,  619,  615,
-      620,  606,  605,  617,  222,  608,  714,  611,  605,  604,
-      592,  607,  595,  609,  595,  608,  596,  606,  606,  603,
-      589,  586,  591,  599,  598,  597,  596,  580,  590,  252,
-      576,  592,  578,  575,  593,  590,  583,  584,  586,  575,
-      569,  567,  229,  585,  578,  570,  578,  561,  566,  575,
-
-      227,  575,  714,  573,  563,  571,  557,  553,  553,  571,
-      553,  569,  554,  714,  553,  562,  551,  714,  558,  557,
-      556,  542,  543,  551,  558,  553,  545,  541,  534,  536,
-      533,  539,  532,  537,  714,  714,  546,  543,  545,  541,
-      531,  543,  542,  530,  521,  538,  521,  533,  714,  529,
-      527,  714,  517,  516,  239,  528,  529,  512,  521,  714,
-      514,  527,  515,  507,  520,  504,  503,  504,  714,  501,
-      511,  494,  500,  505,  498,  511,  502,  714,  498,  503,
-      510,  488,  506,  490,  486,  483,  493,  499,  714,  488,
-      244,  501,  714,  477,  488,  714,  479,  485,  479,  487,
-
-      714,  474,  479,  475,  491,  488,  714,  485,  484,  473,
-      478,  486,  465,  479,  469,  478,  468,  478,  468,  466,
-      459,  714,  470,  714,  474,  470,  714,  448,  452,  466,
-      469,  455,  453,  464,  461,  456,  461,  443,  449,  460,
-      714,  456,  249,  458,  434,  714,  452,  444,  450,  434,
-      452,  432,  430,  449,  445,  245,  436,  425,  442,  421,
-      443,  425,  714,  422,  436,  435,  426,  429,  714,  412,
-      435,  423,  429,  426,  423,  419,  410,  714,  415,  419,
-      408,  412,  424,  415,  422,  404,  416,  416,  399,  400,
-      252,  714,  408,  238,  714,  397,  410,  400,  393,  397,
-
-      393,  402,  246,  407,  403,  402,  401,  385,  395,  714,
-      714,  714,  714,  387,  714,  399,  714,  385,  385,  396,
-      714,  378,  714,  383,  388,  391,  373,  378,  376,  714,
-      714,  382,  387,  384,  383,  369,  379,  714,  376,  714,
-      365,  379,  362,  358,  362,  364,  377,  359,  363,  363,
-      714,  362,  353,  369,  714,  366,  350,  355,  363,  349,
-      359,  364,  359,  344,  348,  359,  340,  344,  344,  341,
-      347,  347,  341,  714,  714,  335,  333,  350,  330,  333,
-      343,  714,  714,  714,  329,  714,  714,  338,  326,  325,
-      714,  714,  339,  318,  321,  714,  331,  330,  326,  334,
-
-      316,  334,  314,  328,  714,  714,  328,  316,  714,  316,
-      320,  714,  714,  714,  313,  714,  318,  325,  303,  714,
-      319,  315,  305,  714,  714,  261,  299,  300,  300,  278,
-      297,  277,  290,  714,  714,  287,  280,  268,  256,  254,
-      252,  252,  251,  714,  714,  256,  248,  231,  714,  228,
-      197,  714,  714,  207,  167,  149,  714,  150,  106,  714,
-      714,  101,  714,  714,  714,  294,  297,  303,   89,  309,
-      315,  321,  327,  333
+        0,    0,   43,   86,  128,  170,  704,  705,   60,  705,
+       63,    0,    0,   43,  692,   53,   50,   47,   53,   78,
+       47,   39,   87,  681,   43,   82,   54,   80,  117,   92,
+       93,  112,  116,  669,   99,  123,  138,  149,  152,    0,
+      141,    0,  695,  156,  101,  705,  157,  160,  163,  175,
+      180,  694,    0,  687,  176,  686,  705,    0,  177,  660,
+      677,  153,  662,  657,  673,  101,  651,  161,   46,  175,
+      178,  670,  668,  660,  659,  649,  647,  186,  653,  645,
+      651,  658,  649,  168,  645,  649,  648,  650,  653,  644,
+      705,  652,  641,  174,  630,  192,  653,  131,  652,  633,
+
+      198,  635,  628,  631,  629,  214,  219,  222,  226,    0,
+      227,    0,  658,  657,  230,    0,  235,  705,    0,  636,
+      635,  146,  634,  637,  623,  629,  625,  624,  705,  617,
+      617,  620,  618,  612,  623,  619,  624,  705,  613,  609,
+      622,  617,  600,  611,  604,  609,  616,  601,  611,  607,
+      612,  598,  597,  609,  206,  600,  705,  603,  597,  596,
+      584,  599,  587,  601,  587,  600,  588,  598,  598,  595,
+      581,  578,  583,  591,  590,  589,  588,  572,  582,  238,
+      568,  584,  570,  567,  585,  582,  575,  576,  578,  567,
+      561,  559,  183,  577,  570,  562,  570,  553,  558,  567,
+
+      216,  567,  705,  565,  555,  563,  549,  545,  545,  563,
+      545,  561,  546,  705,  545,  554,  543,  705,  550,  549,
+      548,  534,  535,  543,  550,  545,  537,  533,  526,  528,
+      525,  531,  524,  529,  705,  705,  538,  535,  537,  533,
+      523,  535,  534,  522,  513,  530,  513,  525,  705,  521,
+      519,  705,  509,  508,  221,  520,  521,  504,  513,  705,
+      506,  519,  507,  499,  512,  496,  495,  496,  705,  493,
+      503,  486,  492,  497,  490,  503,  494,  705,  490,  495,
+      502,  480,  498,  482,  478,  475,  485,  491,  705,  480,
+      193,  493,  705,  469,  480,  705,  471,  477,  471,  479,
+
+      705,  466,  471,  467,  483,  480,  705,  477,  476,  465,
+      470,  478,  457,  471,  461,  470,  460,  470,  460,  458,
+      451,  705,  462,  705,  466,  462,  705,  440,  444,  458,
+      461,  447,  445,  456,  453,  448,  453,  435,  441,  452,
+      705,  448,  221,  450,  426,  705,  444,  436,  442,  426,
+      444,  424,  422,  441,  437,  227,  428,  417,  434,  413,
+      435,  417,  705,  414,  428,  427,  418,  421,  705,  404,
+      427,  415,  421,  418,  415,  411,  402,  705,  407,  411,
+      400,  404,  416,  407,  414,  396,  408,  408,  391,  392,
+      227,  705,  400,  219,  705,  389,  402,  392,  385,  389,
+
+      385,  394,  231,  399,  395,  394,  393,  377,  387,  705,
+      705,  705,  705,  379,  705,  391,  705,  377,  377,  388,
+      705,  370,  705,  375,  380,  383,  365,  370,  368,  705,
+      705,  374,  379,  376,  375,  361,  371,  705,  368,  705,
+      357,  371,  354,  350,  354,  356,  369,  351,  355,  355,
+      705,  354,  345,  361,  705,  358,  342,  347,  355,  341,
+      351,  356,  351,  336,  340,  351,  332,  336,  336,  333,
+      339,  339,  333,  705,  705,  327,  325,  342,  322,  325,
+      335,  705,  705,  705,  321,  705,  705,  330,  318,  317,
+      705,  705,  331,  310,  313,  705,  323,  322,  318,  326,
+
+      308,  326,  306,  320,  705,  705,  320,  308,  705,  308,
+      312,  705,  705,  705,  305,  705,  310,  317,  295,  705,
+      311,  307,  300,  705,  705,  236,  299,  305,  309,  287,
+      306,  289,  302,  705,  705,  299,  296,  296,  281,  274,
+      267,  264,  263,  705,  705,  269,  258,  261,  705,  267,
+      250,  705,  705,  245,  225,  222,  705,  212,  166,  705,
+      705,  155,  705,  705,  705,  268,  274,  277,  283,  113,
+      289,  295,  301,  307,  313
     } ;
 
-static yyconst flex_int16_t yy_def[575] =
+static yyconst flex_int16_t yy_def[576] =
     {   0,
-      565,    1,  565,    3,  566,  566,  565,  565,  565,  565,
-      565,  567,  568,  565,  565,  565,  565,  565,  565,  565,
+      565,    1,  566,  566,  567,  567,  565,  565,  565,  565,
+      565,  568,  569,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
-      565,  565,  565,  565,  565,  565,  565,  565,  565,  569,
-      565,  570,  571,  572,  570,  565,  570,  570,  565,  565,
-      565,  567,  568,  565,  565,  565,  565,  573,  565,  565,
+      565,  565,  565,  565,  565,  565,  565,  565,  565,  570,
+      565,  571,  572,  573,  571,  565,  571,  571,  565,  565,
+      565,  568,  569,  565,  565,  565,  565,  574,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
 
-      565,  565,  565,  565,  565,  565,  565,  565,  565,  569,
-      565,  570,  571,  571,  572,  570,  574,  565,  573,  565,
+      565,  565,  565,  565,  565,  565,  565,  565,  565,  570,
+      565,  571,  572,  572,  573,  571,  575,  565,  574,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
-      565,  565,  565,  565,  565,  565,  565,  565,  565,  574,
+      565,  565,  565,  565,  565,  565,  565,  565,  565,  575,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
 
@@ -596,177 +596,175 @@ static yyconst flex_int16_t yy_def[575] =
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,    0,  565,  565,  565,  565,  565,
-      565,  565,  565,  565
+      565,  565,  565,  565,  565
     } ;
 
-static yyconst flex_int16_t yy_nxt[759] =
+static yyconst flex_int16_t yy_nxt[749] =
     {   0,
-        8,    9,   10,   11,   12,   13,    8,    8,   14,   15,
-       16,   17,    8,    8,    8,    8,    8,   18,   19,   20,
-       21,   22,   23,   24,    8,   25,    8,    8,   26,   27,
-       28,   29,   30,    8,   31,   32,   33,   34,   35,    8,
-        8,    8,   36,   37,    8,   38,   10,   39,    8,   13,
-        8,    8,    8,   40,   16,   40,    8,    8,   41,    8,
-       40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
-       40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
-       40,   40,   40,   40,   40,   40,   36,   37,    9,   10,
-       11,   43,   44,   54,  110,   55,   49,   45,   49,   54,
-
-       46,   59,   57,   49,   60,   49,   58,   70,   65,   68,
-       82,   71,   80,   72,   61,   62,   83,   81,   84,   66,
-       63,   64,   67,   69,   73,  106,   85,  106,   86,   47,
-       48,    9,   10,   11,   43,   44,  564,   50,   51,   74,
-       45,  563,   93,   46,   50,   51,  100,   75,   87,   94,
-       76,   88,   97,   77,   95,   89,   78,  104,   96,  101,
-       98,  105,   90,   91,   99,   92,  102,  107,  108,  107,
-      108,  562,   47,   48,  108,  111,  108,  111,   53,  116,
-       53,  109,  106,  117,  106,  561,  107,  109,  107,   49,
-       53,   49,  106,  107,  106,  107,   54,   54,   55,   59,
-
-      122,  127,  130,  560,  131,  128,  132,  133,  134,   50,
-       51,  123,  135,  136,  137,   50,   51,  144,  151,  161,
-      169,  145,  152,  170,  164,  173,  162,  165,  559,  174,
-       50,   51,  106,  558,  106,  166,  107,  108,  107,  108,
-      167,  111,  111,  111,  111,  175,   53,  119,   53,  119,
-      109,  183,  557,  119,  215,  119,  261,  262,   53,  119,
-      216,  343,  556,  252,  184,  119,  253,  309,  310,  388,
-      401,  311,  435,  438,  439,  447,  344,  402,   50,   51,
-      403,  537,  448,  555,  554,  389,  553,  552,  436,  551,
-      550,  549,  548,  538,   42,   42,   42,   42,   42,   42,
-
-       52,   52,   52,   53,   53,  547,   53,   53,   53,  112,
-      546,  545,  544,  112,  112,  113,  543,  542,  541,  113,
-      113,  115,  115,  540,  115,  115,  115,  119,  119,  539,
-      119,  119,  119,  180,  180,  536,  180,  180,  180,  535,
-      534,  533,  532,  531,  530,  529,  528,  527,  526,  525,
-      524,  523,  522,  521,  520,  519,  518,  517,  516,  515,
-      514,  513,  512,  511,  510,  509,  508,  507,  506,  505,
-      504,  503,  502,  501,  500,  499,  498,  497,  496,  495,
-      494,  493,  492,  491,  490,  489,  488,  487,  486,  485,
-      484,  483,  482,  481,  480,  479,  478,  477,  476,  475,
-
-      474,  473,  472,  471,  470,  469,  468,  467,  466,  465,
-      464,  463,  462,  461,  460,  459,  458,  457,  456,  455,
-      454,  453,  452,  451,  450,  449,  446,  445,  444,  443,
-      442,  441,  440,  437,  434,  433,  432,  431,  430,  429,
-      428,  427,  426,  425,  424,  423,  422,  421,  420,  419,
-      418,  417,  416,  415,  414,  413,  412,  411,  410,  409,
-      408,  407,  406,  405,  404,  400,  399,  398,  397,  396,
-      395,  394,  393,  392,  391,  390,  387,  386,  385,  384,
-      383,  382,  381,  380,  379,  378,  377,  376,  375,  374,
-      373,  372,  371,  370,  369,  368,  367,  366,  365,  364,
-
-      363,  362,  361,  360,  359,  358,  357,  356,  355,  354,
-      353,  352,  351,  350,  349,  348,  347,  346,  345,  342,
-      341,  340,  339,  338,  337,  336,  335,  334,  333,  332,
-      331,  330,  329,  328,  327,  326,  325,  324,  323,  322,
-      321,  320,  319,  318,  317,  316,  315,  314,  313,  312,
-      308,  307,  306,  305,  304,  303,  302,  301,  300,  299,
-      298,  297,  296,  295,  294,  293,  292,  291,  290,  289,
-      288,  287,  286,  285,  284,  283,  282,  281,  280,  279,
-      278,  277,  276,  275,  274,  273,  272,  271,  270,  269,
-      268,  267,  266,  265,  264,  263,  260,  259,  258,  257,
-
-      256,  255,  254,  251,  250,  249,  248,  247,  246,  245,
-      244,  243,  242,  241,  240,  239,  238,  237,  236,  235,
-      234,  233,  232,  231,  230,  229,  228,  227,  226,  225,
-      224,  223,  222,  221,  220,  219,  218,  217,  214,  213,
-      212,  211,  210,  209,  208,  207,  206,  205,  204,  203,
-      202,  201,  200,  199,  198,  197,  196,  195,  194,  193,
-      192,  191,  190,  189,  188,  187,  186,  185,  182,  181,
-      114,  114,  179,  178,  177,  176,  172,  171,  168,  163,
-      160,  159,  158,  157,  156,  155,  154,  153,  150,  149,
-      148,  147,  146,  143,  142,  141,  140,  139,  138,  129,
-
-      126,  125,  124,  121,  120,   56,   56,  118,  114,  103,
-       79,   56,  565,    7,  565,  565,  565,  565,  565,  565,
+        8,    9,   10,   11,   12,   13,    8,   14,   15,   16,
+       17,    8,    8,    8,    8,    8,   18,   19,   20,   21,
+       22,   23,   24,    8,   25,    8,    8,   26,   27,   28,
+       29,   30,    8,   31,   32,   33,   34,   35,    8,    8,
+        8,   36,   37,    8,   38,   10,   39,    8,   13,    8,
+        8,   54,   16,   55,    8,    8,   41,    8,   54,   57,
+       59,   49,   58,   49,   49,   60,   49,   70,   72,   65,
+       84,   71,   80,  132,  133,   61,   62,   81,   85,   73,
+       66,   63,   64,   67,   36,   37,    8,   38,   10,   39,
+        8,   13,    8,    8,   68,   16,   86,    8,    8,   41,
+
+        8,   50,   51,   74,   50,   51,   82,  116,   69,   95,
+      117,   75,   83,   96,   76,   93,   87,   77,  110,  104,
+       78,  127,   94,  105,  106,  128,  106,   36,   37,    9,
+       10,   11,   43,   44,   88,   97,  100,   45,   89,  107,
+       46,  107,  111,   98,  111,   90,   91,   99,   92,  101,
+      108,  169,  108,  108,  170,  108,  102,   53,  106,   53,
+      106,  107,  109,  107,   49,  109,   49,  183,   53,   47,
+       48,    9,   10,   11,   43,   44,  106,  122,  106,   45,
+      184,  107,   46,  107,   54,   54,   55,   59,  123,  564,
+       50,   51,  134,   50,   51,  130,  135,  131,  136,  137,
+
+      563,  161,  144,  151,   50,   51,  145,  152,  162,  343,
+      164,   47,   48,  165,  173,  106,  252,  106,  174,  253,
+      107,  166,  107,  108,  344,  108,  167,  111,  111,  111,
+      111,   53,  562,   53,  175,  109,  119,  215,  119,  119,
+      388,  119,   53,  216,  261,  262,  435,  119,  309,  310,
+      119,  401,  311,  438,  439,  537,  389,  561,  402,  447,
+      560,  403,  436,   50,   51,  559,  448,  538,   40,   40,
+       40,   40,   40,   40,   42,   42,   42,   42,   42,   42,
+       52,   52,   52,   53,   53,  558,   53,   53,   53,  112,
+      557,  556,  555,  112,  112,  113,  554,  553,  552,  113,
+
+      113,  115,  115,  551,  115,  115,  115,  119,  119,  550,
+      119,  119,  119,  180,  180,  549,  180,  180,  180,  548,
+      547,  546,  545,  544,  543,  542,  541,  540,  539,  536,
+      535,  534,  533,  532,  531,  530,  529,  528,  527,  526,
+      525,  524,  523,  522,  521,  520,  519,  518,  517,  516,
+      515,  514,  513,  512,  511,  510,  509,  508,  507,  506,
+      505,  504,  503,  502,  501,  500,  499,  498,  497,  496,
+      495,  494,  493,  492,  491,  490,  489,  488,  487,  486,
+      485,  484,  483,  482,  481,  480,  479,  478,  477,  476,
+      475,  474,  473,  472,  471,  470,  469,  468,  467,  466,
+
+      465,  464,  463,  462,  461,  460,  459,  458,  457,  456,
+      455,  454,  453,  452,  451,  450,  449,  446,  445,  444,
+      443,  442,  441,  440,  437,  434,  433,  432,  431,  430,
+      429,  428,  427,  426,  425,  424,  423,  422,  421,  420,
+      419,  418,  417,  416,  415,  414,  413,  412,  411,  410,
+      409,  408,  407,  406,  405,  404,  400,  399,  398,  397,
+      396,  395,  394,  393,  392,  391,  390,  387,  386,  385,
+      384,  383,  382,  381,  380,  379,  378,  377,  376,  375,
+      374,  373,  372,  371,  370,  369,  368,  367,  366,  365,
+      364,  363,  362,  361,  360,  359,  358,  357,  356,  355,
+
+      354,  353,  352,  351,  350,  349,  348,  347,  346,  345,
+      342,  341,  340,  339,  338,  337,  336,  335,  334,  333,
+      332,  331,  330,  329,  328,  327,  326,  325,  324,  323,
+      322,  321,  320,  319,  318,  317,  316,  315,  314,  313,
+      312,  308,  307,  306,  305,  304,  303,  302,  301,  300,
+      299,  298,  297,  296,  295,  294,  293,  292,  291,  290,
+      289,  288,  287,  286,  285,  284,  283,  282,  281,  280,
+      279,  278,  277,  276,  275,  274,  273,  272,  271,  270,
+      269,  268,  267,  266,  265,  264,  263,  260,  259,  258,
+      257,  256,  255,  254,  251,  250,  249,  248,  247,  246,
+
+      245,  244,  243,  242,  241,  240,  239,  238,  237,  236,
+      235,  234,  233,  232,  231,  230,  229,  228,  227,  226,
+      225,  224,  223,  222,  221,  220,  219,  218,  217,  214,
+      213,  212,  211,  210,  209,  208,  207,  206,  205,  204,
+      203,  202,  201,  200,  199,  198,  197,  196,  195,  194,
+      193,  192,  191,  190,  189,  188,  187,  186,  185,  182,
+      181,  114,  114,  179,  178,  177,  176,  172,  171,  168,
+      163,  160,  159,  158,  157,  156,  155,  154,  153,  150,
+      149,  148,  147,  146,  143,  142,  141,  140,  139,  138,
+      129,  126,  125,  124,  121,  120,   56,   56,  118,  114,
+
+      103,   79,   56,  565,    7,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565
     } ;
 
-static yyconst flex_int16_t yy_chk[759] =
+static yyconst flex_int16_t yy_chk[749] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    5,    5,
-        5,    5,    5,   14,  569,   14,    9,    5,    9,   17,
-
-        5,   17,   16,   11,   18,   11,   16,   21,   19,   20,
-       26,   21,   25,   22,   18,   18,   26,   25,   27,   19,
-       18,   18,   19,   20,   22,   36,   27,   36,   28,    5,
-        5,    6,    6,    6,    6,    6,  562,    9,    9,   23,
-        6,  559,   30,    6,   11,   11,   33,   23,   28,   30,
-       23,   29,   32,   23,   31,   29,   23,   35,   31,   33,
-       32,   35,   29,   29,   32,   29,   33,   37,   38,   37,
-       38,  558,    6,    6,   39,   41,   39,   41,   44,   45,
-       44,   38,   47,   45,   47,  556,   48,   39,   48,   49,
-       44,   49,   50,   51,   50,   51,   55,   59,   55,   59,
-
-       62,   66,   68,  555,   68,   66,   69,   69,   70,   38,
-       38,   62,   70,   71,   71,   39,   39,   78,   84,   94,
-       98,   78,   84,   98,   96,  101,   94,   96,  554,  101,
-       49,   49,  106,  551,  106,   96,  107,  108,  107,  108,
-       96,  109,  111,  109,  111,  101,  115,  117,  115,  117,
-      108,  122,  550,  180,  155,  180,  201,  201,  115,  117,
-      155,  291,  548,  193,  122,  180,  193,  255,  255,  343,
-      356,  255,  391,  394,  394,  403,  291,  356,  108,  108,
-      356,  526,  403,  547,  546,  343,  543,  542,  391,  541,
-      540,  539,  538,  526,  566,  566,  566,  566,  566,  566,
-
-      567,  567,  567,  568,  568,  537,  568,  568,  568,  570,
-      536,  533,  532,  570,  570,  571,  531,  530,  529,  571,
-      571,  572,  572,  528,  572,  572,  572,  573,  573,  527,
-      573,  573,  573,  574,  574,  523,  574,  574,  574,  522,
-      521,  519,  518,  517,  515,  511,  510,  508,  507,  504,
-      503,  502,  501,  500,  499,  498,  497,  495,  494,  493,
-      490,  489,  488,  485,  481,  480,  479,  478,  477,  476,
-      473,  472,  471,  470,  469,  468,  467,  466,  465,  464,
-      463,  462,  461,  460,  459,  458,  457,  456,  454,  453,
-      452,  450,  449,  448,  447,  446,  445,  444,  443,  442,
-
-      441,  439,  437,  436,  435,  434,  433,  432,  429,  428,
-      427,  426,  425,  424,  422,  420,  419,  418,  416,  414,
-      409,  408,  407,  406,  405,  404,  402,  401,  400,  399,
-      398,  397,  396,  393,  390,  389,  388,  387,  386,  385,
-      384,  383,  382,  381,  380,  379,  377,  376,  375,  374,
-      373,  372,  371,  370,  368,  367,  366,  365,  364,  362,
-      361,  360,  359,  358,  357,  355,  354,  353,  352,  351,
-      350,  349,  348,  347,  345,  344,  342,  340,  339,  338,
-      337,  336,  335,  334,  333,  332,  331,  330,  329,  328,
-      326,  325,  323,  321,  320,  319,  318,  317,  316,  315,
-
-      314,  313,  312,  311,  310,  309,  308,  306,  305,  304,
-      303,  302,  300,  299,  298,  297,  295,  294,  292,  290,
-      288,  287,  286,  285,  284,  283,  282,  281,  280,  279,
-      277,  276,  275,  274,  273,  272,  271,  270,  268,  267,
-      266,  265,  264,  263,  262,  261,  259,  258,  257,  256,
-      254,  253,  251,  250,  248,  247,  246,  245,  244,  243,
-      242,  241,  240,  239,  238,  237,  234,  233,  232,  231,
-      230,  229,  228,  227,  226,  225,  224,  223,  222,  221,
-      220,  219,  217,  216,  215,  213,  212,  211,  210,  209,
-      208,  207,  206,  205,  204,  202,  200,  199,  198,  197,
-
-      196,  195,  194,  192,  191,  190,  189,  188,  187,  186,
-      185,  184,  183,  182,  181,  179,  178,  177,  176,  175,
-      174,  173,  172,  171,  170,  169,  168,  167,  166,  165,
-      164,  163,  162,  161,  160,  159,  158,  156,  154,  153,
-      152,  151,  150,  149,  148,  147,  146,  145,  144,  143,
-      142,  141,  140,  139,  137,  136,  135,  134,  133,  132,
-      131,  130,  128,  127,  126,  125,  124,  123,  121,  120,
-      114,  113,  105,  104,  103,  102,  100,   99,   97,   95,
-       93,   92,   90,   89,   88,   87,   86,   85,   83,   82,
-       81,   80,   79,   77,   76,   75,   74,   73,   72,   67,
-
-       65,   64,   63,   61,   60,   56,   54,   52,   43,   34,
-       24,   15,    7,  565,  565,  565,  565,  565,  565,  565,
+        1,    1,    1,    3,    3,    3,    3,    3,    3,    3,
+        3,   14,    3,   14,    3,    3,    3,    3,   17,   16,
+       17,    9,   16,    9,   11,   18,   11,   21,   22,   19,
+       27,   21,   25,   69,   69,   18,   18,   25,   27,   22,
+       19,   18,   18,   19,    3,    3,    4,    4,    4,    4,
+        4,    4,    4,    4,   20,    4,   28,    4,    4,    4,
+
+        4,    9,    9,   23,   11,   11,   26,   45,   20,   31,
+       45,   23,   26,   31,   23,   30,   28,   23,  570,   35,
+       23,   66,   30,   35,   36,   66,   36,    4,    4,    5,
+        5,    5,    5,    5,   29,   32,   33,    5,   29,   37,
+        5,   37,   41,   32,   41,   29,   29,   32,   29,   33,
+       38,   98,   38,   39,   98,   39,   33,   44,   47,   44,
+       47,   48,   38,   48,   49,   39,   49,  122,   44,    5,
+        5,    6,    6,    6,    6,    6,   50,   62,   50,    6,
+      122,   51,    6,   51,   55,   59,   55,   59,   62,  562,
+       38,   38,   70,   39,   39,   68,   70,   68,   71,   71,
+
+      559,   94,   78,   84,   49,   49,   78,   84,   94,  291,
+       96,    6,    6,   96,  101,  106,  193,  106,  101,  193,
+      107,   96,  107,  108,  291,  108,   96,  109,  111,  109,
+      111,  115,  558,  115,  101,  108,  117,  155,  117,  180,
+      343,  180,  115,  155,  201,  201,  391,  117,  255,  255,
+      180,  356,  255,  394,  394,  526,  343,  556,  356,  403,
+      555,  356,  391,  108,  108,  554,  403,  526,  566,  566,
+      566,  566,  566,  566,  567,  567,  567,  567,  567,  567,
+      568,  568,  568,  569,  569,  551,  569,  569,  569,  571,
+      550,  548,  547,  571,  571,  572,  546,  543,  542,  572,
+
+      572,  573,  573,  541,  573,  573,  573,  574,  574,  540,
+      574,  574,  574,  575,  575,  539,  575,  575,  575,  538,
+      537,  536,  533,  532,  531,  530,  529,  528,  527,  523,
+      522,  521,  519,  518,  517,  515,  511,  510,  508,  507,
+      504,  503,  502,  501,  500,  499,  498,  497,  495,  494,
+      493,  490,  489,  488,  485,  481,  480,  479,  478,  477,
+      476,  473,  472,  471,  470,  469,  468,  467,  466,  465,
+      464,  463,  462,  461,  460,  459,  458,  457,  456,  454,
+      453,  452,  450,  449,  448,  447,  446,  445,  444,  443,
+      442,  441,  439,  437,  436,  435,  434,  433,  432,  429,
+
+      428,  427,  426,  425,  424,  422,  420,  419,  418,  416,
+      414,  409,  408,  407,  406,  405,  404,  402,  401,  400,
+      399,  398,  397,  396,  393,  390,  389,  388,  387,  386,
+      385,  384,  383,  382,  381,  380,  379,  377,  376,  375,
+      374,  373,  372,  371,  370,  368,  367,  366,  365,  364,
+      362,  361,  360,  359,  358,  357,  355,  354,  353,  352,
+      351,  350,  349,  348,  347,  345,  344,  342,  340,  339,
+      338,  337,  336,  335,  334,  333,  332,  331,  330,  329,
+      328,  326,  325,  323,  321,  320,  319,  318,  317,  316,
+      315,  314,  313,  312,  311,  310,  309,  308,  306,  305,
+
+      304,  303,  302,  300,  299,  298,  297,  295,  294,  292,
+      290,  288,  287,  286,  285,  284,  283,  282,  281,  280,
+      279,  277,  276,  275,  274,  273,  272,  271,  270,  268,
+      267,  266,  265,  264,  263,  262,  261,  259,  258,  257,
+      256,  254,  253,  251,  250,  248,  247,  246,  245,  244,
+      243,  242,  241,  240,  239,  238,  237,  234,  233,  232,
+      231,  230,  229,  228,  227,  226,  225,  224,  223,  222,
+      221,  220,  219,  217,  216,  215,  213,  212,  211,  210,
+      209,  208,  207,  206,  205,  204,  202,  200,  199,  198,
+      197,  196,  195,  194,  192,  191,  190,  189,  188,  187,
+
+      186,  185,  184,  183,  182,  181,  179,  178,  177,  176,
+      175,  174,  173,  172,  171,  170,  169,  168,  167,  166,
+      165,  164,  163,  162,  161,  160,  159,  158,  156,  154,
+      153,  152,  151,  150,  149,  148,  147,  146,  145,  144,
+      143,  142,  141,  140,  139,  137,  136,  135,  134,  133,
+      132,  131,  130,  128,  127,  126,  125,  124,  123,  121,
+      120,  114,  113,  105,  104,  103,  102,  100,   99,   97,
+       95,   93,   92,   90,   89,   88,   87,   86,   85,   83,
+       82,   81,   80,   79,   77,   76,   75,   74,   73,   72,
+       67,   65,   64,   63,   61,   60,   56,   54,   52,   43,
+
+       34,   24,   15,    7,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
       565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
@@ -802,11 +800,10 @@ char *yy_text;
 /* this header file is automatically generated by bison 
  * and includes all token definitions, as well as yy_lval */
 #if ELBEEM_BLENDER==1
-// for blender the headers have to be .h 
 #include "cfgparser.h"
-#else 
+#else // ELBEEM_BLENDER==1
 #include "cfgparser.hpp"
-#endif
+#endif // ELBEEM_BLENDER==1
 #include "utilities.h"
 
 #include <string.h>
@@ -828,7 +825,7 @@ extern "C" int yy_wrap (void ) { return 1; }
  * rules start 
  */
 /*----------------------------------------------------------------------------*/
-#line 832 "<stdout>"
+#line 829 "<stdout>"
 
 #define INITIAL 0
 #define ATTR 1
@@ -981,11 +978,11 @@ YY_DECL
        register char *yy_cp, *yy_bp;
        register int yy_act;
     
-#line 55 "src/cfglexer.ll"
+#line 54 "src/cfglexer.ll"
 
 
 
-#line 989 "<stdout>"
+#line 986 "<stdout>"
 
        if ( (yy_init) )
                {
@@ -1066,25 +1063,25 @@ do_action:      /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 58 "src/cfglexer.ll"
+#line 57 "src/cfglexer.ll"
 { return KW_PAROPEN; }
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 59 "src/cfglexer.ll"
+#line 58 "src/cfglexer.ll"
 { BEGIN(INITIAL); // '}' always closes scopes
                        return KW_PARCLOSE; }
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 62 "src/cfglexer.ll"
+#line 61 "src/cfglexer.ll"
 { 
                        BEGIN(ATTRVALUE);
                        return KW_EQUALS; }
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 65 "src/cfglexer.ll"
+#line 64 "src/cfglexer.ll"
 { /* attribute name = normal string */
                strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
                yy_lval.charValue = charBuffer;
@@ -1094,7 +1091,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 71 "src/cfglexer.ll"
+#line 70 "src/cfglexer.ll"
 { /* quoted string! attribute name = normal string */
                strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
                        /* get rid of " " */
@@ -1105,7 +1102,7 @@ YY_RULE_SETUP
        YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 78 "src/cfglexer.ll"
+#line 77 "src/cfglexer.ll"
 { /* ends at newline or ';' */
                strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
                yy_lval.charValue = charBuffer;
@@ -1113,433 +1110,433 @@ YY_RULE_SETUP
        YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 82 "src/cfglexer.ll"
+#line 81 "src/cfglexer.ll"
 { /* return end token... */
                        BEGIN(ATTR); 
                        return KW_ATTREND; }
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 87 "src/cfglexer.ll"
+#line 86 "src/cfglexer.ll"
 { return KW_LBMSIM; }
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 88 "src/cfglexer.ll"
+#line 87 "src/cfglexer.ll"
 { return KW_COMPARELBM; }
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 89 "src/cfglexer.ll"
+#line 88 "src/cfglexer.ll"
 { return KW_DEBUGMODE; }
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 90 "src/cfglexer.ll"
+#line 89 "src/cfglexer.ll"
 { return KW_DEBUGLEVEL; }
        YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 91 "src/cfglexer.ll"
+#line 90 "src/cfglexer.ll"
 { return KW_RAYTRACING; }
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 94 "src/cfglexer.ll"
+#line 93 "src/cfglexer.ll"
 { return KW_RESOLUTION; }
        YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 95 "src/cfglexer.ll"
+#line 94 "src/cfglexer.ll"
 { return KW_ANTIALIAS; }
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 96 "src/cfglexer.ll"
+#line 95 "src/cfglexer.ll"
 { return KW_EYEPOINT; }
        YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 97 "src/cfglexer.ll"
+#line 96 "src/cfglexer.ll"
 { return KW_LOOKAT ; }
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 98 "src/cfglexer.ll"
+#line 97 "src/cfglexer.ll"
 { return KW_UPVEC ; }
        YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 99 "src/cfglexer.ll"
+#line 98 "src/cfglexer.ll"
 { return KW_FOVY; }
        YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 100 "src/cfglexer.ll"
+#line 99 "src/cfglexer.ll"
 { return KW_ASPECT ; }
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 101 "src/cfglexer.ll"
+#line 100 "src/cfglexer.ll"
 { return KW_AMBIENCE; }
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 102 "src/cfglexer.ll"
+#line 101 "src/cfglexer.ll"
 { return KW_BACKGROUND; }
        YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 103 "src/cfglexer.ll"
+#line 102 "src/cfglexer.ll"
 { return KW_ANISTART; }
        YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 104 "src/cfglexer.ll"
+#line 103 "src/cfglexer.ll"
 { return KW_ANIFRAMES; }
        YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 105 "src/cfglexer.ll"
+#line 104 "src/cfglexer.ll"
 { return KW_ANIFRAMETIME; }
        YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 106 "src/cfglexer.ll"
+#line 105 "src/cfglexer.ll"
 { return KW_FRAMESKIP; }
        YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 107 "src/cfglexer.ll"
+#line 106 "src/cfglexer.ll"
 { return KW_FILENAME; }
        YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 108 "src/cfglexer.ll"
+#line 107 "src/cfglexer.ll"
 { return KW_PMCAUSTICS; }
        YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 109 "src/cfglexer.ll"
+#line 108 "src/cfglexer.ll"
 { return KW_CAUSTICDIST; }
        YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 110 "src/cfglexer.ll"
+#line 109 "src/cfglexer.ll"
 { return KW_CAUSTICPHOT; }
        YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 111 "src/cfglexer.ll"
+#line 110 "src/cfglexer.ll"
 { return KW_SHADOWMAPBIAS; }
        YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 112 "src/cfglexer.ll"
+#line 111 "src/cfglexer.ll"
 { return KW_MAXRAYDEPTH; }
        YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 113 "src/cfglexer.ll"
+#line 112 "src/cfglexer.ll"
 { return KW_TREEMAXDEPTH; }
        YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 114 "src/cfglexer.ll"
+#line 113 "src/cfglexer.ll"
 { return KW_TREEMAXTRIANGLES; }
        YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 115 "src/cfglexer.ll"
+#line 114 "src/cfglexer.ll"
 { return KW_DEBUGPIXEL; }
        YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 116 "src/cfglexer.ll"
+#line 115 "src/cfglexer.ll"
 { return KW_TESTMODE; }
        YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 117 "src/cfglexer.ll"
+#line 116 "src/cfglexer.ll"
 { return KW_OPENGLATTR; }
        YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 118 "src/cfglexer.ll"
+#line 117 "src/cfglexer.ll"
 { return KW_BLENDERATTR; }
        YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 120 "src/cfglexer.ll"
+#line 119 "src/cfglexer.ll"
 { return KW_OBJATTR; /* assign attr to obj */ }
        YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 121 "src/cfglexer.ll"
+#line 120 "src/cfglexer.ll"
 { BEGIN(ATTR); return KW_ATTRIBUTE;  /* global attr list */ }
        YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 122 "src/cfglexer.ll"
+#line 121 "src/cfglexer.ll"
 { BEGIN(ATTR); return KW_DEFINEATTR; /* obj defines new attrs */ }
        YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 123 "src/cfglexer.ll"
+#line 122 "src/cfglexer.ll"
 { BEGIN(ATTR); return KW_DEFINEATTR; }
        YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 124 "src/cfglexer.ll"
+#line 123 "src/cfglexer.ll"
 { BEGIN(ATTR); return KW_DEFINEATTR; }
        YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 126 "src/cfglexer.ll"
+#line 125 "src/cfglexer.ll"
 { return KW_GEOMETRY; }
        YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 127 "src/cfglexer.ll"
+#line 126 "src/cfglexer.ll"
 { return KW_TYPE; }
        YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 128 "src/cfglexer.ll"
+#line 127 "src/cfglexer.ll"
 { return KW_GEOTYPE_BOX; }
        YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 129 "src/cfglexer.ll"
+#line 128 "src/cfglexer.ll"
 { return KW_GEOTYPE_SPHERE; }
        YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 130 "src/cfglexer.ll"
+#line 129 "src/cfglexer.ll"
 { return KW_GEOTYPE_OBJMODEL; }
        YY_BREAK
 case 48:
 YY_RULE_SETUP
-#line 131 "src/cfglexer.ll"
+#line 130 "src/cfglexer.ll"
 { return KW_CASTSHADOWS; }  
        YY_BREAK
 case 49:
 YY_RULE_SETUP
-#line 132 "src/cfglexer.ll"
+#line 131 "src/cfglexer.ll"
 { return KW_RECEIVESHADOWS ; }
        YY_BREAK
 case 50:
 YY_RULE_SETUP
-#line 133 "src/cfglexer.ll"
+#line 132 "src/cfglexer.ll"
 { return KW_VISIBLE; }  
        YY_BREAK
 case 51:
 YY_RULE_SETUP
-#line 134 "src/cfglexer.ll"
+#line 133 "src/cfglexer.ll"
 { return KW_BOX_START; }
        YY_BREAK
 case 52:
 YY_RULE_SETUP
-#line 135 "src/cfglexer.ll"
+#line 134 "src/cfglexer.ll"
 { return KW_BOX_END; }
        YY_BREAK
 case 53:
 YY_RULE_SETUP
-#line 136 "src/cfglexer.ll"
+#line 135 "src/cfglexer.ll"
 { return KW_POLY ; }
        YY_BREAK
 case 54:
 YY_RULE_SETUP
-#line 137 "src/cfglexer.ll"
+#line 136 "src/cfglexer.ll"
 { return KW_POLY ; }
        YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 138 "src/cfglexer.ll"
+#line 137 "src/cfglexer.ll"
 { return KW_NUMVERTICES; }
        YY_BREAK
 case 56:
 YY_RULE_SETUP
-#line 139 "src/cfglexer.ll"
+#line 138 "src/cfglexer.ll"
 { return KW_VERTEX; }
        YY_BREAK
 case 57:
 YY_RULE_SETUP
-#line 140 "src/cfglexer.ll"
+#line 139 "src/cfglexer.ll"
 { return KW_NUMPOLYGONS; }
        YY_BREAK
 case 58:
 YY_RULE_SETUP
-#line 141 "src/cfglexer.ll"
+#line 140 "src/cfglexer.ll"
 { return KW_ISOSURF; }  
        YY_BREAK
 case 59:
 YY_RULE_SETUP
-#line 142 "src/cfglexer.ll"
+#line 141 "src/cfglexer.ll"
 { return KW_FILEMODE; }  
        YY_BREAK
 case 60:
 YY_RULE_SETUP
-#line 143 "src/cfglexer.ll"
+#line 142 "src/cfglexer.ll"
 { return KW_INVERT; }  
        YY_BREAK
 case 61:
 YY_RULE_SETUP
-#line 145 "src/cfglexer.ll"
+#line 144 "src/cfglexer.ll"
 { return KW_MATERIAL; }
        YY_BREAK
 case 62:
 YY_RULE_SETUP
-#line 146 "src/cfglexer.ll"
+#line 145 "src/cfglexer.ll"
 { return KW_MATTYPE_PHONG; }
        YY_BREAK
 case 63:
 YY_RULE_SETUP
-#line 147 "src/cfglexer.ll"
+#line 146 "src/cfglexer.ll"
 { return KW_MATTYPE_BLINN; }
        YY_BREAK
 case 64:
 YY_RULE_SETUP
-#line 148 "src/cfglexer.ll"
+#line 147 "src/cfglexer.ll"
 { return KW_NAME; }
        YY_BREAK
 case 65:
 YY_RULE_SETUP
-#line 149 "src/cfglexer.ll"
+#line 148 "src/cfglexer.ll"
 { return KW_AMBIENT; }
        YY_BREAK
 case 66:
 YY_RULE_SETUP
-#line 150 "src/cfglexer.ll"
+#line 149 "src/cfglexer.ll"
 { return KW_DIFFUSE; }
        YY_BREAK
 case 67:
 YY_RULE_SETUP
-#line 151 "src/cfglexer.ll"
+#line 150 "src/cfglexer.ll"
 { return KW_SPECULAR; }
        YY_BREAK
 case 68:
 YY_RULE_SETUP
-#line 152 "src/cfglexer.ll"
+#line 151 "src/cfglexer.ll"
 { return KW_MIRROR; }
        YY_BREAK
 case 69:
 YY_RULE_SETUP
-#line 153 "src/cfglexer.ll"
+#line 152 "src/cfglexer.ll"
 { return KW_TRANSPARENCE; }
        YY_BREAK
 case 70:
 YY_RULE_SETUP
-#line 154 "src/cfglexer.ll"
+#line 153 "src/cfglexer.ll"
 { return KW_REFRACINDEX; }
        YY_BREAK
 case 71:
 YY_RULE_SETUP
-#line 155 "src/cfglexer.ll"
+#line 154 "src/cfglexer.ll"
 { return KW_TRANSADDITIVE; }
        YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 156 "src/cfglexer.ll"
+#line 155 "src/cfglexer.ll"
 { return KW_TRANSATTCOL; }
        YY_BREAK
 case 73:
 YY_RULE_SETUP
-#line 157 "src/cfglexer.ll"
+#line 156 "src/cfglexer.ll"
 { return KW_FRESNEL; }
        YY_BREAK
 case 74:
 YY_RULE_SETUP
-#line 158 "src/cfglexer.ll"
+#line 157 "src/cfglexer.ll"
 { return KW_FRESNEL; }
        YY_BREAK
 case 75:
 YY_RULE_SETUP
-#line 160 "src/cfglexer.ll"
+#line 159 "src/cfglexer.ll"
 { return KW_LIGHT; }
        YY_BREAK
 case 76:
 YY_RULE_SETUP
-#line 161 "src/cfglexer.ll"
+#line 160 "src/cfglexer.ll"
 { return KW_LIGHT_OMNI; }
        YY_BREAK
 case 77:
 YY_RULE_SETUP
-#line 162 "src/cfglexer.ll"
+#line 161 "src/cfglexer.ll"
 { return KW_ACTIVE; }
        YY_BREAK
 case 78:
 YY_RULE_SETUP
-#line 163 "src/cfglexer.ll"
+#line 162 "src/cfglexer.ll"
 { return KW_COLOUR; }
        YY_BREAK
 case 79:
 YY_RULE_SETUP
-#line 164 "src/cfglexer.ll"
+#line 163 "src/cfglexer.ll"
 { return KW_COLOUR; }
        YY_BREAK
 case 80:
 YY_RULE_SETUP
-#line 165 "src/cfglexer.ll"
+#line 164 "src/cfglexer.ll"
 { return KW_POSITION; }
        YY_BREAK
 case 81:
 YY_RULE_SETUP
-#line 166 "src/cfglexer.ll"
+#line 165 "src/cfglexer.ll"
 { return KW_CAUSTICPHOTONS; }
        YY_BREAK
 case 82:
 YY_RULE_SETUP
-#line 167 "src/cfglexer.ll"
+#line 166 "src/cfglexer.ll"
 { return KW_CAUSTICSTRENGTH; }
        YY_BREAK
 case 83:
 YY_RULE_SETUP
-#line 168 "src/cfglexer.ll"
+#line 167 "src/cfglexer.ll"
 { return KW_SHADOWMAP; }
        YY_BREAK
 case 84:
 YY_RULE_SETUP
-#line 169 "src/cfglexer.ll"
+#line 168 "src/cfglexer.ll"
 { return KW_CAUSTICSMAP; }
        YY_BREAK
 case 85:
 YY_RULE_SETUP
-#line 171 "src/cfglexer.ll"
+#line 170 "src/cfglexer.ll"
 { yy_lval.intValue = 1; return DT_INTEGER; }
        YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 172 "src/cfglexer.ll"
+#line 171 "src/cfglexer.ll"
 { yy_lval.intValue = 0; return DT_INTEGER; }
        YY_BREAK
 case 87:
 YY_RULE_SETUP
-#line 173 "src/cfglexer.ll"
+#line 172 "src/cfglexer.ll"
 { yy_lval.intValue = 1; return DT_INTEGER; }
        YY_BREAK
 case 88:
 YY_RULE_SETUP
-#line 174 "src/cfglexer.ll"
+#line 173 "src/cfglexer.ll"
 { yy_lval.intValue = 0; return DT_INTEGER; }
        YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 177 "src/cfglexer.ll"
+#line 176 "src/cfglexer.ll"
 { // integer number
   yy_lval.intValue = atoi( yy_text );
   return DT_INTEGER; }
        YY_BREAK
 case 90:
 YY_RULE_SETUP
-#line 181 "src/cfglexer.ll"
+#line 180 "src/cfglexer.ll"
 { // floating point number
   yy_lval.floatValue = atof( yy_text );
   return DT_FLOAT; }
        YY_BREAK
 case 91:
 YY_RULE_SETUP
-#line 185 "src/cfglexer.ll"
+#line 184 "src/cfglexer.ll"
 { /* normal character strings, now also for paths/filenames */
   strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
        /* get rid of " " */
@@ -1550,17 +1547,17 @@ YY_RULE_SETUP
        YY_BREAK
 case 92:
 YY_RULE_SETUP
-#line 193 "src/cfglexer.ll"
+#line 192 "src/cfglexer.ll"
 { /* one line comment */  }
        YY_BREAK
 case 93:
 YY_RULE_SETUP
-#line 194 "src/cfglexer.ll"
+#line 193 "src/cfglexer.ll"
 { /* one line comment */  }
        YY_BREAK
 case 94:
 YY_RULE_SETUP
-#line 195 "src/cfglexer.ll"
+#line 194 "src/cfglexer.ll"
 { /* multiline comment */
        register int c; 
        for ( ; ; )     {
@@ -1586,26 +1583,26 @@ YY_RULE_SETUP
 case 95:
 /* rule 95 can match eol */
 YY_RULE_SETUP
-#line 219 "src/cfglexer.ll"
+#line 218 "src/cfglexer.ll"
 { // count line numbers
   lineCount++; }
        YY_BREAK
 case 96:
 YY_RULE_SETUP
-#line 222 "src/cfglexer.ll"
+#line 221 "src/cfglexer.ll"
 { /* do nothing by default... */ }
        YY_BREAK
 case 97:
 YY_RULE_SETUP
-#line 224 "src/cfglexer.ll"
+#line 223 "src/cfglexer.ll"
 { /*errorOut( "cfgLexer, Line "<<lineCount<<" : Unknown character '"<<(char)yyinput()<<"' " ); xit(1); */ }
        YY_BREAK
 case 98:
 YY_RULE_SETUP
-#line 227 "src/cfglexer.ll"
+#line 226 "src/cfglexer.ll"
 ECHO;
        YY_BREAK
-#line 1609 "<stdout>"
+#line 1606 "<stdout>"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(ATTR):
 case YY_STATE_EOF(ATTRVALUE):
@@ -2570,4 +2567,4 @@ void yy_free (void * ptr )
 #undef YY_DECL_IS_OURS
 #undef YY_DECL
 #endif
-#line 227 "src/cfglexer.ll"
+#line 226 "src/cfglexer.ll"
index f2c4451233848a38188d54d08d5cc5af238620ac..afd4c345ccd4680787c443526642d34352988845 100644 (file)
@@ -273,9 +273,6 @@ ECHO Done
                        <File
                                RelativePath="..\..\intern\ntl_scene.cpp">
                        </File>
-                       <File
-                               RelativePath="..\..\intern\ntl_world.cpp">
-                       </File>
                        <File
                                RelativePath="..\..\intern\parametrizer.cpp">
                        </File>
@@ -285,18 +282,6 @@ ECHO Done
                        <File
                                RelativePath="..\..\intern\simulation_object.cpp">
                        </File>
-                       <File
-                               RelativePath="..\..\intern\solver_init.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\intern\solver_interface.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\intern\solver_main.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\intern\solver_util.cpp">
-                       </File>
                        <File
                                RelativePath="..\..\intern\utilities.cpp">
                        </File>
@@ -311,9 +296,6 @@ ECHO Done
                        <File
                                RelativePath="..\..\intern\cfgparser.h">
                        </File>
-                       <File
-                               RelativePath="..\..\intern\elbeem.h">
-                       </File>
                        <File
                                RelativePath="..\..\intern\globals.h">
                        </File>
@@ -368,9 +350,6 @@ ECHO Done
                        <File
                                RelativePath="..\..\intern\ntl_vector3dim.h">
                        </File>
-                       <File
-                               RelativePath="..\..\intern\ntl_world.h">
-                       </File>
                        <File
                                RelativePath="..\..\intern\parametrizer.h">
                        </File>
@@ -380,18 +359,6 @@ ECHO Done
                        <File
                                RelativePath="..\..\intern\simulation_object.h">
                        </File>
-                       <File
-                               RelativePath="..\..\intern\solver_class.h">
-                       </File>
-                       <File
-                               RelativePath="..\..\intern\solver_dimenions.h">
-                       </File>
-                       <File
-                               RelativePath="..\..\intern\solver_interface.h">
-                       </File>
-                       <File
-                               RelativePath="..\..\intern\solver_relax.h">
-                       </File>
                        <File
                                RelativePath="..\..\intern\utilities.h">
                        </File>
index fa2f788823fba3413ecda2176f53200cf5cd4b50..61a2b83011b662cf77901471248a873e89fb7431 100644 (file)
@@ -67,19 +67,19 @@ public:
         * Returns the timer callback.
         * @return The timer callback.
         */
-       virtual GHOST_TimerProcPtr getTimerProc() const = 0;
+       inline virtual GHOST_TimerProcPtr getTimerProc() const = 0;
 
        /**
         * Changes the timer callback.
         * @param timerProc The timer callback.
         */
-       virtual void setTimerProc(const GHOST_TimerProcPtr timerProc) = 0;
+       inline virtual void setTimerProc(const GHOST_TimerProcPtr timerProc) = 0;
 
        /**
         * Returns the timer user data.
         * @return The timer user data.
         */
-       virtual GHOST_TUserDataPtr getUserData() const = 0;
+       inline virtual GHOST_TUserDataPtr getUserData() const = 0;
        
        /**
         * Changes the time user data.
index 903d1e4498da24c566326eb54c849bf4ba0b7226..bd15df3dba8580bc0a15ac6a8cae826c7a2820d0 100644 (file)
@@ -79,7 +79,7 @@ public:
         * Returns the type of drawing context used in this window.
         * @return The current type of drawing context.
         */
-       virtual GHOST_TDrawingContextType getDrawingContextType() = 0;
+       inline virtual GHOST_TDrawingContextType getDrawingContextType() = 0;
 
        /**
         * Tries to install a rendering context in this window.
@@ -193,7 +193,7 @@ public:
         * Returns the window user data.
         * @return The window user data.
         */
-       virtual GHOST_TUserDataPtr getUserData() const = 0;
+       inline virtual GHOST_TUserDataPtr getUserData() const = 0;
        
        /**
         * Changes the window user data.
index ee76349ededded616172d377408535fed415fcf0..d1caadab219edcf7f5d180fbe1c71d9f930f8b0d 100644 (file)
@@ -655,7 +655,6 @@ OSStatus GHOST_SystemCarbon::handleWindowEvent(EventRef event)
                        case kEventWindowActivated:
                                m_windowManager->setActiveWindow(window);
                                window->loadCursor(window->getCursorVisibility(), window->getCursorShape());
-                               window->updateDrawingContext();
                                pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window) );
                                break;
                        case kEventWindowDeactivated:
@@ -664,7 +663,6 @@ OSStatus GHOST_SystemCarbon::handleWindowEvent(EventRef event)
                                break;
                        case kEventWindowUpdate:
                                //if (getFullScreen()) GHOST_PRINT("GHOST_SystemCarbon::handleWindowEvent(): full-screen update event\n");
-                               window->updateDrawingContext();
                                pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) );
                                break;
                        case kEventWindowBoundsChanged:
index 919eeb739ce08ef48160e82fa4959fce2be17e48..23960a9550b0eeedb6902209c4f44b670d8ab643 100644 (file)
 #include <list>
 using namespace std;
 
-class IK_QSolver {
-public:
-       IK_QSolver() {};
-
+typedef struct {
        IK_QJacobianSolver solver;
        IK_QSegment *root;
        std::list<IK_QTask*> tasks;
-};
+} IK_QSolver;
 
 IK_QSegment *CreateSegment(int flag, bool translate)
 {
index c6d701b30fcdc0a9eb70087a4ca8599c8f73e578..46eb11004757853ee677eb1584a72759a43c5cf3 100644 (file)
@@ -39,6 +39,7 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <iostream>
+#include <strstream>
 #ifdef TNT_USE_REGIONS
 #include "region2d.h"
 #endif
@@ -203,7 +204,19 @@ class Matrix
         copy(v);
     }
 
+    Matrix(Subscript M, Subscript N, const char *s)
+    {
+        initialize(M,N);
+        std::istrstream ins(s);
+
+        Subscript i, j;
+
+        for (i=0; i<M; i++)
+            for (j=0; j<N; j++)
+                ins >> row_[i][j];
+    }
 
+               
     // destructor
     //
     ~Matrix()
index daba50c993f9774a9c981a8a2501ed6d4b6e2b2a..eb5531815eb161ef2a12fd675f00d7762a872055 100644 (file)
@@ -38,6 +38,7 @@
 #include <cstdlib>
 #include <cassert>
 #include <iostream>
+#include <strstream>
 #ifdef TNT_USE_REGIONS
 #include "region2d.h"
 #endif
@@ -197,6 +198,18 @@ class Fortran_Matrix
     }
 
 
+    Fortran_Matrix(Subscript M, Subscript N, char *s)
+    {
+        initialize(M,N);
+        std::istrstream ins(s);
+
+        Subscript i, j;
+
+        for (i=1; i<=M; i++)
+            for (j=1; j<=N; j++)
+                ins >> (*this)(i,j);
+    }
+
     // destructor
     ~Fortran_Matrix()
     {
index 1fafccdfe935b52448f5f2eede87eecf167a1530..7ebba6f882d1931cf41f9398e5b0654dbc9c331f 100644 (file)
@@ -39,6 +39,7 @@
 #include <cstdlib>
 #include <cassert>
 #include <iostream>
+#include <strstream>
 
 using namespace std;
 
index 1729d83ca107ca23a765891009a56eb43fa3e38c..d4f7c2f40210a2ab7481aa7635c31061b36edea3 100644 (file)
@@ -37,6 +37,7 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <iostream>
+#include <strstream>
 
 namespace TNT
 {
@@ -185,6 +186,17 @@ class Vector
         copy(v);
     }
 
+    Vector(Subscript N, char *s) :  v_(0), vm1_(0), n_(0)
+    {
+        initialize(N);
+        std::istrstream ins(s);
+
+        Subscript i;
+
+        for (i=0; i<N; i++)
+                ins >> v_[i];
+    }
+
 
     // methods
     // 
index ef2e66f19e0056613ba3f6ef806f46c3782d1dfa..fc5930c1b4faa1730c69bf3d0f86145bd8e5ac6c 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <cstdlib>
 #include <iostream>
+#include <strstream>
 #include <cassert>
 
 #include "subscript.h"
@@ -116,6 +117,15 @@ class Vector_Adaptor
 
     } 
 
+    Vector_Adaptor(Subscript N, /*const*/ char *s) : v_(N) 
+    {
+        istrstream ins(s);
+        for (Subscript i=0; i<N; i++)
+            ins >> v_[i] ;
+
+        vm1_ = ( v_.size() > 0 ? &(v_[0]) -1 : NULL); 
+    }; 
+
     Vector_Adaptor(Subscript N, const T& value = T()) : v_(N)
     {
         for (Subscript i=0; i<N; i++)
index 4345ee7b9bd9d264d66f2dedcdac8a7a601dc92b..2818636c1c6e3ba2b7d61b3fe7b186a82a0780fc 100644 (file)
@@ -45,9 +45,6 @@ Package=<4>
     Project_Dep_Name MoTo
     End Project Dependency
     Begin Project Dependency
-    Project_Dep_Name OpenALSoundSystem
-    End Project Dependency
-    Begin Project Dependency
     Project_Dep_Name SoundSystem
     End Project Dependency
     Begin Project Dependency
@@ -59,6 +56,9 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name boolop
     End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name OpenALSoundSystem
+    End Project Dependency
 }}}
 
 ###############################################################################
index 128f1b137bcfb12550dc2e2ba5182165948c9981..345cf0dc7170f8f77b9a98b57a6a375277f24c0b 100644 (file)
@@ -89,10 +89,6 @@ typedef void* NLContext;
 #define NL_SYMMETRIC        0x106
 #define NL_ERROR            0x108
 
-/* Enable / Disable */
-
-#define NL_NORMALIZE_ROWS  0x400
-
 /* Row parameters */
 
 #define NL_RIGHT_HAND_SIDE 0x500
@@ -142,7 +138,9 @@ void nlRightHandSideAdd(NLuint index, NLfloat value);
 
 /* Solve */
 
-NLboolean nlSolve(void);
+void nlPrintMatrix(void);
+NLboolean nlSolve();
+NLboolean nlSolveAdvanced(NLint *permutation, NLboolean solveAgain);
 
 #ifdef __cplusplus
 }
index 7773582e0272932262883ea2424bc18b7c5d29c3..c5518731c6bccf3e106cebbde1ad36d9715ad2f8 100644 (file)
  *
  *  Contact: Bruno Levy
  *
- *     levy@loria.fr
+ *      levy@loria.fr
  *
- *     ISA Project
- *     LORIA, INRIA Lorraine, 
- *     Campus Scientifique, BP 239
- *     54506 VANDOEUVRE LES NANCY CEDEX 
- *     FRANCE
+ *      ISA Project
+ *      LORIA, INRIA Lorraine, 
+ *      Campus Scientifique, BP 239
+ *      54506 VANDOEUVRE LES NANCY CEDEX 
+ *      FRANCE
  *
  *  Note that the GNU General Public License does not permit incorporating
  *  the Software into proprietary programs. 
 
 
 static void __nl_assertion_failed(char* cond, char* file, int line) {
-    fprintf(
-        stderr, 
-        "OpenNL assertion failed: %s, file:%s, line:%d\n",
-        cond,file,line
-    );
-    abort();
+       fprintf(
+               stderr, 
+               "OpenNL assertion failed: %s, file:%s, line:%d\n",
+               cond,file,line
+       );
+       abort();
 }
 
 static void __nl_range_assertion_failed(
-    float x, float min_val, float max_val, char* file, int line
+       float x, float min_val, float max_val, char* file, int line
 ) {
-    fprintf(
-        stderr, 
-        "OpenNL range assertion failed: %f in [ %f ... %f ], file:%s, line:%d\n",
-        x, min_val, max_val, file,line
-    );
-    abort();
+       fprintf(
+               stderr, 
+               "OpenNL range assertion failed: %f in [ %f ... %f ], file:%s, line:%d\n",
+               x, min_val, max_val, file,line
+       );
+       abort();
 }
 
 static void __nl_should_not_have_reached(char* file, int line) {
-    fprintf(
-        stderr, 
-        "OpenNL should not have reached this point: file:%s, line:%d\n",
-        file,line
-    );
-    abort();
+       fprintf(
+               stderr, 
+               "OpenNL should not have reached this point: file:%s, line:%d\n",
+               file,line
+       );
+       abort();
 }
 
 
-#define __nl_assert(x) {                                        \
-    if(!(x)) {                                                  \
-        __nl_assertion_failed(#x,__FILE__, __LINE__);          \
-    }                                                           \
+#define __nl_assert(x) {                                                                               \
+       if(!(x)) {                                                                                                \
+               __nl_assertion_failed(#x,__FILE__, __LINE__);             \
+       }                                                                                                                  \
 } 
 
-#define __nl_range_assert(x,min_val,max_val) {                  \
-    if(((x) < (min_val)) || ((x) > (max_val))) {                \
-        __nl_range_assertion_failed(x, min_val, max_val,        \
-            __FILE__, __LINE__                                  \
-        );                                                     \
-    }                                                           \
+#define __nl_range_assert(x,min_val,max_val) {                           \
+       if(((x) < (min_val)) || ((x) > (max_val))) {                            \
+               __nl_range_assertion_failed(x, min_val, max_val,                \
+                       __FILE__, __LINE__                                                                \
+               );                                                                                                       \
+       }                                                                                                                  \
 }
 
-#define __nl_assert_not_reached {                               \
-    __nl_should_not_have_reached(__FILE__, __LINE__);          \
+#define __nl_assert_not_reached {                                                         \
+       __nl_should_not_have_reached(__FILE__, __LINE__);                 \
 }
 
 #ifdef NL_DEBUG
@@ -135,301 +135,301 @@ static void __nl_should_not_have_reached(char* file, int line) {
 /************************************************************************************/
 /* memory management */
 
-#define __NL_NEW(T)                (T*)(calloc(1, sizeof(T))) 
-#define __NL_NEW_ARRAY(T,NB)       (T*)(calloc((NB),sizeof(T))) 
+#define __NL_NEW(T)                            (T*)(calloc(1, sizeof(T))) 
+#define __NL_NEW_ARRAY(T,NB)      (T*)(calloc((NB),sizeof(T))) 
 #define __NL_RENEW_ARRAY(T,x,NB)   (T*)(realloc(x,(NB)*sizeof(T))) 
-#define __NL_DELETE(x)             free(x); x = NULL 
-#define __NL_DELETE_ARRAY(x)       free(x); x = NULL
+#define __NL_DELETE(x)                  free(x); x = NULL 
+#define __NL_DELETE_ARRAY(x)      free(x); x = NULL
 
-#define __NL_CLEAR(T, x)           memset(x, 0, sizeof(T)) 
+#define __NL_CLEAR(T, x)                  memset(x, 0, sizeof(T)) 
 #define __NL_CLEAR_ARRAY(T,x,NB)   memset(x, 0, (NB)*sizeof(T)) 
 
 /************************************************************************************/
 /* Dynamic arrays for sparse row/columns */
 
 typedef struct {
-    NLuint   index;
-    NLfloat value;
+       NLuint   index;
+       NLfloat value;
 } __NLCoeff;
 
 typedef struct {
-    NLuint size;
-    NLuint capacity;
-    __NLCoeff* coeff;
+       NLuint size;
+       NLuint capacity;
+       __NLCoeff* coeff;
 } __NLRowColumn;
 
 static void __nlRowColumnConstruct(__NLRowColumn* c) {
-    c->size     = 0;
-    c->capacity = 0;
-    c->coeff    = NULL;
+       c->size  = 0;
+       c->capacity = 0;
+       c->coeff        = NULL;
 }
 
 static void __nlRowColumnDestroy(__NLRowColumn* c) {
-    __NL_DELETE_ARRAY(c->coeff);
+       __NL_DELETE_ARRAY(c->coeff);
 #ifdef NL_PARANOID
-    __NL_CLEAR(__NLRowColumn, c); 
+       __NL_CLEAR(__NLRowColumn, c); 
 #endif
 }
 
 static void __nlRowColumnGrow(__NLRowColumn* c) {
-    if(c->capacity != 0) {
-        c->capacity = 2 * c->capacity;
-        c->coeff = __NL_RENEW_ARRAY(__NLCoeff, c->coeff, c->capacity);
-    } else {
-        c->capacity = 4;
-        c->coeff = __NL_NEW_ARRAY(__NLCoeff, c->capacity);
-    }
+       if(c->capacity != 0) {
+               c->capacity = 2 * c->capacity;
+               c->coeff = __NL_RENEW_ARRAY(__NLCoeff, c->coeff, c->capacity);
+       } else {
+               c->capacity = 4;
+               c->coeff = __NL_NEW_ARRAY(__NLCoeff, c->capacity);
+       }
 }
 
 static void __nlRowColumnAdd(__NLRowColumn* c, NLint index, NLfloat value) {
-    NLuint i;
-    for(i=0; i<c->size; i++) {
-        if(c->coeff[i].index == (NLuint)index) {
-            c->coeff[i].value += value;
-            return;
-        }
-    }
-    if(c->size == c->capacity) {
-        __nlRowColumnGrow(c);
-    }
-    c->coeff[c->size].index = index;
-    c->coeff[c->size].value = value;
-    c->size++;
+       NLuint i;
+       for(i=0; i<c->size; i++) {
+               if(c->coeff[i].index == (NLuint)index) {
+                       c->coeff[i].value += value;
+                       return;
+               }
+       }
+       if(c->size == c->capacity) {
+               __nlRowColumnGrow(c);
+       }
+       c->coeff[c->size].index = index;
+       c->coeff[c->size].value = value;
+       c->size++;
 }
 
 /* Does not check whether the index already exists */
 static void __nlRowColumnAppend(__NLRowColumn* c, NLint index, NLfloat value) {
-    if(c->size == c->capacity) {
-        __nlRowColumnGrow(c);
-    }
-    c->coeff[c->size].index = index;
-    c->coeff[c->size].value = value;
-    c->size++;
+       if(c->size == c->capacity) {
+               __nlRowColumnGrow(c);
+       }
+       c->coeff[c->size].index = index;
+       c->coeff[c->size].value = value;
+       c->size++;
 }
 
 static void __nlRowColumnZero(__NLRowColumn* c) {
-    c->size = 0;
+       c->size = 0;
 }
 
 static void __nlRowColumnClear(__NLRowColumn* c) {
-    c->size     = 0;
-    c->capacity = 0;
-    __NL_DELETE_ARRAY(c->coeff);
+       c->size  = 0;
+       c->capacity = 0;
+       __NL_DELETE_ARRAY(c->coeff);
 }
 
 /************************************************************************************/
 /* SparseMatrix data structure */
 
-#define __NL_ROWS      1
+#define __NL_ROWS        1
 #define __NL_COLUMNS   2
 #define __NL_SYMMETRIC 4
 
 typedef struct {
-    NLuint m;
-    NLuint n;
-    NLuint diag_size;
-    NLenum storage;
-    __NLRowColumn* row;
-    __NLRowColumn* column;
-    NLfloat*      diag;
+       NLuint m;
+       NLuint n;
+       NLuint diag_size;
+       NLenum storage;
+       __NLRowColumn* row;
+       __NLRowColumn* column;
+       NLfloat*          diag;
 } __NLSparseMatrix;
 
 
 static void __nlSparseMatrixConstruct(
-    __NLSparseMatrix* M, NLuint m, NLuint n, NLenum storage
+       __NLSparseMatrix* M, NLuint m, NLuint n, NLenum storage
 ) {
-    NLuint i;
-    M->m = m;
-    M->n = n;
-    M->storage = storage;
-    if(storage & __NL_ROWS) {
-        M->row = __NL_NEW_ARRAY(__NLRowColumn, m);
-        for(i=0; i<n; i++) {
-            __nlRowColumnConstruct(&(M->row[i]));
-        }
-    } else {
-        M->row = NULL;
-    }
-
-    if(storage & __NL_COLUMNS) {
-        M->column = __NL_NEW_ARRAY(__NLRowColumn, n);
-        for(i=0; i<n; i++) {
-            __nlRowColumnConstruct(&(M->column[i]));
-        }
-    } else {
-        M->column = NULL;
-    }
-
-    M->diag_size = MIN(m,n);
-    M->diag = __NL_NEW_ARRAY(NLfloat, M->diag_size);
+       NLuint i;
+       M->m = m;
+       M->n = n;
+       M->storage = storage;
+       if(storage & __NL_ROWS) {
+               M->row = __NL_NEW_ARRAY(__NLRowColumn, m);
+               for(i=0; i<n; i++) {
+                       __nlRowColumnConstruct(&(M->row[i]));
+               }
+       } else {
+               M->row = NULL;
+       }
+
+       if(storage & __NL_COLUMNS) {
+               M->column = __NL_NEW_ARRAY(__NLRowColumn, n);
+               for(i=0; i<n; i++) {
+                       __nlRowColumnConstruct(&(M->column[i]));
+               }
+       } else {
+               M->column = NULL;
+       }
+
+       M->diag_size = MIN(m,n);
+       M->diag = __NL_NEW_ARRAY(NLfloat, M->diag_size);
 }
 
 static void __nlSparseMatrixDestroy(__NLSparseMatrix* M) {
-    NLuint i;
-    __NL_DELETE_ARRAY(M->diag);
-    if(M->storage & __NL_ROWS) {
-        for(i=0; i<M->m; i++) {
-            __nlRowColumnDestroy(&(M->row[i]));
-        }
-        __NL_DELETE_ARRAY(M->row);
-    }
-    if(M->storage & __NL_COLUMNS) {
-        for(i=0; i<M->n; i++) {
-            __nlRowColumnDestroy(&(M->column[i]));
-        }
-        __NL_DELETE_ARRAY(M->column);
-    }
+       NLuint i;
+       __NL_DELETE_ARRAY(M->diag);
+       if(M->storage & __NL_ROWS) {
+               for(i=0; i<M->m; i++) {
+                       __nlRowColumnDestroy(&(M->row[i]));
+               }
+               __NL_DELETE_ARRAY(M->row);
+       }
+       if(M->storage & __NL_COLUMNS) {
+               for(i=0; i<M->n; i++) {
+                       __nlRowColumnDestroy(&(M->column[i]));
+               }
+               __NL_DELETE_ARRAY(M->column);
+       }
 #ifdef NL_PARANOID
-    __NL_CLEAR(__NLSparseMatrix,M);
+       __NL_CLEAR(__NLSparseMatrix,M);
 #endif
 }
 
 static void __nlSparseMatrixAdd(
-    __NLSparseMatrix* M, NLuint i, NLuint j, NLfloat value
+       __NLSparseMatrix* M, NLuint i, NLuint j, NLfloat value
 ) {
-    __nl_parano_range_assert(i, 0, M->m - 1);
-    __nl_parano_range_assert(j, 0, M->n - 1);
-    if((M->storage & __NL_SYMMETRIC) && (j > i)) {
-        return;
-    }
-    if(i == j) {
-        M->diag[i] += value;
-    }
-    if(M->storage & __NL_ROWS) {
-        __nlRowColumnAdd(&(M->row[i]), j, value);
-    }
-    if(M->storage & __NL_COLUMNS) {
-        __nlRowColumnAdd(&(M->column[j]), i, value);
-    }
+       __nl_parano_range_assert(i, 0, M->m - 1);
+       __nl_parano_range_assert(j, 0, M->n - 1);
+       if((M->storage & __NL_SYMMETRIC) && (j > i)) {
+               return;
+       }
+       if(i == j) {
+               M->diag[i] += value;
+       }
+       if(M->storage & __NL_ROWS) {
+               __nlRowColumnAdd(&(M->row[i]), j, value);
+       }
+       if(M->storage & __NL_COLUMNS) {
+               __nlRowColumnAdd(&(M->column[j]), i, value);
+       }
 }
 
 static void __nlSparseMatrixClear( __NLSparseMatrix* M) {
-    NLuint i;
-    if(M->storage & __NL_ROWS) {
-        for(i=0; i<M->m; i++) {
-            __nlRowColumnClear(&(M->row[i]));
-        }
-    }
-    if(M->storage & __NL_COLUMNS) {
-        for(i=0; i<M->n; i++) {
-            __nlRowColumnClear(&(M->column[i]));
-        }
-    }
-    __NL_CLEAR_ARRAY(NLfloat, M->diag, M->diag_size);    
+       NLuint i;
+       if(M->storage & __NL_ROWS) {
+               for(i=0; i<M->m; i++) {
+                       __nlRowColumnClear(&(M->row[i]));
+               }
+       }
+       if(M->storage & __NL_COLUMNS) {
+               for(i=0; i<M->n; i++) {
+                       __nlRowColumnClear(&(M->column[i]));
+               }
+       }
+       __NL_CLEAR_ARRAY(NLfloat, M->diag, M->diag_size);       
 }
 
 /* Returns the number of non-zero coefficients */
 static NLuint __nlSparseMatrixNNZ( __NLSparseMatrix* M) {
-    NLuint nnz = 0;
-    NLuint i;
-    if(M->storage & __NL_ROWS) {
-        for(i = 0; i<M->m; i++) {
-            nnz += M->row[i].size;
-        }
-    } else if (M->storage & __NL_COLUMNS) {
-        for(i = 0; i<M->n; i++) {
-            nnz += M->column[i].size;
-        }
-    } else {
-        __nl_assert_not_reached;
-    }
-    return nnz;
+       NLuint nnz = 0;
+       NLuint i;
+       if(M->storage & __NL_ROWS) {
+               for(i = 0; i<M->m; i++) {
+                       nnz += M->row[i].size;
+               }
+       } else if (M->storage & __NL_COLUMNS) {
+               for(i = 0; i<M->n; i++) {
+                       nnz += M->column[i].size;
+               }
+       } else {
+               __nl_assert_not_reached;
+       }
+       return nnz;
 }
 
 /************************************************************************************/
 /* SparseMatrix x Vector routines, internal helper routines */
 
 static void __nlSparseMatrix_mult_rows_symmetric(
-    __NLSparseMatrix* A, NLfloat* x, NLfloat* y
+       __NLSparseMatrix* A, NLfloat* x, NLfloat* y
 ) {
-    NLuint m = A->m;
-    NLuint i,ij;
-    __NLRowColumn* Ri = NULL;
-    __NLCoeff* c = NULL;
-    for(i=0; i<m; i++) {
-        y[i] = 0;
-        Ri = &(A->row[i]);
-        for(ij=0; ij<Ri->size; ij++) {
-            c = &(Ri->coeff[ij]);
-            y[i] += c->value * x[c->index];
-            if(i != c->index) {
-                y[c->index] += c->value * x[i];
-            }
-        }
-    }
+       NLuint m = A->m;
+       NLuint i,ij;
+       __NLRowColumn* Ri = NULL;
+       __NLCoeff* c = NULL;
+       for(i=0; i<m; i++) {
+               y[i] = 0;
+               Ri = &(A->row[i]);
+               for(ij=0; ij<Ri->size; ij++) {
+                       c = &(Ri->coeff[ij]);
+                       y[i] += c->value * x[c->index];
+                       if(i != c->index) {
+                               y[c->index] += c->value * x[i];
+                       }
+               }
+       }
 }
 
 static void __nlSparseMatrix_mult_rows(
-    __NLSparseMatrix* A, NLfloat* x, NLfloat* y
+       __NLSparseMatrix* A, NLfloat* x, NLfloat* y
 ) {
-    NLuint m = A->m;
-    NLuint i,ij;
-    __NLRowColumn* Ri = NULL;
-    __NLCoeff* c = NULL;
-    for(i=0; i<m; i++) {
-        y[i] = 0;
-        Ri = &(A->row[i]);
-        for(ij=0; ij<Ri->size; ij++) {
-            c = &(Ri->coeff[ij]);
-            y[i] += c->value * x[c->index];
-        }
-    }
+       NLuint m = A->m;
+       NLuint i,ij;
+       __NLRowColumn* Ri = NULL;
+       __NLCoeff* c = NULL;
+       for(i=0; i<m; i++) {
+               y[i] = 0;
+               Ri = &(A->row[i]);
+               for(ij=0; ij<Ri->size; ij++) {
+                       c = &(Ri->coeff[ij]);
+                       y[i] += c->value * x[c->index];
+               }
+       }
 }
 
 static void __nlSparseMatrix_mult_cols_symmetric(
-    __NLSparseMatrix* A, NLfloat* x, NLfloat* y
+       __NLSparseMatrix* A, NLfloat* x, NLfloat* y
 ) {
-    NLuint n = A->n;
-    NLuint j,ii;
-    __NLRowColumn* Cj = NULL;
-    __NLCoeff* c = NULL;
-    for(j=0; j<n; j++) {
-        y[j] = 0;
-        Cj = &(A->column[j]);
-        for(ii=0; ii<Cj->size; ii++) {
-            c = &(Cj->coeff[ii]);
-            y[c->index] += c->value * x[j];
-            if(j != c->index) {
-                y[j] += c->value * x[c->index];
-            }
-        }
-    }
+       NLuint n = A->n;
+       NLuint j,ii;
+       __NLRowColumn* Cj = NULL;
+       __NLCoeff* c = NULL;
+       for(j=0; j<n; j++) {
+               y[j] = 0;
+               Cj = &(A->column[j]);
+               for(ii=0; ii<Cj->size; ii++) {
+                       c = &(Cj->coeff[ii]);
+                       y[c->index] += c->value * x[j];
+                       if(j != c->index) {
+                               y[j] += c->value * x[c->index];
+                       }
+               }
+       }
 }
 
 static void __nlSparseMatrix_mult_cols(
-    __NLSparseMatrix* A, NLfloat* x, NLfloat* y
+       __NLSparseMatrix* A, NLfloat* x, NLfloat* y
 ) {
-    NLuint n = A->n;
-    NLuint j,ii; 
-    __NLRowColumn* Cj = NULL;
-    __NLCoeff* c = NULL;
-    __NL_CLEAR_ARRAY(NLfloat, y, A->m);
-    for(j=0; j<n; j++) {
-        Cj = &(A->column[j]);
-        for(ii=0; ii<Cj->size; ii++) {
-            c = &(Cj->coeff[ii]);
-            y[c->index] += c->value * x[j];
-        }
-    }
+       NLuint n = A->n;
+       NLuint j,ii; 
+       __NLRowColumn* Cj = NULL;
+       __NLCoeff* c = NULL;
+       __NL_CLEAR_ARRAY(NLfloat, y, A->m);
+       for(j=0; j<n; j++) {
+               Cj = &(A->column[j]);
+               for(ii=0; ii<Cj->size; ii++) {
+                       c = &(Cj->coeff[ii]);
+                       y[c->index] += c->value * x[j];
+               }
+       }
 }
 
 /************************************************************************************/
 /* SparseMatrix x Vector routines, main driver routine */
 
 static void __nlSparseMatrixMult(__NLSparseMatrix* A, NLfloat* x, NLfloat* y) {
-    if(A->storage & __NL_ROWS) {
-        if(A->storage & __NL_SYMMETRIC) {
-            __nlSparseMatrix_mult_rows_symmetric(A, x, y);
-        } else {
-            __nlSparseMatrix_mult_rows(A, x, y);
-        }
-    } else {
-        if(A->storage & __NL_SYMMETRIC) {
-            __nlSparseMatrix_mult_cols_symmetric(A, x, y);
-        } else {
-            __nlSparseMatrix_mult_cols(A, x, y);
-        }
-    }
+       if(A->storage & __NL_ROWS) {
+               if(A->storage & __NL_SYMMETRIC) {
+                       __nlSparseMatrix_mult_rows_symmetric(A, x, y);
+               } else {
+                       __nlSparseMatrix_mult_rows(A, x, y);
+               }
+       } else {
+               if(A->storage & __NL_SYMMETRIC) {
+                       __nlSparseMatrix_mult_cols_symmetric(A, x, y);
+               } else {
+                       __nlSparseMatrix_mult_cols(A, x, y);
+               }
+       }
 }
 
 /************************************************************************************/
@@ -438,513 +438,467 @@ static void __nlSparseMatrixMult(__NLSparseMatrix* A, NLfloat* x, NLfloat* y) {
 typedef void(*__NLMatrixFunc)(float* x, float* y);
 
 typedef struct {
-    NLfloat  value;
-    NLboolean locked;
-    NLuint    index;
+       NLfloat  value;
+       NLboolean locked;
+       NLuint  index;
 } __NLVariable;
 
-#define __NL_STATE_INITIAL            0
-#define __NL_STATE_SYSTEM             1
-#define __NL_STATE_MATRIX             2
-#define __NL_STATE_ROW                3
-#define __NL_STATE_MATRIX_CONSTRUCTED 4
-#define __NL_STATE_SYSTEM_CONSTRUCTED 5
-#define __NL_STATE_SOLVED             6
+#define __NL_STATE_INITIAL                             0
+#define __NL_STATE_SYSTEM                              1
+#define __NL_STATE_MATRIX                              2
+#define __NL_STATE_ROW                                 3
+#define __NL_STATE_MATRIX_CONSTRUCTED  4
+#define __NL_STATE_SYSTEM_CONSTRUCTED  5
+#define __NL_STATE_SYSTEM_SOLVED               7
 
 typedef struct {
-    NLenum           state;
-    __NLVariable*    variable;
-    NLuint           n;
-    __NLSparseMatrix M;
-    __NLRowColumn    af;
-    __NLRowColumn    al;
-    __NLRowColumn    xl;
-    NLfloat*        x;
-    NLfloat*        b;
-    NLfloat         right_hand_side;
-    NLfloat         row_scaling;
-    NLuint           nb_variables;
-    NLuint           current_row;
-    NLboolean        least_squares;
-    NLboolean        symmetric;
-    NLboolean        normalize_rows;
-    NLboolean        alloc_M;
-    NLboolean        alloc_af;
-    NLboolean        alloc_al;
-    NLboolean        alloc_xl;
-    NLboolean        alloc_variable;
-    NLboolean        alloc_x;
-    NLboolean        alloc_b;
-    NLfloat         error;
-    __NLMatrixFunc   matrix_vector_prod;
+       NLenum             state;
+       __NLVariable*   variable;
+       NLuint             n;
+       __NLSparseMatrix M;
+       __NLRowColumn   af;
+       __NLRowColumn   al;
+       NLfloat*                x;
+       NLfloat*                b;
+       NLfloat          right_hand_side;
+       NLuint             nb_variables;
+       NLuint             current_row;
+       NLboolean               least_squares;
+       NLboolean               symmetric;
+       NLboolean               solve_again;
+       NLboolean               alloc_M;
+       NLboolean               alloc_af;
+       NLboolean               alloc_al;
+       NLboolean               alloc_variable;
+       NLboolean               alloc_x;
+       NLboolean               alloc_b;
+       NLfloat          error;
+       __NLMatrixFunc   matrix_vector_prod;
+
+       struct __NLSuperLUContext {
+               NLboolean alloc_slu;
+               SuperMatrix L, U;
+               NLint *perm_c, *perm_r;
+               SuperLUStat_t stat;
+       } slu;
 } __NLContext;
 
 static __NLContext* __nlCurrentContext = NULL;
 
 static void __nlMatrixVectorProd_default(NLfloat* x, NLfloat* y) {
-    __nlSparseMatrixMult(&(__nlCurrentContext->M), x, y);
+       __nlSparseMatrixMult(&(__nlCurrentContext->M), x, y);
 }
 
 
 NLContext nlNewContext(void) {
-    __NLContext* result      = __NL_NEW(__NLContext);
-    result->state            = __NL_STATE_INITIAL;
-    result->row_scaling      = 1.0;
-    result->right_hand_side  = 0.0;
-    result->matrix_vector_prod = __nlMatrixVectorProd_default;
-    nlMakeCurrent(result);
-    return result;
+       __NLContext* result       = __NL_NEW(__NLContext);
+       result->state                   = __NL_STATE_INITIAL;
+       result->right_hand_side  = 0.0;
+       result->matrix_vector_prod = __nlMatrixVectorProd_default;
+       nlMakeCurrent(result);
+       return result;
 }
 
+static void __nlFree_SUPERLU(__NLContext *context);
+
 void nlDeleteContext(NLContext context_in) {
-    __NLContext* context = (__NLContext*)(context_in);
-    if(__nlCurrentContext == context) {
-        __nlCurrentContext = NULL;
-    }
-    if(context->alloc_M) {
-        __nlSparseMatrixDestroy(&context->M);
-    }
-    if(context->alloc_af) {
-        __nlRowColumnDestroy(&context->af);
-    }
-    if(context->alloc_al) {
-        __nlRowColumnDestroy(&context->al);
-    }
-    if(context->alloc_xl) {
-        __nlRowColumnDestroy(&context->xl);
-    }
-    if(context->alloc_variable) {
-        __NL_DELETE_ARRAY(context->variable);
-    }
-    if(context->alloc_x) {
-        __NL_DELETE_ARRAY(context->x);
-    }
-    if(context->alloc_b) {
-        __NL_DELETE_ARRAY(context->b);
-    }
+       __NLContext* context = (__NLContext*)(context_in);
+       if(__nlCurrentContext == context) {
+               __nlCurrentContext = NULL;
+       }
+       if(context->alloc_M) {
+               __nlSparseMatrixDestroy(&context->M);
+       }
+       if(context->alloc_af) {
+               __nlRowColumnDestroy(&context->af);
+       }
+       if(context->alloc_al) {
+               __nlRowColumnDestroy(&context->al);
+       }
+       if(context->alloc_variable) {
+               __NL_DELETE_ARRAY(context->variable);
+       }
+       if(context->alloc_x) {
+               __NL_DELETE_ARRAY(context->x);
+       }
+       if(context->alloc_b) {
+               __NL_DELETE_ARRAY(context->b);
+       }
+       if (context->slu.alloc_slu) {
+               __nlFree_SUPERLU(context);
+       }
 
 #ifdef NL_PARANOID
-    __NL_CLEAR(__NLContext, context);
+       __NL_CLEAR(__NLContext, context);
 #endif
-    __NL_DELETE(context);
+       __NL_DELETE(context);
 }
 
 void nlMakeCurrent(NLContext context) {
-    __nlCurrentContext = (__NLContext*)(context);
+       __nlCurrentContext = (__NLContext*)(context);
 }
 
 NLContext nlGetCurrent(void) {
-    return __nlCurrentContext;
+       return __nlCurrentContext;
 }
 
 static void __nlCheckState(NLenum state) {
-    __nl_assert(__nlCurrentContext->state == state);
+       __nl_assert(__nlCurrentContext->state == state);
 }
 
 static void __nlTransition(NLenum from_state, NLenum to_state) {
-    __nlCheckState(from_state);
-    __nlCurrentContext->state = to_state;
+       __nlCheckState(from_state);
+       __nlCurrentContext->state = to_state;
 }
 
 /************************************************************************************/
 /* Get/Set parameters */
 
 void nlSolverParameterf(NLenum pname, NLfloat param) {
-    __nlCheckState(__NL_STATE_INITIAL);
-    switch(pname) {
-    case NL_NB_VARIABLES: {
-        __nl_assert(param > 0);
-        __nlCurrentContext->nb_variables = (NLuint)param;
-    } break;
-    case NL_LEAST_SQUARES: {
-        __nlCurrentContext->least_squares = (NLboolean)param;
-    } break;
-    case NL_SYMMETRIC: {
-        __nlCurrentContext->symmetric = (NLboolean)param;        
-    }
-    default: {
-        __nl_assert_not_reached;
-    } break;
-    }
+       __nlCheckState(__NL_STATE_INITIAL);
+       switch(pname) {
+       case NL_NB_VARIABLES: {
+               __nl_assert(param > 0);
+               __nlCurrentContext->nb_variables = (NLuint)param;
+       } break;
+       case NL_LEAST_SQUARES: {
+               __nlCurrentContext->least_squares = (NLboolean)param;
+       } break;
+       case NL_SYMMETRIC: {
+               __nlCurrentContext->symmetric = (NLboolean)param;               
+       }
+       default: {
+               __nl_assert_not_reached;
+       } break;
+       }
 }
 
 void nlSolverParameteri(NLenum pname, NLint param) {
-    __nlCheckState(__NL_STATE_INITIAL);
-    switch(pname) {
-    case NL_NB_VARIABLES: {
-        __nl_assert(param > 0);
-        __nlCurrentContext->nb_variables = (NLuint)param;
-    } break;
-    case NL_LEAST_SQUARES: {
-        __nlCurrentContext->least_squares = (NLboolean)param;
-    } break;
-    case NL_SYMMETRIC: {
-        __nlCurrentContext->symmetric = (NLboolean)param;        
-    }
-    default: {
-        __nl_assert_not_reached;
-    } break;
-    }
+       __nlCheckState(__NL_STATE_INITIAL);
+       switch(pname) {
+       case NL_NB_VARIABLES: {
+               __nl_assert(param > 0);
+               __nlCurrentContext->nb_variables = (NLuint)param;
+       } break;
+       case NL_LEAST_SQUARES: {
+               __nlCurrentContext->least_squares = (NLboolean)param;
+       } break;
+       case NL_SYMMETRIC: {
+               __nlCurrentContext->symmetric = (NLboolean)param;               
+       }
+       default: {
+               __nl_assert_not_reached;
+       } break;
+       }
 }
 
 void nlRowParameterf(NLenum pname, NLfloat param) {
-    __nlCheckState(__NL_STATE_MATRIX);
-    switch(pname) {
-    case NL_RIGHT_HAND_SIDE: {
-        __nlCurrentContext->right_hand_side = param;
-    } break;
-    case NL_ROW_SCALING: {
-        __nlCurrentContext->row_scaling = param;
-    } break;
-    }
+       __nlCheckState(__NL_STATE_MATRIX);
+       switch(pname) {
+       case NL_RIGHT_HAND_SIDE: {
+               __nlCurrentContext->right_hand_side = param;
+       } break;
+       }
 }
 
 void nlRowParameteri(NLenum pname, NLint param) {
-    __nlCheckState(__NL_STATE_MATRIX);
-    switch(pname) {
-    case NL_RIGHT_HAND_SIDE: {
-        __nlCurrentContext->right_hand_side = (NLfloat)param;
-    } break;
-    case NL_ROW_SCALING: {
-        __nlCurrentContext->row_scaling = (NLfloat)param;
-    } break;
-    }
+       __nlCheckState(__NL_STATE_MATRIX);
+       switch(pname) {
+       case NL_RIGHT_HAND_SIDE: {
+               __nlCurrentContext->right_hand_side = (NLfloat)param;
+       } break;
+       }
 }
 
 void nlGetBooleanv(NLenum pname, NLboolean* params) {
-    switch(pname) {
-    case NL_LEAST_SQUARES: {
-        *params = __nlCurrentContext->least_squares;
-    } break;
-    case NL_SYMMETRIC: {
-        *params = __nlCurrentContext->symmetric;
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    } break;
-    }
+       switch(pname) {
+       case NL_LEAST_SQUARES: {
+               *params = __nlCurrentContext->least_squares;
+       } break;
+       case NL_SYMMETRIC: {
+               *params = __nlCurrentContext->symmetric;
+       } break;
+       default: {
+               __nl_assert_not_reached;
+       } break;
+       }
 }
 
 void nlGetFloatv(NLenum pname, NLfloat* params) {
-    switch(pname) {
-    case NL_NB_VARIABLES: {
-        *params = (NLfloat)(__nlCurrentContext->nb_variables);
-    } break;
-    case NL_LEAST_SQUARES: {
-        *params = (NLfloat)(__nlCurrentContext->least_squares);
-    } break;
-    case NL_SYMMETRIC: {
-        *params = (NLfloat)(__nlCurrentContext->symmetric);
-    } break;
-    case NL_ERROR: {
-        *params = (NLfloat)(__nlCurrentContext->error);
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    } break;
-    }
+       switch(pname) {
+       case NL_NB_VARIABLES: {
+               *params = (NLfloat)(__nlCurrentContext->nb_variables);
+       } break;
+       case NL_LEAST_SQUARES: {
+               *params = (NLfloat)(__nlCurrentContext->least_squares);
+       } break;
+       case NL_SYMMETRIC: {
+               *params = (NLfloat)(__nlCurrentContext->symmetric);
+       } break;
+       case NL_ERROR: {
+               *params = (NLfloat)(__nlCurrentContext->error);
+       } break;
+       default: {
+               __nl_assert_not_reached;
+       } break;
+       }
 }
 
 void nlGetIntergerv(NLenum pname, NLint* params) {
-    switch(pname) {
-    case NL_NB_VARIABLES: {
-        *params = (NLint)(__nlCurrentContext->nb_variables);
-    } break;
-    case NL_LEAST_SQUARES: {
-        *params = (NLint)(__nlCurrentContext->least_squares);
-    } break;
-    case NL_SYMMETRIC: {
-        *params = (NLint)(__nlCurrentContext->symmetric);
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    } break;
-    }
+       switch(pname) {
+       case NL_NB_VARIABLES: {
+               *params = (NLint)(__nlCurrentContext->nb_variables);
+       } break;
+       case NL_LEAST_SQUARES: {
+               *params = (NLint)(__nlCurrentContext->least_squares);
+       } break;
+       case NL_SYMMETRIC: {
+               *params = (NLint)(__nlCurrentContext->symmetric);
+       } break;
+       default: {
+               __nl_assert_not_reached;
+       } break;
+       }
 }
 
 /************************************************************************************/
 /* Enable / Disable */
 
 void nlEnable(NLenum pname) {
-    switch(pname) {
-    case NL_NORMALIZE_ROWS: {
-        __nl_assert(__nlCurrentContext->state != __NL_STATE_ROW);
-        __nlCurrentContext->normalize_rows = NL_TRUE;
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    }
-    }
+       switch(pname) {
+       default: {
+               __nl_assert_not_reached;
+       }
+       }
 }
 
 void nlDisable(NLenum pname) {
-    switch(pname) {
-    case NL_NORMALIZE_ROWS: {
-        __nl_assert(__nlCurrentContext->state != __NL_STATE_ROW);
-        __nlCurrentContext->normalize_rows = NL_FALSE;
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    }
-    }
+       switch(pname) {
+       default: {
+               __nl_assert_not_reached;
+       }
+       }
 }
 
 NLboolean nlIsEnabled(NLenum pname) {
-    switch(pname) {
-    case NL_NORMALIZE_ROWS: {
-        return __nlCurrentContext->normalize_rows;
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    }
-    }
-    return NL_FALSE;
+       switch(pname) {
+       default: {
+               __nl_assert_not_reached;
+       }
+       }
+       return NL_FALSE;
 }
 
 /************************************************************************************/
 /* Get/Set Lock/Unlock variables */
 
 void nlSetVariable(NLuint index, NLfloat value) {
-    __nlCheckState(__NL_STATE_SYSTEM);
-    __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
-    __nlCurrentContext->variable[index].value = value;    
+       __nlCheckState(__NL_STATE_SYSTEM);
+       __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
+       __nlCurrentContext->variable[index].value = value;      
 }
 
 NLfloat nlGetVariable(NLuint index) {
-    __nl_assert(__nlCurrentContext->state != __NL_STATE_INITIAL);
-    __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
-    return __nlCurrentContext->variable[index].value;
+       __nl_assert(__nlCurrentContext->state != __NL_STATE_INITIAL);
+       __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
+       return __nlCurrentContext->variable[index].value;
 }
 
 void nlLockVariable(NLuint index) {
-    __nlCheckState(__NL_STATE_SYSTEM);
-    __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
-    __nlCurrentContext->variable[index].locked = NL_TRUE;
+       __nlCheckState(__NL_STATE_SYSTEM);
+       __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
+       __nlCurrentContext->variable[index].locked = NL_TRUE;
 }
 
 void nlUnlockVariable(NLuint index) {
-    __nlCheckState(__NL_STATE_SYSTEM);
-    __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
-    __nlCurrentContext->variable[index].locked = NL_FALSE;
+       __nlCheckState(__NL_STATE_SYSTEM);
+       __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
+       __nlCurrentContext->variable[index].locked = NL_FALSE;
 }
 
 NLboolean nlVariableIsLocked(NLuint index) {
-    __nl_assert(__nlCurrentContext->state != __NL_STATE_INITIAL);
-    __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
-    return __nlCurrentContext->variable[index].locked;
+       __nl_assert(__nlCurrentContext->state != __NL_STATE_INITIAL);
+       __nl_parano_range_assert(index, 0, __nlCurrentContext->nb_variables - 1);
+       return __nlCurrentContext->variable[index].locked;
 }
 
 /************************************************************************************/
 /* System construction */
 
 static void __nlVariablesToVector() {
-    NLuint i;
-    __nl_assert(__nlCurrentContext->alloc_x);
-    __nl_assert(__nlCurrentContext->alloc_variable);
-    for(i=0; i<__nlCurrentContext->nb_variables; i++) {
-        __NLVariable* v = &(__nlCurrentContext->variable[i]);
-        if(!v->locked) {
-            __nl_assert(v->index < __nlCurrentContext->n);
-            __nlCurrentContext->x[v->index] = v->value;
-        }
-    }
+       NLuint i;
+       __nl_assert(__nlCurrentContext->alloc_x);
+       __nl_assert(__nlCurrentContext->alloc_variable);
+       for(i=0; i<__nlCurrentContext->nb_variables; i++) {
+               __NLVariable* v = &(__nlCurrentContext->variable[i]);
+               if(!v->locked) {
+                       __nl_assert(v->index < __nlCurrentContext->n);
+                       __nlCurrentContext->x[v->index] = v->value;
+               }
+       }
 }
 
 static void __nlVectorToVariables() {
-    NLuint i;
-    __nl_assert(__nlCurrentContext->alloc_x);
-    __nl_assert(__nlCurrentContext->alloc_variable);
-    for(i=0; i<__nlCurrentContext->nb_variables; i++) {
-        __NLVariable* v = &(__nlCurrentContext->variable[i]);
-        if(!v->locked) {
-            __nl_assert(v->index < __nlCurrentContext->n);
-            v->value = __nlCurrentContext->x[v->index];
-        }
-    }
+       NLuint i;
+       __nl_assert(__nlCurrentContext->alloc_x);
+       __nl_assert(__nlCurrentContext->alloc_variable);
+       for(i=0; i<__nlCurrentContext->nb_variables; i++) {
+               __NLVariable* v = &(__nlCurrentContext->variable[i]);
+               if(!v->locked) {
+                       __nl_assert(v->index < __nlCurrentContext->n);
+                       v->value = __nlCurrentContext->x[v->index];
+               }
+       }
 }
 
-
 static void __nlBeginSystem() {
-    __nlTransition(__NL_STATE_INITIAL, __NL_STATE_SYSTEM);
-    __nl_assert(__nlCurrentContext->nb_variables > 0);
-    __nlCurrentContext->variable = __NL_NEW_ARRAY(
-        __NLVariable, __nlCurrentContext->nb_variables
-    );
-    __nlCurrentContext->alloc_variable = NL_TRUE;
+       __nl_assert(__nlCurrentContext->nb_variables > 0);
+
+       if (__nlCurrentContext->solve_again)
+               __nlTransition(__NL_STATE_SYSTEM_SOLVED, __NL_STATE_SYSTEM);
+       else {
+               __nlTransition(__NL_STATE_INITIAL, __NL_STATE_SYSTEM);
+
+               __nlCurrentContext->variable = __NL_NEW_ARRAY(
+                       __NLVariable, __nlCurrentContext->nb_variables
+               );
+               __nlCurrentContext->alloc_variable = NL_TRUE;
+       }
 }
 
 static void __nlEndSystem() {
-    __nlTransition(__NL_STATE_MATRIX_CONSTRUCTED, __NL_STATE_SYSTEM_CONSTRUCTED);    
+       __nlTransition(__NL_STATE_MATRIX_CONSTRUCTED, __NL_STATE_SYSTEM_CONSTRUCTED);   
 }
 
 static void __nlBeginMatrix() {
-    NLuint i;
-    NLuint n = 0;
-    NLenum storage = __NL_ROWS;
-
-    __nlTransition(__NL_STATE_SYSTEM, __NL_STATE_MATRIX);
-
-    for(i=0; i<__nlCurrentContext->nb_variables; i++) {
-        if(!__nlCurrentContext->variable[i].locked) {
-            __nlCurrentContext->variable[i].index = n;
-            n++;
-        } else {
-            __nlCurrentContext->variable[i].index = ~0;
-        }
-    }
-
-    __nlCurrentContext->n = n;
-
-    /* a least squares problem results in a symmetric matrix */
-    if(__nlCurrentContext->least_squares) {
-        __nlCurrentContext->symmetric = NL_TRUE;
-    }
-
-    if(__nlCurrentContext->symmetric) {
-        storage = (storage | __NL_SYMMETRIC);
-    }
-
-    /* SuperLU storage does not support symmetric storage */
-    storage = (storage & ~__NL_SYMMETRIC);
-
-    __nlSparseMatrixConstruct(&__nlCurrentContext->M, n, n, storage);
-    __nlCurrentContext->alloc_M = NL_TRUE;
-
-    __nlCurrentContext->x = __NL_NEW_ARRAY(NLfloat, n);
-    __nlCurrentContext->alloc_x = NL_TRUE;
-    
-    __nlCurrentContext->b = __NL_NEW_ARRAY(NLfloat, n);
-    __nlCurrentContext->alloc_b = NL_TRUE;
-
-    __nlVariablesToVector();
-
-    __nlRowColumnConstruct(&__nlCurrentContext->af);
-    __nlCurrentContext->alloc_af = NL_TRUE;
-    __nlRowColumnConstruct(&__nlCurrentContext->al);
-    __nlCurrentContext->alloc_al = NL_TRUE;
-    __nlRowColumnConstruct(&__nlCurrentContext->xl);
-    __nlCurrentContext->alloc_xl = NL_TRUE;
-
-    __nlCurrentContext->current_row = 0;
+       NLuint i;
+       NLuint n = 0;
+       NLenum storage = __NL_ROWS;
+
+       __nlTransition(__NL_STATE_SYSTEM, __NL_STATE_MATRIX);
+
+       if (!__nlCurrentContext->solve_again) {
+               for(i=0; i<__nlCurrentContext->nb_variables; i++) {
+                       if(!__nlCurrentContext->variable[i].locked)
+                               __nlCurrentContext->variable[i].index = n++;
+                       else
+                               __nlCurrentContext->variable[i].index = ~0;
+               }
+
+               __nlCurrentContext->n = n;
+
+               /* a least squares problem results in a symmetric matrix */
+               if(__nlCurrentContext->least_squares)
+                       __nlCurrentContext->symmetric = NL_TRUE;
+
+               if(__nlCurrentContext->symmetric)
+                       storage = (storage | __NL_SYMMETRIC);
+
+               /* SuperLU storage does not support symmetric storage */
+               storage = (storage & ~__NL_SYMMETRIC);
+
+               __nlSparseMatrixConstruct(&__nlCurrentContext->M, n, n, storage);
+               __nlCurrentContext->alloc_M = NL_TRUE;
+
+               __nlCurrentContext->x = __NL_NEW_ARRAY(NLfloat, n);
+               __nlCurrentContext->alloc_x = NL_TRUE;
+               
+               __nlCurrentContext->b = __NL_NEW_ARRAY(NLfloat, n);
+               __nlCurrentContext->alloc_b = NL_TRUE;
+       }
+       else {
+               /* need to recompute b only, A is not constructed anymore */
+               __NL_CLEAR_ARRAY(NLfloat, __nlCurrentContext->b, __nlCurrentContext->n);
+       }
+
+       __nlVariablesToVector();
+
+       __nlRowColumnConstruct(&__nlCurrentContext->af);
+       __nlCurrentContext->alloc_af = NL_TRUE;
+       __nlRowColumnConstruct(&__nlCurrentContext->al);
+       __nlCurrentContext->alloc_al = NL_TRUE;
+
+       __nlCurrentContext->current_row = 0;
 }
 
 static void __nlEndMatrix() {
-    __nlTransition(__NL_STATE_MATRIX, __NL_STATE_MATRIX_CONSTRUCTED);    
-    
-    __nlRowColumnDestroy(&__nlCurrentContext->af);
-    __nlCurrentContext->alloc_af = NL_FALSE;
-    __nlRowColumnDestroy(&__nlCurrentContext->al);
-    __nlCurrentContext->alloc_al = NL_FALSE;
-    __nlRowColumnDestroy(&__nlCurrentContext->xl);
-    __nlCurrentContext->alloc_al = NL_FALSE;
-    
+       __nlTransition(__NL_STATE_MATRIX, __NL_STATE_MATRIX_CONSTRUCTED);       
+       
+       __nlRowColumnDestroy(&__nlCurrentContext->af);
+       __nlCurrentContext->alloc_af = NL_FALSE;
+       __nlRowColumnDestroy(&__nlCurrentContext->al);
+       __nlCurrentContext->alloc_al = NL_FALSE;
+       
 #if 0
-    if(!__nlCurrentContext->least_squares) {
-        __nl_assert(
-            __nlCurrentContext->current_row == 
-            __nlCurrentContext->n
-        );
-    }
+       if(!__nlCurrentContext->least_squares) {
+               __nl_assert(
+                       __nlCurrentContext->current_row == 
+                       __nlCurrentContext->n
+               );
+       }
 #endif
 }
 
 static void __nlBeginRow() {
-    __nlTransition(__NL_STATE_MATRIX, __NL_STATE_ROW);
-    __nlRowColumnZero(&__nlCurrentContext->af);
-    __nlRowColumnZero(&__nlCurrentContext->al);
-    __nlRowColumnZero(&__nlCurrentContext->xl);
-}
-
-static void __nlScaleRow(NLfloat s) {
-    __NLRowColumn*    af = &__nlCurrentContext->af;
-    __NLRowColumn*    al = &__nlCurrentContext->al;
-    NLuint nf            = af->size;
-    NLuint nl            = al->size;
-    NLuint i;
-    for(i=0; i<nf; i++) {
-        af->coeff[i].value *= s;
-    }
-    for(i=0; i<nl; i++) {
-        al->coeff[i].value *= s;
-    }
-    __nlCurrentContext->right_hand_side *= s;
-}
-
-static void __nlNormalizeRow(NLfloat weight) {
-    __NLRowColumn*    af = &__nlCurrentContext->af;
-    __NLRowColumn*    al = &__nlCurrentContext->al;
-    NLuint nf            = af->size;
-    NLuint nl            = al->size;
-    NLuint i;
-    NLfloat norm = 0.0;
-    for(i=0; i<nf; i++) {
-        norm += af->coeff[i].value * af->coeff[i].value;
-    }
-    for(i=0; i<nl; i++) {
-        norm += al->coeff[i].value * al->coeff[i].value;
-    }
-    norm = sqrt(norm);
-    __nlScaleRow(weight / norm);
+       __nlTransition(__NL_STATE_MATRIX, __NL_STATE_ROW);
+       __nlRowColumnZero(&__nlCurrentContext->af);
+       __nlRowColumnZero(&__nlCurrentContext->al);
 }
 
 static void __nlEndRow() {
-    __NLRowColumn*    af = &__nlCurrentContext->af;
-    __NLRowColumn*    al = &__nlCurrentContext->al;
-    __NLRowColumn*    xl = &__nlCurrentContext->xl;
-    __NLSparseMatrix* M  = &__nlCurrentContext->M;
-    NLfloat* b        = __nlCurrentContext->b;
-    NLuint nf          = af->size;
-    NLuint nl          = al->size;
-    NLuint current_row = __nlCurrentContext->current_row;
-    NLuint i;
-    NLuint j;
-    NLfloat S;
-    __nlTransition(__NL_STATE_ROW, __NL_STATE_MATRIX);
-
-    if(__nlCurrentContext->normalize_rows) {
-        __nlNormalizeRow(__nlCurrentContext->row_scaling);
-    } else {
-        __nlScaleRow(__nlCurrentContext->row_scaling);
-    }
-
-    if(__nlCurrentContext->least_squares) {
-        for(i=0; i<nf; i++) {
-            for(j=0; j<nf; j++) {
-                __nlSparseMatrixAdd(
-                    M, af->coeff[i].index, af->coeff[j].index,
-                    af->coeff[i].value * af->coeff[j].value
-                );
-            }
-        }
-        S = -__nlCurrentContext->right_hand_side;
-        for(j=0; j<nl; j++) {
-            S += al->coeff[j].value * xl->coeff[j].value;
-        }
-        for(i=0; i<nf; i++) {
-            b[ af->coeff[i].index ] -= af->coeff[i].value * S;
-        }
-    } else {
-        for(i=0; i<nf; i++) {
-            __nlSparseMatrixAdd(
-                M, current_row, af->coeff[i].index, af->coeff[i].value
-            );
-        }
-        b[current_row] = -__nlCurrentContext->right_hand_side;
-        for(i=0; i<nl; i++) {
-            b[current_row] -= al->coeff[i].value * xl->coeff[i].value;
-        }
-    }
-    __nlCurrentContext->current_row++;
-    __nlCurrentContext->right_hand_side = 0.0;    
-    __nlCurrentContext->row_scaling     = 1.0;
+       __NLRowColumn*  af = &__nlCurrentContext->af;
+       __NLRowColumn*  al = &__nlCurrentContext->al;
+       __NLSparseMatrix* M  = &__nlCurrentContext->M;
+       NLfloat* b              = __nlCurrentContext->b;
+       NLuint nf                 = af->size;
+       NLuint nl                 = al->size;
+       NLuint current_row = __nlCurrentContext->current_row;
+       NLuint i;
+       NLuint j;
+       NLfloat S;
+       __nlTransition(__NL_STATE_ROW, __NL_STATE_MATRIX);
+
+       if(__nlCurrentContext->least_squares) {
+               if (!__nlCurrentContext->solve_again) {
+                       for(i=0; i<nf; i++) {
+                               for(j=0; j<nf; j++) {
+                                       __nlSparseMatrixAdd(
+                                               M, af->coeff[i].index, af->coeff[j].index,
+                                               af->coeff[i].value * af->coeff[j].value
+                                       );
+                               }
+                       }
+               }
+
+               S = -__nlCurrentContext->right_hand_side;
+               for(j=0; j<nl; j++)
+                       S += al->coeff[j].value;
+
+               for(i=0; i<nf; i++)
+                       b[ af->coeff[i].index ] -= af->coeff[i].value * S;
+       } else {
+               if (!__nlCurrentContext->solve_again) {
+                       for(i=0; i<nf; i++) {
+                               __nlSparseMatrixAdd(
+                                       M, current_row, af->coeff[i].index, af->coeff[i].value
+                               );
+                       }
+               }
+               b[current_row] = -__nlCurrentContext->right_hand_side;
+               for(i=0; i<nl; i++) {
+                       b[current_row] -= al->coeff[i].value;
+               }
+       }
+       __nlCurrentContext->current_row++;
+       __nlCurrentContext->right_hand_side = 0.0;      
 }
 
 void nlMatrixAdd(NLuint row, NLuint col, NLfloat value)
 {
-    __NLSparseMatrix* M  = &__nlCurrentContext->M;
-    __nlCheckState(__NL_STATE_MATRIX);
-    __nl_range_assert(row, 0, __nlCurrentContext->n - 1);
-    __nl_range_assert(col, 0, __nlCurrentContext->nb_variables - 1);
+       __NLSparseMatrix* M  = &__nlCurrentContext->M;
+       __nlCheckState(__NL_STATE_MATRIX);
+       __nl_range_assert(row, 0, __nlCurrentContext->n - 1);
+       __nl_range_assert(col, 0, __nlCurrentContext->nb_variables - 1);
        __nl_assert(!__nlCurrentContext->least_squares);
 
        __nlSparseMatrixAdd(M, row, col, value);
@@ -952,226 +906,264 @@ void nlMatrixAdd(NLuint row, NLuint col, NLfloat value)
 
 void nlRightHandSideAdd(NLuint index, NLfloat value)
 {
-    NLfloat* b = __nlCurrentContext->b;
+       NLfloat* b = __nlCurrentContext->b;
 
-    __nlCheckState(__NL_STATE_MATRIX);
-    __nl_range_assert(index, 0, __nlCurrentContext->n - 1);
+       __nlCheckState(__NL_STATE_MATRIX);
+       __nl_range_assert(index, 0, __nlCurrentContext->n - 1);
        __nl_assert(!__nlCurrentContext->least_squares);
 
        b[index] += value;
 }
 
 void nlCoefficient(NLuint index, NLfloat value) {
-    __NLVariable* v;
+       __NLVariable* v;
        unsigned int zero= 0;
-    __nlCheckState(__NL_STATE_ROW);
-    __nl_range_assert(index, zero, __nlCurrentContext->nb_variables - 1);
-    v = &(__nlCurrentContext->variable[index]);
-    if(v->locked) {
-        __nlRowColumnAppend(&(__nlCurrentContext->al), 0, value);
-        __nlRowColumnAppend(&(__nlCurrentContext->xl), 0, v->value);
-    } else {
-        __nlRowColumnAppend(&(__nlCurrentContext->af), v->index, value);
-    }
+       __nlCheckState(__NL_STATE_ROW);
+       __nl_range_assert(index, zero, __nlCurrentContext->nb_variables - 1);
+       v = &(__nlCurrentContext->variable[index]);
+       if(v->locked)
+               __nlRowColumnAppend(&(__nlCurrentContext->al), 0, value*v->value);
+       else
+               __nlRowColumnAppend(&(__nlCurrentContext->af), v->index, value);
 }
 
 void nlBegin(NLenum prim) {
-    switch(prim) {
-    case NL_SYSTEM: {
-        __nlBeginSystem();
-    } break;
-    case NL_MATRIX: {
-        __nlBeginMatrix();
-    } break;
-    case NL_ROW: {
-        __nlBeginRow();
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    }
-    }
+       switch(prim) {
+       case NL_SYSTEM: {
+               __nlBeginSystem();
+       } break;
+       case NL_MATRIX: {
+               __nlBeginMatrix();
+       } break;
+       case NL_ROW: {
+               __nlBeginRow();
+       } break;
+       default: {
+               __nl_assert_not_reached;
+       }
+       }
 }
 
 void nlEnd(NLenum prim) {
-    switch(prim) {
-    case NL_SYSTEM: {
-        __nlEndSystem();
-    } break;
-    case NL_MATRIX: {
-        __nlEndMatrix();
-    } break;
-    case NL_ROW: {
-        __nlEndRow();
-    } break;
-    default: {
-        __nl_assert_not_reached;
-    }
-    }
+       switch(prim) {
+       case NL_SYSTEM: {
+               __nlEndSystem();
+       } break;
+       case NL_MATRIX: {
+               __nlEndMatrix();
+       } break;
+       case NL_ROW: {
+               __nlEndRow();
+       } break;
+       default: {
+               __nl_assert_not_reached;
+       }
+       }
 }
 
 /************************************************************************/
 /* SuperLU wrapper */
 
-/* Note: SuperLU is difficult to call, but it is worth it.    */
+/* Note: SuperLU is difficult to call, but it is worth it.     */
 /* Here is a driver inspired by A. Sheffer's "cow flattener". */
-static NLboolean __nlSolve_SUPERLU( NLboolean do_perm) {
-
-    /* OpenNL Context */
-    __NLSparseMatrix* M  = &(__nlCurrentContext->M);
-    NLfloat* b          = __nlCurrentContext->b;
-    NLfloat* x          = __nlCurrentContext->x;
-
-    /* Compressed Row Storage matrix representation */
-    NLuint    n      = __nlCurrentContext->n;
-    NLuint    nnz    = __nlSparseMatrixNNZ(M); /* Number of Non-Zero coeffs */
-    NLint*    xa     = __NL_NEW_ARRAY(NLint, n+1);
-    NLfloat* rhs    = __NL_NEW_ARRAY(NLfloat, n);
-    NLfloat* a      = __NL_NEW_ARRAY(NLfloat, nnz);
-    NLint*    asub   = __NL_NEW_ARRAY(NLint, nnz);
-
-    /* Permutation vector */
-    NLint*    perm_r  = __NL_NEW_ARRAY(NLint, n);
-    NLint*    perm    = __NL_NEW_ARRAY(NLint, n);
-
-    /* SuperLU variables */
-    SuperMatrix A, B; /* System       */
-    SuperMatrix L, U; /* Inverse of A */
-    NLint info;       /* status code  */
-    DNformat *vals = NULL; /* access to result */
-    float *rvals  = NULL; /* access to result */
-
-    /* SuperLU options and stats */
-    superlu_options_t options;
-    SuperLUStat_t     stat;
-
-
-    /* Temporary variables */
-    __NLRowColumn* Ri = NULL;
-    NLuint         i,jj,count;
-    
-    __nl_assert(!(M->storage & __NL_SYMMETRIC));
-    __nl_assert(M->storage & __NL_ROWS);
-    __nl_assert(M->m == M->n);
-    
-    
-    /*
-     * Step 1: convert matrix M into SuperLU compressed column 
-     *   representation.
-     * -------------------------------------------------------
-     */
-
-&