summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader
diff options
context:
space:
mode:
authorAndreaCatania <info@andreacatania.com>2017-08-01 14:30:58 +0200
committerAndreaCatania <info@andreacatania.com>2017-11-04 20:08:26 +0100
commited047261f06f814eeb88a1f6ee2dd8abd7a14034 (patch)
tree3addbdbfa8ca5068226a644a0dbbbee0ed691303 /thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader
parent3cbcf5c2ddadf1cd630137d6bd438634b8517b00 (diff)
Vendor thirdparty Bullet source for upcoming physics server backend
Diffstat (limited to 'thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader')
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt55
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/autogenerated/bullet2.h1053
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.cpp423
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.h83
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.cpp75
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.h92
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Common.h39
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.cpp629
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.h110
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Defines.h136
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp1739
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.h165
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.cpp908
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.h639
-rw-r--r--thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/premake4.lua12
15 files changed, 6158 insertions, 0 deletions
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt
new file mode 100644
index 0000000000..125576634f
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt
@@ -0,0 +1,55 @@
+
+INCLUDE_DIRECTORIES(
+ ${BULLET_PHYSICS_SOURCE_DIR}/src
+)
+
+SET(Bullet2FileLoader_SRCS
+ b3BulletFile.cpp
+ b3Chunk.cpp
+ b3DNA.cpp
+ b3File.cpp
+ b3Serializer.cpp
+)
+
+
+SET(Bullet2FileLoader_HDRS
+ b3BulletFile.h
+ b3Chunk.h
+ b3Common.h
+ b3Defines.h
+ b3DNA.h
+ b3File.h
+ b3Serializer.h
+ autogenerated/bullet2.h
+)
+
+ADD_LIBRARY(Bullet2FileLoader ${Bullet2FileLoader_SRCS} ${Bullet2FileLoader_HDRS})
+if (BUILD_SHARED_LIBS)
+ target_link_libraries(Bullet2FileLoader Bullet3Common)
+endif ()
+SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES VERSION ${BULLET_VERSION})
+SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES SOVERSION ${BULLET_VERSION})
+
+IF (INSTALL_LIBS)
+ IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
+ #FILES_MATCHING requires CMake 2.6
+ IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
+ IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ INSTALL(TARGETS Bullet2FileLoader DESTINATION .)
+ ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ INSTALL(TARGETS Bullet2FileLoader
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX})
+ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
+".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
+ ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
+
+ IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES FRAMEWORK true)
+ SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES PUBLIC_HEADER "${Bullet2FileLoader_HDRS}")
+ ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
+ ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
+ENDIF (INSTALL_LIBS)
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/autogenerated/bullet2.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/autogenerated/bullet2.h
new file mode 100644
index 0000000000..a6b57b1a12
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/autogenerated/bullet2.h
@@ -0,0 +1,1053 @@
+/* Copyright (C) 2011 Erwin Coumans & Charlie C
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+*
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+*
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+// Auto generated from Bullet/Extras/HeaderGenerator/bulletGenerate.py
+#ifndef __BULLET2_H__
+#define __BULLET2_H__
+namespace Bullet3SerializeBullet2 {
+
+// put an empty struct in the case
+typedef struct bInvalidHandle {
+ int unused;
+}bInvalidHandle;
+
+ class PointerArray;
+ class b3PhysicsSystem;
+ class ListBase;
+ class b3Vector3FloatData;
+ class b3Vector3DoubleData;
+ class b3Matrix3x3FloatData;
+ class b3Matrix3x3DoubleData;
+ class b3TransformFloatData;
+ class b3TransformDoubleData;
+ class b3BvhSubtreeInfoData;
+ class b3OptimizedBvhNodeFloatData;
+ class b3OptimizedBvhNodeDoubleData;
+ class b3QuantizedBvhNodeData;
+ class b3QuantizedBvhFloatData;
+ class b3QuantizedBvhDoubleData;
+ class b3CollisionShapeData;
+ class b3StaticPlaneShapeData;
+ class b3ConvexInternalShapeData;
+ class b3PositionAndRadius;
+ class b3MultiSphereShapeData;
+ class b3IntIndexData;
+ class b3ShortIntIndexData;
+ class b3ShortIntIndexTripletData;
+ class b3CharIndexTripletData;
+ class b3MeshPartData;
+ class b3StridingMeshInterfaceData;
+ class b3TriangleMeshShapeData;
+ class b3ScaledTriangleMeshShapeData;
+ class b3CompoundShapeChildData;
+ class b3CompoundShapeData;
+ class b3CylinderShapeData;
+ class b3CapsuleShapeData;
+ class b3TriangleInfoData;
+ class b3TriangleInfoMapData;
+ class b3GImpactMeshShapeData;
+ class b3ConvexHullShapeData;
+ class b3CollisionObjectDoubleData;
+ class b3CollisionObjectFloatData;
+ class b3DynamicsWorldDoubleData;
+ class b3DynamicsWorldFloatData;
+ class b3RigidBodyFloatData;
+ class b3RigidBodyDoubleData;
+ class b3ConstraintInfo1;
+ class b3TypedConstraintData;
+ class b3Point2PointConstraintFloatData;
+ class b3Point2PointConstraintDoubleData;
+ class b3HingeConstraintDoubleData;
+ class b3HingeConstraintFloatData;
+ class b3ConeTwistConstraintData;
+ class b3Generic6DofConstraintData;
+ class b3Generic6DofSpringConstraintData;
+ class b3SliderConstraintData;
+ class b3ContactSolverInfoDoubleData;
+ class b3ContactSolverInfoFloatData;
+ class SoftBodyMaterialData;
+ class SoftBodyNodeData;
+ class SoftBodyLinkData;
+ class SoftBodyFaceData;
+ class SoftBodyTetraData;
+ class SoftRigidAnchorData;
+ class SoftBodyConfigData;
+ class SoftBodyPoseData;
+ class SoftBodyClusterData;
+ class b3SoftBodyJointData;
+ class b3SoftBodyFloatData;
+// -------------------------------------------------- //
+ class PointerArray
+ {
+ public:
+ int m_size;
+ int m_capacity;
+ void *m_data;
+ };
+
+
+// -------------------------------------------------- //
+ class b3PhysicsSystem
+ {
+ public:
+ PointerArray m_collisionShapes;
+ PointerArray m_collisionObjects;
+ PointerArray m_constraints;
+ };
+
+
+// -------------------------------------------------- //
+ class ListBase
+ {
+ public:
+ void *first;
+ void *last;
+ };
+
+
+// -------------------------------------------------- //
+ class b3Vector3FloatData
+ {
+ public:
+ float m_floats[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3Vector3DoubleData
+ {
+ public:
+ double m_floats[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3Matrix3x3FloatData
+ {
+ public:
+ b3Vector3FloatData m_el[3];
+ };
+
+
+// -------------------------------------------------- //
+ class b3Matrix3x3DoubleData
+ {
+ public:
+ b3Vector3DoubleData m_el[3];
+ };
+
+
+// -------------------------------------------------- //
+ class b3TransformFloatData
+ {
+ public:
+ b3Matrix3x3FloatData m_basis;
+ b3Vector3FloatData m_origin;
+ };
+
+
+// -------------------------------------------------- //
+ class b3TransformDoubleData
+ {
+ public:
+ b3Matrix3x3DoubleData m_basis;
+ b3Vector3DoubleData m_origin;
+ };
+
+
+// -------------------------------------------------- //
+ class b3BvhSubtreeInfoData
+ {
+ public:
+ int m_rootNodeIndex;
+ int m_subtreeSize;
+ short m_quantizedAabbMin[3];
+ short m_quantizedAabbMax[3];
+ };
+
+
+// -------------------------------------------------- //
+ class b3OptimizedBvhNodeFloatData
+ {
+ public:
+ b3Vector3FloatData m_aabbMinOrg;
+ b3Vector3FloatData m_aabbMaxOrg;
+ int m_escapeIndex;
+ int m_subPart;
+ int m_triangleIndex;
+ char m_pad[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3OptimizedBvhNodeDoubleData
+ {
+ public:
+ b3Vector3DoubleData m_aabbMinOrg;
+ b3Vector3DoubleData m_aabbMaxOrg;
+ int m_escapeIndex;
+ int m_subPart;
+ int m_triangleIndex;
+ char m_pad[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3QuantizedBvhNodeData
+ {
+ public:
+ short m_quantizedAabbMin[3];
+ short m_quantizedAabbMax[3];
+ int m_escapeIndexOrTriangleIndex;
+ };
+
+
+// -------------------------------------------------- //
+ class b3QuantizedBvhFloatData
+ {
+ public:
+ b3Vector3FloatData m_bvhAabbMin;
+ b3Vector3FloatData m_bvhAabbMax;
+ b3Vector3FloatData m_bvhQuantization;
+ int m_curNodeIndex;
+ int m_useQuantization;
+ int m_numContiguousLeafNodes;
+ int m_numQuantizedContiguousNodes;
+ b3OptimizedBvhNodeFloatData *m_contiguousNodesPtr;
+ b3QuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
+ b3BvhSubtreeInfoData *m_subTreeInfoPtr;
+ int m_traversalMode;
+ int m_numSubtreeHeaders;
+ };
+
+
+// -------------------------------------------------- //
+ class b3QuantizedBvhDoubleData
+ {
+ public:
+ b3Vector3DoubleData m_bvhAabbMin;
+ b3Vector3DoubleData m_bvhAabbMax;
+ b3Vector3DoubleData m_bvhQuantization;
+ int m_curNodeIndex;
+ int m_useQuantization;
+ int m_numContiguousLeafNodes;
+ int m_numQuantizedContiguousNodes;
+ b3OptimizedBvhNodeDoubleData *m_contiguousNodesPtr;
+ b3QuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
+ int m_traversalMode;
+ int m_numSubtreeHeaders;
+ b3BvhSubtreeInfoData *m_subTreeInfoPtr;
+ };
+
+
+// -------------------------------------------------- //
+ class b3CollisionShapeData
+ {
+ public:
+ char *m_name;
+ int m_shapeType;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3StaticPlaneShapeData
+ {
+ public:
+ b3CollisionShapeData m_collisionShapeData;
+ b3Vector3FloatData m_localScaling;
+ b3Vector3FloatData m_planeNormal;
+ float m_planeConstant;
+ char m_pad[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3ConvexInternalShapeData
+ {
+ public:
+ b3CollisionShapeData m_collisionShapeData;
+ b3Vector3FloatData m_localScaling;
+ b3Vector3FloatData m_implicitShapeDimensions;
+ float m_collisionMargin;
+ int m_padding;
+ };
+
+
+// -------------------------------------------------- //
+ class b3PositionAndRadius
+ {
+ public:
+ b3Vector3FloatData m_pos;
+ float m_radius;
+ };
+
+
+// -------------------------------------------------- //
+ class b3MultiSphereShapeData
+ {
+ public:
+ b3ConvexInternalShapeData m_convexInternalShapeData;
+ b3PositionAndRadius *m_localPositionArrayPtr;
+ int m_localPositionArraySize;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3IntIndexData
+ {
+ public:
+ int m_value;
+ };
+
+
+// -------------------------------------------------- //
+ class b3ShortIntIndexData
+ {
+ public:
+ short m_value;
+ char m_pad[2];
+ };
+
+
+// -------------------------------------------------- //
+ class b3ShortIntIndexTripletData
+ {
+ public:
+ short m_values[3];
+ char m_pad[2];
+ };
+
+
+// -------------------------------------------------- //
+ class b3CharIndexTripletData
+ {
+ public:
+ char m_values[3];
+ char m_pad;
+ };
+
+
+// -------------------------------------------------- //
+ class b3MeshPartData
+ {
+ public:
+ b3Vector3FloatData *m_vertices3f;
+ b3Vector3DoubleData *m_vertices3d;
+ b3IntIndexData *m_indices32;
+ b3ShortIntIndexTripletData *m_3indices16;
+ b3CharIndexTripletData *m_3indices8;
+ b3ShortIntIndexData *m_indices16;
+ int m_numTriangles;
+ int m_numVertices;
+ };
+
+
+// -------------------------------------------------- //
+ class b3StridingMeshInterfaceData
+ {
+ public:
+ b3MeshPartData *m_meshPartsPtr;
+ b3Vector3FloatData m_scaling;
+ int m_numMeshParts;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3TriangleMeshShapeData
+ {
+ public:
+ b3CollisionShapeData m_collisionShapeData;
+ b3StridingMeshInterfaceData m_meshInterface;
+ b3QuantizedBvhFloatData *m_quantizedFloatBvh;
+ b3QuantizedBvhDoubleData *m_quantizedDoubleBvh;
+ b3TriangleInfoMapData *m_triangleInfoMap;
+ float m_collisionMargin;
+ char m_pad3[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3ScaledTriangleMeshShapeData
+ {
+ public:
+ b3TriangleMeshShapeData m_trimeshShapeData;
+ b3Vector3FloatData m_localScaling;
+ };
+
+
+// -------------------------------------------------- //
+ class b3CompoundShapeChildData
+ {
+ public:
+ b3TransformFloatData m_transform;
+ b3CollisionShapeData *m_childShape;
+ int m_childShapeType;
+ float m_childMargin;
+ };
+
+
+// -------------------------------------------------- //
+ class b3CompoundShapeData
+ {
+ public:
+ b3CollisionShapeData m_collisionShapeData;
+ b3CompoundShapeChildData *m_childShapePtr;
+ int m_numChildShapes;
+ float m_collisionMargin;
+ };
+
+
+// -------------------------------------------------- //
+ class b3CylinderShapeData
+ {
+ public:
+ b3ConvexInternalShapeData m_convexInternalShapeData;
+ int m_upAxis;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3CapsuleShapeData
+ {
+ public:
+ b3ConvexInternalShapeData m_convexInternalShapeData;
+ int m_upAxis;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3TriangleInfoData
+ {
+ public:
+ int m_flags;
+ float m_edgeV0V1Angle;
+ float m_edgeV1V2Angle;
+ float m_edgeV2V0Angle;
+ };
+
+
+// -------------------------------------------------- //
+ class b3TriangleInfoMapData
+ {
+ public:
+ int *m_hashTablePtr;
+ int *m_nextPtr;
+ b3TriangleInfoData *m_valueArrayPtr;
+ int *m_keyArrayPtr;
+ float m_convexEpsilon;
+ float m_planarEpsilon;
+ float m_equalVertexThreshold;
+ float m_edgeDistanceThreshold;
+ float m_zeroAreaThreshold;
+ int m_nextSize;
+ int m_hashTableSize;
+ int m_numValues;
+ int m_numKeys;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3GImpactMeshShapeData
+ {
+ public:
+ b3CollisionShapeData m_collisionShapeData;
+ b3StridingMeshInterfaceData m_meshInterface;
+ b3Vector3FloatData m_localScaling;
+ float m_collisionMargin;
+ int m_gimpactSubType;
+ };
+
+
+// -------------------------------------------------- //
+ class b3ConvexHullShapeData
+ {
+ public:
+ b3ConvexInternalShapeData m_convexInternalShapeData;
+ b3Vector3FloatData *m_unscaledPointsFloatPtr;
+ b3Vector3DoubleData *m_unscaledPointsDoublePtr;
+ int m_numUnscaledPoints;
+ char m_padding3[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3CollisionObjectDoubleData
+ {
+ public:
+ void *m_broadphaseHandle;
+ void *m_collisionShape;
+ b3CollisionShapeData *m_rootCollisionShape;
+ char *m_name;
+ b3TransformDoubleData m_worldTransform;
+ b3TransformDoubleData m_interpolationWorldTransform;
+ b3Vector3DoubleData m_interpolationLinearVelocity;
+ b3Vector3DoubleData m_interpolationAngularVelocity;
+ b3Vector3DoubleData m_anisotropicFriction;
+ double m_contactProcessingThreshold;
+ double m_deactivationTime;
+ double m_friction;
+ double m_rollingFriction;
+ double m_restitution;
+ double m_hitFraction;
+ double m_ccdSweptSphereRadius;
+ double m_ccdMotionThreshold;
+ int m_hasAnisotropicFriction;
+ int m_collisionFlags;
+ int m_islandTag1;
+ int m_companionId;
+ int m_activationState1;
+ int m_internalType;
+ int m_checkCollideWith;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3CollisionObjectFloatData
+ {
+ public:
+ void *m_broadphaseHandle;
+ void *m_collisionShape;
+ b3CollisionShapeData *m_rootCollisionShape;
+ char *m_name;
+ b3TransformFloatData m_worldTransform;
+ b3TransformFloatData m_interpolationWorldTransform;
+ b3Vector3FloatData m_interpolationLinearVelocity;
+ b3Vector3FloatData m_interpolationAngularVelocity;
+ b3Vector3FloatData m_anisotropicFriction;
+ float m_contactProcessingThreshold;
+ float m_deactivationTime;
+ float m_friction;
+ float m_rollingFriction;
+ float m_restitution;
+ float m_hitFraction;
+ float m_ccdSweptSphereRadius;
+ float m_ccdMotionThreshold;
+ int m_hasAnisotropicFriction;
+ int m_collisionFlags;
+ int m_islandTag1;
+ int m_companionId;
+ int m_activationState1;
+ int m_internalType;
+ int m_checkCollideWith;
+ char m_padding[4];
+ };
+
+
+
+// -------------------------------------------------- //
+ class b3RigidBodyFloatData
+ {
+ public:
+ b3CollisionObjectFloatData m_collisionObjectData;
+ b3Matrix3x3FloatData m_invInertiaTensorWorld;
+ b3Vector3FloatData m_linearVelocity;
+ b3Vector3FloatData m_angularVelocity;
+ b3Vector3FloatData m_angularFactor;
+ b3Vector3FloatData m_linearFactor;
+ b3Vector3FloatData m_gravity;
+ b3Vector3FloatData m_gravity_acceleration;
+ b3Vector3FloatData m_invInertiaLocal;
+ b3Vector3FloatData m_totalForce;
+ b3Vector3FloatData m_totalTorque;
+ float m_inverseMass;
+ float m_linearDamping;
+ float m_angularDamping;
+ float m_additionalDampingFactor;
+ float m_additionalLinearDampingThresholdSqr;
+ float m_additionalAngularDampingThresholdSqr;
+ float m_additionalAngularDampingFactor;
+ float m_linearSleepingThreshold;
+ float m_angularSleepingThreshold;
+ int m_additionalDamping;
+ };
+
+
+// -------------------------------------------------- //
+ class b3RigidBodyDoubleData
+ {
+ public:
+ b3CollisionObjectDoubleData m_collisionObjectData;
+ b3Matrix3x3DoubleData m_invInertiaTensorWorld;
+ b3Vector3DoubleData m_linearVelocity;
+ b3Vector3DoubleData m_angularVelocity;
+ b3Vector3DoubleData m_angularFactor;
+ b3Vector3DoubleData m_linearFactor;
+ b3Vector3DoubleData m_gravity;
+ b3Vector3DoubleData m_gravity_acceleration;
+ b3Vector3DoubleData m_invInertiaLocal;
+ b3Vector3DoubleData m_totalForce;
+ b3Vector3DoubleData m_totalTorque;
+ double m_inverseMass;
+ double m_linearDamping;
+ double m_angularDamping;
+ double m_additionalDampingFactor;
+ double m_additionalLinearDampingThresholdSqr;
+ double m_additionalAngularDampingThresholdSqr;
+ double m_additionalAngularDampingFactor;
+ double m_linearSleepingThreshold;
+ double m_angularSleepingThreshold;
+ int m_additionalDamping;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3ConstraintInfo1
+ {
+ public:
+ int m_numConstraintRows;
+ int nub;
+ };
+
+
+// -------------------------------------------------- //
+ class b3TypedConstraintData
+ {
+ public:
+ bInvalidHandle *m_rbA;
+ bInvalidHandle *m_rbB;
+ char *m_name;
+ int m_objectType;
+ int m_userConstraintType;
+ int m_userConstraintId;
+ int m_needsFeedback;
+ float m_appliedImpulse;
+ float m_dbgDrawSize;
+ int m_disableCollisionsBetweenLinkedBodies;
+ int m_overrideNumSolverIterations;
+ float m_breakingImpulseThreshold;
+ int m_isEnabled;
+ };
+
+
+// -------------------------------------------------- //
+ class b3Point2PointConstraintFloatData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3Vector3FloatData m_pivotInA;
+ b3Vector3FloatData m_pivotInB;
+ };
+
+
+// -------------------------------------------------- //
+ class b3Point2PointConstraintDoubleData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3Vector3DoubleData m_pivotInA;
+ b3Vector3DoubleData m_pivotInB;
+ };
+
+
+// -------------------------------------------------- //
+ class b3HingeConstraintDoubleData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3TransformDoubleData m_rbAFrame;
+ b3TransformDoubleData m_rbBFrame;
+ int m_useReferenceFrameA;
+ int m_angularOnly;
+ int m_enableAngularMotor;
+ float m_motorTargetVelocity;
+ float m_maxMotorImpulse;
+ float m_lowerLimit;
+ float m_upperLimit;
+ float m_limitSoftness;
+ float m_biasFactor;
+ float m_relaxationFactor;
+ };
+
+
+// -------------------------------------------------- //
+ class b3HingeConstraintFloatData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3TransformFloatData m_rbAFrame;
+ b3TransformFloatData m_rbBFrame;
+ int m_useReferenceFrameA;
+ int m_angularOnly;
+ int m_enableAngularMotor;
+ float m_motorTargetVelocity;
+ float m_maxMotorImpulse;
+ float m_lowerLimit;
+ float m_upperLimit;
+ float m_limitSoftness;
+ float m_biasFactor;
+ float m_relaxationFactor;
+ };
+
+
+// -------------------------------------------------- //
+ class b3ConeTwistConstraintData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3TransformFloatData m_rbAFrame;
+ b3TransformFloatData m_rbBFrame;
+ float m_swingSpan1;
+ float m_swingSpan2;
+ float m_twistSpan;
+ float m_limitSoftness;
+ float m_biasFactor;
+ float m_relaxationFactor;
+ float m_damping;
+ char m_pad[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3Generic6DofConstraintData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3TransformFloatData m_rbAFrame;
+ b3TransformFloatData m_rbBFrame;
+ b3Vector3FloatData m_linearUpperLimit;
+ b3Vector3FloatData m_linearLowerLimit;
+ b3Vector3FloatData m_angularUpperLimit;
+ b3Vector3FloatData m_angularLowerLimit;
+ int m_useLinearReferenceFrameA;
+ int m_useOffsetForConstraintFrame;
+ };
+
+
+// -------------------------------------------------- //
+ class b3Generic6DofSpringConstraintData
+ {
+ public:
+ b3Generic6DofConstraintData m_6dofData;
+ int m_springEnabled[6];
+ float m_equilibriumPoint[6];
+ float m_springStiffness[6];
+ float m_springDamping[6];
+ };
+
+
+// -------------------------------------------------- //
+ class b3SliderConstraintData
+ {
+ public:
+ b3TypedConstraintData m_typeConstraintData;
+ b3TransformFloatData m_rbAFrame;
+ b3TransformFloatData m_rbBFrame;
+ float m_linearUpperLimit;
+ float m_linearLowerLimit;
+ float m_angularUpperLimit;
+ float m_angularLowerLimit;
+ int m_useLinearReferenceFrameA;
+ int m_useOffsetForConstraintFrame;
+ };
+
+
+// -------------------------------------------------- //
+ class b3ContactSolverInfoDoubleData
+ {
+ public:
+ double m_tau;
+ double m_damping;
+ double m_friction;
+ double m_timeStep;
+ double m_restitution;
+ double m_maxErrorReduction;
+ double m_sor;
+ double m_erp;
+ double m_erp2;
+ double m_globalCfm;
+ double m_splitImpulsePenetrationThreshold;
+ double m_splitImpulseTurnErp;
+ double m_linearSlop;
+ double m_warmstartingFactor;
+ double m_maxGyroscopicForce;
+ double m_singleAxisRollingFrictionThreshold;
+ int m_numIterations;
+ int m_solverMode;
+ int m_restingContactRestitutionThreshold;
+ int m_minimumSolverBatchSize;
+ int m_splitImpulse;
+ char m_padding[4];
+ };
+
+
+// -------------------------------------------------- //
+ class b3ContactSolverInfoFloatData
+ {
+ public:
+ float m_tau;
+ float m_damping;
+ float m_friction;
+ float m_timeStep;
+ float m_restitution;
+ float m_maxErrorReduction;
+ float m_sor;
+ float m_erp;
+ float m_erp2;
+ float m_globalCfm;
+ float m_splitImpulsePenetrationThreshold;
+ float m_splitImpulseTurnErp;
+ float m_linearSlop;
+ float m_warmstartingFactor;
+ float m_maxGyroscopicForce;
+ float m_singleAxisRollingFrictionThreshold;
+ int m_numIterations;
+ int m_solverMode;
+ int m_restingContactRestitutionThreshold;
+ int m_minimumSolverBatchSize;
+ int m_splitImpulse;
+ char m_padding[4];
+ };
+
+
+ // -------------------------------------------------- //
+ class b3DynamicsWorldDoubleData
+ {
+ public:
+ b3ContactSolverInfoDoubleData m_solverInfo;
+ b3Vector3DoubleData m_gravity;
+ };
+
+
+// -------------------------------------------------- //
+ class b3DynamicsWorldFloatData
+ {
+ public:
+ b3ContactSolverInfoFloatData m_solverInfo;
+ b3Vector3FloatData m_gravity;
+ };
+
+
+
+// -------------------------------------------------- //
+ class SoftBodyMaterialData
+ {
+ public:
+ float m_linearStiffness;
+ float m_angularStiffness;
+ float m_volumeStiffness;
+ int m_flags;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyNodeData
+ {
+ public:
+ SoftBodyMaterialData *m_material;
+ b3Vector3FloatData m_position;
+ b3Vector3FloatData m_previousPosition;
+ b3Vector3FloatData m_velocity;
+ b3Vector3FloatData m_accumulatedForce;
+ b3Vector3FloatData m_normal;
+ float m_inverseMass;
+ float m_area;
+ int m_attach;
+ int m_pad;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyLinkData
+ {
+ public:
+ SoftBodyMaterialData *m_material;
+ int m_nodeIndices[2];
+ float m_restLength;
+ int m_bbending;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyFaceData
+ {
+ public:
+ b3Vector3FloatData m_normal;
+ SoftBodyMaterialData *m_material;
+ int m_nodeIndices[3];
+ float m_restArea;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyTetraData
+ {
+ public:
+ b3Vector3FloatData m_c0[4];
+ SoftBodyMaterialData *m_material;
+ int m_nodeIndices[4];
+ float m_restVolume;
+ float m_c1;
+ float m_c2;
+ int m_pad;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftRigidAnchorData
+ {
+ public:
+ b3Matrix3x3FloatData m_c0;
+ b3Vector3FloatData m_c1;
+ b3Vector3FloatData m_localFrame;
+ bInvalidHandle *m_rigidBody;
+ int m_nodeIndex;
+ float m_c2;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyConfigData
+ {
+ public:
+ int m_aeroModel;
+ float m_baumgarte;
+ float m_damping;
+ float m_drag;
+ float m_lift;
+ float m_pressure;
+ float m_volume;
+ float m_dynamicFriction;
+ float m_poseMatch;
+ float m_rigidContactHardness;
+ float m_kineticContactHardness;
+ float m_softContactHardness;
+ float m_anchorHardness;
+ float m_softRigidClusterHardness;
+ float m_softKineticClusterHardness;
+ float m_softSoftClusterHardness;
+ float m_softRigidClusterImpulseSplit;
+ float m_softKineticClusterImpulseSplit;
+ float m_softSoftClusterImpulseSplit;
+ float m_maxVolume;
+ float m_timeScale;
+ int m_velocityIterations;
+ int m_positionIterations;
+ int m_driftIterations;
+ int m_clusterIterations;
+ int m_collisionFlags;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyPoseData
+ {
+ public:
+ b3Matrix3x3FloatData m_rot;
+ b3Matrix3x3FloatData m_scale;
+ b3Matrix3x3FloatData m_aqq;
+ b3Vector3FloatData m_com;
+ b3Vector3FloatData *m_positions;
+ float *m_weights;
+ int m_numPositions;
+ int m_numWeigts;
+ int m_bvolume;
+ int m_bframe;
+ float m_restVolume;
+ int m_pad;
+ };
+
+
+// -------------------------------------------------- //
+ class SoftBodyClusterData
+ {
+ public:
+ b3TransformFloatData m_framexform;
+ b3Matrix3x3FloatData m_locii;
+ b3Matrix3x3FloatData m_invwi;
+ b3Vector3FloatData m_com;
+ b3Vector3FloatData m_vimpulses[2];
+ b3Vector3FloatData m_dimpulses[2];
+ b3Vector3FloatData m_lv;
+ b3Vector3FloatData m_av;
+ b3Vector3FloatData *m_framerefs;
+ int *m_nodeIndices;
+ float *m_masses;
+ int m_numFrameRefs;
+ int m_numNodes;
+ int m_numMasses;
+ float m_idmass;
+ float m_imass;
+ int m_nvimpulses;
+ int m_ndimpulses;
+ float m_ndamping;
+ float m_ldamping;
+ float m_adamping;
+ float m_matching;
+ float m_maxSelfCollisionImpulse;
+ float m_selfCollisionImpulseFactor;
+ int m_containsAnchor;
+ int m_collide;
+ int m_clusterIndex;
+ };
+
+
+// -------------------------------------------------- //
+ class b3SoftBodyJointData
+ {
+ public:
+ void *m_bodyA;
+ void *m_bodyB;
+ b3Vector3FloatData m_refs[2];
+ float m_cfm;
+ float m_erp;
+ float m_split;
+ int m_delete;
+ b3Vector3FloatData m_relPosition[2];
+ int m_bodyAtype;
+ int m_bodyBtype;
+ int m_jointType;
+ int m_pad;
+ };
+
+
+// -------------------------------------------------- //
+ class b3SoftBodyFloatData
+ {
+ public:
+ b3CollisionObjectFloatData m_collisionObjectData;
+ SoftBodyPoseData *m_pose;
+ SoftBodyMaterialData **m_materials;
+ SoftBodyNodeData *m_nodes;
+ SoftBodyLinkData *m_links;
+ SoftBodyFaceData *m_faces;
+ SoftBodyTetraData *m_tetrahedra;
+ SoftRigidAnchorData *m_anchors;
+ SoftBodyClusterData *m_clusters;
+ b3SoftBodyJointData *m_joints;
+ int m_numMaterials;
+ int m_numNodes;
+ int m_numLinks;
+ int m_numFaces;
+ int m_numTetrahedra;
+ int m_numAnchors;
+ int m_numClusters;
+ int m_numJoints;
+ SoftBodyConfigData m_config;
+ };
+
+
+}
+#endif//__BULLET2_H__ \ No newline at end of file
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.cpp b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.cpp
new file mode 100644
index 0000000000..c3ceb8388c
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.cpp
@@ -0,0 +1,423 @@
+/*
+bParse
+Copyright (c) 2006-2010 Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "b3BulletFile.h"
+#include "b3Defines.h"
+#include "b3DNA.h"
+
+#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
+#include <memory.h>
+#endif
+#include <string.h>
+
+
+// 32 && 64 bit versions
+#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+#ifdef _WIN64
+extern char b3s_bulletDNAstr64[];
+extern int b3s_bulletDNAlen64;
+#else
+extern char b3s_bulletDNAstr[];
+extern int b3s_bulletDNAlen;
+#endif //_WIN64
+#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+
+extern char b3s_bulletDNAstr64[];
+extern int b3s_bulletDNAlen64;
+extern char b3s_bulletDNAstr[];
+extern int b3s_bulletDNAlen;
+
+#endif //B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+
+using namespace bParse;
+
+b3BulletFile::b3BulletFile()
+:bFile("", "BULLET ")
+{
+ mMemoryDNA = new bDNA(); //this memory gets released in the bFile::~bFile destructor,@todo not consistent with the rule 'who allocates it, has to deallocate it"
+
+ m_DnaCopy = 0;
+
+
+#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+#ifdef _WIN64
+ m_DnaCopy = (char*)b3AlignedAlloc(b3s_bulletDNAlen64,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+ mMemoryDNA->init(m_DnaCopy,b3s_bulletDNAlen64);
+#else//_WIN64
+ m_DnaCopy = (char*)b3AlignedAlloc(b3s_bulletDNAlen,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr,b3s_bulletDNAlen);
+ mMemoryDNA->init(m_DnaCopy,b3s_bulletDNAlen);
+#endif//_WIN64
+#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+ m_DnaCopy = (char*) b3AlignedAlloc(b3s_bulletDNAlen64,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+ mMemoryDNA->init(m_DnaCopy,b3s_bulletDNAlen64);
+ }
+ else
+ {
+ m_DnaCopy =(char*) b3AlignedAlloc(b3s_bulletDNAlen,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr,b3s_bulletDNAlen);
+ mMemoryDNA->init(m_DnaCopy,b3s_bulletDNAlen);
+ }
+#endif//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+}
+
+
+
+b3BulletFile::b3BulletFile(const char* fileName)
+:bFile(fileName, "BULLET ")
+{
+ m_DnaCopy = 0;
+}
+
+
+
+b3BulletFile::b3BulletFile(char *memoryBuffer, int len)
+:bFile(memoryBuffer,len, "BULLET ")
+{
+ m_DnaCopy = 0;
+}
+
+
+b3BulletFile::~b3BulletFile()
+{
+ if (m_DnaCopy)
+ b3AlignedFree(m_DnaCopy);
+
+
+ while (m_dataBlocks.size())
+ {
+ char* dataBlock = m_dataBlocks[m_dataBlocks.size()-1];
+ delete[] dataBlock;
+ m_dataBlocks.pop_back();
+ }
+
+}
+
+
+
+// ----------------------------------------------------- //
+void b3BulletFile::parseData()
+{
+// printf ("Building datablocks");
+// printf ("Chunk size = %d",CHUNK_HEADER_LEN);
+// printf ("File chunk size = %d",ChunkUtils::getOffset(mFlags));
+
+ const bool brokenDNA = (mFlags&FD_BROKEN_DNA)!=0;
+
+ //const bool swap = (mFlags&FD_ENDIAN_SWAP)!=0;
+
+
+ mDataStart = 12;
+
+ char *dataPtr = mFileBuffer+mDataStart;
+
+ bChunkInd dataChunk;
+ dataChunk.code = 0;
+
+
+ //dataPtr += ChunkUtils::getNextBlock(&dataChunk, dataPtr, mFlags);
+ int seek = getNextBlock(&dataChunk, dataPtr, mFlags);
+
+
+ if (mFlags &FD_ENDIAN_SWAP)
+ swapLen(dataPtr);
+
+ //dataPtr += ChunkUtils::getOffset(mFlags);
+ char *dataPtrHead = 0;
+
+ while (dataChunk.code != B3_DNA1)
+ {
+ if (!brokenDNA || (dataChunk.code != B3_QUANTIZED_BVH_CODE) )
+ {
+
+ // one behind
+ if (dataChunk.code == B3_SDNA) break;
+ //if (dataChunk.code == DNA1) break;
+
+ // same as (BHEAD+DATA dependency)
+ dataPtrHead = dataPtr+ChunkUtils::getOffset(mFlags);
+ if (dataChunk.dna_nr>=0)
+ {
+ char *id = readStruct(dataPtrHead, dataChunk);
+
+ // lookup maps
+ if (id)
+ {
+ m_chunkPtrPtrMap.insert(dataChunk.oldPtr, dataChunk);
+ mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)id);
+
+ m_chunks.push_back(dataChunk);
+ // block it
+ //bListBasePtr *listID = mMain->getListBasePtr(dataChunk.code);
+ //if (listID)
+ // listID->push_back((bStructHandle*)id);
+ }
+
+ if (dataChunk.code == B3_SOFTBODY_CODE)
+ {
+ m_softBodies.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_RIGIDBODY_CODE)
+ {
+ m_rigidBodies.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_DYNAMICSWORLD_CODE)
+ {
+ m_dynamicsWorldInfo.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_CONSTRAINT_CODE)
+ {
+ m_constraints.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_QUANTIZED_BVH_CODE)
+ {
+ m_bvhs.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_TRIANLGE_INFO_MAP)
+ {
+ m_triangleInfoMaps.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_COLLISIONOBJECT_CODE)
+ {
+ m_collisionObjects.push_back((bStructHandle*) id);
+ }
+
+ if (dataChunk.code == B3_SHAPE_CODE)
+ {
+ m_collisionShapes.push_back((bStructHandle*) id);
+ }
+
+ // if (dataChunk.code == GLOB)
+ // {
+ // m_glob = (bStructHandle*) id;
+ // }
+ } else
+ {
+ //printf("unknown chunk\n");
+
+ mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)dataPtrHead);
+ }
+ } else
+ {
+ printf("skipping B3_QUANTIZED_BVH_CODE due to broken DNA\n");
+ }
+
+
+ dataPtr += seek;
+
+ seek = getNextBlock(&dataChunk, dataPtr, mFlags);
+ if (mFlags &FD_ENDIAN_SWAP)
+ swapLen(dataPtr);
+
+ if (seek < 0)
+ break;
+ }
+
+}
+
+void b3BulletFile::addDataBlock(char* dataBlock)
+{
+ m_dataBlocks.push_back(dataBlock);
+
+}
+
+
+
+
+void b3BulletFile::writeDNA(FILE* fp)
+{
+
+ bChunkInd dataChunk;
+ dataChunk.code = B3_DNA1;
+ dataChunk.dna_nr = 0;
+ dataChunk.nr = 1;
+#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+#ifdef _WIN64
+ dataChunk.len = b3s_bulletDNAlen64;
+ dataChunk.oldPtr = b3s_bulletDNAstr64;
+ fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
+ fwrite(b3s_bulletDNAstr64, b3s_bulletDNAlen64,1,fp);
+#else
+ b3Assert(0);
+#endif
+ }
+ else
+ {
+#ifndef _WIN64
+ dataChunk.len = b3s_bulletDNAlen;
+ dataChunk.oldPtr = b3s_bulletDNAstr;
+ fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
+ fwrite(b3s_bulletDNAstr, b3s_bulletDNAlen,1,fp);
+#else//_WIN64
+ b3Assert(0);
+#endif//_WIN64
+ }
+#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+ dataChunk.len = b3s_bulletDNAlen64;
+ dataChunk.oldPtr = b3s_bulletDNAstr64;
+ fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
+ fwrite(b3s_bulletDNAstr64, b3s_bulletDNAlen64,1,fp);
+ }
+ else
+ {
+ dataChunk.len = b3s_bulletDNAlen;
+ dataChunk.oldPtr = b3s_bulletDNAstr;
+ fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
+ fwrite(b3s_bulletDNAstr, b3s_bulletDNAlen,1,fp);
+ }
+#endif//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+}
+
+
+void b3BulletFile::parse(int verboseMode)
+{
+#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+#ifdef _WIN64
+
+ if (m_DnaCopy)
+ delete m_DnaCopy;
+ m_DnaCopy = (char*)b3AlignedAlloc(b3s_bulletDNAlen64,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+ parseInternal(verboseMode,(char*)b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+#else
+ b3Assert(0);
+#endif
+ }
+ else
+ {
+#ifndef _WIN64
+
+ if (m_DnaCopy)
+ delete m_DnaCopy;
+ m_DnaCopy = (char*)b3AlignedAlloc(b3s_bulletDNAlen,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr,b3s_bulletDNAlen);
+ parseInternal(verboseMode,m_DnaCopy,b3s_bulletDNAlen);
+#else
+ b3Assert(0);
+#endif
+ }
+#else//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+ if (m_DnaCopy)
+ delete m_DnaCopy;
+ m_DnaCopy = (char*)b3AlignedAlloc(b3s_bulletDNAlen64,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+ parseInternal(verboseMode,m_DnaCopy,b3s_bulletDNAlen64);
+ }
+ else
+ {
+ if (m_DnaCopy)
+ delete m_DnaCopy;
+ m_DnaCopy = (char*)b3AlignedAlloc(b3s_bulletDNAlen,16);
+ memcpy(m_DnaCopy,b3s_bulletDNAstr,b3s_bulletDNAlen);
+ parseInternal(verboseMode,m_DnaCopy,b3s_bulletDNAlen);
+ }
+#endif//B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+
+ //the parsing will convert to cpu endian
+ mFlags &=~FD_ENDIAN_SWAP;
+
+ int littleEndian= 1;
+ littleEndian= ((char*)&littleEndian)[0];
+
+ mFileBuffer[8] = littleEndian?'v':'V';
+
+}
+
+// experimental
+int b3BulletFile::write(const char* fileName, bool fixupPointers)
+{
+ FILE *fp = fopen(fileName, "wb");
+ if (fp)
+ {
+ char header[B3_SIZEOFBLENDERHEADER] ;
+ memcpy(header, m_headerString, 7);
+ int endian= 1;
+ endian= ((char*)&endian)[0];
+
+ if (endian)
+ {
+ header[7] = '_';
+ } else
+ {
+ header[7] = '-';
+ }
+ if (VOID_IS_8)
+ {
+ header[8]='V';
+ } else
+ {
+ header[8]='v';
+ }
+
+ header[9] = '2';
+ header[10] = '7';
+ header[11] = '5';
+
+ fwrite(header,B3_SIZEOFBLENDERHEADER,1,fp);
+
+ writeChunks(fp, fixupPointers);
+
+ writeDNA(fp);
+
+ fclose(fp);
+
+ } else
+ {
+ printf("Error: cannot open file %s for writing\n",fileName);
+ return 0;
+ }
+ return 1;
+}
+
+
+
+void b3BulletFile::addStruct(const char* structType,void* data, int len, void* oldPtr, int code)
+{
+
+ bParse::bChunkInd dataChunk;
+ dataChunk.code = code;
+ dataChunk.nr = 1;
+ dataChunk.len = len;
+ dataChunk.dna_nr = mMemoryDNA->getReverseType(structType);
+ dataChunk.oldPtr = oldPtr;
+
+ ///Perform structure size validation
+ short* structInfo= mMemoryDNA->getStruct(dataChunk.dna_nr);
+ int elemBytes;
+ elemBytes= mMemoryDNA->getLength(structInfo[0]);
+// int elemBytes = mMemoryDNA->getElementSize(structInfo[0],structInfo[1]);
+ assert(len==elemBytes);
+
+ mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)data);
+ m_chunks.push_back(dataChunk);
+}
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.h
new file mode 100644
index 0000000000..fb1b9b0dde
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3BulletFile.h
@@ -0,0 +1,83 @@
+/*
+bParse
+Copyright (c) 2006-2010 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef B3_BULLET_FILE_H
+#define B3_BULLET_FILE_H
+
+
+#include "b3File.h"
+#include "Bullet3Common/b3AlignedObjectArray.h"
+#include "b3Defines.h"
+
+#include "Bullet3Serialize/Bullet2FileLoader/b3Serializer.h"
+
+
+
+namespace bParse {
+
+ // ----------------------------------------------------- //
+ class b3BulletFile : public bFile
+ {
+
+
+ protected:
+
+ char* m_DnaCopy;
+
+ public:
+
+ b3AlignedObjectArray<bStructHandle*> m_softBodies;
+
+ b3AlignedObjectArray<bStructHandle*> m_rigidBodies;
+
+ b3AlignedObjectArray<bStructHandle*> m_collisionObjects;
+
+ b3AlignedObjectArray<bStructHandle*> m_collisionShapes;
+
+ b3AlignedObjectArray<bStructHandle*> m_constraints;
+
+ b3AlignedObjectArray<bStructHandle*> m_bvhs;
+
+ b3AlignedObjectArray<bStructHandle*> m_triangleInfoMaps;
+
+ b3AlignedObjectArray<bStructHandle*> m_dynamicsWorldInfo;
+
+ b3AlignedObjectArray<char*> m_dataBlocks;
+ b3BulletFile();
+
+ b3BulletFile(const char* fileName);
+
+ b3BulletFile(char *memoryBuffer, int len);
+
+ virtual ~b3BulletFile();
+
+ virtual void addDataBlock(char* dataBlock);
+
+
+ // experimental
+ virtual int write(const char* fileName, bool fixupPointers=false);
+
+ virtual void parse(int verboseMode);
+
+ virtual void parseData();
+
+ virtual void writeDNA(FILE* fp);
+
+ void addStruct(const char* structType,void* data, int len, void* oldPtr, int code);
+
+ };
+};
+
+#endif //B3_BULLET_FILE_H
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.cpp b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.cpp
new file mode 100644
index 0000000000..c0e1bb708c
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.cpp
@@ -0,0 +1,75 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "b3Chunk.h"
+#include "b3Defines.h"
+#include "b3File.h"
+
+#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
+#include <memory.h>
+#endif
+#include <string.h>
+
+
+using namespace bParse;
+
+
+// ----------------------------------------------------- //
+short ChunkUtils::swapShort(short sht)
+{
+ B3_SWITCH_SHORT(sht);
+ return sht;
+}
+
+// ----------------------------------------------------- //
+int ChunkUtils::swapInt(int inte)
+{
+ B3_SWITCH_INT(inte);
+ return inte;
+}
+
+// ----------------------------------------------------- //
+b3Long64 ChunkUtils::swapLong64(b3Long64 lng)
+{
+ B3_SWITCH_LONGINT(lng);
+ return lng;
+}
+
+// ----------------------------------------------------- //
+int ChunkUtils::getOffset(int flags)
+{
+ // if the file is saved in a
+ // different format, get the
+ // file's chunk size
+ int res = CHUNK_HEADER_LEN;
+
+ if (VOID_IS_8)
+ {
+ if (flags &FD_BITS_VARIES)
+ res = sizeof(bChunkPtr4);
+ }
+ else
+ {
+ if (flags &FD_BITS_VARIES)
+ res = sizeof(bChunkPtr8);
+ }
+ return res;
+}
+
+
+
+
+
+//eof
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.h
new file mode 100644
index 0000000000..03ecb6b4fa
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Chunk.h
@@ -0,0 +1,92 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef __BCHUNK_H__
+#define __BCHUNK_H__
+
+#if defined (_WIN32) && ! defined (__MINGW32__)
+ #define b3Long64 __int64
+#elif defined (__MINGW32__)
+ #include <stdint.h>
+ #define b3Long64 int64_t
+#else
+ #define b3Long64 long long
+#endif
+
+
+namespace bParse {
+
+
+ // ----------------------------------------------------- //
+ class bChunkPtr4
+ {
+ public:
+ bChunkPtr4(){}
+ int code;
+ int len;
+ union
+ {
+ int m_uniqueInt;
+ };
+ int dna_nr;
+ int nr;
+ };
+
+ // ----------------------------------------------------- //
+ class bChunkPtr8
+ {
+ public:
+ bChunkPtr8(){}
+ int code, len;
+ union
+ {
+ b3Long64 oldPrev;
+ int m_uniqueInts[2];
+ };
+ int dna_nr, nr;
+ };
+
+ // ----------------------------------------------------- //
+ class bChunkInd
+ {
+ public:
+ bChunkInd(){}
+ int code, len;
+ void *oldPtr;
+ int dna_nr, nr;
+ };
+
+
+ // ----------------------------------------------------- //
+ class ChunkUtils
+ {
+ public:
+
+ // file chunk offset
+ static int getOffset(int flags);
+
+ // endian utils
+ static short swapShort(short sht);
+ static int swapInt(int inte);
+ static b3Long64 swapLong64(b3Long64 lng);
+
+ };
+
+
+ const int CHUNK_HEADER_LEN = ((sizeof(bChunkInd)));
+ const bool VOID_IS_8 = ((sizeof(void*)==8));
+}
+
+#endif//__BCHUNK_H__
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Common.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Common.h
new file mode 100644
index 0000000000..2792d84033
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Common.h
@@ -0,0 +1,39 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef __BCOMMON_H__
+#define __BCOMMON_H__
+
+
+#include <assert.h>
+//#include "bLog.h"
+#include "Bullet3Common/b3AlignedObjectArray.h"
+#include "Bullet3Common/b3HashMap.h"
+
+namespace bParse {
+
+ class bMain;
+ class bFileData;
+ class bFile;
+ class bDNA;
+
+ // delete void* undefined
+ typedef struct bStructHandle {int unused;}bStructHandle;
+ typedef b3AlignedObjectArray<bStructHandle*> bListBasePtr;
+ typedef b3HashMap<b3HashPtr, bStructHandle*> bPtrMap;
+}
+
+
+#endif//__BCOMMON_H__
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.cpp b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.cpp
new file mode 100644
index 0000000000..0fe5056922
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.cpp
@@ -0,0 +1,629 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#include <assert.h>
+
+#include "b3DNA.h"
+#include "b3Chunk.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+//this define will force traversal of structures, to check backward (and forward) compatibility
+//#define TEST_BACKWARD_FORWARD_COMPATIBILITY
+
+
+using namespace bParse;
+
+
+// ----------------------------------------------------- //
+bDNA::bDNA()
+ : mPtrLen(0)
+{
+ // --
+}
+
+// ----------------------------------------------------- //
+bDNA::~bDNA()
+{
+ // --
+}
+
+// ----------------------------------------------------- //
+bool bDNA::lessThan(bDNA *file)
+{
+ return ( m_Names.size() < file->m_Names.size());
+}
+
+// ----------------------------------------------------- //
+char *bDNA::getName(int ind)
+{
+ assert(ind <= (int)m_Names.size());
+ return m_Names[ind].m_name;
+}
+
+
+// ----------------------------------------------------- //
+char *bDNA::getType(int ind)
+{
+ assert(ind<= (int)mTypes.size());
+ return mTypes[ind];
+}
+
+
+// ----------------------------------------------------- //
+short *bDNA::getStruct(int ind)
+{
+ assert(ind <= (int)mStructs.size());
+ return mStructs[ind];
+}
+
+
+// ----------------------------------------------------- //
+short bDNA::getLength(int ind)
+{
+ assert(ind <= (int)mTlens.size());
+ return mTlens[ind];
+}
+
+
+// ----------------------------------------------------- //
+int bDNA::getReverseType(short type)
+{
+
+ int* intPtr = mStructReverse.find(type);
+ if (intPtr)
+ return *intPtr;
+
+ return -1;
+}
+
+// ----------------------------------------------------- //
+int bDNA::getReverseType(const char *type)
+{
+
+ b3HashString key(type);
+ int* valuePtr = mTypeLookup.find(key);
+ if (valuePtr)
+ return *valuePtr;
+
+ return -1;
+}
+
+// ----------------------------------------------------- //
+int bDNA::getNumStructs()
+{
+ return (int)mStructs.size();
+}
+
+// ----------------------------------------------------- //
+bool bDNA::flagNotEqual(int dna_nr)
+{
+ assert(dna_nr <= (int)mCMPFlags.size());
+ return mCMPFlags[dna_nr] == FDF_STRUCT_NEQU;
+}
+
+// ----------------------------------------------------- //
+bool bDNA::flagEqual(int dna_nr)
+{
+ assert(dna_nr <= (int)mCMPFlags.size());
+ int flag = mCMPFlags[dna_nr];
+ return flag == FDF_STRUCT_EQU;
+}
+
+// ----------------------------------------------------- //
+bool bDNA::flagNone(int dna_nr)
+{
+ assert(dna_nr <= (int)mCMPFlags.size());
+ return mCMPFlags[dna_nr] == FDF_NONE;
+}
+
+// ----------------------------------------------------- //
+int bDNA::getPointerSize()
+{
+ return mPtrLen;
+}
+
+// ----------------------------------------------------- //
+void bDNA::initRecurseCmpFlags(int iter)
+{
+ // iter is FDF_STRUCT_NEQU
+
+ short *oldStrc = mStructs[iter];
+ short type = oldStrc[0];
+
+ for (int i=0; i<(int)mStructs.size(); i++)
+ {
+ if (i != iter && mCMPFlags[i] == FDF_STRUCT_EQU )
+ {
+ short *curStruct = mStructs[i];
+ int eleLen = curStruct[1];
+ curStruct+=2;
+
+ for (int j=0; j<eleLen; j++, curStruct+=2)
+ {
+ if (curStruct[0] == type)
+ {
+ //char *name = m_Names[curStruct[1]].m_name;
+ //if (name[0] != '*')
+ if (m_Names[curStruct[1]].m_isPointer)
+ {
+ mCMPFlags[i] = FDF_STRUCT_NEQU;
+ initRecurseCmpFlags(i);
+ }
+ }
+ }
+ }
+ }
+}
+
+// ----------------------------------------------------- //
+void bDNA::initCmpFlags(bDNA *memDNA)
+{
+
+ // compare the file to memory
+ // this ptr should be the file data
+
+
+ assert(!(m_Names.size() == 0));// && "SDNA empty!");
+ mCMPFlags.resize(mStructs.size(), FDF_NONE);
+
+
+
+ int i;
+ for ( i=0; i<(int)mStructs.size(); i++)
+ {
+ short *oldStruct = mStructs[i];
+
+ int oldLookup = getReverseType(oldStruct[0]);
+ if (oldLookup == -1)
+ {
+ mCMPFlags[i] = FDF_NONE;
+ continue;
+ }
+ //char* typeName = mTypes[oldStruct[0]];
+
+//#define SLOW_FORWARD_COMPATIBLE 1
+#ifdef SLOW_FORWARD_COMPATIBLE
+ char* typeName = mTypes[oldLookup];
+ int newLookup = memDNA->getReverseType(typeName);
+ if (newLookup == -1)
+ {
+ mCMPFlags[i] = FDF_NONE;
+ continue;
+ }
+ short *curStruct = memDNA->mStructs[newLookup];
+#else
+ // memory for file
+
+ if (oldLookup < memDNA->mStructs.size())
+ {
+ short *curStruct = memDNA->mStructs[oldLookup];
+#endif
+
+
+
+ // rebuild...
+ mCMPFlags[i] = FDF_STRUCT_NEQU;
+
+#ifndef TEST_BACKWARD_FORWARD_COMPATIBILITY
+
+ if (curStruct[1] == oldStruct[1])
+ {
+ // type len same ...
+ if (mTlens[oldStruct[0]] == memDNA->mTlens[curStruct[0]])
+ {
+ bool isSame = true;
+ int elementLength = oldStruct[1];
+
+
+ curStruct+=2;
+ oldStruct+=2;
+
+
+ for (int j=0; j<elementLength; j++, curStruct+=2, oldStruct+=2)
+ {
+ // type the same
+ //const char* typeFileDNA = mTypes[oldStruct[0]];
+ //const char* typeMemDNA = mTypes[curStruct[0]];
+ if (strcmp(mTypes[oldStruct[0]], memDNA->mTypes[curStruct[0]])!=0)
+ {
+ isSame=false;
+ break;
+ }
+
+ // name the same
+ if (strcmp(m_Names[oldStruct[1]].m_name, memDNA->m_Names[curStruct[1]].m_name)!=0)
+ {
+ isSame=false;
+ break;
+ }
+ }
+ // flag valid ==
+ if (isSame)
+ mCMPFlags[i] = FDF_STRUCT_EQU;
+ }
+ }
+#endif
+ }
+ }
+
+
+
+
+
+ // recurse in
+ for ( i=0; i<(int)mStructs.size(); i++)
+ {
+ if (mCMPFlags[i] == FDF_STRUCT_NEQU)
+ initRecurseCmpFlags(i);
+ }
+}
+
+
+
+
+static int name_is_array(char* name, int* dim1, int* dim2) {
+ int len = strlen(name);
+ /*fprintf(stderr,"[%s]",name);*/
+ /*if (len >= 1) {
+ if (name[len-1] != ']')
+ return 1;
+ }
+ return 0;*/
+ char *bp;
+ int num;
+ if (dim1) {
+ *dim1 = 1;
+ }
+ if (dim2) {
+ *dim2 = 1;
+ }
+ bp = strchr(name, '[');
+ if (!bp) {
+ return 0;
+ }
+ num = 0;
+ while (++bp < name+len-1) {
+ const char c = *bp;
+ if (c == ']') {
+ break;
+ }
+ if (c <= '9' && c >= '0') {
+ num *= 10;
+ num += (c - '0');
+ } else {
+ printf("array parse error.\n");
+ return 0;
+ }
+ }
+ if (dim2) {
+ *dim2 = num;
+ }
+
+ /* find second dim, if any. */
+ bp = strchr(bp, '[');
+ if (!bp) {
+ return 1; /* at least we got the first dim. */
+ }
+ num = 0;
+ while (++bp < name+len-1) {
+ const char c = *bp;
+ if (c == ']') {
+ break;
+ }
+ if (c <= '9' && c >= '0') {
+ num *= 10;
+ num += (c - '0');
+ } else {
+ printf("array2 parse error.\n");
+ return 1;
+ }
+ }
+ if (dim1) {
+ if (dim2) {
+ *dim1 = *dim2;
+ *dim2 = num;
+ } else {
+ *dim1 = num;
+ }
+ }
+
+ return 1;
+}
+
+
+// ----------------------------------------------------- //
+void bDNA::init(char *data, int len, bool swap)
+{
+ int *intPtr=0;short *shtPtr=0;
+ char *cp = 0;int dataLen =0;
+ //long nr=0;
+ intPtr = (int*)data;
+
+ /*
+ SDNA (4 bytes) (magic number)
+ NAME (4 bytes)
+ <nr> (4 bytes) amount of names (int)
+ <string>
+ <string>
+ */
+
+ if (strncmp(data, "SDNA", 4)==0)
+ {
+ // skip ++ NAME
+ intPtr++; intPtr++;
+ }
+
+
+
+ // Parse names
+ if (swap)
+ {
+ *intPtr = ChunkUtils::swapInt(*intPtr);
+ }
+ dataLen = *intPtr;
+ intPtr++;
+
+ cp = (char*)intPtr;
+ int i;
+ for ( i=0; i<dataLen; i++)
+ {
+ bNameInfo info;
+ info.m_name = cp;
+ info.m_isPointer = (info.m_name[0] == '*') || (info.m_name[1] == '*');
+ name_is_array(info.m_name,&info.m_dim0,&info.m_dim1);
+ m_Names.push_back(info);
+ while (*cp)cp++;
+ cp++;
+ }
+
+
+ cp = b3AlignPointer(cp,4);
+
+
+ /*
+ TYPE (4 bytes)
+ <nr> amount of types (int)
+ <string>
+ <string>
+ */
+
+ intPtr = (int*)cp;
+ assert(strncmp(cp, "TYPE", 4)==0); intPtr++;
+
+ if (swap)
+ {
+ *intPtr = ChunkUtils::swapInt(*intPtr);
+ }
+ dataLen = *intPtr;
+ intPtr++;
+
+ cp = (char*)intPtr;
+ for ( i=0; i<dataLen; i++)
+ {
+ mTypes.push_back(cp);
+ while (*cp)cp++;
+ cp++;
+ }
+
+
+ cp = b3AlignPointer(cp,4);
+
+ /*
+ TLEN (4 bytes)
+ <len> (short) the lengths of types
+ <len>
+ */
+
+ // Parse type lens
+ intPtr = (int*)cp;
+ assert(strncmp(cp, "TLEN", 4)==0); intPtr++;
+
+ dataLen = (int)mTypes.size();
+
+ shtPtr = (short*)intPtr;
+ for ( i=0; i<dataLen; i++, shtPtr++)
+ {
+ if (swap)
+ shtPtr[0] = ChunkUtils::swapShort(shtPtr[0]);
+ mTlens.push_back(shtPtr[0]);
+ }
+
+ if (dataLen & 1) shtPtr++;
+
+ /*
+ STRC (4 bytes)
+ <nr> amount of structs (int)
+ <typenr>
+ <nr_of_elems>
+ <typenr>
+ <namenr>
+ <typenr>
+ <namenr>
+ */
+
+ intPtr = (int*)shtPtr;
+ cp = (char*)intPtr;
+ assert(strncmp(cp, "STRC", 4)==0); intPtr++;
+
+ if (swap)
+ {
+ *intPtr = ChunkUtils::swapInt(*intPtr);
+ }
+ dataLen = *intPtr;
+ intPtr++;
+
+
+ shtPtr = (short*)intPtr;
+ for ( i=0; i<dataLen; i++)
+ {
+ mStructs.push_back (shtPtr);
+ if (swap)
+ {
+ shtPtr[0]= ChunkUtils::swapShort(shtPtr[0]);
+ shtPtr[1]= ChunkUtils::swapShort(shtPtr[1]);
+
+ int len = shtPtr[1];
+ shtPtr+= 2;
+
+ for (int a=0; a<len; a++, shtPtr+=2)
+ {
+ shtPtr[0]= ChunkUtils::swapShort(shtPtr[0]);
+ shtPtr[1]= ChunkUtils::swapShort(shtPtr[1]);
+ }
+ }
+ else
+ shtPtr+= (2*shtPtr[1])+2;
+ }
+
+
+ // build reverse lookups
+ for ( i=0; i<(int)mStructs.size(); i++)
+ {
+ short *strc = mStructs.at(i);
+ if (!mPtrLen && strcmp(mTypes[strc[0]],"ListBase")==0)
+ {
+ mPtrLen = mTlens[strc[0]]/2;
+ }
+
+ mStructReverse.insert(strc[0], i);
+ mTypeLookup.insert(b3HashString(mTypes[strc[0]]),i);
+ }
+}
+
+
+// ----------------------------------------------------- //
+int bDNA::getArraySize(char* string)
+{
+ int ret = 1;
+ int len = strlen(string);
+
+
+ char* next = 0;
+ for (int i=0; i<len; i++)
+ {
+ char c = string[i];
+
+ if (c == '[')
+ next = &string[i+1];
+ else if (c==']')
+ if (next)
+ ret *= atoi(next);
+ }
+
+// print (string << ' ' << ret);
+ return ret;
+}
+
+
+void bDNA::dumpTypeDefinitions()
+{
+ int i;
+
+ int numTypes = mTypes.size();
+
+ for (i=0;i<numTypes;i++)
+ {
+
+ }
+
+ for ( i=0; i<(int)mStructs.size(); i++)
+ {
+ int totalBytes=0;
+ short *oldStruct = mStructs[i];
+
+ int oldLookup = getReverseType(oldStruct[0]);
+ if (oldLookup == -1)
+ {
+ mCMPFlags[i] = FDF_NONE;
+ continue;
+ }
+
+ short* newStruct = mStructs[oldLookup];
+ char* typeName = mTypes[newStruct[0]];
+ printf("%3d: %s ",i,typeName);
+
+ //char *name = mNames[oldStruct[1]];
+ int len = oldStruct[1];
+ printf(" (%d fields) ",len);
+ oldStruct+=2;
+
+ printf("{");
+ int j;
+ for (j=0; j<len; ++j,oldStruct+=2) {
+ const char* name = m_Names[oldStruct[1]].m_name;
+ printf("%s %s", mTypes[oldStruct[0]],name);
+ int elemNumBytes= 0;
+ int arrayDimensions = getArraySizeNew(oldStruct[1]);
+
+ if (m_Names[oldStruct[1]].m_isPointer)
+ {
+ elemNumBytes = VOID_IS_8 ? 8 : 4;
+ } else
+ {
+ elemNumBytes = getLength(oldStruct[0]);
+ }
+ printf(" /* %d bytes */",elemNumBytes*arrayDimensions);
+
+ if (j == len-1) {
+ printf(";}");
+ } else {
+ printf("; ");
+ }
+ totalBytes+=elemNumBytes*arrayDimensions;
+ }
+ printf("\ntotalBytes=%d\n\n",totalBytes);
+
+ }
+
+
+
+#if 0
+ /* dump out display of types and their sizes */
+ for (i=0; i<bf->types_count; ++i) {
+ /* if (!bf->types[i].is_struct)*/
+ {
+ printf("%3d: sizeof(%s%s)=%d",
+ i,
+ bf->types[i].is_struct ? "struct " : "atomic ",
+ bf->types[i].name, bf->types[i].size);
+ if (bf->types[i].is_struct) {
+ int j;
+ printf(", %d fields: { ", bf->types[i].fieldtypes_count);
+ for (j=0; j<bf->types[i].fieldtypes_count; ++j) {
+ printf("%s %s",
+ bf->types[bf->types[i].fieldtypes[j]].name,
+ bf->names[bf->types[i].fieldnames[j]]);
+ if (j == bf->types[i].fieldtypes_count-1) {
+ printf(";}");
+ } else {
+ printf("; ");
+ }
+ }
+ }
+ printf("\n\n");
+
+ }
+ }
+#endif
+
+}
+
+
+
+
+//eof
+
+
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.h
new file mode 100644
index 0000000000..6e60087cce
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3DNA.h
@@ -0,0 +1,110 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef __BDNA_H__
+#define __BDNA_H__
+
+
+#include "b3Common.h"
+
+namespace bParse {
+
+ struct bNameInfo
+ {
+ char* m_name;
+ bool m_isPointer;
+ int m_dim0;
+ int m_dim1;
+ };
+
+ class bDNA
+ {
+ public:
+ bDNA();
+ ~bDNA();
+
+ void init(char *data, int len, bool swap=false);
+
+ int getArraySize(char* str);
+ int getArraySizeNew(short name)
+ {
+ const bNameInfo& nameInfo = m_Names[name];
+ return nameInfo.m_dim0*nameInfo.m_dim1;
+ }
+ int getElementSize(short type, short name)
+ {
+ const bNameInfo& nameInfo = m_Names[name];
+ int size = nameInfo.m_isPointer ? mPtrLen*nameInfo.m_dim0*nameInfo.m_dim1 : mTlens[type]*nameInfo.m_dim0*nameInfo.m_dim1;
+ return size;
+ }
+
+ int getNumNames() const
+ {
+ return m_Names.size();
+ }
+
+ char *getName(int ind);
+ char *getType(int ind);
+ short *getStruct(int ind);
+ short getLength(int ind);
+ int getReverseType(short type);
+ int getReverseType(const char *type);
+
+
+ int getNumStructs();
+
+ //
+ bool lessThan(bDNA* other);
+
+ void initCmpFlags(bDNA *memDNA);
+ bool flagNotEqual(int dna_nr);
+ bool flagEqual(int dna_nr);
+ bool flagNone(int dna_nr);
+
+
+ int getPointerSize();
+
+ void dumpTypeDefinitions();
+
+
+ private:
+ enum FileDNAFlags
+ {
+ FDF_NONE=0,
+ FDF_STRUCT_NEQU,
+ FDF_STRUCT_EQU
+ };
+
+ void initRecurseCmpFlags(int i);
+
+ b3AlignedObjectArray<int> mCMPFlags;
+
+ b3AlignedObjectArray<bNameInfo> m_Names;
+ b3AlignedObjectArray<char*> mTypes;
+ b3AlignedObjectArray<short*> mStructs;
+ b3AlignedObjectArray<short> mTlens;
+ b3HashMap<b3HashInt, int> mStructReverse;
+ b3HashMap<b3HashString,int> mTypeLookup;
+
+ int mPtrLen;
+
+
+
+
+ };
+}
+
+
+#endif//__BDNA_H__
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Defines.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Defines.h
new file mode 100644
index 0000000000..8f28d3c441
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Defines.h
@@ -0,0 +1,136 @@
+/* Copyright (C) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+*
+* This software is provided 'as-is', without any express or implied
+* warranty. In no event will the authors be held liable for any damages
+* arising from the use of this software.
+*
+* Permission is granted to anyone to use this software for any purpose,
+* including commercial applications, and to alter it and redistribute it
+* freely, subject to the following restrictions:
+*
+* 1. The origin of this software must not be misrepresented; you must not
+* claim that you wrote the original software. If you use this software
+* in a product, an acknowledgment in the product documentation would be
+* appreciated but is not required.
+* 2. Altered source versions must be plainly marked as such, and must not be
+* misrepresented as being the original software.
+* 3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef __B_DEFINES_H__
+#define __B_DEFINES_H__
+
+
+// MISC defines, see BKE_global.h, BKE_utildefines.h
+#define B3_SIZEOFBLENDERHEADER 12
+
+
+// ------------------------------------------------------------
+#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
+# define B3_MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
+#else
+# define B3_MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
+#endif
+
+
+// ------------------------------------------------------------
+#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
+# define B3_MAKE_ID2(c, d) ( (c)<<8 | (d) )
+#else
+# define B3_MAKE_ID2(c, d) ( (d)<<8 | (c) )
+#endif
+
+// ------------------------------------------------------------
+#define B3_ID_SCE B3_MAKE_ID2('S', 'C')
+#define B3_ID_LI B3_MAKE_ID2('L', 'I')
+#define B3_ID_OB B3_MAKE_ID2('O', 'B')
+#define B3_ID_ME B3_MAKE_ID2('M', 'E')
+#define B3_ID_CU B3_MAKE_ID2('C', 'U')
+#define B3_ID_MB B3_MAKE_ID2('M', 'B')
+#define B3_ID_MA B3_MAKE_ID2('M', 'A')
+#define B3_ID_TE B3_MAKE_ID2('T', 'E')
+#define B3_ID_IM B3_MAKE_ID2('I', 'M')
+#define B3_ID_IK B3_MAKE_ID2('I', 'K')
+#define B3_ID_WV B3_MAKE_ID2('W', 'V')
+#define B3_ID_LT B3_MAKE_ID2('L', 'T')
+#define B3_ID_SE B3_MAKE_ID2('S', 'E')
+#define B3_ID_LF B3_MAKE_ID2('L', 'F')
+#define B3_ID_LA B3_MAKE_ID2('L', 'A')
+#define B3_ID_CA B3_MAKE_ID2('C', 'A')
+#define B3_ID_IP B3_MAKE_ID2('I', 'P')
+#define B3_ID_KE B3_MAKE_ID2('K', 'E')
+#define B3_ID_WO B3_MAKE_ID2('W', 'O')
+#define B3_ID_SCR B3_MAKE_ID2('S', 'R')
+#define B3_ID_VF B3_MAKE_ID2('V', 'F')
+#define B3_ID_TXT B3_MAKE_ID2('T', 'X')
+#define B3_ID_SO B3_MAKE_ID2('S', 'O')
+#define B3_ID_SAMPLE B3_MAKE_ID2('S', 'A')
+#define B3_ID_GR B3_MAKE_ID2('G', 'R')
+#define B3_ID_ID B3_MAKE_ID2('I', 'D')
+#define B3_ID_AR B3_MAKE_ID2('A', 'R')
+#define B3_ID_AC B3_MAKE_ID2('A', 'C')
+#define B3_ID_SCRIPT B3_MAKE_ID2('P', 'Y')
+#define B3_ID_FLUIDSIM B3_MAKE_ID2('F', 'S')
+#define B3_ID_NT B3_MAKE_ID2('N', 'T')
+#define B3_ID_BR B3_MAKE_ID2('B', 'R')
+
+
+#define B3_ID_SEQ B3_MAKE_ID2('S', 'Q')
+#define B3_ID_CO B3_MAKE_ID2('C', 'O')
+#define B3_ID_PO B3_MAKE_ID2('A', 'C')
+#define B3_ID_NLA B3_MAKE_ID2('N', 'L')
+
+#define B3_ID_VS B3_MAKE_ID2('V', 'S')
+#define B3_ID_VN B3_MAKE_ID2('V', 'N')
+
+
+// ------------------------------------------------------------
+#define B3_FORM B3_MAKE_ID('F','O','R','M')
+#define B3_DDG1 B3_MAKE_ID('3','D','G','1')
+#define B3_DDG2 B3_MAKE_ID('3','D','G','2')
+#define B3_DDG3 B3_MAKE_ID('3','D','G','3')
+#define B3_DDG4 B3_MAKE_ID('3','D','G','4')
+#define B3_GOUR B3_MAKE_ID('G','O','U','R')
+#define B3_BLEN B3_MAKE_ID('B','L','E','N')
+#define B3_DER_ B3_MAKE_ID('D','E','R','_')
+#define B3_V100 B3_MAKE_ID('V','1','0','0')
+#define B3_DATA B3_MAKE_ID('D','A','T','A')
+#define B3_GLOB B3_MAKE_ID('G','L','O','B')
+#define B3_IMAG B3_MAKE_ID('I','M','A','G')
+#define B3_TEST B3_MAKE_ID('T','E','S','T')
+#define B3_USER B3_MAKE_ID('U','S','E','R')
+
+
+// ------------------------------------------------------------
+#define B3_DNA1 B3_MAKE_ID('D','N','A','1')
+#define B3_REND B3_MAKE_ID('R','E','N','D')
+#define B3_ENDB B3_MAKE_ID('E','N','D','B')
+#define B3_NAME B3_MAKE_ID('N','A','M','E')
+#define B3_SDNA B3_MAKE_ID('S','D','N','A')
+#define B3_TYPE B3_MAKE_ID('T','Y','P','E')
+#define B3_TLEN B3_MAKE_ID('T','L','E','N')
+#define B3_STRC B3_MAKE_ID('S','T','R','C')
+
+
+// ------------------------------------------------------------
+#define B3_SWITCH_INT(a) { \
+ char s_i, *p_i; \
+ p_i= (char *)&(a); \
+ s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
+ s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
+
+// ------------------------------------------------------------
+#define B3_SWITCH_SHORT(a) { \
+ char s_i, *p_i; \
+ p_i= (char *)&(a); \
+ s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; }
+
+// ------------------------------------------------------------
+#define B3_SWITCH_LONGINT(a) { \
+ char s_i, *p_i; \
+ p_i= (char *)&(a); \
+ s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
+ s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
+ s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
+ s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
+
+#endif//__B_DEFINES_H__
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp
new file mode 100644
index 0000000000..432f7fc2b4
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp
@@ -0,0 +1,1739 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#include "b3File.h"
+#include "b3Common.h"
+#include "b3Chunk.h"
+#include "b3DNA.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+#include "b3Defines.h"
+#include "Bullet3Serialize/Bullet2FileLoader/b3Serializer.h"
+#include "Bullet3Common/b3AlignedAllocator.h"
+#include "Bullet3Common/b3MinMax.h"
+
+#define B3_SIZEOFBLENDERHEADER 12
+#define MAX_ARRAY_LENGTH 512
+using namespace bParse;
+#define MAX_STRLEN 1024
+
+const char* getCleanName(const char* memName, char* buffer)
+{
+ int slen = strlen(memName);
+ assert(slen<MAX_STRLEN);
+ slen=b3Min(slen,MAX_STRLEN);
+ for (int i=0;i<slen;i++)
+ {
+ if (memName[i]==']'||memName[i]=='[')
+ {
+ buffer[i] = 0;//'_';
+ } else
+ {
+ buffer[i] = memName[i];
+ }
+ }
+ buffer[slen]=0;
+ return buffer;
+}
+
+
+
+// ----------------------------------------------------- //
+bFile::bFile(const char *filename, const char headerString[7])
+ : mOwnsBuffer(true),
+ mFileBuffer(0),
+ mFileLen(0),
+ mVersion(0),
+ mDataStart(0),
+ mFileDNA(0),
+ mMemoryDNA(0),
+ mFlags(FD_INVALID)
+{
+ for (int i=0;i<7;i++)
+ {
+ m_headerString[i] = headerString[i];
+ }
+
+ FILE *fp = fopen(filename, "rb");
+ if (fp)
+ {
+ fseek(fp, 0L, SEEK_END);
+ mFileLen = ftell(fp);
+ fseek(fp, 0L, SEEK_SET);
+
+ mFileBuffer = (char*)malloc(mFileLen+1);
+ int bytesRead;
+ bytesRead = fread(mFileBuffer, mFileLen, 1, fp);
+
+ fclose(fp);
+
+ //
+ parseHeader();
+
+ }
+}
+
+// ----------------------------------------------------- //
+bFile::bFile( char *memoryBuffer, int len, const char headerString[7])
+: mOwnsBuffer(false),
+ mFileBuffer(0),
+ mFileLen(0),
+ mVersion(0),
+ mDataStart(0),
+ mFileDNA(0),
+ mMemoryDNA(0),
+ mFlags(FD_INVALID)
+{
+ for (int i=0;i<7;i++)
+ {
+ m_headerString[i] = headerString[i];
+ }
+ mFileBuffer = memoryBuffer;
+ mFileLen = len;
+
+ parseHeader();
+
+}
+
+
+// ----------------------------------------------------- //
+bFile::~bFile()
+{
+ if (mOwnsBuffer && mFileBuffer)
+ {
+ free(mFileBuffer);
+ mFileBuffer = 0;
+ }
+
+
+ delete mMemoryDNA;
+ delete mFileDNA;
+}
+
+
+
+
+
+// ----------------------------------------------------- //
+void bFile::parseHeader()
+{
+ if (!mFileLen || !mFileBuffer)
+ return;
+
+ char *blenderBuf = mFileBuffer;
+ char header[B3_SIZEOFBLENDERHEADER+1] ;
+ memcpy(header, blenderBuf, B3_SIZEOFBLENDERHEADER);
+ header[B3_SIZEOFBLENDERHEADER]='\0';
+
+ if (strncmp(header, m_headerString, 6)!=0)
+ {
+ memcpy(header, m_headerString, B3_SIZEOFBLENDERHEADER);
+ return;
+ }
+
+ if (header[6] == 'd')
+ {
+ mFlags |= FD_DOUBLE_PRECISION;
+ }
+
+ char *ver = header+9;
+ mVersion = atoi(ver);
+ if (mVersion <= 241)
+ {
+ //printf("Warning, %d not fully tested : <= 242\n", mVersion);
+ }
+
+ int littleEndian= 1;
+ littleEndian= ((char*)&littleEndian)[0];
+
+ // swap ptr sizes...
+ if (header[7]=='-')
+ {
+ mFlags |= FD_FILE_64;
+ if (!VOID_IS_8)
+ mFlags |= FD_BITS_VARIES;
+ }
+ else if (VOID_IS_8) mFlags |= FD_BITS_VARIES;
+
+ // swap endian...
+ if (header[8]=='V')
+ {
+ if (littleEndian ==1)
+ mFlags |= FD_ENDIAN_SWAP;
+ }
+ else
+ if (littleEndian==0)
+ mFlags |= FD_ENDIAN_SWAP;
+
+
+ mFlags |= FD_OK;
+}
+
+// ----------------------------------------------------- //
+bool bFile::ok()
+{
+ return (mFlags &FD_OK)!=0;
+}
+
+// ----------------------------------------------------- //
+void bFile::parseInternal(int verboseMode, char* memDna,int memDnaLength)
+{
+ if ( (mFlags &FD_OK) ==0)
+ return;
+
+ char *blenderData = mFileBuffer;
+ bChunkInd dna;
+ dna.oldPtr = 0;
+
+ char *tempBuffer = blenderData;
+ for (int i=0; i<mFileLen; i++)
+ {
+ // looking for the data's starting position
+ // and the start of SDNA decls
+
+ if (!mDataStart && strncmp(tempBuffer, "REND", 4)==0)
+ mDataStart = i;
+
+ if (strncmp(tempBuffer, "DNA1", 4)==0)
+ {
+ // read the DNA1 block and extract SDNA
+ if (getNextBlock(&dna, tempBuffer, mFlags) > 0)
+ {
+ if (strncmp((tempBuffer + ChunkUtils::getOffset(mFlags)), "SDNANAME", 8) ==0)
+ dna.oldPtr = (tempBuffer + ChunkUtils::getOffset(mFlags));
+ else dna.oldPtr = 0;
+ }
+ else dna.oldPtr = 0;
+ }
+ // Some Bullet files are missing the DNA1 block
+ // In Blender it's DNA1 + ChunkUtils::getOffset() + SDNA + NAME
+ // In Bullet tests its SDNA + NAME
+ else if (strncmp(tempBuffer, "SDNANAME", 8) ==0)
+ {
+ dna.oldPtr = blenderData + i;
+ dna.len = mFileLen-i;
+
+ // Also no REND block, so exit now.
+ if (mVersion==276) break;
+ }
+
+ if (mDataStart && dna.oldPtr) break;
+ tempBuffer++;
+ }
+ if (!dna.oldPtr || !dna.len)
+ {
+ //printf("Failed to find DNA1+SDNA pair\n");
+ mFlags &= ~FD_OK;
+ return;
+ }
+
+
+ mFileDNA = new bDNA();
+
+
+ ///mFileDNA->init will convert part of DNA file endianness to current CPU endianness if necessary
+ mFileDNA->init((char*)dna.oldPtr, dna.len, (mFlags & FD_ENDIAN_SWAP)!=0);
+
+
+ if (mVersion==276)
+ {
+ int i;
+ for (i=0;i<mFileDNA->getNumNames();i++)
+ {
+ if (strcmp(mFileDNA->getName(i),"int")==0)
+ {
+ mFlags |= FD_BROKEN_DNA;
+ }
+ }
+ if ((mFlags&FD_BROKEN_DNA)!=0)
+ {
+ //printf("warning: fixing some broken DNA version\n");
+ }
+ }
+
+
+
+ if (verboseMode & FD_VERBOSE_DUMP_DNA_TYPE_DEFINITIONS)
+ mFileDNA->dumpTypeDefinitions();
+
+ mMemoryDNA = new bDNA();
+ int littleEndian= 1;
+ littleEndian= ((char*)&littleEndian)[0];
+
+ mMemoryDNA->init(memDna,memDnaLength,littleEndian==0);
+
+
+
+
+ ///@todo we need a better version check, add version/sub version info from FileGlobal into memory DNA/header files
+ if (mMemoryDNA->getNumNames() != mFileDNA->getNumNames())
+ {
+ mFlags |= FD_VERSION_VARIES;
+ //printf ("Warning, file DNA is different than built in, performance is reduced. Best to re-export file with a matching version/platform");
+ }
+
+ // as long as it kept up to date it will be ok!!
+ if (mMemoryDNA->lessThan(mFileDNA))
+ {
+ //printf ("Warning, file DNA is newer than built in.");
+ }
+
+
+ mFileDNA->initCmpFlags(mMemoryDNA);
+
+ parseData();
+
+ resolvePointers(verboseMode);
+
+ updateOldPointers();
+
+
+}
+
+
+
+// ----------------------------------------------------- //
+void bFile::swap(char *head, bChunkInd& dataChunk, bool ignoreEndianFlag)
+{
+ char *data = head;
+ short *strc = mFileDNA->getStruct(dataChunk.dna_nr);
+
+
+
+ const char s[] = "SoftBodyMaterialData";
+ int szs = sizeof(s);
+ if (strncmp((char*)&dataChunk.code,"ARAY",4)==0)
+ {
+ short *oldStruct = mFileDNA->getStruct(dataChunk.dna_nr);
+ char *oldType = mFileDNA->getType(oldStruct[0]);
+ if (strncmp(oldType,s,szs)==0)
+ {
+ return;
+ }
+ }
+
+
+ int len = mFileDNA->getLength(strc[0]);
+
+ for (int i=0; i<dataChunk.nr; i++)
+ {
+ swapStruct(dataChunk.dna_nr, data,ignoreEndianFlag);
+ data+=len;
+ }
+}
+
+void bFile::swapLen(char *dataPtr)
+{
+ const bool VOID_IS_8 = ((sizeof(void*)==8));
+ if (VOID_IS_8)
+ {
+ if (mFlags &FD_BITS_VARIES)
+ {
+ bChunkPtr4*c = (bChunkPtr4*) dataPtr;
+ if ((c->code & 0xFFFF)==0)
+ c->code >>=16;
+ B3_SWITCH_INT(c->len);
+ B3_SWITCH_INT(c->dna_nr);
+ B3_SWITCH_INT(c->nr);
+ } else
+ {
+ bChunkPtr8* c = (bChunkPtr8*) dataPtr;
+ if ((c->code & 0xFFFF)==0)
+ c->code >>=16;
+ B3_SWITCH_INT(c->len);
+ B3_SWITCH_INT(c->dna_nr);
+ B3_SWITCH_INT(c->nr);
+
+ }
+ } else
+ {
+ if (mFlags &FD_BITS_VARIES)
+ {
+ bChunkPtr8*c = (bChunkPtr8*) dataPtr;
+ if ((c->code & 0xFFFF)==0)
+ c->code >>=16;
+ B3_SWITCH_INT(c->len);
+ B3_SWITCH_INT(c->dna_nr);
+ B3_SWITCH_INT(c->nr);
+
+ } else
+ {
+ bChunkPtr4* c = (bChunkPtr4*) dataPtr;
+ if ((c->code & 0xFFFF)==0)
+ c->code >>=16;
+ B3_SWITCH_INT(c->len);
+
+ B3_SWITCH_INT(c->dna_nr);
+ B3_SWITCH_INT(c->nr);
+
+ }
+ }
+
+}
+
+
+void bFile::swapDNA(char* ptr)
+{
+ bool swap = ((mFlags & FD_ENDIAN_SWAP)!=0);
+
+ char* data = &ptr[20];
+// void bDNA::init(char *data, int len, bool swap)
+ int *intPtr=0;short *shtPtr=0;
+ char *cp = 0;int dataLen =0;
+ //long nr=0;
+ intPtr = (int*)data;
+
+ /*
+ SDNA (4 bytes) (magic number)
+ NAME (4 bytes)
+ <nr> (4 bytes) amount of names (int)
+ <string>
+ <string>
+ */
+
+ if (strncmp(data, "SDNA", 4)==0)
+ {
+ // skip ++ NAME
+ intPtr++; intPtr++;
+ }
+
+
+
+ // Parse names
+ if (swap)
+ dataLen = ChunkUtils::swapInt(*intPtr);
+ else
+ dataLen = *intPtr;
+
+ *intPtr = ChunkUtils::swapInt(*intPtr);
+ intPtr++;
+
+ cp = (char*)intPtr;
+ int i;
+ for ( i=0; i<dataLen; i++)
+ {
+ while (*cp)cp++;
+ cp++;
+ }
+
+
+ cp = b3AlignPointer(cp,4);
+
+ /*
+ TYPE (4 bytes)
+ <nr> amount of types (int)
+ <string>
+ <string>
+ */
+
+ intPtr = (int*)cp;
+ assert(strncmp(cp, "TYPE", 4)==0); intPtr++;
+
+ if (swap)
+ dataLen = ChunkUtils::swapInt(*intPtr);
+ else
+ dataLen = *intPtr;
+
+ *intPtr = ChunkUtils::swapInt(*intPtr);
+
+ intPtr++;
+
+ cp = (char*)intPtr;
+ for ( i=0; i<dataLen; i++)
+ {
+ while (*cp)cp++;
+ cp++;
+ }
+
+ cp = b3AlignPointer(cp,4);
+
+ /*
+ TLEN (4 bytes)
+ <len> (short) the lengths of types
+ <len>
+ */
+
+ // Parse type lens
+ intPtr = (int*)cp;
+ assert(strncmp(cp, "TLEN", 4)==0); intPtr++;
+
+
+ shtPtr = (short*)intPtr;
+ for ( i=0; i<dataLen; i++, shtPtr++)
+ {
+ //??????if (swap)
+ shtPtr[0] = ChunkUtils::swapShort(shtPtr[0]);
+ }
+
+ if (dataLen & 1)
+ shtPtr++;
+
+ /*
+ STRC (4 bytes)
+ <nr> amount of structs (int)
+ <typenr>
+ <nr_of_elems>
+ <typenr>
+ <namenr>
+ <typenr>
+ <namenr>
+ */
+
+ intPtr = (int*)shtPtr;
+ cp = (char*)intPtr;
+ assert(strncmp(cp, "STRC", 4)==0);
+ intPtr++;
+
+ if (swap)
+ dataLen = ChunkUtils::swapInt(*intPtr);
+ else
+ dataLen = *intPtr;
+
+ *intPtr = ChunkUtils::swapInt(*intPtr);
+
+ intPtr++;
+
+
+ shtPtr = (short*)intPtr;
+ for ( i=0; i<dataLen; i++)
+ {
+
+ //if (swap)
+ {
+ int len = shtPtr[1];
+
+ shtPtr[0]= ChunkUtils::swapShort(shtPtr[0]);
+ shtPtr[1]= ChunkUtils::swapShort(shtPtr[1]);
+
+ shtPtr+= 2;
+
+ for (int a=0; a<len; a++, shtPtr+=2)
+ {
+ shtPtr[0]= ChunkUtils::swapShort(shtPtr[0]);
+ shtPtr[1]= ChunkUtils::swapShort(shtPtr[1]);
+ }
+ }
+// else
+// shtPtr+= (2*shtPtr[1])+2;
+ }
+
+}
+
+void bFile::writeFile(const char* fileName)
+{
+ FILE* f = fopen(fileName,"wb");
+ fwrite(mFileBuffer,1,mFileLen,f);
+ fclose(f);
+}
+
+void bFile::preSwap()
+{
+
+ //const bool brokenDNA = (mFlags&FD_BROKEN_DNA)!=0;
+ //FD_ENDIAN_SWAP
+ //byte 8 determines the endianness of the file, little (v) versus big (V)
+ int littleEndian= 1;
+ littleEndian= ((char*)&littleEndian)[0];
+
+
+ if (mFileBuffer[8]=='V')
+ {
+ mFileBuffer[8]='v';
+ }
+ else
+ {
+ mFileBuffer[8]='V';
+ }
+
+
+
+
+
+
+ mDataStart = 12;
+
+ char *dataPtr = mFileBuffer+mDataStart;
+
+ bChunkInd dataChunk;
+ dataChunk.code = 0;
+ bool ignoreEndianFlag = true;
+
+ //we always want to swap here
+
+ int seek = getNextBlock(&dataChunk, dataPtr, mFlags);
+ //dataPtr += ChunkUtils::getOffset(mFlags);
+ char *dataPtrHead = 0;
+
+ while (1)
+ {
+ // one behind
+ if (dataChunk.code == B3_SDNA || dataChunk.code==B3_DNA1 || dataChunk.code == B3_TYPE || dataChunk.code == B3_TLEN || dataChunk.code==B3_STRC)
+ {
+
+ swapDNA(dataPtr);
+ break;
+ } else
+ {
+ //if (dataChunk.code == DNA1) break;
+ dataPtrHead = dataPtr+ChunkUtils::getOffset(mFlags);
+
+ swapLen(dataPtr);
+ if (dataChunk.dna_nr>=0)
+ {
+ swap(dataPtrHead, dataChunk,ignoreEndianFlag);
+ } else
+ {
+ //printf("unknown chunk\n");
+ }
+ }
+
+ // next please!
+ dataPtr += seek;
+
+ seek = getNextBlock(&dataChunk, dataPtr, mFlags);
+ if (seek < 0)
+ break;
+ }
+
+ if (mFlags & FD_ENDIAN_SWAP)
+ {
+ mFlags &= ~FD_ENDIAN_SWAP;
+ } else
+ {
+ mFlags |= FD_ENDIAN_SWAP;
+ }
+
+
+
+}
+
+
+// ----------------------------------------------------- //
+char* bFile::readStruct(char *head, bChunkInd& dataChunk)
+{
+ bool ignoreEndianFlag = false;
+
+ if (mFlags & FD_ENDIAN_SWAP)
+ swap(head, dataChunk, ignoreEndianFlag);
+
+
+
+ if (!mFileDNA->flagEqual(dataChunk.dna_nr))
+ {
+ // Ouch! need to rebuild the struct
+ short *oldStruct,*curStruct;
+ char *oldType, *newType;
+ int oldLen, curLen, reverseOld;
+
+
+ oldStruct = mFileDNA->getStruct(dataChunk.dna_nr);
+ oldType = mFileDNA->getType(oldStruct[0]);
+
+ oldLen = mFileDNA->getLength(oldStruct[0]);
+
+ if ((mFlags&FD_BROKEN_DNA)!=0)
+ {
+ if ((strcmp(oldType,"b3QuantizedBvhNodeData")==0)&&oldLen==20)
+ {
+ return 0;
+ }
+ if ((strcmp(oldType,"b3ShortIntIndexData")==0))
+ {
+ int allocLen = 2;
+ char *dataAlloc = new char[(dataChunk.nr*allocLen)+1];
+ memset(dataAlloc, 0, (dataChunk.nr*allocLen)+1);
+ short* dest = (short*) dataAlloc;
+ const short* src = (short*) head;
+ for (int i=0;i<dataChunk.nr;i++)
+ {
+ dest[i] = src[i];
+ if (mFlags &FD_ENDIAN_SWAP)
+ {
+ B3_SWITCH_SHORT(dest[i]);
+ }
+ }
+ addDataBlock(dataAlloc);
+ return dataAlloc;
+ }
+ }
+
+
+
+ ///don't try to convert Link block data, just memcpy it. Other data can be converted.
+ if (strcmp("Link",oldType)!=0)
+ {
+ reverseOld = mMemoryDNA->getReverseType(oldType);
+
+ if ((reverseOld!=-1))
+ {
+ // make sure it's here
+ //assert(reverseOld!= -1 && "getReverseType() returned -1, struct required!");
+
+ //
+ curStruct = mMemoryDNA->getStruct(reverseOld);
+ newType = mMemoryDNA->getType(curStruct[0]);
+ curLen = mMemoryDNA->getLength(curStruct[0]);
+
+
+
+ // make sure it's the same
+ assert((strcmp(oldType, newType)==0) && "internal error, struct mismatch!");
+
+
+ // numBlocks * length
+
+ int allocLen = (curLen);
+ char *dataAlloc = new char[(dataChunk.nr*allocLen)+1];
+ memset(dataAlloc, 0, (dataChunk.nr*allocLen));
+
+ // track allocated
+ addDataBlock(dataAlloc);
+
+ char *cur = dataAlloc;
+ char *old = head;
+ for (int block=0; block<dataChunk.nr; block++)
+ {
+ bool fixupPointers = true;
+ parseStruct(cur, old, dataChunk.dna_nr, reverseOld, fixupPointers);
+ mLibPointers.insert(old,(bStructHandle*)cur);
+
+ cur += curLen;
+ old += oldLen;
+ }
+ return dataAlloc;
+ }
+ } else
+ {
+ //printf("Link found\n");
+ }
+ } else
+ {
+//#define DEBUG_EQUAL_STRUCTS
+#ifdef DEBUG_EQUAL_STRUCTS
+ short *oldStruct;
+ char *oldType;
+ oldStruct = mFileDNA->getStruct(dataChunk.dna_nr);
+ oldType = mFileDNA->getType(oldStruct[0]);
+ printf("%s equal structure, just memcpy\n",oldType);
+#endif //
+ }
+
+
+ char *dataAlloc = new char[(dataChunk.len)+1];
+ memset(dataAlloc, 0, dataChunk.len+1);
+
+
+ // track allocated
+ addDataBlock(dataAlloc);
+
+ memcpy(dataAlloc, head, dataChunk.len);
+ return dataAlloc;
+
+}
+
+
+// ----------------------------------------------------- //
+void bFile::parseStruct(char *strcPtr, char *dtPtr, int old_dna, int new_dna, bool fixupPointers)
+{
+ if (old_dna == -1) return;
+ if (new_dna == -1) return;
+
+ //disable this, because we need to fixup pointers/ListBase
+ if (0)//mFileDNA->flagEqual(old_dna))
+ {
+ short *strc = mFileDNA->getStruct(old_dna);
+ int len = mFileDNA->getLength(strc[0]);
+
+ memcpy(strcPtr, dtPtr, len);
+ return;
+ }
+
+ // Ok, now build the struct
+ char *memType, *memName, *cpc, *cpo;
+ short *fileStruct, *filePtrOld, *memoryStruct, *firstStruct;
+ int elementLength, size, revType, old_nr, new_nr, fpLen;
+ short firstStructType;
+
+
+ // File to memory lookup
+ memoryStruct = mMemoryDNA->getStruct(new_dna);
+ fileStruct = mFileDNA->getStruct(old_dna);
+ firstStruct = fileStruct;
+
+
+ filePtrOld = fileStruct;
+ firstStructType = mMemoryDNA->getStruct(0)[0];
+
+ // Get number of elements
+ elementLength = memoryStruct[1];
+ memoryStruct+=2;
+
+ cpc = strcPtr; cpo = 0;
+ for (int ele=0; ele<elementLength; ele++, memoryStruct+=2)
+ {
+ memType = mMemoryDNA->getType(memoryStruct[0]);
+ memName = mMemoryDNA->getName(memoryStruct[1]);
+
+
+ size = mMemoryDNA->getElementSize(memoryStruct[0], memoryStruct[1]);
+ revType = mMemoryDNA->getReverseType(memoryStruct[0]);
+
+ if (revType != -1 && memoryStruct[0]>=firstStructType && memName[0] != '*')
+ {
+ cpo = getFileElement(firstStruct, memName, memType, dtPtr, &filePtrOld);
+ if (cpo)
+ {
+ int arrayLen = mFileDNA->getArraySizeNew(filePtrOld[1]);
+ old_nr = mFileDNA->getReverseType(memType);
+ new_nr = revType;
+ fpLen = mFileDNA->getElementSize(filePtrOld[0], filePtrOld[1]);
+ if (arrayLen==1)
+ {
+ parseStruct(cpc, cpo, old_nr, new_nr,fixupPointers);
+ } else
+ {
+ char* tmpCpc = cpc;
+ char* tmpCpo = cpo;
+
+ for (int i=0;i<arrayLen;i++)
+ {
+ parseStruct(tmpCpc, tmpCpo, old_nr, new_nr,fixupPointers);
+ tmpCpc += size/arrayLen;
+ tmpCpo += fpLen/arrayLen;
+ }
+ }
+ cpc+=size;
+ cpo+=fpLen;
+ }
+ else
+ cpc+=size;
+ }
+ else
+ {
+ getMatchingFileDNA(fileStruct, memName, memType, cpc, dtPtr,fixupPointers);
+ cpc+=size;
+ }
+
+ }
+}
+
+
+// ----------------------------------------------------- //
+static void getElement(int arrayLen, const char *cur, const char *old, char *oldPtr, char *curData)
+{
+#define b3GetEle(value, current, type, cast, size, ptr)\
+ if (strcmp(current, type)==0)\
+ {\
+ value = (*(cast*)ptr);\
+ ptr += size;\
+ }
+
+#define b3SetEle(value, current, type, cast, size, ptr)\
+ if (strcmp(current, type)==0)\
+ {\
+ (*(cast*)ptr) = (cast)value;\
+ ptr += size;\
+ }
+ double value = 0.0;
+
+ for (int i=0; i<arrayLen; i++)
+ {
+ b3GetEle(value, old, "char", char, sizeof(char), oldPtr);
+ b3SetEle(value, cur, "char", char, sizeof(char), curData);
+ b3GetEle(value, old, "short", short, sizeof(short), oldPtr);
+ b3SetEle(value, cur, "short", short, sizeof(short), curData);
+ b3GetEle(value, old, "ushort", unsigned short, sizeof(unsigned short), oldPtr);
+ b3SetEle(value, cur, "ushort", unsigned short, sizeof(unsigned short), curData);
+ b3GetEle(value, old, "int", int, sizeof(int), oldPtr);
+ b3SetEle(value, cur, "int", int, sizeof(int), curData);
+ b3GetEle(value, old, "long", int, sizeof(int), oldPtr);
+ b3SetEle(value, cur, "long", int, sizeof(int), curData);
+ b3GetEle(value, old, "float", float, sizeof(float), oldPtr);
+ b3SetEle(value, cur, "float", float, sizeof(float), curData);
+ b3GetEle(value, old, "double", double, sizeof(double), oldPtr);
+ b3SetEle(value, cur, "double", double, sizeof(double), curData);
+ }
+}
+
+
+// ----------------------------------------------------- //
+void bFile::swapData(char *data, short type, int arraySize,bool ignoreEndianFlag)
+{
+ if (ignoreEndianFlag || (mFlags &FD_ENDIAN_SWAP))
+ {
+ if (type == 2 || type == 3)
+ {
+ short *sp = (short*)data;
+ for (int i=0; i<arraySize; i++)
+ {
+ sp[0] = ChunkUtils::swapShort(sp[0]);
+ sp++;
+ }
+ }
+ if (type>3 && type <8)
+ {
+ char c;
+ char *cp = data;
+ for (int i=0; i<arraySize; i++)
+ {
+ c = cp[0];
+ cp[0] = cp[3];
+ cp[3] = c;
+ c = cp[1];
+ cp[1] = cp[2];
+ cp[2] = c;
+ cp+=4;
+ }
+ }
+ }
+}
+
+
+
+void bFile::safeSwapPtr(char *dst, const char *src)
+{
+ int ptrFile = mFileDNA->getPointerSize();
+ int ptrMem = mMemoryDNA->getPointerSize();
+
+ if (!src && !dst)
+ return;
+
+
+ if (ptrFile == ptrMem)
+ {
+ memcpy(dst, src, ptrMem);
+ }
+ else if (ptrMem==4 && ptrFile==8)
+ {
+ b3PointerUid* oldPtr = (b3PointerUid*)src;
+ b3PointerUid* newPtr = (b3PointerUid*)dst;
+
+ if (oldPtr->m_uniqueIds[0] == oldPtr->m_uniqueIds[1])
+ {
+ //Bullet stores the 32bit unique ID in both upper and lower part of 64bit pointers
+ //so it can be used to distinguish between .blend and .bullet
+ newPtr->m_uniqueIds[0] = oldPtr->m_uniqueIds[0];
+ } else
+ {
+ //deal with pointers the Blender .blend style way, see
+ //readfile.c in the Blender source tree
+ b3Long64 longValue = *((b3Long64*)src);
+ //endian swap for 64bit pointer otherwise truncation will fail due to trailing zeros
+ if (mFlags & FD_ENDIAN_SWAP)
+ B3_SWITCH_LONGINT(longValue);
+ *((int*)dst) = (int)(longValue>>3);
+ }
+
+ }
+ else if (ptrMem==8 && ptrFile==4)
+ {
+ b3PointerUid* oldPtr = (b3PointerUid*)src;
+ b3PointerUid* newPtr = (b3PointerUid*)dst;
+ if (oldPtr->m_uniqueIds[0] == oldPtr->m_uniqueIds[1])
+ {
+ newPtr->m_uniqueIds[0] = oldPtr->m_uniqueIds[0];
+ newPtr->m_uniqueIds[1] = 0;
+ } else
+ {
+ *((b3Long64*)dst)= *((int*)src);
+ }
+ }
+ else
+ {
+ printf ("%d %d\n", ptrFile,ptrMem);
+ assert(0 && "Invalid pointer len");
+ }
+
+
+}
+
+
+// ----------------------------------------------------- //
+void bFile::getMatchingFileDNA(short* dna_addr, const char* lookupName, const char* lookupType, char *strcData, char *data, bool fixupPointers)
+{
+ // find the matching memory dna data
+ // to the file being loaded. Fill the
+ // memory with the file data...
+
+ int len = dna_addr[1];
+ dna_addr+=2;
+
+ for (int i=0; i<len; i++, dna_addr+=2)
+ {
+ const char* type = mFileDNA->getType(dna_addr[0]);
+ const char* name = mFileDNA->getName(dna_addr[1]);
+
+
+
+ int eleLen = mFileDNA->getElementSize(dna_addr[0], dna_addr[1]);
+
+ if ((mFlags&FD_BROKEN_DNA)!=0)
+ {
+ if ((strcmp(type,"short")==0)&&(strcmp(name,"int")==0))
+ {
+ eleLen = 0;
+ }
+ }
+
+ if (strcmp(lookupName, name)==0)
+ {
+ //int arrayLenold = mFileDNA->getArraySize((char*)name.c_str());
+ int arrayLen = mFileDNA->getArraySizeNew(dna_addr[1]);
+ //assert(arrayLenold == arrayLen);
+
+ if (name[0] == '*')
+ {
+ // cast pointers
+ int ptrFile = mFileDNA->getPointerSize();
+ int ptrMem = mMemoryDNA->getPointerSize();
+ safeSwapPtr(strcData,data);
+
+ if (fixupPointers)
+ {
+ if (arrayLen > 1)
+ {
+ //void **sarray = (void**)strcData;
+ //void **darray = (void**)data;
+
+ char *cpc, *cpo;
+ cpc = (char*)strcData;
+ cpo = (char*)data;
+
+ for (int a=0; a<arrayLen; a++)
+ {
+ safeSwapPtr(cpc, cpo);
+ m_pointerFixupArray.push_back(cpc);
+ cpc += ptrMem;
+ cpo += ptrFile;
+ }
+ }
+ else
+ {
+ if (name[1] == '*')
+ m_pointerPtrFixupArray.push_back(strcData);
+ else
+ m_pointerFixupArray.push_back(strcData);
+ }
+ }
+ else
+ {
+// printf("skipped %s %s : %x\n",type.c_str(),name.c_str(),strcData);
+ }
+
+ }
+
+ else if (strcmp(type, lookupType)==0)
+ memcpy(strcData, data, eleLen);
+ else
+ getElement(arrayLen, lookupType, type, data, strcData);
+
+ // --
+ return;
+ }
+ data+=eleLen;
+ }
+}
+
+
+// ----------------------------------------------------- //
+char* bFile::getFileElement(short *firstStruct, char *lookupName, char *lookupType, char *data, short **foundPos)
+{
+ short *old = firstStruct;//mFileDNA->getStruct(old_nr);
+ int elementLength = old[1];
+ old+=2;
+
+ for (int i=0; i<elementLength; i++, old+=2)
+ {
+ char* type = mFileDNA->getType(old[0]);
+ char* name = mFileDNA->getName(old[1]);
+ int len = mFileDNA->getElementSize(old[0], old[1]);
+
+ if (strcmp(lookupName, name)==0)
+ {
+ if (strcmp(type, lookupType)==0)
+ {
+ if (foundPos)
+ *foundPos = old;
+ return data;
+ }
+ return 0;
+ }
+ data+=len;
+ }
+ return 0;
+}
+
+
+// ----------------------------------------------------- //
+void bFile::swapStruct(int dna_nr, char *data,bool ignoreEndianFlag)
+{
+ if (dna_nr == -1) return;
+
+ short *strc = mFileDNA->getStruct(dna_nr);
+ //short *firstStrc = strc;
+
+ int elementLen= strc[1];
+ strc+=2;
+
+ short first = mFileDNA->getStruct(0)[0];
+
+ char *buf = data;
+ for (int i=0; i<elementLen; i++, strc+=2)
+ {
+ char *type = mFileDNA->getType(strc[0]);
+ char *name = mFileDNA->getName(strc[1]);
+
+ int size = mFileDNA->getElementSize(strc[0], strc[1]);
+ if (strc[0] >= first && name[0]!='*')
+ {
+ int old_nr = mFileDNA->getReverseType(type);
+ int arrayLen = mFileDNA->getArraySizeNew(strc[1]);
+ if (arrayLen==1)
+ {
+ swapStruct(old_nr,buf,ignoreEndianFlag);
+ } else
+ {
+ char* tmpBuf = buf;
+ for (int i=0;i<arrayLen;i++)
+ {
+ swapStruct(old_nr,tmpBuf,ignoreEndianFlag);
+ tmpBuf+=size/arrayLen;
+ }
+ }
+ }
+ else
+ {
+ //int arrayLenOld = mFileDNA->getArraySize(name);
+ int arrayLen = mFileDNA->getArraySizeNew(strc[1]);
+ //assert(arrayLenOld == arrayLen);
+ swapData(buf, strc[0], arrayLen,ignoreEndianFlag);
+ }
+ buf+=size;
+ }
+}
+
+void bFile::resolvePointersMismatch()
+{
+// printf("resolvePointersStructMismatch\n");
+
+ int i;
+
+ for (i=0;i< m_pointerFixupArray.size();i++)
+ {
+ char* cur = m_pointerFixupArray.at(i);
+ void** ptrptr = (void**) cur;
+ void* ptr = *ptrptr;
+ ptr = findLibPointer(ptr);
+ if (ptr)
+ {
+ //printf("Fixup pointer!\n");
+ *(ptrptr) = ptr;
+ } else
+ {
+// printf("pointer not found: %x\n",cur);
+ }
+ }
+
+
+ for (i=0; i<m_pointerPtrFixupArray.size(); i++)
+ {
+ char* cur= m_pointerPtrFixupArray.at(i);
+ void** ptrptr = (void**)cur;
+
+ bChunkInd *block = m_chunkPtrPtrMap.find(*ptrptr);
+ if (block)
+ {
+ int ptrMem = mMemoryDNA->getPointerSize();
+ int ptrFile = mFileDNA->getPointerSize();
+
+
+ int blockLen = block->len / ptrFile;
+
+ void *onptr = findLibPointer(*ptrptr);
+ if (onptr)
+ {
+ char *newPtr = new char[blockLen * ptrMem];
+ addDataBlock(newPtr);
+ memset(newPtr, 0, blockLen * ptrMem);
+
+ void **onarray = (void**)onptr;
+ char *oldPtr = (char*)onarray;
+
+ int p = 0;
+ while (blockLen-- > 0)
+ {
+ b3PointerUid dp = {{0}};
+ safeSwapPtr((char*)dp.m_uniqueIds, oldPtr);
+
+ void **tptr = (void**)(newPtr + p * ptrMem);
+ *tptr = findLibPointer(dp.m_ptr);
+
+ oldPtr += ptrFile;
+ ++p;
+ }
+
+ *ptrptr = newPtr;
+ }
+ }
+ }
+}
+
+
+///this loop only works fine if the Blender DNA structure of the file matches the headerfiles
+void bFile::resolvePointersChunk(const bChunkInd& dataChunk, int verboseMode)
+{
+ bParse::bDNA* fileDna = mFileDNA ? mFileDNA : mMemoryDNA;
+
+ short int* oldStruct = fileDna->getStruct(dataChunk.dna_nr);
+ short oldLen = fileDna->getLength(oldStruct[0]);
+ //char* structType = fileDna->getType(oldStruct[0]);
+
+ char* cur = (char*)findLibPointer(dataChunk.oldPtr);
+ for (int block=0; block<dataChunk.nr; block++)
+ {
+ resolvePointersStructRecursive(cur,dataChunk.dna_nr, verboseMode,1);
+ cur += oldLen;
+ }
+}
+
+
+int bFile::resolvePointersStructRecursive(char *strcPtr, int dna_nr, int verboseMode,int recursion)
+{
+
+ bParse::bDNA* fileDna = mFileDNA ? mFileDNA : mMemoryDNA;
+
+ char* memType;
+ char* memName;
+ short firstStructType = fileDna->getStruct(0)[0];
+
+
+ char* elemPtr= strcPtr;
+
+ short int* oldStruct = fileDna->getStruct(dna_nr);
+
+ int elementLength = oldStruct[1];
+ oldStruct+=2;
+
+ int totalSize = 0;
+
+ for (int ele=0; ele<elementLength; ele++, oldStruct+=2)
+ {
+
+ memType = fileDna->getType(oldStruct[0]);
+ memName = fileDna->getName(oldStruct[1]);
+
+
+
+ int arrayLen = fileDna->getArraySizeNew(oldStruct[1]);
+ if (memName[0] == '*')
+ {
+ if (arrayLen > 1)
+ {
+ void **array= (void**)elemPtr;
+ for (int a=0; a<arrayLen; a++)
+ {
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+ for (int i=0;i<recursion;i++)
+ {
+ printf(" ");
+ }
+ //skip the *
+ printf("<%s type=\"pointer\"> ",&memName[1]);
+ printf("%p ", array[a]);
+ printf("</%s>\n",&memName[1]);
+ }
+
+ array[a] = findLibPointer(array[a]);
+ }
+ }
+ else
+ {
+ void** ptrptr = (void**) elemPtr;
+ void* ptr = *ptrptr;
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+ for (int i=0;i<recursion;i++)
+ {
+ printf(" ");
+ }
+ printf("<%s type=\"pointer\"> ",&memName[1]);
+ printf("%p ", ptr);
+ printf("</%s>\n",&memName[1]);
+ }
+ ptr = findLibPointer(ptr);
+
+ if (ptr)
+ {
+ // printf("Fixup pointer at 0x%x from 0x%x to 0x%x!\n",ptrptr,*ptrptr,ptr);
+ *(ptrptr) = ptr;
+ if (memName[1] == '*' && ptrptr && *ptrptr)
+ {
+ // This will only work if the given **array is continuous
+ void **array= (void**)*(ptrptr);
+ void *np= array[0];
+ int n=0;
+ while (np)
+ {
+ np= findLibPointer(array[n]);
+ if (np) array[n]= np;
+ n++;
+ }
+ }
+ } else
+ {
+ // printf("Cannot fixup pointer at 0x%x from 0x%x to 0x%x!\n",ptrptr,*ptrptr,ptr);
+ }
+ }
+ } else
+ {
+ int revType = fileDna->getReverseType(oldStruct[0]);
+ if (oldStruct[0]>=firstStructType) //revType != -1 &&
+ {
+ char cleanName[MAX_STRLEN];
+ getCleanName(memName,cleanName);
+
+ int arrayLen = fileDna->getArraySizeNew(oldStruct[1]);
+ int byteOffset = 0;
+
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+ for (int i=0;i<recursion;i++)
+ {
+ printf(" ");
+ }
+
+ if (arrayLen>1)
+ {
+ printf("<%s type=\"%s\" count=%d>\n",cleanName,memType, arrayLen);
+ } else
+ {
+ printf("<%s type=\"%s\">\n",cleanName,memType);
+ }
+ }
+
+ for (int i=0;i<arrayLen;i++)
+ {
+ byteOffset += resolvePointersStructRecursive(elemPtr+byteOffset,revType, verboseMode,recursion+1);
+ }
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+ for (int i=0;i<recursion;i++)
+ {
+ printf(" ");
+ }
+ printf("</%s>\n",cleanName);
+ }
+ } else
+ {
+ //export a simple type
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+
+ if (arrayLen>MAX_ARRAY_LENGTH)
+ {
+ printf("too long\n");
+ } else
+ {
+ //printf("%s %s\n",memType,memName);
+
+ bool isIntegerType = (strcmp(memType,"char")==0) || (strcmp(memType,"int")==0) || (strcmp(memType,"short")==0);
+
+ if (isIntegerType)
+ {
+ const char* newtype="int";
+ int dbarray[MAX_ARRAY_LENGTH];
+ int* dbPtr = 0;
+ char* tmp = elemPtr;
+ dbPtr = &dbarray[0];
+ if (dbPtr)
+ {
+ char cleanName[MAX_STRLEN];
+ getCleanName(memName,cleanName);
+
+ int i;
+ getElement(arrayLen, newtype,memType, tmp, (char*)dbPtr);
+ for (i=0;i<recursion;i++)
+ printf(" ");
+ if (arrayLen==1)
+ printf("<%s type=\"%s\">",cleanName,memType);
+ else
+ printf("<%s type=\"%s\" count=%d>",cleanName,memType,arrayLen);
+ for (i=0;i<arrayLen;i++)
+ printf(" %d ",dbPtr[i]);
+ printf("</%s>\n",cleanName);
+ }
+ } else
+ {
+ const char* newtype="double";
+ double dbarray[MAX_ARRAY_LENGTH];
+ double* dbPtr = 0;
+ char* tmp = elemPtr;
+ dbPtr = &dbarray[0];
+ if (dbPtr)
+ {
+ int i;
+ getElement(arrayLen, newtype,memType, tmp, (char*)dbPtr);
+ for (i=0;i<recursion;i++)
+ printf(" ");
+ char cleanName[MAX_STRLEN];
+ getCleanName(memName,cleanName);
+
+ if (arrayLen==1)
+ {
+ printf("<%s type=\"%s\">",memName,memType);
+ }
+ else
+ {
+ printf("<%s type=\"%s\" count=%d>",cleanName,memType,arrayLen);
+ }
+ for (i=0;i<arrayLen;i++)
+ printf(" %f ",dbPtr[i]);
+ printf("</%s>\n",cleanName);
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ int size = fileDna->getElementSize(oldStruct[0], oldStruct[1]);
+ totalSize += size;
+ elemPtr+=size;
+
+ }
+
+ return totalSize;
+}
+
+
+///Resolve pointers replaces the original pointers in structures, and linked lists by the new in-memory structures
+void bFile::resolvePointers(int verboseMode)
+{
+ bParse::bDNA* fileDna = mFileDNA ? mFileDNA : mMemoryDNA;
+
+ //char *dataPtr = mFileBuffer+mDataStart;
+
+ if (1) //mFlags & (FD_BITS_VARIES | FD_VERSION_VARIES))
+ {
+ resolvePointersMismatch();
+ }
+
+ {
+
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+ printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
+ int numitems = m_chunks.size();
+ printf("<bullet_physics version=%d itemcount = %d>\n", b3GetVersion(), numitems);
+ }
+ for (int i=0;i<m_chunks.size();i++)
+ {
+ const bChunkInd& dataChunk = m_chunks.at(i);
+
+ if (!mFileDNA || fileDna->flagEqual(dataChunk.dna_nr))
+ {
+ //dataChunk.len
+ short int* oldStruct = fileDna->getStruct(dataChunk.dna_nr);
+ char* oldType = fileDna->getType(oldStruct[0]);
+
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ printf(" <%s pointer=%p>\n",oldType,dataChunk.oldPtr);
+
+ resolvePointersChunk(dataChunk, verboseMode);
+
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ printf(" </%s>\n",oldType);
+ } else
+ {
+ //printf("skipping mStruct\n");
+ }
+ }
+ if (verboseMode & FD_VERBOSE_EXPORT_XML)
+ {
+ printf("</bullet_physics>\n");
+ }
+ }
+
+
+}
+
+
+// ----------------------------------------------------- //
+void* bFile::findLibPointer(void *ptr)
+{
+
+ bStructHandle** ptrptr = getLibPointers().find(ptr);
+ if (ptrptr)
+ return *ptrptr;
+ return 0;
+}
+
+
+void bFile::updateOldPointers()
+{
+ int i;
+
+ for (i=0;i<m_chunks.size();i++)
+ {
+ bChunkInd& dataChunk = m_chunks[i];
+ dataChunk.oldPtr = findLibPointer(dataChunk.oldPtr);
+ }
+}
+void bFile::dumpChunks(bParse::bDNA* dna)
+{
+ int i;
+
+ for (i=0;i<m_chunks.size();i++)
+ {
+ bChunkInd& dataChunk = m_chunks[i];
+ char* codeptr = (char*)&dataChunk.code;
+ char codestr[5] = {codeptr[0],codeptr[1],codeptr[2],codeptr[3],0};
+
+ short* newStruct = dna->getStruct(dataChunk.dna_nr);
+ char* typeName = dna->getType(newStruct[0]);
+ printf("%3d: %s ",i,typeName);
+
+ printf("code=%s ",codestr);
+
+ printf("ptr=%p ",dataChunk.oldPtr);
+ printf("len=%d ",dataChunk.len);
+ printf("nr=%d ",dataChunk.nr);
+ if (dataChunk.nr!=1)
+ {
+ printf("not 1\n");
+ }
+ printf("\n");
+
+
+
+
+ }
+
+#if 0
+ IDFinderData ifd;
+ ifd.success = 0;
+ ifd.IDname = NULL;
+ ifd.just_print_it = 1;
+ for (i=0; i<bf->m_blocks.size(); ++i)
+ {
+ BlendBlock* bb = bf->m_blocks[i];
+ printf("tag='%s'\tptr=%p\ttype=%s\t[%4d]", bb->tag, bb,bf->types[bb->type_index].name,bb->m_array_entries_.size());
+ block_ID_finder(bb, bf, &ifd);
+ printf("\n");
+ }
+#endif
+
+}
+
+
+void bFile::writeChunks(FILE* fp, bool fixupPointers)
+{
+ bParse::bDNA* fileDna = mFileDNA ? mFileDNA : mMemoryDNA;
+
+ for (int i=0;i<m_chunks.size();i++)
+ {
+ bChunkInd& dataChunk = m_chunks.at(i);
+
+ // Ouch! need to rebuild the struct
+ short *oldStruct,*curStruct;
+ char *oldType, *newType;
+ int oldLen, curLen, reverseOld;
+
+ oldStruct = fileDna->getStruct(dataChunk.dna_nr);
+ oldType = fileDna->getType(oldStruct[0]);
+ oldLen = fileDna->getLength(oldStruct[0]);
+ ///don't try to convert Link block data, just memcpy it. Other data can be converted.
+ reverseOld = mMemoryDNA->getReverseType(oldType);
+
+
+ if ((reverseOld!=-1))
+ {
+ // make sure it's here
+ //assert(reverseOld!= -1 && "getReverseType() returned -1, struct required!");
+ //
+ curStruct = mMemoryDNA->getStruct(reverseOld);
+ newType = mMemoryDNA->getType(curStruct[0]);
+ // make sure it's the same
+ assert((strcmp(oldType, newType)==0) && "internal error, struct mismatch!");
+
+
+ curLen = mMemoryDNA->getLength(curStruct[0]);
+ dataChunk.dna_nr = reverseOld;
+ if (strcmp("Link",oldType)!=0)
+ {
+ dataChunk.len = curLen * dataChunk.nr;
+ } else
+ {
+// printf("keep length of link = %d\n",dataChunk.len);
+ }
+
+ //write the structure header
+ fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
+
+
+
+ short int* curStruct1;
+ curStruct1 = mMemoryDNA->getStruct(dataChunk.dna_nr);
+ assert(curStruct1 == curStruct);
+
+ char* cur = fixupPointers ? (char*)findLibPointer(dataChunk.oldPtr) : (char*)dataChunk.oldPtr;
+
+ //write the actual contents of the structure(s)
+ fwrite(cur,dataChunk.len,1,fp);
+ } else
+ {
+ printf("serious error, struct mismatch: don't write\n");
+ }
+ }
+
+}
+
+
+// ----------------------------------------------------- //
+int bFile::getNextBlock(bChunkInd *dataChunk, const char *dataPtr, const int flags)
+{
+ bool swap = false;
+ bool varies = false;
+
+ if (flags &FD_ENDIAN_SWAP)
+ swap = true;
+ if (flags &FD_BITS_VARIES)
+ varies = true;
+
+ if (VOID_IS_8)
+ {
+ if (varies)
+ {
+ bChunkPtr4 head;
+ memcpy(&head, dataPtr, sizeof(bChunkPtr4));
+
+
+ bChunkPtr8 chunk;
+
+ chunk.code = head.code;
+ chunk.len = head.len;
+ chunk.m_uniqueInts[0] = head.m_uniqueInt;
+ chunk.m_uniqueInts[1] = 0;
+ chunk.dna_nr = head.dna_nr;
+ chunk.nr = head.nr;
+
+ if (swap)
+ {
+ if ((chunk.code & 0xFFFF)==0)
+ chunk.code >>=16;
+
+ B3_SWITCH_INT(chunk.len);
+ B3_SWITCH_INT(chunk.dna_nr);
+ B3_SWITCH_INT(chunk.nr);
+ }
+
+
+ memcpy(dataChunk, &chunk, sizeof(bChunkInd));
+ }
+ else
+ {
+ bChunkPtr8 c;
+ memcpy(&c, dataPtr, sizeof(bChunkPtr8));
+
+ if (swap)
+ {
+ if ((c.code & 0xFFFF)==0)
+ c.code >>=16;
+
+ B3_SWITCH_INT(c.len);
+ B3_SWITCH_INT(c.dna_nr);
+ B3_SWITCH_INT(c.nr);
+ }
+
+ memcpy(dataChunk, &c, sizeof(bChunkInd));
+ }
+ }
+ else
+ {
+ if (varies)
+ {
+ bChunkPtr8 head;
+ memcpy(&head, dataPtr, sizeof(bChunkPtr8));
+
+
+ bChunkPtr4 chunk;
+ chunk.code = head.code;
+ chunk.len = head.len;
+
+ if (head.m_uniqueInts[0]==head.m_uniqueInts[1])
+ {
+ chunk.m_uniqueInt = head.m_uniqueInts[0];
+ } else
+ {
+ b3Long64 oldPtr =0;
+ memcpy(&oldPtr, &head.m_uniqueInts[0], 8);
+ if (swap)
+ B3_SWITCH_LONGINT(oldPtr);
+ chunk.m_uniqueInt = (int)(oldPtr >> 3);
+ }
+
+
+ chunk.dna_nr = head.dna_nr;
+ chunk.nr = head.nr;
+
+ if (swap)
+ {
+ if ((chunk.code & 0xFFFF)==0)
+ chunk.code >>=16;
+
+ B3_SWITCH_INT(chunk.len);
+ B3_SWITCH_INT(chunk.dna_nr);
+ B3_SWITCH_INT(chunk.nr);
+ }
+
+ memcpy(dataChunk, &chunk, sizeof(bChunkInd));
+ }
+ else
+ {
+ bChunkPtr4 c;
+ memcpy(&c, dataPtr, sizeof(bChunkPtr4));
+
+ if (swap)
+ {
+ if ((c.code & 0xFFFF)==0)
+ c.code >>=16;
+
+ B3_SWITCH_INT(c.len);
+ B3_SWITCH_INT(c.dna_nr);
+ B3_SWITCH_INT(c.nr);
+ }
+ memcpy(dataChunk, &c, sizeof(bChunkInd));
+ }
+ }
+
+ if (dataChunk->len < 0)
+ return -1;
+
+#if 0
+ print ("----------");
+ print (dataChunk->code);
+ print (dataChunk->len);
+ print (dataChunk->old);
+ print (dataChunk->dna_nr);
+ print (dataChunk->nr);
+#endif
+ return (dataChunk->len+ChunkUtils::getOffset(flags));
+}
+
+
+
+//eof
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.h
new file mode 100644
index 0000000000..861056806d
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3File.h
@@ -0,0 +1,165 @@
+/*
+bParse
+Copyright (c) 2006-2009 Charlie C & Erwin Coumans http://gamekit.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef __BFILE_H__
+#define __BFILE_H__
+
+#include "b3Common.h"
+#include "b3Chunk.h"
+#include <stdio.h>
+
+namespace bParse {
+
+ // ----------------------------------------------------- //
+ enum bFileFlags
+ {
+ FD_INVALID =0,
+ FD_OK =1,
+ FD_VOID_IS_8 =2,
+ FD_ENDIAN_SWAP =4,
+ FD_FILE_64 =8,
+ FD_BITS_VARIES =16,
+ FD_VERSION_VARIES = 32,
+ FD_DOUBLE_PRECISION =64,
+ FD_BROKEN_DNA = 128
+ };
+
+ enum bFileVerboseMode
+ {
+ FD_VERBOSE_EXPORT_XML = 1,
+ FD_VERBOSE_DUMP_DNA_TYPE_DEFINITIONS = 2,
+ FD_VERBOSE_DUMP_CHUNKS = 4,
+ FD_VERBOSE_DUMP_FILE_INFO=8,
+ };
+ // ----------------------------------------------------- //
+ class bFile
+ {
+ protected:
+
+ char m_headerString[7];
+
+ bool mOwnsBuffer;
+ char* mFileBuffer;
+ int mFileLen;
+ int mVersion;
+
+
+ bPtrMap mLibPointers;
+
+ int mDataStart;
+ bDNA* mFileDNA;
+ bDNA* mMemoryDNA;
+
+ b3AlignedObjectArray<char*> m_pointerFixupArray;
+ b3AlignedObjectArray<char*> m_pointerPtrFixupArray;
+
+ b3AlignedObjectArray<bChunkInd> m_chunks;
+ b3HashMap<b3HashPtr, bChunkInd> m_chunkPtrPtrMap;
+
+ //
+
+ bPtrMap mDataPointers;
+
+
+ int mFlags;
+
+ // ////////////////////////////////////////////////////////////////////////////
+
+ // buffer offset util
+ int getNextBlock(bChunkInd *dataChunk, const char *dataPtr, const int flags);
+ void safeSwapPtr(char *dst, const char *src);
+
+ virtual void parseHeader();
+
+ virtual void parseData() = 0;
+
+ void resolvePointersMismatch();
+ void resolvePointersChunk(const bChunkInd& dataChunk, int verboseMode);
+
+ int resolvePointersStructRecursive(char *strcPtr, int old_dna, int verboseMode, int recursion);
+ //void swapPtr(char *dst, char *src);
+
+ void parseStruct(char *strcPtr, char *dtPtr, int old_dna, int new_dna, bool fixupPointers);
+ void getMatchingFileDNA(short* old, const char* lookupName, const char* lookupType, char *strcData, char *data, bool fixupPointers);
+ char* getFileElement(short *firstStruct, char *lookupName, char *lookupType, char *data, short **foundPos);
+
+
+ void swap(char *head, class bChunkInd& ch, bool ignoreEndianFlag);
+ void swapData(char *data, short type, int arraySize, bool ignoreEndianFlag);
+ void swapStruct(int dna_nr, char *data, bool ignoreEndianFlag);
+ void swapLen(char *dataPtr);
+ void swapDNA(char* ptr);
+
+
+ char* readStruct(char *head, class bChunkInd& chunk);
+ char *getAsString(int code);
+
+ void parseInternal(int verboseMode, char* memDna,int memDnaLength);
+
+ public:
+ bFile(const char *filename, const char headerString[7]);
+
+ //todo: make memoryBuffer const char
+ //bFile( const char *memoryBuffer, int len);
+ bFile( char *memoryBuffer, int len, const char headerString[7]);
+ virtual ~bFile();
+
+ bDNA* getFileDNA()
+ {
+ return mFileDNA;
+ }
+
+ virtual void addDataBlock(char* dataBlock) = 0;
+
+ int getFlags() const
+ {
+ return mFlags;
+ }
+
+ bPtrMap& getLibPointers()
+ {
+ return mLibPointers;
+ }
+
+ void* findLibPointer(void *ptr);
+
+ bool ok();
+
+ virtual void parse(int verboseMode) = 0;
+
+ virtual int write(const char* fileName, bool fixupPointers=false) = 0;
+
+ virtual void writeChunks(FILE* fp, bool fixupPointers );
+
+ virtual void writeDNA(FILE* fp) = 0;
+
+ void updateOldPointers();
+ void resolvePointers(int verboseMode);
+
+ void dumpChunks(bDNA* dna);
+
+ int getVersion() const
+ {
+ return mVersion;
+ }
+ //pre-swap the endianness, so that data loaded on a target with different endianness doesn't need to be swapped
+ void preSwap();
+ void writeFile(const char* fileName);
+
+ };
+}
+
+
+#endif//__BFILE_H__
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.cpp b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.cpp
new file mode 100644
index 0000000000..c6a2a832ad
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.cpp
@@ -0,0 +1,908 @@
+char b3s_bulletDNAstr[]= {
+char(83),char(68),char(78),char(65),char(78),char(65),char(77),char(69),char(63),char(1),char(0),char(0),char(109),char(95),char(115),char(105),char(122),char(101),char(0),char(109),
+char(95),char(99),char(97),char(112),char(97),char(99),char(105),char(116),char(121),char(0),char(42),char(109),char(95),char(100),char(97),char(116),char(97),char(0),char(109),char(95),
+char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(83),char(104),char(97),char(112),char(101),char(115),char(0),char(109),char(95),char(99),char(111),
+char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),char(116),char(115),char(0),char(109),char(95),char(99),char(111),char(110),
+char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(115),char(0),char(42),char(102),char(105),char(114),char(115),char(116),char(0),char(42),char(108),char(97),char(115),
+char(116),char(0),char(109),char(95),char(102),char(108),char(111),char(97),char(116),char(115),char(91),char(52),char(93),char(0),char(109),char(95),char(101),char(108),char(91),char(51),
+char(93),char(0),char(109),char(95),char(98),char(97),char(115),char(105),char(115),char(0),char(109),char(95),char(111),char(114),char(105),char(103),char(105),char(110),char(0),char(109),
+char(95),char(114),char(111),char(111),char(116),char(78),char(111),char(100),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(115),char(117),char(98),
+char(116),char(114),char(101),char(101),char(83),char(105),char(122),char(101),char(0),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),
+char(65),char(97),char(98),char(98),char(77),char(105),char(110),char(91),char(51),char(93),char(0),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),
+char(101),char(100),char(65),char(97),char(98),char(98),char(77),char(97),char(120),char(91),char(51),char(93),char(0),char(109),char(95),char(97),char(97),char(98),char(98),char(77),
+char(105),char(110),char(79),char(114),char(103),char(0),char(109),char(95),char(97),char(97),char(98),char(98),char(77),char(97),char(120),char(79),char(114),char(103),char(0),char(109),
+char(95),char(101),char(115),char(99),char(97),char(112),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(115),char(117),char(98),char(80),char(97),
+char(114),char(116),char(0),char(109),char(95),char(116),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),
+char(95),char(112),char(97),char(100),char(91),char(52),char(93),char(0),char(109),char(95),char(101),char(115),char(99),char(97),char(112),char(101),char(73),char(110),char(100),char(101),
+char(120),char(79),char(114),char(84),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(98),
+char(118),char(104),char(65),char(97),char(98),char(98),char(77),char(105),char(110),char(0),char(109),char(95),char(98),char(118),char(104),char(65),char(97),char(98),char(98),char(77),
+char(97),char(120),char(0),char(109),char(95),char(98),char(118),char(104),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(97),char(116),char(105),char(111),char(110),
+char(0),char(109),char(95),char(99),char(117),char(114),char(78),char(111),char(100),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(117),char(115),
+char(101),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(97),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(110),char(117),char(109),char(67),
+char(111),char(110),char(116),char(105),char(103),char(117),char(111),char(117),char(115),char(76),char(101),char(97),char(102),char(78),char(111),char(100),char(101),char(115),char(0),char(109),
+char(95),char(110),char(117),char(109),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(67),char(111),char(110),char(116),char(105),char(103),char(117),
+char(111),char(117),char(115),char(78),char(111),char(100),char(101),char(115),char(0),char(42),char(109),char(95),char(99),char(111),char(110),char(116),char(105),char(103),char(117),char(111),
+char(117),char(115),char(78),char(111),char(100),char(101),char(115),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),
+char(122),char(101),char(100),char(67),char(111),char(110),char(116),char(105),char(103),char(117),char(111),char(117),char(115),char(78),char(111),char(100),char(101),char(115),char(80),char(116),
+char(114),char(0),char(42),char(109),char(95),char(115),char(117),char(98),char(84),char(114),char(101),char(101),char(73),char(110),char(102),char(111),char(80),char(116),char(114),char(0),
+char(109),char(95),char(116),char(114),char(97),char(118),char(101),char(114),char(115),char(97),char(108),char(77),char(111),char(100),char(101),char(0),char(109),char(95),char(110),char(117),
+char(109),char(83),char(117),char(98),char(116),char(114),char(101),char(101),char(72),char(101),char(97),char(100),char(101),char(114),char(115),char(0),char(42),char(109),char(95),char(110),
+char(97),char(109),char(101),char(0),char(109),char(95),char(115),char(104),char(97),char(112),char(101),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(112),char(97),
+char(100),char(100),char(105),char(110),char(103),char(91),char(52),char(93),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),
+char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(108),char(111),char(99),char(97),char(108),char(83),char(99),char(97),
+char(108),char(105),char(110),char(103),char(0),char(109),char(95),char(112),char(108),char(97),char(110),char(101),char(78),char(111),char(114),char(109),char(97),char(108),char(0),char(109),
+char(95),char(112),char(108),char(97),char(110),char(101),char(67),char(111),char(110),char(115),char(116),char(97),char(110),char(116),char(0),char(109),char(95),char(105),char(109),char(112),
+char(108),char(105),char(99),char(105),char(116),char(83),char(104),char(97),char(112),char(101),char(68),char(105),char(109),char(101),char(110),char(115),char(105),char(111),char(110),char(115),
+char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(77),char(97),char(114),char(103),char(105),char(110),char(0),char(109),
+char(95),char(112),char(97),char(100),char(100),char(105),char(110),char(103),char(0),char(109),char(95),char(112),char(111),char(115),char(0),char(109),char(95),char(114),char(97),char(100),
+char(105),char(117),char(115),char(0),char(109),char(95),char(99),char(111),char(110),char(118),char(101),char(120),char(73),char(110),char(116),char(101),char(114),char(110),char(97),char(108),
+char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(42),char(109),char(95),char(108),char(111),char(99),char(97),char(108),char(80),char(111),
+char(115),char(105),char(116),char(105),char(111),char(110),char(65),char(114),char(114),char(97),char(121),char(80),char(116),char(114),char(0),char(109),char(95),char(108),char(111),char(99),
+char(97),char(108),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(65),char(114),char(114),char(97),char(121),char(83),char(105),char(122),char(101),char(0),
+char(109),char(95),char(118),char(97),char(108),char(117),char(101),char(0),char(109),char(95),char(112),char(97),char(100),char(91),char(50),char(93),char(0),char(109),char(95),char(118),
+char(97),char(108),char(117),char(101),char(115),char(91),char(51),char(93),char(0),char(109),char(95),char(112),char(97),char(100),char(0),char(42),char(109),char(95),char(118),char(101),
+char(114),char(116),char(105),char(99),char(101),char(115),char(51),char(102),char(0),char(42),char(109),char(95),char(118),char(101),char(114),char(116),char(105),char(99),char(101),char(115),
+char(51),char(100),char(0),char(42),char(109),char(95),char(105),char(110),char(100),char(105),char(99),char(101),char(115),char(51),char(50),char(0),char(42),char(109),char(95),char(51),
+char(105),char(110),char(100),char(105),char(99),char(101),char(115),char(49),char(54),char(0),char(42),char(109),char(95),char(51),char(105),char(110),char(100),char(105),char(99),char(101),
+char(115),char(56),char(0),char(42),char(109),char(95),char(105),char(110),char(100),char(105),char(99),char(101),char(115),char(49),char(54),char(0),char(109),char(95),char(110),char(117),
+char(109),char(84),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(86),char(101),char(114),char(116),
+char(105),char(99),char(101),char(115),char(0),char(42),char(109),char(95),char(109),char(101),char(115),char(104),char(80),char(97),char(114),char(116),char(115),char(80),char(116),char(114),
+char(0),char(109),char(95),char(115),char(99),char(97),char(108),char(105),char(110),char(103),char(0),char(109),char(95),char(110),char(117),char(109),char(77),char(101),char(115),char(104),
+char(80),char(97),char(114),char(116),char(115),char(0),char(109),char(95),char(109),char(101),char(115),char(104),char(73),char(110),char(116),char(101),char(114),char(102),char(97),char(99),
+char(101),char(0),char(42),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(70),char(108),char(111),char(97),char(116),char(66),
+char(118),char(104),char(0),char(42),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(68),char(111),char(117),char(98),char(108),
+char(101),char(66),char(118),char(104),char(0),char(42),char(109),char(95),char(116),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(102),char(111),
+char(77),char(97),char(112),char(0),char(109),char(95),char(112),char(97),char(100),char(51),char(91),char(52),char(93),char(0),char(109),char(95),char(116),char(114),char(105),char(109),
+char(101),char(115),char(104),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(116),char(114),char(97),char(110),char(115),
+char(102),char(111),char(114),char(109),char(0),char(42),char(109),char(95),char(99),char(104),char(105),char(108),char(100),char(83),char(104),char(97),char(112),char(101),char(0),char(109),
+char(95),char(99),char(104),char(105),char(108),char(100),char(83),char(104),char(97),char(112),char(101),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(99),char(104),
+char(105),char(108),char(100),char(77),char(97),char(114),char(103),char(105),char(110),char(0),char(42),char(109),char(95),char(99),char(104),char(105),char(108),char(100),char(83),char(104),
+char(97),char(112),char(101),char(80),char(116),char(114),char(0),char(109),char(95),char(110),char(117),char(109),char(67),char(104),char(105),char(108),char(100),char(83),char(104),char(97),
+char(112),char(101),char(115),char(0),char(109),char(95),char(117),char(112),char(65),char(120),char(105),char(115),char(0),char(109),char(95),char(102),char(108),char(97),char(103),char(115),
+char(0),char(109),char(95),char(101),char(100),char(103),char(101),char(86),char(48),char(86),char(49),char(65),char(110),char(103),char(108),char(101),char(0),char(109),char(95),char(101),
+char(100),char(103),char(101),char(86),char(49),char(86),char(50),char(65),char(110),char(103),char(108),char(101),char(0),char(109),char(95),char(101),char(100),char(103),char(101),char(86),
+char(50),char(86),char(48),char(65),char(110),char(103),char(108),char(101),char(0),char(42),char(109),char(95),char(104),char(97),char(115),char(104),char(84),char(97),char(98),char(108),
+char(101),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(110),char(101),char(120),char(116),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(118),
+char(97),char(108),char(117),char(101),char(65),char(114),char(114),char(97),char(121),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(107),char(101),char(121),char(65),
+char(114),char(114),char(97),char(121),char(80),char(116),char(114),char(0),char(109),char(95),char(99),char(111),char(110),char(118),char(101),char(120),char(69),char(112),char(115),char(105),
+char(108),char(111),char(110),char(0),char(109),char(95),char(112),char(108),char(97),char(110),char(97),char(114),char(69),char(112),char(115),char(105),char(108),char(111),char(110),char(0),
+char(109),char(95),char(101),char(113),char(117),char(97),char(108),char(86),char(101),char(114),char(116),char(101),char(120),char(84),char(104),char(114),char(101),char(115),char(104),char(111),
+char(108),char(100),char(0),char(109),char(95),char(101),char(100),char(103),char(101),char(68),char(105),char(115),char(116),char(97),char(110),char(99),char(101),char(84),char(104),char(114),
+char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(122),char(101),char(114),char(111),char(65),char(114),char(101),char(97),char(84),char(104),char(114),
+char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(110),char(101),char(120),char(116),char(83),char(105),char(122),char(101),char(0),char(109),char(95),
+char(104),char(97),char(115),char(104),char(84),char(97),char(98),char(108),char(101),char(83),char(105),char(122),char(101),char(0),char(109),char(95),char(110),char(117),char(109),char(86),
+char(97),char(108),char(117),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(75),char(101),char(121),char(115),char(0),char(109),char(95),char(103),char(105),
+char(109),char(112),char(97),char(99),char(116),char(83),char(117),char(98),char(84),char(121),char(112),char(101),char(0),char(42),char(109),char(95),char(117),char(110),char(115),char(99),
+char(97),char(108),char(101),char(100),char(80),char(111),char(105),char(110),char(116),char(115),char(70),char(108),char(111),char(97),char(116),char(80),char(116),char(114),char(0),char(42),
+char(109),char(95),char(117),char(110),char(115),char(99),char(97),char(108),char(101),char(100),char(80),char(111),char(105),char(110),char(116),char(115),char(68),char(111),char(117),char(98),
+char(108),char(101),char(80),char(116),char(114),char(0),char(109),char(95),char(110),char(117),char(109),char(85),char(110),char(115),char(99),char(97),char(108),char(101),char(100),char(80),
+char(111),char(105),char(110),char(116),char(115),char(0),char(109),char(95),char(112),char(97),char(100),char(100),char(105),char(110),char(103),char(51),char(91),char(52),char(93),char(0),
+char(42),char(109),char(95),char(98),char(114),char(111),char(97),char(100),char(112),char(104),char(97),char(115),char(101),char(72),char(97),char(110),char(100),char(108),char(101),char(0),
+char(42),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(83),char(104),char(97),char(112),char(101),char(0),char(42),char(109),
+char(95),char(114),char(111),char(111),char(116),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(83),char(104),char(97),char(112),char(101),char(0),
+char(109),char(95),char(119),char(111),char(114),char(108),char(100),char(84),char(114),char(97),char(110),char(115),char(102),char(111),char(114),char(109),char(0),char(109),char(95),char(105),
+char(110),char(116),char(101),char(114),char(112),char(111),char(108),char(97),char(116),char(105),char(111),char(110),char(87),char(111),char(114),char(108),char(100),char(84),char(114),char(97),
+char(110),char(115),char(102),char(111),char(114),char(109),char(0),char(109),char(95),char(105),char(110),char(116),char(101),char(114),char(112),char(111),char(108),char(97),char(116),char(105),
+char(111),char(110),char(76),char(105),char(110),char(101),char(97),char(114),char(86),char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(105),
+char(110),char(116),char(101),char(114),char(112),char(111),char(108),char(97),char(116),char(105),char(111),char(110),char(65),char(110),char(103),char(117),char(108),char(97),char(114),char(86),
+char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(110),char(105),char(115),char(111),char(116),char(114),char(111),char(112),char(105),
+char(99),char(70),char(114),char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(99),char(111),char(110),char(116),char(97),char(99),char(116),char(80),
+char(114),char(111),char(99),char(101),char(115),char(115),char(105),char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(100),char(101),char(97),char(99),char(116),char(105),char(118),char(97),char(116),char(105),char(111),char(110),char(84),char(105),char(109),char(101),char(0),char(109),char(95),
+char(102),char(114),char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(114),char(111),char(108),char(108),char(105),char(110),char(103),char(70),char(114),
+char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(105),char(116),char(117),char(116),char(105),char(111),char(110),
+char(0),char(109),char(95),char(104),char(105),char(116),char(70),char(114),char(97),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(99),char(99),char(100),
+char(83),char(119),char(101),char(112),char(116),char(83),char(112),char(104),char(101),char(114),char(101),char(82),char(97),char(100),char(105),char(117),char(115),char(0),char(109),char(95),
+char(99),char(99),char(100),char(77),char(111),char(116),char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(104),char(97),char(115),char(65),char(110),char(105),char(115),char(111),char(116),char(114),char(111),char(112),char(105),char(99),char(70),char(114),char(105),char(99),char(116),
+char(105),char(111),char(110),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(70),char(108),char(97),char(103),char(115),
+char(0),char(109),char(95),char(105),char(115),char(108),char(97),char(110),char(100),char(84),char(97),char(103),char(49),char(0),char(109),char(95),char(99),char(111),char(109),char(112),
+char(97),char(110),char(105),char(111),char(110),char(73),char(100),char(0),char(109),char(95),char(97),char(99),char(116),char(105),char(118),char(97),char(116),char(105),char(111),char(110),
+char(83),char(116),char(97),char(116),char(101),char(49),char(0),char(109),char(95),char(105),char(110),char(116),char(101),char(114),char(110),char(97),char(108),char(84),char(121),char(112),
+char(101),char(0),char(109),char(95),char(99),char(104),char(101),char(99),char(107),char(67),char(111),char(108),char(108),char(105),char(100),char(101),char(87),char(105),char(116),char(104),
+char(0),char(109),char(95),char(115),char(111),char(108),char(118),char(101),char(114),char(73),char(110),char(102),char(111),char(0),char(109),char(95),char(103),char(114),char(97),char(118),
+char(105),char(116),char(121),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),
+char(116),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(105),char(110),char(118),char(73),char(110),char(101),char(114),char(116),char(105),char(97),char(84),char(101),
+char(110),char(115),char(111),char(114),char(87),char(111),char(114),char(108),char(100),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(86),char(101),
+char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(86),char(101),char(108),char(111),
+char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(70),char(97),char(99),char(116),char(111),char(114),
+char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(103),char(114),
+char(97),char(118),char(105),char(116),char(121),char(95),char(97),char(99),char(99),char(101),char(108),char(101),char(114),char(97),char(116),char(105),char(111),char(110),char(0),char(109),
+char(95),char(105),char(110),char(118),char(73),char(110),char(101),char(114),char(116),char(105),char(97),char(76),char(111),char(99),char(97),char(108),char(0),char(109),char(95),char(116),
+char(111),char(116),char(97),char(108),char(70),char(111),char(114),char(99),char(101),char(0),char(109),char(95),char(116),char(111),char(116),char(97),char(108),char(84),char(111),char(114),
+char(113),char(117),char(101),char(0),char(109),char(95),char(105),char(110),char(118),char(101),char(114),char(115),char(101),char(77),char(97),char(115),char(115),char(0),char(109),char(95),
+char(108),char(105),char(110),char(101),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(97),char(110),char(103),char(117),
+char(108),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(97),char(100),char(100),char(105),char(116),char(105),char(111),
+char(110),char(97),char(108),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(97),
+char(100),char(100),char(105),char(116),char(105),char(111),char(110),char(97),char(108),char(76),char(105),char(110),char(101),char(97),char(114),char(68),char(97),char(109),char(112),char(105),
+char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(83),char(113),char(114),char(0),char(109),char(95),char(97),char(100),char(100),
+char(105),char(116),char(105),char(111),char(110),char(97),char(108),char(65),char(110),char(103),char(117),char(108),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),
+char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(83),char(113),char(114),char(0),char(109),char(95),char(97),char(100),char(100),char(105),
+char(116),char(105),char(111),char(110),char(97),char(108),char(65),char(110),char(103),char(117),char(108),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),char(103),
+char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(83),char(108),char(101),char(101),char(112),
+char(105),char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),
+char(97),char(114),char(83),char(108),char(101),char(101),char(112),char(105),char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),
+char(109),char(95),char(97),char(100),char(100),char(105),char(116),char(105),char(111),char(110),char(97),char(108),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(0),
+char(109),char(95),char(110),char(117),char(109),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(82),char(111),char(119),char(115),char(0),
+char(110),char(117),char(98),char(0),char(42),char(109),char(95),char(114),char(98),char(65),char(0),char(42),char(109),char(95),char(114),char(98),char(66),char(0),char(109),char(95),
+char(111),char(98),char(106),char(101),char(99),char(116),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(117),char(115),char(101),char(114),char(67),char(111),char(110),
+char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(117),char(115),char(101),char(114),char(67),char(111),
+char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(73),char(100),char(0),char(109),char(95),char(110),char(101),char(101),char(100),char(115),char(70),char(101),
+char(101),char(100),char(98),char(97),char(99),char(107),char(0),char(109),char(95),char(97),char(112),char(112),char(108),char(105),char(101),char(100),char(73),char(109),char(112),char(117),
+char(108),char(115),char(101),char(0),char(109),char(95),char(100),char(98),char(103),char(68),char(114),char(97),char(119),char(83),char(105),char(122),char(101),char(0),char(109),char(95),
+char(100),char(105),char(115),char(97),char(98),char(108),char(101),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(115),char(66),char(101),char(116),
+char(119),char(101),char(101),char(110),char(76),char(105),char(110),char(107),char(101),char(100),char(66),char(111),char(100),char(105),char(101),char(115),char(0),char(109),char(95),char(111),
+char(118),char(101),char(114),char(114),char(105),char(100),char(101),char(78),char(117),char(109),char(83),char(111),char(108),char(118),char(101),char(114),char(73),char(116),char(101),char(114),
+char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(98),char(114),char(101),char(97),char(107),char(105),char(110),char(103),char(73),char(109),char(112),
+char(117),char(108),char(115),char(101),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(105),char(115),char(69),char(110),
+char(97),char(98),char(108),char(101),char(100),char(0),char(109),char(95),char(116),char(121),char(112),char(101),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),
+char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(112),char(105),char(118),char(111),char(116),char(73),char(110),char(65),char(0),char(109),char(95),
+char(112),char(105),char(118),char(111),char(116),char(73),char(110),char(66),char(0),char(109),char(95),char(114),char(98),char(65),char(70),char(114),char(97),char(109),char(101),char(0),
+char(109),char(95),char(114),char(98),char(66),char(70),char(114),char(97),char(109),char(101),char(0),char(109),char(95),char(117),char(115),char(101),char(82),char(101),char(102),char(101),
+char(114),char(101),char(110),char(99),char(101),char(70),char(114),char(97),char(109),char(101),char(65),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),
+char(114),char(79),char(110),char(108),char(121),char(0),char(109),char(95),char(101),char(110),char(97),char(98),char(108),char(101),char(65),char(110),char(103),char(117),char(108),char(97),
+char(114),char(77),char(111),char(116),char(111),char(114),char(0),char(109),char(95),char(109),char(111),char(116),char(111),char(114),char(84),char(97),char(114),char(103),char(101),char(116),
+char(86),char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(109),char(97),char(120),char(77),char(111),char(116),char(111),char(114),char(73),
+char(109),char(112),char(117),char(108),char(115),char(101),char(0),char(109),char(95),char(108),char(111),char(119),char(101),char(114),char(76),char(105),char(109),char(105),char(116),char(0),
+char(109),char(95),char(117),char(112),char(112),char(101),char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(108),char(105),char(109),char(105),char(116),
+char(83),char(111),char(102),char(116),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(98),char(105),char(97),char(115),char(70),char(97),char(99),char(116),char(111),
+char(114),char(0),char(109),char(95),char(114),char(101),char(108),char(97),char(120),char(97),char(116),char(105),char(111),char(110),char(70),char(97),char(99),char(116),char(111),char(114),
+char(0),char(109),char(95),char(115),char(119),char(105),char(110),char(103),char(83),char(112),char(97),char(110),char(49),char(0),char(109),char(95),char(115),char(119),char(105),char(110),
+char(103),char(83),char(112),char(97),char(110),char(50),char(0),char(109),char(95),char(116),char(119),char(105),char(115),char(116),char(83),char(112),char(97),char(110),char(0),char(109),
+char(95),char(100),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(85),char(112),char(112),
+char(101),char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(76),char(111),char(119),char(101),
+char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(85),char(112),char(112),char(101),
+char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(76),char(111),char(119),char(101),
+char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(117),char(115),char(101),char(76),char(105),char(110),char(101),char(97),char(114),char(82),char(101),
+char(102),char(101),char(114),char(101),char(110),char(99),char(101),char(70),char(114),char(97),char(109),char(101),char(65),char(0),char(109),char(95),char(117),char(115),char(101),char(79),
+char(102),char(102),char(115),char(101),char(116),char(70),char(111),char(114),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(70),char(114),
+char(97),char(109),char(101),char(0),char(109),char(95),char(54),char(100),char(111),char(102),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(115),char(112),char(114),
+char(105),char(110),char(103),char(69),char(110),char(97),char(98),char(108),char(101),char(100),char(91),char(54),char(93),char(0),char(109),char(95),char(101),char(113),char(117),char(105),
+char(108),char(105),char(98),char(114),char(105),char(117),char(109),char(80),char(111),char(105),char(110),char(116),char(91),char(54),char(93),char(0),char(109),char(95),char(115),char(112),
+char(114),char(105),char(110),char(103),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(91),char(54),char(93),char(0),char(109),char(95),char(115),
+char(112),char(114),char(105),char(110),char(103),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(91),char(54),char(93),char(0),char(109),char(95),char(116),char(97),
+char(117),char(0),char(109),char(95),char(116),char(105),char(109),char(101),char(83),char(116),char(101),char(112),char(0),char(109),char(95),char(109),char(97),char(120),char(69),char(114),
+char(114),char(111),char(114),char(82),char(101),char(100),char(117),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(115),char(111),char(114),char(0),char(109),
+char(95),char(101),char(114),char(112),char(0),char(109),char(95),char(101),char(114),char(112),char(50),char(0),char(109),char(95),char(103),char(108),char(111),char(98),char(97),char(108),
+char(67),char(102),char(109),char(0),char(109),char(95),char(115),char(112),char(108),char(105),char(116),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(80),char(101),
+char(110),char(101),char(116),char(114),char(97),char(116),char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(115),char(112),char(108),char(105),char(116),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(84),char(117),char(114),char(110),char(69),char(114),char(112),
+char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(83),char(108),char(111),char(112),char(0),char(109),char(95),char(119),char(97),char(114),char(109),
+char(115),char(116),char(97),char(114),char(116),char(105),char(110),char(103),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(109),char(97),char(120),
+char(71),char(121),char(114),char(111),char(115),char(99),char(111),char(112),char(105),char(99),char(70),char(111),char(114),char(99),char(101),char(0),char(109),char(95),char(115),char(105),
+char(110),char(103),char(108),char(101),char(65),char(120),char(105),char(115),char(82),char(111),char(108),char(108),char(105),char(110),char(103),char(70),char(114),char(105),char(99),char(116),
+char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(110),char(117),char(109),char(73),char(116),
+char(101),char(114),char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(115),char(111),char(108),char(118),char(101),char(114),char(77),char(111),char(100),
+char(101),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(105),char(110),char(103),char(67),char(111),char(110),char(116),char(97),char(99),char(116),char(82),char(101),
+char(115),char(116),char(105),char(116),char(117),char(116),char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(109),char(105),char(110),char(105),char(109),char(117),char(109),char(83),char(111),char(108),char(118),char(101),char(114),char(66),char(97),char(116),char(99),char(104),char(83),
+char(105),char(122),char(101),char(0),char(109),char(95),char(115),char(112),char(108),char(105),char(116),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(0),char(109),
+char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(97),
+char(110),char(103),char(117),char(108),char(97),char(114),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(118),char(111),
+char(108),char(117),char(109),char(101),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(0),char(42),char(109),char(95),char(109),char(97),char(116),
+char(101),char(114),char(105),char(97),char(108),char(0),char(109),char(95),char(112),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(112),
+char(114),char(101),char(118),char(105),char(111),char(117),char(115),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(118),char(101),
+char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(99),char(99),char(117),char(109),char(117),char(108),char(97),char(116),char(101),char(100),
+char(70),char(111),char(114),char(99),char(101),char(0),char(109),char(95),char(110),char(111),char(114),char(109),char(97),char(108),char(0),char(109),char(95),char(97),char(114),char(101),
+char(97),char(0),char(109),char(95),char(97),char(116),char(116),char(97),char(99),char(104),char(0),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),
+char(105),char(99),char(101),char(115),char(91),char(50),char(93),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(76),char(101),char(110),char(103),char(116),char(104),
+char(0),char(109),char(95),char(98),char(98),char(101),char(110),char(100),char(105),char(110),char(103),char(0),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),
+char(100),char(105),char(99),char(101),char(115),char(91),char(51),char(93),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(65),char(114),char(101),char(97),char(0),
+char(109),char(95),char(99),char(48),char(91),char(52),char(93),char(0),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),char(105),char(99),char(101),
+char(115),char(91),char(52),char(93),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(86),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),
+char(99),char(49),char(0),char(109),char(95),char(99),char(50),char(0),char(109),char(95),char(99),char(48),char(0),char(109),char(95),char(108),char(111),char(99),char(97),char(108),
+char(70),char(114),char(97),char(109),char(101),char(0),char(42),char(109),char(95),char(114),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(0),char(109),
+char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(97),char(101),char(114),char(111),char(77),char(111),char(100),
+char(101),char(108),char(0),char(109),char(95),char(98),char(97),char(117),char(109),char(103),char(97),char(114),char(116),char(101),char(0),char(109),char(95),char(100),char(114),char(97),
+char(103),char(0),char(109),char(95),char(108),char(105),char(102),char(116),char(0),char(109),char(95),char(112),char(114),char(101),char(115),char(115),char(117),char(114),char(101),char(0),
+char(109),char(95),char(118),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),char(100),char(121),char(110),char(97),char(109),char(105),char(99),char(70),char(114),
+char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(112),char(111),char(115),char(101),char(77),char(97),char(116),char(99),char(104),char(0),char(109),
+char(95),char(114),char(105),char(103),char(105),char(100),char(67),char(111),char(110),char(116),char(97),char(99),char(116),char(72),char(97),char(114),char(100),char(110),char(101),char(115),
+char(115),char(0),char(109),char(95),char(107),char(105),char(110),char(101),char(116),char(105),char(99),char(67),char(111),char(110),char(116),char(97),char(99),char(116),char(72),char(97),
+char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(67),char(111),char(110),char(116),char(97),char(99),char(116),
+char(72),char(97),char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(97),char(110),char(99),char(104),char(111),char(114),char(72),char(97),char(114),
+char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(82),char(105),char(103),char(105),char(100),char(67),char(108),char(117),
+char(115),char(116),char(101),char(114),char(72),char(97),char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(75),
+char(105),char(110),char(101),char(116),char(105),char(99),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(72),char(97),char(114),char(100),char(110),char(101),char(115),
+char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(83),char(111),char(102),char(116),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(72),
+char(97),char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(82),char(105),char(103),char(105),char(100),char(67),
+char(108),char(117),char(115),char(116),char(101),char(114),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(83),char(112),char(108),char(105),char(116),char(0),char(109),
+char(95),char(115),char(111),char(102),char(116),char(75),char(105),char(110),char(101),char(116),char(105),char(99),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(73),
+char(109),char(112),char(117),char(108),char(115),char(101),char(83),char(112),char(108),char(105),char(116),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(83),char(111),
+char(102),char(116),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(83),char(112),char(108),char(105),
+char(116),char(0),char(109),char(95),char(109),char(97),char(120),char(86),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),char(116),char(105),char(109),char(101),
+char(83),char(99),char(97),char(108),char(101),char(0),char(109),char(95),char(118),char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(73),char(116),char(101),char(114),
+char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(112),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(73),char(116),char(101),
+char(114),char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(100),char(114),char(105),char(102),char(116),char(73),char(116),char(101),char(114),char(97),
+char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(99),char(108),char(117),char(115),char(116),char(101),char(114),char(73),char(116),char(101),char(114),char(97),
+char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(114),char(111),char(116),char(0),char(109),char(95),char(115),char(99),char(97),char(108),char(101),char(0),
+char(109),char(95),char(97),char(113),char(113),char(0),char(109),char(95),char(99),char(111),char(109),char(0),char(42),char(109),char(95),char(112),char(111),char(115),char(105),char(116),
+char(105),char(111),char(110),char(115),char(0),char(42),char(109),char(95),char(119),char(101),char(105),char(103),char(104),char(116),char(115),char(0),char(109),char(95),char(110),char(117),
+char(109),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(87),char(101),char(105),char(103),
+char(116),char(115),char(0),char(109),char(95),char(98),char(118),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),char(98),char(102),char(114),char(97),char(109),
+char(101),char(0),char(109),char(95),char(102),char(114),char(97),char(109),char(101),char(120),char(102),char(111),char(114),char(109),char(0),char(109),char(95),char(108),char(111),char(99),
+char(105),char(105),char(0),char(109),char(95),char(105),char(110),char(118),char(119),char(105),char(0),char(109),char(95),char(118),char(105),char(109),char(112),char(117),char(108),char(115),
+char(101),char(115),char(91),char(50),char(93),char(0),char(109),char(95),char(100),char(105),char(109),char(112),char(117),char(108),char(115),char(101),char(115),char(91),char(50),char(93),
+char(0),char(109),char(95),char(108),char(118),char(0),char(109),char(95),char(97),char(118),char(0),char(42),char(109),char(95),char(102),char(114),char(97),char(109),char(101),char(114),
+char(101),char(102),char(115),char(0),char(42),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),char(105),char(99),char(101),char(115),char(0),char(42),
+char(109),char(95),char(109),char(97),char(115),char(115),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(70),char(114),char(97),char(109),char(101),char(82),
+char(101),char(102),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(78),char(111),char(100),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),
+char(77),char(97),char(115),char(115),char(101),char(115),char(0),char(109),char(95),char(105),char(100),char(109),char(97),char(115),char(115),char(0),char(109),char(95),char(105),char(109),
+char(97),char(115),char(115),char(0),char(109),char(95),char(110),char(118),char(105),char(109),char(112),char(117),char(108),char(115),char(101),char(115),char(0),char(109),char(95),char(110),
+char(100),char(105),char(109),char(112),char(117),char(108),char(115),char(101),char(115),char(0),char(109),char(95),char(110),char(100),char(97),char(109),char(112),char(105),char(110),char(103),
+char(0),char(109),char(95),char(108),char(100),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(97),char(100),char(97),char(109),char(112),char(105),
+char(110),char(103),char(0),char(109),char(95),char(109),char(97),char(116),char(99),char(104),char(105),char(110),char(103),char(0),char(109),char(95),char(109),char(97),char(120),char(83),
+char(101),char(108),char(102),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(0),
+char(109),char(95),char(115),char(101),char(108),char(102),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(73),char(109),char(112),char(117),char(108),
+char(115),char(101),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(99),char(111),char(110),char(116),char(97),char(105),char(110),char(115),char(65),
+char(110),char(99),char(104),char(111),char(114),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(100),char(101),char(0),char(109),char(95),char(99),char(108),
+char(117),char(115),char(116),char(101),char(114),char(73),char(110),char(100),char(101),char(120),char(0),char(42),char(109),char(95),char(98),char(111),char(100),char(121),char(65),char(0),
+char(42),char(109),char(95),char(98),char(111),char(100),char(121),char(66),char(0),char(109),char(95),char(114),char(101),char(102),char(115),char(91),char(50),char(93),char(0),char(109),
+char(95),char(99),char(102),char(109),char(0),char(109),char(95),char(115),char(112),char(108),char(105),char(116),char(0),char(109),char(95),char(100),char(101),char(108),char(101),char(116),
+char(101),char(0),char(109),char(95),char(114),char(101),char(108),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(91),char(50),char(93),char(0),char(109),
+char(95),char(98),char(111),char(100),char(121),char(65),char(116),char(121),char(112),char(101),char(0),char(109),char(95),char(98),char(111),char(100),char(121),char(66),char(116),char(121),
+char(112),char(101),char(0),char(109),char(95),char(106),char(111),char(105),char(110),char(116),char(84),char(121),char(112),char(101),char(0),char(42),char(109),char(95),char(112),char(111),
+char(115),char(101),char(0),char(42),char(42),char(109),char(95),char(109),char(97),char(116),char(101),char(114),char(105),char(97),char(108),char(115),char(0),char(42),char(109),char(95),
+char(110),char(111),char(100),char(101),char(115),char(0),char(42),char(109),char(95),char(108),char(105),char(110),char(107),char(115),char(0),char(42),char(109),char(95),char(102),char(97),
+char(99),char(101),char(115),char(0),char(42),char(109),char(95),char(116),char(101),char(116),char(114),char(97),char(104),char(101),char(100),char(114),char(97),char(0),char(42),char(109),
+char(95),char(97),char(110),char(99),char(104),char(111),char(114),char(115),char(0),char(42),char(109),char(95),char(99),char(108),char(117),char(115),char(116),char(101),char(114),char(115),
+char(0),char(42),char(109),char(95),char(106),char(111),char(105),char(110),char(116),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(77),char(97),char(116),char(101),
+char(114),char(105),char(97),char(108),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(76),char(105),char(110),char(107),char(115),char(0),char(109),char(95),char(110),
+char(117),char(109),char(70),char(97),char(99),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(84),char(101),char(116),char(114),char(97),char(104),char(101),
+char(100),char(114),char(97),char(0),char(109),char(95),char(110),char(117),char(109),char(65),char(110),char(99),char(104),char(111),char(114),char(115),char(0),char(109),char(95),char(110),
+char(117),char(109),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(74),char(111),char(105),char(110),
+char(116),char(115),char(0),char(109),char(95),char(99),char(111),char(110),char(102),char(105),char(103),char(0),char(84),char(89),char(80),char(69),char(76),char(0),char(0),char(0),
+char(99),char(104),char(97),char(114),char(0),char(117),char(99),char(104),char(97),char(114),char(0),char(115),char(104),char(111),char(114),char(116),char(0),char(117),char(115),char(104),
+char(111),char(114),char(116),char(0),char(105),char(110),char(116),char(0),char(108),char(111),char(110),char(103),char(0),char(117),char(108),char(111),char(110),char(103),char(0),char(102),
+char(108),char(111),char(97),char(116),char(0),char(100),char(111),char(117),char(98),char(108),char(101),char(0),char(118),char(111),char(105),char(100),char(0),char(80),char(111),char(105),
+char(110),char(116),char(101),char(114),char(65),char(114),char(114),char(97),char(121),char(0),char(98),char(116),char(80),char(104),char(121),char(115),char(105),char(99),char(115),char(83),
+char(121),char(115),char(116),char(101),char(109),char(0),char(76),char(105),char(115),char(116),char(66),char(97),char(115),char(101),char(0),char(98),char(116),char(86),char(101),char(99),
+char(116),char(111),char(114),char(51),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(86),char(101),char(99),char(116),
+char(111),char(114),char(51),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(77),char(97),char(116),char(114),
+char(105),char(120),char(51),char(120),char(51),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(77),char(97),char(116),
+char(114),char(105),char(120),char(51),char(120),char(51),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),
+char(114),char(97),char(110),char(115),char(102),char(111),char(114),char(109),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(84),char(114),char(97),char(110),char(115),char(102),char(111),char(114),char(109),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),
+char(98),char(116),char(66),char(118),char(104),char(83),char(117),char(98),char(116),char(114),char(101),char(101),char(73),char(110),char(102),char(111),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(79),char(112),char(116),char(105),char(109),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(78),char(111),char(100),char(101),char(70),
+char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(79),char(112),char(116),char(105),char(109),char(105),char(122),char(101),char(100),
+char(66),char(118),char(104),char(78),char(111),char(100),char(101),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(78),char(111),char(100),char(101),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(70),char(108),char(111),char(97),char(116),
+char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(68),
+char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),
+char(110),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(83),char(116),char(97),char(116),char(105),char(99),char(80),
+char(108),char(97),char(110),char(101),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(118),
+char(101),char(120),char(73),char(110),char(116),char(101),char(114),char(110),char(97),char(108),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),
+char(98),char(116),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(65),char(110),char(100),char(82),char(97),char(100),char(105),char(117),char(115),char(0),
+char(98),char(116),char(77),char(117),char(108),char(116),char(105),char(83),char(112),char(104),char(101),char(114),char(101),char(83),char(104),char(97),char(112),char(101),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(73),char(110),char(116),char(73),char(110),char(100),char(101),char(120),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(104),char(111),char(114),char(116),char(73),char(110),char(116),char(73),char(110),char(100),char(101),char(120),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(104),char(111),char(114),char(116),char(73),char(110),char(116),char(73),char(110),char(100),char(101),char(120),char(84),char(114),char(105),char(112),char(108),char(101),char(116),
+char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(104),char(97),char(114),char(73),char(110),char(100),char(101),char(120),char(84),char(114),char(105),char(112),
+char(108),char(101),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(77),char(101),char(115),char(104),char(80),char(97),char(114),char(116),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(83),char(116),char(114),char(105),char(100),char(105),char(110),char(103),char(77),char(101),char(115),char(104),char(73),char(110),char(116),
+char(101),char(114),char(102),char(97),char(99),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),char(114),char(105),char(97),char(110),char(103),char(108),
+char(101),char(77),char(101),char(115),char(104),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),char(114),char(105),
+char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(102),char(111),char(77),char(97),char(112),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(83),
+char(99),char(97),char(108),char(101),char(100),char(84),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(77),char(101),char(115),char(104),char(83),char(104),char(97),
+char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(109),char(112),char(111),char(117),char(110),char(100),char(83),char(104),char(97),
+char(112),char(101),char(67),char(104),char(105),char(108),char(100),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(109),char(112),char(111),char(117),
+char(110),char(100),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(121),char(108),char(105),char(110),char(100),
+char(101),char(114),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(97),char(112),char(115),char(117),char(108),
+char(101),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),char(114),char(105),char(97),char(110),char(103),char(108),
+char(101),char(73),char(110),char(102),char(111),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(71),char(73),char(109),char(112),char(97),char(99),char(116),char(77),
+char(101),char(115),char(104),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(118),char(101),
+char(120),char(72),char(117),char(108),char(108),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(108),
+char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),char(116),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),char(116),
+char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(68),char(121),char(110),char(97),char(109),char(105),char(99),char(115),
+char(87),char(111),char(114),char(108),char(100),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),
+char(110),char(116),char(97),char(99),char(116),char(83),char(111),char(108),char(118),char(101),char(114),char(73),char(110),char(102),char(111),char(68),char(111),char(117),char(98),char(108),
+char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(68),char(121),char(110),char(97),char(109),char(105),char(99),char(115),char(87),char(111),char(114),char(108),
+char(100),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(116),char(97),char(99),char(116),
+char(83),char(111),char(108),char(118),char(101),char(114),char(73),char(110),char(102),char(111),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),
+char(98),char(116),char(82),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(82),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(73),char(110),char(102),char(111),char(49),
+char(0),char(98),char(116),char(84),char(121),char(112),char(101),char(100),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(82),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(68),char(97),char(116),char(97),char(0),char(98),
+char(116),char(80),char(111),char(105),char(110),char(116),char(50),char(80),char(111),char(105),char(110),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),
+char(110),char(116),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(80),char(111),char(105),char(110),char(116),char(50),
+char(80),char(111),char(105),char(110),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(111),char(117),char(98),char(108),
+char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(72),char(105),char(110),char(103),char(101),char(67),char(111),char(110),char(115),char(116),char(114),char(97),
+char(105),char(110),char(116),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(72),char(105),char(110),char(103),
+char(101),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(67),char(111),char(110),char(101),char(84),char(119),char(105),char(115),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),
+char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(71),char(101),char(110),char(101),char(114),char(105),char(99),char(54),char(68),char(111),char(102),
+char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(71),char(101),char(110),
+char(101),char(114),char(105),char(99),char(54),char(68),char(111),char(102),char(83),char(112),char(114),char(105),char(110),char(103),char(67),char(111),char(110),char(115),char(116),char(114),
+char(97),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(83),char(108),char(105),char(100),char(101),char(114),char(67),char(111),char(110),
+char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),
+char(77),char(97),char(116),char(101),char(114),char(105),char(97),char(108),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),
+char(121),char(78),char(111),char(100),char(101),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(76),char(105),
+char(110),char(107),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(70),char(97),char(99),char(101),char(68),
+char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(84),char(101),char(116),char(114),char(97),char(68),char(97),char(116),
+char(97),char(0),char(83),char(111),char(102),char(116),char(82),char(105),char(103),char(105),char(100),char(65),char(110),char(99),char(104),char(111),char(114),char(68),char(97),char(116),
+char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(67),char(111),char(110),char(102),char(105),char(103),char(68),char(97),char(116),char(97),
+char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(80),char(111),char(115),char(101),char(68),char(97),char(116),char(97),char(0),char(83),char(111),
+char(102),char(116),char(66),char(111),char(100),char(121),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(74),char(111),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(0),char(0),
+char(84),char(76),char(69),char(78),char(1),char(0),char(1),char(0),char(2),char(0),char(2),char(0),char(4),char(0),char(4),char(0),char(4),char(0),char(4),char(0),
+char(8),char(0),char(0),char(0),char(12),char(0),char(36),char(0),char(8),char(0),char(16),char(0),char(32),char(0),char(48),char(0),char(96),char(0),char(64),char(0),
+char(-128),char(0),char(20),char(0),char(48),char(0),char(80),char(0),char(16),char(0),char(84),char(0),char(-124),char(0),char(12),char(0),char(52),char(0),char(52),char(0),
+char(20),char(0),char(64),char(0),char(4),char(0),char(4),char(0),char(8),char(0),char(4),char(0),char(32),char(0),char(28),char(0),char(60),char(0),char(56),char(0),
+char(76),char(0),char(76),char(0),char(24),char(0),char(60),char(0),char(60),char(0),char(16),char(0),char(64),char(0),char(68),char(0),char(-48),char(1),char(0),char(1),
+char(-72),char(0),char(-104),char(0),char(104),char(0),char(88),char(0),char(-24),char(1),char(-96),char(3),char(8),char(0),char(52),char(0),char(0),char(0),char(84),char(0),
+char(116),char(0),char(92),char(1),char(-36),char(0),char(-44),char(0),char(-4),char(0),char(92),char(1),char(-52),char(0),char(16),char(0),char(100),char(0),char(20),char(0),
+char(36),char(0),char(100),char(0),char(92),char(0),char(104),char(0),char(-64),char(0),char(92),char(1),char(104),char(0),char(-84),char(1),char(83),char(84),char(82),char(67),
+char(65),char(0),char(0),char(0),char(10),char(0),char(3),char(0),char(4),char(0),char(0),char(0),char(4),char(0),char(1),char(0),char(9),char(0),char(2),char(0),
+char(11),char(0),char(3),char(0),char(10),char(0),char(3),char(0),char(10),char(0),char(4),char(0),char(10),char(0),char(5),char(0),char(12),char(0),char(2),char(0),
+char(9),char(0),char(6),char(0),char(9),char(0),char(7),char(0),char(13),char(0),char(1),char(0),char(7),char(0),char(8),char(0),char(14),char(0),char(1),char(0),
+char(8),char(0),char(8),char(0),char(15),char(0),char(1),char(0),char(13),char(0),char(9),char(0),char(16),char(0),char(1),char(0),char(14),char(0),char(9),char(0),
+char(17),char(0),char(2),char(0),char(15),char(0),char(10),char(0),char(13),char(0),char(11),char(0),char(18),char(0),char(2),char(0),char(16),char(0),char(10),char(0),
+char(14),char(0),char(11),char(0),char(19),char(0),char(4),char(0),char(4),char(0),char(12),char(0),char(4),char(0),char(13),char(0),char(2),char(0),char(14),char(0),
+char(2),char(0),char(15),char(0),char(20),char(0),char(6),char(0),char(13),char(0),char(16),char(0),char(13),char(0),char(17),char(0),char(4),char(0),char(18),char(0),
+char(4),char(0),char(19),char(0),char(4),char(0),char(20),char(0),char(0),char(0),char(21),char(0),char(21),char(0),char(6),char(0),char(14),char(0),char(16),char(0),
+char(14),char(0),char(17),char(0),char(4),char(0),char(18),char(0),char(4),char(0),char(19),char(0),char(4),char(0),char(20),char(0),char(0),char(0),char(21),char(0),
+char(22),char(0),char(3),char(0),char(2),char(0),char(14),char(0),char(2),char(0),char(15),char(0),char(4),char(0),char(22),char(0),char(23),char(0),char(12),char(0),
+char(13),char(0),char(23),char(0),char(13),char(0),char(24),char(0),char(13),char(0),char(25),char(0),char(4),char(0),char(26),char(0),char(4),char(0),char(27),char(0),
+char(4),char(0),char(28),char(0),char(4),char(0),char(29),char(0),char(20),char(0),char(30),char(0),char(22),char(0),char(31),char(0),char(19),char(0),char(32),char(0),
+char(4),char(0),char(33),char(0),char(4),char(0),char(34),char(0),char(24),char(0),char(12),char(0),char(14),char(0),char(23),char(0),char(14),char(0),char(24),char(0),
+char(14),char(0),char(25),char(0),char(4),char(0),char(26),char(0),char(4),char(0),char(27),char(0),char(4),char(0),char(28),char(0),char(4),char(0),char(29),char(0),
+char(21),char(0),char(30),char(0),char(22),char(0),char(31),char(0),char(4),char(0),char(33),char(0),char(4),char(0),char(34),char(0),char(19),char(0),char(32),char(0),
+char(25),char(0),char(3),char(0),char(0),char(0),char(35),char(0),char(4),char(0),char(36),char(0),char(0),char(0),char(37),char(0),char(26),char(0),char(5),char(0),
+char(25),char(0),char(38),char(0),char(13),char(0),char(39),char(0),char(13),char(0),char(40),char(0),char(7),char(0),char(41),char(0),char(0),char(0),char(21),char(0),
+char(27),char(0),char(5),char(0),char(25),char(0),char(38),char(0),char(13),char(0),char(39),char(0),char(13),char(0),char(42),char(0),char(7),char(0),char(43),char(0),
+char(4),char(0),char(44),char(0),char(28),char(0),char(2),char(0),char(13),char(0),char(45),char(0),char(7),char(0),char(46),char(0),char(29),char(0),char(4),char(0),
+char(27),char(0),char(47),char(0),char(28),char(0),char(48),char(0),char(4),char(0),char(49),char(0),char(0),char(0),char(37),char(0),char(30),char(0),char(1),char(0),
+char(4),char(0),char(50),char(0),char(31),char(0),char(2),char(0),char(2),char(0),char(50),char(0),char(0),char(0),char(51),char(0),char(32),char(0),char(2),char(0),
+char(2),char(0),char(52),char(0),char(0),char(0),char(51),char(0),char(33),char(0),char(2),char(0),char(0),char(0),char(52),char(0),char(0),char(0),char(53),char(0),
+char(34),char(0),char(8),char(0),char(13),char(0),char(54),char(0),char(14),char(0),char(55),char(0),char(30),char(0),char(56),char(0),char(32),char(0),char(57),char(0),
+char(33),char(0),char(58),char(0),char(31),char(0),char(59),char(0),char(4),char(0),char(60),char(0),char(4),char(0),char(61),char(0),char(35),char(0),char(4),char(0),
+char(34),char(0),char(62),char(0),char(13),char(0),char(63),char(0),char(4),char(0),char(64),char(0),char(0),char(0),char(37),char(0),char(36),char(0),char(7),char(0),
+char(25),char(0),char(38),char(0),char(35),char(0),char(65),char(0),char(23),char(0),char(66),char(0),char(24),char(0),char(67),char(0),char(37),char(0),char(68),char(0),
+char(7),char(0),char(43),char(0),char(0),char(0),char(69),char(0),char(38),char(0),char(2),char(0),char(36),char(0),char(70),char(0),char(13),char(0),char(39),char(0),
+char(39),char(0),char(4),char(0),char(17),char(0),char(71),char(0),char(25),char(0),char(72),char(0),char(4),char(0),char(73),char(0),char(7),char(0),char(74),char(0),
+char(40),char(0),char(4),char(0),char(25),char(0),char(38),char(0),char(39),char(0),char(75),char(0),char(4),char(0),char(76),char(0),char(7),char(0),char(43),char(0),
+char(41),char(0),char(3),char(0),char(27),char(0),char(47),char(0),char(4),char(0),char(77),char(0),char(0),char(0),char(37),char(0),char(42),char(0),char(3),char(0),
+char(27),char(0),char(47),char(0),char(4),char(0),char(77),char(0),char(0),char(0),char(37),char(0),char(43),char(0),char(4),char(0),char(4),char(0),char(78),char(0),
+char(7),char(0),char(79),char(0),char(7),char(0),char(80),char(0),char(7),char(0),char(81),char(0),char(37),char(0),char(14),char(0),char(4),char(0),char(82),char(0),
+char(4),char(0),char(83),char(0),char(43),char(0),char(84),char(0),char(4),char(0),char(85),char(0),char(7),char(0),char(86),char(0),char(7),char(0),char(87),char(0),
+char(7),char(0),char(88),char(0),char(7),char(0),char(89),char(0),char(7),char(0),char(90),char(0),char(4),char(0),char(91),char(0),char(4),char(0),char(92),char(0),
+char(4),char(0),char(93),char(0),char(4),char(0),char(94),char(0),char(0),char(0),char(37),char(0),char(44),char(0),char(5),char(0),char(25),char(0),char(38),char(0),
+char(35),char(0),char(65),char(0),char(13),char(0),char(39),char(0),char(7),char(0),char(43),char(0),char(4),char(0),char(95),char(0),char(45),char(0),char(5),char(0),
+char(27),char(0),char(47),char(0),char(13),char(0),char(96),char(0),char(14),char(0),char(97),char(0),char(4),char(0),char(98),char(0),char(0),char(0),char(99),char(0),
+char(46),char(0),char(25),char(0),char(9),char(0),char(100),char(0),char(9),char(0),char(101),char(0),char(25),char(0),char(102),char(0),char(0),char(0),char(35),char(0),
+char(18),char(0),char(103),char(0),char(18),char(0),char(104),char(0),char(14),char(0),char(105),char(0),char(14),char(0),char(106),char(0),char(14),char(0),char(107),char(0),
+char(8),char(0),char(108),char(0),char(8),char(0),char(109),char(0),char(8),char(0),char(110),char(0),char(8),char(0),char(111),char(0),char(8),char(0),char(112),char(0),
+char(8),char(0),char(113),char(0),char(8),char(0),char(114),char(0),char(8),char(0),char(115),char(0),char(4),char(0),char(116),char(0),char(4),char(0),char(117),char(0),
+char(4),char(0),char(118),char(0),char(4),char(0),char(119),char(0),char(4),char(0),char(120),char(0),char(4),char(0),char(121),char(0),char(4),char(0),char(122),char(0),
+char(0),char(0),char(37),char(0),char(47),char(0),char(25),char(0),char(9),char(0),char(100),char(0),char(9),char(0),char(101),char(0),char(25),char(0),char(102),char(0),
+char(0),char(0),char(35),char(0),char(17),char(0),char(103),char(0),char(17),char(0),char(104),char(0),char(13),char(0),char(105),char(0),char(13),char(0),char(106),char(0),
+char(13),char(0),char(107),char(0),char(7),char(0),char(108),char(0),char(7),char(0),char(109),char(0),char(7),char(0),char(110),char(0),char(7),char(0),char(111),char(0),
+char(7),char(0),char(112),char(0),char(7),char(0),char(113),char(0),char(7),char(0),char(114),char(0),char(7),char(0),char(115),char(0),char(4),char(0),char(116),char(0),
+char(4),char(0),char(117),char(0),char(4),char(0),char(118),char(0),char(4),char(0),char(119),char(0),char(4),char(0),char(120),char(0),char(4),char(0),char(121),char(0),
+char(4),char(0),char(122),char(0),char(0),char(0),char(37),char(0),char(48),char(0),char(2),char(0),char(49),char(0),char(123),char(0),char(14),char(0),char(124),char(0),
+char(50),char(0),char(2),char(0),char(51),char(0),char(123),char(0),char(13),char(0),char(124),char(0),char(52),char(0),char(21),char(0),char(47),char(0),char(125),char(0),
+char(15),char(0),char(126),char(0),char(13),char(0),char(127),char(0),char(13),char(0),char(-128),char(0),char(13),char(0),char(-127),char(0),char(13),char(0),char(-126),char(0),
+char(13),char(0),char(124),char(0),char(13),char(0),char(-125),char(0),char(13),char(0),char(-124),char(0),char(13),char(0),char(-123),char(0),char(13),char(0),char(-122),char(0),
+char(7),char(0),char(-121),char(0),char(7),char(0),char(-120),char(0),char(7),char(0),char(-119),char(0),char(7),char(0),char(-118),char(0),char(7),char(0),char(-117),char(0),
+char(7),char(0),char(-116),char(0),char(7),char(0),char(-115),char(0),char(7),char(0),char(-114),char(0),char(7),char(0),char(-113),char(0),char(4),char(0),char(-112),char(0),
+char(53),char(0),char(22),char(0),char(46),char(0),char(125),char(0),char(16),char(0),char(126),char(0),char(14),char(0),char(127),char(0),char(14),char(0),char(-128),char(0),
+char(14),char(0),char(-127),char(0),char(14),char(0),char(-126),char(0),char(14),char(0),char(124),char(0),char(14),char(0),char(-125),char(0),char(14),char(0),char(-124),char(0),
+char(14),char(0),char(-123),char(0),char(14),char(0),char(-122),char(0),char(8),char(0),char(-121),char(0),char(8),char(0),char(-120),char(0),char(8),char(0),char(-119),char(0),
+char(8),char(0),char(-118),char(0),char(8),char(0),char(-117),char(0),char(8),char(0),char(-116),char(0),char(8),char(0),char(-115),char(0),char(8),char(0),char(-114),char(0),
+char(8),char(0),char(-113),char(0),char(4),char(0),char(-112),char(0),char(0),char(0),char(37),char(0),char(54),char(0),char(2),char(0),char(4),char(0),char(-111),char(0),
+char(4),char(0),char(-110),char(0),char(55),char(0),char(13),char(0),char(56),char(0),char(-109),char(0),char(56),char(0),char(-108),char(0),char(0),char(0),char(35),char(0),
+char(4),char(0),char(-107),char(0),char(4),char(0),char(-106),char(0),char(4),char(0),char(-105),char(0),char(4),char(0),char(-104),char(0),char(7),char(0),char(-103),char(0),
+char(7),char(0),char(-102),char(0),char(4),char(0),char(-101),char(0),char(4),char(0),char(-100),char(0),char(7),char(0),char(-99),char(0),char(4),char(0),char(-98),char(0),
+char(57),char(0),char(3),char(0),char(55),char(0),char(-97),char(0),char(13),char(0),char(-96),char(0),char(13),char(0),char(-95),char(0),char(58),char(0),char(3),char(0),
+char(55),char(0),char(-97),char(0),char(14),char(0),char(-96),char(0),char(14),char(0),char(-95),char(0),char(59),char(0),char(13),char(0),char(55),char(0),char(-97),char(0),
+char(18),char(0),char(-94),char(0),char(18),char(0),char(-93),char(0),char(4),char(0),char(-92),char(0),char(4),char(0),char(-91),char(0),char(4),char(0),char(-90),char(0),
+char(7),char(0),char(-89),char(0),char(7),char(0),char(-88),char(0),char(7),char(0),char(-87),char(0),char(7),char(0),char(-86),char(0),char(7),char(0),char(-85),char(0),
+char(7),char(0),char(-84),char(0),char(7),char(0),char(-83),char(0),char(60),char(0),char(13),char(0),char(55),char(0),char(-97),char(0),char(17),char(0),char(-94),char(0),
+char(17),char(0),char(-93),char(0),char(4),char(0),char(-92),char(0),char(4),char(0),char(-91),char(0),char(4),char(0),char(-90),char(0),char(7),char(0),char(-89),char(0),
+char(7),char(0),char(-88),char(0),char(7),char(0),char(-87),char(0),char(7),char(0),char(-86),char(0),char(7),char(0),char(-85),char(0),char(7),char(0),char(-84),char(0),
+char(7),char(0),char(-83),char(0),char(61),char(0),char(11),char(0),char(55),char(0),char(-97),char(0),char(17),char(0),char(-94),char(0),char(17),char(0),char(-93),char(0),
+char(7),char(0),char(-82),char(0),char(7),char(0),char(-81),char(0),char(7),char(0),char(-80),char(0),char(7),char(0),char(-85),char(0),char(7),char(0),char(-84),char(0),
+char(7),char(0),char(-83),char(0),char(7),char(0),char(-79),char(0),char(0),char(0),char(21),char(0),char(62),char(0),char(9),char(0),char(55),char(0),char(-97),char(0),
+char(17),char(0),char(-94),char(0),char(17),char(0),char(-93),char(0),char(13),char(0),char(-78),char(0),char(13),char(0),char(-77),char(0),char(13),char(0),char(-76),char(0),
+char(13),char(0),char(-75),char(0),char(4),char(0),char(-74),char(0),char(4),char(0),char(-73),char(0),char(63),char(0),char(5),char(0),char(62),char(0),char(-72),char(0),
+char(4),char(0),char(-71),char(0),char(7),char(0),char(-70),char(0),char(7),char(0),char(-69),char(0),char(7),char(0),char(-68),char(0),char(64),char(0),char(9),char(0),
+char(55),char(0),char(-97),char(0),char(17),char(0),char(-94),char(0),char(17),char(0),char(-93),char(0),char(7),char(0),char(-78),char(0),char(7),char(0),char(-77),char(0),
+char(7),char(0),char(-76),char(0),char(7),char(0),char(-75),char(0),char(4),char(0),char(-74),char(0),char(4),char(0),char(-73),char(0),char(49),char(0),char(22),char(0),
+char(8),char(0),char(-67),char(0),char(8),char(0),char(-79),char(0),char(8),char(0),char(110),char(0),char(8),char(0),char(-66),char(0),char(8),char(0),char(112),char(0),
+char(8),char(0),char(-65),char(0),char(8),char(0),char(-64),char(0),char(8),char(0),char(-63),char(0),char(8),char(0),char(-62),char(0),char(8),char(0),char(-61),char(0),
+char(8),char(0),char(-60),char(0),char(8),char(0),char(-59),char(0),char(8),char(0),char(-58),char(0),char(8),char(0),char(-57),char(0),char(8),char(0),char(-56),char(0),
+char(8),char(0),char(-55),char(0),char(4),char(0),char(-54),char(0),char(4),char(0),char(-53),char(0),char(4),char(0),char(-52),char(0),char(4),char(0),char(-51),char(0),
+char(4),char(0),char(-50),char(0),char(0),char(0),char(37),char(0),char(51),char(0),char(22),char(0),char(7),char(0),char(-67),char(0),char(7),char(0),char(-79),char(0),
+char(7),char(0),char(110),char(0),char(7),char(0),char(-66),char(0),char(7),char(0),char(112),char(0),char(7),char(0),char(-65),char(0),char(7),char(0),char(-64),char(0),
+char(7),char(0),char(-63),char(0),char(7),char(0),char(-62),char(0),char(7),char(0),char(-61),char(0),char(7),char(0),char(-60),char(0),char(7),char(0),char(-59),char(0),
+char(7),char(0),char(-58),char(0),char(7),char(0),char(-57),char(0),char(7),char(0),char(-56),char(0),char(7),char(0),char(-55),char(0),char(4),char(0),char(-54),char(0),
+char(4),char(0),char(-53),char(0),char(4),char(0),char(-52),char(0),char(4),char(0),char(-51),char(0),char(4),char(0),char(-50),char(0),char(0),char(0),char(37),char(0),
+char(65),char(0),char(4),char(0),char(7),char(0),char(-49),char(0),char(7),char(0),char(-48),char(0),char(7),char(0),char(-47),char(0),char(4),char(0),char(78),char(0),
+char(66),char(0),char(10),char(0),char(65),char(0),char(-46),char(0),char(13),char(0),char(-45),char(0),char(13),char(0),char(-44),char(0),char(13),char(0),char(-43),char(0),
+char(13),char(0),char(-42),char(0),char(13),char(0),char(-41),char(0),char(7),char(0),char(-121),char(0),char(7),char(0),char(-40),char(0),char(4),char(0),char(-39),char(0),
+char(4),char(0),char(53),char(0),char(67),char(0),char(4),char(0),char(65),char(0),char(-46),char(0),char(4),char(0),char(-38),char(0),char(7),char(0),char(-37),char(0),
+char(4),char(0),char(-36),char(0),char(68),char(0),char(4),char(0),char(13),char(0),char(-41),char(0),char(65),char(0),char(-46),char(0),char(4),char(0),char(-35),char(0),
+char(7),char(0),char(-34),char(0),char(69),char(0),char(7),char(0),char(13),char(0),char(-33),char(0),char(65),char(0),char(-46),char(0),char(4),char(0),char(-32),char(0),
+char(7),char(0),char(-31),char(0),char(7),char(0),char(-30),char(0),char(7),char(0),char(-29),char(0),char(4),char(0),char(53),char(0),char(70),char(0),char(6),char(0),
+char(15),char(0),char(-28),char(0),char(13),char(0),char(-30),char(0),char(13),char(0),char(-27),char(0),char(56),char(0),char(-26),char(0),char(4),char(0),char(-25),char(0),
+char(7),char(0),char(-29),char(0),char(71),char(0),char(26),char(0),char(4),char(0),char(-24),char(0),char(7),char(0),char(-23),char(0),char(7),char(0),char(-79),char(0),
+char(7),char(0),char(-22),char(0),char(7),char(0),char(-21),char(0),char(7),char(0),char(-20),char(0),char(7),char(0),char(-19),char(0),char(7),char(0),char(-18),char(0),
+char(7),char(0),char(-17),char(0),char(7),char(0),char(-16),char(0),char(7),char(0),char(-15),char(0),char(7),char(0),char(-14),char(0),char(7),char(0),char(-13),char(0),
+char(7),char(0),char(-12),char(0),char(7),char(0),char(-11),char(0),char(7),char(0),char(-10),char(0),char(7),char(0),char(-9),char(0),char(7),char(0),char(-8),char(0),
+char(7),char(0),char(-7),char(0),char(7),char(0),char(-6),char(0),char(7),char(0),char(-5),char(0),char(4),char(0),char(-4),char(0),char(4),char(0),char(-3),char(0),
+char(4),char(0),char(-2),char(0),char(4),char(0),char(-1),char(0),char(4),char(0),char(117),char(0),char(72),char(0),char(12),char(0),char(15),char(0),char(0),char(1),
+char(15),char(0),char(1),char(1),char(15),char(0),char(2),char(1),char(13),char(0),char(3),char(1),char(13),char(0),char(4),char(1),char(7),char(0),char(5),char(1),
+char(4),char(0),char(6),char(1),char(4),char(0),char(7),char(1),char(4),char(0),char(8),char(1),char(4),char(0),char(9),char(1),char(7),char(0),char(-31),char(0),
+char(4),char(0),char(53),char(0),char(73),char(0),char(27),char(0),char(17),char(0),char(10),char(1),char(15),char(0),char(11),char(1),char(15),char(0),char(12),char(1),
+char(13),char(0),char(3),char(1),char(13),char(0),char(13),char(1),char(13),char(0),char(14),char(1),char(13),char(0),char(15),char(1),char(13),char(0),char(16),char(1),
+char(13),char(0),char(17),char(1),char(4),char(0),char(18),char(1),char(7),char(0),char(19),char(1),char(4),char(0),char(20),char(1),char(4),char(0),char(21),char(1),
+char(4),char(0),char(22),char(1),char(7),char(0),char(23),char(1),char(7),char(0),char(24),char(1),char(4),char(0),char(25),char(1),char(4),char(0),char(26),char(1),
+char(7),char(0),char(27),char(1),char(7),char(0),char(28),char(1),char(7),char(0),char(29),char(1),char(7),char(0),char(30),char(1),char(7),char(0),char(31),char(1),
+char(7),char(0),char(32),char(1),char(4),char(0),char(33),char(1),char(4),char(0),char(34),char(1),char(4),char(0),char(35),char(1),char(74),char(0),char(12),char(0),
+char(9),char(0),char(36),char(1),char(9),char(0),char(37),char(1),char(13),char(0),char(38),char(1),char(7),char(0),char(39),char(1),char(7),char(0),char(-63),char(0),
+char(7),char(0),char(40),char(1),char(4),char(0),char(41),char(1),char(13),char(0),char(42),char(1),char(4),char(0),char(43),char(1),char(4),char(0),char(44),char(1),
+char(4),char(0),char(45),char(1),char(4),char(0),char(53),char(0),char(75),char(0),char(19),char(0),char(47),char(0),char(125),char(0),char(72),char(0),char(46),char(1),
+char(65),char(0),char(47),char(1),char(66),char(0),char(48),char(1),char(67),char(0),char(49),char(1),char(68),char(0),char(50),char(1),char(69),char(0),char(51),char(1),
+char(70),char(0),char(52),char(1),char(73),char(0),char(53),char(1),char(74),char(0),char(54),char(1),char(4),char(0),char(55),char(1),char(4),char(0),char(21),char(1),
+char(4),char(0),char(56),char(1),char(4),char(0),char(57),char(1),char(4),char(0),char(58),char(1),char(4),char(0),char(59),char(1),char(4),char(0),char(60),char(1),
+char(4),char(0),char(61),char(1),char(71),char(0),char(62),char(1),};
+int b3s_bulletDNAlen= sizeof(b3s_bulletDNAstr);
+char b3s_bulletDNAstr64[]= {
+char(83),char(68),char(78),char(65),char(78),char(65),char(77),char(69),char(63),char(1),char(0),char(0),char(109),char(95),char(115),char(105),char(122),char(101),char(0),char(109),
+char(95),char(99),char(97),char(112),char(97),char(99),char(105),char(116),char(121),char(0),char(42),char(109),char(95),char(100),char(97),char(116),char(97),char(0),char(109),char(95),
+char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(83),char(104),char(97),char(112),char(101),char(115),char(0),char(109),char(95),char(99),char(111),
+char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),char(116),char(115),char(0),char(109),char(95),char(99),char(111),char(110),
+char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(115),char(0),char(42),char(102),char(105),char(114),char(115),char(116),char(0),char(42),char(108),char(97),char(115),
+char(116),char(0),char(109),char(95),char(102),char(108),char(111),char(97),char(116),char(115),char(91),char(52),char(93),char(0),char(109),char(95),char(101),char(108),char(91),char(51),
+char(93),char(0),char(109),char(95),char(98),char(97),char(115),char(105),char(115),char(0),char(109),char(95),char(111),char(114),char(105),char(103),char(105),char(110),char(0),char(109),
+char(95),char(114),char(111),char(111),char(116),char(78),char(111),char(100),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(115),char(117),char(98),
+char(116),char(114),char(101),char(101),char(83),char(105),char(122),char(101),char(0),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),
+char(65),char(97),char(98),char(98),char(77),char(105),char(110),char(91),char(51),char(93),char(0),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),
+char(101),char(100),char(65),char(97),char(98),char(98),char(77),char(97),char(120),char(91),char(51),char(93),char(0),char(109),char(95),char(97),char(97),char(98),char(98),char(77),
+char(105),char(110),char(79),char(114),char(103),char(0),char(109),char(95),char(97),char(97),char(98),char(98),char(77),char(97),char(120),char(79),char(114),char(103),char(0),char(109),
+char(95),char(101),char(115),char(99),char(97),char(112),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(115),char(117),char(98),char(80),char(97),
+char(114),char(116),char(0),char(109),char(95),char(116),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),
+char(95),char(112),char(97),char(100),char(91),char(52),char(93),char(0),char(109),char(95),char(101),char(115),char(99),char(97),char(112),char(101),char(73),char(110),char(100),char(101),
+char(120),char(79),char(114),char(84),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(98),
+char(118),char(104),char(65),char(97),char(98),char(98),char(77),char(105),char(110),char(0),char(109),char(95),char(98),char(118),char(104),char(65),char(97),char(98),char(98),char(77),
+char(97),char(120),char(0),char(109),char(95),char(98),char(118),char(104),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(97),char(116),char(105),char(111),char(110),
+char(0),char(109),char(95),char(99),char(117),char(114),char(78),char(111),char(100),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(117),char(115),
+char(101),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(97),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(110),char(117),char(109),char(67),
+char(111),char(110),char(116),char(105),char(103),char(117),char(111),char(117),char(115),char(76),char(101),char(97),char(102),char(78),char(111),char(100),char(101),char(115),char(0),char(109),
+char(95),char(110),char(117),char(109),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(67),char(111),char(110),char(116),char(105),char(103),char(117),
+char(111),char(117),char(115),char(78),char(111),char(100),char(101),char(115),char(0),char(42),char(109),char(95),char(99),char(111),char(110),char(116),char(105),char(103),char(117),char(111),
+char(117),char(115),char(78),char(111),char(100),char(101),char(115),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),
+char(122),char(101),char(100),char(67),char(111),char(110),char(116),char(105),char(103),char(117),char(111),char(117),char(115),char(78),char(111),char(100),char(101),char(115),char(80),char(116),
+char(114),char(0),char(42),char(109),char(95),char(115),char(117),char(98),char(84),char(114),char(101),char(101),char(73),char(110),char(102),char(111),char(80),char(116),char(114),char(0),
+char(109),char(95),char(116),char(114),char(97),char(118),char(101),char(114),char(115),char(97),char(108),char(77),char(111),char(100),char(101),char(0),char(109),char(95),char(110),char(117),
+char(109),char(83),char(117),char(98),char(116),char(114),char(101),char(101),char(72),char(101),char(97),char(100),char(101),char(114),char(115),char(0),char(42),char(109),char(95),char(110),
+char(97),char(109),char(101),char(0),char(109),char(95),char(115),char(104),char(97),char(112),char(101),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(112),char(97),
+char(100),char(100),char(105),char(110),char(103),char(91),char(52),char(93),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),
+char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(108),char(111),char(99),char(97),char(108),char(83),char(99),char(97),
+char(108),char(105),char(110),char(103),char(0),char(109),char(95),char(112),char(108),char(97),char(110),char(101),char(78),char(111),char(114),char(109),char(97),char(108),char(0),char(109),
+char(95),char(112),char(108),char(97),char(110),char(101),char(67),char(111),char(110),char(115),char(116),char(97),char(110),char(116),char(0),char(109),char(95),char(105),char(109),char(112),
+char(108),char(105),char(99),char(105),char(116),char(83),char(104),char(97),char(112),char(101),char(68),char(105),char(109),char(101),char(110),char(115),char(105),char(111),char(110),char(115),
+char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(77),char(97),char(114),char(103),char(105),char(110),char(0),char(109),
+char(95),char(112),char(97),char(100),char(100),char(105),char(110),char(103),char(0),char(109),char(95),char(112),char(111),char(115),char(0),char(109),char(95),char(114),char(97),char(100),
+char(105),char(117),char(115),char(0),char(109),char(95),char(99),char(111),char(110),char(118),char(101),char(120),char(73),char(110),char(116),char(101),char(114),char(110),char(97),char(108),
+char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(42),char(109),char(95),char(108),char(111),char(99),char(97),char(108),char(80),char(111),
+char(115),char(105),char(116),char(105),char(111),char(110),char(65),char(114),char(114),char(97),char(121),char(80),char(116),char(114),char(0),char(109),char(95),char(108),char(111),char(99),
+char(97),char(108),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(65),char(114),char(114),char(97),char(121),char(83),char(105),char(122),char(101),char(0),
+char(109),char(95),char(118),char(97),char(108),char(117),char(101),char(0),char(109),char(95),char(112),char(97),char(100),char(91),char(50),char(93),char(0),char(109),char(95),char(118),
+char(97),char(108),char(117),char(101),char(115),char(91),char(51),char(93),char(0),char(109),char(95),char(112),char(97),char(100),char(0),char(42),char(109),char(95),char(118),char(101),
+char(114),char(116),char(105),char(99),char(101),char(115),char(51),char(102),char(0),char(42),char(109),char(95),char(118),char(101),char(114),char(116),char(105),char(99),char(101),char(115),
+char(51),char(100),char(0),char(42),char(109),char(95),char(105),char(110),char(100),char(105),char(99),char(101),char(115),char(51),char(50),char(0),char(42),char(109),char(95),char(51),
+char(105),char(110),char(100),char(105),char(99),char(101),char(115),char(49),char(54),char(0),char(42),char(109),char(95),char(51),char(105),char(110),char(100),char(105),char(99),char(101),
+char(115),char(56),char(0),char(42),char(109),char(95),char(105),char(110),char(100),char(105),char(99),char(101),char(115),char(49),char(54),char(0),char(109),char(95),char(110),char(117),
+char(109),char(84),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(86),char(101),char(114),char(116),
+char(105),char(99),char(101),char(115),char(0),char(42),char(109),char(95),char(109),char(101),char(115),char(104),char(80),char(97),char(114),char(116),char(115),char(80),char(116),char(114),
+char(0),char(109),char(95),char(115),char(99),char(97),char(108),char(105),char(110),char(103),char(0),char(109),char(95),char(110),char(117),char(109),char(77),char(101),char(115),char(104),
+char(80),char(97),char(114),char(116),char(115),char(0),char(109),char(95),char(109),char(101),char(115),char(104),char(73),char(110),char(116),char(101),char(114),char(102),char(97),char(99),
+char(101),char(0),char(42),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(70),char(108),char(111),char(97),char(116),char(66),
+char(118),char(104),char(0),char(42),char(109),char(95),char(113),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(68),char(111),char(117),char(98),char(108),
+char(101),char(66),char(118),char(104),char(0),char(42),char(109),char(95),char(116),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(102),char(111),
+char(77),char(97),char(112),char(0),char(109),char(95),char(112),char(97),char(100),char(51),char(91),char(52),char(93),char(0),char(109),char(95),char(116),char(114),char(105),char(109),
+char(101),char(115),char(104),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(116),char(114),char(97),char(110),char(115),
+char(102),char(111),char(114),char(109),char(0),char(42),char(109),char(95),char(99),char(104),char(105),char(108),char(100),char(83),char(104),char(97),char(112),char(101),char(0),char(109),
+char(95),char(99),char(104),char(105),char(108),char(100),char(83),char(104),char(97),char(112),char(101),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(99),char(104),
+char(105),char(108),char(100),char(77),char(97),char(114),char(103),char(105),char(110),char(0),char(42),char(109),char(95),char(99),char(104),char(105),char(108),char(100),char(83),char(104),
+char(97),char(112),char(101),char(80),char(116),char(114),char(0),char(109),char(95),char(110),char(117),char(109),char(67),char(104),char(105),char(108),char(100),char(83),char(104),char(97),
+char(112),char(101),char(115),char(0),char(109),char(95),char(117),char(112),char(65),char(120),char(105),char(115),char(0),char(109),char(95),char(102),char(108),char(97),char(103),char(115),
+char(0),char(109),char(95),char(101),char(100),char(103),char(101),char(86),char(48),char(86),char(49),char(65),char(110),char(103),char(108),char(101),char(0),char(109),char(95),char(101),
+char(100),char(103),char(101),char(86),char(49),char(86),char(50),char(65),char(110),char(103),char(108),char(101),char(0),char(109),char(95),char(101),char(100),char(103),char(101),char(86),
+char(50),char(86),char(48),char(65),char(110),char(103),char(108),char(101),char(0),char(42),char(109),char(95),char(104),char(97),char(115),char(104),char(84),char(97),char(98),char(108),
+char(101),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(110),char(101),char(120),char(116),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(118),
+char(97),char(108),char(117),char(101),char(65),char(114),char(114),char(97),char(121),char(80),char(116),char(114),char(0),char(42),char(109),char(95),char(107),char(101),char(121),char(65),
+char(114),char(114),char(97),char(121),char(80),char(116),char(114),char(0),char(109),char(95),char(99),char(111),char(110),char(118),char(101),char(120),char(69),char(112),char(115),char(105),
+char(108),char(111),char(110),char(0),char(109),char(95),char(112),char(108),char(97),char(110),char(97),char(114),char(69),char(112),char(115),char(105),char(108),char(111),char(110),char(0),
+char(109),char(95),char(101),char(113),char(117),char(97),char(108),char(86),char(101),char(114),char(116),char(101),char(120),char(84),char(104),char(114),char(101),char(115),char(104),char(111),
+char(108),char(100),char(0),char(109),char(95),char(101),char(100),char(103),char(101),char(68),char(105),char(115),char(116),char(97),char(110),char(99),char(101),char(84),char(104),char(114),
+char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(122),char(101),char(114),char(111),char(65),char(114),char(101),char(97),char(84),char(104),char(114),
+char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(110),char(101),char(120),char(116),char(83),char(105),char(122),char(101),char(0),char(109),char(95),
+char(104),char(97),char(115),char(104),char(84),char(97),char(98),char(108),char(101),char(83),char(105),char(122),char(101),char(0),char(109),char(95),char(110),char(117),char(109),char(86),
+char(97),char(108),char(117),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(75),char(101),char(121),char(115),char(0),char(109),char(95),char(103),char(105),
+char(109),char(112),char(97),char(99),char(116),char(83),char(117),char(98),char(84),char(121),char(112),char(101),char(0),char(42),char(109),char(95),char(117),char(110),char(115),char(99),
+char(97),char(108),char(101),char(100),char(80),char(111),char(105),char(110),char(116),char(115),char(70),char(108),char(111),char(97),char(116),char(80),char(116),char(114),char(0),char(42),
+char(109),char(95),char(117),char(110),char(115),char(99),char(97),char(108),char(101),char(100),char(80),char(111),char(105),char(110),char(116),char(115),char(68),char(111),char(117),char(98),
+char(108),char(101),char(80),char(116),char(114),char(0),char(109),char(95),char(110),char(117),char(109),char(85),char(110),char(115),char(99),char(97),char(108),char(101),char(100),char(80),
+char(111),char(105),char(110),char(116),char(115),char(0),char(109),char(95),char(112),char(97),char(100),char(100),char(105),char(110),char(103),char(51),char(91),char(52),char(93),char(0),
+char(42),char(109),char(95),char(98),char(114),char(111),char(97),char(100),char(112),char(104),char(97),char(115),char(101),char(72),char(97),char(110),char(100),char(108),char(101),char(0),
+char(42),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(83),char(104),char(97),char(112),char(101),char(0),char(42),char(109),
+char(95),char(114),char(111),char(111),char(116),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(83),char(104),char(97),char(112),char(101),char(0),
+char(109),char(95),char(119),char(111),char(114),char(108),char(100),char(84),char(114),char(97),char(110),char(115),char(102),char(111),char(114),char(109),char(0),char(109),char(95),char(105),
+char(110),char(116),char(101),char(114),char(112),char(111),char(108),char(97),char(116),char(105),char(111),char(110),char(87),char(111),char(114),char(108),char(100),char(84),char(114),char(97),
+char(110),char(115),char(102),char(111),char(114),char(109),char(0),char(109),char(95),char(105),char(110),char(116),char(101),char(114),char(112),char(111),char(108),char(97),char(116),char(105),
+char(111),char(110),char(76),char(105),char(110),char(101),char(97),char(114),char(86),char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(105),
+char(110),char(116),char(101),char(114),char(112),char(111),char(108),char(97),char(116),char(105),char(111),char(110),char(65),char(110),char(103),char(117),char(108),char(97),char(114),char(86),
+char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(110),char(105),char(115),char(111),char(116),char(114),char(111),char(112),char(105),
+char(99),char(70),char(114),char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(99),char(111),char(110),char(116),char(97),char(99),char(116),char(80),
+char(114),char(111),char(99),char(101),char(115),char(115),char(105),char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(100),char(101),char(97),char(99),char(116),char(105),char(118),char(97),char(116),char(105),char(111),char(110),char(84),char(105),char(109),char(101),char(0),char(109),char(95),
+char(102),char(114),char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(114),char(111),char(108),char(108),char(105),char(110),char(103),char(70),char(114),
+char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(105),char(116),char(117),char(116),char(105),char(111),char(110),
+char(0),char(109),char(95),char(104),char(105),char(116),char(70),char(114),char(97),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(99),char(99),char(100),
+char(83),char(119),char(101),char(112),char(116),char(83),char(112),char(104),char(101),char(114),char(101),char(82),char(97),char(100),char(105),char(117),char(115),char(0),char(109),char(95),
+char(99),char(99),char(100),char(77),char(111),char(116),char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(104),char(97),char(115),char(65),char(110),char(105),char(115),char(111),char(116),char(114),char(111),char(112),char(105),char(99),char(70),char(114),char(105),char(99),char(116),
+char(105),char(111),char(110),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(70),char(108),char(97),char(103),char(115),
+char(0),char(109),char(95),char(105),char(115),char(108),char(97),char(110),char(100),char(84),char(97),char(103),char(49),char(0),char(109),char(95),char(99),char(111),char(109),char(112),
+char(97),char(110),char(105),char(111),char(110),char(73),char(100),char(0),char(109),char(95),char(97),char(99),char(116),char(105),char(118),char(97),char(116),char(105),char(111),char(110),
+char(83),char(116),char(97),char(116),char(101),char(49),char(0),char(109),char(95),char(105),char(110),char(116),char(101),char(114),char(110),char(97),char(108),char(84),char(121),char(112),
+char(101),char(0),char(109),char(95),char(99),char(104),char(101),char(99),char(107),char(67),char(111),char(108),char(108),char(105),char(100),char(101),char(87),char(105),char(116),char(104),
+char(0),char(109),char(95),char(115),char(111),char(108),char(118),char(101),char(114),char(73),char(110),char(102),char(111),char(0),char(109),char(95),char(103),char(114),char(97),char(118),
+char(105),char(116),char(121),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),
+char(116),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(105),char(110),char(118),char(73),char(110),char(101),char(114),char(116),char(105),char(97),char(84),char(101),
+char(110),char(115),char(111),char(114),char(87),char(111),char(114),char(108),char(100),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(86),char(101),
+char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(86),char(101),char(108),char(111),
+char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(70),char(97),char(99),char(116),char(111),char(114),
+char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(103),char(114),
+char(97),char(118),char(105),char(116),char(121),char(95),char(97),char(99),char(99),char(101),char(108),char(101),char(114),char(97),char(116),char(105),char(111),char(110),char(0),char(109),
+char(95),char(105),char(110),char(118),char(73),char(110),char(101),char(114),char(116),char(105),char(97),char(76),char(111),char(99),char(97),char(108),char(0),char(109),char(95),char(116),
+char(111),char(116),char(97),char(108),char(70),char(111),char(114),char(99),char(101),char(0),char(109),char(95),char(116),char(111),char(116),char(97),char(108),char(84),char(111),char(114),
+char(113),char(117),char(101),char(0),char(109),char(95),char(105),char(110),char(118),char(101),char(114),char(115),char(101),char(77),char(97),char(115),char(115),char(0),char(109),char(95),
+char(108),char(105),char(110),char(101),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(97),char(110),char(103),char(117),
+char(108),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(97),char(100),char(100),char(105),char(116),char(105),char(111),
+char(110),char(97),char(108),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(97),
+char(100),char(100),char(105),char(116),char(105),char(111),char(110),char(97),char(108),char(76),char(105),char(110),char(101),char(97),char(114),char(68),char(97),char(109),char(112),char(105),
+char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(83),char(113),char(114),char(0),char(109),char(95),char(97),char(100),char(100),
+char(105),char(116),char(105),char(111),char(110),char(97),char(108),char(65),char(110),char(103),char(117),char(108),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),
+char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(83),char(113),char(114),char(0),char(109),char(95),char(97),char(100),char(100),char(105),
+char(116),char(105),char(111),char(110),char(97),char(108),char(65),char(110),char(103),char(117),char(108),char(97),char(114),char(68),char(97),char(109),char(112),char(105),char(110),char(103),
+char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(83),char(108),char(101),char(101),char(112),
+char(105),char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),
+char(97),char(114),char(83),char(108),char(101),char(101),char(112),char(105),char(110),char(103),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),
+char(109),char(95),char(97),char(100),char(100),char(105),char(116),char(105),char(111),char(110),char(97),char(108),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(0),
+char(109),char(95),char(110),char(117),char(109),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(82),char(111),char(119),char(115),char(0),
+char(110),char(117),char(98),char(0),char(42),char(109),char(95),char(114),char(98),char(65),char(0),char(42),char(109),char(95),char(114),char(98),char(66),char(0),char(109),char(95),
+char(111),char(98),char(106),char(101),char(99),char(116),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(117),char(115),char(101),char(114),char(67),char(111),char(110),
+char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(84),char(121),char(112),char(101),char(0),char(109),char(95),char(117),char(115),char(101),char(114),char(67),char(111),
+char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(73),char(100),char(0),char(109),char(95),char(110),char(101),char(101),char(100),char(115),char(70),char(101),
+char(101),char(100),char(98),char(97),char(99),char(107),char(0),char(109),char(95),char(97),char(112),char(112),char(108),char(105),char(101),char(100),char(73),char(109),char(112),char(117),
+char(108),char(115),char(101),char(0),char(109),char(95),char(100),char(98),char(103),char(68),char(114),char(97),char(119),char(83),char(105),char(122),char(101),char(0),char(109),char(95),
+char(100),char(105),char(115),char(97),char(98),char(108),char(101),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(115),char(66),char(101),char(116),
+char(119),char(101),char(101),char(110),char(76),char(105),char(110),char(107),char(101),char(100),char(66),char(111),char(100),char(105),char(101),char(115),char(0),char(109),char(95),char(111),
+char(118),char(101),char(114),char(114),char(105),char(100),char(101),char(78),char(117),char(109),char(83),char(111),char(108),char(118),char(101),char(114),char(73),char(116),char(101),char(114),
+char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(98),char(114),char(101),char(97),char(107),char(105),char(110),char(103),char(73),char(109),char(112),
+char(117),char(108),char(115),char(101),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(105),char(115),char(69),char(110),
+char(97),char(98),char(108),char(101),char(100),char(0),char(109),char(95),char(116),char(121),char(112),char(101),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),
+char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(112),char(105),char(118),char(111),char(116),char(73),char(110),char(65),char(0),char(109),char(95),
+char(112),char(105),char(118),char(111),char(116),char(73),char(110),char(66),char(0),char(109),char(95),char(114),char(98),char(65),char(70),char(114),char(97),char(109),char(101),char(0),
+char(109),char(95),char(114),char(98),char(66),char(70),char(114),char(97),char(109),char(101),char(0),char(109),char(95),char(117),char(115),char(101),char(82),char(101),char(102),char(101),
+char(114),char(101),char(110),char(99),char(101),char(70),char(114),char(97),char(109),char(101),char(65),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),
+char(114),char(79),char(110),char(108),char(121),char(0),char(109),char(95),char(101),char(110),char(97),char(98),char(108),char(101),char(65),char(110),char(103),char(117),char(108),char(97),
+char(114),char(77),char(111),char(116),char(111),char(114),char(0),char(109),char(95),char(109),char(111),char(116),char(111),char(114),char(84),char(97),char(114),char(103),char(101),char(116),
+char(86),char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(109),char(97),char(120),char(77),char(111),char(116),char(111),char(114),char(73),
+char(109),char(112),char(117),char(108),char(115),char(101),char(0),char(109),char(95),char(108),char(111),char(119),char(101),char(114),char(76),char(105),char(109),char(105),char(116),char(0),
+char(109),char(95),char(117),char(112),char(112),char(101),char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(108),char(105),char(109),char(105),char(116),
+char(83),char(111),char(102),char(116),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(98),char(105),char(97),char(115),char(70),char(97),char(99),char(116),char(111),
+char(114),char(0),char(109),char(95),char(114),char(101),char(108),char(97),char(120),char(97),char(116),char(105),char(111),char(110),char(70),char(97),char(99),char(116),char(111),char(114),
+char(0),char(109),char(95),char(115),char(119),char(105),char(110),char(103),char(83),char(112),char(97),char(110),char(49),char(0),char(109),char(95),char(115),char(119),char(105),char(110),
+char(103),char(83),char(112),char(97),char(110),char(50),char(0),char(109),char(95),char(116),char(119),char(105),char(115),char(116),char(83),char(112),char(97),char(110),char(0),char(109),
+char(95),char(100),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(85),char(112),char(112),
+char(101),char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(76),char(111),char(119),char(101),
+char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(85),char(112),char(112),char(101),
+char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(97),char(110),char(103),char(117),char(108),char(97),char(114),char(76),char(111),char(119),char(101),
+char(114),char(76),char(105),char(109),char(105),char(116),char(0),char(109),char(95),char(117),char(115),char(101),char(76),char(105),char(110),char(101),char(97),char(114),char(82),char(101),
+char(102),char(101),char(114),char(101),char(110),char(99),char(101),char(70),char(114),char(97),char(109),char(101),char(65),char(0),char(109),char(95),char(117),char(115),char(101),char(79),
+char(102),char(102),char(115),char(101),char(116),char(70),char(111),char(114),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(70),char(114),
+char(97),char(109),char(101),char(0),char(109),char(95),char(54),char(100),char(111),char(102),char(68),char(97),char(116),char(97),char(0),char(109),char(95),char(115),char(112),char(114),
+char(105),char(110),char(103),char(69),char(110),char(97),char(98),char(108),char(101),char(100),char(91),char(54),char(93),char(0),char(109),char(95),char(101),char(113),char(117),char(105),
+char(108),char(105),char(98),char(114),char(105),char(117),char(109),char(80),char(111),char(105),char(110),char(116),char(91),char(54),char(93),char(0),char(109),char(95),char(115),char(112),
+char(114),char(105),char(110),char(103),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(91),char(54),char(93),char(0),char(109),char(95),char(115),
+char(112),char(114),char(105),char(110),char(103),char(68),char(97),char(109),char(112),char(105),char(110),char(103),char(91),char(54),char(93),char(0),char(109),char(95),char(116),char(97),
+char(117),char(0),char(109),char(95),char(116),char(105),char(109),char(101),char(83),char(116),char(101),char(112),char(0),char(109),char(95),char(109),char(97),char(120),char(69),char(114),
+char(114),char(111),char(114),char(82),char(101),char(100),char(117),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(115),char(111),char(114),char(0),char(109),
+char(95),char(101),char(114),char(112),char(0),char(109),char(95),char(101),char(114),char(112),char(50),char(0),char(109),char(95),char(103),char(108),char(111),char(98),char(97),char(108),
+char(67),char(102),char(109),char(0),char(109),char(95),char(115),char(112),char(108),char(105),char(116),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(80),char(101),
+char(110),char(101),char(116),char(114),char(97),char(116),char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(115),char(112),char(108),char(105),char(116),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(84),char(117),char(114),char(110),char(69),char(114),char(112),
+char(0),char(109),char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(83),char(108),char(111),char(112),char(0),char(109),char(95),char(119),char(97),char(114),char(109),
+char(115),char(116),char(97),char(114),char(116),char(105),char(110),char(103),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(109),char(97),char(120),
+char(71),char(121),char(114),char(111),char(115),char(99),char(111),char(112),char(105),char(99),char(70),char(111),char(114),char(99),char(101),char(0),char(109),char(95),char(115),char(105),
+char(110),char(103),char(108),char(101),char(65),char(120),char(105),char(115),char(82),char(111),char(108),char(108),char(105),char(110),char(103),char(70),char(114),char(105),char(99),char(116),
+char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),char(95),char(110),char(117),char(109),char(73),char(116),
+char(101),char(114),char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(115),char(111),char(108),char(118),char(101),char(114),char(77),char(111),char(100),
+char(101),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(105),char(110),char(103),char(67),char(111),char(110),char(116),char(97),char(99),char(116),char(82),char(101),
+char(115),char(116),char(105),char(116),char(117),char(116),char(105),char(111),char(110),char(84),char(104),char(114),char(101),char(115),char(104),char(111),char(108),char(100),char(0),char(109),
+char(95),char(109),char(105),char(110),char(105),char(109),char(117),char(109),char(83),char(111),char(108),char(118),char(101),char(114),char(66),char(97),char(116),char(99),char(104),char(83),
+char(105),char(122),char(101),char(0),char(109),char(95),char(115),char(112),char(108),char(105),char(116),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(0),char(109),
+char(95),char(108),char(105),char(110),char(101),char(97),char(114),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(97),
+char(110),char(103),char(117),char(108),char(97),char(114),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(118),char(111),
+char(108),char(117),char(109),char(101),char(83),char(116),char(105),char(102),char(102),char(110),char(101),char(115),char(115),char(0),char(42),char(109),char(95),char(109),char(97),char(116),
+char(101),char(114),char(105),char(97),char(108),char(0),char(109),char(95),char(112),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(112),
+char(114),char(101),char(118),char(105),char(111),char(117),char(115),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(118),char(101),
+char(108),char(111),char(99),char(105),char(116),char(121),char(0),char(109),char(95),char(97),char(99),char(99),char(117),char(109),char(117),char(108),char(97),char(116),char(101),char(100),
+char(70),char(111),char(114),char(99),char(101),char(0),char(109),char(95),char(110),char(111),char(114),char(109),char(97),char(108),char(0),char(109),char(95),char(97),char(114),char(101),
+char(97),char(0),char(109),char(95),char(97),char(116),char(116),char(97),char(99),char(104),char(0),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),
+char(105),char(99),char(101),char(115),char(91),char(50),char(93),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(76),char(101),char(110),char(103),char(116),char(104),
+char(0),char(109),char(95),char(98),char(98),char(101),char(110),char(100),char(105),char(110),char(103),char(0),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),
+char(100),char(105),char(99),char(101),char(115),char(91),char(51),char(93),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(65),char(114),char(101),char(97),char(0),
+char(109),char(95),char(99),char(48),char(91),char(52),char(93),char(0),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),char(105),char(99),char(101),
+char(115),char(91),char(52),char(93),char(0),char(109),char(95),char(114),char(101),char(115),char(116),char(86),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),
+char(99),char(49),char(0),char(109),char(95),char(99),char(50),char(0),char(109),char(95),char(99),char(48),char(0),char(109),char(95),char(108),char(111),char(99),char(97),char(108),
+char(70),char(114),char(97),char(109),char(101),char(0),char(42),char(109),char(95),char(114),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(0),char(109),
+char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),char(101),char(120),char(0),char(109),char(95),char(97),char(101),char(114),char(111),char(77),char(111),char(100),
+char(101),char(108),char(0),char(109),char(95),char(98),char(97),char(117),char(109),char(103),char(97),char(114),char(116),char(101),char(0),char(109),char(95),char(100),char(114),char(97),
+char(103),char(0),char(109),char(95),char(108),char(105),char(102),char(116),char(0),char(109),char(95),char(112),char(114),char(101),char(115),char(115),char(117),char(114),char(101),char(0),
+char(109),char(95),char(118),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),char(100),char(121),char(110),char(97),char(109),char(105),char(99),char(70),char(114),
+char(105),char(99),char(116),char(105),char(111),char(110),char(0),char(109),char(95),char(112),char(111),char(115),char(101),char(77),char(97),char(116),char(99),char(104),char(0),char(109),
+char(95),char(114),char(105),char(103),char(105),char(100),char(67),char(111),char(110),char(116),char(97),char(99),char(116),char(72),char(97),char(114),char(100),char(110),char(101),char(115),
+char(115),char(0),char(109),char(95),char(107),char(105),char(110),char(101),char(116),char(105),char(99),char(67),char(111),char(110),char(116),char(97),char(99),char(116),char(72),char(97),
+char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(67),char(111),char(110),char(116),char(97),char(99),char(116),
+char(72),char(97),char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(97),char(110),char(99),char(104),char(111),char(114),char(72),char(97),char(114),
+char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(82),char(105),char(103),char(105),char(100),char(67),char(108),char(117),
+char(115),char(116),char(101),char(114),char(72),char(97),char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(75),
+char(105),char(110),char(101),char(116),char(105),char(99),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(72),char(97),char(114),char(100),char(110),char(101),char(115),
+char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(83),char(111),char(102),char(116),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(72),
+char(97),char(114),char(100),char(110),char(101),char(115),char(115),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(82),char(105),char(103),char(105),char(100),char(67),
+char(108),char(117),char(115),char(116),char(101),char(114),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(83),char(112),char(108),char(105),char(116),char(0),char(109),
+char(95),char(115),char(111),char(102),char(116),char(75),char(105),char(110),char(101),char(116),char(105),char(99),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(73),
+char(109),char(112),char(117),char(108),char(115),char(101),char(83),char(112),char(108),char(105),char(116),char(0),char(109),char(95),char(115),char(111),char(102),char(116),char(83),char(111),
+char(102),char(116),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(83),char(112),char(108),char(105),
+char(116),char(0),char(109),char(95),char(109),char(97),char(120),char(86),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),char(116),char(105),char(109),char(101),
+char(83),char(99),char(97),char(108),char(101),char(0),char(109),char(95),char(118),char(101),char(108),char(111),char(99),char(105),char(116),char(121),char(73),char(116),char(101),char(114),
+char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(112),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(73),char(116),char(101),
+char(114),char(97),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(100),char(114),char(105),char(102),char(116),char(73),char(116),char(101),char(114),char(97),
+char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(99),char(108),char(117),char(115),char(116),char(101),char(114),char(73),char(116),char(101),char(114),char(97),
+char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(114),char(111),char(116),char(0),char(109),char(95),char(115),char(99),char(97),char(108),char(101),char(0),
+char(109),char(95),char(97),char(113),char(113),char(0),char(109),char(95),char(99),char(111),char(109),char(0),char(42),char(109),char(95),char(112),char(111),char(115),char(105),char(116),
+char(105),char(111),char(110),char(115),char(0),char(42),char(109),char(95),char(119),char(101),char(105),char(103),char(104),char(116),char(115),char(0),char(109),char(95),char(110),char(117),
+char(109),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(87),char(101),char(105),char(103),
+char(116),char(115),char(0),char(109),char(95),char(98),char(118),char(111),char(108),char(117),char(109),char(101),char(0),char(109),char(95),char(98),char(102),char(114),char(97),char(109),
+char(101),char(0),char(109),char(95),char(102),char(114),char(97),char(109),char(101),char(120),char(102),char(111),char(114),char(109),char(0),char(109),char(95),char(108),char(111),char(99),
+char(105),char(105),char(0),char(109),char(95),char(105),char(110),char(118),char(119),char(105),char(0),char(109),char(95),char(118),char(105),char(109),char(112),char(117),char(108),char(115),
+char(101),char(115),char(91),char(50),char(93),char(0),char(109),char(95),char(100),char(105),char(109),char(112),char(117),char(108),char(115),char(101),char(115),char(91),char(50),char(93),
+char(0),char(109),char(95),char(108),char(118),char(0),char(109),char(95),char(97),char(118),char(0),char(42),char(109),char(95),char(102),char(114),char(97),char(109),char(101),char(114),
+char(101),char(102),char(115),char(0),char(42),char(109),char(95),char(110),char(111),char(100),char(101),char(73),char(110),char(100),char(105),char(99),char(101),char(115),char(0),char(42),
+char(109),char(95),char(109),char(97),char(115),char(115),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(70),char(114),char(97),char(109),char(101),char(82),
+char(101),char(102),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(78),char(111),char(100),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),
+char(77),char(97),char(115),char(115),char(101),char(115),char(0),char(109),char(95),char(105),char(100),char(109),char(97),char(115),char(115),char(0),char(109),char(95),char(105),char(109),
+char(97),char(115),char(115),char(0),char(109),char(95),char(110),char(118),char(105),char(109),char(112),char(117),char(108),char(115),char(101),char(115),char(0),char(109),char(95),char(110),
+char(100),char(105),char(109),char(112),char(117),char(108),char(115),char(101),char(115),char(0),char(109),char(95),char(110),char(100),char(97),char(109),char(112),char(105),char(110),char(103),
+char(0),char(109),char(95),char(108),char(100),char(97),char(109),char(112),char(105),char(110),char(103),char(0),char(109),char(95),char(97),char(100),char(97),char(109),char(112),char(105),
+char(110),char(103),char(0),char(109),char(95),char(109),char(97),char(116),char(99),char(104),char(105),char(110),char(103),char(0),char(109),char(95),char(109),char(97),char(120),char(83),
+char(101),char(108),char(102),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(73),char(109),char(112),char(117),char(108),char(115),char(101),char(0),
+char(109),char(95),char(115),char(101),char(108),char(102),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(73),char(109),char(112),char(117),char(108),
+char(115),char(101),char(70),char(97),char(99),char(116),char(111),char(114),char(0),char(109),char(95),char(99),char(111),char(110),char(116),char(97),char(105),char(110),char(115),char(65),
+char(110),char(99),char(104),char(111),char(114),char(0),char(109),char(95),char(99),char(111),char(108),char(108),char(105),char(100),char(101),char(0),char(109),char(95),char(99),char(108),
+char(117),char(115),char(116),char(101),char(114),char(73),char(110),char(100),char(101),char(120),char(0),char(42),char(109),char(95),char(98),char(111),char(100),char(121),char(65),char(0),
+char(42),char(109),char(95),char(98),char(111),char(100),char(121),char(66),char(0),char(109),char(95),char(114),char(101),char(102),char(115),char(91),char(50),char(93),char(0),char(109),
+char(95),char(99),char(102),char(109),char(0),char(109),char(95),char(115),char(112),char(108),char(105),char(116),char(0),char(109),char(95),char(100),char(101),char(108),char(101),char(116),
+char(101),char(0),char(109),char(95),char(114),char(101),char(108),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(91),char(50),char(93),char(0),char(109),
+char(95),char(98),char(111),char(100),char(121),char(65),char(116),char(121),char(112),char(101),char(0),char(109),char(95),char(98),char(111),char(100),char(121),char(66),char(116),char(121),
+char(112),char(101),char(0),char(109),char(95),char(106),char(111),char(105),char(110),char(116),char(84),char(121),char(112),char(101),char(0),char(42),char(109),char(95),char(112),char(111),
+char(115),char(101),char(0),char(42),char(42),char(109),char(95),char(109),char(97),char(116),char(101),char(114),char(105),char(97),char(108),char(115),char(0),char(42),char(109),char(95),
+char(110),char(111),char(100),char(101),char(115),char(0),char(42),char(109),char(95),char(108),char(105),char(110),char(107),char(115),char(0),char(42),char(109),char(95),char(102),char(97),
+char(99),char(101),char(115),char(0),char(42),char(109),char(95),char(116),char(101),char(116),char(114),char(97),char(104),char(101),char(100),char(114),char(97),char(0),char(42),char(109),
+char(95),char(97),char(110),char(99),char(104),char(111),char(114),char(115),char(0),char(42),char(109),char(95),char(99),char(108),char(117),char(115),char(116),char(101),char(114),char(115),
+char(0),char(42),char(109),char(95),char(106),char(111),char(105),char(110),char(116),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(77),char(97),char(116),char(101),
+char(114),char(105),char(97),char(108),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(76),char(105),char(110),char(107),char(115),char(0),char(109),char(95),char(110),
+char(117),char(109),char(70),char(97),char(99),char(101),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(84),char(101),char(116),char(114),char(97),char(104),char(101),
+char(100),char(114),char(97),char(0),char(109),char(95),char(110),char(117),char(109),char(65),char(110),char(99),char(104),char(111),char(114),char(115),char(0),char(109),char(95),char(110),
+char(117),char(109),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(115),char(0),char(109),char(95),char(110),char(117),char(109),char(74),char(111),char(105),char(110),
+char(116),char(115),char(0),char(109),char(95),char(99),char(111),char(110),char(102),char(105),char(103),char(0),char(84),char(89),char(80),char(69),char(76),char(0),char(0),char(0),
+char(99),char(104),char(97),char(114),char(0),char(117),char(99),char(104),char(97),char(114),char(0),char(115),char(104),char(111),char(114),char(116),char(0),char(117),char(115),char(104),
+char(111),char(114),char(116),char(0),char(105),char(110),char(116),char(0),char(108),char(111),char(110),char(103),char(0),char(117),char(108),char(111),char(110),char(103),char(0),char(102),
+char(108),char(111),char(97),char(116),char(0),char(100),char(111),char(117),char(98),char(108),char(101),char(0),char(118),char(111),char(105),char(100),char(0),char(80),char(111),char(105),
+char(110),char(116),char(101),char(114),char(65),char(114),char(114),char(97),char(121),char(0),char(98),char(116),char(80),char(104),char(121),char(115),char(105),char(99),char(115),char(83),
+char(121),char(115),char(116),char(101),char(109),char(0),char(76),char(105),char(115),char(116),char(66),char(97),char(115),char(101),char(0),char(98),char(116),char(86),char(101),char(99),
+char(116),char(111),char(114),char(51),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(86),char(101),char(99),char(116),
+char(111),char(114),char(51),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(77),char(97),char(116),char(114),
+char(105),char(120),char(51),char(120),char(51),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(77),char(97),char(116),
+char(114),char(105),char(120),char(51),char(120),char(51),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),
+char(114),char(97),char(110),char(115),char(102),char(111),char(114),char(109),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(84),char(114),char(97),char(110),char(115),char(102),char(111),char(114),char(109),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),
+char(98),char(116),char(66),char(118),char(104),char(83),char(117),char(98),char(116),char(114),char(101),char(101),char(73),char(110),char(102),char(111),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(79),char(112),char(116),char(105),char(109),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(78),char(111),char(100),char(101),char(70),
+char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(79),char(112),char(116),char(105),char(109),char(105),char(122),char(101),char(100),
+char(66),char(118),char(104),char(78),char(111),char(100),char(101),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(78),char(111),char(100),char(101),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(70),char(108),char(111),char(97),char(116),
+char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(81),char(117),char(97),char(110),char(116),char(105),char(122),char(101),char(100),char(66),char(118),char(104),char(68),
+char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),
+char(110),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(83),char(116),char(97),char(116),char(105),char(99),char(80),
+char(108),char(97),char(110),char(101),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(118),
+char(101),char(120),char(73),char(110),char(116),char(101),char(114),char(110),char(97),char(108),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),
+char(98),char(116),char(80),char(111),char(115),char(105),char(116),char(105),char(111),char(110),char(65),char(110),char(100),char(82),char(97),char(100),char(105),char(117),char(115),char(0),
+char(98),char(116),char(77),char(117),char(108),char(116),char(105),char(83),char(112),char(104),char(101),char(114),char(101),char(83),char(104),char(97),char(112),char(101),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(73),char(110),char(116),char(73),char(110),char(100),char(101),char(120),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(104),char(111),char(114),char(116),char(73),char(110),char(116),char(73),char(110),char(100),char(101),char(120),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(104),char(111),char(114),char(116),char(73),char(110),char(116),char(73),char(110),char(100),char(101),char(120),char(84),char(114),char(105),char(112),char(108),char(101),char(116),
+char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(104),char(97),char(114),char(73),char(110),char(100),char(101),char(120),char(84),char(114),char(105),char(112),
+char(108),char(101),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(77),char(101),char(115),char(104),char(80),char(97),char(114),char(116),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(83),char(116),char(114),char(105),char(100),char(105),char(110),char(103),char(77),char(101),char(115),char(104),char(73),char(110),char(116),
+char(101),char(114),char(102),char(97),char(99),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),char(114),char(105),char(97),char(110),char(103),char(108),
+char(101),char(77),char(101),char(115),char(104),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),char(114),char(105),
+char(97),char(110),char(103),char(108),char(101),char(73),char(110),char(102),char(111),char(77),char(97),char(112),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(83),
+char(99),char(97),char(108),char(101),char(100),char(84),char(114),char(105),char(97),char(110),char(103),char(108),char(101),char(77),char(101),char(115),char(104),char(83),char(104),char(97),
+char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(109),char(112),char(111),char(117),char(110),char(100),char(83),char(104),char(97),
+char(112),char(101),char(67),char(104),char(105),char(108),char(100),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(109),char(112),char(111),char(117),
+char(110),char(100),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(121),char(108),char(105),char(110),char(100),
+char(101),char(114),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(97),char(112),char(115),char(117),char(108),
+char(101),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(84),char(114),char(105),char(97),char(110),char(103),char(108),
+char(101),char(73),char(110),char(102),char(111),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(71),char(73),char(109),char(112),char(97),char(99),char(116),char(77),
+char(101),char(115),char(104),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(118),char(101),
+char(120),char(72),char(117),char(108),char(108),char(83),char(104),char(97),char(112),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(108),
+char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),char(116),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(108),char(108),char(105),char(115),char(105),char(111),char(110),char(79),char(98),char(106),char(101),char(99),char(116),
+char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(68),char(121),char(110),char(97),char(109),char(105),char(99),char(115),
+char(87),char(111),char(114),char(108),char(100),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),
+char(110),char(116),char(97),char(99),char(116),char(83),char(111),char(108),char(118),char(101),char(114),char(73),char(110),char(102),char(111),char(68),char(111),char(117),char(98),char(108),
+char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(68),char(121),char(110),char(97),char(109),char(105),char(99),char(115),char(87),char(111),char(114),char(108),
+char(100),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(116),char(97),char(99),char(116),
+char(83),char(111),char(108),char(118),char(101),char(114),char(73),char(110),char(102),char(111),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),
+char(98),char(116),char(82),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(82),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(73),char(110),char(102),char(111),char(49),
+char(0),char(98),char(116),char(84),char(121),char(112),char(101),char(100),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(97),
+char(116),char(97),char(0),char(98),char(116),char(82),char(105),char(103),char(105),char(100),char(66),char(111),char(100),char(121),char(68),char(97),char(116),char(97),char(0),char(98),
+char(116),char(80),char(111),char(105),char(110),char(116),char(50),char(80),char(111),char(105),char(110),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),
+char(110),char(116),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(80),char(111),char(105),char(110),char(116),char(50),
+char(80),char(111),char(105),char(110),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(111),char(117),char(98),char(108),
+char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(72),char(105),char(110),char(103),char(101),char(67),char(111),char(110),char(115),char(116),char(114),char(97),
+char(105),char(110),char(116),char(68),char(111),char(117),char(98),char(108),char(101),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(72),char(105),char(110),char(103),
+char(101),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),
+char(0),char(98),char(116),char(67),char(111),char(110),char(101),char(84),char(119),char(105),char(115),char(116),char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),
+char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(71),char(101),char(110),char(101),char(114),char(105),char(99),char(54),char(68),char(111),char(102),
+char(67),char(111),char(110),char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(71),char(101),char(110),
+char(101),char(114),char(105),char(99),char(54),char(68),char(111),char(102),char(83),char(112),char(114),char(105),char(110),char(103),char(67),char(111),char(110),char(115),char(116),char(114),
+char(97),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),char(83),char(108),char(105),char(100),char(101),char(114),char(67),char(111),char(110),
+char(115),char(116),char(114),char(97),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),
+char(77),char(97),char(116),char(101),char(114),char(105),char(97),char(108),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),
+char(121),char(78),char(111),char(100),char(101),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(76),char(105),
+char(110),char(107),char(68),char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(70),char(97),char(99),char(101),char(68),
+char(97),char(116),char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(84),char(101),char(116),char(114),char(97),char(68),char(97),char(116),
+char(97),char(0),char(83),char(111),char(102),char(116),char(82),char(105),char(103),char(105),char(100),char(65),char(110),char(99),char(104),char(111),char(114),char(68),char(97),char(116),
+char(97),char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(67),char(111),char(110),char(102),char(105),char(103),char(68),char(97),char(116),char(97),
+char(0),char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(80),char(111),char(115),char(101),char(68),char(97),char(116),char(97),char(0),char(83),char(111),
+char(102),char(116),char(66),char(111),char(100),char(121),char(67),char(108),char(117),char(115),char(116),char(101),char(114),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(74),char(111),char(105),char(110),char(116),char(68),char(97),char(116),char(97),char(0),char(98),char(116),
+char(83),char(111),char(102),char(116),char(66),char(111),char(100),char(121),char(70),char(108),char(111),char(97),char(116),char(68),char(97),char(116),char(97),char(0),char(0),char(0),
+char(84),char(76),char(69),char(78),char(1),char(0),char(1),char(0),char(2),char(0),char(2),char(0),char(4),char(0),char(4),char(0),char(4),char(0),char(4),char(0),
+char(8),char(0),char(0),char(0),char(16),char(0),char(48),char(0),char(16),char(0),char(16),char(0),char(32),char(0),char(48),char(0),char(96),char(0),char(64),char(0),
+char(-128),char(0),char(20),char(0),char(48),char(0),char(80),char(0),char(16),char(0),char(96),char(0),char(-112),char(0),char(16),char(0),char(56),char(0),char(56),char(0),
+char(20),char(0),char(72),char(0),char(4),char(0),char(4),char(0),char(8),char(0),char(4),char(0),char(56),char(0),char(32),char(0),char(80),char(0),char(72),char(0),
+char(96),char(0),char(80),char(0),char(32),char(0),char(64),char(0),char(64),char(0),char(16),char(0),char(72),char(0),char(80),char(0),char(-32),char(1),char(16),char(1),
+char(-72),char(0),char(-104),char(0),char(104),char(0),char(88),char(0),char(-8),char(1),char(-80),char(3),char(8),char(0),char(64),char(0),char(0),char(0),char(96),char(0),
+char(-128),char(0),char(104),char(1),char(-24),char(0),char(-32),char(0),char(8),char(1),char(104),char(1),char(-40),char(0),char(16),char(0),char(104),char(0),char(24),char(0),
+char(40),char(0),char(104),char(0),char(96),char(0),char(104),char(0),char(-56),char(0),char(104),char(1),char(112),char(0),char(-32),char(1),char(83),char(84),char(82),char(67),
+char(65),char(0),char(0),char(0),char(10),char(0),char(3),char(0),char(4),char(0),char(0),char(0),char(4),char(0),char(1),char(0),char(9),char(0),char(2),char(0),
+char(11),char(0),char(3),char(0),char(10),char(0),char(3),char(0),char(10),char(0),char(4),char(0),char(10),char(0),char(5),char(0),char(12),char(0),char(2),char(0),
+char(9),char(0),char(6),char(0),char(9),char(0),char(7),char(0),char(13),char(0),char(1),char(0),char(7),char(0),char(8),char(0),char(14),char(0),char(1),char(0),
+char(8),char(0),char(8),char(0),char(15),char(0),char(1),char(0),char(13),char(0),char(9),char(0),char(16),char(0),char(1),char(0),char(14),char(0),char(9),char(0),
+char(17),char(0),char(2),char(0),char(15),char(0),char(10),char(0),char(13),char(0),char(11),char(0),char(18),char(0),char(2),char(0),char(16),char(0),char(10),char(0),
+char(14),char(0),char(11),char(0),char(19),char(0),char(4),char(0),char(4),char(0),char(12),char(0),char(4),char(0),char(13),char(0),char(2),char(0),char(14),char(0),
+char(2),char(0),char(15),char(0),char(20),char(0),char(6),char(0),char(13),char(0),char(16),char(0),char(13),char(0),char(17),char(0),char(4),char(0),char(18),char(0),
+char(4),char(0),char(19),char(0),char(4),char(0),char(20),char(0),char(0),char(0),char(21),char(0),char(21),char(0),char(6),char(0),char(14),char(0),char(16),char(0),
+char(14),char(0),char(17),char(0),char(4),char(0),char(18),char(0),char(4),char(0),char(19),char(0),char(4),char(0),char(20),char(0),char(0),char(0),char(21),char(0),
+char(22),char(0),char(3),char(0),char(2),char(0),char(14),char(0),char(2),char(0),char(15),char(0),char(4),char(0),char(22),char(0),char(23),char(0),char(12),char(0),
+char(13),char(0),char(23),char(0),char(13),char(0),char(24),char(0),char(13),char(0),char(25),char(0),char(4),char(0),char(26),char(0),char(4),char(0),char(27),char(0),
+char(4),char(0),char(28),char(0),char(4),char(0),char(29),char(0),char(20),char(0),char(30),char(0),char(22),char(0),char(31),char(0),char(19),char(0),char(32),char(0),
+char(4),char(0),char(33),char(0),char(4),char(0),char(34),char(0),char(24),char(0),char(12),char(0),char(14),char(0),char(23),char(0),char(14),char(0),char(24),char(0),
+char(14),char(0),char(25),char(0),char(4),char(0),char(26),char(0),char(4),char(0),char(27),char(0),char(4),char(0),char(28),char(0),char(4),char(0),char(29),char(0),
+char(21),char(0),char(30),char(0),char(22),char(0),char(31),char(0),char(4),char(0),char(33),char(0),char(4),char(0),char(34),char(0),char(19),char(0),char(32),char(0),
+char(25),char(0),char(3),char(0),char(0),char(0),char(35),char(0),char(4),char(0),char(36),char(0),char(0),char(0),char(37),char(0),char(26),char(0),char(5),char(0),
+char(25),char(0),char(38),char(0),char(13),char(0),char(39),char(0),char(13),char(0),char(40),char(0),char(7),char(0),char(41),char(0),char(0),char(0),char(21),char(0),
+char(27),char(0),char(5),char(0),char(25),char(0),char(38),char(0),char(13),char(0),char(39),char(0),char(13),char(0),char(42),char(0),char(7),char(0),char(43),char(0),
+char(4),char(0),char(44),char(0),char(28),char(0),char(2),char(0),char(13),char(0),char(45),char(0),char(7),char(0),char(46),char(0),char(29),char(0),char(4),char(0),
+char(27),char(0),char(47),char(0),char(28),char(0),char(48),char(0),char(4),char(0),char(49),char(0),char(0),char(0),char(37),char(0),char(30),char(0),char(1),char(0),
+char(4),char(0),char(50),char(0),char(31),char(0),char(2),char(0),char(2),char(0),char(50),char(0),char(0),char(0),char(51),char(0),char(32),char(0),char(2),char(0),
+char(2),char(0),char(52),char(0),char(0),char(0),char(51),char(0),char(33),char(0),char(2),char(0),char(0),char(0),char(52),char(0),char(0),char(0),char(53),char(0),
+char(34),char(0),char(8),char(0),char(13),char(0),char(54),char(0),char(14),char(0),char(55),char(0),char(30),char(0),char(56),char(0),char(32),char(0),char(57),char(0),
+char(33),char(0),char(58),char(0),char(31),char(0),char(59),char(0),char(4),char(0),char(60),char(0),char(4),char(0),char(61),char(0),char(35),char(0),char(4),char(0),
+char(34),char(0),char(62),char(0),char(13),char(0),char(63),char(0),char(4),char(0),char(64),char(0),char(0),char(0),char(37),char(0),char(36),char(0),char(7),char(0),
+char(25),char(0),char(38),char(0),char(35),char(0),char(65),char(0),char(23),char(0),char(66),char(0),char(24),char(0),char(67),char(0),char(37),char(0),char(68),char(0),
+char(7),char(0),char(43),char(0),char(0),char(0),char(69),char(0),char(38),char(0),char(2),char(0),char(36),char(0),char(70),char(0),char(13),char(0),char(39),char(0),
+char(39),char(0),char(4),char(0),char(17),char(0),char(71),char(0),char(25),char(0),char(72),char(0),char(4),char(0),char(73),char(0),char(7),char(0),char(74),char(0),
+char(40),char(0),char(4),char(0),char(25),char(0),char(38),char(0),char(39),char(0),char(75),char(0),char(4),char(0),char(76),char(0),char(7),char(0),char(43),char(0),
+char(41),char(0),char(3),char(0),char(27),char(0),char(47),char(0),char(4),char(0),char(77),char(0),char(0),char(0),char(37),char(0),char(42),char(0),char(3),char(0),
+char(27),char(0),char(47),char(0),char(4),char(0),char(77),char(0),char(0),char(0),char(37),char(0),char(43),char(0),char(4),char(0),char(4),char(0),char(78),char(0),
+char(7),char(0),char(79),char(0),char(7),char(0),char(80),char(0),char(7),char(0),char(81),char(0),char(37),char(0),char(14),char(0),char(4),char(0),char(82),char(0),
+char(4),char(0),char(83),char(0),char(43),char(0),char(84),char(0),char(4),char(0),char(85),char(0),char(7),char(0),char(86),char(0),char(7),char(0),char(87),char(0),
+char(7),char(0),char(88),char(0),char(7),char(0),char(89),char(0),char(7),char(0),char(90),char(0),char(4),char(0),char(91),char(0),char(4),char(0),char(92),char(0),
+char(4),char(0),char(93),char(0),char(4),char(0),char(94),char(0),char(0),char(0),char(37),char(0),char(44),char(0),char(5),char(0),char(25),char(0),char(38),char(0),
+char(35),char(0),char(65),char(0),char(13),char(0),char(39),char(0),char(7),char(0),char(43),char(0),char(4),char(0),char(95),char(0),char(45),char(0),char(5),char(0),
+char(27),char(0),char(47),char(0),char(13),char(0),char(96),char(0),char(14),char(0),char(97),char(0),char(4),char(0),char(98),char(0),char(0),char(0),char(99),char(0),
+char(46),char(0),char(25),char(0),char(9),char(0),char(100),char(0),char(9),char(0),char(101),char(0),char(25),char(0),char(102),char(0),char(0),char(0),char(35),char(0),
+char(18),char(0),char(103),char(0),char(18),char(0),char(104),char(0),char(14),char(0),char(105),char(0),char(14),char(0),char(106),char(0),char(14),char(0),char(107),char(0),
+char(8),char(0),char(108),char(0),char(8),char(0),char(109),char(0),char(8),char(0),char(110),char(0),char(8),char(0),char(111),char(0),char(8),char(0),char(112),char(0),
+char(8),char(0),char(113),char(0),char(8),char(0),char(114),char(0),char(8),char(0),char(115),char(0),char(4),char(0),char(116),char(0),char(4),char(0),char(117),char(0),
+char(4),char(0),char(118),char(0),char(4),char(0),char(119),char(0),char(4),char(0),char(120),char(0),char(4),char(0),char(121),char(0),char(4),char(0),char(122),char(0),
+char(0),char(0),char(37),char(0),char(47),char(0),char(25),char(0),char(9),char(0),char(100),char(0),char(9),char(0),char(101),char(0),char(25),char(0),char(102),char(0),
+char(0),char(0),char(35),char(0),char(17),char(0),char(103),char(0),char(17),char(0),char(104),char(0),char(13),char(0),char(105),char(0),char(13),char(0),char(106),char(0),
+char(13),char(0),char(107),char(0),char(7),char(0),char(108),char(0),char(7),char(0),char(109),char(0),char(7),char(0),char(110),char(0),char(7),char(0),char(111),char(0),
+char(7),char(0),char(112),char(0),char(7),char(0),char(113),char(0),char(7),char(0),char(114),char(0),char(7),char(0),char(115),char(0),char(4),char(0),char(116),char(0),
+char(4),char(0),char(117),char(0),char(4),char(0),char(118),char(0),char(4),char(0),char(119),char(0),char(4),char(0),char(120),char(0),char(4),char(0),char(121),char(0),
+char(4),char(0),char(122),char(0),char(0),char(0),char(37),char(0),char(48),char(0),char(2),char(0),char(49),char(0),char(123),char(0),char(14),char(0),char(124),char(0),
+char(50),char(0),char(2),char(0),char(51),char(0),char(123),char(0),char(13),char(0),char(124),char(0),char(52),char(0),char(21),char(0),char(47),char(0),char(125),char(0),
+char(15),char(0),char(126),char(0),char(13),char(0),char(127),char(0),char(13),char(0),char(-128),char(0),char(13),char(0),char(-127),char(0),char(13),char(0),char(-126),char(0),
+char(13),char(0),char(124),char(0),char(13),char(0),char(-125),char(0),char(13),char(0),char(-124),char(0),char(13),char(0),char(-123),char(0),char(13),char(0),char(-122),char(0),
+char(7),char(0),char(-121),char(0),char(7),char(0),char(-120),char(0),char(7),char(0),char(-119),char(0),char(7),char(0),char(-118),char(0),char(7),char(0),char(-117),char(0),
+char(7),char(0),char(-116),char(0),char(7),char(0),char(-115),char(0),char(7),char(0),char(-114),char(0),char(7),char(0),char(-113),char(0),char(4),char(0),char(-112),char(0),
+char(53),char(0),char(22),char(0),char(46),char(0),char(125),char(0),char(16),char(0),char(126),char(0),char(14),char(0),char(127),char(0),char(14),char(0),char(-128),char(0),
+char(14),char(0),char(-127),char(0),char(14),char(0),char(-126),char(0),char(14),char(0),char(124),char(0),char(14),char(0),char(-125),char(0),char(14),char(0),char(-124),char(0),
+char(14),char(0),char(-123),char(0),char(14),char(0),char(-122),char(0),char(8),char(0),char(-121),char(0),char(8),char(0),char(-120),char(0),char(8),char(0),char(-119),char(0),
+char(8),char(0),char(-118),char(0),char(8),char(0),char(-117),char(0),char(8),char(0),char(-116),char(0),char(8),char(0),char(-115),char(0),char(8),char(0),char(-114),char(0),
+char(8),char(0),char(-113),char(0),char(4),char(0),char(-112),char(0),char(0),char(0),char(37),char(0),char(54),char(0),char(2),char(0),char(4),char(0),char(-111),char(0),
+char(4),char(0),char(-110),char(0),char(55),char(0),char(13),char(0),char(56),char(0),char(-109),char(0),char(56),char(0),char(-108),char(0),char(0),char(0),char(35),char(0),
+char(4),char(0),char(-107),char(0),char(4),char(0),char(-106),char(0),char(4),char(0),char(-105),char(0),char(4),char(0),char(-104),char(0),char(7),char(0),char(-103),char(0),
+char(7),char(0),char(-102),char(0),char(4),char(0),char(-101),char(0),char(4),char(0),char(-100),char(0),char(7),char(0),char(-99),char(0),char(4),char(0),char(-98),char(0),
+char(57),char(0),char(3),char(0),char(55),char(0),char(-97),char(0),char(13),char(0),char(-96),char(0),char(13),char(0),char(-95),char(0),char(58),char(0),char(3),char(0),
+char(55),char(0),char(-97),char(0),char(14),char(0),char(-96),char(0),char(14),char(0),char(-95),char(0),char(59),char(0),char(13),char(0),char(55),char(0),char(-97),char(0),
+char(18),char(0),char(-94),char(0),char(18),char(0),char(-93),char(0),char(4),char(0),char(-92),char(0),char(4),char(0),char(-91),char(0),char(4),char(0),char(-90),char(0),
+char(7),char(0),char(-89),char(0),char(7),char(0),char(-88),char(0),char(7),char(0),char(-87),char(0),char(7),char(0),char(-86),char(0),char(7),char(0),char(-85),char(0),
+char(7),char(0),char(-84),char(0),char(7),char(0),char(-83),char(0),char(60),char(0),char(13),char(0),char(55),char(0),char(-97),char(0),char(17),char(0),char(-94),char(0),
+char(17),char(0),char(-93),char(0),char(4),char(0),char(-92),char(0),char(4),char(0),char(-91),char(0),char(4),char(0),char(-90),char(0),char(7),char(0),char(-89),char(0),
+char(7),char(0),char(-88),char(0),char(7),char(0),char(-87),char(0),char(7),char(0),char(-86),char(0),char(7),char(0),char(-85),char(0),char(7),char(0),char(-84),char(0),
+char(7),char(0),char(-83),char(0),char(61),char(0),char(11),char(0),char(55),char(0),char(-97),char(0),char(17),char(0),char(-94),char(0),char(17),char(0),char(-93),char(0),
+char(7),char(0),char(-82),char(0),char(7),char(0),char(-81),char(0),char(7),char(0),char(-80),char(0),char(7),char(0),char(-85),char(0),char(7),char(0),char(-84),char(0),
+char(7),char(0),char(-83),char(0),char(7),char(0),char(-79),char(0),char(0),char(0),char(21),char(0),char(62),char(0),char(9),char(0),char(55),char(0),char(-97),char(0),
+char(17),char(0),char(-94),char(0),char(17),char(0),char(-93),char(0),char(13),char(0),char(-78),char(0),char(13),char(0),char(-77),char(0),char(13),char(0),char(-76),char(0),
+char(13),char(0),char(-75),char(0),char(4),char(0),char(-74),char(0),char(4),char(0),char(-73),char(0),char(63),char(0),char(5),char(0),char(62),char(0),char(-72),char(0),
+char(4),char(0),char(-71),char(0),char(7),char(0),char(-70),char(0),char(7),char(0),char(-69),char(0),char(7),char(0),char(-68),char(0),char(64),char(0),char(9),char(0),
+char(55),char(0),char(-97),char(0),char(17),char(0),char(-94),char(0),char(17),char(0),char(-93),char(0),char(7),char(0),char(-78),char(0),char(7),char(0),char(-77),char(0),
+char(7),char(0),char(-76),char(0),char(7),char(0),char(-75),char(0),char(4),char(0),char(-74),char(0),char(4),char(0),char(-73),char(0),char(49),char(0),char(22),char(0),
+char(8),char(0),char(-67),char(0),char(8),char(0),char(-79),char(0),char(8),char(0),char(110),char(0),char(8),char(0),char(-66),char(0),char(8),char(0),char(112),char(0),
+char(8),char(0),char(-65),char(0),char(8),char(0),char(-64),char(0),char(8),char(0),char(-63),char(0),char(8),char(0),char(-62),char(0),char(8),char(0),char(-61),char(0),
+char(8),char(0),char(-60),char(0),char(8),char(0),char(-59),char(0),char(8),char(0),char(-58),char(0),char(8),char(0),char(-57),char(0),char(8),char(0),char(-56),char(0),
+char(8),char(0),char(-55),char(0),char(4),char(0),char(-54),char(0),char(4),char(0),char(-53),char(0),char(4),char(0),char(-52),char(0),char(4),char(0),char(-51),char(0),
+char(4),char(0),char(-50),char(0),char(0),char(0),char(37),char(0),char(51),char(0),char(22),char(0),char(7),char(0),char(-67),char(0),char(7),char(0),char(-79),char(0),
+char(7),char(0),char(110),char(0),char(7),char(0),char(-66),char(0),char(7),char(0),char(112),char(0),char(7),char(0),char(-65),char(0),char(7),char(0),char(-64),char(0),
+char(7),char(0),char(-63),char(0),char(7),char(0),char(-62),char(0),char(7),char(0),char(-61),char(0),char(7),char(0),char(-60),char(0),char(7),char(0),char(-59),char(0),
+char(7),char(0),char(-58),char(0),char(7),char(0),char(-57),char(0),char(7),char(0),char(-56),char(0),char(7),char(0),char(-55),char(0),char(4),char(0),char(-54),char(0),
+char(4),char(0),char(-53),char(0),char(4),char(0),char(-52),char(0),char(4),char(0),char(-51),char(0),char(4),char(0),char(-50),char(0),char(0),char(0),char(37),char(0),
+char(65),char(0),char(4),char(0),char(7),char(0),char(-49),char(0),char(7),char(0),char(-48),char(0),char(7),char(0),char(-47),char(0),char(4),char(0),char(78),char(0),
+char(66),char(0),char(10),char(0),char(65),char(0),char(-46),char(0),char(13),char(0),char(-45),char(0),char(13),char(0),char(-44),char(0),char(13),char(0),char(-43),char(0),
+char(13),char(0),char(-42),char(0),char(13),char(0),char(-41),char(0),char(7),char(0),char(-121),char(0),char(7),char(0),char(-40),char(0),char(4),char(0),char(-39),char(0),
+char(4),char(0),char(53),char(0),char(67),char(0),char(4),char(0),char(65),char(0),char(-46),char(0),char(4),char(0),char(-38),char(0),char(7),char(0),char(-37),char(0),
+char(4),char(0),char(-36),char(0),char(68),char(0),char(4),char(0),char(13),char(0),char(-41),char(0),char(65),char(0),char(-46),char(0),char(4),char(0),char(-35),char(0),
+char(7),char(0),char(-34),char(0),char(69),char(0),char(7),char(0),char(13),char(0),char(-33),char(0),char(65),char(0),char(-46),char(0),char(4),char(0),char(-32),char(0),
+char(7),char(0),char(-31),char(0),char(7),char(0),char(-30),char(0),char(7),char(0),char(-29),char(0),char(4),char(0),char(53),char(0),char(70),char(0),char(6),char(0),
+char(15),char(0),char(-28),char(0),char(13),char(0),char(-30),char(0),char(13),char(0),char(-27),char(0),char(56),char(0),char(-26),char(0),char(4),char(0),char(-25),char(0),
+char(7),char(0),char(-29),char(0),char(71),char(0),char(26),char(0),char(4),char(0),char(-24),char(0),char(7),char(0),char(-23),char(0),char(7),char(0),char(-79),char(0),
+char(7),char(0),char(-22),char(0),char(7),char(0),char(-21),char(0),char(7),char(0),char(-20),char(0),char(7),char(0),char(-19),char(0),char(7),char(0),char(-18),char(0),
+char(7),char(0),char(-17),char(0),char(7),char(0),char(-16),char(0),char(7),char(0),char(-15),char(0),char(7),char(0),char(-14),char(0),char(7),char(0),char(-13),char(0),
+char(7),char(0),char(-12),char(0),char(7),char(0),char(-11),char(0),char(7),char(0),char(-10),char(0),char(7),char(0),char(-9),char(0),char(7),char(0),char(-8),char(0),
+char(7),char(0),char(-7),char(0),char(7),char(0),char(-6),char(0),char(7),char(0),char(-5),char(0),char(4),char(0),char(-4),char(0),char(4),char(0),char(-3),char(0),
+char(4),char(0),char(-2),char(0),char(4),char(0),char(-1),char(0),char(4),char(0),char(117),char(0),char(72),char(0),char(12),char(0),char(15),char(0),char(0),char(1),
+char(15),char(0),char(1),char(1),char(15),char(0),char(2),char(1),char(13),char(0),char(3),char(1),char(13),char(0),char(4),char(1),char(7),char(0),char(5),char(1),
+char(4),char(0),char(6),char(1),char(4),char(0),char(7),char(1),char(4),char(0),char(8),char(1),char(4),char(0),char(9),char(1),char(7),char(0),char(-31),char(0),
+char(4),char(0),char(53),char(0),char(73),char(0),char(27),char(0),char(17),char(0),char(10),char(1),char(15),char(0),char(11),char(1),char(15),char(0),char(12),char(1),
+char(13),char(0),char(3),char(1),char(13),char(0),char(13),char(1),char(13),char(0),char(14),char(1),char(13),char(0),char(15),char(1),char(13),char(0),char(16),char(1),
+char(13),char(0),char(17),char(1),char(4),char(0),char(18),char(1),char(7),char(0),char(19),char(1),char(4),char(0),char(20),char(1),char(4),char(0),char(21),char(1),
+char(4),char(0),char(22),char(1),char(7),char(0),char(23),char(1),char(7),char(0),char(24),char(1),char(4),char(0),char(25),char(1),char(4),char(0),char(26),char(1),
+char(7),char(0),char(27),char(1),char(7),char(0),char(28),char(1),char(7),char(0),char(29),char(1),char(7),char(0),char(30),char(1),char(7),char(0),char(31),char(1),
+char(7),char(0),char(32),char(1),char(4),char(0),char(33),char(1),char(4),char(0),char(34),char(1),char(4),char(0),char(35),char(1),char(74),char(0),char(12),char(0),
+char(9),char(0),char(36),char(1),char(9),char(0),char(37),char(1),char(13),char(0),char(38),char(1),char(7),char(0),char(39),char(1),char(7),char(0),char(-63),char(0),
+char(7),char(0),char(40),char(1),char(4),char(0),char(41),char(1),char(13),char(0),char(42),char(1),char(4),char(0),char(43),char(1),char(4),char(0),char(44),char(1),
+char(4),char(0),char(45),char(1),char(4),char(0),char(53),char(0),char(75),char(0),char(19),char(0),char(47),char(0),char(125),char(0),char(72),char(0),char(46),char(1),
+char(65),char(0),char(47),char(1),char(66),char(0),char(48),char(1),char(67),char(0),char(49),char(1),char(68),char(0),char(50),char(1),char(69),char(0),char(51),char(1),
+char(70),char(0),char(52),char(1),char(73),char(0),char(53),char(1),char(74),char(0),char(54),char(1),char(4),char(0),char(55),char(1),char(4),char(0),char(21),char(1),
+char(4),char(0),char(56),char(1),char(4),char(0),char(57),char(1),char(4),char(0),char(58),char(1),char(4),char(0),char(59),char(1),char(4),char(0),char(60),char(1),
+char(4),char(0),char(61),char(1),char(71),char(0),char(62),char(1),};
+int b3s_bulletDNAlen64= sizeof(b3s_bulletDNAstr64);
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.h b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.h
new file mode 100644
index 0000000000..1c1ce43764
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/b3Serializer.h
@@ -0,0 +1,639 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef B3_SERIALIZER_H
+#define B3_SERIALIZER_H
+
+#include "Bullet3Common/b3Scalar.h" // has definitions like B3_FORCE_INLINE
+#include "Bullet3Common/b3StackAlloc.h"
+#include "Bullet3Common/b3HashMap.h"
+
+#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
+#include <memory.h>
+#endif
+#include <string.h>
+
+
+
+extern char b3s_bulletDNAstr[];
+extern int b3s_bulletDNAlen;
+extern char b3s_bulletDNAstr64[];
+extern int b3s_bulletDNAlen64;
+
+B3_FORCE_INLINE int b3StrLen(const char* str)
+{
+ if (!str)
+ return(0);
+ int len = 0;
+
+ while (*str != 0)
+ {
+ str++;
+ len++;
+ }
+
+ return len;
+}
+
+
+class b3Chunk
+{
+public:
+ int m_chunkCode;
+ int m_length;
+ void *m_oldPtr;
+ int m_dna_nr;
+ int m_number;
+};
+
+enum b3SerializationFlags
+{
+ B3_SERIALIZE_NO_BVH = 1,
+ B3_SERIALIZE_NO_TRIANGLEINFOMAP = 2,
+ B3_SERIALIZE_NO_DUPLICATE_ASSERT = 4
+};
+
+class b3Serializer
+{
+
+public:
+
+ virtual ~b3Serializer() {}
+
+ virtual const unsigned char* getBufferPointer() const = 0;
+
+ virtual int getCurrentBufferSize() const = 0;
+
+ virtual b3Chunk* allocate(size_t size, int numElements) = 0;
+
+ virtual void finalizeChunk(b3Chunk* chunk, const char* structType, int chunkCode,void* oldPtr)= 0;
+
+ virtual void* findPointer(void* oldPtr) = 0;
+
+ virtual void* getUniquePointer(void*oldPtr) = 0;
+
+ virtual void startSerialization() = 0;
+
+ virtual void finishSerialization() = 0;
+
+ virtual const char* findNameForPointer(const void* ptr) const = 0;
+
+ virtual void registerNameForPointer(const void* ptr, const char* name) = 0;
+
+ virtual void serializeName(const char* ptr) = 0;
+
+ virtual int getSerializationFlags() const = 0;
+
+ virtual void setSerializationFlags(int flags) = 0;
+
+
+};
+
+
+
+#define B3_HEADER_LENGTH 12
+#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
+# define B3_MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
+#else
+# define B3_MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
+#endif
+
+#define B3_SOFTBODY_CODE B3_MAKE_ID('S','B','D','Y')
+#define B3_COLLISIONOBJECT_CODE B3_MAKE_ID('C','O','B','J')
+#define B3_RIGIDBODY_CODE B3_MAKE_ID('R','B','D','Y')
+#define B3_CONSTRAINT_CODE B3_MAKE_ID('C','O','N','S')
+#define B3_BOXSHAPE_CODE B3_MAKE_ID('B','O','X','S')
+#define B3_QUANTIZED_BVH_CODE B3_MAKE_ID('Q','B','V','H')
+#define B3_TRIANLGE_INFO_MAP B3_MAKE_ID('T','M','A','P')
+#define B3_SHAPE_CODE B3_MAKE_ID('S','H','A','P')
+#define B3_ARRAY_CODE B3_MAKE_ID('A','R','A','Y')
+#define B3_SBMATERIAL_CODE B3_MAKE_ID('S','B','M','T')
+#define B3_SBNODE_CODE B3_MAKE_ID('S','B','N','D')
+#define B3_DYNAMICSWORLD_CODE B3_MAKE_ID('D','W','L','D')
+#define B3_DNA_CODE B3_MAKE_ID('D','N','A','1')
+
+
+struct b3PointerUid
+{
+ union
+ {
+ void* m_ptr;
+ int m_uniqueIds[2];
+ };
+};
+
+///The b3DefaultSerializer is the main Bullet serialization class.
+///The constructor takes an optional argument for backwards compatibility, it is recommended to leave this empty/zero.
+class b3DefaultSerializer : public b3Serializer
+{
+
+
+ b3AlignedObjectArray<char*> mTypes;
+ b3AlignedObjectArray<short*> mStructs;
+ b3AlignedObjectArray<short> mTlens;
+ b3HashMap<b3HashInt, int> mStructReverse;
+ b3HashMap<b3HashString,int> mTypeLookup;
+
+
+ b3HashMap<b3HashPtr,void*> m_chunkP;
+
+ b3HashMap<b3HashPtr,const char*> m_nameMap;
+
+ b3HashMap<b3HashPtr,b3PointerUid> m_uniquePointers;
+ int m_uniqueIdGenerator;
+
+ int m_totalSize;
+ unsigned char* m_buffer;
+ int m_currentSize;
+ void* m_dna;
+ int m_dnaLength;
+
+ int m_serializationFlags;
+
+
+ b3AlignedObjectArray<b3Chunk*> m_chunkPtrs;
+
+protected:
+
+ virtual void* findPointer(void* oldPtr)
+ {
+ void** ptr = m_chunkP.find(oldPtr);
+ if (ptr && *ptr)
+ return *ptr;
+ return 0;
+ }
+
+
+
+
+
+ void writeDNA()
+ {
+ b3Chunk* dnaChunk = allocate(m_dnaLength,1);
+ memcpy(dnaChunk->m_oldPtr,m_dna,m_dnaLength);
+ finalizeChunk(dnaChunk,"DNA1",B3_DNA_CODE, m_dna);
+ }
+
+ int getReverseType(const char *type) const
+ {
+
+ b3HashString key(type);
+ const int* valuePtr = mTypeLookup.find(key);
+ if (valuePtr)
+ return *valuePtr;
+
+ return -1;
+ }
+
+ void initDNA(const char* bdnaOrg,int dnalen)
+ {
+ ///was already initialized
+ if (m_dna)
+ return;
+
+ int littleEndian= 1;
+ littleEndian= ((char*)&littleEndian)[0];
+
+
+ m_dna = b3AlignedAlloc(dnalen,16);
+ memcpy(m_dna,bdnaOrg,dnalen);
+ m_dnaLength = dnalen;
+
+ int *intPtr=0;
+ short *shtPtr=0;
+ char *cp = 0;int dataLen =0;
+ intPtr = (int*)m_dna;
+
+ /*
+ SDNA (4 bytes) (magic number)
+ NAME (4 bytes)
+ <nr> (4 bytes) amount of names (int)
+ <string>
+ <string>
+ */
+
+ if (strncmp((const char*)m_dna, "SDNA", 4)==0)
+ {
+ // skip ++ NAME
+ intPtr++; intPtr++;
+ }
+
+ // Parse names
+ if (!littleEndian)
+ *intPtr = b3SwapEndian(*intPtr);
+
+ dataLen = *intPtr;
+
+ intPtr++;
+
+ cp = (char*)intPtr;
+ int i;
+ for ( i=0; i<dataLen; i++)
+ {
+
+ while (*cp)cp++;
+ cp++;
+ }
+ cp = b3AlignPointer(cp,4);
+
+ /*
+ TYPE (4 bytes)
+ <nr> amount of types (int)
+ <string>
+ <string>
+ */
+
+ intPtr = (int*)cp;
+ b3Assert(strncmp(cp, "TYPE", 4)==0); intPtr++;
+
+ if (!littleEndian)
+ *intPtr = b3SwapEndian(*intPtr);
+
+ dataLen = *intPtr;
+ intPtr++;
+
+
+ cp = (char*)intPtr;
+ for (i=0; i<dataLen; i++)
+ {
+ mTypes.push_back(cp);
+ while (*cp)cp++;
+ cp++;
+ }
+
+ cp = b3AlignPointer(cp,4);
+
+
+ /*
+ TLEN (4 bytes)
+ <len> (short) the lengths of types
+ <len>
+ */
+
+ // Parse type lens
+ intPtr = (int*)cp;
+ b3Assert(strncmp(cp, "TLEN", 4)==0); intPtr++;
+
+ dataLen = (int)mTypes.size();
+
+ shtPtr = (short*)intPtr;
+ for (i=0; i<dataLen; i++, shtPtr++)
+ {
+ if (!littleEndian)
+ shtPtr[0] = b3SwapEndian(shtPtr[0]);
+ mTlens.push_back(shtPtr[0]);
+ }
+
+ if (dataLen & 1) shtPtr++;
+
+ /*
+ STRC (4 bytes)
+ <nr> amount of structs (int)
+ <typenr>
+ <nr_of_elems>
+ <typenr>
+ <namenr>
+ <typenr>
+ <namenr>
+ */
+
+ intPtr = (int*)shtPtr;
+ cp = (char*)intPtr;
+ b3Assert(strncmp(cp, "STRC", 4)==0); intPtr++;
+
+ if (!littleEndian)
+ *intPtr = b3SwapEndian(*intPtr);
+ dataLen = *intPtr ;
+ intPtr++;
+
+
+ shtPtr = (short*)intPtr;
+ for (i=0; i<dataLen; i++)
+ {
+ mStructs.push_back (shtPtr);
+
+ if (!littleEndian)
+ {
+ shtPtr[0]= b3SwapEndian(shtPtr[0]);
+ shtPtr[1]= b3SwapEndian(shtPtr[1]);
+
+ int len = shtPtr[1];
+ shtPtr+= 2;
+
+ for (int a=0; a<len; a++, shtPtr+=2)
+ {
+ shtPtr[0]= b3SwapEndian(shtPtr[0]);
+ shtPtr[1]= b3SwapEndian(shtPtr[1]);
+ }
+
+ } else
+ {
+ shtPtr+= (2*shtPtr[1])+2;
+ }
+ }
+
+ // build reverse lookups
+ for (i=0; i<(int)mStructs.size(); i++)
+ {
+ short *strc = mStructs.at(i);
+ mStructReverse.insert(strc[0], i);
+ mTypeLookup.insert(b3HashString(mTypes[strc[0]]),i);
+ }
+ }
+
+public:
+
+
+
+
+ b3DefaultSerializer(int totalSize=0)
+ :m_totalSize(totalSize),
+ m_currentSize(0),
+ m_dna(0),
+ m_dnaLength(0),
+ m_serializationFlags(0)
+ {
+ m_buffer = m_totalSize?(unsigned char*)b3AlignedAlloc(totalSize,16):0;
+
+ const bool VOID_IS_8 = ((sizeof(void*)==8));
+
+#ifdef B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+#if _WIN64
+ initDNA((const char*)b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+#else
+ b3Assert(0);
+#endif
+ } else
+ {
+#ifndef _WIN64
+ initDNA((const char*)b3s_bulletDNAstr,b3s_bulletDNAlen);
+#else
+ b3Assert(0);
+#endif
+ }
+
+#else //B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+ if (VOID_IS_8)
+ {
+ initDNA((const char*)b3s_bulletDNAstr64,b3s_bulletDNAlen64);
+ } else
+ {
+ initDNA((const char*)b3s_bulletDNAstr,b3s_bulletDNAlen);
+ }
+#endif //B3_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+
+ }
+
+ virtual ~b3DefaultSerializer()
+ {
+ if (m_buffer)
+ b3AlignedFree(m_buffer);
+ if (m_dna)
+ b3AlignedFree(m_dna);
+ }
+
+ void writeHeader(unsigned char* buffer) const
+ {
+
+
+#ifdef B3_USE_DOUBLE_PRECISION
+ memcpy(buffer, "BULLETd", 7);
+#else
+ memcpy(buffer, "BULLETf", 7);
+#endif //B3_USE_DOUBLE_PRECISION
+
+ int littleEndian= 1;
+ littleEndian= ((char*)&littleEndian)[0];
+
+ if (sizeof(void*)==8)
+ {
+ buffer[7] = '-';
+ } else
+ {
+ buffer[7] = '_';
+ }
+
+ if (littleEndian)
+ {
+ buffer[8]='v';
+ } else
+ {
+ buffer[8]='V';
+ }
+
+
+ buffer[9] = '2';
+ buffer[10] = '8';
+ buffer[11] = '1';
+
+ }
+
+ virtual void startSerialization()
+ {
+ m_uniqueIdGenerator= 1;
+ if (m_totalSize)
+ {
+ unsigned char* buffer = internalAlloc(B3_HEADER_LENGTH);
+ writeHeader(buffer);
+ }
+
+ }
+
+ virtual void finishSerialization()
+ {
+ writeDNA();
+
+ //if we didn't pre-allocate a buffer, we need to create a contiguous buffer now
+ int mysize = 0;
+ if (!m_totalSize)
+ {
+ if (m_buffer)
+ b3AlignedFree(m_buffer);
+
+ m_currentSize += B3_HEADER_LENGTH;
+ m_buffer = (unsigned char*)b3AlignedAlloc(m_currentSize,16);
+
+ unsigned char* currentPtr = m_buffer;
+ writeHeader(m_buffer);
+ currentPtr += B3_HEADER_LENGTH;
+ mysize+=B3_HEADER_LENGTH;
+ for (int i=0;i< m_chunkPtrs.size();i++)
+ {
+ int curLength = sizeof(b3Chunk)+m_chunkPtrs[i]->m_length;
+ memcpy(currentPtr,m_chunkPtrs[i], curLength);
+ b3AlignedFree(m_chunkPtrs[i]);
+ currentPtr+=curLength;
+ mysize+=curLength;
+ }
+ }
+
+ mTypes.clear();
+ mStructs.clear();
+ mTlens.clear();
+ mStructReverse.clear();
+ mTypeLookup.clear();
+ m_chunkP.clear();
+ m_nameMap.clear();
+ m_uniquePointers.clear();
+ m_chunkPtrs.clear();
+ }
+
+ virtual void* getUniquePointer(void*oldPtr)
+ {
+ if (!oldPtr)
+ return 0;
+
+ b3PointerUid* uptr = (b3PointerUid*)m_uniquePointers.find(oldPtr);
+ if (uptr)
+ {
+ return uptr->m_ptr;
+ }
+ m_uniqueIdGenerator++;
+
+ b3PointerUid uid;
+ uid.m_uniqueIds[0] = m_uniqueIdGenerator;
+ uid.m_uniqueIds[1] = m_uniqueIdGenerator;
+ m_uniquePointers.insert(oldPtr,uid);
+ return uid.m_ptr;
+
+ }
+
+ virtual const unsigned char* getBufferPointer() const
+ {
+ return m_buffer;
+ }
+
+ virtual int getCurrentBufferSize() const
+ {
+ return m_currentSize;
+ }
+
+ virtual void finalizeChunk(b3Chunk* chunk, const char* structType, int chunkCode,void* oldPtr)
+ {
+ if (!(m_serializationFlags&B3_SERIALIZE_NO_DUPLICATE_ASSERT))
+ {
+ b3Assert(!findPointer(oldPtr));
+ }
+
+ chunk->m_dna_nr = getReverseType(structType);
+
+ chunk->m_chunkCode = chunkCode;
+
+ void* uniquePtr = getUniquePointer(oldPtr);
+
+ m_chunkP.insert(oldPtr,uniquePtr);//chunk->m_oldPtr);
+ chunk->m_oldPtr = uniquePtr;//oldPtr;
+
+ }
+
+
+ virtual unsigned char* internalAlloc(size_t size)
+ {
+ unsigned char* ptr = 0;
+
+ if (m_totalSize)
+ {
+ ptr = m_buffer+m_currentSize;
+ m_currentSize += int(size);
+ b3Assert(m_currentSize<m_totalSize);
+ } else
+ {
+ ptr = (unsigned char*)b3AlignedAlloc(size,16);
+ m_currentSize += int(size);
+ }
+ return ptr;
+ }
+
+
+
+ virtual b3Chunk* allocate(size_t size, int numElements)
+ {
+
+ unsigned char* ptr = internalAlloc(int(size)*numElements+sizeof(b3Chunk));
+
+ unsigned char* data = ptr + sizeof(b3Chunk);
+
+ b3Chunk* chunk = (b3Chunk*)ptr;
+ chunk->m_chunkCode = 0;
+ chunk->m_oldPtr = data;
+ chunk->m_length = int(size)*numElements;
+ chunk->m_number = numElements;
+
+ m_chunkPtrs.push_back(chunk);
+
+
+ return chunk;
+ }
+
+ virtual const char* findNameForPointer(const void* ptr) const
+ {
+ const char*const * namePtr = m_nameMap.find(ptr);
+ if (namePtr && *namePtr)
+ return *namePtr;
+ return 0;
+
+ }
+
+ virtual void registerNameForPointer(const void* ptr, const char* name)
+ {
+ m_nameMap.insert(ptr,name);
+ }
+
+ virtual void serializeName(const char* name)
+ {
+ if (name)
+ {
+ //don't serialize name twice
+ if (findPointer((void*)name))
+ return;
+
+ int len = b3StrLen(name);
+ if (len)
+ {
+
+ int newLen = len+1;
+ int padding = ((newLen+3)&~3)-newLen;
+ newLen += padding;
+
+ //serialize name string now
+ b3Chunk* chunk = allocate(sizeof(char),newLen);
+ char* destinationName = (char*)chunk->m_oldPtr;
+ for (int i=0;i<len;i++)
+ {
+ destinationName[i] = name[i];
+ }
+ destinationName[len] = 0;
+ finalizeChunk(chunk,"char",B3_ARRAY_CODE,(void*)name);
+ }
+ }
+ }
+
+ virtual int getSerializationFlags() const
+ {
+ return m_serializationFlags;
+ }
+
+ virtual void setSerializationFlags(int flags)
+ {
+ m_serializationFlags = flags;
+ }
+
+};
+
+
+#endif //B3_SERIALIZER_H
+
diff --git a/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/premake4.lua b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/premake4.lua
new file mode 100644
index 0000000000..ec2f0a51ae
--- /dev/null
+++ b/thirdparty/bullet/src/Bullet3Serialize/Bullet2FileLoader/premake4.lua
@@ -0,0 +1,12 @@
+ project "Bullet2FileLoader"
+
+ kind "StaticLib"
+
+ includedirs {
+ "../../../src"
+ }
+
+ files {
+ "**.cpp",
+ "**.h"
+ } \ No newline at end of file