svn merge ^/trunk/blender -r47961:48070
authorCampbell Barton <ideasman42@gmail.com>
Tue, 19 Jun 2012 08:16:07 +0000 (08:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 19 Jun 2012 08:16:07 +0000 (08:16 +0000)
414 files changed:
doc/python_api/examples/bpy.types.Object.py
doc/python_api/examples/bpy.types.Panel.1.py
extern/recastnavigation/recast-capi.cpp
intern/audaspace/Python/AUD_PyAPI.cpp
intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
intern/bsp/test/BSP_GhostTest/plyfile.c
intern/elbeem/intern/controlparticles.cpp
intern/ffmpeg/ffmpeg_compat.h
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/test/gears/GHOST_C-Test.c
intern/ghost/test/gears/GHOST_Test.cpp
intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
release/scripts/presets/operator/wm.collada_export/second_life.py
release/scripts/startup/bl_ui/properties_particle.py
source/blender/avi/intern/avi.c
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/CCGSubSurf.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/intern/fnmatch.c
source/blender/blenlib/intern/string_utf8.c
source/blender/blenlib/intern/threads.c
source/blender/blenlib/intern/voronoi.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureExporter.h
source/blender/collada/DocumentImporter.cpp
source/blender/collada/ExportSettings.h
source/blender/collada/GeometryExporter.cpp
source/blender/collada/MaterialExporter.cpp
source/blender/collada/collada.cpp
source/blender/collada/collada.h
source/blender/collada/collada_utils.cpp
source/blender/collada/collada_utils.h
source/blender/compositor/CMakeLists.txt
source/blender/compositor/COM_defines.h
source/blender/compositor/intern/COM_CPUDevice.cpp
source/blender/compositor/intern/COM_ChannelInfo.cpp
source/blender/compositor/intern/COM_ChunkOrder.cpp
source/blender/compositor/intern/COM_ChunkOrderHotspot.cpp
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_ExecutionSystem.cpp
source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
source/blender/compositor/intern/COM_InputSocket.cpp
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/compositor/intern/COM_Node.cpp
source/blender/compositor/intern/COM_NodeBase.cpp
source/blender/compositor/intern/COM_NodeBase.h
source/blender/compositor/intern/COM_NodeOperation.cpp
source/blender/compositor/intern/COM_OpenCLDevice.cpp
source/blender/compositor/intern/COM_OpenCLDevice.h
source/blender/compositor/intern/COM_OutputSocket.cpp
source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp
source/blender/compositor/intern/COM_Socket.cpp
source/blender/compositor/intern/COM_SocketConnection.cpp
source/blender/compositor/intern/COM_WorkScheduler.cpp
source/blender/compositor/nodes/COM_AlphaOverNode.cpp
source/blender/compositor/nodes/COM_BilateralBlurNode.cpp
source/blender/compositor/nodes/COM_BlurNode.cpp
source/blender/compositor/nodes/COM_BokehBlurNode.cpp
source/blender/compositor/nodes/COM_BokehImageNode.cpp
source/blender/compositor/nodes/COM_BoxMaskNode.cpp
source/blender/compositor/nodes/COM_BrightnessNode.cpp
source/blender/compositor/nodes/COM_ChannelMatteNode.cpp
source/blender/compositor/nodes/COM_ChromaMatteNode.cpp
source/blender/compositor/nodes/COM_ColorBalanceNode.cpp
source/blender/compositor/nodes/COM_ColorCorrectionNode.cpp
source/blender/compositor/nodes/COM_ColorCurveNode.cpp
source/blender/compositor/nodes/COM_ColorMatteNode.cpp
source/blender/compositor/nodes/COM_ColorNode.cpp
source/blender/compositor/nodes/COM_ColorRampNode.cpp
source/blender/compositor/nodes/COM_ColorSpillNode.cpp
source/blender/compositor/nodes/COM_ColorToBWNode.cpp
source/blender/compositor/nodes/COM_CombineHSVANode.cpp
source/blender/compositor/nodes/COM_CombineRGBANode.cpp
source/blender/compositor/nodes/COM_CombineYCCANode.cpp
source/blender/compositor/nodes/COM_CombineYUVANode.cpp
source/blender/compositor/nodes/COM_CompositorNode.cpp
source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp
source/blender/compositor/nodes/COM_CropNode.cpp
source/blender/compositor/nodes/COM_DefocusNode.cpp
source/blender/compositor/nodes/COM_DifferenceMatteNode.cpp
source/blender/compositor/nodes/COM_DilateErodeNode.cpp
source/blender/compositor/nodes/COM_DilateErodeNode.h
source/blender/compositor/nodes/COM_DirectionalBlurNode.cpp
source/blender/compositor/nodes/COM_DisplaceNode.cpp
source/blender/compositor/nodes/COM_DistanceMatteNode.cpp
source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp
source/blender/compositor/nodes/COM_EllipseMaskNode.cpp
source/blender/compositor/nodes/COM_FilterNode.cpp
source/blender/compositor/nodes/COM_FlipNode.cpp
source/blender/compositor/nodes/COM_GammaNode.cpp
source/blender/compositor/nodes/COM_GlareNode.cpp
source/blender/compositor/nodes/COM_GroupNode.cpp
source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp
source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp
source/blender/compositor/nodes/COM_IDMaskNode.cpp
source/blender/compositor/nodes/COM_ImageNode.cpp
source/blender/compositor/nodes/COM_InvertNode.cpp
source/blender/compositor/nodes/COM_KeyingNode.cpp
source/blender/compositor/nodes/COM_KeyingScreenNode.cpp
source/blender/compositor/nodes/COM_LensDistortionNode.cpp
source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp
source/blender/compositor/nodes/COM_MapUVNode.cpp
source/blender/compositor/nodes/COM_MapValueNode.cpp
source/blender/compositor/nodes/COM_MaskNode.cpp
source/blender/compositor/nodes/COM_MathNode.cpp
source/blender/compositor/nodes/COM_MixNode.cpp
source/blender/compositor/nodes/COM_MovieClipNode.cpp
source/blender/compositor/nodes/COM_MovieDistortionNode.cpp
source/blender/compositor/nodes/COM_MuteNode.cpp
source/blender/compositor/nodes/COM_NormalNode.cpp
source/blender/compositor/nodes/COM_NormalizeNode.cpp
source/blender/compositor/nodes/COM_OutputFileNode.cpp
source/blender/compositor/nodes/COM_RenderLayersNode.cpp
source/blender/compositor/nodes/COM_RotateNode.cpp
source/blender/compositor/nodes/COM_ScaleNode.cpp
source/blender/compositor/nodes/COM_SeparateHSVANode.cpp
source/blender/compositor/nodes/COM_SeparateRGBANode.cpp
source/blender/compositor/nodes/COM_SeparateYCCANode.cpp
source/blender/compositor/nodes/COM_SeparateYUVANode.cpp
source/blender/compositor/nodes/COM_SetAlphaNode.cpp
source/blender/compositor/nodes/COM_SocketProxyNode.cpp
source/blender/compositor/nodes/COM_SplitViewerNode.cpp
source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
source/blender/compositor/nodes/COM_SwitchNode.cpp
source/blender/compositor/nodes/COM_TextureNode.cpp
source/blender/compositor/nodes/COM_TimeNode.cpp
source/blender/compositor/nodes/COM_TonemapNode.cpp
source/blender/compositor/nodes/COM_TransformNode.cpp
source/blender/compositor/nodes/COM_TranslateNode.cpp
source/blender/compositor/nodes/COM_ValueNode.cpp
source/blender/compositor/nodes/COM_VectorBlurNode.cpp
source/blender/compositor/nodes/COM_VectorCurveNode.cpp
source/blender/compositor/nodes/COM_ViewLevelsNode.cpp
source/blender/compositor/nodes/COM_ViewerNode.cpp
source/blender/compositor/nodes/COM_ZCombineNode.cpp
source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp
source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp
source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp
source/blender/compositor/operations/COM_AntiAliasOperation.cpp
source/blender/compositor/operations/COM_BlurBaseOperation.cpp
source/blender/compositor/operations/COM_BlurBaseOperation.h
source/blender/compositor/operations/COM_BokehBlurOperation.cpp
source/blender/compositor/operations/COM_BokehImageOperation.cpp
source/blender/compositor/operations/COM_BoxMaskOperation.cpp
source/blender/compositor/operations/COM_BrightnessOperation.cpp
source/blender/compositor/operations/COM_CalculateMeanOperation.cpp
source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp
source/blender/compositor/operations/COM_ChangeHSVOperation.cpp
source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
source/blender/compositor/operations/COM_ChromaMatteOperation.cpp
source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp
source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp
source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
source/blender/compositor/operations/COM_ColorCurveOperation.cpp
source/blender/compositor/operations/COM_ColorMatteOperation.cpp
source/blender/compositor/operations/COM_ColorRampOperation.cpp
source/blender/compositor/operations/COM_ColorSpillOperation.cpp
source/blender/compositor/operations/COM_CombineChannelsOperation.cpp
source/blender/compositor/operations/COM_ConvertColorProfileOperation.cpp
source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp
source/blender/compositor/operations/COM_ConvertColorToVectorOperation.cpp
source/blender/compositor/operations/COM_ConvertColourToValueProg.cpp
source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.cpp
source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp
source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp
source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.cpp
source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp
source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.cpp
source/blender/compositor/operations/COM_ConvertValueToColourProg.cpp
source/blender/compositor/operations/COM_ConvertValueToVectorOperation.cpp
source/blender/compositor/operations/COM_ConvertVectorToColorOperation.cpp
source/blender/compositor/operations/COM_ConvertVectorToValueOperation.cpp
source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp
source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.cpp
source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp
source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp
source/blender/compositor/operations/COM_CropOperation.cpp
source/blender/compositor/operations/COM_CurveBaseOperation.cpp
source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/compositor/operations/COM_DisplaceOperation.cpp
source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp
source/blender/compositor/operations/COM_DistanceMatteOperation.cpp
source/blender/compositor/operations/COM_DotproductOperation.cpp
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
source/blender/compositor/operations/COM_EllipseMaskOperation.cpp
source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
source/blender/compositor/operations/COM_FastGaussianBlurOperation.h
source/blender/compositor/operations/COM_FlipOperation.cpp
source/blender/compositor/operations/COM_GammaCorrectOperation.cpp
source/blender/compositor/operations/COM_GammaOperation.cpp
source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp [new file with mode: 0644]
source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h [new file with mode: 0644]
source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp [new file with mode: 0644]
source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h [new file with mode: 0644]
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianXBlurOperation.h
source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp
source/blender/compositor/operations/COM_IDMaskOperation.cpp
source/blender/compositor/operations/COM_ImageOperation.cpp
source/blender/compositor/operations/COM_InvertOperation.cpp
source/blender/compositor/operations/COM_KeyingClipOperation.cpp
source/blender/compositor/operations/COM_KeyingDespillOperation.cpp
source/blender/compositor/operations/COM_KeyingOperation.cpp
source/blender/compositor/operations/COM_KeyingScreenOperation.cpp
source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
source/blender/compositor/operations/COM_MapUVOperation.cpp
source/blender/compositor/operations/COM_MapValueOperation.cpp
source/blender/compositor/operations/COM_MaskOperation.cpp
source/blender/compositor/operations/COM_MathBaseOperation.cpp
source/blender/compositor/operations/COM_MixAddOperation.cpp
source/blender/compositor/operations/COM_MixBaseOperation.cpp
source/blender/compositor/operations/COM_MixBlendOperation.cpp
source/blender/compositor/operations/COM_MixBurnOperation.cpp
source/blender/compositor/operations/COM_MixColorOperation.cpp
source/blender/compositor/operations/COM_MixDarkenOperation.cpp
source/blender/compositor/operations/COM_MixDifferenceOperation.cpp
source/blender/compositor/operations/COM_MixDivideOperation.cpp
source/blender/compositor/operations/COM_MixDodgeOperation.cpp
source/blender/compositor/operations/COM_MixGlareOperation.cpp
source/blender/compositor/operations/COM_MixHueOperation.cpp
source/blender/compositor/operations/COM_MixLightenOperation.cpp
source/blender/compositor/operations/COM_MixLinearLightOperation.cpp
source/blender/compositor/operations/COM_MixMultiplyOperation.cpp
source/blender/compositor/operations/COM_MixOverlayOperation.cpp
source/blender/compositor/operations/COM_MixSaturationOperation.cpp
source/blender/compositor/operations/COM_MixScreenOperation.cpp
source/blender/compositor/operations/COM_MixSoftLightOperation.cpp
source/blender/compositor/operations/COM_MixSubtractOperation.cpp
source/blender/compositor/operations/COM_MixValueOperation.cpp
source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
source/blender/compositor/operations/COM_MovieClipOperation.cpp
source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
source/blender/compositor/operations/COM_NormalizeOperation.cpp
source/blender/compositor/operations/COM_OpenCLKernels.cl
source/blender/compositor/operations/COM_OpenCLKernels.cl.h
source/blender/compositor/operations/COM_OutputFileOperation.cpp
source/blender/compositor/operations/COM_PreviewOperation.cpp
source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
source/blender/compositor/operations/COM_QualityStepHelper.cpp
source/blender/compositor/operations/COM_ReadBufferOperation.cpp
source/blender/compositor/operations/COM_RenderLayersAOOperation.cpp
source/blender/compositor/operations/COM_RenderLayersAlphaProg.cpp
source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
source/blender/compositor/operations/COM_RenderLayersColorOperation.cpp
source/blender/compositor/operations/COM_RenderLayersCyclesOperation.cpp
source/blender/compositor/operations/COM_RenderLayersDepthProg.cpp
source/blender/compositor/operations/COM_RenderLayersDiffuseOperation.cpp
source/blender/compositor/operations/COM_RenderLayersEmitOperation.cpp
source/blender/compositor/operations/COM_RenderLayersEnvironmentOperation.cpp
source/blender/compositor/operations/COM_RenderLayersImageProg.cpp
source/blender/compositor/operations/COM_RenderLayersIndirectOperation.cpp
source/blender/compositor/operations/COM_RenderLayersMaterialIndexOperation.cpp
source/blender/compositor/operations/COM_RenderLayersMistOperation.cpp
source/blender/compositor/operations/COM_RenderLayersNormalOperation.cpp
source/blender/compositor/operations/COM_RenderLayersObjectIndexOperation.cpp
source/blender/compositor/operations/COM_RenderLayersReflectionOperation.cpp
source/blender/compositor/operations/COM_RenderLayersRefractionOperation.cpp
source/blender/compositor/operations/COM_RenderLayersShadowOperation.cpp
source/blender/compositor/operations/COM_RenderLayersSpecularOperation.cpp
source/blender/compositor/operations/COM_RenderLayersSpeedOperation.cpp
source/blender/compositor/operations/COM_RenderLayersUVOperation.cpp
source/blender/compositor/operations/COM_RotateOperation.cpp
source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
source/blender/compositor/operations/COM_SeparateChannelOperation.cpp
source/blender/compositor/operations/COM_SetAlphaOperation.cpp
source/blender/compositor/operations/COM_SetColorOperation.cpp
source/blender/compositor/operations/COM_SetSamplerOperation.cpp
source/blender/compositor/operations/COM_SetValueOperation.cpp
source/blender/compositor/operations/COM_SetVectorOperation.cpp
source/blender/compositor/operations/COM_SocketProxyOperation.cpp
source/blender/compositor/operations/COM_TextureOperation.cpp
source/blender/compositor/operations/COM_TonemapOperation.cpp
source/blender/compositor/operations/COM_TranslateOperation.cpp
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
source/blender/compositor/operations/COM_VectorCurveOperation.cpp
source/blender/compositor/operations/COM_WriteBufferOperation.cpp
source/blender/compositor/operations/COM_ZCombineOperation.cpp
source/blender/editors/CMakeLists.txt
source/blender/editors/SConscript
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/keyframes_general.c
source/blender/editors/animation/keyframing.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/resources.c
source/blender/editors/io/CMakeLists.txt [new file with mode: 0644]
source/blender/editors/io/SConscript [new file with mode: 0644]
source/blender/editors/io/io_collada.c [new file with mode: 0644]
source/blender/editors/io/io_collada.h [new file with mode: 0644]
source/blender/editors/io/io_ops.c [new file with mode: 0644]
source/blender/editors/io/io_ops.h [new file with mode: 0644]
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_lattice.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_api/CMakeLists.txt
source/blender/editors/space_api/SConscript
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filelist.h
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_file/fsmenu.h
source/blender/editors/space_file/space_file.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform_snap.c
source/blender/gpu/intern/gpu_draw.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/intern/rna_movieclip.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_nodetree_types.h
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_defocus.c
source/blender/nodes/composite/nodes/node_composite_dilate.c
source/blender/nodes/composite/nodes/node_composite_mask.c
source/blender/nodes/shader/nodes/node_shader_particle_info.c
source/blender/nodes/texture/node_texture_util.c
source/blender/nodes/texture/nodes/node_texture_coord.c
source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
source/blender/nodes/texture/nodes/node_texture_texture.c
source/blender/python/mathutils/mathutils_Vector.c
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/pixelblending.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_subwindow.c
source/blender/windowmanager/intern/wm_window.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BulletPhysicsController.h
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_PyMath.h
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/VideoTexture/Exception.cpp
source/gameengine/VideoTexture/FilterBase.cpp
source/gameengine/VideoTexture/FilterBase.h
source/gameengine/VideoTexture/FilterBlueScreen.cpp
source/gameengine/VideoTexture/FilterColor.cpp
source/gameengine/VideoTexture/FilterNormal.cpp
source/gameengine/VideoTexture/FilterSource.cpp
source/gameengine/VideoTexture/ImageBase.cpp
source/gameengine/VideoTexture/ImageBase.h
source/gameengine/VideoTexture/ImageBuff.cpp
source/gameengine/VideoTexture/ImageMix.cpp
source/gameengine/VideoTexture/ImageRender.cpp
source/gameengine/VideoTexture/ImageRender.h
source/gameengine/VideoTexture/ImageViewport.cpp
source/gameengine/VideoTexture/PyTypeList.cpp
source/gameengine/VideoTexture/PyTypeList.h
source/gameengine/VideoTexture/Texture.cpp
source/gameengine/VideoTexture/Texture.h
source/gameengine/VideoTexture/VideoBase.h
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/gameengine/VideoTexture/VideoFFmpeg.h
source/gameengine/VideoTexture/blendVideoTex.cpp

index 5301797..2ddce24 100644 (file)
@@ -2,7 +2,7 @@
 Basic Object Operations Example
 +++++++++++++++++++++++++++++++
 This script demonstrates basic operations on object like creating new
-object, placing it into scene, selecting it and making it active
+object, placing it into scene, selecting it and making it active.
 """
 
 import bpy
@@ -11,15 +11,15 @@ from mathutils import Matrix
 scene = bpy.context.scene
 
 # Create new lamp datablock
-lamp_data = bpy.data.lamps.new(name="New Lamp", type="POINT")
+lamp_data = bpy.data.lamps.new(name="New Lamp", type='POINT')
 
-# Create new object with out lamp datablock
+# Create new object with our lamp datablock
 lamp_object = bpy.data.objects.new(name="New Lamp", object_data=lamp_data)
 
 # Link lamp object to the scene so it'll appear in this scene
 scene.objects.link(lamp_object)
 
-# Place lamp to specified location
+# Place lamp to specified location
 lamp_object.location = (5.0, 5.0, 5.0)
 
 # And finally select it make active
index cd85d30..fbcdae8 100644 (file)
@@ -2,7 +2,7 @@
 Simple Object Panel
 +++++++++++++++++++
 This panel has a :class:`Panel.poll` and :class:`Panel.draw_header` function,
-even though the contents is basic this closely resemples blenders panels.
+even though the contents is basic this closely resembles blenders panels.
 """
 import bpy
 
index 9aeb0d6..1cf8ed5 100644 (file)
@@ -278,7 +278,7 @@ static inline void   swapfunc(char *, char *, int, int);
 #define min(a, b)      (a) < (b) ? a : b
 #define swapcode(TYPE, parmi, parmj, n)                \
 {                                                                                      \
-       long i = (n) / sizeof (TYPE);                   \
+       long i = (n) / sizeof(TYPE);                    \
        TYPE *pi = (TYPE *) (parmi);                    \
        TYPE *pj = (TYPE *) (parmj);                    \
        do {                                                                    \
index bbc7a0c..238249b 100644 (file)
@@ -28,7 +28,7 @@
 
 
 #include "AUD_PyAPI.h"
-#include "structmember.h"
+#include <structmember.h>
 
 #include "AUD_I3DDevice.h"
 #include "AUD_I3DHandle.h"
index 6553073..28a14a9 100644 (file)
@@ -143,23 +143,23 @@ void AUD_FFMPEGReader::init()
 
        switch(m_codecCtx->sample_fmt)
        {
-       case SAMPLE_FMT_U8:
+       case AV_SAMPLE_FMT_U8:
                m_convert = AUD_convert_u8_float;
                m_specs.format = AUD_FORMAT_U8;
                break;
-       case SAMPLE_FMT_S16:
+       case AV_SAMPLE_FMT_S16:
                m_convert = AUD_convert_s16_float;
                m_specs.format = AUD_FORMAT_S16;
                break;
-       case SAMPLE_FMT_S32:
+       case AV_SAMPLE_FMT_S32:
                m_convert = AUD_convert_s32_float;
                m_specs.format = AUD_FORMAT_S32;
                break;
-       case SAMPLE_FMT_FLT:
+       case AV_SAMPLE_FMT_FLT:
                m_convert = AUD_convert_copy<float>;
                m_specs.format = AUD_FORMAT_FLOAT32;
                break;
-       case SAMPLE_FMT_DBL:
+       case AV_SAMPLE_FMT_DBL:
                m_convert = AUD_convert_double_float;
                m_specs.format = AUD_FORMAT_FLOAT64;
                break;
@@ -189,7 +189,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(std::string filename) :
        }
        catch(AUD_Exception&)
        {
-               av_close_input_file(m_formatCtx);
+               avformat_close_input(&m_formatCtx);
                throw;
        }
 }
@@ -227,7 +227,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference<AUD_Buffer> buffer) :
        }
        catch(AUD_Exception&)
        {
-               av_close_input_stream(m_formatCtx);
+               avformat_close_input(&m_formatCtx);
                av_free(m_aviocontext);
                throw;
        }
@@ -239,7 +239,7 @@ AUD_FFMPEGReader::~AUD_FFMPEGReader()
 
        if(m_aviocontext)
        {
-               av_close_input_stream(m_formatCtx);
+               avformat_close_input(&m_formatCtx);
                av_free(m_aviocontext);
        }
        else
index 702c366..2b34348 100644 (file)
@@ -133,23 +133,23 @@ AUD_FFMPEGWriter::AUD_FFMPEGWriter(std::string filename, AUD_DeviceSpecs specs,
                {
                case AUD_FORMAT_U8:
                        m_convert = AUD_convert_float_u8;
-                       m_codecCtx->sample_fmt = SAMPLE_FMT_U8;
+                       m_codecCtx->sample_fmt = AV_SAMPLE_FMT_U8;
                        break;
                case AUD_FORMAT_S16:
                        m_convert = AUD_convert_float_s16;
-                       m_codecCtx->sample_fmt = SAMPLE_FMT_S16;
+                       m_codecCtx->sample_fmt = AV_SAMPLE_FMT_S16;
                        break;
                case AUD_FORMAT_S32:
                        m_convert = AUD_convert_float_s32;
-                       m_codecCtx->sample_fmt = SAMPLE_FMT_S32;
+                       m_codecCtx->sample_fmt = AV_SAMPLE_FMT_S32;
                        break;
                case AUD_FORMAT_FLOAT32:
                        m_convert = AUD_convert_copy<float>;
-                       m_codecCtx->sample_fmt = SAMPLE_FMT_FLT;
+                       m_codecCtx->sample_fmt = AV_SAMPLE_FMT_FLT;
                        break;
                case AUD_FORMAT_FLOAT64:
                        m_convert = AUD_convert_float_double;
-                       m_codecCtx->sample_fmt = SAMPLE_FMT_DBL;
+                       m_codecCtx->sample_fmt = AV_SAMPLE_FMT_DBL;
                        break;
                default:
                        AUD_THROW(AUD_ERROR_FFMPEG, format_error);
index 9cb9d81..b0134f0 100644 (file)
 /*
 
 
-The interface routines for reading and writing PLY polygon files.
+   The interface routines for reading and writing PLY polygon files.
 
-Greg Turk, February 1994
+   Greg Turk, February 1994
 
----------------------------------------------------------------
+   ---------------------------------------------------------------
 
-A PLY file contains a single polygonal _object_.
+   A PLY file contains a single polygonal _object_.
 
-An object is composed of lists of _elements_.  Typical elements are
-vertices, faces, edges and materials.
+   An object is composed of lists of _elements_.  Typical elements are
+   vertices, faces, edges and materials.
 
-Each type of element for a given object has one or more _properties_
-associated with the element type.  For instance, a vertex element may
-have as properties the floating-point values x,y,z and the three unsigned
-chars representing red, green and blue.
+   Each type of element for a given object has one or more _properties_
+   associated with the element type.  For instance, a vertex element may
+   have as properties the floating-point values x,y,z and the three unsigned
+   chars representing red, green and blue.
 
----------------------------------------------------------------
+   ---------------------------------------------------------------
 
-Copyright (c) 1994 The Board of Trustees of The Leland Stanford
-Junior University.  All rights reserved.   
+   Copyright (c) 1994 The Board of Trustees of The Leland Stanford
+   Junior University.  All rights reserved.
   
-Permission to use, copy, modify and distribute this software and its   
-documentation for any purpose is hereby granted without fee, provided   
-that the above copyright notice and this permission notice appear in   
-all copies of this software and that you do not sell the software.   
+   Permission to use, copy, modify and distribute this software and its
+   documentation for any purpose is hereby granted without fee, provided
+   that the above copyright notice and this permission notice appear in
+   all copies of this software and that you do not sell the software.
   
-THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,   
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY   
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   
+   THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
+   EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+   WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 
-*/
+ */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -67,14 +67,14 @@ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 #include "ply.h"
 
 char *type_names[] = {
-"invalid",
-"char", "short", "int",
-"uchar", "ushort", "uint",
-"float", "double",
+       "invalid",
+       "char", "short", "int",
+       "uchar", "ushort", "uint",
+       "float", "double",
 };
 
 int ply_type_size[] = {
-  0, 1, 2, 4, 1, 2, 4, 4, 8
+       0, 1, 2, 4, 1, 2, 4, 4, 8
 };
 
 #define NO_OTHER_PROPS  -1
@@ -96,7 +96,7 @@ PlyElement *find_element(PlyFile *, char *);
 PlyProperty *find_property(PlyElement *, char *, int *);
 
 /* write to a file the word describing a PLY file data type */
-void write_scalar_type (FILE *, int);
+void write_scalar_type(FILE *, int);
 
 /* read a line from a file and break it up into separate words */
 char **get_words(FILE *, int *, char **);
@@ -120,7 +120,7 @@ void copy_property(PlyProperty *, PlyProperty *);
 void store_item(char *, int, int, unsigned int, double);
 
 /* return the value of a stored item */
-void get_stored_item( void *, int, int *, unsigned int *, double *);
+void get_stored_item(void *, int, int *, unsigned int *, double *);
 
 /* return the value stored in an item, given ptr to it and its type */
 double get_item_value(char *, int);
@@ -143,551 +143,551 @@ char *my_alloc(int, int, char *);
 
 
 /******************************************************************************
-Given a file pointer, get ready to write PLY data to the file.
+   Given a file pointer, get ready to write PLY data to the file.
 
-Entry:
-  fp         - the given file pointer
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
+   Entry:
+   fp         - the given file pointer
+   nelems     - number of elements in object
+   elem_names - list of element names
+   file_type  - file type, either ascii or binary
 
-Exit:
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
+   Exit:
+   returns a pointer to a PlyFile, used to refer to this file, or NULL if error
 ******************************************************************************/
 
 PlyFile *ply_write(
-  FILE *fp,
-  int nelems,
-  char **elem_names,
-  int file_type
-)
+    FILE *fp,
+    int nelems,
+    char **elem_names,
+    int file_type
+    )
 {
-  int i;
-  PlyFile *plyfile;
-  PlyElement *elem;
-
-  /* check for NULL file pointer */
-  if (fp == NULL)
-    return (NULL);
-
-  /* create a record for this object */
-
-  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
-  plyfile->file_type = file_type;
-  plyfile->num_comments = 0;
-  plyfile->num_obj_info = 0;
-  plyfile->nelems = nelems;
-  plyfile->version = 1.0;
-  plyfile->fp = fp;
-  plyfile->other_elems = NULL;
-
-  /* tuck aside the names of the elements */
-
-  plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *) * nelems);
-  for (i = 0; i < nelems; i++) {
-    elem = (PlyElement *) myalloc (sizeof (PlyElement));
-    plyfile->elems[i] = elem;
-    elem->name = strdup (elem_names[i]);
-    elem->num = 0;
-    elem->nprops = 0;
-  }
-
-  /* return pointer to the file descriptor */
-  return (plyfile);
+       int i;
+       PlyFile *plyfile;
+       PlyElement *elem;
+
+       /* check for NULL file pointer */
+       if (fp == NULL)
+               return (NULL);
+
+       /* create a record for this object */
+
+       plyfile = (PlyFile *) myalloc(sizeof(PlyFile));
+       plyfile->file_type = file_type;
+       plyfile->num_comments = 0;
+       plyfile->num_obj_info = 0;
+       plyfile->nelems = nelems;
+       plyfile->version = 1.0;
+       plyfile->fp = fp;
+       plyfile->other_elems = NULL;
+
+       /* tuck aside the names of the elements */
+
+       plyfile->elems = (PlyElement **) myalloc(sizeof(PlyElement *) * nelems);
+       for (i = 0; i < nelems; i++) {
+               elem = (PlyElement *) myalloc(sizeof(PlyElement));
+               plyfile->elems[i] = elem;
+               elem->name = strdup(elem_names[i]);
+               elem->num = 0;
+               elem->nprops = 0;
+       }
+
+       /* return pointer to the file descriptor */
+       return (plyfile);
 }
 
 
 /******************************************************************************
-Open a polygon file for writing.
+   Open a polygon file for writing.
 
-Entry:
-  filename   - name of file to read from
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
+   Entry:
+   filename   - name of file to read from
+   nelems     - number of elements in object
+   elem_names - list of element names
+   file_type  - file type, either ascii or binary
 
-Exit:
-  version - version number of PLY file
-  returns a file identifier, used to refer to this file, or NULL if error
+   Exit:
+   version - version number of PLY file
+   returns a file identifier, used to refer to this file, or NULL if error
 ******************************************************************************/
 
 PlyFile *ply_open_for_writing(
-  char *filename,
-  int nelems,
-  char **elem_names,
-  int file_type,
-  float *version
-)
+    char *filename,
+    int nelems,
+    char **elem_names,
+    int file_type,
+    float *version
+    )
 {
-  PlyFile *plyfile;
-  char *name;
-  FILE *fp;
+       PlyFile *plyfile;
+       char *name;
+       FILE *fp;
 
-  /* tack on the extension .ply, if necessary */
+       /* tack on the extension .ply, if necessary */
 
-  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
-  strcpy (name, filename);
-  if (strlen (name) < 4 ||
-      strcmp (name + strlen (name) - 4, ".ply") != 0)
-      strcat (name, ".ply");
+       name = (char *) myalloc(sizeof(char) * (strlen(filename) + 5));
+       strcpy(name, filename);
+       if (strlen(name) < 4 ||
+           strcmp(name + strlen(name) - 4, ".ply") != 0)
+               strcat(name, ".ply");
 
-  /* open the file for writing */
+       /* open the file for writing */
 
-  fp = fopen (name, "w");
-  if (fp == NULL) {
-    return (NULL);
-  }
+       fp = fopen(name, "w");
+       if (fp == NULL) {
+               return (NULL);
+       }
 
-  /* create the actual PlyFile structure */
+       /* create the actual PlyFile structure */
 
-  plyfile = ply_write (fp, nelems, elem_names, file_type);
-  if (plyfile == NULL)
-    return (NULL);
+       plyfile = ply_write(fp, nelems, elem_names, file_type);
+       if (plyfile == NULL)
+               return (NULL);
 
-  /* say what PLY file version number we're writing */
-  *version = plyfile->version;
+       /* say what PLY file version number we're writing */
+       *version = plyfile->version;
 
-  /* return pointer to the file descriptor */
-  return (plyfile);
+       /* return pointer to the file descriptor */
+       return (plyfile);
 }
 
 
 /******************************************************************************
-Describe an element, including its properties and how many will be written
-to the file.
-
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  nelems    - number of elements of this type to be written
-  nprops    - number of properties contained in the element
-  prop_list - list of properties
+   Describe an element, including its properties and how many will be written
+   to the file.
+
+   Entry:
+   plyfile   - file identifier
+   elem_name - name of element that information is being specified about
+   nelems    - number of elements of this type to be written
+   nprops    - number of properties contained in the element
+   prop_list - list of properties
 ******************************************************************************/
 
 void ply_describe_element(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems,
-  int nprops,
-  PlyProperty *prop_list
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    int nelems,
+    int nprops,
+    PlyProperty *prop_list
+    )
 {
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"ply_describe_element: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
-
-  elem->num = nelems;
-
-  /* copy the list of properties */
-
-  elem->nprops = nprops;
-  elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *) * nprops);
-  elem->store_prop = (char *) myalloc (sizeof (char) * nprops);
-
-  for (i = 0; i < nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    elem->props[i] = prop;
-    elem->store_prop[i] = NAMED_PROP;
-    copy_property (prop, &prop_list[i]);
-  }
+       int i;
+       PlyElement *elem;
+       PlyProperty *prop;
+
+       /* look for appropriate element */
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL) {
+               fprintf(stderr, "ply_describe_element: can't find element '%s'\n", elem_name);
+               exit(-1);
+       }
+
+       elem->num = nelems;
+
+       /* copy the list of properties */
+
+       elem->nprops = nprops;
+       elem->props = (PlyProperty **) myalloc(sizeof(PlyProperty *) * nprops);
+       elem->store_prop = (char *) myalloc(sizeof(char) * nprops);
+
+       for (i = 0; i < nprops; i++) {
+               prop = (PlyProperty *) myalloc(sizeof(PlyProperty));
+               elem->props[i] = prop;
+               elem->store_prop[i] = NAMED_PROP;
+               copy_property(prop, &prop_list[i]);
+       }
 }
 
 
 /******************************************************************************
-Describe a property of an element.
+   Describe a property of an element.
 
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  prop      - the new property
+   Entry:
+   plyfile   - file identifier
+   elem_name - name of element that information is being specified about
+   prop      - the new property
 ******************************************************************************/
 
 void ply_describe_property(
-  PlyFile *plyfile,
-  char *elem_name,
-  PlyProperty *prop
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    PlyProperty *prop
+    )
 {
-  PlyElement *elem;
-  PlyProperty *elem_prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr, "ply_describe_property: can't find element '%s'\n",
-            elem_name);
-    return;
-  }
-
-  /* create room for new property */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-    elem->store_prop = (char *) myalloc (sizeof (char));
-    elem->nprops = 1;
-  }
-  else {
-    elem->nprops++;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
-  }
-
-  /* copy the new property */
-
-  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-  elem->props[elem->nprops - 1] = elem_prop;
-  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
-  copy_property (elem_prop, prop);
+       PlyElement *elem;
+       PlyProperty *elem_prop;
+
+       /* look for appropriate element */
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL) {
+               fprintf(stderr, "ply_describe_property: can't find element '%s'\n",
+                       elem_name);
+               return;
+       }
+
+       /* create room for new property */
+
+       if (elem->nprops == 0) {
+               elem->props = (PlyProperty **) myalloc(sizeof(PlyProperty *));
+               elem->store_prop = (char *) myalloc(sizeof(char));
+               elem->nprops = 1;
+       }
+       else {
+               elem->nprops++;
+               elem->props = (PlyProperty **)
+                             realloc(elem->props, sizeof(PlyProperty *) * elem->nprops);
+               elem->store_prop = (char *)
+                                  realloc(elem->store_prop, sizeof(char) * elem->nprops);
+       }
+
+       /* copy the new property */
+
+       elem_prop = (PlyProperty *) myalloc(sizeof(PlyProperty));
+       elem->props[elem->nprops - 1] = elem_prop;
+       elem->store_prop[elem->nprops - 1] = NAMED_PROP;
+       copy_property(elem_prop, prop);
 }
 
 
 /******************************************************************************
-Describe what the "other" properties are that are to be stored, and where
-they are in an element.
+   Describe what the "other" properties are that are to be stored, and where
+   they are in an element.
 ******************************************************************************/
 
 void ply_describe_other_properties(
-  PlyFile *plyfile,
-  PlyOtherProp *other,
-  int offset
-)
+    PlyFile *plyfile,
+    PlyOtherProp *other,
+    int offset
+    )
 {
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, other->name);
-  if (elem == NULL) {
-    fprintf(stderr, "ply_describe_other_properties: can't find element '%s'\n",
-            other->name);
-    return;
-  }
-
-  /* create room for other properties */
-
-  if (elem->nprops == 0) {
-    elem->props = (PlyProperty **)
-                  myalloc (sizeof (PlyProperty *) * other->nprops);
-    elem->store_prop = (char *) myalloc (sizeof (char) * other->nprops);
-    elem->nprops = 0;
-  }
-  else {
-    int newsize;
-    newsize = elem->nprops + other->nprops;
-    elem->props = (PlyProperty **)
-                  realloc (elem->props, sizeof (PlyProperty *) * newsize);
-    elem->store_prop = (char *)
-                  realloc (elem->store_prop, sizeof (char) * newsize);
-  }
-
-  /* copy the other properties */
-
-  for (i = 0; i < other->nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, other->props[i]);
-    elem->props[elem->nprops] = prop;
-    elem->store_prop[elem->nprops] = OTHER_PROP;
-    elem->nprops++;
-  }
-
-  /* save other info about other properties */
-  elem->other_size = other->size;
-  elem->other_offset = offset;
+       int i;
+       PlyElement *elem;
+       PlyProperty *prop;
+
+       /* look for appropriate element */
+       elem = find_element(plyfile, other->name);
+       if (elem == NULL) {
+               fprintf(stderr, "ply_describe_other_properties: can't find element '%s'\n",
+                       other->name);
+               return;
+       }
+
+       /* create room for other properties */
+
+       if (elem->nprops == 0) {
+               elem->props = (PlyProperty **)
+                             myalloc(sizeof(PlyProperty *) * other->nprops);
+               elem->store_prop = (char *) myalloc(sizeof(char) * other->nprops);
+               elem->nprops = 0;
+       }
+       else {
+               int newsize;
+               newsize = elem->nprops + other->nprops;
+               elem->props = (PlyProperty **)
+                             realloc(elem->props, sizeof(PlyProperty *) * newsize);
+               elem->store_prop = (char *)
+                                  realloc(elem->store_prop, sizeof(char) * newsize);
+       }
+
+       /* copy the other properties */
+
+       for (i = 0; i < other->nprops; i++) {
+               prop = (PlyProperty *) myalloc(sizeof(PlyProperty));
+               copy_property(prop, other->props[i]);
+               elem->props[elem->nprops] = prop;
+               elem->store_prop[elem->nprops] = OTHER_PROP;
+               elem->nprops++;
+       }
+
+       /* save other info about other properties */
+       elem->other_size = other->size;
+       elem->other_offset = offset;
 }
 
 
 /******************************************************************************
-State how many of a given element will be written.
+   State how many of a given element will be written.
 
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that information is being specified about
-  nelems    - number of elements of this type to be written
+   Entry:
+   plyfile   - file identifier
+   elem_name - name of element that information is being specified about
+   nelems    - number of elements of this type to be written
 ******************************************************************************/
 
 void ply_element_count(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nelems
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    int nelems
+    )
 {
-  PlyElement *elem;
+       PlyElement *elem;
 
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr,"ply_element_count: can't find element '%s'\n",elem_name);
-    exit (-1);
-  }
+       /* look for appropriate element */
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL) {
+               fprintf(stderr, "ply_element_count: can't find element '%s'\n", elem_name);
+               exit(-1);
+       }
 
-  elem->num = nelems;
+       elem->num = nelems;
 }
 
 
 /******************************************************************************
-Signal that we've described everything a PLY file's header and that the
-header should be written to the file.
+   Signal that we've described everything a PLY file's header and that the
+   header should be written to the file.
 
-Entry:
-  plyfile - file identifier
+   Entry:
+   plyfile - file identifier
 ******************************************************************************/
 
 void ply_header_complete(PlyFile *plyfile)
 {
-  int i,j;
-  FILE *fp = plyfile->fp;
-  PlyElement *elem;
-  PlyProperty *prop;
-
-  fprintf (fp, "ply\n");
-
-  switch (plyfile->file_type) {
-    case PLY_ASCII:
-      fprintf (fp, "format ascii 1.0\n");
-      break;
-    case PLY_BINARY_BE:
-      fprintf (fp, "format binary_big_endian 1.0\n");
-      break;
-    case PLY_BINARY_LE:
-      fprintf (fp, "format binary_little_endian 1.0\n");
-      break;
-    default:
-      fprintf (stderr, "ply_header_complete: bad file type = %d\n",
-               plyfile->file_type);
-      exit (-1);
-  }
-
-  /* write out the comments */
-
-  for (i = 0; i < plyfile->num_comments; i++)
-    fprintf (fp, "comment %s\n", plyfile->comments[i]);
-
-  /* write out object information */
-
-  for (i = 0; i < plyfile->num_obj_info; i++)
-    fprintf (fp, "obj_info %s\n", plyfile->obj_info[i]);
-
-  /* write out information about each element */
-
-  for (i = 0; i < plyfile->nelems; i++) {
-
-    elem = plyfile->elems[i];
-    fprintf (fp, "element %s %d\n", elem->name, elem->num);
-
-    /* write out each property */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (prop->is_list) {
-        fprintf (fp, "property list ");
-        write_scalar_type (fp, prop->count_external);
-        fprintf (fp, " ");
-        write_scalar_type (fp, prop->external_type);
-        fprintf (fp, " %s\n", prop->name);
-      }
-      else {
-        fprintf (fp, "property ");
-        write_scalar_type (fp, prop->external_type);
-        fprintf (fp, " %s\n", prop->name);
-      }
-    }
-  }
-
-  fprintf (fp, "end_header\n");
+       int i, j;
+       FILE *fp = plyfile->fp;
+       PlyElement *elem;
+       PlyProperty *prop;
+
+       fprintf(fp, "ply\n");
+
+       switch (plyfile->file_type) {
+               case PLY_ASCII:
+                       fprintf(fp, "format ascii 1.0\n");
+                       break;
+               case PLY_BINARY_BE:
+                       fprintf(fp, "format binary_big_endian 1.0\n");
+                       break;
+               case PLY_BINARY_LE:
+                       fprintf(fp, "format binary_little_endian 1.0\n");
+                       break;
+               default:
+                       fprintf(stderr, "ply_header_complete: bad file type = %d\n",
+                               plyfile->file_type);
+                       exit(-1);
+       }
+
+       /* write out the comments */
+
+       for (i = 0; i < plyfile->num_comments; i++)
+               fprintf(fp, "comment %s\n", plyfile->comments[i]);
+
+       /* write out object information */
+
+       for (i = 0; i < plyfile->num_obj_info; i++)
+               fprintf(fp, "obj_info %s\n", plyfile->obj_info[i]);
+
+       /* write out information about each element */
+
+       for (i = 0; i < plyfile->nelems; i++) {
+
+               elem = plyfile->elems[i];
+               fprintf(fp, "element %s %d\n", elem->name, elem->num);
+
+               /* write out each property */
+               for (j = 0; j < elem->nprops; j++) {
+                       prop = elem->props[j];
+                       if (prop->is_list) {
+                               fprintf(fp, "property list ");
+                               write_scalar_type(fp, prop->count_external);
+                               fprintf(fp, " ");
+                               write_scalar_type(fp, prop->external_type);
+                               fprintf(fp, " %s\n", prop->name);
+                       }
+                       else {
+                               fprintf(fp, "property ");
+                               write_scalar_type(fp, prop->external_type);
+                               fprintf(fp, " %s\n", prop->name);
+                       }
+               }
+       }
+
+       fprintf(fp, "end_header\n");
 }
 
 
 /******************************************************************************
-Specify which elements are going to be written.  This should be called
-before a call to the routine ply_put_element().
+   Specify which elements are going to be written.  This should be called
+   before a call to the routine ply_put_element().
 
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element we're talking about
+   Entry:
+   plyfile   - file identifier
+   elem_name - name of element we're talking about
 ******************************************************************************/
 
 void ply_put_element_setup(PlyFile *plyfile, char *elem_name)
 {
-  PlyElement *elem;
+       PlyElement *elem;
 
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf(stderr, "ply_elements_setup: can't find element '%s'\n", elem_name);
-    exit (-1);
-  }
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL) {
+               fprintf(stderr, "ply_elements_setup: can't find element '%s'\n", elem_name);
+               exit(-1);
+       }
 
-  plyfile->which_elem = elem;
+       plyfile->which_elem = elem;
 }
 
 
 /******************************************************************************
-Write an element to the file.  This routine assumes that we're
-writing the type of element specified in the last call to the routine
-ply_put_element_setup().
+   Write an element to the file.  This routine assumes that we're
+   writing the type of element specified in the last call to the routine
+   ply_put_element_setup().
 
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to the element
+   Entry:
+   plyfile  - file identifier
+   elem_ptr - pointer to the element
 ******************************************************************************/
 
 void ply_put_element(PlyFile *plyfile, void *elem_ptr)
 {
-  int j,k;
-  FILE *fp = plyfile->fp;
-  PlyElement *elem;
-  PlyProperty *prop;
-  char *elem_data,*item;
-  char **item_ptr;
-  int list_count;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  char **other_ptr;
-
-  elem = plyfile->which_elem;
-  elem_data = elem_ptr;
-  other_ptr = (char **) (((char *) elem_ptr) + elem->other_offset);
-
-  /* write out either to an ascii or binary file */
-
-  if (plyfile->file_type == PLY_ASCII) {
-
-    /* write an ascii file */
-
-    /* write out each property of the element */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (elem->store_prop[j] == OTHER_PROP)
-        elem_data = *other_ptr;
-      else
-        elem_data = elem_ptr;
-      if (prop->is_list) {
-        item = elem_data + prop->count_offset;
-        get_stored_item ((void *) item, prop->count_internal,
-                         &int_val, &uint_val, &double_val);
-        write_ascii_item (fp, int_val, uint_val, double_val,
-                          prop->count_external);
-        list_count = uint_val;
-        item_ptr = (char **) (elem_data + prop->offset);
-        item = item_ptr[0];
-       item_size = ply_type_size[prop->internal_type];
-        for (k = 0; k < list_count; k++) {
-          get_stored_item ((void *) item, prop->internal_type,
-                           &int_val, &uint_val, &double_val);
-          write_ascii_item (fp, int_val, uint_val, double_val,
-                            prop->external_type);
-          item += item_size;
-        }
-      }
-      else {
-        item = elem_data + prop->offset;
-        get_stored_item ((void *) item, prop->internal_type,
-                         &int_val, &uint_val, &double_val);
-        write_ascii_item (fp, int_val, uint_val, double_val,
-                          prop->external_type);
-      }
-    }
-
-    fprintf (fp, "\n");
-  }
-  else {
-
-    /* write a binary file */
-
-    /* write out each property of the element */
-    for (j = 0; j < elem->nprops; j++) {
-      prop = elem->props[j];
-      if (elem->store_prop[j] == OTHER_PROP)
-        elem_data = *other_ptr;
-      else
-        elem_data = elem_ptr;
-      if (prop->is_list) {
-        item = elem_data + prop->count_offset;
-        item_size = ply_type_size[prop->count_internal];
-        get_stored_item ((void *) item, prop->count_internal,
-                         &int_val, &uint_val, &double_val);
-        write_binary_item (fp, int_val, uint_val, double_val,
-                           prop->count_external);
-        list_count = uint_val;
-        item_ptr = (char **) (elem_data + prop->offset);
-        item = item_ptr[0];
-        item_size = ply_type_size[prop->internal_type];
-        for (k = 0; k < list_count; k++) {
-          get_stored_item ((void *) item, prop->internal_type,
-                           &int_val, &uint_val, &double_val);
-          write_binary_item (fp, int_val, uint_val, double_val,
-                             prop->external_type);
-          item += item_size;
-        }
-      }
-      else {
-        item = elem_data + prop->offset;
-        item_size = ply_type_size[prop->internal_type];
-        get_stored_item ((void *) item, prop->internal_type,
-                         &int_val, &uint_val, &double_val);
-        write_binary_item (fp, int_val, uint_val, double_val,
-                           prop->external_type);
-      }
-    }
-
-  }
+       int j, k;
+       FILE *fp = plyfile->fp;
+       PlyElement *elem;
+       PlyProperty *prop;
+       char *elem_data, *item;
+       char **item_ptr;
+       int list_count;
+       int item_size;
+       int int_val;
+       unsigned int uint_val;
+       double double_val;
+       char **other_ptr;
+
+       elem = plyfile->which_elem;
+       elem_data = elem_ptr;
+       other_ptr = (char **) (((char *) elem_ptr) + elem->other_offset);
+
+       /* write out either to an ascii or binary file */
+
+       if (plyfile->file_type == PLY_ASCII) {
+
+               /* write an ascii file */
+
+               /* write out each property of the element */
+               for (j = 0; j < elem->nprops; j++) {
+                       prop = elem->props[j];
+                       if (elem->store_prop[j] == OTHER_PROP)
+                               elem_data = *other_ptr;
+                       else
+                               elem_data = elem_ptr;
+                       if (prop->is_list) {
+                               item = elem_data + prop->count_offset;
+                               get_stored_item((void *) item, prop->count_internal,
+                                               &int_val, &uint_val, &double_val);
+                               write_ascii_item(fp, int_val, uint_val, double_val,
+                                                prop->count_external);
+                               list_count = uint_val;
+                               item_ptr = (char **) (elem_data + prop->offset);
+                               item = item_ptr[0];
+                               item_size = ply_type_size[prop->internal_type];
+                               for (k = 0; k < list_count; k++) {
+                                       get_stored_item((void *) item, prop->internal_type,
+                                                       &int_val, &uint_val, &double_val);
+                                       write_ascii_item(fp, int_val, uint_val, double_val,
+                                                        prop->external_type);
+                                       item += item_size;
+                               }
+                       }
+                       else {
+                               item = elem_data + prop->offset;
+                               get_stored_item((void *) item, prop->internal_type,
+                                               &int_val, &uint_val, &double_val);
+                               write_ascii_item(fp, int_val, uint_val, double_val,
+                                                prop->external_type);
+                       }
+               }
+
+               fprintf(fp, "\n");
+       }
+       else {
+
+               /* write a binary file */
+
+               /* write out each property of the element */
+               for (j = 0; j < elem->nprops; j++) {
+                       prop = elem->props[j];
+                       if (elem->store_prop[j] == OTHER_PROP)
+                               elem_data = *other_ptr;
+                       else
+                               elem_data = elem_ptr;
+                       if (prop->is_list) {
+                               item = elem_data + prop->count_offset;
+                               item_size = ply_type_size[prop->count_internal];
+                               get_stored_item((void *) item, prop->count_internal,
+                                               &int_val, &uint_val, &double_val);
+                               write_binary_item(fp, int_val, uint_val, double_val,
+                                                 prop->count_external);
+                               list_count = uint_val;
+                               item_ptr = (char **) (elem_data + prop->offset);
+                               item = item_ptr[0];
+                               item_size = ply_type_size[prop->internal_type];
+                               for (k = 0; k < list_count; k++) {
+                                       get_stored_item((void *) item, prop->internal_type,
+                                                       &int_val, &uint_val, &double_val);
+                                       write_binary_item(fp, int_val, uint_val, double_val,
+                                                         prop->external_type);
+                                       item += item_size;
+                               }
+                       }
+                       else {
+                               item = elem_data + prop->offset;
+                               item_size = ply_type_size[prop->internal_type];
+                               get_stored_item((void *) item, prop->internal_type,
+                                               &int_val, &uint_val, &double_val);
+                               write_binary_item(fp, int_val, uint_val, double_val,
+                                                 prop->external_type);
+                       }
+               }
+
+       }
 }
 
 
 /******************************************************************************
-Specify a comment that will be written in the header.
+   Specify a comment that will be written in the header.
 
-Entry:
-  plyfile - file identifier
-  comment - the comment to be written
+   Entry:
+   plyfile - file identifier
+   comment - the comment to be written
 ******************************************************************************/
 
 void ply_put_comment(PlyFile *plyfile, char *comment)
 {
-  /* (re)allocate space for new comment */
-  if (plyfile->num_comments == 0)
-    plyfile->comments = (char **) myalloc (sizeof (char *));
-  else
-    plyfile->comments = (char **) realloc (plyfile->comments,
-                         sizeof (char *) * (plyfile->num_comments + 1));
-
-  /* add comment to list */
-  plyfile->comments[plyfile->num_comments] = strdup (comment);
-  plyfile->num_comments++;
+       /* (re)allocate space for new comment */
+       if (plyfile->num_comments == 0)
+               plyfile->comments = (char **) myalloc(sizeof(char *));
+       else
+               plyfile->comments = (char **) realloc(plyfile->comments,
+                                                     sizeof(char *) * (plyfile->num_comments + 1));
+
+       /* add comment to list */
+       plyfile->comments[plyfile->num_comments] = strdup(comment);
+       plyfile->num_comments++;
 }
 
 
 /******************************************************************************
-Specify a piece of object information (arbitrary text) that will be written
-in the header.
+   Specify a piece of object information (arbitrary text) that will be written
+   in the header.
 
-Entry:
-  plyfile  - file identifier
-  obj_info - the text information to be written
+   Entry:
+   plyfile  - file identifier
+   obj_info - the text information to be written
 ******************************************************************************/
 
 void ply_put_obj_info(PlyFile *plyfile, char *obj_info)
 {
-  /* (re)allocate space for new info */
-  if (plyfile->num_obj_info == 0)
-    plyfile->obj_info = (char **) myalloc (sizeof (char *));
-  else
-    plyfile->obj_info = (char **) realloc (plyfile->obj_info,
-                         sizeof (char *) * (plyfile->num_obj_info + 1));
-
-  /* add info to list */
-  plyfile->obj_info[plyfile->num_obj_info] = strdup (obj_info);
-  plyfile->num_obj_info++;
+       /* (re)allocate space for new info */
+       if (plyfile->num_obj_info == 0)
+               plyfile->obj_info = (char **) myalloc(sizeof(char *));
+       else
+               plyfile->obj_info = (char **) realloc(plyfile->obj_info,
+                                                     sizeof(char *) * (plyfile->num_obj_info + 1));
+
+       /* add info to list */
+       plyfile->obj_info[plyfile->num_obj_info] = strdup(obj_info);
+       plyfile->num_obj_info++;
 }
 
 
@@ -703,507 +703,507 @@ void ply_put_obj_info(PlyFile *plyfile, char *obj_info)
 
 
 /******************************************************************************
-Given a file pointer, get ready to read PLY data from the file.
+   Given a file pointer, get ready to read PLY data from the file.
 
-Entry:
-  fp - the given file pointer
+   Entry:
+   fp - the given file pointer
 
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  returns a pointer to a PlyFile, used to refer to this file, or NULL if error
+   Exit:
+   nelems     - number of elements in object
+   elem_names - list of element names
+   returns a pointer to a PlyFile, used to refer to this file, or NULL if error
 ******************************************************************************/
 
 PlyFile *ply_read(FILE *fp, int *nelems, char ***elem_names)
 {
-  int i,j;
-  PlyFile *plyfile;
-  int nwords;
-  char **words;
-  int found_format = 0;
-  char **elist;
-  PlyElement *elem;
-  char *orig_line;
-
-  /* check for NULL file pointer */
-  if (fp == NULL)
-    return (NULL);
-
-  /* create record for this object */
-
-  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
-  plyfile->nelems = 0;
-  plyfile->comments = NULL;
-  plyfile->num_comments = 0;
-  plyfile->obj_info = NULL;
-  plyfile->num_obj_info = 0;
-  plyfile->fp = fp;
-  plyfile->other_elems = NULL;
-
-  /* read and parse the file's header */
-
-  words = get_words (plyfile->fp, &nwords, &orig_line);
-  if (!words || !equal_strings (words[0], "ply"))
-    return (NULL);
-
-  while (words) {
-
-    /* parse words */
-
-    if (equal_strings (words[0], "format")) {
-      if (nwords != 3)
-        return (NULL);
-      if (equal_strings (words[1], "ascii"))
-        plyfile->file_type = PLY_ASCII;
-      else if (equal_strings (words[1], "binary_big_endian"))
-        plyfile->file_type = PLY_BINARY_BE;
-      else if (equal_strings (words[1], "binary_little_endian"))
-        plyfile->file_type = PLY_BINARY_LE;
-      else
-        return (NULL);
-      plyfile->version = (float)atof (words[2]);
-      found_format = 1;
-    }
-    else if (equal_strings (words[0], "element"))
-      add_element (plyfile, words);
-    else if (equal_strings (words[0], "property"))
-      add_property (plyfile, words);
-    else if (equal_strings (words[0], "comment"))
-      add_comment (plyfile, orig_line);
-    else if (equal_strings (words[0], "obj_info"))
-      add_obj_info (plyfile, orig_line);
-    else if (equal_strings (words[0], "end_header"))
-      break;
-
-    /* free up words space */
-    free (words);
-
-    words = get_words (plyfile->fp, &nwords, &orig_line);
-  }
-
-  /* create tags for each property of each element, to be used */
-  /* later to say whether or not to store each property for the user */
-
-  for (i = 0; i < plyfile->nelems; i++) {
-    elem = plyfile->elems[i];
-    elem->store_prop = (char *) myalloc (sizeof (char) * elem->nprops);
-    for (j = 0; j < elem->nprops; j++)
-      elem->store_prop[j] = DONT_STORE_PROP;
-    elem->other_offset = NO_OTHER_PROPS; /* no "other" props by default */
-  }
-
-  /* set return values about the elements */
-
-  elist = (char **) myalloc (sizeof (char *) * plyfile->nelems);
-  for (i = 0; i < plyfile->nelems; i++)
-    elist[i] = strdup (plyfile->elems[i]->name);
-
-  *elem_names = elist;
-  *nelems = plyfile->nelems;
-
-  /* return a pointer to the file's information */
-
-  return (plyfile);
+       int i, j;
+       PlyFile *plyfile;
+       int nwords;
+       char **words;
+       int found_format = 0;
+       char **elist;
+       PlyElement *elem;
+       char *orig_line;
+
+       /* check for NULL file pointer */
+       if (fp == NULL)
+               return (NULL);
+
+       /* create record for this object */
+
+       plyfile = (PlyFile *) myalloc(sizeof(PlyFile));
+       plyfile->nelems = 0;
+       plyfile->comments = NULL;
+       plyfile->num_comments = 0;
+       plyfile->obj_info = NULL;
+       plyfile->num_obj_info = 0;
+       plyfile->fp = fp;
+       plyfile->other_elems = NULL;
+
+       /* read and parse the file's header */
+
+       words = get_words(plyfile->fp, &nwords, &orig_line);
+       if (!words || !equal_strings(words[0], "ply"))
+               return (NULL);
+
+       while (words) {
+
+               /* parse words */
+
+               if (equal_strings(words[0], "format")) {
+                       if (nwords != 3)
+                               return (NULL);
+                       if (equal_strings(words[1], "ascii"))
+                               plyfile->file_type = PLY_ASCII;
+                       else if (equal_strings(words[1], "binary_big_endian"))
+                               plyfile->file_type = PLY_BINARY_BE;
+                       else if (equal_strings(words[1], "binary_little_endian"))
+                               plyfile->file_type = PLY_BINARY_LE;
+                       else
+                               return (NULL);
+                       plyfile->version = (float)atof(words[2]);
+                       found_format = 1;
+               }
+               else if (equal_strings(words[0], "element"))
+                       add_element(plyfile, words);
+               else if (equal_strings(words[0], "property"))
+                       add_property(plyfile, words);
+               else if (equal_strings(words[0], "comment"))
+                       add_comment(plyfile, orig_line);
+               else if (equal_strings(words[0], "obj_info"))
+                       add_obj_info(plyfile, orig_line);
+               else if (equal_strings(words[0], "end_header"))
+                       break;
+
+               /* free up words space */
+               free(words);
+
+               words = get_words(plyfile->fp, &nwords, &orig_line);
+       }
+
+       /* create tags for each property of each element, to be used */
+       /* later to say whether or not to store each property for the user */
+
+       for (i = 0; i < plyfile->nelems; i++) {
+               elem = plyfile->elems[i];
+               elem->store_prop = (char *) myalloc(sizeof(char) * elem->nprops);
+               for (j = 0; j < elem->nprops; j++)
+                       elem->store_prop[j] = DONT_STORE_PROP;
+               elem->other_offset = NO_OTHER_PROPS; /* no "other" props by default */
+       }
+
+       /* set return values about the elements */
+
+       elist = (char **) myalloc(sizeof(char *) * plyfile->nelems);
+       for (i = 0; i < plyfile->nelems; i++)
+               elist[i] = strdup(plyfile->elems[i]->name);
+
+       *elem_names = elist;
+       *nelems = plyfile->nelems;
+
+       /* return a pointer to the file's information */
+
+       return (plyfile);
 }
 
 
 /******************************************************************************
-Open a polygon file for reading.
+   Open a polygon file for reading.
 
-Entry:
-  filename - name of file to read from
+   Entry:
+   filename - name of file to read from
 
-Exit:
-  nelems     - number of elements in object
-  elem_names - list of element names
-  file_type  - file type, either ascii or binary
-  version    - version number of PLY file
-  returns a file identifier, used to refer to this file, or NULL if error
+   Exit:
+   nelems     - number of elements in object
+   elem_names - list of element names
+   file_type  - file type, either ascii or binary
+   version    - version number of PLY file
+   returns a file identifier, used to refer to this file, or NULL if error
 ******************************************************************************/
 
 PlyFile *ply_open_for_reading(
-  char *filename,
-  int *nelems,
-  char ***elem_names,
-  int *file_type,
-  float *version
-)
+    char *filename,
+    int *nelems,
+    char ***elem_names,
+    int *file_type,
+    float *version
+    )
 {
-  FILE *fp;
-  PlyFile *plyfile;
-  char *name;
+       FILE *fp;
+       PlyFile *plyfile;
+       char *name;
 
-  /* tack on the extension .ply, if necessary */
+       /* tack on the extension .ply, if necessary */
 
-  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
-  strcpy (name, filename);
-  if (strlen (name) < 4 ||
-      strcmp (name + strlen (name) - 4, ".ply") != 0)
-      strcat (name, ".ply");
+       name = (char *) myalloc(sizeof(char) * (strlen(filename) + 5));
+       strcpy(name, filename);
+       if (strlen(name) < 4 ||
+           strcmp(name + strlen(name) - 4, ".ply") != 0)
+               strcat(name, ".ply");
 
-  /* open the file for reading */
+       /* open the file for reading */
 
-  fp = fopen (name, "r");
-  if (fp == NULL)
-    return (NULL);
+       fp = fopen(name, "r");
+       if (fp == NULL)
+               return (NULL);
 
-  /* create the PlyFile data structure */
+       /* create the PlyFile data structure */
 
-  plyfile = ply_read (fp, nelems, elem_names);
+       plyfile = ply_read(fp, nelems, elem_names);
 
-  /* determine the file type and version */
+       /* determine the file type and version */
 
-  *file_type = plyfile->file_type;
-  *version = plyfile->version;
+       *file_type = plyfile->file_type;
+       *version = plyfile->version;
 
-  /* return a pointer to the file's information */
+       /* return a pointer to the file's information */
 
-  return (plyfile);
+       return (plyfile);
 }
 
 
 /******************************************************************************
-Get information about a particular element.
+   Get information about a particular element.
 
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element to get information about
+   Entry:
+   plyfile   - file identifier
+   elem_name - name of element to get information about
 
-Exit:
-  nelems   - number of elements of this type in the file
-  nprops   - number of properties
-  returns a list of properties, or NULL if the file doesn't contain that elem
+   Exit:
+   nelems   - number of elements of this type in the file
+   nprops   - number of properties
+   returns a list of properties, or NULL if the file doesn't contain that elem
 ******************************************************************************/
 
 PlyProperty **ply_get_element_description(
-  PlyFile *plyfile,
-  char *elem_name,
-  int *nelems,
-  int *nprops
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    int *nelems,
+    int *nprops
+    )
 {
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-  PlyProperty **prop_list;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL)
-    return (NULL);
-
-  *nelems = elem->num;
-  *nprops = elem->nprops;
-
-  /* make a copy of the element's property list */
-  prop_list = (PlyProperty **) myalloc (sizeof (PlyProperty *) * elem->nprops);
-  for (i = 0; i < elem->nprops; i++) {
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, elem->props[i]);
-    prop_list[i] = prop;
-  }
-
-  /* return this duplicate property list */
-  return (prop_list);
+       int i;
+       PlyElement *elem;
+       PlyProperty *prop;
+       PlyProperty **prop_list;
+
+       /* find information about the element */
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL)
+               return (NULL);
+
+       *nelems = elem->num;
+       *nprops = elem->nprops;
+
+       /* make a copy of the element's property list */
+       prop_list = (PlyProperty **) myalloc(sizeof(PlyProperty *) * elem->nprops);
+       for (i = 0; i < elem->nprops; i++) {
+               prop = (PlyProperty *) myalloc(sizeof(PlyProperty));
+               copy_property(prop, elem->props[i]);
+               prop_list[i] = prop;
+       }
+
+       /* return this duplicate property list */
+       return (prop_list);
 }
 
 
 /******************************************************************************
-Specify which properties of an element are to be returned.  This should be
-called before a call to the routine ply_get_element().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - which element we're talking about
-  nprops    - number of properties
-  prop_list - list of properties
+   Specify which properties of an element are to be returned.  This should be
+   called before a call to the routine ply_get_element().
+
+   Entry:
+   plyfile   - file identifier
+   elem_name - which element we're talking about
+   nprops    - number of properties
+   prop_list - list of properties
 ******************************************************************************/
 
 void ply_get_element_setup(
-  PlyFile *plyfile,
-  char *elem_name,
-  int nprops,
-  PlyProperty *prop_list
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    int nprops,
+    PlyProperty *prop_list
+    )
 {
-  int i;
-  PlyElement *elem;
-  PlyProperty *prop;
-  int index;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  plyfile->which_elem = elem;
-
-  /* deposit the property information into the element's description */
-  for (i = 0; i < nprops; i++) {
-
-    /* look for actual property */
-    prop = find_property (elem, prop_list[i].name, &index);
-    if (prop == NULL) {
-      fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-               prop_list[i].name, elem_name);
-      continue;
-    }
-
-    /* store its description */
-    prop->internal_type = prop_list[i].internal_type;
-    prop->offset = prop_list[i].offset;
-    prop->count_internal = prop_list[i].count_internal;
-    prop->count_offset = prop_list[i].count_offset;
-
-    /* specify that the user wants this property */
-    elem->store_prop[index] = STORE_PROP;
-  }
+       int i;
+       PlyElement *elem;
+       PlyProperty *prop;
+       int index;
+
+       /* find information about the element */
+       elem = find_element(plyfile, elem_name);
+       plyfile->which_elem = elem;
+
+       /* deposit the property information into the element's description */
+       for (i = 0; i < nprops; i++) {
+
+               /* look for actual property */
+               prop = find_property(elem, prop_list[i].name, &index);
+               if (prop == NULL) {
+                       fprintf(stderr, "Warning:  Can't find property '%s' in element '%s'\n",
+                               prop_list[i].name, elem_name);
+                       continue;
+               }
+
+               /* store its description */
+               prop->internal_type = prop_list[i].internal_type;
+               prop->offset = prop_list[i].offset;
+               prop->count_internal = prop_list[i].count_internal;
+               prop->count_offset = prop_list[i].count_offset;
+
+               /* specify that the user wants this property */
+               elem->store_prop[index] = STORE_PROP;
+       }
 }
 
 
 /******************************************************************************
-Specify a property of an element that is to be returned.  This should be
-called (usually multiple times) before a call to the routine ply_get_element().
-This routine should be used in preference to the less flexible old routine
-called ply_get_element_setup().
-
-Entry:
-  plyfile   - file identifier
-  elem_name - which element we're talking about
-  prop      - property to add to those that will be returned
+   Specify a property of an element that is to be returned.  This should be
+   called (usually multiple times) before a call to the routine ply_get_element().
+   This routine should be used in preference to the less flexible old routine
+   called ply_get_element_setup().
+
+   Entry:
+   plyfile   - file identifier
+   elem_name - which element we're talking about
+   prop      - property to add to those that will be returned
 ******************************************************************************/
 
 void ply_get_property(
-  PlyFile *plyfile,
-  char *elem_name,
-  PlyProperty *prop
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    PlyProperty *prop
+    )
 {
-  PlyElement *elem;
-  PlyProperty *prop_ptr;
-  int index;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  plyfile->which_elem = elem;
-
-  /* deposit the property information into the element's description */
-
-  prop_ptr = find_property (elem, prop->name, &index);
-  if (prop_ptr == NULL) {
-    fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
-             prop->name, elem_name);
-    return;
-  }
-  prop_ptr->internal_type  = prop->internal_type;
-  prop_ptr->offset         = prop->offset;
-  prop_ptr->count_internal = prop->count_internal;
-  prop_ptr->count_offset   = prop->count_offset;
-
-  /* specify that the user wants this property */
-  elem->store_prop[index] = STORE_PROP;
+       PlyElement *elem;
+       PlyProperty *prop_ptr;
+       int index;
+
+       /* find information about the element */
+       elem = find_element(plyfile, elem_name);
+       plyfile->which_elem = elem;
+
+       /* deposit the property information into the element's description */
+
+       prop_ptr = find_property(elem, prop->name, &index);
+       if (prop_ptr == NULL) {
+               fprintf(stderr, "Warning:  Can't find property '%s' in element '%s'\n",
+                       prop->name, elem_name);
+               return;
+       }
+       prop_ptr->internal_type  = prop->internal_type;
+       prop_ptr->offset         = prop->offset;
+       prop_ptr->count_internal = prop->count_internal;
+       prop_ptr->count_offset   = prop->count_offset;
+
+       /* specify that the user wants this property */
+       elem->store_prop[index] = STORE_PROP;
 }
 
 
 /******************************************************************************
-Read one element from the file.  This routine assumes that we're reading
-the type of element specified in the last call to the routine
-ply_get_element_setup().
+   Read one element from the file.  This routine assumes that we're reading
+   the type of element specified in the last call to the routine
+   ply_get_element_setup().
 
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to location where the element information should be put
+   Entry:
+   plyfile  - file identifier
+   elem_ptr - pointer to location where the element information should be put
 ******************************************************************************/
 
 void ply_get_element(PlyFile *plyfile, void *elem_ptr)
 {
-  if (plyfile->file_type == PLY_ASCII)
-    ascii_get_element (plyfile, (char *) elem_ptr);
-  else
-    binary_get_element (plyfile, (char *) elem_ptr);
+       if (plyfile->file_type == PLY_ASCII)
+               ascii_get_element(plyfile, (char *) elem_ptr);
+       else
+               binary_get_element(plyfile, (char *) elem_ptr);
 }
 
 
 /******************************************************************************
-Extract the comments from the header information of a PLY file.
+   Extract the comments from the header information of a PLY file.
 
-Entry:
-  plyfile - file identifier
+   Entry:
+   plyfile - file identifier
 
-Exit:
-  num_comments - number of comments returned
-  returns a pointer to a list of comments
+   Exit:
+   num_comments - number of comments returned
+   returns a pointer to a list of comments
 ******************************************************************************/
 
 char **ply_get_comments(PlyFile *plyfile, int *num_comments)
 {
-  *num_comments = plyfile->num_comments;
-  return (plyfile->comments);
+       *num_comments = plyfile->num_comments;
+       return (plyfile->comments);
 }
 
 
 /******************************************************************************
-Extract the object information (arbitrary text) from the header information
-of a PLY file.
+   Extract the object information (arbitrary text) from the header information
+   of a PLY file.
 
-Entry:
-  plyfile - file identifier
+   Entry:
+   plyfile - file identifier
 
-Exit:
-  num_obj_info - number of lines of text information returned
-  returns a pointer to a list of object info lines
+   Exit:
+   num_obj_info - number of lines of text information returned
+   returns a pointer to a list of object info lines
 ******************************************************************************/
 
 char **ply_get_obj_info(PlyFile *plyfile, int *num_obj_info)
 {
-  *num_obj_info = plyfile->num_obj_info;
-  return (plyfile->obj_info);
+       *num_obj_info = plyfile->num_obj_info;
+       return (plyfile->obj_info);
 }
 
 
 /******************************************************************************
-Make ready for "other" properties of an element-- those properties that
-the user has not explicitly asked for, but that are to be stashed away
-in a special structure to be carried along with the element's other
-information.
-
-Entry:
-  plyfile - file identifier
-  elem    - element for which we want to save away other properties
+   Make ready for "other" properties of an element-- those properties that
+   the user has not explicitly asked for, but that are to be stashed away
+   in a special structure to be carried along with the element's other
+   information.
+
+   Entry:
+   plyfile - file identifier
+   elem    - element for which we want to save away other properties
 ******************************************************************************/
 
 void setup_other_props(PlyElement *elem)
 {
-  int i;
-  PlyProperty *prop;
-  int size = 0;
-  int type_size;
-
-  /* Examine each property in decreasing order of size. */
-  /* We do this so that all data types will be aligned by */
-  /* word, half-word, or whatever within the structure. */
-
-  for (type_size = 8; type_size > 0; type_size /= 2) {
-
-    /* add up the space taken by each property, and save this information */
-    /* away in the property descriptor */
-
-    for (i = 0; i < elem->nprops; i++) {
-
-      /* don't bother with properties we've been asked to store explicitly */
-      if (elem->store_prop[i])
-        continue;
-
-      prop = elem->props[i];
-
-      /* internal types will be same as external */
-      prop->internal_type = prop->external_type;
-      prop->count_internal = prop->count_external;
-
-      /* check list case */
-      if (prop->is_list) {
-
-        /* pointer to list */
-        if (type_size == sizeof (void *)) {
-          prop->offset = size;
-          size += sizeof (void *);    /* always use size of a pointer here */
-        }
-
-        /* count of number of list elements */
-        if (type_size == ply_type_size[prop->count_external]) {
-          prop->count_offset = size;
-          size += ply_type_size[prop->count_external];
-        }
-      }
-      /* not list */
-      else if (type_size == ply_type_size[prop->external_type]) {
-        prop->offset = size;
-        size += ply_type_size[prop->external_type];
-      }
-    }
-
-  }
-
-  /* save the size for the other_props structure */
-  elem->other_size = size;
+       int i;
+       PlyProperty *prop;
+       int size = 0;
+       int type_size;
+
+       /* Examine each property in decreasing order of size. */
+       /* We do this so that all data types will be aligned by */
+       /* word, half-word, or whatever within the structure. */
+
+       for (type_size = 8; type_size > 0; type_size /= 2) {
+
+               /* add up the space taken by each property, and save this information */
+               /* away in the property descriptor */
+
+               for (i = 0; i < elem->nprops; i++) {
+
+                       /* don't bother with properties we've been asked to store explicitly */
+                       if (elem->store_prop[i])
+                               continue;
+
+                       prop = elem->props[i];
+
+                       /* internal types will be same as external */
+                       prop->internal_type = prop->external_type;
+                       prop->count_internal = prop->count_external;
+
+                       /* check list case */
+                       if (prop->is_list) {
+
+                               /* pointer to list */
+                               if (type_size == sizeof(void *)) {
+                                       prop->offset = size;
+                                       size += sizeof(void *); /* always use size of a pointer here */
+                               }
+
+                               /* count of number of list elements */
+                               if (type_size == ply_type_size[prop->count_external]) {
+                                       prop->count_offset = size;
+                                       size += ply_type_size[prop->count_external];
+                               }
+                       }
+                       /* not list */
+                       else if (type_size == ply_type_size[prop->external_type]) {
+                               prop->offset = size;
+                               size += ply_type_size[prop->external_type];
+                       }
+               }
+
+       }
+
+       /* save the size for the other_props structure */
+       elem->other_size = size;
 }
 
 
 /******************************************************************************
-Specify that we want the "other" properties of an element to be tucked
-away within the user's structure.  The user needn't be concerned for how
-these properties are stored.
+   Specify that we want the "other" properties of an element to be tucked
+   away within the user's structure.  The user needn't be concerned for how
+   these properties are stored.
 
-Entry:
-  plyfile   - file identifier
-  elem_name - name of element that we want to store other_props in
-  offset    - offset to where other_props will be stored inside user's structure
+   Entry:
+   plyfile   - file identifier
+   elem_name - name of element that we want to store other_props in
+   offset    - offset to where other_props will be stored inside user's structure
 
-Exit:
-  returns pointer to structure containing description of other_props
+   Exit:
+   returns pointer to structure containing description of other_props
 ******************************************************************************/
 
 PlyOtherProp *ply_get_other_properties(
-  PlyFile *plyfile,
-  char *elem_name,
-  int offset
-)
+    PlyFile *plyfile,
+    char *elem_name,
+    int offset
+    )
 {
-  int i;
-  PlyElement *elem;
-  PlyOtherProp *other;
-  PlyProperty *prop;
-  int nprops;
-
-  /* find information about the element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf (stderr, "ply_get_other_properties: Can't find element '%s'\n",
-             elem_name);
-    return (NULL);
-  }
-
-  /* remember that this is the "current" element */
-  plyfile->which_elem = elem;
-
-  /* save the offset to where to store the other_props */
-  elem->other_offset = offset;
-
-  /* place the appropriate pointers, etc. in the element's property list */
-  setup_other_props (elem);
-
-  /* create structure for describing other_props */
-  other = (PlyOtherProp *) myalloc (sizeof (PlyOtherProp));
-  other->name = strdup (elem_name);
+       int i;
+       PlyElement *elem;
+       PlyOtherProp *other;
+       PlyProperty *prop;
+       int nprops;
+
+       /* find information about the element */
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL) {
+               fprintf(stderr, "ply_get_other_properties: Can't find element '%s'\n",
+                       elem_name);
+               return (NULL);
+       }
+
+       /* remember that this is the "current" element */
+       plyfile->which_elem = elem;
+
+       /* save the offset to where to store the other_props */
+       elem->other_offset = offset;
+
+       /* place the appropriate pointers, etc. in the element's property list */
+       setup_other_props(elem);
+
+       /* create structure for describing other_props */
+       other = (PlyOtherProp *) myalloc(sizeof(PlyOtherProp));
+       other->name = strdup(elem_name);
 #if 0
-  if (elem->other_offset == NO_OTHER_PROPS) {
-    other->size = 0;
-    other->props = NULL;
-    other->nprops = 0;
-    return (other);
-  }
+       if (elem->other_offset == NO_OTHER_PROPS) {
+               other->size = 0;
+               other->props = NULL;
+               other->nprops = 0;
+               return (other);
+       }
 #endif
-  other->size = elem->other_size;
-  other->props = (PlyProperty **) myalloc (sizeof(PlyProperty) * elem->nprops);
+       other->size = elem->other_size;
+       other->props = (PlyProperty **) myalloc(sizeof(PlyProperty) * elem->nprops);
   
-  /* save descriptions of each "other" property */
-  nprops = 0;
-  for (i = 0; i < elem->nprops; i++) {
-    if (elem->store_prop[i])
-      continue;
-    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
-    copy_property (prop, elem->props[i]);
-    other->props[nprops] = prop;
-    nprops++;
-  }
-  other->nprops = nprops;
+       /* save descriptions of each "other" property */
+       nprops = 0;
+       for (i = 0; i < elem->nprops; i++) {
+               if (elem->store_prop[i])
+                       continue;
+               prop = (PlyProperty *) myalloc(sizeof(PlyProperty));
+               copy_property(prop, elem->props[i]);
+               other->props[nprops] = prop;
+               nprops++;
+       }
+       other->nprops = nprops;
 
 #if 1
-  /* set other_offset pointer appropriately if there are NO other properties */
-  if (other->nprops == 0) {
-    elem->other_offset = NO_OTHER_PROPS;
-  }
+       /* set other_offset pointer appropriately if there are NO other properties */
+       if (other->nprops == 0) {
+               elem->other_offset = NO_OTHER_PROPS;
+       }
 #endif
   
-  /* return structure */
-  return (other);
+       /* return structure */
+       return (other);
 }
 
 
@@ -1217,151 +1217,151 @@ PlyOtherProp *ply_get_other_properties(
 
 
 /******************************************************************************
-Grab all the data for an element that a user does not want to explicitly
-read in.
+   Grab all the data for an element that a user does not want to explicitly
+   read in.
 
-Entry:
-  plyfile    - pointer to file
-  elem_name  - name of element whose data is to be read in
-  elem_count - number of instances of this element stored in the file
+   Entry:
+   plyfile    - pointer to file
+   elem_name  - name of element whose data is to be read in
+   elem_count - number of instances of this element stored in the file
 
-Exit:
-  returns pointer to ALL the "other" element data for this PLY file
+   Exit:
+   returns pointer to ALL the "other" element data for this PLY file
 ******************************************************************************/
 
-PlyOtherElems *ply_get_other_element (
-  PlyFile *plyfile,
-  char *elem_name,
-  int elem_count
-)
+PlyOtherElems *ply_get_other_element(
+    PlyFile *plyfile,
+    char *elem_name,
+    int elem_count
+    )
 {
-  int i;
-  PlyElement *elem;
-  PlyOtherElems *other_elems;
-  OtherElem *other;
-
-  /* look for appropriate element */
-  elem = find_element (plyfile, elem_name);
-  if (elem == NULL) {
-    fprintf (stderr,
-             "ply_get_other_element: can't find element '%s'\n", elem_name);
-    exit (-1);
-  }
-
-  /* create room for the new "other" element, initializing the */
-  /* other data structure if necessary */
-
-  if (plyfile->other_elems == NULL) {
-    plyfile->other_elems = (PlyOtherElems *) myalloc (sizeof (PlyOtherElems));
-    other_elems = plyfile->other_elems;
-    other_elems->other_list = (OtherElem *) myalloc (sizeof (OtherElem));
-    other = &(other_elems->other_list[0]);
-    other_elems->num_elems = 1;
-  }
-  else {
-    other_elems = plyfile->other_elems;
-    other_elems->other_list = (OtherElem *) realloc (other_elems->other_list,
-                              sizeof (OtherElem) * other_elems->num_elems + 1);
-    other = &(other_elems->other_list[other_elems->num_elems]);
-    other_elems->num_elems++;
-  }
-
-  /* count of element instances in file */
-  other->elem_count = elem_count;
-
-  /* save name of element */
-  other->elem_name = strdup (elem_name);
-
-  /* create a list to hold all the current elements */
-  other->other_data = (OtherData **)
-                  malloc (sizeof (OtherData *) * other->elem_count);
-
-  /* set up for getting elements */
-  other->other_props = ply_get_other_properties (plyfile, elem_name,
-                         offsetof(OtherData,other_props));
-
-  /* grab all these elements */
-  for (i = 0; i < other->elem_count; i++) {
-    /* grab and element from the file */
-    other->other_data[i] = (OtherData *) malloc (sizeof (OtherData));
-    ply_get_element (plyfile, (void *) other->other_data[i]);
-  }
-
-  /* return pointer to the other elements data */
-  return (other_elems);
+       int i;
+       PlyElement *elem;
+       PlyOtherElems *other_elems;
+       OtherElem *other;
+
+       /* look for appropriate element */
+       elem = find_element(plyfile, elem_name);
+       if (elem == NULL) {
+               fprintf(stderr,
+                       "ply_get_other_element: can't find element '%s'\n", elem_name);
+               exit(-1);
+       }
+
+       /* create room for the new "other" element, initializing the */
+       /* other data structure if necessary */
+
+       if (plyfile->other_elems == NULL) {
+               plyfile->other_elems = (PlyOtherElems *) myalloc(sizeof(PlyOtherElems));
+               other_elems = plyfile->other_elems;
+               other_elems->other_list = (OtherElem *) myalloc(sizeof(OtherElem));
+               other = &(other_elems->other_list[0]);
+               other_elems->num_elems = 1;
+       }
+       else {
+               other_elems = plyfile->other_elems;
+               other_elems->other_list = (OtherElem *) realloc(other_elems->other_list,
+                                                               sizeof(OtherElem) * other_elems->num_elems + 1);
+               other = &(other_elems->other_list[other_elems->num_elems]);
+               other_elems->num_elems++;
+       }
+
+       /* count of element instances in file */
+       other->elem_count = elem_count;
+
+       /* save name of element */
+       other->elem_name = strdup(elem_name);
+
+       /* create a list to hold all the current elements */
+       other->other_data = (OtherData **)
+                           malloc(sizeof(OtherData *) * other->elem_count);
+
+       /* set up for getting elements */
+       other->other_props = ply_get_other_properties(plyfile, elem_name,
+                                                     offsetof(OtherData, other_props));
+
+       /* grab all these elements */
+       for (i = 0; i < other->elem_count; i++) {
+               /* grab and element from the file */
+               other->other_data[i] = (OtherData *) malloc(sizeof(OtherData));
+               ply_get_element(plyfile, (void *) other->other_data[i]);
+       }
+
+       /* return pointer to the other elements data */
+       return (other_elems);
 }
 
 
 /******************************************************************************
-Pass along a pointer to "other" elements that we want to save in a given
-PLY file.  These other elements were presumably read from another PLY file.
+   Pass along a pointer to "other" elements that we want to save in a given
+   PLY file.  These other elements were presumably read from another PLY file.
 
-Entry:
-  plyfile     - file pointer in which to store this other element info
-  other_elems - info about other elements that we want to store
+   Entry:
+   plyfile     - file pointer in which to store this other element info
+   other_elems - info about other elements that we want to store
 ******************************************************************************/
 
-void ply_describe_other_elements (
-  PlyFile *plyfile,
-  PlyOtherElems *other_elems
-)
+void ply_describe_other_elements(
+    PlyFile *plyfile,
+    PlyOtherElems *other_elems
+    )
 {
-  int i;
-  OtherElem *other;
+       int i;
+       OtherElem *other;
 
-  /* ignore this call if there is no other element */
-  if (other_elems == NULL)
-    return;
+       /* ignore this call if there is no other element */
+       if (other_elems == NULL)
+               return;
 
-  /* save pointer to this information */
-  plyfile->other_elems = other_elems;
+       /* save pointer to this information */
+       plyfile->other_elems = other_elems;
 
-  /* describe the other properties of this element */
+       /* describe the other properties of this element */
 
-  for (i = 0; i < other_elems->num_elems; i++) {
-    other = &(other_elems->other_list[i]);
-    ply_element_count (plyfile, other->elem_name, other->elem_count);
-    ply_describe_other_properties (plyfile, other->other_props,
-                                   offsetof(OtherData,other_props));
-  }
+       for (i = 0; i < other_elems->num_elems; i++) {
+               other = &(other_elems->other_list[i]);
+               ply_element_count(plyfile, other->elem_name, other->elem_count);
+               ply_describe_other_properties(plyfile, other->other_props,
+                                             offsetof(OtherData, other_props));
+       }
 }
 
 
 /******************************************************************************
-Write out the "other" elements specified for this PLY file.
+   Write out the "other" elements specified for this PLY file.
 
-Entry:
-  plyfile - pointer to PLY file to write out other elements for
+   Entry:
+   plyfile - pointer to PLY file to write out other elements for
 ******************************************************************************/
 
-void ply_put_other_elements (PlyFile *plyfile)
+void ply_put_other_elements(PlyFile *plyfile)
 {
-  int i,j;
-  OtherElem *other;
+       int i, j;
+       OtherElem *other;
 
-  /* make sure we have other elements to write */
-  if (plyfile->other_elems == NULL)
-    return;
+       /* make sure we have other elements to write */
+       if (plyfile->other_elems == NULL)
+               return;
 
-  /* write out the data for each "other" element */
+       /* write out the data for each "other" element */
 
-  for (i = 0; i < plyfile->other_elems->num_elems; i++) {
+       for (i = 0; i < plyfile->other_elems->num_elems; i++) {
 
-    other = &(plyfile->other_elems->other_list[i]);
-    ply_put_element_setup (plyfile, other->elem_name);
+               other = &(plyfile->other_elems->other_list[i]);
+               ply_put_element_setup(plyfile, other->elem_name);
 
-    /* write out each instance of the current element */
-    for (j = 0; j < other->elem_count; j++)
-      ply_put_element (plyfile, (void *) other->other_data[j]);
-  }
+               /* write out each instance of the current element */
+               for (j = 0; j < other->elem_count; j++)
+                       ply_put_element(plyfile, (void *) other->other_data[j]);
+       }
 }
 
 
 /******************************************************************************
-Free up storage used by an "other" elements data structure.
+   Free up storage used by an "other" elements data structure.
 
-Entry:
-  other_elems - data structure to free up
+   Entry:
+   other_elems - data structure to free up
 ******************************************************************************/
 
 
@@ -1374,1171 +1374,1172 @@ Entry:
 
 
 /******************************************************************************
-Close a PLY file.
+   Close a PLY file.
 
-Entry:
-  plyfile - identifier of file to close
+   Entry:
+   plyfile - identifier of file to close
 ******************************************************************************/
 
 void ply_close(PlyFile *plyfile)
 {
-  fclose (plyfile->fp);
+       fclose(plyfile->fp);
 
-  /* free up memory associated with the PLY file */
-  free (plyfile);
+       /* free up memory associated with the PLY file */
+       free(plyfile);
 }
 
 
 /******************************************************************************
-Get version number and file type of a PlyFile.
+   Get version number and file type of a PlyFile.
 
-Entry:
-  ply - pointer to PLY file
+   Entry:
+   ply - pointer to PLY file
 
-Exit:
-  version - version of the file
-  file_type - PLY_ASCII, PLY_BINARY_BE, or PLY_BINARY_LE
+   Exit:
+   version - version of the file
+   file_type - PLY_ASCII, PLY_BINARY_BE, or PLY_BINARY_LE
 ******************************************************************************/
 
 void ply_get_info(PlyFile *ply, float *version, int *file_type)
 {
-  if (ply == NULL)
-    return;
+       if (ply == NULL)
+               return;
 
-  *version = ply->version;
-  *file_type = ply->file_type;
+       *version = ply->version;
+       *file_type = ply->file_type;
 }
 
 
 /******************************************************************************
-Compare two strings.  Returns 1 if they are the same, 0 if not.
+   Compare two strings.  Returns 1 if they are the same, 0 if not.
 ******************************************************************************/
 
 int equal_strings(char *s1, char *s2)
 {
 
-  while (*s1 && *s2)
-    if (*s1++ != *s2++)
-      return (0);
+       while (*s1 && *s2)
+               if (*s1++ != *s2++)
+                       return (0);
 
-  if (*s1 != *s2)
-    return (0);
-  else
-    return (1);
+       if (*s1 != *s2)
+               return (0);
+       else
+               return (1);
 }
 
 
 /******************************************************************************
-Find an element from the element list of a given PLY object.
+   Find an element from the element list of a given PLY object.
 
-Entry:
-  plyfile - file id for PLY file
-  element - name of element we're looking for
+   Entry:
+   plyfile - file id for PLY file
+   element - name of element we're looking for
 
-Exit:
-  returns the element, or NULL if not found
+   Exit:
+   returns the element, or NULL if not found
 ******************************************************************************/
 
 PlyElement *find_element(PlyFile *plyfile, char *element)
 {
-  int i;
+       int i;
 
-  for (i = 0; i < plyfile->nelems; i++)
-    if (equal_strings (element, plyfile->elems[i]->name))
-      return (plyfile->elems[i]);
+       for (i = 0; i < plyfile->nelems; i++)
+               if (equal_strings(element, plyfile->elems[i]->name))
+                       return (plyfile->elems[i]);
 
-  return (NULL);
+       return (NULL);
 }
 
 
 /******************************************************************************
-Find a property in the list of properties of a given element.
+   Find a property in the list of properties of a given element.
 
-Entry:
-  elem      - pointer to element in which we want to find the property
-  prop_name - name of property to find
+   Entry:
+   elem      - pointer to element in which we want to find the property
+   prop_name - name of property to find
 
-Exit:
-  index - index to position in list
-  returns a pointer to the property, or NULL if not found
+   Exit:
+   index - index to position in list
+   returns a pointer to the property, or NULL if not found
 ******************************************************************************/
 
 PlyProperty *find_property(PlyElement *elem, char *prop_name, int *index)
 {
-  int i;
+       int i;
 
-  for (i = 0; i < elem->nprops; i++)
-    if (equal_strings (prop_name, elem->props[i]->name)) {
-      *index = i;
-      return (elem->props[i]);
-    }
+       for (i = 0; i < elem->nprops; i++)
+               if (equal_strings(prop_name, elem->props[i]->name)) {
+                       *index = i;
+                       return (elem->props[i]);
+               }
 
-  *index = -1;
-  return (NULL);
+       *index = -1;
+       return (NULL);
 }
 
 
 /******************************************************************************
-Read an element from an ascii file.
+   Read an element from an ascii file.
 
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to element
+   Entry:
+   plyfile  - file identifier
+   elem_ptr - pointer to element
 ******************************************************************************/
 
 void ascii_get_element(PlyFile *plyfile, char *elem_ptr)
 {
-  int j,k;
-  PlyElement *elem;
-  PlyProperty *prop;
-  char **words;
-  int nwords;
-  int which_word;
-  char *elem_data,*item;
-  char *item_ptr;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  int list_count;
-  int store_it;
-  char **store_array;
-  char *orig_line;
-  char *other_data;
-  int other_flag;
-
-    other_flag = 0;
+       int j, k;
+       PlyElement *elem;
+       PlyProperty *prop;
+       char **words;
+       int nwords;
+       int which_word;
+       char *elem_data, *item;
+       char *item_ptr;
+       int item_size;
+       int int_val;
+       unsigned int uint_val;
+       double double_val;
+       int list_count;
+       int store_it;
+       char **store_array;
+       char *orig_line;
+       char *other_data;
+       int other_flag;
+
+       other_flag = 0;
        other_data = NULL;
        item = NULL;
        item_size = 0;
 
-  /* the kind of element we're reading currently */
-  elem = plyfile->which_elem;
-
-  /* do we need to setup for other_props? */
-
-  if (elem->other_offset != NO_OTHER_PROPS) {
-    char **ptr;
-    other_flag = 1;
-    /* make room for other_props */
-    other_data = (char *) myalloc (elem->other_size);
-    /* store pointer in user's structure to the other_props */
-    ptr = (char **) (elem_ptr + elem->other_offset);
-    *ptr = other_data;
-  } else {
-    other_flag = 0;
-       other_data = NULL;
-       item = NULL;
-       item_size = 0;
-  }
-
-  /* read in the element */
-
-  words = get_words (plyfile->fp, &nwords, &orig_line);
-  if (words == NULL) {
-    fprintf (stderr, "ply_get_element: unexpected end of file\n");
-    exit (-1);
-  }
-
-  which_word = 0;
-
-  for (j = 0; j < elem->nprops; j++) {
-
-    prop = elem->props[j];
-    store_it = (elem->store_prop[j] | other_flag);
-
-    /* store either in the user's structure or in other_props */
-    if (elem->store_prop[j])
-      elem_data = elem_ptr;
-    else
-      elem_data = other_data;
-
-    if (prop->is_list) {       /* a list */
-
-      /* get and store the number of items in the list */
-      get_ascii_item (words[which_word++], prop->count_external,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->count_offset;
-        store_item(item, prop->count_internal, int_val, uint_val, double_val);
-      }
-
-      /* allocate space for an array of items and store a ptr to the array */
-      list_count = int_val;
-      item_size = ply_type_size[prop->internal_type];
-      store_array = (char **) (elem_data + prop->offset);
-
-      if (list_count == 0) {
-        if (store_it)
-          *store_array = NULL;
-      }
-      else {
-        if (store_it) {
-          item_ptr = (char *) myalloc (sizeof (char) * item_size * list_count);
-          item = item_ptr;
-          *store_array = item_ptr;
-        }
-
-        /* read items and store them into the array */
-        for (k = 0; k < list_count; k++) {
-          get_ascii_item (words[which_word++], prop->external_type,
-                          &int_val, &uint_val, &double_val);
-          if (store_it) {
-            store_item (item, prop->internal_type,
-                        int_val, uint_val, double_val);
-            item += item_size;
-          }
-        }
-      }
-
-    }
-    else {                     /* not a list */
-      get_ascii_item (words[which_word++], prop->external_type,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->offset;
-        store_item (item, prop->internal_type, int_val, uint_val, double_val);
-      }
-    }
-
-  }
-
-  free (words);
+       /* the kind of element we're reading currently */
+       elem = plyfile->which_elem;
+
+       /* do we need to setup for other_props? */
+
+       if (elem->other_offset != NO_OTHER_PROPS) {
+               char **ptr;
+               other_flag = 1;
+               /* make room for other_props */
+               other_data = (char *) myalloc(elem->other_size);
+               /* store pointer in user's structure to the other_props */
+               ptr = (char **) (elem_ptr + elem->other_offset);
+               *ptr = other_data;
+       }
+       else {
+               other_flag = 0;
+               other_data = NULL;
+               item = NULL;
+               item_size = 0;
+       }
+
+       /* read in the element */
+
+       words = get_words(plyfile->fp, &nwords, &orig_line);
+       if (words == NULL) {
+               fprintf(stderr, "ply_get_element: unexpected end of file\n");
+               exit(-1);
+       }
+
+       which_word = 0;
+
+       for (j = 0; j < elem->nprops; j++) {
+
+               prop = elem->props[j];
+               store_it = (elem->store_prop[j] | other_flag);
+
+               /* store either in the user's structure or in other_props */
+               if (elem->store_prop[j])
+                       elem_data = elem_ptr;
+               else
+                       elem_data = other_data;
+
+               if (prop->is_list) {   /* a list */
+
+                       /* get and store the number of items in the list */
+                       get_ascii_item(words[which_word++], prop->count_external,
+                                      &int_val, &uint_val, &double_val);
+                       if (store_it) {
+                               item = elem_data + prop->count_offset;
+                               store_item(item, prop->count_internal, int_val, uint_val, double_val);
+                       }
+
+                       /* allocate space for an array of items and store a ptr to the array */
+                       list_count = int_val;
+                       item_size = ply_type_size[prop->internal_type];
+                       store_array = (char **) (elem_data + prop->offset);
+
+                       if (list_count == 0) {
+                               if (store_it)
+                                       *store_array = NULL;
+                       }
+                       else {
+                               if (store_it) {
+                                       item_ptr = (char *) myalloc(sizeof(char) * item_size * list_count);
+                                       item = item_ptr;
+                                       *store_array = item_ptr;
+                               }
+
+                               /* read items and store them into the array */
+                               for (k = 0; k < list_count; k++) {
+                                       get_ascii_item(words[which_word++], prop->external_type,
+                                                      &int_val, &uint_val, &double_val);
+                                       if (store_it) {
+                                               store_item(item, prop->internal_type,
+                                                          int_val, uint_val, double_val);
+                                               item += item_size;
+                                       }
+                               }
+                       }
+
+               }
+               else {                 /* not a list */
+                       get_ascii_item(words[which_word++], prop->external_type,
+                                      &int_val, &uint_val, &double_val);
+                       if (store_it) {
+                               item = elem_data + prop->offset;
+                               store_item(item, prop->internal_type, int_val, uint_val, double_val);
+                       }
+               }
+
+       }
+
+       free(words);
 }
 
 
 /******************************************************************************
-Read an element from a binary file.
+   Read an element from a binary file.
 
-Entry:
-  plyfile  - file identifier
-  elem_ptr - pointer to an element
+   Entry:
+   plyfile  - file identifier
+   elem_ptr - pointer to an element
 ******************************************************************************/
 
 void binary_get_element(PlyFile *plyfile, char *elem_ptr)
 {
-  int j,k;
-  PlyElement *elem;
-  PlyProperty *prop;
-  FILE *fp = plyfile->fp;
-  char *elem_data,*item;
-  char *item_ptr;
-  int item_size;
-  int int_val;
-  unsigned int uint_val;
-  double double_val;
-  int list_count;
-  int store_it;
-  char **store_array;
-  char *other_data;
-  int other_flag;
-
-
-  other_flag = 0;
-  other_data = NULL;
-  item = NULL;
-  item_size = 0;
-
-  /* the kind of element we're reading currently */
-  elem = plyfile->which_elem;
-
-  /* do we need to setup for other_props? */
-
-  if (elem->other_offset != NO_OTHER_PROPS) {
-    char **ptr;
-    other_flag = 1;
-    /* make room for other_props */
-    other_data = (char *) myalloc (elem->other_size);
-    /* store pointer in user's structure to the other_props */
-    ptr = (char **) (elem_ptr + elem->other_offset);
-    *ptr = other_data;
-  }
-  else {
-    other_flag = 0;
+       int j, k;
+       PlyElement *elem;
+       PlyProperty *prop;
+       FILE *fp = plyfile->fp;
+       char *elem_data, *item;
+       char *item_ptr;
+       int item_size;
+       int int_val;
+       unsigned int uint_val;
+       double double_val;
+       int list_count;
+       int store_it;
+       char **store_array;
+       char *other_data;
+       int other_flag;
+
+
+       other_flag = 0;
        other_data = NULL;
        item = NULL;
        item_size = 0;
-  }
-  /* read in a number of elements */
-
-  for (j = 0; j < elem->nprops; j++) {
-
-    prop = elem->props[j];
-    store_it = (elem->store_prop[j] | other_flag);
-
-    /* store either in the user's structure or in other_props */
-    if (elem->store_prop[j])
-      elem_data = elem_ptr;
-    else
-      elem_data = other_data;
-
-    if (prop->is_list) {       /* a list */
-
-      /* get and store the number of items in the list */
-      get_binary_item (fp, prop->count_external,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->count_offset;
-        store_item(item, prop->count_internal, int_val, uint_val, double_val);
-      }
-
-      /* allocate space for an array of items and store a ptr to the array */
-      list_count = int_val;
-      /* The "if" was added by Afra Zomorodian 8/22/95
-       * so that zipper won't crash reading plies that have additional
-       * properties.
-       */ 
-      if (store_it) {
-       item_size = ply_type_size[prop->internal_type];
-      }
-      store_array = (char **) (elem_data + prop->offset);
-      if (list_count == 0) {
-        if (store_it)
-          *store_array = NULL;
-      }
-      else {
-        if (store_it) {
-          item_ptr = (char *) myalloc (sizeof (char) * item_size * list_count);
-          item = item_ptr;
-          *store_array = item_ptr;
-        }
-
-        /* read items and store them into the array */
-        for (k = 0; k < list_count; k++) {
-          get_binary_item (fp, prop->external_type,
-                          &int_val, &uint_val, &double_val);
-          if (store_it) {
-            store_item (item, prop->internal_type,
-                        int_val, uint_val, double_val);
-            item += item_size;
-          }
-        }
-      }
-
-    }
-    else {                     /* not a list */
-      get_binary_item (fp, prop->external_type,
-                      &int_val, &uint_val, &double_val);
-      if (store_it) {
-        item = elem_data + prop->offset;
-        store_item (item, prop->internal_type, int_val, uint_val, double_val);
-      }
-    }
-
-  }
+
+       /* the kind of element we're reading currently */
+       elem = plyfile->which_elem;
+
+       /* do we need to setup for other_props? */
+
+       if (elem->other_offset != NO_OTHER_PROPS) {
+               char **ptr;
+               other_flag = 1;
+               /* make room for other_props */
+               other_data = (char *) myalloc(elem->other_size);
+               /* store pointer in user's structure to the other_props */
+               ptr = (char **) (elem_ptr + elem->other_offset);
+               *ptr = other_data;
+       }
+       else {
+               other_flag = 0;
+               other_data = NULL;
+               item = NULL;
+               item_size = 0;
+       }
+       /* read in a number of elements */
+
+       for (j = 0; j < elem->nprops; j++) {
+
+               prop = elem->props[j];
+               store_it = (elem->store_prop[j] | other_flag);
+
+               /* store either in the user's structure or in other_props */
+               if (elem->store_prop[j])
+                       elem_data = elem_ptr;
+               else
+                       elem_data = other_data;
+
+               if (prop->is_list) {   /* a list */
+
+                       /* get and store the number of items in the list */
+                       get_binary_item(fp, prop->count_external,
+                                       &int_val, &uint_val, &double_val);
+                       if (store_it) {
+                               item = elem_data + prop->count_offset;
+                               store_item(item, prop->count_internal, int_val, uint_val, double_val);
+                       }
+
+                       /* allocate space for an array of items and store a ptr to the array */
+                       list_count = int_val;
+                       /* The "if" was added by Afra Zomorodian 8/22/95
+                        * so that zipper won't crash reading plies that have additional
+                        * properties.
+                        */
+                       if (store_it) {
+                               item_size = ply_type_size[prop->internal_type];
+                       }
+                       store_array = (char **) (elem_data + prop->offset);
+                       if (list_count == 0) {
+                               if (store_it)
+                                       *store_array = NULL;
+                       }
+                       else {
+                               if (store_it) {
+                                       item_ptr = (char *) myalloc(sizeof(char) * item_size * list_count);
+                                       item = item_ptr;
+                                       *store_array = item_ptr;
+                               }
+
+                               /* read items and store them into the array */
+                               for (k = 0; k < list_count; k++) {
+                                       get_binary_item(fp, prop->external_type,
+                                                       &int_val, &uint_val, &double_val);
+                                       if (store_it) {
+                                               store_item(item, prop->internal_type,
+                                                          int_val, uint_val, double_val);
+                                               item += item_size;
+                                       }
+                               }
+                       }
+
+               }
+               else {                 /* not a list */
+                       get_binary_item(fp, prop->external_type,
+                                       &int_val, &uint_val, &double_val);
+                       if (store_it) {
+                               item = elem_data + prop->offset;
+                               store_item(item, prop->internal_type, int_val, uint_val, double_val);
+                       }
+               }
+
+       }
 }
 
 
 /******************************************************************************
-Write to a file the word that represents a PLY data type.
+   Write to a file the word that represents a PLY data type.
 
-Entry:
-  fp   - file pointer
-  code - code for type
+   Entry:
+   fp   - file pointer
+   code - code for type
 ******************************************************************************/
 
-void write_scalar_type (FILE *fp, int code)
+void write_scalar_type(FILE *fp, int code)
 {
-  /* make sure this is a valid code */
+       /* make sure this is a valid code */
 
-  if (code <= PLY_START_TYPE || code >= PLY_END_TYPE) {
-    fprintf (stderr, "write_scalar_type: bad data code = %d\n", code);
-    exit (-1);
-  }
+       if (code <= PLY_START_TYPE || code >= PLY_END_TYPE) {
+               fprintf(stderr, "write_scalar_type: bad data code = %d\n", code);
+               exit(-1);
+       }
 
-  /* write the code to a file */
+       /* write the code to a file */
 
-  fprintf (fp, "%s", type_names[code]);
+       fprintf(fp, "%s", type_names[code]);
 }
 
 
 /******************************************************************************
-Get a text line from a file and break it up into words.
+   Get a text line from a file and break it up into words.
 
-IMPORTANT: The calling routine call "free" on the returned pointer once
-finished with it.
+   IMPORTANT: The calling routine call "free" on the returned pointer once
+   finished with it.
 
-Entry:
-  fp - file to read from
+   Entry:
+   fp - file to read from
 
-Exit:
-  nwords    - number of words returned
-  orig_line - the original line of characters
-  returns a list of words from the line, or NULL if end-of-file
+   Exit:
+   nwords    - number of words returned
+   orig_line - the original line of characters
+   returns a list of words from the line, or NULL if end-of-file
 ******************************************************************************/
 
 char **get_words(FILE *fp, int *nwords, char **orig_line)
 {
 #define BIG_STRING 4096
-  static char str[BIG_STRING];
-  static char str_copy[BIG_STRING];
-  char **words;
-  int max_words = 10;
-  int num_words = 0;
-  char *ptr,*ptr2;
-  char *result;
-
-  words = (char **) myalloc (sizeof (char *) * max_words);
-
-  /* read in a line */
-  result = fgets (str, BIG_STRING, fp);
-  if (result == NULL) {
-    *nwords = 0;
-    *orig_line = NULL;
-    return (NULL);
-  }
-
-  /* convert line-feed and tabs into spaces */
-  /* (this guarentees that there will be a space before the */
-  /*  null character at the end of the string) */
-
-  str[BIG_STRING-2] = ' ';
-  str[BIG_STRING-1] = '\0';
-
-  for (ptr = str, ptr2 = str_copy; *ptr != '\0'; ptr++, ptr2++) {
-    *ptr2 = *ptr;
-    if (*ptr == '\t') {
-      *ptr = ' ';
-      *ptr2 = ' ';
-    }
-    else if (*ptr == '\n') {
-      *ptr = ' ';
-      *ptr2 = '\0';
-      break;
-    }
-  }
-
-  /* find the words in the line */
-
-  ptr = str;
-  while (*ptr != '\0') {
-
-    /* jump over leading spaces */
-    while (*ptr == ' ')
-      ptr++;
-
-    /* break if we reach the end */
-    if (*ptr == '\0')
-      break;
-
-    /* save pointer to beginning of word */
-    if (num_words >= max_words) {
-      max_words += 10;
-      words = (char **) realloc (words, sizeof (char *) * max_words);
-    }
-    words[num_words++] = ptr;
-
-    /* jump over non-spaces */
-    while (*ptr != ' ')
-      ptr++;
-
-    /* place a null character here to mark the end of the word */
-    *ptr++ = '\0';
-  }
-
-  /* return the list of words */
-  *nwords = num_words;
-  *orig_line = str_copy;
-  return (words);
+       static char str[BIG_STRING];
+       static char str_copy[BIG_STRING];
+       char **words;
+       int max_words = 10;
+       int num_words = 0;
+       char *ptr, *ptr2;
+       char *result;
+
+       words = (char **) myalloc(sizeof(char *) * max_words);
+
+       /* read in a line */
+       result = fgets(str, BIG_STRING, fp);
+       if (result == NULL) {
+               *nwords = 0;
+               *orig_line = NULL;
+               return (NULL);
+       }
+
+       /* convert line-feed and tabs into spaces */
+       /* (this guarentees that there will be a space before the */
+       /*  null character at the end of the string) */
+
+       str[BIG_STRING - 2] = ' ';
+       str[BIG_STRING - 1] = '\0';
+
+       for (ptr = str, ptr2 = str_copy; *ptr != '\0'; ptr++, ptr2++) {
+               *ptr2 = *ptr;
+               if (*ptr == '\t') {
+                       *ptr = ' ';
+                       *ptr2 = ' ';
+               }
+               else if (*ptr == '\n') {
+                       *ptr = ' ';
+                       *ptr2 = '\0';
+                       break;
+               }
+       }
+
+       /* find the words in the line */
+
+       ptr = str;
+       while (*ptr != '\0') {
+
+               /* jump over leading spaces */
+               while (*ptr == ' ')
+                       ptr++;
+
+               /* break if we reach the end */
+               if (*ptr == '\0')
+                       break;
+
+               /* save pointer to beginning of word */
+               if (num_words >= max_words) {
+                       max_words += 10;
+                       words = (char **) realloc(words, sizeof(char *) * max_words);
+               }
+               words[num_words++] = ptr;
+
+               /* jump over non-spaces */
+               while (*ptr != ' ')
+                       ptr++;
+
+               /* place a null character here to mark the end of the word */
+               *ptr++ = '\0';
+       }
+
+       /* return the list of words */
+       *nwords = num_words;
+       *orig_line = str_copy;
+       return (words);
 }
 
 
 /******************************************************************************
-Return the value of an item, given a pointer to it and its type.
+   Return the value of an item, given a pointer to it and its type.
 
-Entry:
-  item - pointer to item
-  type - data type that "item" points to
+   Entry:
+   item - pointer to item
+   type - data type that "item" points to
 
-Exit:
-  returns a double-precision float that contains the value of the item
+   Exit:
+   returns a double-precision float that contains the value of the item
 ******************************************************************************/
 
 double get_item_value(char *item, int type)
 {
-  unsigned char *puchar;
-  char *pchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-  int int_value;
-  unsigned int uint_value;
-  double double_value;
-
-  switch (type) {
-    case PLY_CHAR:
-      pchar = (char *) item;
-      int_value = *pchar;
-      return ((double) int_value);
-    case PLY_UCHAR:
-      puchar = (unsigned char *) item;
-      int_value = *puchar;
-      return ((double) int_value);
-    case PLY_SHORT:
-      pshort = (short int *) item;
-      int_value = *pshort;
-      return ((double) int_value);
-    case PLY_USHORT:
-      pushort = (unsigned short int *) item;
-      int_value = *pushort;
-      return ((double) int_value);
-    case PLY_INT:
-      pint = (int *) item;
-      int_value = *pint;
-      return ((double) int_value);
-    case PLY_UINT:
-      puint = (unsigned int *) item;
-      uint_value = *puint;
-      return ((double) uint_value);
-    case PLY_FLOAT:
-      pfloat = (float *) item;
-      double_value = *pfloat;
-      return (double_value);
-    case PLY_DOUBLE:
-      pdouble = (double *) item;
-      double_value = *pdouble;
-      return (double_value);
-    default:
-      fprintf (stderr, "get_item_value: bad type = %d\n", type);
-      exit (-1);
-  }
+       unsigned char *puchar;
+       char *pchar;
+       short int *pshort;
+       unsigned short int *pushort;
+       int *pint;
+       unsigned int *puint;
+       float *pfloat;
+       double *pdouble;
+       int int_value;
+       unsigned int uint_value;
+       double double_value;
+
+       switch (type) {
+               case PLY_CHAR:
+                       pchar = (char *) item;
+                       int_value = *pchar;
+                       return ((double) int_value);
+               case PLY_UCHAR:
+                       puchar = (unsigned char *) item;
+                       int_value = *puchar;
+                       return ((double) int_value);
+               case PLY_SHORT:
+                       pshort = (short int *) item;
+                       int_value = *pshort;
+                       return ((double) int_value);
+               case PLY_USHORT:
+                       pushort = (unsigned short int *) item;
+                       int_value = *pushort;
+                       return ((double) int_value);
+               case PLY_INT:
+                       pint = (int *) item;
+                       int_value = *pint;
+                       return ((double) int_value);
+               case PLY_UINT:
+                       puint = (unsigned int *) item;
+                       uint_value = *puint;
+                       return ((double) uint_value);
+               case PLY_FLOAT:
+                       pfloat = (float *) item;
+                       double_value = *pfloat;
+                       return (double_value);
+               case PLY_DOUBLE:
+                       pdouble = (double *) item;
+                       double_value = *pdouble;
+                       return (double_value);
+               default:
+                       fprintf(stderr, "get_item_value: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Write out an item to a file as raw binary bytes.
-
-Entry:
-  fp         - file to write to
-  int_val    - integer version of item
-  uint_val   - unsigned integer version of item
-  double_val - double-precision float version of item
-  type       - data type to write out
+   Write out an item to a file as raw binary bytes.
+
+   Entry:
+   fp         - file to write to
+   int_val    - integer version of item
+   uint_val   - unsigned integer version of item
+   double_val - double-precision float version of item
+   type       - data type to write out
 ******************************************************************************/
 
 void write_binary_item(
-  FILE *fp,
-  int int_val,
-  unsigned int uint_val,
-  double double_val,
-  int type
-)
+    FILE *fp,
+    int int_val,
+    unsigned int uint_val,
+    double double_val,
+    int type
+    )
 {
-  unsigned char uchar_val;
-  char char_val;
-  unsigned short ushort_val;
-  short short_val;
-  float float_val;
-
-  switch (type) {
-    case PLY_CHAR:
-      char_val = (char)int_val;
-      fwrite (&char_val, 1, 1, fp);
-      break;
-    case PLY_SHORT:
-      short_val = (short)int_val;
-      fwrite (&short_val, 2, 1, fp);
-      break;
-    case PLY_INT:
-      fwrite (&int_val, 4, 1, fp);
-      break;
-    case PLY_UCHAR:
-      uchar_val = (unsigned char) uint_val;
-      fwrite (&uchar_val, 1, 1, fp);
-      break;
-    case PLY_USHORT:
-      ushort_val = (unsigned short)uint_val;
-      fwrite (&ushort_val, 2, 1, fp);
-      break;
-    case PLY_UINT:
-      fwrite (&uint_val, 4, 1, fp);
-      break;
-    case PLY_FLOAT:
-      float_val = (float) double_val;
-      fwrite (&float_val, 4, 1, fp);
-      break;
-    case PLY_DOUBLE:
-      fwrite (&double_val, 8, 1, fp);
-      break;
-    default:
-      fprintf (stderr, "write_binary_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       unsigned char uchar_val;
+       char char_val;
+       unsigned short ushort_val;
+       short short_val;
+       float float_val;
+
+       switch (type) {
+               case PLY_CHAR:
+                       char_val = (char)int_val;
+                       fwrite(&char_val, 1, 1, fp);
+                       break;
+               case PLY_SHORT:
+                       short_val = (short)int_val;
+                       fwrite(&short_val, 2, 1, fp);
+                       break;
+               case PLY_INT:
+                       fwrite(&int_val, 4, 1, fp);
+                       break;
+               case PLY_UCHAR:
+                       uchar_val = (unsigned char) uint_val;
+                       fwrite(&uchar_val, 1, 1, fp);
+                       break;
+               case PLY_USHORT:
+                       ushort_val = (unsigned short)uint_val;
+                       fwrite(&ushort_val, 2, 1, fp);
+                       break;
+               case PLY_UINT:
+                       fwrite(&uint_val, 4, 1, fp);
+                       break;
+               case PLY_FLOAT:
+                       float_val = (float) double_val;
+                       fwrite(&float_val, 4, 1, fp);
+                       break;
+               case PLY_DOUBLE:
+                       fwrite(&double_val, 8, 1, fp);
+                       break;
+               default:
+                       fprintf(stderr, "write_binary_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Write out an item to a file as ascii characters.
-
-Entry:
-  fp         - file to write to
-  int_val    - integer version of item
-  uint_val   - unsigned integer version of item
-  double_val - double-precision float version of item
-  type       - data type to write out
+   Write out an item to a file as ascii characters.
+
+   Entry:
+   fp         - file to write to
+   int_val    - integer version of item
+   uint_val   - unsigned integer version of item
+   double_val - double-precision float version of item
+   type       - data type to write out
 ******************************************************************************/
 
 void write_ascii_item(
-  FILE *fp,
-  int int_val,
-  unsigned int uint_val,
-  double double_val,
-  int type
-)
+    FILE *fp,
+    int int_val,
+    unsigned int uint_val,
+    double double_val,
+    int type
+    )
 {
-  switch (type) {
-    case PLY_CHAR:
-    case PLY_SHORT:
-    case PLY_INT:
-      fprintf (fp, "%d ", int_val);
-      break;
-    case PLY_UCHAR:
-    case PLY_USHORT:
-    case PLY_UINT:
-      fprintf (fp, "%u ", uint_val);
-      break;
-    case PLY_FLOAT:
-    case PLY_DOUBLE:
-      fprintf (fp, "%g ", double_val);
-      break;
-    default:
-      fprintf (stderr, "write_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       switch (type) {
+               case PLY_CHAR:
+               case PLY_SHORT:
+               case PLY_INT:
+                       fprintf(fp, "%d ", int_val);
+                       break;
+               case PLY_UCHAR:
+               case PLY_USHORT:
+               case PLY_UINT:
+                       fprintf(fp, "%u ", uint_val);
+                       break;
+               case PLY_FLOAT:
+               case PLY_DOUBLE:
+                       fprintf(fp, "%g ", double_val);
+                       break;
+               default:
+                       fprintf(stderr, "write_ascii_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Write out an item to a file as ascii characters.
+   Write out an item to a file as ascii characters.
 
-Entry:
-  fp   - file to write to
-  item - pointer to item to write
-  type - data type that "item" points to
+   Entry:
+   fp   - file to write to
+   item - pointer to item to write
+   type - data type that "item" points to
 
-Exit:
-  returns a double-precision float that contains the value of the written item
+   Exit:
+   returns a double-precision float that contains the value of the written item
 ******************************************************************************/
 
 double old_write_ascii_item(FILE *fp, char *item, int type)
 {
-  unsigned char *puchar;
-  char *pchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-  int int_value;
-  unsigned int uint_value;
-  double double_value;
-
-  switch (type) {
-    case PLY_CHAR:
-      pchar = (char *) item;
-      int_value = *pchar;
-      fprintf (fp, "%d ", int_value);
-      return ((double) int_value);
-    case PLY_UCHAR:
-      puchar = (unsigned char *) item;
-      int_value = *puchar;
-      fprintf (fp, "%d ", int_value);
-      return ((double) int_value);
-    case PLY_SHORT:
-      pshort = (short int *) item;
-      int_value = *pshort;
-      fprintf (fp, "%d ", int_value);
-      return ((double) int_value);
-    case PLY_USHORT:
-      pushort = (unsigned short int *) item;
-      int_value = *pushort;
-      fprintf (fp, "%d ", int_value);
-      return ((double) int_value);
-    case PLY_INT:
-      pint = (int *) item;
-      int_value = *pint;
-      fprintf (fp, "%d ", int_value);
-      return ((double) int_value);
-    case PLY_UINT:
-      puint = (unsigned int *) item;
-      uint_value = *puint;
-      fprintf (fp, "%u ", uint_value);
-      return ((double) uint_value);
-    case PLY_FLOAT:
-      pfloat = (float *) item;
-      double_value = *pfloat;
-      fprintf (fp, "%g ", double_value);
-      return (double_value);
-    case PLY_DOUBLE:
-      pdouble = (double *) item;
-      double_value = *pdouble;
-      fprintf (fp, "%g ", double_value);
-      return (double_value);
-    default:
-      fprintf (stderr, "old_write_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       unsigned char *puchar;
+       char *pchar;
+       short int *pshort;
+       unsigned short int *pushort;
+       int *pint;
+       unsigned int *puint;
+       float *pfloat;
+       double *pdouble;
+       int int_value;
+       unsigned int uint_value;
+       double double_value;
+
+       switch (type) {
+               case PLY_CHAR:
+                       pchar = (char *) item;
+                       int_value = *pchar;
+                       fprintf(fp, "%d ", int_value);
+                       return ((double) int_value);
+               case PLY_UCHAR:
+                       puchar = (unsigned char *) item;
+                       int_value = *puchar;
+                       fprintf(fp, "%d ", int_value);
+                       return ((double) int_value);
+               case PLY_SHORT:
+                       pshort = (short int *) item;
+                       int_value = *pshort;
+                       fprintf(fp, "%d ", int_value);
+                       return ((double) int_value);
+               case PLY_USHORT:
+                       pushort = (unsigned short int *) item;
+                       int_value = *pushort;
+                       fprintf(fp, "%d ", int_value);
+                       return ((double) int_value);
+               case PLY_INT:
+                       pint = (int *) item;
+                       int_value = *pint;
+                       fprintf(fp, "%d ", int_value);
+                       return ((double) int_value);
+               case PLY_UINT:
+                       puint = (unsigned int *) item;
+                       uint_value = *puint;
+                       fprintf(fp, "%u ", uint_value);
+                       return ((double) uint_value);
+               case PLY_FLOAT:
+                       pfloat = (float *) item;
+                       double_value = *pfloat;
+                       fprintf(fp, "%g ", double_value);
+                       return (double_value);
+               case PLY_DOUBLE:
+                       pdouble = (double *) item;
+                       double_value = *pdouble;
+                       fprintf(fp, "%g ", double_value);
+                       return (double_value);
+               default:
+                       fprintf(stderr, "old_write_ascii_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Get the value of an item that is in memory, and place the result
-into an integer, an unsigned integer and a double.
+   Get the value of an item that is in memory, and place the result
+   into an integer, an unsigned integer and a double.
 
-Entry:
-  ptr  - pointer to the item
-  type - data type supposedly in the item
+   Entry:
+   ptr  - pointer to the item
+   type - data type supposedly in the item
 
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
+   Exit:
+   int_val    - integer value
+   uint_val   - unsigned integer value
+   double_val - double-precision floating point value
 ******************************************************************************/
 
 void get_stored_item(
-  void *ptr,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
+    void *ptr,
+    int type,
+    int *int_val,
+    unsigned int *uint_val,
+    double *double_val
+    )
 {
-  switch (type) {
-    case PLY_CHAR:
-      *int_val = *((char *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case PLY_UCHAR:
-      *uint_val = *((unsigned char *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case PLY_SHORT:
-      *int_val = *((short int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case PLY_USHORT:
-      *uint_val = *((unsigned short int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case PLY_INT:
-      *int_val = *((int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case PLY_UINT:
-      *uint_val = *((unsigned int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case PLY_FLOAT:
-      *double_val = *((float *) ptr);
-      *int_val = (int)*double_val;
-      *uint_val = (unsigned int)*double_val;
-      break;
-    case PLY_DOUBLE:
-      *double_val = *((double *) ptr);
-      *int_val = (int)*double_val;
-      *uint_val =(unsigned int) *double_val;
-      break;
-    default:
-      fprintf (stderr, "get_stored_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       switch (type) {
+               case PLY_CHAR:
+                       *int_val = *((char *) ptr);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+               case PLY_UCHAR:
+                       *uint_val = *((unsigned char *) ptr);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+               case PLY_SHORT:
+                       *int_val = *((short int *) ptr);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+               case PLY_USHORT:
+                       *uint_val = *((unsigned short int *) ptr);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+               case PLY_INT:
+                       *int_val = *((int *) ptr);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+               case PLY_UINT:
+                       *uint_val = *((unsigned int *) ptr);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+               case PLY_FLOAT:
+                       *double_val = *((float *) ptr);
+                       *int_val = (int)*double_val;
+                       *uint_val = (unsigned int)*double_val;
+                       break;
+               case PLY_DOUBLE:
+                       *double_val = *((double *) ptr);
+                       *int_val = (int)*double_val;
+                       *uint_val = (unsigned int) *double_val;
+                       break;
+               default:
+                       fprintf(stderr, "get_stored_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Get the value of an item from a binary file, and place the result
-into an integer, an unsigned integer and a double.
+   Get the value of an item from a binary file, and place the result
+   into an integer, an unsigned integer and a double.
 
-Entry:
-  fp   - file to get item from
-  type - data type supposedly in the word
+   Entry:
+   fp   - file to get item from
+   type - data type supposedly in the word
 
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
+   Exit:
+   int_val    - integer value
+   uint_val   - unsigned integer value
+   double_val - double-precision floating point value
 ******************************************************************************/
 
 void get_binary_item(
-  FILE *fp,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
+    FILE *fp,
+    int type,
+    int *int_val,
+    unsigned int *uint_val,
+    double *double_val
+    )
 {
-  char c[8];
-  void *ptr;
-
-  ptr = (void *) c;
-
-  switch (type) {
-    case PLY_CHAR:
-      fread (ptr, 1, 1, fp);
-      *int_val = *((char *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case PLY_UCHAR:
-      fread (ptr, 1, 1, fp);
-      *uint_val = *((unsigned char *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case PLY_SHORT:
-      fread (ptr, 2, 1, fp);
-      *int_val = *((short int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case PLY_USHORT:
-      fread (ptr, 2, 1, fp);
-      *uint_val = *((unsigned short int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case PLY_INT:
-      fread (ptr, 4, 1, fp);
-      *int_val = *((int *) ptr);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-    case PLY_UINT:
-      fread (ptr, 4, 1, fp);
-      *uint_val = *((unsigned int *) ptr);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-    case PLY_FLOAT:
-      fread (ptr, 4, 1, fp);
-      *double_val = *((float *) ptr);
-      *int_val = (int)*double_val;
-      *uint_val =(unsigned int) *double_val;
-      break;
-    case PLY_DOUBLE:
-      fread (ptr, 8, 1, fp);
-      *double_val = *((double *) ptr);
-      *int_val = (int)*double_val;
-      *uint_val = (unsigned int)*double_val;
-      break;
-    default:
-      fprintf (stderr, "get_binary_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       char c[8];
+       void *ptr;
+
+       ptr = (void *) c;
+
+       switch (type) {
+               case PLY_CHAR:
+                       fread(ptr, 1, 1, fp);
+                       *int_val = *((char *) ptr);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+               case PLY_UCHAR:
+                       fread(ptr, 1, 1, fp);
+                       *uint_val = *((unsigned char *) ptr);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+               case PLY_SHORT:
+                       fread(ptr, 2, 1, fp);
+                       *int_val = *((short int *) ptr);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+               case PLY_USHORT:
+                       fread(ptr, 2, 1, fp);
+                       *uint_val = *((unsigned short int *) ptr);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+               case PLY_INT:
+                       fread(ptr, 4, 1, fp);
+                       *int_val = *((int *) ptr);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+               case PLY_UINT:
+                       fread(ptr, 4, 1, fp);
+                       *uint_val = *((unsigned int *) ptr);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+               case PLY_FLOAT:
+                       fread(ptr, 4, 1, fp);
+                       *double_val = *((float *) ptr);
+                       *int_val = (int)*double_val;
+                       *uint_val = (unsigned int) *double_val;
+                       break;
+               case PLY_DOUBLE:
+                       fread(ptr, 8, 1, fp);
+                       *double_val = *((double *) ptr);
+                       *int_val = (int)*double_val;
+                       *uint_val = (unsigned int)*double_val;
+                       break;
+               default:
+                       fprintf(stderr, "get_binary_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Extract the value of an item from an ascii word, and place the result
-into an integer, an unsigned integer and a double.
+   Extract the value of an item from an ascii word, and place the result
+   into an integer, an unsigned integer and a double.
 
-Entry:
-  word - word to extract value from
-  type - data type supposedly in the word
+   Entry:
+   word - word to extract value from
+   type - data type supposedly in the word
 
-Exit:
-  int_val    - integer value
-  uint_val   - unsigned integer value
-  double_val - double-precision floating point value
+   Exit:
+   int_val    - integer value
+   uint_val   - unsigned integer value
+   double_val - double-precision floating point value
 ******************************************************************************/
 
 void get_ascii_item(
-  char *word,
-  int type,
-  int *int_val,
-  unsigned int *uint_val,
-  double *double_val
-)
+    char *word,
+    int type,
+    int *int_val,
+    unsigned int *uint_val,
+    double *double_val
+    )
 {
-  switch (type) {
-    case PLY_CHAR:
-    case PLY_UCHAR:
-    case PLY_SHORT:
-    case PLY_USHORT:
-    case PLY_INT:
-      *int_val = atoi (word);
-      *uint_val = *int_val;
-      *double_val = *int_val;
-      break;
-
-    case PLY_UINT:
-      *uint_val = strtoul (word, (char **) NULL, 10);
-      *int_val = *uint_val;
-      *double_val = *uint_val;
-      break;
-
-    case PLY_FLOAT:
-    case PLY_DOUBLE:
-      *double_val = atof (word);
-      *int_val = (int) *double_val;
-      *uint_val = (unsigned int) *double_val;
-      break;
-
-    default:
-      fprintf (stderr, "get_ascii_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       switch (type) {
+               case PLY_CHAR:
+               case PLY_UCHAR:
+               case PLY_SHORT:
+               case PLY_USHORT:
+               case PLY_INT:
+                       *int_val = atoi(word);
+                       *uint_val = *int_val;
+                       *double_val = *int_val;
+                       break;
+
+               case PLY_UINT:
+                       *uint_val = strtoul(word, (char **) NULL, 10);
+                       *int_val = *uint_val;
+                       *double_val = *uint_val;
+                       break;
+
+               case PLY_FLOAT:
+               case PLY_DOUBLE:
+                       *double_val = atof(word);
+                       *int_val = (int) *double_val;
+                       *uint_val = (unsigned int) *double_val;
+                       break;
+
+               default:
+                       fprintf(stderr, "get_ascii_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Store a value into a place being pointed to, guided by a data type.
+   Store a value into a place being pointed to, guided by a data type.
 
-Entry:
-  item       - place to store value
-  type       - data type
-  int_val    - integer version of value
-  uint_val   - unsigned integer version of value
-  double_val - double version of value
+   Entry:
+   item       - place to store value
+   type       - data type
+   int_val    - integer version of value
+   uint_val   - unsigned integer version of value
+   double_val - double version of value
 
-Exit:
-  item - pointer to stored value
+   Exit:
+   item - pointer to stored value
 ******************************************************************************/
 
-void store_item (
-  char *item,
-  int type,
-  int int_val,
-  unsigned int uint_val,
-  double double_val
-)
+void store_item(
+    char *item,
+    int type,
+    int int_val,
+    unsigned int uint_val,
+    double double_val
+    )
 {
-  unsigned char *puchar;
-  short int *pshort;
-  unsigned short int *pushort;
-  int *pint;
-  unsigned int *puint;
-  float *pfloat;
-  double *pdouble;
-
-  switch (type) {
-    case PLY_CHAR:
-      *item = (char) int_val;
-      break;
-    case PLY_UCHAR:
-      puchar = (unsigned char *) item;
-      *puchar = (unsigned char)uint_val;
-      break;
-    case PLY_SHORT:
-      pshort = (short *) item;
-      *pshort = (short)int_val;
-      break;
-    case PLY_USHORT:
-      pushort = (unsigned short *) item;
-      *pushort = (unsigned short)uint_val;
-      break;
-    case PLY_INT:
-      pint = (int *) item;
-      *pint = int_val;
-      break;
-    case PLY_UINT:
-      puint = (unsigned int *) item;
-      *puint = uint_val;
-      break;
-    case PLY_FLOAT:
-      pfloat = (float *) item;
-      *pfloat = (float)double_val;
-      break;
-    case PLY_DOUBLE:
-      pdouble = (double *) item;
-      *pdouble = double_val;
-      break;
-    default:
-      fprintf (stderr, "store_item: bad type = %d\n", type);
-      exit (-1);
-  }
+       unsigned char *puchar;
+       short int *pshort;
+       unsigned short int *pushort;
+       int *pint;
+       unsigned int *puint;
+       float *pfloat;
+       double *pdouble;
+
+       switch (type) {
+               case PLY_CHAR:
+                       *item = (char) int_val;
+                       break;
+               case PLY_UCHAR:
+                       puchar = (unsigned char *) item;
+                       *puchar = (unsigned char)uint_val;
+                       break;
+               case PLY_SHORT:
+                       pshort = (short *) item;
+                       *pshort = (short)int_val;
+                       break;
+               case PLY_USHORT:
+                       pushort = (unsigned short *) item;
+                       *pushort = (unsigned short)uint_val;
+                       break;
+               case PLY_INT:
+                       pint = (int *) item;
+                       *pint = int_val;
+                       break;
+               case PLY_UINT:
+                       puint = (unsigned int *) item;
+                       *puint = uint_val;
+                       break;
+               case PLY_FLOAT:
+                       pfloat = (float *) item;
+                       *pfloat = (float)double_val;
+                       break;
+               case PLY_DOUBLE:
+                       pdouble = (double *) item;
+                       *pdouble = double_val;
+                       break;
+               default:
+                       fprintf(stderr, "store_item: bad type = %d\n", type);
+                       exit(-1);
+       }
 }
 
 
 /******************************************************************************
-Add an element to a PLY file descriptor.
+   Add an element to a PLY file descriptor.
 
-Entry:
-  plyfile - PLY file descriptor
-  words   - list of words describing the element
-  nwords  - number of words in the list
+   Entry:
+   plyfile - PLY file descriptor
+   words   - list of words describing the element
+   nwords  - number of words in the list
 ******************************************************************************/
 
-void add_element (PlyFile *plyfile, char **words)
+void add_element(PlyFile *plyfile, char **words)
 {
-  PlyElement *elem;
-
-  /* create the new element */
-  elem = (PlyElement *) myalloc (sizeof (PlyElement));
-  elem->name = strdup (words[1]);
-  elem->num = atoi (words[2]);
-  elem->nprops = 0;
-
-  /* make room for new element in the object's list of elements */
-  if (plyfile->nelems == 0)
-    plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *));
-  else
-    plyfile->elems = (PlyElement **) realloc (plyfile->elems,
-                     sizeof (PlyElement *) * (plyfile->nelems + 1));
-
-  /* add the new element to the object's list */
-  plyfile->elems[plyfile->nelems] = elem;
-  plyfile->nelems++;
+       PlyElement *elem;
+
+       /* create the new element */
+       elem = (PlyElement *) myalloc(sizeof(PlyElement));
+       elem->name = strdup(words[1]);
+       elem->num = atoi(words[2]);
+       elem->nprops = 0;
+
+       /* make room for new element in the object's list of elements */
+       if (plyfile->nelems == 0)
+               plyfile->elems = (PlyElement **) myalloc(sizeof(PlyElement *));
+       else
+               plyfile->elems = (PlyElement **) realloc(plyfile->elems,
+                                                        sizeof(PlyElement *) * (plyfile->nelems + 1));
+
+       /* add the new element to the object's list */
+       plyfile->elems[plyfile->nelems] = elem;
+       plyfile->nelems++;
 }
 
 
 /******************************************************************************
-Return the type of a property, given the name of the property.
+   Return the type of a property, given the name of the property.
 
-Entry:
-  name - name of property type
+   Entry:
+   name - name of property type
 
-Exit:
-  returns integer code for property, or 0 if not found
+   Exit:
+   returns integer code for property, or 0 if not found
 ******************************************************************************/
 
 int get_prop_type(char *type_name)
 {
-  int i;
+       int i;
 
-  for (i = PLY_START_TYPE + 1; i < PLY_END_TYPE; i++)
-    if (equal_strings (type_name, type_names[i]))
-      return (i);
+       for (i = PLY_START_TYPE + 1; i < PLY_END_TYPE; i++)
+               if (equal_strings(type_name, type_names[i]))
+                       return (i);
 
-  /* if we get here, we didn't find the type */
-  return (0);
+       /* if we get here, we didn't find the type */
+       return (0);
 }
 
 
 /******************************************************************************
-Add a property to a PLY file descriptor.
+   Add a property to a PLY file descriptor.
 
-Entry:
-  plyfile - PLY file descriptor
-  words   - list of words describing the property
-  nwords  - number of words in the list
+   Entry:
+   plyfile - PLY file descriptor
+   words   - list of words describing the property
+   nwords  - number of words in the list
 ******************************************************************************/
 
-void add_property (PlyFile *plyfile, char **words)
+void add_property(PlyFile *plyfile, char **words)
 {
-  PlyProperty *prop;
-  PlyElement *elem;
+       PlyProperty *prop;
+       PlyElement *elem;
 
-  /* create the new property */
+       /* create the new property */
 
-  prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
+       prop = (PlyProperty *) myalloc(sizeof(PlyProperty));
 
-  if (equal_strings (words[1], "list")) {       /* is a list */
-    prop->count_external = get_prop_type (words[2]);
-    prop->external_type = get_prop_type (words[3]);
-    prop->name = strdup (words[4]);
-    prop->is_list = 1;
-  }
-  else {                                        /* not a list */
-    prop->external_type = get_prop_type (words[1]);
-    prop->name = strdup (words[2]);
-    prop->is_list = 0;
-  }
+       if (equal_strings(words[1], "list")) {      /* is a list */
+               prop->count_external = get_prop_type(words[2]);
+               prop->external_type = get_prop_type(words[3]);
+               prop->name = strdup(words[4]);
+               prop->is_list = 1;
+       }
+       else {                                      /* not a list */
+               prop->external_type = get_prop_type(words[1]);
+               prop->name = strdup(words[2]);
+               prop->is_list = 0;
+       }
 
-  /* add this property to the list of properties of the current element */
+       /* add this property to the list of properties of the current element */
 
-  elem = plyfile->elems[plyfile->nelems - 1];
+       elem = plyfile->elems[plyfile->nelems - 1];
 
-  if (elem->nprops == 0)
-    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
-  else
-    elem->props = (PlyProperty **) realloc (elem->props,
-                  sizeof (PlyProperty *) * (elem->nprops + 1));
+       if (elem->nprops == 0)
+               elem->props = (PlyProperty **) myalloc(sizeof(PlyProperty *));
+       else
+               elem->props = (PlyProperty **) realloc(elem->props,
+                                                      sizeof(PlyProperty *) * (elem->nprops + 1));
 
-  elem->props[elem->nprops] = prop;
-  elem->nprops++;
+       elem->props[elem->nprops] = prop;
+       elem->nprops++;
 }
 
 
 /******************************************************************************
-Add a comment to a PLY file descriptor.
+   Add a comment to a PLY file descriptor.
 
-Entry:
-  plyfile - PLY file descriptor
-  line    - line containing comment
+   Entry:
+   plyfile - PLY file descriptor
+   line    - line containing comment
 ******************************************************************************/
 
-void add_comment (PlyFile *plyfile, char *line)
+void add_comment(PlyFile *plyfile, char *line)
 {
-  int i;
+       int i;
 
-  /* skip over "comment" and leading spaces and tabs */
-  i = 7;
-  while (line[i] == ' ' || line[i] == '\t')
-    i++;
+       /* skip over "comment" and leading spaces and tabs */
+       i = 7;
+       while (line[i] == ' ' || line[i] == '\t')
+               i++;
 
-  ply_put_comment (plyfile, &line[i]);
+       ply_put_comment(plyfile, &line[i]);
 }
 
 
 /******************************************************************************
-Add a some object information to a PLY file descriptor.
+   Add a some object information to a PLY file descriptor.
 
-Entry:
-  plyfile - PLY file descriptor
-  line    - line containing text info
+   Entry:
+   plyfile - PLY file descriptor
+   line    - line containing text info
 ******************************************************************************/
 
-void add_obj_info (PlyFile *plyfile, char *line)
+void add_obj_info(PlyFile *plyfile, char *line)
 {
-  int i;
+       int i;
 
-  /* skip over "obj_info" and leading spaces and tabs */
-  i = 8;
-  while (line[i] == ' ' || line[i] == '\t')
-    i++;
+       /* skip over "obj_info" and leading spaces and tabs */
+       i = 8;
+       while (line[i] == ' ' || line[i] == '\t')
+               i++;
 
-  ply_put_obj_info (plyfile, &line[i]);
+       ply_put_obj_info(plyfile, &line[i]);
 }
 
 
 /******************************************************************************
-Copy a property.
+   Copy a property.
 ******************************************************************************/
 
 void copy_property(PlyProperty *dest, PlyProperty *src)
 {
-  dest->name = strdup (src->name);
-  dest->external_type = src->external_type;
-  dest->internal_type = src->internal_type;
-  dest->offset = src->offset;
-
-  dest->is_list = src->is_list;
-  dest->count_external = src->count_external;
-  dest->count_internal = src->count_internal;
-  dest->count_offset = src->count_offset;
+       dest->name = strdup(src->name);
+       dest->external_type = src->external_type;
+       dest->internal_type = src->internal_type;
+       dest->offset = src->offset;
+
+       dest->is_list = src->is_list;
+       dest->count_external = src->count_external;
+       dest->count_internal = src->count_internal;
+       dest->count_offset = src->count_offset;
 }
 
 
 /******************************************************************************
-Allocate some memory.
+   Allocate some memory.
 
-Entry:
-  size  - amount of memory requested (in bytes)
-  lnum  - line number from which memory was requested
-  fname - file name from which memory was requested
+   Entry:
+   size  - amount of memory requested (in bytes)
+   lnum  - line number from which memory was requested
+   fname - file name from which memory was requested
 ******************************************************************************/
 
 static char *my_alloc(int size, int lnum, char *fname)
 {
-  char *ptr;
+       char *ptr;
 
-  ptr = (char *) malloc (size);
+       ptr = (char *) malloc(size);
 
-  if (ptr == 0) {
-    fprintf(stderr, "Memory allocation bombed on line %d in %s\n", lnum, fname);
-  }
+       if (ptr == 0) {
+               fprintf(stderr, "Memory allocation bombed on line %d in %s\n", lnum, fname);
+       }
 
-  return (ptr);
+       return (ptr);
 }
 
index 7f43ba6..526fac0 100644 (file)
@@ -665,11 +665,11 @@ int ControlParticles::initFromBinaryFile(string filename) {
                        int ptype=0;
                        float psize=0.0;
                        ntlVec3Gfx ppos,pvel;
-                       gzread(gzf, &ptype, sizeof( ptype )); 
-                       gzread(gzf, &psize, sizeof( float )); 
+                       gzread(gzf, &ptype, sizeof(ptype));
+                       gzread(gzf, &psize, sizeof(float));
 
-                       for(int j=0; j<3; j++) { gzread(gzf, &ppos[j], sizeof( float )); }
-                       for(int j=0; j<3; j++) { gzread(gzf, &pvel[j], sizeof( float )); }
+                       for (int j=0; j<3; j++) { gzread(gzf, &ppos[j], sizeof(float)); }
+                       for (int j=0; j<3; j++) { gzread(gzf, &pvel[j], sizeof(float)); }
 
                        ControlParticle p; 
                        p.reset();
index 9dbbb46..703c528 100644 (file)
@@ -40,7 +40,6 @@
 #endif
 
 #include <libswscale/swscale.h>
-#include <libavcodec/opt.h>
 
 #if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 105))
 #define FFMPEG_HAVE_AVIO 1
 #define FFMPEG_FFV1_ALPHA_SUPPORTED
 #endif
 
+#if ((LIBAVFORMAT_VERSION_MAJOR < 53) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR < 24)) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR < 24) && (LIBAVFORMAT_VERSION_MICRO < 2)))
+#define avformat_close_input(x) av_close_input_file(*(x))
+#endif
+
+#if ((LIBAVFORMAT_VERSION_MAJOR > 53) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR > 32)) || ((LIBAVFORMAT_VERSION_MAJOR == 53) && (LIBAVFORMAT_VERSION_MINOR == 24) && (LIBAVFORMAT_VERSION_MICRO >= 100)))
+void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
+
+static inline
+void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
+{
+    ff_update_cur_dts(s, ref_st, timestamp);
+}
+#endif
+
 #ifndef FFMPEG_HAVE_AVIO
 #define AVIO_FLAG_WRITE URL_WRONLY
 #define avio_open url_fopen
index 277b14e..e52ac0a 100644 (file)
@@ -143,6 +143,7 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL)
                                intern/GHOST_SystemPathsCarbon.h
                        )
                endif()
+
        elseif(UNIX)
                list(APPEND SRC
                        intern/GHOST_SystemPathsX11.cpp
@@ -152,13 +153,17 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL)
                if(NOT WITH_INSTALL_PORTABLE)
                        add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
                endif()
-       elseif(WIN32)
 
+       elseif(WIN32)
                list(APPEND SRC
                        intern/GHOST_SystemPathsWin32.cpp
 
                        intern/GHOST_SystemPathsWin32.h
                )
+
+               list(APPEND INC
+                       ../utfconv
+               )
        endif()
 
        if(NOT WITH_HEADLESS)
index a647f82..c2456fe 100644 (file)
@@ -639,8 +639,8 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type,
 GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type, GHOST_IWindow *Iwindow)
 {
        GHOST_TInt32 x_screen, y_screen;
-       GHOST_SystemWin32 *system = ((GHOST_SystemWin32 * ) getSystem());
-       GHOST_WindowWin32 *window = ( GHOST_WindowWin32 * ) Iwindow;
+       GHOST_SystemWin32 *system = (GHOST_SystemWin32 *) getSystem();
+       GHOST_WindowWin32 *window = (GHOST_WindowWin32 *) Iwindow;
        
        system->getCursorPosition(x_screen, y_screen);
 
index 4086fbb..c32d78f 100644 (file)
@@ -526,7 +526,6 @@ int main(int argc, char **argv)
 
        /* Dispose the system */
        GHOST_DisposeSystem(shSystem);
-       GHOST_DisposeEventConsumer(consumer);
        
        return 0;
 }
index c51b72a..d338f11 100644 (file)
@@ -435,7 +435,7 @@ Application::Application(GHOST_ISystem *system)
        m_secondaryWindow = system->createWindow(title2, 340, 64, 320, 200, GHOST_kWindowStateNormal,
                                                 GHOST_kDrawingContextTypeOpenGL, false, false);
        if (!m_secondaryWindow) {
-               cout << "could not create secondary window\n";
+               std::cout << "could not create secondary window\n";
                exit(-1);
        }
 
index 0ec1ccd..cfa6a20 100644 (file)
@@ -58,12 +58,12 @@ public:
        MEM_CacheLimiterCClass(MEM_CacheLimiter_Destruct_Func data_destructor_, MEM_CacheLimiter_DataSize_Func data_size)
                : data_destructor(data_destructor_), cache(data_size) {
        }
-        ~MEM_CacheLimiterCClass();
+       ~MEM_CacheLimiterCClass();
        
        handle_t * insert(void * data);
 
        void destruct(void * data,
-                     list_t::iterator it);
+                     list_t::iterator it);
 
        cache_t * get_cache() {
                return &cache;
@@ -79,9 +79,9 @@ private:
 class MEM_CacheLimiterHandleCClass {
 public:
        MEM_CacheLimiterHandleCClass(void * data_,
-                                  MEM_CacheLimiterCClass * parent_)
-               : data(data_), parent(parent_) { }
-        ~MEM_CacheLimiterHandleCClass();
+                                    MEM_CacheLimiterCClass * parent_)
+           : data(data_), parent(parent_) { }
+       ~MEM_CacheLimiterHandleCClass();
        void set_iter(list_t::iterator it_) {
                it = it_;
        }
index be96564..bacf49a 100644 (file)
@@ -1,10 +1,10 @@
 import bpy
 op = bpy.context.active_operator
-
-op.selected = True
 op.apply_modifiers = True
-op.include_armatures = False
+op.selected = True
 op.include_children = False
+op.include_armatures = True
+op.deform_bones_only = True
 op.use_object_instantiation = False
 op.sort_by_name = True
 op.second_life = True
index 9200c68..a667125 100644 (file)
@@ -841,7 +841,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
                     row = layout.row()
                     row.prop(part, "use_simplify_viewport")
                     sub = row.row()
-                    sub.active = part.viewport == True
+                    sub.active = part.use_simplify_viewport == True
                     sub.prop(part, "simplify_viewport")
 
         elif part.render_type == 'OBJECT':
index e00982b..3d04db5 100644 (file)
@@ -452,7 +452,7 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
                return AVI_ERROR_FORMAT;
        }
 
-       movie->header = (AviMainHeader *) MEM_mallocN(sizeof (AviMainHeader), "movieheader");
+       movie->header = (AviMainHeader *) MEM_mallocN(sizeof(AviMainHeader), "movieheader");
 
        if (GET_FCC(movie->fp) != FCC("AVI ") ||
            GET_FCC(movie->fp) != FCC("LIST") ||
@@ -769,7 +769,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
        if (movie->fp == NULL)
                return AVI_ERROR_OPEN;
 
-       movie->offset_table = (int64_t *) MEM_mallocN((1 + streams * 2) * sizeof (int64_t), "offsettable");
+       movie->offset_table = (int64_t *) MEM_mallocN((1 + streams * 2) * sizeof(int64_t), "offsettable");
        
        for (i = 0; i < 1 + streams * 2; i++)
                movie->offset_table[i] = -1L;
index faa996b..144cbe2 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         263
-#define BLENDER_SUBVERSION      11
+#define BLENDER_SUBVERSION      12
 
 #define BLENDER_MINVERSION      250
 #define BLENDER_MINSUBVERSION   0
index d26a722..575c721 100644 (file)
@@ -1627,7 +1627,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
        int nextLvl = curLvl + 1;
        int ptrIdx, cornerIdx, i;
        int vertDataSize = ss->meshIFC.vertDataSize;
-       void *q = ss->q, *r = ss->r;
+       float *q = ss->q, *r = ss->r;
 
        #pragma omp parallel for private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT)
        for (ptrIdx = 0; ptrIdx < numEffectedF; ptrIdx++) {
@@ -1642,11 +1642,11 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                                for (x = 0; x < gridSize - 1; x++) {
                                        int fx = 1 + 2 * x;
                                        int fy = 1 + 2 * y;
-                                       void *co0 = FACE_getIFCo(f, curLvl, S, x + 0, y + 0);
-                                       void *co1 = FACE_getIFCo(f, curLvl, S, x + 1, y + 0);
-                                       void *co2 = FACE_getIFCo(f, curLvl, S, x + 1, y + 1);
-                                       void *co3 = FACE_getIFCo(f, curLvl, S, x + 0, y + 1);
-                                       void *co = FACE_getIFCo(f, nextLvl, S, fx, fy);
+                                       const float *co0 = FACE_getIFCo(f, curLvl, S, x + 0, y + 0);
+                                       const float *co1 = FACE_getIFCo(f, curLvl, S, x + 1, y + 0);
+                                       const float *co2 = FACE_getIFCo(f, curLvl, S, x + 1, y + 1);
+                                       const float *co3 = FACE_getIFCo(f, curLvl, S, x + 0, y + 1);
+                                       float *co = FACE_getIFCo(f, nextLvl, S, fx, fy);
 
                                        VertDataAvg4(co, co0, co1, co2, co3, ss);
                                }
@@ -1660,11 +1660,11 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                for (S = 0; S < f->numVerts; S++) {
                        for (x = 0; x < gridSize - 1; x++) {
                                int fx = x * 2 + 1;
-                               void *co0 = FACE_getIECo(f, curLvl, S, x + 0);
-                               void *co1 = FACE_getIECo(f, curLvl, S, x + 1);
-                               void *co2 = FACE_getIFCo(f, nextLvl, (S + 1) % f->numVerts, 1, fx);
-                               void *co3 = FACE_getIFCo(f, nextLvl, S, fx, 1);
-                               void *co  = FACE_getIECo(f, nextLvl, S, fx);
+                               const float *co0 = FACE_getIECo(f, curLvl, S, x + 0);
+                               const float *co1 = FACE_getIECo(f, curLvl, S, x + 1);
+                               const float *co2 = FACE_getIFCo(f, nextLvl, (S + 1) % f->numVerts, 1, fx);
+                               const float *co3 = FACE_getIFCo(f, nextLvl, S, fx, 1);
+                               float *co  = FACE_getIECo(f, nextLvl, S, fx);
                                
                                VertDataAvg4(co, co0, co1, co2, co3, ss);
                        }
@@ -1679,11 +1679,11 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                                for (y = 0; y < gridSize - 1; y++) {
                                        int fx = x * 2;
                                        int fy = y * 2 + 1;
-                                       void *co0 = FACE_getIFCo(f, curLvl, S, x, y + 0);
-                                       void *co1 = FACE_getIFCo(f, curLvl, S, x, y + 1);
-                                       void *co2 = FACE_getIFCo(f, nextLvl, S, fx - 1, fy);
-                                       void *co3 = FACE_getIFCo(f, nextLvl, S, fx + 1, fy);
-                                       void *co  = FACE_getIFCo(f, nextLvl, S, fx, fy);
+                                       const float *co0 = FACE_getIFCo(f, curLvl, S, x, y + 0);
+                                       const float *co1 = FACE_getIFCo(f, curLvl, S, x, y + 1);
+                                       const float *co2 = FACE_getIFCo(f, nextLvl, S, fx - 1, fy);
+                                       const float *co3 = FACE_getIFCo(f, nextLvl, S, fx + 1, fy);
+                                       float *co  = FACE_getIFCo(f, nextLvl, S, fx, fy);
 
                                        VertDataAvg4(co, co0, co1, co2, co3, ss);
                                }
@@ -1694,11 +1694,11 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                                for (x = 0; x < gridSize - 1; x++) {
                                        int fx = x * 2 + 1;
                                        int fy = y * 2;
-                                       void *co0 = FACE_getIFCo(f, curLvl, S, x + 0, y);
-                                       void *co1 = FACE_getIFCo(f, curLvl, S, x + 1, y);
-                                       void *co2 = FACE_getIFCo(f, nextLvl, S, fx, fy - 1);
-                                       void *co3 = FACE_getIFCo(f, nextLvl, S, fx, fy + 1);
-                                       void *co  = FACE_getIFCo(f, nextLvl, S, fx, fy);
+                                       const float *co0 = FACE_getIFCo(f, curLvl, S, x + 0, y);
+                                       const float *co1 = FACE_getIFCo(f, curLvl, S, x + 1, y);
+                                       const float *co2 = FACE_getIFCo(f, nextLvl, S, fx, fy - 1);
+                                       const float *co3 = FACE_getIFCo(f, nextLvl, S, fx, fy + 1);
+                                       float *co  = FACE_getIFCo(f, nextLvl, S, fx, fy);
 
                                        VertDataAvg4(co, co0, co1, co2, co3, ss);
                                }
@@ -1718,9 +1718,9 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                if (_edge_isBoundary(e) || sharpness > 1.0f) {
                        for (x = 0; x < edgeSize - 1; x++) {
                                int fx = x * 2 + 1;
-                               void *co0 = EDGE_getCo(e, curLvl, x + 0);
-                               void *co1 = EDGE_getCo(e, curLvl, x + 1);
-                               void *co  = EDGE_getCo(e, nextLvl, fx);
+                               const float *co0 = EDGE_getCo(e, curLvl, x + 0);
+                               const float *co1 = EDGE_getCo(e, curLvl, x + 1);
+                               float *co  = EDGE_getCo(e, nextLvl, fx);
 
                                VertDataCopy(co, co0, ss);
                                VertDataAdd(co, co1, ss);
@@ -1730,9 +1730,9 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                else {
                        for (x = 0; x < edgeSize - 1; x++) {
                                int fx = x * 2 + 1;
-                               void *co0 = EDGE_getCo(e, curLvl, x + 0);
-                               void *co1 = EDGE_getCo(e, curLvl, x + 1);
-                               void *co  = EDGE_getCo(e, nextLvl, fx);
+                               const float *co0 = EDGE_getCo(e, curLvl, x + 0);
+                               const float *co1 = EDGE_getCo(e, curLvl, x + 1);
+                               float *co  = EDGE_getCo(e, nextLvl, fx);
                                int numFaces = 0;
 
                                VertDataCopy(q, co0, ss);
@@ -1766,8 +1766,8 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
         */
        for (ptrIdx = 0; ptrIdx < numEffectedV; ptrIdx++) {
                CCGVert *v = (CCGVert *) effectedV[ptrIdx];
-               void *co = VERT_getCo(v, curLvl);
-               void *nCo = VERT_getCo(v, nextLvl);
+               const float *co = VERT_getCo(v, curLvl);
+               float *nCo = VERT_getCo(v, nextLvl);
                int sharpCount = 0, allSharp = 1;
                float avgSharpness = 0.0;
                int j, seam = VERT_seam(v), seamEdges = 0;
@@ -1878,8 +1878,8 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
 
                        /* r = co * 0.75 + q * 0.25 */
                        VertDataCopy(r, co, ss);
-                       VertDataMulN(r, .75f, ss);
-                       VertDataMulN(q, .25f, ss);
+                       VertDataMulN(r, 0.75f, ss);
+                       VertDataMulN(q, 0.25f, ss);
                        VertDataAdd(r, q, ss);
 
                        /* nCo = nCo  + (r - nCo) * avgSharpness */
@@ -1914,14 +1914,18 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                        avgSharpness = 0;
                }
 
-               if (_edge_isBoundary(e) && (!e->numFaces || sharpCount < 2)) {
+               if (_edge_isBoundary(e)) {
                        for (x = 1; x < edgeSize - 1; x++) {
                                int fx = x * 2;
-                               void *co = EDGE_getCo(e, curLvl, x);
-                               void *nCo = EDGE_getCo(e, nextLvl, fx);
+                               const float *co = EDGE_getCo(e, curLvl, x);
+                               float *nCo = EDGE_getCo(e, nextLvl, fx);
+
+                               /* Average previous level's endpoints */
                                VertDataCopy(r, EDGE_getCo(e, curLvl, x - 1), ss);
                                VertDataAdd(r, EDGE_getCo(e, curLvl, x + 1), ss);
                                VertDataMulN(r, 0.5f, ss);
+
+                               /* nCo = nCo * 0.75 + r * 0.25 */
                                VertDataCopy(nCo, co, ss);
                                VertDataMulN(nCo, 0.75f, ss);
                                VertDataMulN(r, 0.25f, ss);
@@ -1931,8 +1935,8 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                else {
                        for (x = 1; x < edgeSize - 1; x++) {
                                int fx = x * 2;
-                               void *co = EDGE_getCo(e, curLvl, x);
-                               void *nCo = EDGE_getCo(e, nextLvl, fx);
+                               const float *co = EDGE_getCo(e, curLvl, x);
+                               float *nCo = EDGE_getCo(e, nextLvl, fx);
                                int numFaces = 0;
 
                                VertDataZero(q, ss);
@@ -1974,7 +1978,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
 
        #pragma omp parallel private(ptrIdx) if (numEffectedF * edgeSize * edgeSize * 4 >= CCG_OMP_LIMIT)
        {
-               void *q, *r;
+               float *q, *r;
 
                #pragma omp critical
                {
@@ -2018,8 +2022,8 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                                        for (y = 1; y < gridSize - 1; y++) {
                                                int fx = x * 2;
                                                int fy = y * 2;
-                                               void *co = FACE_getIFCo(f, curLvl, S, x, y);
-                                               void *nCo = FACE_getIFCo(f, nextLvl, S, fx, fy);
+                                               const float *co = FACE_getIFCo(f, curLvl, S, x, y);
+                                               float *nCo = FACE_getIFCo(f, nextLvl, S, fx, fy);
                                                
                                                VertDataAvg4(q,
                                                             FACE_getIFCo(f, nextLvl, S, fx - 1, fy - 1),
@@ -2049,8 +2053,8 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                                 */
                                for (x = 1; x < gridSize - 1; x++) {
                                        int fx = x * 2;
-                                       void *co = FACE_getIECo(f, curLvl, S, x);
-                                       void *nCo = FACE_getIECo(f, nextLvl, S, fx);
+                                       const float *co = FACE_getIECo(f, curLvl, S, x);
+                                       float *nCo = FACE_getIECo(f, nextLvl, S, fx);
                                        
                                        VertDataAvg4(q,
                                                     FACE_getIFCo(f, nextLvl, (S + 1) % f->numVerts, 1, fx - 1),
@@ -2106,7 +2110,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss,
                        VertDataCopy(FACE_getIFCo(f, nextLvl, S, cornerIdx, cornerIdx), VERT_getCo(FACE_getVerts(f)[S], nextLvl), ss);
                        VertDataCopy(FACE_getIECo(f, nextLvl, S, cornerIdx), EDGE_getCo(FACE_getEdges(f)[S], nextLvl, cornerIdx), ss);
                        for (x = 1; x < gridSize - 1; x++) {
-                               void *co = FACE_getIECo(f, nextLvl, S, x);
+                               float *co = FACE_getIECo(f, nextLvl, S, x);
                                VertDataCopy(FACE_getIFCo(f, nextLvl, S, x, 0), co, ss);
                                VertDataCopy(FACE_getIFCo(f, nextLvl, (S + 1) % f->numVerts, 0, x), co, ss);
                        }
index b681426..a0cca25 100644 (file)
@@ -1007,7 +1007,7 @@ int cloth_add_spring(ClothModifierData *clmd, unsigned int indexA, unsigned int
        if (cloth) {
                // TODO: look if this spring is already there
                
-               spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
+               spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
                
                if (!spring)
                        return 0;
@@ -1079,7 +1079,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
        cloth->springs = NULL;
 
-       edgelist = MEM_callocN ( sizeof ( LinkNode * ) * numverts, "cloth_edgelist_alloc" );
+       edgelist = MEM_callocN ( sizeof (LinkNode *) * numverts, "cloth_edgelist_alloc" );
        
        if (!edgelist)
                return 0;
@@ -1096,7 +1096,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
        // structural springs
        for ( i = 0; i < numedges; i++ ) {
-               spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
+               spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
 
                if ( spring ) {
                        spring->ij = MIN2(medge[i].v1, medge[i].v2);
@@ -1154,7 +1154,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
                
                // if ( mface[i].v4 ) --> Quad face
-               spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
+               spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
                
                if (!spring) {
                        cloth_free_errorsprings(cloth, edgehash, edgelist);
@@ -1192,7 +1192,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
                                if (!BLI_edgehash_haskey(edgehash, MIN2(tspring2->ij, index2), MAX2(tspring2->ij, index2)) &&
                                    (index2 != tspring2->ij))
                                {
-                                       spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
+                                       spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
                                        
                                        if (!spring) {
                                                cloth_free_errorsprings(cloth, edgehash, edgelist);
@@ -1229,7 +1229,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
                        tspring2 = search2->link;
 
                        if (tspring->ij == tspring2->kl) {
-                               spring = ( ClothSpring * ) MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
+                               spring = (ClothSpring *)MEM_callocN ( sizeof ( ClothSpring ), "cloth spring" );
                                
                                if (!spring) {
                                        cloth_free_errorsprings(cloth, edgehash, edgelist);
index 44f5243..71b2f69 100644 (file)
@@ -643,12 +643,12 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis
 {
        int i;
        
-       *collisions = ( CollPair* ) MEM_mallocN ( sizeof ( CollPair ) * numresult * 64, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
+       *collisions = (CollPair *) MEM_mallocN(sizeof(CollPair) * numresult * 64, "collision array" ); //*4 since cloth_collision_static can return more than 1 collision
        *collisions_index = *collisions;
 
        for ( i = 0; i < numresult; i++ ) {
                *collisions_index = cloth_collision ( (ModifierData *)clmd, (ModifierData *)collmd,
-                                                                                         overlap+i, *collisions_index, dt );
+                                                     overlap+i, *collisions_index, dt );
        }
 }
 
index 623d4b8..674a2d9 100644 (file)
@@ -1713,7 +1713,7 @@ static void calc_bevel_sin_cos(float x1, float y1, float x2, float y2, float *si
 
        t02 = x1 * x2 + y1 * y2;
        if (fabs(t02) >= 1.0)
-               t02 = .5 * M_PI;
+               t02 = 0.5 * M_PI;
        else
                t02 = (saacos(t02)) / 2.0f;
 
index 4aef471..4755fcc 100644 (file)
@@ -186,7 +186,7 @@ DO_INLINE void print_lfvector(float (*fLongVector)[3], unsigned int verts)
 DO_INLINE lfVector *create_lfvector(unsigned int verts)
 {
        // TODO: check if memory allocation was successfull */
-       return  (lfVector *)MEM_callocN (verts * sizeof(lfVector), "cloth_implicit_alloc_vector");
+       return  (lfVector *)MEM_callocN(verts * sizeof(lfVector), "cloth_implicit_alloc_vector");
        // return (lfVector *)cloth_aligned_malloc(&MEMORY_BASE, verts * sizeof(lfVector));
 }
 /* delete long vector */
@@ -514,7 +514,7 @@ static void print_bfmatrix(fmatrix3x3 *m3)
 DO_INLINE fmatrix3x3 *create_bfmatrix(unsigned int verts, unsigned int springs)
 {
        // TODO: check if memory allocation was successfull */
-       fmatrix3x3 *temp = (fmatrix3x3 *)MEM_callocN (sizeof (fmatrix3x3) * (verts + springs), "cloth_implicit_alloc_matrix");
+       fmatrix3x3 *temp = (fmatrix3x3 *)MEM_callocN(sizeof(fmatrix3x3) * (verts + springs), "cloth_implicit_alloc_matrix");
        temp[0].vcount = verts;
        temp[0].scount = springs;
        return temp;
@@ -720,7 +720,7 @@ int implicit_init(Object *UNUSED(ob), ClothModifierData *clmd)
        verts = cloth->verts;
 
        // create implicit base
-       id = (Implicit_Data *)MEM_callocN (sizeof(Implicit_Data), "implicit vecmat");
+       id = (Implicit_Data *)MEM_callocN(sizeof(Implicit_Data), "implicit vecmat");
        cloth->implicit = id;
 
        /* process diagonal elements */