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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-09-08 22:37:24 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-09-08 22:37:24 +0400
commit4565944248175e84a2b3663202cae0c86fcee5b9 (patch)
tree708c4f90fd8910217a366371d04b027f8d2436d3
parent98b18bc679388a2c036c9fed48a835ac71963b7f (diff)
parentde4828036857e76141ca336997b99978ee09fb5f (diff)
soc-2008-mxcurioni: merged changes to revision 16424, corrected compilation errors
-rw-r--r--CMake/macros.cmake4
-rw-r--r--CMakeLists.txt20
-rw-r--r--SConstruct9
-rw-r--r--bin/.blender/.Blanguages1
-rw-r--r--blenderplayer/CMakeLists.txt1
-rw-r--r--config/linux2-config.py2
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp39
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h18
-rw-r--r--extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp6
-rw-r--r--extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h3
-rw-r--r--extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp24
-rw-r--r--extern/glew/SConscript2
-rw-r--r--extern/glew/include/GL/glew.h7
-rw-r--r--extern/glew/src/glew.c2
-rw-r--r--intern/bmfont/intern/BDF2BMF.py177
-rw-r--r--intern/boolop/SConscript2
-rw-r--r--intern/boolop/intern/BOP_Edge.cpp43
-rw-r--r--intern/boolop/intern/BOP_Edge.h13
-rw-r--r--intern/boolop/intern/BOP_Face.cpp2
-rw-r--r--intern/boolop/intern/BOP_Face.h3
-rw-r--r--intern/boolop/intern/BOP_Interface.cpp30
-rw-r--r--intern/boolop/intern/BOP_Merge.cpp3
-rw-r--r--intern/boolop/intern/BOP_Merge.h5
-rw-r--r--intern/boolop/intern/BOP_Merge2.cpp944
-rw-r--r--intern/boolop/intern/BOP_Merge2.h99
-rw-r--r--intern/boolop/intern/BOP_Mesh.cpp11
-rw-r--r--intern/boolop/intern/BOP_Mesh.h7
-rw-r--r--intern/boolop/intern/BOP_Misc.h54
-rw-r--r--intern/boolop/intern/BOP_Tag.h2
-rw-r--r--intern/boolop/intern/BOP_Vertex.cpp19
-rw-r--r--intern/boolop/intern/BOP_Vertex.h5
-rw-r--r--intern/boolop/make/msvc_7_0/boolop.vcproj9
-rw-r--r--intern/bsp/SConscript2
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp8
-rw-r--r--intern/guardedalloc/BLO_sys_types.h125
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h10
-rw-r--r--intern/guardedalloc/intern/mallocn.c27
-rw-r--r--intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj3
-rw-r--r--intern/memutil/MEM_Allocator.h1
-rw-r--r--intern/memutil/MEM_CacheLimiter.h12
-rw-r--r--intern/memutil/intern/MEM_CacheLimiterC-Api.cpp8
-rw-r--r--intern/moto/include/GEN_Map.h13
-rw-r--r--intern/moto/include/MT_Matrix4x4.h1
-rw-r--r--intern/moto/include/MT_Matrix4x4.inl14
-rw-r--r--intern/opennl/make/msvc_7_0/opennl.vcproj3
-rw-r--r--intern/opennl/superlu/BLO_sys_types.h127
-rw-r--r--intern/opennl/superlu/smemory.c10
-rw-r--r--projectfiles_vc7/blender/BPY_python/BPY_python.vcproj112
-rw-r--r--projectfiles_vc7/blender/blender.sln31
-rw-r--r--projectfiles_vc7/blender/blender.vcproj4
-rw-r--r--projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj30
-rw-r--r--projectfiles_vc7/blender/gpu/BL_gpu.vcproj372
-rw-r--r--projectfiles_vc7/blender/nodes/nodes.vcproj8
-rw-r--r--projectfiles_vc7/blender/radiosity/BRA_radiosity.vcproj4
-rw-r--r--projectfiles_vc7/blender/src/BL_src.vcproj4
-rw-r--r--projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj10
-rw-r--r--projectfiles_vc7/gameengine/converter/KX_converter.vcproj12
-rw-r--r--projectfiles_vc7/gameengine/expression/EXP_expressions.vcproj12
-rw-r--r--projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj18
-rw-r--r--projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj19
-rw-r--r--projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj12
-rw-r--r--projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj1
-rw-r--r--projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj12
-rw-r--r--projectfiles_vc7/kernel/system/SYS_system.vcproj8
-rw-r--r--release/VERSION2
-rw-r--r--release/datafiles/blenderbuttonsbin69599 -> 68242 bytes
-rw-r--r--release/datafiles/datatoc.c2
-rw-r--r--release/datafiles/splash.jpgbin95515 -> 50665 bytes
-rw-r--r--release/scripts/bpymodules/BPyTextPlugin.py814
-rw-r--r--release/scripts/flt_dofedit.py835
-rw-r--r--release/scripts/flt_export.py29
-rw-r--r--release/scripts/flt_lodedit.py502
-rw-r--r--release/scripts/flt_palettemanager.py149
-rw-r--r--release/scripts/flt_properties.py19
-rw-r--r--release/scripts/import_dxf.py928
-rw-r--r--release/scripts/mesh_cleanup.py32
-rw-r--r--release/scripts/object_find.py26
-rw-r--r--release/scripts/ply_export.py7
-rw-r--r--release/scripts/rvk1_torvk2.py64
-rw-r--r--release/scripts/scripttemplate_text_plugin.py69
-rw-r--r--release/scripts/sysinfo.py2
-rw-r--r--release/scripts/textplugin_functiondocs.py64
-rw-r--r--release/scripts/textplugin_imports.py91
-rw-r--r--release/scripts/textplugin_membersuggest.py90
-rw-r--r--release/scripts/textplugin_outliner.py142
-rw-r--r--release/scripts/textplugin_suggest.py94
-rw-r--r--release/scripts/textplugin_templates.py123
-rw-r--r--release/scripts/weightpaint_clean.py7
-rw-r--r--release/text/copyright.txt2
-rw-r--r--source/Makefile4
-rw-r--r--source/blender/CMakeLists.txt2
-rw-r--r--source/blender/Makefile2
-rw-r--r--source/blender/SConscript1
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h51
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_bad_level_calls.h4
-rw-r--r--source/blender/blenkernel/BKE_blender.h4
-rw-r--r--source/blender/blenkernel/BKE_bvhutils.h98
-rw-r--r--source/blender/blenkernel/BKE_collision.h11
-rw-r--r--source/blender/blenkernel/BKE_colortools.h1
-rw-r--r--source/blender/blenkernel/BKE_customdata.h4
-rw-r--r--source/blender/blenkernel/BKE_deform.h4
-rw-r--r--source/blender/blenkernel/BKE_effect.h6
-rw-r--r--source/blender/blenkernel/BKE_endian.h6
-rw-r--r--source/blender/blenkernel/BKE_global.h9
-rw-r--r--source/blender/blenkernel/BKE_idprop.h1
-rw-r--r--source/blender/blenkernel/BKE_mesh.h1
-rw-r--r--source/blender/blenkernel/BKE_node.h8
-rw-r--r--source/blender/blenkernel/BKE_shrinkwrap.h146
-rw-r--r--source/blender/blenkernel/BKE_suggestions.h93
-rw-r--r--source/blender/blenkernel/BKE_text.h29
-rw-r--r--source/blender/blenkernel/BKE_texture.h3
-rw-r--r--source/blender/blenkernel/BKE_utildefines.h6
-rw-r--r--source/blender/blenkernel/CMakeLists.txt2
-rw-r--r--source/blender/blenkernel/SConscript1
-rw-r--r--source/blender/blenkernel/bad_level_call_stubs/stubs.c12
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c4
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c549
-rw-r--r--source/blender/blenkernel/intern/Makefile4
-rw-r--r--source/blender/blenkernel/intern/action.c4
-rw-r--r--source/blender/blenkernel/intern/anim.c27
-rw-r--r--source/blender/blenkernel/intern/blender.c36
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c577
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c138
-rw-r--r--source/blender/blenkernel/intern/cloth.c22
-rw-r--r--source/blender/blenkernel/intern/collision.c289
-rw-r--r--source/blender/blenkernel/intern/colortools.c21
-rw-r--r--source/blender/blenkernel/intern/constraint.c112
-rw-r--r--source/blender/blenkernel/intern/customdata.c31
-rw-r--r--source/blender/blenkernel/intern/deform.c28
-rw-r--r--source/blender/blenkernel/intern/displist.c8
-rw-r--r--source/blender/blenkernel/intern/effect.c474
-rw-r--r--source/blender/blenkernel/intern/icons.c2
-rw-r--r--source/blender/blenkernel/intern/idprop.c15
-rw-r--r--source/blender/blenkernel/intern/image.c19
-rw-r--r--source/blender/blenkernel/intern/implicit.c135
-rw-r--r--source/blender/blenkernel/intern/ipo.c41
-rw-r--r--source/blender/blenkernel/intern/material.c7
-rw-r--r--source/blender/blenkernel/intern/mesh.c39
-rw-r--r--source/blender/blenkernel/intern/modifier.c196
-rw-r--r--source/blender/blenkernel/intern/node.c114
-rw-r--r--source/blender/blenkernel/intern/object.c12
-rw-r--r--source/blender/blenkernel/intern/particle.c34
-rw-r--r--source/blender/blenkernel/intern/particle_system.c330
-rw-r--r--source/blender/blenkernel/intern/sca.c3
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c588
-rw-r--r--source/blender/blenkernel/intern/softbody.c859
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c172
-rw-r--r--source/blender/blenkernel/intern/suggestions.c254
-rw-r--r--source/blender/blenkernel/intern/text.c564
-rw-r--r--source/blender/blenkernel/intern/texture.c45
-rw-r--r--source/blender/blenlib/BLI_arithb.h1
-rw-r--r--source/blender/blenlib/BLI_blenlib.h1
-rw-r--r--source/blender/blenlib/BLI_editVert.h8
-rw-r--r--source/blender/blenlib/BLI_kdopbvh.h36
-rw-r--r--source/blender/blenlib/BLI_rand.h1
-rw-r--r--source/blender/blenlib/BLI_winstuff.h8
-rw-r--r--source/blender/blenlib/SConscript2
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c8
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c1235
-rw-r--r--source/blender/blenlib/intern/arithb.c13
-rw-r--r--source/blender/blenlib/intern/boxpack2d.c10
-rw-r--r--source/blender/blenlib/intern/fileops.c6
-rw-r--r--source/blender/blenlib/intern/freetypefont.c2
-rw-r--r--source/blender/blenlib/intern/psfont.c4
-rw-r--r--source/blender/blenlib/intern/rand.c18
-rw-r--r--source/blender/blenlib/intern/util.c8
-rw-r--r--source/blender/blenloader/BLO_sys_types.h29
-rw-r--r--source/blender/blenloader/intern/genfile.c10
-rw-r--r--source/blender/blenloader/intern/readblenentry.c4
-rw-r--r--source/blender/blenloader/intern/readfile.c167
-rw-r--r--source/blender/blenloader/intern/writefile.c21
-rw-r--r--source/blender/blenpluginapi/intern/pluginapi.c4
-rw-r--r--source/blender/freestyle/SConscript2
-rw-r--r--source/blender/gpu/CMakeLists.txt34
-rw-r--r--source/blender/gpu/GPU_draw.h116
-rw-r--r--source/blender/gpu/GPU_extensions.h144
-rw-r--r--source/blender/gpu/GPU_material.h169
-rw-r--r--source/blender/gpu/Makefile37
-rw-r--r--source/blender/gpu/SConscript11
-rw-r--r--source/blender/gpu/intern/Makefile53
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c1441
-rw-r--r--source/blender/gpu/intern/gpu_codegen.h87
-rw-r--r--source/blender/gpu/intern/gpu_draw.c1167
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c987
-rw-r--r--source/blender/gpu/intern/gpu_material.c1496
-rw-r--r--source/blender/gpu/intern/gpu_shader_material.glsl1555
-rw-r--r--source/blender/gpu/intern/gpu_shader_material.glsl.c1032
-rw-r--r--source/blender/gpu/intern/gpu_shader_vertex.glsl12
-rw-r--r--source/blender/gpu/intern/gpu_shader_vertex.glsl.c13
-rw-r--r--source/blender/imbuf/intern/anim.c15
-rw-r--r--source/blender/imbuf/intern/cineon/cineonlib.c32
-rw-r--r--source/blender/imbuf/intern/cineon/dpxlib.c36
-rw-r--r--source/blender/imbuf/intern/cineon/logImageCore.h6
-rw-r--r--source/blender/imbuf/intern/cineon/logmemfile.c6
-rw-r--r--source/blender/imbuf/intern/cineon/logmemfile.h2
-rw-r--r--source/blender/imbuf/intern/scaling.c74
-rw-r--r--source/blender/include/BDR_drawmesh.h43
-rw-r--r--source/blender/include/BDR_drawobject.h3
-rw-r--r--source/blender/include/BDR_gpencil.h15
-rw-r--r--source/blender/include/BDR_imagepaint.h4
-rw-r--r--source/blender/include/BIF_drawgpencil.h5
-rw-r--r--source/blender/include/BIF_drawseq.h2
-rw-r--r--source/blender/include/BIF_drawtext.h6
-rw-r--r--source/blender/include/BIF_editaction.h10
-rw-r--r--source/blender/include/BIF_editarmature.h16
-rw-r--r--source/blender/include/BIF_editmesh.h2
-rw-r--r--source/blender/include/BIF_editview.h4
-rw-r--r--source/blender/include/BIF_gl.h15
-rw-r--r--source/blender/include/BIF_keyval.h3
-rw-r--r--source/blender/include/BIF_meshtools.h4
-rw-r--r--source/blender/include/BIF_poseobject.h2
-rw-r--r--source/blender/include/BIF_resources.h14
-rw-r--r--source/blender/include/BIF_space.h4
-rw-r--r--source/blender/include/BSE_drawipo.h3
-rw-r--r--source/blender/include/BSE_drawview.h7
-rw-r--r--source/blender/include/blendef.h8
-rw-r--r--source/blender/include/butspace.h2
-rw-r--r--source/blender/include/transform.h2
-rw-r--r--source/blender/makesdna/DNA_ID.h3
-rw-r--r--source/blender/makesdna/DNA_action_types.h1
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h18
-rw-r--r--source/blender/makesdna/DNA_armature_types.h3
-rw-r--r--source/blender/makesdna/DNA_brush_types.h4
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h10
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h4
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h14
-rw-r--r--source/blender/makesdna/DNA_group_types.h2
-rw-r--r--source/blender/makesdna/DNA_image_types.h4
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h40
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h16
-rw-r--r--source/blender/makesdna/DNA_material_types.h11
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h3
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h45
-rw-r--r--source/blender/makesdna/DNA_object_force.h7
-rw-r--r--source/blender/makesdna/DNA_object_types.h4
-rw-r--r--source/blender/makesdna/DNA_particle_types.h3
-rw-r--r--source/blender/makesdna/DNA_scene_types.h3
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h17
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h1
-rw-r--r--source/blender/makesdna/DNA_space_types.h15
-rw-r--r--source/blender/makesdna/DNA_text_types.h25
-rw-r--r--source/blender/makesdna/DNA_texture_types.h1
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h7
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h3
-rw-r--r--source/blender/makesdna/DNA_world_types.h4
-rw-r--r--source/blender/makesdna/intern/makesdna.c8
-rw-r--r--source/blender/nodes/CMakeLists.txt2
-rw-r--r--source/blender/nodes/SConscript1
-rw-r--r--source/blender/nodes/intern/CMP_nodes/Makefile1
-rw-r--r--source/blender/nodes/intern/Makefile2
-rw-r--r--source/blender/nodes/intern/SHD_nodes/Makefile2
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_camera.c10
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_curves.c24
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_geom.c16
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c9
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_invert.c8
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_mapping.c17
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_material.c82
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_math.c43
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c14
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_normal.c11
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_output.c16
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_rgb.c11
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c16
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c8
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_texture.c17
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c20
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_value.c9
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c31
-rw-r--r--source/blender/nodes/intern/SHD_util.c4
-rw-r--r--source/blender/nodes/intern/SHD_util.h15
-rw-r--r--source/blender/python/BPY_extern.h3
-rw-r--r--source/blender/python/BPY_interface.c113
-rw-r--r--source/blender/python/BPY_menus.c40
-rw-r--r--source/blender/python/BPY_menus.h2
-rw-r--r--source/blender/python/CMakeLists.txt6
-rw-r--r--source/blender/python/SConscript4
-rw-r--r--source/blender/python/api2_2x/Armature.c2
-rw-r--r--source/blender/python/api2_2x/Blender.c24
-rw-r--r--source/blender/python/api2_2x/Bone.c10
-rw-r--r--source/blender/python/api2_2x/Constraint.c29
-rw-r--r--source/blender/python/api2_2x/Draw.c6
-rw-r--r--source/blender/python/api2_2x/Group.c31
-rw-r--r--source/blender/python/api2_2x/IDProp.c57
-rw-r--r--source/blender/python/api2_2x/Image.c4
-rw-r--r--source/blender/python/api2_2x/Lamp.c18
-rw-r--r--source/blender/python/api2_2x/MTex.c10
-rw-r--r--source/blender/python/api2_2x/Makefile6
-rw-r--r--source/blender/python/api2_2x/Material.c107
-rw-r--r--source/blender/python/api2_2x/Mathutils.c8
-rw-r--r--source/blender/python/api2_2x/Mathutils.h2
-rw-r--r--source/blender/python/api2_2x/Mesh.c9
-rw-r--r--source/blender/python/api2_2x/Object.c37
-rw-r--r--source/blender/python/api2_2x/Particle.c6
-rw-r--r--source/blender/python/api2_2x/Text.c401
-rw-r--r--source/blender/python/api2_2x/Text.h2
-rw-r--r--source/blender/python/api2_2x/Text3d.c46
-rw-r--r--source/blender/python/api2_2x/Texture.c41
-rw-r--r--source/blender/python/api2_2x/doc/Armature.py3
-rw-r--r--source/blender/python/api2_2x/doc/Draw.py8
-rw-r--r--source/blender/python/api2_2x/doc/Group.py2
-rw-r--r--source/blender/python/api2_2x/doc/IDProp.py4
-rw-r--r--source/blender/python/api2_2x/doc/Material.py19
-rw-r--r--source/blender/python/api2_2x/doc/Mathutils.py9
-rw-r--r--source/blender/python/api2_2x/doc/Mesh.py1
-rw-r--r--source/blender/python/api2_2x/doc/Object.py8
-rw-r--r--source/blender/python/api2_2x/doc/Render.py15
-rw-r--r--source/blender/python/api2_2x/doc/Text.py103
-rw-r--r--source/blender/python/api2_2x/doc/Text3d.py20
-rw-r--r--source/blender/python/api2_2x/doc/Texture.py6
-rw-r--r--source/blender/python/api2_2x/gen_utils.h1
-rw-r--r--source/blender/python/api2_2x/sceneRender.c38
-rw-r--r--source/blender/python/api2_2x/sceneSequence.c115
-rw-r--r--source/blender/python/api2_2x/vector.c52
-rw-r--r--source/blender/python/api2_2x/vector.h1
-rw-r--r--source/blender/radiosity/CMakeLists.txt2
-rw-r--r--source/blender/radiosity/SConscript2
-rw-r--r--source/blender/radiosity/intern/source/Makefile2
-rw-r--r--source/blender/radiosity/intern/source/radnode.c10
-rw-r--r--source/blender/radiosity/intern/source/radpreprocess.c4
-rw-r--r--source/blender/render/CMakeLists.txt2
-rw-r--r--source/blender/render/SConscript2
-rw-r--r--source/blender/render/intern/include/render_types.h11
-rw-r--r--source/blender/render/intern/source/convertblender.c20
-rw-r--r--source/blender/render/intern/source/occlusion.c2
-rw-r--r--source/blender/render/intern/source/pipeline.c8
-rw-r--r--source/blender/render/intern/source/rayshade.c12
-rw-r--r--source/blender/render/intern/source/rendercore.c52
-rw-r--r--source/blender/render/intern/source/shadbuf.c20
-rw-r--r--source/blender/render/intern/source/shadeoutput.c16
-rw-r--r--source/blender/render/intern/source/strand.c4
-rw-r--r--source/blender/render/intern/source/zbuf.c10
-rw-r--r--source/blender/src/CMakeLists.txt2
-rw-r--r--source/blender/src/Makefile1
-rw-r--r--source/blender/src/SConscript3
-rw-r--r--source/blender/src/blenderbuttons.c4310
-rw-r--r--source/blender/src/buttons_editing.c184
-rw-r--r--source/blender/src/buttons_logic.c213
-rw-r--r--source/blender/src/buttons_object.c150
-rw-r--r--source/blender/src/buttons_scene.c18
-rw-r--r--source/blender/src/buttons_shading.c137
-rw-r--r--source/blender/src/drawaction.c129
-rw-r--r--source/blender/src/drawarmature.c3
-rw-r--r--source/blender/src/drawgpencil.c692
-rw-r--r--source/blender/src/drawimage.c56
-rw-r--r--source/blender/src/drawipo.c54
-rw-r--r--source/blender/src/drawmesh.c781
-rw-r--r--source/blender/src/drawnode.c2
-rw-r--r--source/blender/src/drawobject.c335
-rw-r--r--source/blender/src/drawseq.c43
-rw-r--r--source/blender/src/drawtext.c2785
-rw-r--r--source/blender/src/drawview.c550
-rw-r--r--source/blender/src/editaction.c95
-rw-r--r--source/blender/src/editaction_gpencil.c7
-rw-r--r--source/blender/src/editarmature.c384
-rw-r--r--source/blender/src/editdeform.c2
-rw-r--r--source/blender/src/editface.c7
-rw-r--r--source/blender/src/editimasel.c6
-rw-r--r--source/blender/src/editipo.c26
-rw-r--r--source/blender/src/editipo_lib.c13
-rw-r--r--source/blender/src/editkey.c6
-rw-r--r--source/blender/src/editlattice.c2
-rw-r--r--source/blender/src/editmesh.c4
-rw-r--r--source/blender/src/editmesh_mods.c675
-rw-r--r--source/blender/src/editmesh_tools.c352
-rw-r--r--source/blender/src/editmode_undo.c40
-rw-r--r--source/blender/src/editnode.c22
-rw-r--r--source/blender/src/editobject.c47
-rw-r--r--source/blender/src/editseq.c35
-rw-r--r--source/blender/src/editsound.c15
-rw-r--r--source/blender/src/editview.c8
-rw-r--r--source/blender/src/gpencil.c988
-rw-r--r--source/blender/src/header_action.c21
-rw-r--r--source/blender/src/header_image.c11
-rw-r--r--source/blender/src/header_info.c168
-rw-r--r--source/blender/src/header_ipo.c2
-rw-r--r--source/blender/src/header_node.c6
-rw-r--r--source/blender/src/header_script.c8
-rw-r--r--source/blender/src/header_text.c215
-rw-r--r--source/blender/src/header_view3d.c133
-rw-r--r--source/blender/src/headerbuttons.c7
-rw-r--r--source/blender/src/imagepaint.c303
-rw-r--r--source/blender/src/interface.c10
-rw-r--r--source/blender/src/interface_draw.c2
-rw-r--r--source/blender/src/keyval.c195
-rw-r--r--source/blender/src/meshlaplacian.c10
-rw-r--r--source/blender/src/meshtools.c21
-rw-r--r--source/blender/src/outliner.c61
-rw-r--r--source/blender/src/parametrizer.c4
-rw-r--r--source/blender/src/parametrizer.h4
-rw-r--r--source/blender/src/parametrizer_intern.h2
-rw-r--r--source/blender/src/playanim.c20
-rw-r--r--source/blender/src/poselib.c7
-rw-r--r--source/blender/src/poseobject.c217
-rw-r--r--source/blender/src/previewrender.c32
-rw-r--r--source/blender/src/renderwin.c15
-rw-r--r--source/blender/src/resources.c21
-rw-r--r--source/blender/src/sculptmode.c7
-rw-r--r--source/blender/src/sequence.c16
-rw-r--r--source/blender/src/space.c132
-rw-r--r--source/blender/src/splash.jpg.c4574
-rw-r--r--source/blender/src/toets.c4
-rw-r--r--source/blender/src/toolbox.c44
-rw-r--r--source/blender/src/transform_conversions.c57
-rw-r--r--source/blender/src/transform_generics.c49
-rw-r--r--source/blender/src/transform_manipulator.c10
-rw-r--r--source/blender/src/transform_numinput.c14
-rw-r--r--source/blender/src/usiblender.c46
-rw-r--r--source/blender/src/verse_image.c4
-rw-r--r--source/blender/src/view.c135
-rw-r--r--source/blender/yafray/intern/export_File.cpp2
-rw-r--r--source/blender/yafray/intern/export_Plugin.cpp4
-rw-r--r--source/creator/CMakeLists.txt3
-rw-r--r--source/creator/Makefile2
-rw-r--r--source/creator/SConscript2
-rw-r--r--source/creator/creator.c30
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp54
-rw-r--r--source/gameengine/BlenderRoutines/CMakeLists.txt1
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.cpp76
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.h3
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp114
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h99
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp263
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h71
-rw-r--r--source/gameengine/BlenderRoutines/Makefile5
-rw-r--r--source/gameengine/BlenderRoutines/SConscript5
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp69
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.cpp83
-rw-r--r--source/gameengine/Converter/BL_ArmatureObject.h9
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp811
-rw-r--r--source/gameengine/Converter/BL_DeformableGameObject.cpp8
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.cpp89
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.h3
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.cpp87
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.h16
-rw-r--r--source/gameengine/Converter/BL_ShapeDeformer.cpp3
-rw-r--r--source/gameengine/Converter/BL_ShapeDeformer.h11
-rw-r--r--source/gameengine/Converter/BL_SkinDeformer.cpp47
-rw-r--r--source/gameengine/Converter/BL_SkinDeformer.h16
-rw-r--r--source/gameengine/Converter/BL_SkinMeshObject.cpp74
-rw-r--r--source/gameengine/Converter/BL_SkinMeshObject.h45
-rw-r--r--source/gameengine/Converter/CMakeLists.txt1
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp37
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.h2
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp141
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp53
-rw-r--r--source/gameengine/Converter/KX_IpoConvert.cpp62
-rw-r--r--source/gameengine/Converter/KX_IpoConvert.h2
-rw-r--r--source/gameengine/Converter/Makefile1
-rw-r--r--source/gameengine/Converter/SConscript2
-rw-r--r--source/gameengine/Expressions/InputParser.cpp5
-rw-r--r--source/gameengine/Expressions/ListValue.cpp13
-rw-r--r--source/gameengine/Expressions/Makefile1
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp16
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h61
-rw-r--r--source/gameengine/Expressions/Value.cpp74
-rw-r--r--source/gameengine/Expressions/Value.h2
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp203
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.h204
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h8
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp56
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h4
-rw-r--r--source/gameengine/GameLogic/Makefile1
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp13
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorEventManager.h1
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorSensor.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_ActuatorSensor.h2
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp11
-rw-r--r--source/gameengine/GameLogic/SCA_AlwaysEventManager.h1
-rw-r--r--source/gameengine/GameLogic/SCA_DelaySensor.cpp257
-rw-r--r--source/gameengine/GameLogic/SCA_DelaySensor.h77
-rw-r--r--source/gameengine/GameLogic/SCA_EventManager.cpp13
-rw-r--r--source/gameengine/GameLogic/SCA_EventManager.h6
-rw-r--r--source/gameengine/GameLogic/SCA_IController.cpp2
-rw-r--r--source/gameengine/GameLogic/SCA_ILogicBrick.cpp4
-rw-r--r--source/gameengine/GameLogic/SCA_IObject.cpp27
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.cpp97
-rw-r--r--source/gameengine/GameLogic/SCA_ISensor.h28
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.cpp40
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.h5
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.cpp155
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.h43
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardManager.cpp15
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardManager.h1
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.cpp2
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.cpp55
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.h9
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.cpp14
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.h1
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyEventManager.cpp11
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyEventManager.h1
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp46
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.h6
-rw-r--r--source/gameengine/GameLogic/SCA_RandomEventManager.cpp11
-rw-r--r--source/gameengine/GameLogic/SCA_RandomEventManager.h1
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.cpp5
-rw-r--r--source/gameengine/GameLogic/SCA_TimeEventManager.h1
-rw-r--r--source/gameengine/GamePlayer/common/CMakeLists.txt2
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RenderTools.cpp538
-rw-r--r--source/gameengine/GamePlayer/common/GPC_RenderTools.h168
-rw-r--r--source/gameengine/GamePlayer/common/Makefile5
-rw-r--r--source/gameengine/GamePlayer/common/SConscript2
-rw-r--r--source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h4
-rw-r--r--source/gameengine/GamePlayer/common/windows/GPW_Canvas.h2
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp96
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h37
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp35
-rw-r--r--source/gameengine/GamePlayer/ghost/Makefile5
-rw-r--r--source/gameengine/GamePlayer/ghost/SConscript4
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.cpp133
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.h24
-rw-r--r--source/gameengine/Ketsji/BL_Material.h11
-rw-r--r--source/gameengine/Ketsji/BL_Shader.cpp62
-rw-r--r--source/gameengine/Ketsji/BL_Shader.h2
-rw-r--r--source/gameengine/Ketsji/BL_Texture.cpp2
-rw-r--r--source/gameengine/Ketsji/CMakeLists.txt15
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp17
-rw-r--r--source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h3
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.cpp239
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h12
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp69
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp120
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.h29
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp475
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp505
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h106
-rw-r--r--source/gameengine/Ketsji/KX_IPO_SGController.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_ISceneConverter.h4
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.cpp36
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.h12
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp35
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h7
-rw-r--r--source/gameengine/Ketsji/KX_Light.cpp57
-rw-r--r--source/gameengine/Ketsji/KX_Light.h11
-rw-r--r--source/gameengine/Ketsji/KX_MaterialIpoController.cpp11
-rw-r--r--source/gameengine/Ketsji/KX_MaterialIpoController.h8
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.cpp48
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.h2
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.cpp17
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.h6
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.h1
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.cpp66
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.h22
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.cpp70
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.cpp265
-rw-r--r--source/gameengine/Ketsji/KX_PolyProxy.h71
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.cpp60
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.h5
-rw-r--r--source/gameengine/Ketsji/KX_PyConstraintBinding.cpp38
-rw-r--r--source/gameengine/Ketsji/KX_PyMath.h23
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp684
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.h3
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.cpp14
-rw-r--r--source/gameengine/Ketsji/KX_RayCast.cpp85
-rw-r--r--source/gameengine/Ketsji/KX_RayCast.h60
-rw-r--r--source/gameengine/Ketsji/KX_RayEventManager.cpp9
-rw-r--r--source/gameengine/Ketsji/KX_RayEventManager.h1
-rw-r--r--source/gameengine/Ketsji/KX_RaySensor.cpp58
-rw-r--r--source/gameengine/Ketsji/KX_RaySensor.h8
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp193
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h34
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp41
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h2
-rw-r--r--source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp115
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h16
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp64
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.cpp33
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.h2
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.h1
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.cpp80
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_VehicleWrapper.cpp29
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.cpp14
-rw-r--r--source/gameengine/Ketsji/KX_VisibilityActuator.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_VisibilityActuator.h2
-rw-r--r--source/gameengine/Ketsji/Makefile11
-rw-r--r--source/gameengine/Ketsji/SConscript21
-rw-r--r--source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp3
-rw-r--r--source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h4
-rw-r--r--source/gameengine/Physics/Bullet/CMakeLists.txt4
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp294
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.h96
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp230
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h19
-rw-r--r--source/gameengine/Physics/Bullet/Makefile5
-rw-r--r--source/gameengine/Physics/Bullet/SConscript2
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp3
-rw-r--r--source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h4
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp17
-rw-r--r--source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp37
-rw-r--r--source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h4
-rw-r--r--source/gameengine/Physics/common/PHY_DynamicTypes.h12
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h48
-rw-r--r--source/gameengine/PyDoc/BL_ShapeActionActuator.py158
-rw-r--r--source/gameengine/PyDoc/GameKeys.py9
-rw-r--r--source/gameengine/PyDoc/GameLogic.py21
-rw-r--r--source/gameengine/PyDoc/KX_ActuatorSensor.py24
-rw-r--r--source/gameengine/PyDoc/KX_CameraActuator.py8
-rw-r--r--source/gameengine/PyDoc/KX_ConstraintActuator.py120
-rw-r--r--source/gameengine/PyDoc/KX_GameObject.py89
-rw-r--r--source/gameengine/PyDoc/KX_IpoActuator.py19
-rw-r--r--source/gameengine/PyDoc/KX_MeshProxy.py15
-rw-r--r--source/gameengine/PyDoc/KX_ObjectActuator.py106
-rw-r--r--source/gameengine/PyDoc/KX_ParentActuator.py9
-rw-r--r--source/gameengine/PyDoc/KX_PolyProxy.py100
-rw-r--r--source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py30
-rw-r--r--source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py5
-rw-r--r--source/gameengine/PyDoc/KX_StateActuator.py26
-rw-r--r--source/gameengine/PyDoc/KX_TrackToActuator.py10
-rw-r--r--source/gameengine/PyDoc/Rasterizer.py20
-rw-r--r--source/gameengine/PyDoc/SCA_DelaySensor.py56
-rw-r--r--source/gameengine/PyDoc/SCA_ISensor.py31
-rw-r--r--source/gameengine/Rasterizer/Makefile4
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp276
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.h22
-rw-r--r--source/gameengine/Rasterizer/RAS_CameraData.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp44
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.h20
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h54
-rw-r--r--source/gameengine/Rasterizer/RAS_IRenderTools.cpp24
-rw-r--r--source/gameengine/Rasterizer/RAS_IRenderTools.h39
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.cpp574
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.h216
-rw-r--r--source/gameengine/Rasterizer/RAS_MeshObject.cpp768
-rw-r--r--source/gameengine/Rasterizer/RAS_MeshObject.h242
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile5
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp84
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h24
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp782
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h55
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp216
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h18
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript5
-rw-r--r--source/gameengine/Rasterizer/RAS_Polygon.cpp101
-rw-r--r--source/gameengine/Rasterizer/RAS_Polygon.h56
-rw-r--r--source/gameengine/Rasterizer/RAS_TexVert.cpp30
-rw-r--r--source/gameengine/Rasterizer/RAS_TexVert.h28
-rw-r--r--source/gameengine/Rasterizer/SConscript5
-rw-r--r--source/kernel/CMakeLists.txt2
-rw-r--r--source/kernel/SConscript2
-rw-r--r--source/kernel/gen_system/GEN_HashedPtr.cpp8
-rw-r--r--source/kernel/gen_system/GEN_Map.h13
-rw-r--r--source/kernel/gen_system/Makefile1
-rw-r--r--source/nan_definitions.mk11
-rwxr-xr-xtools/btools.py4
657 files changed, 42035 insertions, 17893 deletions
diff --git a/CMake/macros.cmake b/CMake/macros.cmake
index 6b6837d25f0..95799a2c1fd 100644
--- a/CMake/macros.cmake
+++ b/CMake/macros.cmake
@@ -38,6 +38,10 @@ MACRO(BLENDERLIB
ENDMACRO(BLENDERLIB)
MACRO(SETUP_LIBDIRS)
+ # see "cmake --help-policy CMP0003"
+ if(COMMAND cmake_policy)
+ CMAKE_POLICY(SET CMP0003 NEW)
+ endif(COMMAND cmake_policy)
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a23e77d9f8..97113c22f98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,7 +63,6 @@ OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
-OPTION(YESIAMSTUPID "Enable execution on 64-bit platforms" OFF)
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
@@ -183,9 +182,9 @@ IF(UNIX)
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++")
IF(WITH_OPENMP)
- SET(LLIBS "${LLIBS} -lgomp ")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
+ SET(LLIBS "${LLIBS} -lgomp")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
ENDIF(WITH_OPENMP)
@@ -249,7 +248,11 @@ IF(WIN32)
SET(GETTEXT ${LIBDIR}/gettext)
SET(GETTEXT_INC ${GETTEXT}/include)
- SET(GETTEXT_LIB gnu_gettext)
+ IF(CMAKE_CL_64)
+ SET(GETTEXT_LIB gettextlib)
+ ELSE(CMAKE_CL_64)
+ SET(GETTEXT_LIB gnu_gettext)
+ ENDIF(CMAKE_CL_64)
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
SET(FREETYPE ${LIBDIR}/freetype)
@@ -280,7 +283,12 @@ IF(WIN32)
SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
+ IF(CMAKE_CL_64)
+ SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
+ ELSE(CMAKE_CL_64)
SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+ ENDIF(CMAKE_CL_64)
+
IF(WITH_OPENAL)
SET(LLIBS ${LLIBS} dxguid)
ENDIF(WITH_OPENAL)
@@ -318,7 +326,7 @@ IF(WIN32)
SET(WINTAB_INC ${LIBDIR}/wintab/include)
IF(CMAKE_CL_64)
- SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib;MSVCRT.lib ")
+ SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
ELSE(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
ENDIF(CMAKE_CL_64)
diff --git a/SConstruct b/SConstruct
index 53b3ce70328..4cff807c5a6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -184,15 +184,16 @@ if env['WITH_BF_OPENMP'] == 1:
env['CPPFLAGS'].append('/openmp')
env['CXXFLAGS'].append('/openmp')
else:
- if env['CC'] == 'icc':
+ if env['CC'][-3:] == 'icc': # to be able to handle CC=/opt/bla/icc case
env.Append(LINKFLAGS=['-openmp', '-static-intel'])
env['CCFLAGS'].append('-openmp')
env['CPPFLAGS'].append('-openmp')
env['CXXFLAGS'].append('-openmp')
else:
- env['CCFLAGS'].append('-fopenmp')
- env['CPPFLAGS'].append('-fopenmp')
- env['CXXFLAGS'].append('-fopenmp')
+ env.Append(CCFLAGS=['-fopenmp'])
+ env.Append(CPPFLAGS=['-fopenmp'])
+ env.Append(CXXFLAGS=['-fopenmp'])
+ # env.Append(LINKFLAGS=['-fprofile-generate'])
#check for additional debug libnames
diff --git a/bin/.blender/.Blanguages b/bin/.blender/.Blanguages
index 0f98ce02247..de8d8c44550 100644
--- a/bin/.blender/.Blanguages
+++ b/bin/.blender/.Blanguages
@@ -20,3 +20,4 @@ Romanian:ro
Arabic:ar
Bulgarian:bg
Greek:el
+Korean:kr
diff --git a/blenderplayer/CMakeLists.txt b/blenderplayer/CMakeLists.txt
index d90639562d2..e32390466c7 100644
--- a/blenderplayer/CMakeLists.txt
+++ b/blenderplayer/CMakeLists.txt
@@ -90,6 +90,7 @@ IF(UNIX)
bf_soundsystem
bf_kernel
bf_nodes
+ bf_gpu
bf_imbuf
bf_avi
kx_network
diff --git a/config/linux2-config.py b/config/linux2-config.py
index b9c6e888b70..ba6099d509c 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -143,7 +143,7 @@ BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}/include'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
-WITH_BF_REDCODE = 'true'
+WITH_BF_REDCODE = 'false'
BF_REDCODE = '#extern/libredcode'
BF_REDCODE_LIB = ''
# Uncomment the following two lines to use system's ffmpeg
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
index b49036a5b50..7dc7d8d2f68 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
@@ -181,7 +181,9 @@ void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTra
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback,short int collisionFilterMask)
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask,
+ bool faceNormal)
{
btSphereShape pointShape(btScalar(0.0));
@@ -191,14 +193,16 @@ void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTra
collisionObject,
collisionShape,
colObjWorldTransform,
- resultCallback,collisionFilterMask);
+ resultCallback,collisionFilterMask,faceNormal);
}
void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const btTransform& rayFromTrans,const btTransform& rayToTrans,
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback,short int collisionFilterMask)
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask,
+ bool faceNormal)
{
@@ -257,9 +261,9 @@ void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const bt
btCollisionObject* m_collisionObject;
btTriangleMeshShape* m_triangleMesh;
- BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
- btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh):
- btTriangleRaycastCallback(from,to),
+ BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,bool faceNormal,
+ btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh):
+ btTriangleRaycastCallback(from,to,faceNormal),
m_resultCallback(resultCallback),
m_collisionObject(collisionObject),
m_triangleMesh(triangleMesh)
@@ -272,6 +276,7 @@ void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const bt
btCollisionWorld::LocalShapeInfo shapeInfo;
shapeInfo.m_shapePart = partId;
shapeInfo.m_triangleIndex = triangleIndex;
+ shapeInfo.m_triangleShape = m_triangleMesh;
btCollisionWorld::LocalRayResult rayResult
(m_collisionObject,
@@ -287,7 +292,7 @@ void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const bt
};
- BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh);
+ BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,faceNormal,&resultCallback,collisionObject,triangleMesh);
rcb.m_hitFraction = resultCallback.m_closestHitFraction;
btVector3 rayAabbMinLocal = rayFromLocal;
@@ -313,7 +318,7 @@ void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const bt
collisionObject,
childCollisionShape,
childWorldTrans,
- resultCallback, collisionFilterMask);
+ resultCallback, collisionFilterMask, faceNormal);
}
@@ -323,7 +328,7 @@ void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const bt
}
}
-void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback,short int collisionFilterMask)
+void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback,short int collisionFilterMask, bool faceNormal)
{
@@ -350,11 +355,17 @@ void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& r
btVector3 hitNormal;
if (btRayAabb(rayFromWorld,rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal))
{
- rayTestSingle(rayFromTrans,rayToTrans,
- collisionObject,
- collisionObject->getCollisionShape(),
- collisionObject->getWorldTransform(),
- resultCallback);
+ // before testing this object, verify that it is not filtered out
+ if (resultCallback.NeedRayCast(collisionObject))
+ {
+ rayTestSingle(rayFromTrans,rayToTrans,
+ collisionObject,
+ collisionObject->getCollisionShape(),
+ collisionObject->getWorldTransform(),
+ resultCallback,
+ collisionFilterMask,
+ faceNormal);
+ }
}
}
}
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
index b6d80233ab7..ed41232ece3 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
@@ -125,8 +125,8 @@ public:
{
int m_shapePart;
int m_triangleIndex;
-
- //const btCollisionShape* m_shapeTemp;
+ // needed in case of compound shape
+ const btCollisionShape* m_triangleShape;
//const btTransform* m_shapeLocalTransform;
};
@@ -166,6 +166,10 @@ public:
:m_closestHitFraction(btScalar(1.))
{
}
+ virtual bool NeedRayCast(btCollisionObject* object)
+ {
+ return true;
+ }
virtual btScalar AddSingleResult(LocalRayResult& rayResult) = 0;
};
@@ -209,7 +213,7 @@ public:
/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
- void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback, short int collisionFilterMask=-1);
+ void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback, short int collisionFilterMask=-1, bool faceNormal=false);
/// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest.
/// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape.
@@ -218,14 +222,18 @@ public:
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback, short int collisionFilterMask=-1);
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask=-1,
+ bool faceNormal=false);
/// objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.
static void objectQuerySingle(const btConvexShape* castShape, const btTransform& rayFromTrans,const btTransform& rayToTrans,
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback, short int collisionFilterMask=-1);
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask=-1,
+ bool faceNormal=false);
void addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=1,short int collisionFilterMask=1);
diff --git a/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp b/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
index 31b91467777..68ac93ec3cc 100644
--- a/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
+++ b/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
@@ -16,10 +16,11 @@ subject to the following restrictions:
#include "btRaycastCallback.h"
-btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to)
+btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to,bool faceNormal)
:
m_from(from),
m_to(to),
+ m_faceNormal(faceNormal),
m_hitFraction(btScalar(1.))
{
@@ -84,8 +85,7 @@ void btTriangleRaycastCallback::processTriangle(btVector3* triangle,int partId,
if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance)
{
-
- if ( dist_a > 0 )
+ if (m_faceNormal || dist_a > 0)
{
m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);
}
diff --git a/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h b/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
index a0bbc9f8fe9..71ed9fead49 100644
--- a/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
+++ b/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
@@ -27,10 +27,11 @@ public:
//input
btVector3 m_from;
btVector3 m_to;
+ bool m_faceNormal;
btScalar m_hitFraction;
- btTriangleRaycastCallback(const btVector3& from,const btVector3& to);
+ btTriangleRaycastCallback(const btVector3& from,const btVector3& to,bool faceNormal);
virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
index 29719ec9a3e..1017c8af6ea 100644
--- a/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+++ b/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
@@ -856,10 +856,26 @@ void btDiscreteDynamicsWorld::debugDrawObject(const btTransform& worldTransform,
btScalar radius = coneShape->getRadius();//+coneShape->getMargin();
btScalar height = coneShape->getHeight();//+coneShape->getMargin();
btVector3 start = worldTransform.getOrigin();
- getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(radius,btScalar(0.),btScalar(-0.5)*height),color);
- getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(-radius,btScalar(0.),btScalar(-0.5)*height),color);
- getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),radius,btScalar(-0.5)*height),color);
- getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),-radius,btScalar(-0.5)*height),color);
+ // insert here Bullet 2.69 that fixes representation of cone
+ int upAxis= coneShape->getConeUpIndex();
+
+ btVector3 offsetHeight(0,0,0);
+ offsetHeight[upAxis] = height * btScalar(0.5);
+ btVector3 offsetRadius(0,0,0);
+ offsetRadius[(upAxis+1)%3] = radius;
+ btVector3 offset2Radius(0,0,0);
+ offset2Radius[(upAxis+2)%3] = radius;
+
+ getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offsetRadius),color);
+ getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offsetRadius),color);
+ getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offset2Radius),color);
+ getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offset2Radius),color);
+
+ // buggy code that does not take into account the direction of the cone
+ //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(radius,btScalar(0.),btScalar(-0.5)*height),color);
+ //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(-radius,btScalar(0.),btScalar(-0.5)*height),color);
+ //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),radius,btScalar(-0.5)*height),color);
+ //getDebugDrawer()->drawLine(start+worldTransform.getBasis() * btVector3(btScalar(0.),btScalar(0.),btScalar(0.5)*height),start+worldTransform.getBasis() * btVector3(btScalar(0.),-radius,btScalar(-0.5)*height),color);
break;
}
diff --git a/extern/glew/SConscript b/extern/glew/SConscript
index 32b3b478113..3badbeb040e 100644
--- a/extern/glew/SConscript
+++ b/extern/glew/SConscript
@@ -9,4 +9,4 @@ sources = ['src/glew.c']
defs = ''
incs = 'include'
-env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['intern', 'player'], priority=[25, 50])
+env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['blender', 'player'], priority=[50, 50])
diff --git a/extern/glew/include/GL/glew.h b/extern/glew/include/GL/glew.h
index fd3fe10b938..6b88e6eb4c9 100644
--- a/extern/glew/include/GL/glew.h
+++ b/extern/glew/include/GL/glew.h
@@ -58,8 +58,11 @@
** version 1.2.1 Specification.
*/
-/* added this here for blender, should be moved elsewhere */
+#define BLENDER_CHANGES
+
+#ifdef BLENDER_CHANGES
#define GLEW_STATIC
+#endif
#ifndef __glew_h__
#define __glew_h__
@@ -1805,6 +1808,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuin
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v);
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);
+#ifndef BLENDER_CHANGES
#define glAttachShader GLEW_GET_FUN(__glewAttachShader)
#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)
#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate)
@@ -1898,6 +1902,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint si
#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv)
#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv)
#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
+#endif
#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)
diff --git a/extern/glew/src/glew.c b/extern/glew/src/glew.c
index 593f0e58f7c..f20463630dc 100644
--- a/extern/glew/src/glew.c
+++ b/extern/glew/src/glew.c
@@ -1836,6 +1836,7 @@ static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
{
GLboolean r = GL_FALSE;
+#ifndef BLENDER_CHANGES
r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r;
r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r;
r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r;
@@ -1929,6 +1930,7 @@ static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r;
r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r;
r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r;
+#endif
return r;
}
diff --git a/intern/bmfont/intern/BDF2BMF.py b/intern/bmfont/intern/BDF2BMF.py
new file mode 100644
index 00000000000..15b9e5b8eb4
--- /dev/null
+++ b/intern/bmfont/intern/BDF2BMF.py
@@ -0,0 +1,177 @@
+#!/usr/bin/python
+
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+HELP_TXT = \
+'''
+Convert BDF pixmap fonts into C++ files Blender can read.
+Use to replace bitmap fonts or add new ones.
+
+Usage
+ python bdf2bmf.py -name=SomeName myfile.bdf
+
+Blender currently supports fonts with a maximum width of 8 pixels.
+'''
+
+# -------- Simple BDF parser
+import sys
+def parse_bdf(f, MAX_CHARS=256):
+ lines = [l.strip().upper().split() for l in f.readlines()]
+
+ is_bitmap = False
+ dummy = {'BITMAP':[]}
+ char_data = [dummy.copy() for i in xrange(MAX_CHARS)]
+ context_bitmap = []
+
+ for l in lines:
+ if l[0]=='ENCODING': enc = int(l[1])
+ elif l[0]=='BBX': bbx = [int(c) for c in l[1:]]
+ elif l[0]=='DWIDTH': dwidth = int(l[1])
+ elif l[0]=='BITMAP': is_bitmap = True
+ elif l[0]=='ENDCHAR':
+ if enc < MAX_CHARS:
+ char_data[enc]['BBX'] = bbx
+ char_data[enc]['DWIDTH'] = dwidth
+ char_data[enc]['BITMAP'] = context_bitmap
+
+ context_bitmap = []
+ enc = bbx = None
+ is_bitmap = False
+ else:
+ # None of the above, Ok, were reading a bitmap
+ if is_bitmap and enc < MAX_CHARS:
+ context_bitmap.append( int(l[0], 16) )
+
+ return char_data
+# -------- end simple BDF parser
+
+def bdf2cpp_name(path):
+ return path.split('.')[0] + '.cpp'
+
+def convert_to_blender(bdf_dict, font_name, origfilename, MAX_CHARS=256):
+
+ # first get a global width/height, also set the offsets
+ xmin = ymin = 10000000
+ xmax = ymax = -10000000
+
+ bitmap_offsets = [-1] * MAX_CHARS
+ bitmap_tot = 0
+ for i, c in enumerate(bdf_dict):
+ if c.has_key('BBX'):
+ bbx = c['BBX']
+ xmax = max(bbx[0], xmax)
+ ymax = max(bbx[1], ymax)
+ xmin = min(bbx[2], xmin)
+ ymin = min(bbx[3], ymin)
+
+ bitmap_offsets[i] = bitmap_tot
+ bitmap_tot += len(c['BITMAP'])
+
+ c['BITMAP'].reverse()
+
+ # Now we can write. Ok if we have no .'s in the path.
+ f = open(bdf2cpp_name(origfilename), 'w')
+
+ f.write('''
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "BMF_FontData.h"
+
+#include "BMF_Settings.h"
+''')
+
+ f.write('#if BMF_INCLUDE_%s\n\n' % font_name.upper())
+ f.write('static unsigned char bitmap_data[]= {')
+ newline = 8
+
+ for i, c in enumerate(bdf_dict):
+
+ for cdata in c['BITMAP']:
+ # Just formatting
+ newline+=1
+ if newline >= 8:
+ newline = 0
+ f.write('\n\t')
+ # End formatting
+
+ f.write('0x%.2hx,' % cdata) # 0x80 <- format
+
+ f.write("\n};\n")
+
+ f.write("BMF_FontData BMF_font_%s = {\n" % font_name)
+ f.write('\t%d, %d,\n' % (xmin, ymin))
+ f.write('\t%d, %d,\n' % (xmax, ymax))
+
+ f.write('\t{\n')
+
+
+ for i, c in enumerate(bdf_dict):
+ if bitmap_offsets[i] == -1 or c.has_key('BBX') == False:
+ f.write('\t\t{0,0,0,0,0, -1},\n')
+ else:
+ bbx = c['BBX']
+ f.write('\t\t{%d,%d,%d,%d,%d, %d},\n' % (bbx[0], bbx[1], -bbx[2], -bbx[3], c['DWIDTH'], bitmap_offsets[i]))
+
+ f.write('''
+ },
+ bitmap_data
+};
+
+#endif
+''')
+
+def main():
+ # replace "[-name=foo]" with "[-name] [foo]"
+ args = []
+ for arg in sys.argv:
+ for a in arg.replace('=', ' ').split():
+ args.append(a)
+
+ name = 'untitled'
+ done_anything = False
+ for i, arg in enumerate(args):
+ if arg == '-name':
+ if i==len(args)-1:
+ print 'no arg given for -name, aborting'
+ return
+ else:
+ name = args[i+1]
+
+ elif arg.lower().endswith('.bdf'):
+ try:
+ f = open(arg)
+ print '...Writing to:', bdf2cpp_name(arg)
+ except:
+ print 'could not open "%s", aborting' % arg
+
+
+ bdf_dict = parse_bdf(f)
+ convert_to_blender(bdf_dict, name, arg)
+ done_anything = True
+
+ if not done_anything:
+ print HELP_TXT
+ print '...nothing to do'
+
+if __name__ == '__main__':
+ main()
+
diff --git a/intern/boolop/SConscript b/intern/boolop/SConscript
index a3f3c0b6433..bec263f251f 100644
--- a/intern/boolop/SConscript
+++ b/intern/boolop/SConscript
@@ -8,7 +8,7 @@ incs += ' ../../source/blender/makesdna ../../intern/guardedalloc'
incs += ' ../../source/blender/blenlib'
if (env['OURPLATFORM'] == 'win32-mingw'):
- env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype=['common','intern'], priority = [5,50] )
+ env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype=['common','intern'], priority = [30,85] )
else:
env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype='common', priority = 5 )
diff --git a/intern/boolop/intern/BOP_Edge.cpp b/intern/boolop/intern/BOP_Edge.cpp
index ac302b530df..44e7d5cb567 100644
--- a/intern/boolop/intern/BOP_Edge.cpp
+++ b/intern/boolop/intern/BOP_Edge.cpp
@@ -75,4 +75,47 @@ void BOP_Edge::replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex)
else if (m_vertexs[1] == oldIndex) m_vertexs[1] = newIndex;
}
+#ifdef BOP_NEW_MERGE
+
+/**
+ * Returns if this edge contains the specified face index.
+ * @param i face index
+ * @return true if this edge contains the specified face index, false otherwise
+ */
+bool BOP_Edge::removeFace(BOP_Index i)
+{
+ int pos=0;
+ for(BOP_IT_Indexs it = m_faces.begin();it!=m_faces.end();pos++,it++) {
+ if ((*it) == i) {
+ m_faces.erase(it);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+#endif
+
+#ifdef BOP_DEBUG
+
+#include <iostream>
+using namespace std;
+
+/**
+ * Implements operator <<.
+ */
+ostream &operator<<(ostream &stream, BOP_Edge *e)
+{
+ stream << "Edge[" << e->getVertex1() << "," << e->getVertex2();
+#ifdef BOP_NEW_MERGE
+ if(e->m_used)
+ stream << "] (used)";
+ else
+ stream << "] (unused)";
+#endif
+ return stream;
+}
+#endif
+
diff --git a/intern/boolop/intern/BOP_Edge.h b/intern/boolop/intern/BOP_Edge.h
index 13426f6e63c..a817b3d624f 100644
--- a/intern/boolop/intern/BOP_Edge.h
+++ b/intern/boolop/intern/BOP_Edge.h
@@ -29,12 +29,16 @@
#define BOP_EDGE_H
#include "BOP_Indexs.h"
+#include "BOP_Misc.h"
class BOP_Edge
{
private:
BOP_Index m_vertexs[2];
BOP_Indexs m_faces;
+#ifdef BOP_NEW_MERGE
+ bool m_used;
+#endif
bool containsFace(BOP_Index i);
@@ -47,6 +51,15 @@ public:
inline unsigned int getNumFaces(){return m_faces.size();};
inline BOP_Indexs &getFaces(){return m_faces;};
void addFace(BOP_Index face);
+#ifdef BOP_NEW_MERGE
+ bool removeFace(BOP_Index i);
+ bool getUsed() { return m_used;};
+ void setUsed(bool setting) { m_used=setting;};
+#endif
+#ifdef BOP_DEBUG
+ friend ostream &operator<<(ostream &stream, BOP_Edge *e);
+#endif
+
};
#endif
diff --git a/intern/boolop/intern/BOP_Face.cpp b/intern/boolop/intern/BOP_Face.cpp
index 12c94624517..01308de3e5d 100644
--- a/intern/boolop/intern/BOP_Face.cpp
+++ b/intern/boolop/intern/BOP_Face.cpp
@@ -402,6 +402,7 @@ bool BOP_Face4::getEdgeIndex(BOP_Index v1, BOP_Index v2, unsigned int &e)
return true;
}
+#ifdef BOP_DEBUG
/**
* Implements operator <<.
*/
@@ -421,3 +422,4 @@ ostream &operator<<(ostream &stream, BOP_Face *f)
return stream;
}
+#endif
diff --git a/intern/boolop/intern/BOP_Face.h b/intern/boolop/intern/BOP_Face.h
index e16425f78b3..965882db732 100644
--- a/intern/boolop/intern/BOP_Face.h
+++ b/intern/boolop/intern/BOP_Face.h
@@ -32,6 +32,7 @@
#include "MT_Plane3.h"
#include "BOP_Indexs.h"
#include "BOP_BBox.h"
+#include "BOP_Misc.h"
#include <iostream>
#include <vector>
using namespace std;
@@ -80,7 +81,9 @@ public:
virtual void replaceVertexIndex(BOP_Index oldIndex, BOP_Index newIndex) = 0;
virtual bool containsVertex(BOP_Index v) = 0;
+#ifdef BOP_DEBUG
friend ostream &operator<<(ostream &stream, BOP_Face *f);
+#endif
};
class BOP_Face3: public BOP_Face
diff --git a/intern/boolop/intern/BOP_Interface.cpp b/intern/boolop/intern/BOP_Interface.cpp
index 2a198103931..c6bcb4a74ce 100644
--- a/intern/boolop/intern/BOP_Interface.cpp
+++ b/intern/boolop/intern/BOP_Interface.cpp
@@ -33,9 +33,12 @@
#include "BOP_Mesh.h"
#include "BOP_Face2Face.h"
#include "BOP_Merge.h"
+#include "BOP_Merge2.h"
#include "BOP_Chrono.h"
-//#define DEBUG
+#if defined(BOP_ORIG_MERGE) && defined(BOP_NEW_MERGE)
+#include "../../../source/blender/blenkernel/BKE_global.h"
+#endif
BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
BOP_Faces* facesA,
@@ -208,7 +211,32 @@ BoolOpState BOP_intersectionBoolOp(BOP_Mesh* meshC,
#endif
// Merge faces
+#ifdef BOP_ORIG_MERGE
+#ifndef BOP_NEW_MERGE
BOP_Merge::getInstance().mergeFaces(meshC,numVertices);
+#endif
+#endif
+
+#ifdef BOP_NEW_MERGE
+#ifndef BOP_ORIG_MERGE
+ BOP_Merge2::getInstance().mergeFaces(meshC,numVertices);
+#else
+ static int state = -1;
+ if (G.rt == 100) {
+ if( state != 1 ) {
+ cout << "Boolean code using old merge technique." << endl;
+ state = 1;
+ }
+ BOP_Merge::getInstance().mergeFaces(meshC,numVertices);
+ } else {
+ if( state != 0 ) {
+ cout << "Boolean code using new merge technique." << endl;
+ state = 0;
+ }
+ BOP_Merge2::getInstance().mergeFaces(meshC,numVertices);
+ }
+#endif
+#endif
#ifdef DEBUG
c = chrono.stamp(); t += c;
diff --git a/intern/boolop/intern/BOP_Merge.cpp b/intern/boolop/intern/BOP_Merge.cpp
index 1e4139ab971..012d3409187 100644
--- a/intern/boolop/intern/BOP_Merge.cpp
+++ b/intern/boolop/intern/BOP_Merge.cpp
@@ -30,6 +30,7 @@
#include "BOP_Merge.h"
+#ifdef BOP_ORIG_MERGE
#ifdef _MSC_VER
#if _MSC_VER < 1300
@@ -802,3 +803,5 @@ void BOP_Merge::getFaces(BOP_LFaces &facesByOriginalFace, BOP_Indexs vertices, B
}
}
}
+
+#endif /* BOP_ORIG_MERGE */
diff --git a/intern/boolop/intern/BOP_Merge.h b/intern/boolop/intern/BOP_Merge.h
index 88999b2e734..ceb8ec10690 100644
--- a/intern/boolop/intern/BOP_Merge.h
+++ b/intern/boolop/intern/BOP_Merge.h
@@ -28,6 +28,9 @@
#ifndef BOP_MERGE_H
#define BOP_MERGE_H
+#include "BOP_Misc.h"
+
+#ifdef BOP_ORIG_MERGE
#include "BOP_Mesh.h"
#include "BOP_Tag.h"
#include "BOP_MathUtils.h"
@@ -68,4 +71,6 @@ class BOP_Merge {
void mergeFaces(BOP_Mesh *m, BOP_Index v);
};
+#endif /* BOP_ORIG_MERGE */
+
#endif
diff --git a/intern/boolop/intern/BOP_Merge2.cpp b/intern/boolop/intern/BOP_Merge2.cpp
new file mode 100644
index 00000000000..bbf3f8ba702
--- /dev/null
+++ b/intern/boolop/intern/BOP_Merge2.cpp
@@ -0,0 +1,944 @@
+/**
+ *
+ * $Id: BOP_Merge22.cpp 14444 2008-04-16 22:40:48Z hos $
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Marc Freixas, Ken Hughes
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "BOP_Merge2.h"
+
+#ifdef BOP_NEW_MERGE
+
+static void deleteFace(BOP_Mesh *m, BOP_Face *face);
+
+/**
+ * SINGLETON (use method BOP_Merge2.getInstance).
+ */
+BOP_Merge2 BOP_Merge2::SINGLETON;
+
+#ifdef BOP_DEBUG
+void dumpmesh ( BOP_Mesh *m, bool force )
+{
+ unsigned int nonmanifold = 0;
+ {
+ BOP_Edges edges = m->getEdges();
+ int count = 0;
+ for (BOP_IT_Edges edge = edges.begin(); edge != edges.end();
+ ++count, ++edge) {
+ if (!(*edge)->getUsed() && (*edge)->getFaces().size() == 0 ) continue;
+ BOP_Vertex * v1 = m->getVertex((*edge)->getVertex1());
+ BOP_Vertex * v2 = m->getVertex((*edge)->getVertex2());
+
+ if(v1->getTAG()!= BROKEN || v2->getTAG()!= BROKEN ) {
+ int fcount = 0;
+ BOP_Indexs faces = (*edge)->getFaces();
+ for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); face++) {
+ BOP_Face *f = m->getFace(*face);
+ if(f->getTAG()== UNCLASSIFIED) ++fcount;
+ }
+
+
+ if(fcount !=0 && fcount !=2 ) {
+ ++nonmanifold;
+ }
+ }
+ }
+ if (!force && nonmanifold == 0) return;
+ }
+ if( nonmanifold )
+ cout << nonmanifold << " edges detected" << endl;
+#ifdef DEBUG
+ cout << "---------------------------" << endl;
+
+ BOP_Edges edges = m->getEdges();
+ int count = 0;
+ for (BOP_IT_Edges edge = edges.begin(); edge != edges.end();
+ ++count, ++edge) {
+ BOP_Vertex * v1 = m->getVertex((*edge)->getVertex1());
+ BOP_Vertex * v2 = m->getVertex((*edge)->getVertex2());
+
+ if(v1->getTAG()!= BROKEN || v2->getTAG()!= BROKEN ) {
+ int fcount = 0;
+ BOP_Indexs faces = (*edge)->getFaces();
+ cout << count << ", " << (*edge) << ", " << faces.size() << endl;
+ for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); face++) {
+ BOP_Face *f = m->getFace(*face);
+ if(f->getTAG()== UNCLASSIFIED) ++fcount;
+ cout << " face " << f << endl;
+ }
+
+
+ if(fcount !=0 && fcount !=2 )
+ cout << " NON-MANIFOLD" << endl;
+ }
+ }
+
+ BOP_Faces faces = m->getFaces();
+ count = 0;
+ for (BOP_IT_Faces face = faces.begin(); face != faces.end(); face++) {
+ if( count < 12*2 || (*face)->getTAG() != BROKEN ) {
+ cout << count << ", " << *face << endl;
+ }
+ ++count;
+ }
+
+ BOP_Vertexs verts = m->getVertexs();
+ count = 0;
+ for (BOP_IT_Vertexs vert = verts.begin(); vert != verts.end(); vert++) {
+ cout << count++ << ", " << *vert << " " << (*vert)->getNumEdges() << endl;
+ BOP_Indexs edges = (*vert)->getEdges();
+ for( BOP_IT_Indexs it = edges.begin(); it != edges.end(); ++it) {
+ BOP_Edge *edge = m->getEdge(*it);
+ cout << " " << edge << endl;
+ }
+ }
+ cout << "===========================" << endl;
+#endif
+}
+#endif
+
+/**
+ * Simplifies a mesh, merging its faces.
+ * @param m mesh
+ * @param v index of the first mergeable vertex (can be removed by merge)
+ */
+
+void BOP_Merge2::mergeFaces(BOP_Mesh *m, BOP_Index v)
+{
+ m_mesh = m;
+
+#ifdef DEBUG
+ cout << "##############################" << endl;
+#endif
+ cleanup( );
+
+ m_firstVertex = v;
+ bool cont = false;
+
+ // Merge faces
+ mergeFaces();
+
+ do {
+ // Add quads ...
+ cont = createQuads();
+ // ... and merge new faces
+ if( cont ) cont = mergeFaces();
+
+#ifdef DEBUG
+ cout << "called mergeFaces " << cont << endl;
+#endif
+ // ... until the merge is not succesful
+ } while(cont);
+}
+
+void clean_nonmanifold( BOP_Mesh *m )
+{
+ return;
+
+ BOP_Edges nme;
+ BOP_Edges e = m->getEdges();
+ for( BOP_IT_Edges it = e.begin(); it != e.end(); ++it ) {
+ BOP_Indexs faces = (*it)->getFaces();
+ if( faces.size() & ~2 )
+ nme.push_back(*it);
+ }
+ if (nme.size() == 0) return;
+ for( BOP_IT_Edges it = nme.begin(); it != nme.end(); ++it ) {
+ if( (*it)->getFaces().size() > 1 ) {
+ BOP_Indexs faces = (*it)->getFaces();
+ for( BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face ) {
+ MT_Point3 vertex1 = m->getVertex(m->getFace(*face)->getVertex(0))->getPoint();
+ MT_Point3 vertex2 = m->getVertex(m->getFace(*face)->getVertex(1))->getPoint();
+ MT_Point3 vertex3 = m->getVertex(m->getFace(*face)->getVertex(2))->getPoint();
+ if (BOP_collinear(vertex1,vertex2,vertex3)) // collinear triangle
+ deleteFace(m,m->getFace(*face));
+ }
+ continue;
+ }
+ BOP_Face *oface1 = m->getFace((*it)->getFaces().front());
+ BOP_Face *oface2, *tmpface;
+ BOP_Index first =(*it)->getVertex1();
+ BOP_Index next =(*it)->getVertex2();
+ BOP_Index last = first;
+ unsigned short facecount = 0;
+ bool found = false;
+ BOP_Indexs vertList;
+#ifdef DEBUG
+ cout << " first edge is " << (*it) << endl;
+#endif
+ vertList.push_back(first);
+ BOP_Edge *edge;
+ while(true) {
+ BOP_Vertex *vert = m->getVertex(next);
+ BOP_Indexs edges = vert->getEdges();
+ edge = NULL;
+ for( BOP_IT_Indexs eit = edges.begin(); eit != edges.end(); ++eit) {
+ edge = m->getEdge(*eit);
+ if( edge->getFaces().size() > 1) {
+ edge = NULL;
+ continue;
+ }
+ if( edge->getVertex1() == next && edge->getVertex2() != last ) {
+ last = next;
+ next = edge->getVertex2();
+ break;
+ }
+ if( edge->getVertex2() == next && edge->getVertex1() != last ) {
+ last = next;
+ next = edge->getVertex1();
+ break;
+ }
+ edge = NULL;
+ }
+ if( !edge ) break;
+#ifdef DEBUG
+ cout << " next edge is " << edge << endl;
+#endif
+ tmpface = m->getFace(edge->getFaces().front());
+ if( oface1->getOriginalFace() != tmpface->getOriginalFace() )
+ oface2 = tmpface;
+ else
+ ++facecount;
+ vertList.push_back(last);
+ if( vertList.size() > 3 ) break;
+ if( next == first ) {
+ found = true;
+ break;
+ }
+ }
+ if(found) {
+ edge = *it;
+#ifdef DEBUG
+ cout << " --> found a loop" << endl;
+#endif
+ if( vertList.size() == 3 ) {
+ BOP_Face3 *face = (BOP_Face3 *)m->getFace(edge->getFaces().front());
+ face->getNeighbours(first,last,next);
+ } else if( vertList.size() == 4 ) {
+ BOP_Face4 *face = (BOP_Face4 *)m->getFace(edge->getFaces().front());
+ face->getNeighbours(first,last,next,last);
+ } else {
+#ifdef DEBUG
+ cout << "loop has " << vertList.size() << "verts";
+#endif
+ continue;
+ }
+ if(facecount == 1) oface1 = oface2;
+ next = vertList[1];
+ last = vertList[2];
+ if( edge->getVertex2() == next ) {
+ BOP_Face3 *f = new BOP_Face3(next,first,last,
+ oface1->getPlane(),oface1->getOriginalFace());
+ m->addFace( f );
+#ifdef DEBUG
+ cout << " face is backward: " << f << endl;
+#endif
+
+ } else {
+ BOP_Face3 *f = new BOP_Face3(last,first,next,
+ oface1->getPlane(),oface1->getOriginalFace());
+ m->addFace( f );
+#ifdef DEBUG
+ cout << " face is forward: " << f << endl;
+#endif
+ }
+ }
+ }
+}
+
+/**
+ * Runs through mesh and makes sure vert/face/edge data is consistent. Most
+ * importantly:
+ * (1) mark edges which are no longer used
+ * (2) remove broken faces from edges
+ * (3) remove faces from mesh which have a single edge belonging to no other
+ * face (non-manifold edges)
+ */
+
+void BOP_Merge2::cleanup( void )
+{
+ BOP_Edges edges = m_mesh->getEdges();
+ for (BOP_IT_Edges edge = edges.begin(); edge != edges.end(); ++edge) {
+ BOP_Indexs faces = (*edge)->getFaces();
+ for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face) {
+ BOP_Face *f = m_mesh->getFace(*face);
+ if(f->getTAG()== UNCLASSIFIED) ;
+ else (*edge)->removeFace(*face);
+ }
+ if( (*edge)->getFaces().size() == 0) (*edge)->setUsed(false);
+ }
+
+ BOP_Vertexs v = m_mesh->getVertexs();
+ for( BOP_IT_Vertexs it = v.begin(); it != v.end(); ++it ) {
+ if( (*it)->getTAG() != BROKEN) {
+ BOP_Indexs edges = (*it)->getEdges();
+ for(BOP_IT_Indexs i = edges.begin();i!=edges.end();i++)
+ if( m_mesh->getEdge((*i))->getUsed( ) == false) (*it)->removeEdge( *i );
+ if( (*it)->getEdges().size() == 0 ) (*it)->setTAG(BROKEN);
+ }
+ }
+ // clean_nonmanifold( m_mesh );
+}
+
+/**
+ * Simplifies a mesh, merging its faces.
+ */
+bool BOP_Merge2::mergeFaces()
+{
+ BOP_Indexs mergeVertices;
+ BOP_Vertexs vertices = m_mesh->getVertexs();
+ BOP_IT_Vertexs v = vertices.begin();
+ const BOP_IT_Vertexs verticesEnd = vertices.end();
+
+ // Advance to first mergeable vertex
+ advance(v,m_firstVertex);
+ BOP_Index pos = m_firstVertex;
+
+ // Add unbroken vertices to the list
+ while(v!=verticesEnd) {
+ if ((*v)->getTAG() != BROKEN) {
+ mergeVertices.push_back(pos);
+ }
+
+ v++;
+ pos++;
+ }
+
+ // Merge faces with that vertices
+ return mergeFaces(mergeVertices);
+}
+
+/**
+ * remove edges from vertices when the vertex is removed
+ */
+void BOP_Merge2::freeVerts(BOP_Index v, BOP_Vertex *vert)
+{
+ BOP_Indexs edges = vert->getEdges();
+ BOP_Vertex *other;
+
+ for( BOP_IT_Indexs it = edges.begin(); it != edges.end(); ++it) {
+ BOP_Edge *edge = m_mesh->getEdge(*it);
+ BOP_Indexs edges2;
+ if( edge->getVertex1() != v )
+ other = m_mesh->getVertex( edge->getVertex1() );
+ else
+ other = m_mesh->getVertex( edge->getVertex2() );
+ other->removeEdge(*it);
+ vert->removeEdge(*it);
+ }
+}
+
+/**
+ * Simplifies a mesh, merging the faces with the specified vertices.
+ * @param mergeVertices vertices to test
+ * @return true if a face merge was performed
+ */
+bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
+{
+ // Check size > 0!
+ if (mergeVertices.size() == 0) return false;
+ bool didMerge = false;
+
+ for( BOP_Index i = 0; i < mergeVertices.size(); ++i ) {
+ BOP_LFaces facesByOriginalFace;
+ BOP_Index v = mergeVertices[i];
+ BOP_Vertex *vert = m_mesh->getVertex(v);
+#ifdef DEBUG
+ cout << "i = " << i << ", v = " << v << ", vert = " << vert << endl;
+ if (v==48)
+ cout << "found vert 48" << endl;
+#endif
+ if ( vert->getTAG() != BROKEN ) {
+ getFaces(facesByOriginalFace,v);
+
+ switch (facesByOriginalFace.size()) {
+ case 0:
+ // v has no unbroken faces (so it's a new BROKEN vertex)
+ freeVerts( v, vert );
+ vert->setTAG(BROKEN);
+ break;
+ case 2: {
+#ifdef DEBUG
+ cout << "size of fBOF = " << facesByOriginalFace.size() << endl;
+#endif
+ BOP_Faces ff = facesByOriginalFace.front();
+ BOP_Faces fb = facesByOriginalFace.back();
+ BOP_Index eindexs[2];
+ int ecount = 0;
+
+ // look for two edges adjacent to v which contain both ofaces
+ BOP_Indexs edges = vert->getEdges();
+#ifdef DEBUG
+ cout << " ff has " << ff.size() << " faces" << endl;
+ cout << " fb has " << fb.size() << " faces" << endl;
+ cout << " v has " << edges.size() << " edges" << endl;
+#endif
+ for(BOP_IT_Indexs it = edges.begin(); it != edges.end();
+ ++it ) {
+ BOP_Edge *edge = m_mesh->getEdge(*it);
+ BOP_Indexs faces = edge->getFaces();
+#ifdef DEBUG
+ cout << " " << edge << " has " << edge->getFaces().size() << " faces" << endl;
+#endif
+ if( faces.size() == 2 ) {
+ BOP_Face *f0 = m_mesh->getFace(faces[0]);
+ BOP_Face *f1 = m_mesh->getFace(faces[1]);
+ if( f0->getOriginalFace() != f1->getOriginalFace() ) {
+#ifdef DEBUG
+ cout << " " << f0 << endl;
+ cout << " " << f1 << endl;
+#endif
+ eindexs[ecount++] = (*it);
+ }
+ }
+ }
+ if(ecount == 2) {
+#ifdef DEBUG
+ cout << " edge indexes are " << eindexs[0];
+ cout << " and " << eindexs[1] << endl;
+#endif
+ BOP_Edge *edge = m_mesh->getEdge(eindexs[0]);
+ BOP_Index N = edge->getVertex1();
+ if(N == v) N = edge->getVertex2();
+#ifdef DEBUG
+ cout << " ## OK, replace "<<v<<" with "<<N << endl;
+#endif
+ mergeVertex(ff , v, N );
+ mergeVertex(fb , v, N );
+// now remove v and its edges
+ vert->setTAG(BROKEN);
+ for(BOP_IT_Indexs it = edges.begin(); it != edges.end();
+ ++it ) {
+ BOP_Edge *edge = m_mesh->getEdge(*it);
+ edge->setUsed(false);
+ }
+ didMerge = true;
+ }
+#ifdef DEBUG
+ else {
+ cout << " HUH: ecount was " << ecount << endl;
+ }
+#endif
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return didMerge;
+}
+
+void BOP_Merge2::mergeVertex(BOP_Faces &faces, BOP_Index v1, BOP_Index v2)
+{
+ for(BOP_IT_Faces face=faces.begin();face!=faces.end();face++) {
+ if( (*face)->size() == 3)
+ mergeVertex((BOP_Face3 *) *face, v1, v2);
+ else
+ mergeVertex((BOP_Face4 *) *face, v1, v2);
+ (*face)->setTAG(BROKEN);
+#ifdef DEBUG
+ cout << " breaking " << (*face) << endl;
+#endif
+ }
+}
+
+/*
+ * Remove a face from the mesh and from each edges's face list
+ */
+
+static void deleteFace(BOP_Mesh *m, BOP_Face *face)
+{
+ BOP_Index l2 = face->getVertex(0);
+ BOP_Faces faces = m->getFaces();
+ for(int i = face->size(); i-- ; ) {
+ BOP_Indexs edges = m->getVertex(l2)->getEdges();
+ BOP_Index l1 = face->getVertex(i);
+ for(BOP_IT_Indexs it1 = edges.begin(); it1 != edges.end(); ++it1 ) {
+ BOP_Edge *edge = m->getEdge(*it1);
+ if( ( edge->getVertex1() == l1 && edge->getVertex2() == l2 ) ||
+ ( edge->getVertex1() == l2 && edge->getVertex2() == l1 ) ) {
+ BOP_Indexs ef = edge->getFaces();
+ for(BOP_IT_Indexs it = ef.begin(); it != ef.end(); ++it ) {
+ if( m->getFace(*it) == face) {
+ edge->removeFace(*it);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ l2 = l1;
+ }
+ face->setTAG(BROKEN);
+}
+
+void BOP_Merge2::mergeVertex(BOP_Face3 *face, BOP_Index v1, BOP_Index v2)
+{
+ BOP_Index next, prev;
+ face->getNeighbours(v1,prev,next);
+
+ // if new vertex is not already in the tri, make a new tri
+ if( prev != v2 && next != v2 ) {
+ m_mesh->addFace( new BOP_Face3(prev,v2,next,
+ face->getPlane(),face->getOriginalFace()) );
+#ifdef DEBUG
+ cout << "mv3: add " << prev << "," << v2 << "," << next << endl;
+ } else {
+ cout << "mv3: vertex already in tri: doing nothing" << endl;
+#endif
+ }
+ deleteFace(m_mesh, face);
+}
+
+void BOP_Merge2::mergeVertex(BOP_Face4 *face, BOP_Index v1, BOP_Index v2)
+{
+ BOP_Index next, prev, opp;
+ face->getNeighbours(v1,prev,next,opp);
+
+ // if new vertex is already in the quad, replace quad with new tri
+ if( prev == v2 || next == v2 ) {
+ m_mesh->addFace( new BOP_Face3(prev,next,opp,
+ face->getPlane(),face->getOriginalFace()) );
+#ifdef DEBUG
+ cout << "mv4a: add " << prev << "," << next << "," << opp << endl;
+#endif
+ }
+ // otherwise make a new quad
+ else {
+ m_mesh->addFace( new BOP_Face4(prev,v2,next,opp,
+ face->getPlane(),face->getOriginalFace()) );
+#ifdef DEBUG
+ cout << "mv4b: add "<<prev<<","<<v2<<","<<next<<","<<opp<<endl;
+#endif
+ }
+ deleteFace(m_mesh, face);
+}
+
+// #define OLD_QUAD
+
+/**
+ * Simplifies the mesh, merging the pairs of triangles that come frome the
+ * same original face and define a quad.
+ * @return true if a quad was added, false otherwise
+ */
+bool BOP_Merge2::createQuads()
+{
+
+ BOP_Faces quads;
+
+ // Get mesh faces
+ BOP_Faces faces = m_mesh->getFaces();
+
+ // Merge mesh triangles
+ const BOP_IT_Faces facesIEnd = (faces.end()-1);
+ const BOP_IT_Faces facesJEnd = faces.end();
+ for(BOP_IT_Faces faceI=faces.begin();faceI!=facesIEnd;faceI++) {
+#ifdef OLD_QUAD
+ if ((*faceI)->getTAG() == BROKEN || (*faceI)->size() != 3) continue;
+ for(BOP_IT_Faces faceJ=(faceI+1);faceJ!=facesJEnd;faceJ++) {
+ if ((*faceJ)->getTAG() == BROKEN || (*faceJ)->size() != 3 ||
+ (*faceJ)->getOriginalFace() != (*faceI)->getOriginalFace()) continue;
+
+
+ BOP_Face *faceK = createQuad((BOP_Face3*)*faceI,(BOP_Face3*)*faceJ);
+ if (faceK != NULL) {
+ // Set triangles to BROKEN
+ deleteFace(m_mesh, *faceI);
+ deleteFace(m_mesh, *faceJ);
+#ifdef DEBUG
+ cout << "createQuad: del " << *faceI << endl;
+ cout << "createQuad: del " << *faceJ << endl;
+ cout << "createQuad: add " << faceK << endl;
+#endif
+ quads.push_back(faceK);
+ break;
+ }
+ }
+#else
+ if ((*faceI)->getTAG() == BROKEN ) continue;
+ for(BOP_IT_Faces faceJ=(faceI+1);faceJ!=facesJEnd;faceJ++) {
+ if ((*faceJ)->getTAG() == BROKEN ||
+ (*faceJ)->getOriginalFace() != (*faceI)->getOriginalFace()) continue;
+
+ BOP_Face *faceK = NULL;
+ if((*faceI)->size() == 3) {
+ if((*faceJ)->size() == 3)
+ faceK = createQuad((BOP_Face3*)*faceI,(BOP_Face3*)*faceJ);
+ else
+ faceK = createQuad((BOP_Face3*)*faceI,(BOP_Face4*)*faceJ);
+ } else {
+ if((*faceJ)->size() == 3)
+ faceK = createQuad((BOP_Face3*)*faceJ,(BOP_Face4*)*faceI);
+ else
+ faceK = createQuad((BOP_Face4*)*faceI,(BOP_Face4*)*faceJ);
+ }
+
+ if (faceK != NULL) {
+ // Set triangles to BROKEN
+ deleteFace(m_mesh, *faceI);
+ deleteFace(m_mesh, *faceJ);
+#ifdef DEBUG
+ cout << "createQuad: del " << *faceI << endl;
+ cout << "createQuad: del " << *faceJ << endl;
+ cout << "createQuad: add " << faceK << endl;
+#endif
+ quads.push_back(faceK);
+ break;
+ }
+ }
+#endif
+ }
+
+ // Add quads to mesh
+ const BOP_IT_Faces quadsEnd = quads.end();
+ for(BOP_IT_Faces quad=quads.begin();quad!=quadsEnd;quad++) m_mesh->addFace(*quad);
+ return (quads.size() > 0);
+}
+
+/**
+ * Returns a new quad (convex) from the merge of two triangles that share the
+ * vertex index v.
+ * @param faceI mesh triangle
+ * @param faceJ mesh triangle
+ * @param v vertex index shared by both triangles
+ * @return a new convex quad if the merge is possible
+ */
+BOP_Face* BOP_Merge2::createQuad(BOP_Face3 *faceI, BOP_Face3 *faceJ)
+{
+ // Test if both triangles share a vertex index
+ BOP_Index v;
+ unsigned int i;
+ for(i=0;i<3 ;i++) {
+ v = faceI->getVertex(i);
+ if( faceJ->containsVertex(v) ) break;
+ }
+ if (i == 3) return NULL;
+
+ BOP_Face *faceK = NULL;
+
+ // Get faces data
+ BOP_Index prevI, nextI, prevJ, nextJ;
+ faceI->getNeighbours(v,prevI,nextI);
+ faceJ->getNeighbours(v,prevJ,nextJ);
+ MT_Point3 vertex = m_mesh->getVertex(v)->getPoint();
+ MT_Point3 vPrevI = m_mesh->getVertex(prevI)->getPoint();
+ MT_Point3 vNextI = m_mesh->getVertex(nextI)->getPoint();
+ MT_Point3 vPrevJ = m_mesh->getVertex(prevJ)->getPoint();
+ MT_Point3 vNextJ = m_mesh->getVertex(nextJ)->getPoint();
+
+ // Quad test
+ if (prevI == nextJ) {
+ if (!BOP_collinear(vNextI,vertex,vPrevJ) && !BOP_collinear(vNextI,vPrevI,vPrevJ) &&
+ BOP_convex(vertex,vNextI,vPrevI,vPrevJ)) {
+ faceK = new BOP_Face4(v,nextI,prevI,prevJ,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ BOP_Index edge;
+ m_mesh->getIndexEdge(v,prevI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ }
+ }
+ else if (nextI == prevJ) {
+ if (!BOP_collinear(vPrevI,vertex,vNextJ) && !BOP_collinear(vPrevI,vNextI,vNextJ) &&
+ BOP_convex(vertex,vNextJ,vNextI,vPrevI)) {
+ faceK = new BOP_Face4(v,nextJ,nextI,prevI,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ BOP_Index edge;
+ m_mesh->getIndexEdge(v,nextI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ }
+ }
+ return faceK;
+}
+
+/**
+ * Returns a new quad (convex) from the merge of two triangles that share the
+ * vertex index v.
+ * @param faceI mesh triangle
+ * @param faceJ mesh triangle
+ * @param v vertex index shared by both triangles
+ * @return a new convex quad if the merge is possible
+ */
+BOP_Face* BOP_Merge2::createQuad(BOP_Face3 *faceI, BOP_Face4 *faceJ)
+{
+ // Test if triangle and quad share a vertex index
+ BOP_Index v;
+ unsigned int i;
+ for(i=0;i<3 ;i++) {
+ v = faceI->getVertex(i);
+ if( faceJ->containsVertex(v) ) break;
+ }
+ if (i == 3) return NULL;
+
+ BOP_Face *faceK = NULL;
+
+ // Get faces data
+ BOP_Index prevI, nextI, prevJ, nextJ, oppJ;
+ faceI->getNeighbours(v,prevI,nextI);
+ faceJ->getNeighbours(v,prevJ,nextJ,oppJ);
+
+ // Quad test
+ BOP_Index edge;
+ if (nextI == prevJ) {
+ if (prevI == nextJ) { // v is in center
+ faceK = new BOP_Face3(nextJ,oppJ,prevJ,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ m_mesh->getIndexEdge(v,prevI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ m_mesh->getIndexEdge(v,nextI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ freeVerts(v, m_mesh->getVertex(v));
+ } else if (prevI == oppJ) { // nextI is in center
+ faceK = new BOP_Face3(v,nextJ,oppJ,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ m_mesh->getIndexEdge(v,nextI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ m_mesh->getIndexEdge(prevI,nextI,edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ freeVerts(nextI, m_mesh->getVertex(nextI));
+ }
+ } else if (nextI == oppJ && prevI == nextJ ) { // prevI is in center
+ faceK = new BOP_Face3(prevJ,v,oppJ,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ m_mesh->getIndexEdge(v,prevI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ m_mesh->getIndexEdge(nextI,prevI,edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ freeVerts(prevI, m_mesh->getVertex(prevI));
+ }
+ return faceK;
+}
+
+/**
+ * Returns a new quad (convex) from the merge of two triangles that share the
+ * vertex index v.
+ * @param faceI mesh triangle
+ * @param faceJ mesh triangle
+ * @param v vertex index shared by both triangles
+ * @return a new convex quad if the merge is possible
+ */
+BOP_Face* BOP_Merge2::createQuad(BOP_Face4 *faceI, BOP_Face4 *faceJ)
+{
+ BOP_Face *faceK = NULL;
+ //
+ // Test if both quads share a vertex index
+ //
+ BOP_Index v;
+ unsigned int i;
+ for(i=0;i<4 ;i++) {
+ v = faceI->getVertex(i);
+ if( faceJ->containsVertex(v) ) break;
+ }
+ if (i == 3) return NULL;
+
+
+ // Get faces data
+ BOP_Index prevI, nextI, oppI, prevJ, nextJ, oppJ;
+ faceI->getNeighbours(v,prevI,nextI,oppI);
+ faceJ->getNeighbours(v,prevJ,nextJ,oppJ);
+
+ // Quad test
+ BOP_Index edge;
+ if (nextI == prevJ) {
+ if (prevI == nextJ) { // v is in center
+ faceK = new BOP_Face4(nextI,oppI,nextJ,oppJ,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ m_mesh->getIndexEdge(v,prevI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ m_mesh->getIndexEdge(v,nextI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ freeVerts(v, m_mesh->getVertex(v));
+ } else if (oppI == oppJ) { // nextI is in center
+ faceK = new BOP_Face4(v,nextJ,oppJ,prevI,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ m_mesh->getIndexEdge(v,nextI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ m_mesh->getIndexEdge(prevI,nextI,edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ freeVerts(nextI, m_mesh->getVertex(nextI));
+ }
+ } else if (prevI == nextJ && oppI == oppJ) { // prevI is in center
+ faceK = new BOP_Face4(v,nextI,oppJ,prevJ,faceI->getPlane(),faceI->getOriginalFace());
+ faceK->setTAG(faceI->getTAG());
+ m_mesh->getIndexEdge(v,prevI,edge);
+ m_mesh->getVertex(v)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ m_mesh->getIndexEdge(nextI,prevI,edge);
+ m_mesh->getVertex(nextI)->removeEdge(edge);
+ m_mesh->getVertex(prevI)->removeEdge(edge);
+ freeVerts(prevI, m_mesh->getVertex(prevI));
+ }
+ return faceK;
+}
+
+/**
+ * Returns if a index is inside a set of indexs.
+ * @param indexs set of indexs
+ * @param i index
+ * @return true if the index is inside the set, false otherwise
+ */
+bool BOP_Merge2::containsIndex(BOP_Indexs indexs, BOP_Index i)
+{
+ const BOP_IT_Indexs indexsEnd = indexs.end();
+ for(BOP_IT_Indexs it=indexs.begin();it!=indexsEnd;it++) {
+ if (*it == i) return true;
+ }
+ return false;
+}
+
+/**
+ * Creates a list of lists L1, L2, ... LN where
+ * LX = mesh faces with vertex v that come from the same original face
+ * @param facesByOriginalFace list of faces lists
+ * @param v vertex index
+ */
+void BOP_Merge2::getFaces(BOP_LFaces &facesByOriginalFace, BOP_Index v)
+{
+ // Get edges with vertex v
+
+ BOP_Indexs edgeIndexs = m_mesh->getVertex(v)->getEdges();
+ const BOP_IT_Indexs edgeEnd = edgeIndexs.end();
+ for(BOP_IT_Indexs edgeIndex = edgeIndexs.begin();edgeIndex != edgeEnd;edgeIndex++) {
+ // For each edge, add its no broken faces to the output list
+ BOP_Edge* edge = m_mesh->getEdge(*edgeIndex);
+ BOP_Indexs faceIndexs = edge->getFaces();
+ const BOP_IT_Indexs faceEnd = faceIndexs.end();
+ for(BOP_IT_Indexs faceIndex=faceIndexs.begin();faceIndex!=faceEnd;faceIndex++) {
+ BOP_Face* face = m_mesh->getFace(*faceIndex);
+ if (face->getTAG() != BROKEN) {
+ bool found = false;
+ // Search if we already have created a list for the
+ // faces that come from the same original face
+ const BOP_IT_LFaces lfEnd = facesByOriginalFace.end();
+ for(BOP_IT_LFaces facesByOriginalFaceX=facesByOriginalFace.begin();
+ facesByOriginalFaceX!=lfEnd; facesByOriginalFaceX++) {
+ if (((*facesByOriginalFaceX)[0])->getOriginalFace() == face->getOriginalFace()) {
+ // Search that the face has not been added to the list before
+ for(unsigned int i = 0;i<(*facesByOriginalFaceX).size();i++) {
+ if ((*facesByOriginalFaceX)[i] == face) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // Add the face to the list
+ if (face->getTAG()==OVERLAPPED) facesByOriginalFaceX->insert(facesByOriginalFaceX->begin(),face);
+ else facesByOriginalFaceX->push_back(face);
+ found = true;
+ }
+ break;
+ }
+ }
+ if (!found) {
+ // Create a new list and add the current face
+ BOP_Faces facesByOriginalFaceX;
+ facesByOriginalFaceX.push_back(face);
+ facesByOriginalFace.push_back(facesByOriginalFaceX);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Creates a list of lists L1, L2, ... LN where
+ * LX = mesh faces with vertex v that come from the same original face
+ * and without any of the vertices that appear before v in vertices
+ * @param facesByOriginalFace list of faces lists
+ * @param vertices vector with vertices indexs that contains v
+ * @param v vertex index
+ */
+void BOP_Merge2::getFaces(BOP_LFaces &facesByOriginalFace, BOP_Indexs vertices, BOP_Index v)
+{
+ // Get edges with vertex v
+ BOP_Indexs edgeIndexs = m_mesh->getVertex(v)->getEdges();
+ const BOP_IT_Indexs edgeEnd = edgeIndexs.end();
+ for(BOP_IT_Indexs edgeIndex = edgeIndexs.begin();edgeIndex != edgeEnd;edgeIndex++) {
+ // Foreach edge, add its no broken faces to the output list
+ BOP_Edge* edge = m_mesh->getEdge(*edgeIndex);
+ BOP_Indexs faceIndexs = edge->getFaces();
+ const BOP_IT_Indexs faceEnd = faceIndexs.end();
+ for(BOP_IT_Indexs faceIndex=faceIndexs.begin();faceIndex!=faceEnd;faceIndex++) {
+ BOP_Face* face = m_mesh->getFace(*faceIndex);
+ if (face->getTAG() != BROKEN) {
+ // Search if the face contains any of the forbidden vertices
+ bool found = false;
+ for(BOP_IT_Indexs vertex = vertices.begin();*vertex!= v;vertex++) {
+ if (face->containsVertex(*vertex)) {
+ // face contains a forbidden vertex!
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // Search if we already have created a list with the
+ // faces that come from the same original face
+ const BOP_IT_LFaces lfEnd = facesByOriginalFace.end();
+ for(BOP_IT_LFaces facesByOriginalFaceX=facesByOriginalFace.begin();
+ facesByOriginalFaceX!=lfEnd; facesByOriginalFaceX++) {
+ if (((*facesByOriginalFaceX)[0])->getOriginalFace() == face->getOriginalFace()) {
+ // Search that the face has not been added to the list before
+ for(unsigned int i = 0;i<(*facesByOriginalFaceX).size();i++) {
+ if ((*facesByOriginalFaceX)[i] == face) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // Add face to the list
+ if (face->getTAG()==OVERLAPPED) facesByOriginalFaceX->insert(facesByOriginalFaceX->begin(),face);
+ else facesByOriginalFaceX->push_back(face);
+ found = true;
+ }
+ break;
+ }
+ }
+ if (!found) {
+ // Create a new list and add the current face
+ BOP_Faces facesByOriginalFaceX;
+ facesByOriginalFaceX.push_back(face);
+ facesByOriginalFace.push_back(facesByOriginalFaceX);
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif /* BOP_NEW_MERGE */
diff --git a/intern/boolop/intern/BOP_Merge2.h b/intern/boolop/intern/BOP_Merge2.h
new file mode 100644
index 00000000000..1e5945a889f
--- /dev/null
+++ b/intern/boolop/intern/BOP_Merge2.h
@@ -0,0 +1,99 @@
+/**
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BOP_MERGE2_H
+#define BOP_MERGE2_H
+
+#include "BOP_Misc.h"
+
+#ifdef BOP_NEW_MERGE
+
+#include "BOP_Mesh.h"
+#include "BOP_Tag.h"
+#include "BOP_MathUtils.h"
+#include "MEM_SmartPtr.h"
+
+typedef vector< BOP_Faces > BOP_LFaces;
+typedef vector< BOP_Faces >::iterator BOP_IT_LFaces;
+
+class BOP_Merge2 {
+ private:
+ BOP_Mesh* m_mesh;
+ BOP_Index m_firstVertex;
+ static BOP_Merge2 SINGLETON;
+
+ BOP_Merge2() {};
+ bool mergeFaces();
+ bool mergeFaces(BOP_Indexs &mergeVertices);
+ bool mergeFaces(BOP_Faces &oldFaces, BOP_Faces &newFaces, BOP_Indexs &vertices, BOP_Index v);
+ bool mergeFaces(BOP_Faces &faces, BOP_Faces &oldFaces, BOP_Faces &newFaces, BOP_Indexs &vertices, BOP_Index v);
+ BOP_Face *mergeFaces(BOP_Face *faceI, BOP_Face *faceJ, BOP_Index v);
+ BOP_Face *mergeFaces(BOP_Face *faceI, BOP_Face *faceJ, BOP_Indexs &pending, BOP_Index v);
+ BOP_Face *mergeFaces(BOP_Face3 *faceI, BOP_Face3 *faceJ, BOP_Index v);
+ BOP_Face *mergeFaces(BOP_Face4 *faceI, BOP_Face3 *faceJ, BOP_Index v);
+ BOP_Face *mergeFaces(BOP_Face4 *faceI, BOP_Face3 *faceJ, BOP_Indexs &pending, BOP_Index v);
+ BOP_Face *mergeFaces(BOP_Face4 *faceI, BOP_Face4 *faceJ, BOP_Indexs &pending, BOP_Index v);
+ bool createQuads();
+ bool containsIndex(BOP_Indexs indexs, BOP_Index index);
+ void getFaces(BOP_LFaces &facesByOriginalFace, BOP_Index v);
+ void getFaces(BOP_LFaces &facesByOriginalFace, BOP_Indexs vertices, BOP_Index v);
+ BOP_Face *createQuad(BOP_Face3 *faceI, BOP_Face3 *faceJ);
+ BOP_Face *createQuad(BOP_Face3 *faceI, BOP_Face4 *faceJ);
+ BOP_Face *createQuad(BOP_Face4 *faceI, BOP_Face4 *faceJ);
+
+ bool mergeVertex(BOP_Face *faceI, BOP_Face *faceJ, BOP_Index v,
+ BOP_Indexs &mergeVertices);
+ bool mergeVertex(BOP_Face *faceI, BOP_Face *faceJ, BOP_Index v,
+ BOP_Indexs &pending, BOP_Faces &oldFaces, BOP_Faces &newFaces );
+ BOP_Face *find3Neighbor(BOP_Face *faceI, BOP_Face *faceJ,
+ BOP_Index X, BOP_Index I, BOP_Index P, BOP_Index N );
+ BOP_Face *find4Neighbor(BOP_Face *faceI, BOP_Face *faceJ,
+ BOP_Index X, BOP_Index I, BOP_Index P, BOP_Index N,
+ BOP_Face **faceL, BOP_Index &O);
+ BOP_Face3 *collapse(BOP_Face4 *faceC, BOP_Index X);
+ void mergeFaces(BOP_Face *A, BOP_Face *B, BOP_Index X,
+ BOP_Index I, BOP_Index N, BOP_Index P, BOP_Faces &newFaces );
+ void freeVerts(BOP_Index v, BOP_Vertex *vert);
+
+ void mergeVertex(BOP_Faces&, BOP_Index, BOP_Index);
+ void mergeVertex(BOP_Face3 *, BOP_Index, BOP_Index);
+ void mergeVertex(BOP_Face4 *, BOP_Index, BOP_Index);
+ void cleanup( void );
+
+ public:
+
+ static BOP_Merge2 &getInstance() {
+ return SINGLETON;
+ }
+
+ void mergeFaces(BOP_Mesh *m, BOP_Index v);
+};
+
+void dumpmesh(BOP_Mesh *, bool);
+
+#endif /* BOP_NEW_MERGE2 */
+#endif
diff --git a/intern/boolop/intern/BOP_Mesh.cpp b/intern/boolop/intern/BOP_Mesh.cpp
index 5659cd62a3f..075884a1920 100644
--- a/intern/boolop/intern/BOP_Mesh.cpp
+++ b/intern/boolop/intern/BOP_Mesh.cpp
@@ -449,6 +449,13 @@ bool BOP_Mesh::getIndexEdge(BOP_Index v1, BOP_Index v2, BOP_Index &e)
printf ("found edge (%d %d)\n",v1,v2);
#endif
e = edge->index;
+#ifdef BOP_NEW_MERGE
+ if( m_edges[e]->getUsed() == false ) {
+ m_edges[e]->setUsed(true);
+ m_vertexs[v1]->addEdge(e);
+ m_vertexs[v2]->addEdge(e);
+ }
+#endif
return true;
}
#ifdef HASH_PRINTF_DEBUG
@@ -794,7 +801,8 @@ bool BOP_Mesh::isClosedMesh()
}
-/** ***************************************************************************
+#ifdef BOP_DEBUG
+/******************************************************************************
* DEBUG METHODS *
* This functions are used to test the mesh state and debug program errors. *
******************************************************************************/
@@ -1075,3 +1083,4 @@ void BOP_Mesh::updatePlanes()
}
}
+#endif
diff --git a/intern/boolop/intern/BOP_Mesh.h b/intern/boolop/intern/BOP_Mesh.h
index 9abff52545f..46c8fa53d20 100644
--- a/intern/boolop/intern/BOP_Mesh.h
+++ b/intern/boolop/intern/BOP_Mesh.h
@@ -1,10 +1,3 @@
-/*
- * TEMPORARY defines to enable hashing support
- */
-
-#define HASH(x) ((x) >> 5) /* each "hash" covers 32 indices */
-// #define HASH_PRINTF_DEBUG /* uncomment to enable debug output */
-
/**
*
* $Id$
diff --git a/intern/boolop/intern/BOP_Misc.h b/intern/boolop/intern/BOP_Misc.h
new file mode 100644
index 00000000000..d021579d161
--- /dev/null
+++ b/intern/boolop/intern/BOP_Misc.h
@@ -0,0 +1,54 @@
+/**
+ *
+ * $Id: BOP_Misc.h 14444 2008-04-16 22:40:48Z khughes $
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Ken Hughes
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/*
+ * This file contains various definitions used across the modules
+ */
+
+/*
+ * define operator>> for faces, edges and vertices, and also add some
+ * debugging functions for displaying various internal data structures
+ */
+
+// #define BOP_DEBUG
+
+#define HASH(x) ((x) >> 5) /* each "hash" covers 32 indices */
+// #define HASH_PRINTF_DEBUG /* uncomment to enable debug output */
+
+/*
+ * temporary: control which method is used to merge final triangles and
+ * quads back together after an operation. If both methods are included,
+ * the "rt" debugging button on the Scene panel (F10) is used to control
+ * which is active. Setting it to 100 enables the original method, any
+ * other value enables the new method.
+ */
+
+#define BOP_ORIG_MERGE /* include original merge code */
+#define BOP_NEW_MERGE /* include new merge code */
diff --git a/intern/boolop/intern/BOP_Tag.h b/intern/boolop/intern/BOP_Tag.h
index 705f4885866..ead10fa6040 100644
--- a/intern/boolop/intern/BOP_Tag.h
+++ b/intern/boolop/intern/BOP_Tag.h
@@ -39,7 +39,7 @@
#define OUTON_TAG 0x11 // Above and on the plane
#define UNCLASSIFIED_TAG 0x0F // Expecting to be classified
-#define PHANTOM_TAG 0x0C // Phantom face
+#define PHANTOM_TAG 0x0C // Phantom face: verts form collinear triangle
#define OVERLAPPED_TAG 0x0D // Overlapped face
#define BROKEN_TAG 0x0B // Splitted and unused ...
diff --git a/intern/boolop/intern/BOP_Vertex.cpp b/intern/boolop/intern/BOP_Vertex.cpp
index a429c26d204..edb53ea6a59 100644
--- a/intern/boolop/intern/BOP_Vertex.cpp
+++ b/intern/boolop/intern/BOP_Vertex.cpp
@@ -89,3 +89,22 @@ bool BOP_Vertex::containsEdge(BOP_Index i)
return false;
}
+
+#ifdef BOP_DEBUG
+/**
+ * Implements operator <<.
+ */
+#include <iomanip>
+
+ostream &operator<<(ostream &stream, BOP_Vertex *v)
+{
+ char aux[20];
+ BOP_stringTAG(v->m_tag,aux);
+ MT_Point3 point = v->getPoint();
+ stream << setprecision(6) << showpoint << fixed;
+ stream << "Vertex[" << point[0] << "," << point[1] << ",";
+ stream << point[2] << "] (" << aux << ")";
+ return stream;
+}
+#endif
+
diff --git a/intern/boolop/intern/BOP_Vertex.h b/intern/boolop/intern/BOP_Vertex.h
index 3a9895df6d3..18b2f168f8c 100644
--- a/intern/boolop/intern/BOP_Vertex.h
+++ b/intern/boolop/intern/BOP_Vertex.h
@@ -31,6 +31,7 @@
#include "BOP_Tag.h"
#include "BOP_Indexs.h"
#include "MT_Point3.h"
+#include "BOP_Misc.h"
class BOP_Vertex
{
@@ -52,6 +53,10 @@ public:
inline MT_Point3 getPoint() const { return m_point;};
inline BOP_TAG getTAG() { return m_tag;};
inline void setTAG(BOP_TAG t) { m_tag = t;};
+#ifdef BOP_DEBUG
+ friend ostream &operator<<(ostream &stream, BOP_Vertex *v);
+#endif
+
};
#endif
diff --git a/intern/boolop/make/msvc_7_0/boolop.vcproj b/intern/boolop/make/msvc_7_0/boolop.vcproj
index 7ae417e42d5..6e6d6abeb43 100644
--- a/intern/boolop/make/msvc_7_0/boolop.vcproj
+++ b/intern/boolop/make/msvc_7_0/boolop.vcproj
@@ -279,6 +279,9 @@ ECHO Done
RelativePath="..\..\intern\BOP_Merge.cpp">
</File>
<File
+ RelativePath="..\..\intern\BOP_Merge2.cpp">
+ </File>
+ <File
RelativePath="..\..\intern\BOP_Mesh.cpp">
</File>
<File
@@ -331,9 +334,15 @@ ECHO Done
RelativePath="..\..\intern\BOP_Merge.h">
</File>
<File
+ RelativePath="..\..\intern\BOP_Merge2.h">
+ </File>
+ <File
RelativePath="..\..\intern\BOP_Mesh.h">
</File>
<File
+ RelativePath="..\..\intern\BOP_Misc.h">
+ </File>
+ <File
RelativePath="..\..\intern\BOP_Segment.h">
</File>
<File
diff --git a/intern/bsp/SConscript b/intern/bsp/SConscript
index 88d2529ae59..39f278625a9 100644
--- a/intern/bsp/SConscript
+++ b/intern/bsp/SConscript
@@ -6,7 +6,7 @@ sources = env.Glob('intern/*.cpp')
incs = 'intern ../container ../moto/include ../memutil'
if (env['OURPLATFORM'] == 'win32-mingw'):
- env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype=['common','intern'], priority=[26,26] )
+ env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype=['common','intern'], priority=[26,69] )
else:
env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype='core', priority=26 )
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index f5c7c08ebfe..7bc20d38739 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -917,8 +917,12 @@ GHOST_TUns8* GHOST_SystemWin32::getClipboard(int flag) const
char *buffer;
char *temp_buff;
- if ( OpenClipboard(NULL) ) {
+ if ( IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) {
HANDLE hData = GetClipboardData( CF_TEXT );
+ if (hData == NULL) {
+ CloseClipboard();
+ return NULL;
+ }
buffer = (char*)GlobalLock( hData );
temp_buff = (char*) malloc(strlen(buffer)+1);
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index fef58d071a4..c30b915c019 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -437,7 +437,13 @@ GHOST_TSuccess GHOST_WindowWin32::swapBuffers()
// adding a glFinish() here is to prevent Geforce in 'full scene antialias' mode
// from antialising the Blender window. Officially a swapbuffers does a glFinish
// itself, so this feels really like a hack... but it won't harm. (ton)
- glFinish();
+ //
+ // disabled this because it is a performance killer for the game engine, glFinish
+ // forces synchronization with the graphics card and calling it is strongly
+ // discouraged for good performance. (brecht)
+ //
+ // glFinish();
+
return ::SwapBuffers(m_hDC) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
}
diff --git a/intern/guardedalloc/BLO_sys_types.h b/intern/guardedalloc/BLO_sys_types.h
new file mode 100644
index 00000000000..5ed3117c890
--- /dev/null
+++ b/intern/guardedalloc/BLO_sys_types.h
@@ -0,0 +1,125 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * A platform-independent definition of [u]intXX_t
+ * Plus the accompanying header include for htonl/ntohl
+ *
+ * This file includes <sys/types.h> to define [u]intXX_t types, where
+ * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
+ * file.
+ * - Windows uses __intXX compiler-builtin types. These are signed,
+ * so we have to flip the signs.
+ * For these rogue platforms, we make the typedefs ourselves.
+ *
+ */
+
+/*
+// DG: original BLO_sys_types.h is in source/blender/blenkernel
+// but is not allowed be accessed here because of bad-level-call
+*/
+
+#ifndef BLO_SYS_TYPES_H
+#define BLO_SYS_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
+
+/* The __intXX are built-in types of the visual complier! So we don't
+ * need to include anything else here. */
+
+typedef signed __int8 int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef signed __int64 int64_t;
+
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+
+#ifndef _INTPTR_T_DEFINED
+#ifdef _WIN64
+typedef __int64 intptr_t;
+#else
+typedef long intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned long uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+
+#elif defined(__linux__)
+
+ /* Linux-i386, Linux-Alpha, Linux-ppc */
+#include <stdint.h>
+
+#elif defined (__APPLE__)
+
+#include <inttypes.h>
+
+#elif defined(FREE_WINDOWS)
+
+#include <stdint.h>
+
+#else
+
+ /* FreeBSD, Irix, Solaris */
+#include <sys/types.h>
+
+#endif /* ifdef platform for types */
+
+#ifdef _WIN32
+#ifndef htonl
+#define htonl(x) correctByteOrder(x)
+#endif
+#ifndef ntohl
+#define ntohl(x) correctByteOrder(x)
+#endif
+#elif defined (__FreeBSD__) || defined (__OpenBSD__)
+#include <sys/param.h>
+#elif defined (__APPLE__)
+#include <sys/types.h>
+#else /* irix sun linux */
+#include <netinet/in.h>
+#endif /* ifdef platform for htonl/ntohl */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* eof */
+
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index d004e7952cc..1d4c753802b 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -58,8 +58,8 @@
#ifndef MEM_MALLOCN_H
#define MEM_MALLOCN_H
-/* Needed for FILE* */
-#include "stdio.h"
+#include "stdio.h" /* needed for FILE* */
+#include "BLO_sys_types.h" /* needed for uintptr_t */
#ifdef __cplusplus
extern "C" {
@@ -123,6 +123,12 @@ extern "C" {
/** Attempt to enforce OSX (or other OS's) to have malloc and stack nonzero */
void MEM_set_memory_debug(void);
+ /* Memory usage stats
+ * - MEM_get_memory_in_use is all memory
+ * - MEM_get_mapped_memory_in_use is a subset of all memory */
+ uintptr_t MEM_get_memory_in_use(void);
+ uintptr_t MEM_get_mapped_memory_in_use(void);
+ int MEM_get_memory_blocks_in_use(void);
#ifdef __cplusplus
}
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 25f2fd8d269..7bdca7339fc 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -111,8 +111,8 @@ static const char *check_memlist(MemHead *memh);
/* --------------------------------------------------------------------- */
-volatile int totblock= 0;
-volatile unsigned long mem_in_use= 0, mmap_in_use= 0;
+static volatile int totblock= 0;
+static volatile uintptr_t mem_in_use= 0, mmap_in_use= 0;
static volatile struct localListBase _membase;
static volatile struct localListBase *membase = &_membase;
@@ -335,7 +335,7 @@ void *MEM_mapallocN(unsigned int len, const char *str)
/* Memory statistics print */
typedef struct MemPrintBlock {
const char *name;
- unsigned long len;
+ uintptr_t len;
int items;
} MemPrintBlock;
@@ -485,14 +485,14 @@ short MEM_freeN(void *vmemh) /* anders compileertie niet meer */
return(-1);
}
- if(sizeof(long)==8) {
- if (((long) memh) & 0x7) {
+ if(sizeof(intptr_t)==8) {
+ if (((intptr_t) memh) & 0x7) {
MemorY_ErroR("free","attempt to free illegal pointer");
return(-1);
}
}
else {
- if (((long) memh) & 0x3) {
+ if (((intptr_t) memh) & 0x3) {
MemorY_ErroR("free","attempt to free illegal pointer");
return(-1);
}
@@ -696,4 +696,19 @@ static const char *check_memlist(MemHead *memh)
return(name);
}
+uintptr_t MEM_get_memory_in_use(void)
+{
+ return mem_in_use;
+}
+
+uintptr_t MEM_get_mapped_memory_in_use(void)
+{
+ return mmap_in_use;
+}
+
+int MEM_get_memory_blocks_in_use(void)
+{
+ return totblock;
+}
+
/* eof */
diff --git a/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj b/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj
index 40e88511d5d..974acef4e70 100644
--- a/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj
+++ b/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj
@@ -262,6 +262,9 @@ ECHO Done
Name="extern"
Filter="">
<File
+ RelativePath="..\..\BLO_sys_types.h">
+ </File>
+ <File
RelativePath="..\..\MEM_guardedalloc.h">
</File>
<File
diff --git a/intern/memutil/MEM_Allocator.h b/intern/memutil/MEM_Allocator.h
index d5ae94cc6b8..b2c3c5e82e2 100644
--- a/intern/memutil/MEM_Allocator.h
+++ b/intern/memutil/MEM_Allocator.h
@@ -25,6 +25,7 @@
#define __MEM_Allocator_h_included__ 1
#include "guardedalloc/MEM_guardedalloc.h"
+#include "guardedalloc/BLO_sys_types.h"
#ifdef _MSC_VER
#if _MSC_VER < 1300 // 1200 == VC++ 6.0 according to boost
diff --git a/intern/memutil/MEM_CacheLimiter.h b/intern/memutil/MEM_CacheLimiter.h
index cada06ae523..43149efc977 100644
--- a/intern/memutil/MEM_CacheLimiter.h
+++ b/intern/memutil/MEM_CacheLimiter.h
@@ -61,11 +61,8 @@ class MEM_CacheLimiter;
#ifndef __MEM_cache_limiter_c_api_h_included__
extern "C" {
- extern void MEM_CacheLimiter_set_maximum(int m);
- extern int MEM_CacheLimiter_get_maximum();
- // this is rather _ugly_!
- extern int mem_in_use;
- extern int mmap_in_use;
+ extern void MEM_CacheLimiter_set_maximum(intptr_t m);
+ extern intptr_t MEM_CacheLimiter_get_maximum();
};
#endif
@@ -141,7 +138,10 @@ public:
delete handle;
}
void enforce_limits() {
- int max = MEM_CacheLimiter_get_maximum();
+ intptr_t max = MEM_CacheLimiter_get_maximum();
+ intptr_t mem_in_use= MEM_get_memory_in_use();
+ intptr_t mmap_in_use= MEM_get_mapped_memory_in_use();
+
if (max == 0) {
return;
}
diff --git a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
index 4cf0ef305d4..d998c9a3e80 100644
--- a/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
+++ b/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
@@ -27,18 +27,18 @@
#include "MEM_CacheLimiter.h"
#include "MEM_CacheLimiterC-Api.h"
-static int & get_max()
+static intptr_t & get_max()
{
- static int m = 32*1024*1024;
+ static intptr_t m = 32*1024*1024;
return m;
}
-void MEM_CacheLimiter_set_maximum(int m)
+void MEM_CacheLimiter_set_maximum(intptr_t m)
{
get_max() = m;
}
-int MEM_CacheLimiter_get_maximum()
+intptr_t MEM_CacheLimiter_get_maximum()
{
return get_max();
}
diff --git a/intern/moto/include/GEN_Map.h b/intern/moto/include/GEN_Map.h
index 9f56924419e..d85e9af175b 100644
--- a/intern/moto/include/GEN_Map.h
+++ b/intern/moto/include/GEN_Map.h
@@ -50,6 +50,19 @@ public:
m_buckets[i] = 0;
}
}
+
+ GEN_Map(const GEN_Map& map)
+ {
+ m_num_buckets = map.m_num_buckets;
+ m_buckets = new Entry *[m_num_buckets];
+
+ for (int i = 0; i < m_num_buckets; ++i) {
+ m_buckets[i] = 0;
+
+ for(Entry *entry = map.m_buckets[i]; entry; entry=entry->m_next)
+ insert(entry->m_key, entry->m_value);
+ }
+ }
int size() {
int count=0;
diff --git a/intern/moto/include/MT_Matrix4x4.h b/intern/moto/include/MT_Matrix4x4.h
index 823541347b7..b4ee84a718b 100644
--- a/intern/moto/include/MT_Matrix4x4.h
+++ b/intern/moto/include/MT_Matrix4x4.h
@@ -212,6 +212,7 @@ public:
MT_Matrix4x4 transposed() const;
void transpose();
+ MT_Matrix4x4 inverse() const;
void invert();
protected:
diff --git a/intern/moto/include/MT_Matrix4x4.inl b/intern/moto/include/MT_Matrix4x4.inl
index a2aa893a6b3..074bd6e4b05 100644
--- a/intern/moto/include/MT_Matrix4x4.inl
+++ b/intern/moto/include/MT_Matrix4x4.inl
@@ -52,14 +52,14 @@ GEN_INLINE void MT_Matrix4x4::invert() {
}
}
-/* We do things slightly different here, because the invert() modifies
- * the buffer itself. This makes it impossible to make this op right
- * away. Like other, still missing facilities, I will repair this
- * later. */
-/* GEN_INLINE T_Matrix4x4 MT_Matrix4x4::inverse() const */
-/* { */
-/* } */
+GEN_INLINE MT_Matrix4x4 MT_Matrix4x4::inverse() const
+{
+ MT_Matrix4x4 invmat = *this;
+
+ invmat.invert();
+ return invmat;
+}
GEN_INLINE MT_Matrix4x4& MT_Matrix4x4::operator*=(const MT_Matrix4x4& m)
{
diff --git a/intern/opennl/make/msvc_7_0/opennl.vcproj b/intern/opennl/make/msvc_7_0/opennl.vcproj
index ec999b0c252..d302a2508ab 100644
--- a/intern/opennl/make/msvc_7_0/opennl.vcproj
+++ b/intern/opennl/make/msvc_7_0/opennl.vcproj
@@ -716,6 +716,9 @@ ECHO Done
Name="superlu"
Filter="">
<File
+ RelativePath="..\..\superlu\BLO_sys_types.h">
+ </File>
+ <File
RelativePath="..\..\superlu\Cnames.h">
</File>
<File
diff --git a/intern/opennl/superlu/BLO_sys_types.h b/intern/opennl/superlu/BLO_sys_types.h
new file mode 100644
index 00000000000..411a8582f96
--- /dev/null
+++ b/intern/opennl/superlu/BLO_sys_types.h
@@ -0,0 +1,127 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * A platform-independent definition of [u]intXX_t
+ * Plus the accompanying header include for htonl/ntohl
+ *
+ * This file includes <sys/types.h> to define [u]intXX_t types, where
+ * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
+ * file.
+ * - Windows uses __intXX compiler-builtin types. These are signed,
+ * so we have to flip the signs.
+ * For these rogue platforms, we make the typedefs ourselves.
+ *
+ */
+
+/*
+// DG: original BLO_sys_types.h is in source/blender/blenkernel
+// but is not allowed be accessed here because of bad-level-call
+*/
+
+#ifndef BLO_SYS_TYPES_H
+#define BLO_SYS_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
+
+/* The __intXX are built-in types of the visual complier! So we don't
+ * need to include anything else here. */
+
+
+typedef signed __int8 int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef signed __int64 int64_t;
+
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+
+#ifndef _INTPTR_T_DEFINED
+#ifdef _WIN64
+typedef __int64 intptr_t;
+#else
+typedef long intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned long uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+
+#elif defined(__linux__)
+
+ /* Linux-i386, Linux-Alpha, Linux-ppc */
+#include <stdint.h>
+
+#elif defined (__APPLE__)
+
+#include <inttypes.h>
+
+#elif defined(FREE_WINDOWS)
+
+#include <stdint.h>
+
+#else
+
+ /* FreeBSD, Irix, Solaris */
+#include <sys/types.h>
+
+#endif /* ifdef platform for types */
+
+
+#ifdef _WIN32
+#ifndef htonl
+#define htonl(x) correctByteOrder(x)
+#endif
+#ifndef ntohl
+#define ntohl(x) correctByteOrder(x)
+#endif
+#elif defined (__FreeBSD__) || defined (__OpenBSD__)
+#include <sys/param.h>
+#elif defined (__APPLE__)
+#include <sys/types.h>
+#else /* irix sun linux */
+#include <netinet/in.h>
+#endif /* ifdef platform for htonl/ntohl */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* eof */
+
diff --git a/intern/opennl/superlu/smemory.c b/intern/opennl/superlu/smemory.c
index 79da748671a..7eefb900673 100644
--- a/intern/opennl/superlu/smemory.c
+++ b/intern/opennl/superlu/smemory.c
@@ -8,6 +8,8 @@
*/
#include "ssp_defs.h"
+#include "BLO_sys_types.h" // needed for intptr_t
+
/* Constants */
#define NO_MEMTYPE 4 /* 0: lusup;
1: ucol;
@@ -49,8 +51,8 @@ static int no_expand;
/* Macros to manipulate stack */
#define StackFull(x) ( x + stack.used >= stack.size )
-#define NotDoubleAlign(addr) ( (long int)addr & 7 )
-#define DoubleAlign(addr) ( ((long int)addr + 7) & ~7L )
+#define NotDoubleAlign(addr) ( (intptr_t)addr & 7 )
+#define DoubleAlign(addr) ( ((intptr_t)addr + 7) & ~7L )
#define TempSpace(m, w) ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \
(w + 1) * m * sizeof(float) )
#define Reduce(alpha) ((alpha + 1) / 2) /* i.e. (alpha-1)/2 + 1 */
@@ -611,8 +613,8 @@ sStackCompress(GlobalLU_t *Glu)
last = (char*)usub + xusub[ndim] * iword;
fragment = (char*) (((char*)stack.array + stack.top1) - last);
- stack.used -= (long int) fragment;
- stack.top1 -= (long int) fragment;
+ stack.used -= (intptr_t) fragment;
+ stack.top1 -= (intptr_t) fragment;
Glu->ucol = ucol;
Glu->lsub = lsub;
diff --git a/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj
index a31b9130db3..01a29d2d24e 100644
--- a/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj
+++ b/projectfiles_vc7/blender/BPY_python/BPY_python.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -75,7 +75,115 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
+ StringPooling="TRUE"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="TRUE"
+ DefaultCharIsUnsigned="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\python\BPY_python.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\python\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\python\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\python\"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="FALSE"
+ CompileAs="0"
+ DisableSpecificWarnings="4100"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\BPY_python.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="BlenderPlayer Debug|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="_DEBUG,WIN32,_LIB;WITH_FFMPEG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DisableLanguageExtensions="FALSE"
+ DefaultCharIsUnsigned="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\python\debug\BPY_python.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\python\debug\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\python\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\python\debug\"
+ WarningLevel="4"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4100"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\debug\BPY_python.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="BlenderPlayer Release|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/projectfiles_vc7/blender/blender.sln b/projectfiles_vc7/blender/blender.sln
index 60c2d8f2d4c..179200727ab 100644
--- a/projectfiles_vc7/blender/blender.sln
+++ b/projectfiles_vc7/blender/blender.sln
@@ -14,6 +14,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E} = {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}
{09222F5E-1625-4FF3-A89A-384D16875EE5} = {09222F5E-1625-4FF3-A89A-384D16875EE5}
{E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067} = {138DD16C-CC78-4F6C-A898-C8DA68D89067}
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
{106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
@@ -141,6 +142,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GP_ghost", "..\gameengine\g
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E} = {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}
{09222F5E-1625-4FF3-A89A-384D16875EE5} = {09222F5E-1625-4FF3-A89A-384D16875EE5}
{E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067} = {138DD16C-CC78-4F6C-A898-C8DA68D89067}
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
@@ -152,6 +154,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GP_ghost", "..\gameengine\g
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA} = {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358}
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{32CC75E2-EE85-45E6-8E3D-513F58464F43} = {32CC75E2-EE85-45E6-8E3D-513F58464F43}
{9A307EE5-CD77-47BC-BD87-62508C7E19D8} = {9A307EE5-CD77-47BC-BD87-62508C7E19D8}
{AB590CED-F71F-4A17-A89B-18583ECD633D} = {AB590CED-F71F-4A17-A89B-18583ECD633D}
@@ -237,6 +240,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_nodes", "nodes\nodes.vcp
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_gpu", "gpu\BL_gpu.vcproj", "{138DD16C-CC78-4F6C-A898-C8DA68D89067}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
3D Plugin Debug = 3D Plugin Debug
@@ -248,6 +255,8 @@ Global
Debug = Debug
Release = Release
EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Debug.ActiveCfg = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Release.ActiveCfg = Blender Release|Win32
@@ -387,8 +396,10 @@ Global
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Debug.Build.0 = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Release.ActiveCfg = Blender Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Release.Build.0 = Blender Release|Win32
- {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug.ActiveCfg = Blender Debug|Win32
- {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release.ActiveCfg = Blender Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug.ActiveCfg = BlenderPlayer Debug|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug.Build.0 = BlenderPlayer Debug|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release.Build.0 = BlenderPlayer Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Debug.ActiveCfg = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Debug.Build.0 = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Release.ActiveCfg = Blender Release|Win32
@@ -805,6 +816,22 @@ Global
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Debug.Build.0 = Blender Debug|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Release.ActiveCfg = Blender Release|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Release.Build.0 = Blender Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Debug.ActiveCfg = 3D Plugin Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Debug.Build.0 = 3D Plugin Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Release.ActiveCfg = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Release.Build.0 = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Debug.ActiveCfg = Blender Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Debug.Build.0 = Blender Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Release.ActiveCfg = Blender Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Release.Build.0 = Blender Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Debug.ActiveCfg = BlenderPlayer Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Debug.Build.0 = BlenderPlayer Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Release.ActiveCfg = BlenderPlayer Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Release.Build.0 = BlenderPlayer Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Debug.ActiveCfg = BlenderPlayer Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Debug.Build.0 = BlenderPlayer Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Release.ActiveCfg = BlenderPlayer Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Release.Build.0 = BlenderPlayer Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
diff --git a/projectfiles_vc7/blender/blender.vcproj b/projectfiles_vc7/blender/blender.vcproj
index 6372a2f73f5..4eda818dad7 100644
--- a/projectfiles_vc7/blender/blender.vcproj
+++ b/projectfiles_vc7/blender/blender.vcproj
@@ -22,7 +22,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\include;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\include;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging;..\..\..\build\msvc_7\extern\glew\include;..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;WITH_QUICKTIME;GAMEBLENDER=1;USE_SUMO_SOLID;FTGL_LIBRARY_STATIC;WITH_VERSE"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -105,7 +105,7 @@ ECHO Done
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\include;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging"
+ AdditionalIncludeDirectories="..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\include;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging;..\..\..\build\msvc_7\extern\glew\include;..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;WITH_QUICKTIME;WITH_VERSE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
index 8efff1742b0..14c534adeec 100644
--- a/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
+++ b/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -125,7 +125,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2;UNWRAPPER;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -177,7 +177,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="2"
@@ -229,7 +229,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -281,7 +281,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2;UNWRAPPER;WITH_FFMPEG"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -366,6 +366,9 @@
RelativePath="..\..\..\source\blender\blenkernel\intern\brush.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\bvhutils.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\CCGSubSurf.c">
</File>
<File
@@ -492,6 +495,9 @@
RelativePath="..\..\..\source\blender\blenkernel\intern\script.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\shrinkwrap.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\softbody.c">
</File>
<File
@@ -501,6 +507,9 @@
RelativePath="..\..\..\source\blender\blenkernel\intern\subsurf_ccg.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\intern\suggestions.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\intern\text.c">
</File>
<File
@@ -577,6 +586,9 @@
RelativePath="..\..\..\source\blender\blenkernel\BKE_brush.h">
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_bvhutils.h">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\BKE_cdderivedmesh.h">
</File>
<File
@@ -703,6 +715,9 @@
RelativePath="..\..\..\source\blender\blenkernel\BKE_script.h">
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_shrinkwrap.h">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\BKE_softbody.h">
</File>
<File
@@ -712,6 +727,9 @@
RelativePath="..\..\..\source\blender\blenkernel\BKE_subsurf.h">
</File>
<File
+ RelativePath="..\..\..\source\blender\blenkernel\BKE_suggestions.h">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\blenkernel\BKE_text.h">
</File>
<File
diff --git a/projectfiles_vc7/blender/gpu/BL_gpu.vcproj b/projectfiles_vc7/blender/gpu/BL_gpu.vcproj
new file mode 100644
index 00000000000..a780bfc9e0c
--- /dev/null
+++ b/projectfiles_vc7/blender/gpu/BL_gpu.vcproj
@@ -0,0 +1,372 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="BL_gpu"
+ ProjectGUID="{138DD16C-CC78-4F6C-A898-C8DA68D89067}"
+ RootNamespace="BL_gpu"
+ SccProjectName=""
+ SccLocalPath="">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="3D Plugin Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\debug"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="_DEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ DefaultCharIsUnsigned="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\debug\BL_gpu.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\debug\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\mtdll\debug\BL_gpu.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\debug"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="_DEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="FALSE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\gpu\debug\BL_gpu.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\gpu\debug\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\gpu\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\gpu\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\debug\BL_gpu.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_7\source\blender\gpu"
+ IntermediateDirectory="..\..\..\..\build\msvc_7\source\blender\gpu"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="NDEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ StringPooling="TRUE"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="TRUE"
+ DefaultCharIsUnsigned="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\gpu\BL_gpu.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\gpu\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\gpu\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\gpu\"
+ WarningLevel="2"
+ SuppressStartupBanner="TRUE"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\BL_gpu.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="3D Plugin Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll"
+ IntermediateDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="NDEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ StringPooling="TRUE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="TRUE"
+ DefaultCharIsUnsigned="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\BL_gpu.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\gpu\mtdll\"
+ WarningLevel="2"
+ SuppressStartupBanner="TRUE"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\mtdll\BL_gpu.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="BlenderPlayer Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\debug\blenplayer"
+ IntermediateDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\debug\blenplayer"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="_DEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="FALSE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\gpu\debug\BL_gpu.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\gpu\debug\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\gpu\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\gpu\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\debug\BL_gpu.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="BlenderPlayer Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\blenplayer"
+ IntermediateDirectory="..\..\..\..\build\msvc_7\source\blender\gpu\blenplayer"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="NDEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ StringPooling="TRUE"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="TRUE"
+ DefaultCharIsUnsigned="TRUE"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\blender\gpu\BL_gpu.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_7\source\blender\gpu\"
+ ObjectFile="..\..\..\..\build\msvc_7\source\blender\gpu\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_7\source\blender\gpu\"
+ WarningLevel="2"
+ SuppressStartupBanner="TRUE"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_7\libs\BL_gpu.lib"
+ SuppressStartupBanner="TRUE"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_codegen.c">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_draw.c">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_extensions.c">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_material.c">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_shader_material.glsl.c">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_shader_vertex.glsl.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl">
+ <File
+ RelativePath="..\..\..\source\blender\gpu\intern\gpu_codegen.h">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\GPU_draw.h">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\GPU_extensions.h">
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\gpu\GPU_material.h">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/projectfiles_vc7/blender/nodes/nodes.vcproj b/projectfiles_vc7/blender/nodes/nodes.vcproj
index 3e19417de9f..e08a2e04f98 100644
--- a/projectfiles_vc7/blender/nodes/nodes.vcproj
+++ b/projectfiles_vc7/blender/nodes/nodes.vcproj
@@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@@ -66,7 +66,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@@ -113,7 +113,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_OPENEXR"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@@ -160,7 +160,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2, WITH_OPENEXR"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
diff --git a/projectfiles_vc7/blender/radiosity/BRA_radiosity.vcproj b/projectfiles_vc7/blender/radiosity/BRA_radiosity.vcproj
index 8ef408c5a5d..4fc1a8542a3 100644
--- a/projectfiles_vc7/blender/radiosity/BRA_radiosity.vcproj
+++ b/projectfiles_vc7/blender/radiosity/BRA_radiosity.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\..\build\msvc_7\extern\glew\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\..\build\msvc_7\extern\glew\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/projectfiles_vc7/blender/src/BL_src.vcproj b/projectfiles_vc7/blender/src/BL_src.vcproj
index 153d9a90b23..b20e1811f1d 100644
--- a/projectfiles_vc7/blender/src/BL_src.vcproj
+++ b/projectfiles_vc7/blender/src/BL_src.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\extern\glew\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\ghost\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\opennl\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\blenkey\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\memutil\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_7\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj
index b020d88b2b3..faa7f184197 100644
--- a/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj
+++ b/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32;_LIB;_DEBUG;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -74,7 +74,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="TRUE"
BasicRuntimeChecks="0"
@@ -143,9 +143,6 @@
RelativePath="..\..\..\source\gameengine\BlenderRoutines\KX_BlenderMouseDevice.cpp">
</File>
<File
- RelativePath="..\..\..\source\gameengine\BlenderRoutines\KX_BlenderPolyMaterial.cpp">
- </File>
- <File
RelativePath="..\..\..\source\gameengine\BlenderRoutines\KX_BlenderRenderTools.cpp">
</File>
<File
@@ -171,9 +168,6 @@
RelativePath="..\..\..\source\gameengine\BlenderRoutines\KX_BlenderMouseDevice.h">
</File>
<File
- RelativePath="..\..\..\source\gameengine\BlenderRoutines\KX_BlenderPolyMaterial.h">
- </File>
- <File
RelativePath="..\..\..\source\gameengine\BlenderRoutines\KX_BlenderRenderTools.h">
</File>
<File
diff --git a/projectfiles_vc7/gameengine/converter/KX_converter.vcproj b/projectfiles_vc7/gameengine/converter/KX_converter.vcproj
index 239a5a38a79..aa214a66454 100644
--- a/projectfiles_vc7/gameengine/converter/KX_converter.vcproj
+++ b/projectfiles_vc7/gameengine/converter/KX_converter.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -126,7 +126,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -178,7 +178,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="2"
@@ -231,7 +231,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,_LIB,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -283,7 +283,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\ode;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\gameengine\soundsystem\snd_blenderwavecache;..\..\..\source\sumo\include;..\..\..\source\sumo\Fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/projectfiles_vc7/gameengine/expression/EXP_expressions.vcproj b/projectfiles_vc7/gameengine/expression/EXP_expressions.vcproj
index e8516326a62..c0e7bdeed6f 100644
--- a/projectfiles_vc7/gameengine/expression/EXP_expressions.vcproj
+++ b/projectfiles_vc7/gameengine/expression/EXP_expressions.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="WIN32,_LIB,EXP_PYTHON_EMBEDDING,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -125,7 +125,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="TRUE"
RuntimeLibrary="2"
@@ -177,7 +177,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -229,7 +229,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -281,7 +281,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj b/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
index 7e2db4f564f..f51dc785f0f 100644
--- a/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
+++ b/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -125,7 +125,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="TRUE"
RuntimeLibrary="2"
@@ -177,7 +177,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="WIN32,_LIB,EXP_PYTHON_EMBEDDING,_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -229,7 +229,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -281,7 +281,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Rasterizer;..\..\..\source\blender\makesdna"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB,EXP_PYTHON_EMBEDDING"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -348,6 +348,9 @@
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ANDController.cpp">
</File>
<File
+ RelativePath="..\..\..\source\gameengine\GameLogic\SCA_DelaySensor.cpp">
+ </File>
+ <File
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_EventManager.cpp">
</File>
<File
@@ -466,6 +469,9 @@
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ANDController.h">
</File>
<File
+ RelativePath="..\..\..\source\gameengine\GameLogic\SCA_DelaySensor.h">
+ </File>
+ <File
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_EventManager.h">
</File>
<File
diff --git a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
index 9d5a9f55074..5246fc101a2 100644
--- a/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
+++ b/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID"
StringPooling="TRUE"
RuntimeLibrary="2"
@@ -74,7 +74,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -126,7 +126,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -179,7 +179,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -232,11 +232,12 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE"
+ RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\build\msvc_7\source\gameengine\ketsji\debug\KX_ketsji.pch"
AssemblerListingLocation="..\..\..\..\build\msvc_7\source\gameengine\ketsji\debug\"
@@ -284,7 +285,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\sdl\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet;..\..\..\source\blender\python\api2_2x;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -394,6 +395,9 @@
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolygonMaterial.cpp">
</File>
<File
+ RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolyProxy.cpp">
+ </File>
+ <File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PyConstraintBinding.cpp">
</File>
<File
@@ -621,6 +625,9 @@
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolygonMaterial.h">
</File>
<File
+ RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolyProxy.h">
+ </File>
+ <File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PyConstraintBinding.h">
</File>
<File
diff --git a/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj b/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
index 9a807f2d39a..19394024d5f 100644
--- a/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
+++ b/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
@@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@@ -64,7 +64,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
@@ -107,7 +107,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
@@ -151,7 +151,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@@ -197,7 +197,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="FALSE"
BasicRuntimeChecks="3"
@@ -242,7 +242,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\..\source\gameengine\Physics\common;..\..\..\..\..\source\gameengine\Physics\Bullet;..\..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
diff --git a/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj b/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj
index a8d6e77cd58..33806e32d65 100644
--- a/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj
+++ b/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj
@@ -171,6 +171,7 @@
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
+ RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\..\build\msvc_7\source\gameengine\physics\sumo\debug\PHY_Sumo.pch"
AssemblerListingLocation="..\..\..\..\..\..\build\msvc_7\source\gameengine\physics\sumo\debug\"
diff --git a/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj b/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
index c3b417a95f6..ec0f3459057 100644
--- a/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
+++ b/projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
@@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -73,7 +73,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -125,7 +125,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="2"
@@ -177,7 +177,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -229,7 +229,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -281,7 +281,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
+ AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\..\build\msvc_7\extern\glew\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer;..\..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/projectfiles_vc7/kernel/system/SYS_system.vcproj b/projectfiles_vc7/kernel/system/SYS_system.vcproj
index 50ffc1fbb99..3b239d9088b 100644
--- a/projectfiles_vc7/kernel/system/SYS_system.vcproj
+++ b/projectfiles_vc7/kernel/system/SYS_system.vcproj
@@ -125,7 +125,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -177,7 +177,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -229,7 +229,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -281,7 +281,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/release/VERSION b/release/VERSION
index e72716a7902..5d8213c95e7 100644
--- a/release/VERSION
+++ b/release/VERSION
@@ -1 +1 @@
-2.46
+2.47
diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons
index a4834091692..6993840e51f 100644
--- a/release/datafiles/blenderbuttons
+++ b/release/datafiles/blenderbuttons
Binary files differ
diff --git a/release/datafiles/datatoc.c b/release/datafiles/datatoc.c
index 2e24a0f92ef..46b935c7fd6 100644
--- a/release/datafiles/datatoc.c
+++ b/release/datafiles/datatoc.c
@@ -35,7 +35,7 @@ int main(int argc, char**argv) {
FILE *fpin, *fpout;
char cname[256];
char sizest[256];
- long size;
+ size_t size;
int i;
if (argc<1) {
diff --git a/release/datafiles/splash.jpg b/release/datafiles/splash.jpg
index 6a1bd28d509..684a12c3cbb 100644
--- a/release/datafiles/splash.jpg
+++ b/release/datafiles/splash.jpg
Binary files differ
diff --git a/release/scripts/bpymodules/BPyTextPlugin.py b/release/scripts/bpymodules/BPyTextPlugin.py
new file mode 100644
index 00000000000..5e5c9f55e53
--- /dev/null
+++ b/release/scripts/bpymodules/BPyTextPlugin.py
@@ -0,0 +1,814 @@
+"""The BPyTextPlugin Module
+
+Use get_cached_descriptor(txt) to retrieve information about the script held in
+the txt Text object.
+
+Use print_cache_for(txt) to print the information to the console.
+
+Use line, cursor = current_line(txt) to get the logical line and cursor position
+
+Use get_targets(line, cursor) to find out what precedes the cursor:
+ aaa.bbb.cc|c.ddd -> ['aaa', 'bbb', 'cc']
+
+Use resolve_targets(txt, targets) to turn a target list into a usable object if
+one is found to match.
+"""
+
+import bpy, sys, os
+import __builtin__, tokenize
+from Blender.sys import time
+from tokenize import generate_tokens, TokenError, \
+ COMMENT, DEDENT, INDENT, NAME, NEWLINE, NL, STRING, NUMBER
+
+class Definition():
+ """Describes a definition or defined object through its name, line number
+ and docstring. This is the base class for definition based descriptors.
+ """
+
+ def __init__(self, name, lineno, doc=''):
+ self.name = name
+ self.lineno = lineno
+ self.doc = doc
+
+class ScriptDesc():
+ """Describes a script through lists of further descriptor objects (classes,
+ defs, vars) and dictionaries to built-in types (imports). If a script has
+ not been fully parsed, its incomplete flag will be set. The time of the last
+ parse is held by the time field and the name of the text object from which
+ it was parsed, the name field.
+ """
+
+ def __init__(self, name, imports, classes, defs, vars, incomplete=False):
+ self.name = name
+ self.imports = imports
+ self.classes = classes
+ self.defs = defs
+ self.vars = vars
+ self.incomplete = incomplete
+ self.parse_due = 0
+
+ def set_delay(self, delay):
+ self.parse_due = time() + delay
+
+class ClassDesc(Definition):
+ """Describes a class through lists of further descriptor objects (defs and
+ vars). The name of the class is held by the name field and the line on
+ which it is defined is held in lineno.
+ """
+
+ def __init__(self, name, parents, defs, vars, lineno, doc=''):
+ Definition.__init__(self, name, lineno, doc)
+ self.parents = parents
+ self.defs = defs
+ self.vars = vars
+
+class FunctionDesc(Definition):
+ """Describes a function through its name and list of parameters (name,
+ params) and the line on which it is defined (lineno).
+ """
+
+ def __init__(self, name, params, lineno, doc=''):
+ Definition.__init__(self, name, lineno, doc)
+ self.params = params
+
+class VarDesc(Definition):
+ """Describes a variable through its name and type (if ascertainable) and the
+ line on which it is defined (lineno). If no type can be determined, type
+ will equal None.
+ """
+
+ def __init__(self, name, type, lineno):
+ Definition.__init__(self, name, lineno)
+ self.type = type # None for unknown (supports: dict/list/str)
+
+# Context types
+CTX_UNSET = -1
+CTX_NORMAL = 0
+CTX_SINGLE_QUOTE = 1
+CTX_DOUBLE_QUOTE = 2
+CTX_COMMENT = 3
+
+# Python keywords
+KEYWORDS = ['and', 'del', 'from', 'not', 'while', 'as', 'elif', 'global',
+ 'or', 'with', 'assert', 'else', 'if', 'pass', 'yield',
+ 'break', 'except', 'import', 'print', 'class', 'exec', 'in',
+ 'raise', 'continue', 'finally', 'is', 'return', 'def', 'for',
+ 'lambda', 'try' ]
+
+# Module file extensions
+MODULE_EXTS = ['.py', '.pyc', '.pyo', '.pyw', '.pyd']
+
+ModuleType = type(__builtin__)
+NoneScriptDesc = ScriptDesc('', dict(), dict(), dict(), dict(), True)
+
+_modules = {}
+_modules_updated = 0
+_parse_cache = dict()
+
+def _load_module_names():
+ """Searches the sys.path for module files and lists them, along with
+ sys.builtin_module_names, in the global dict _modules.
+ """
+
+ global _modules
+
+ for n in sys.builtin_module_names:
+ _modules[n] = None
+ for p in sys.path:
+ if p == '': p = os.curdir
+ if not os.path.isdir(p): continue
+ for f in os.listdir(p):
+ for ext in MODULE_EXTS:
+ if f.endswith(ext):
+ _modules[f[:-len(ext)]] = None
+ break
+
+_load_module_names()
+
+def _trim_doc(doc):
+ """Trims the quotes from a quoted STRING token (eg. "'''text'''" -> "text")
+ """
+
+ l = len(doc)
+ i = 0
+ while i < l/2 and (doc[i] == "'" or doc[i] == '"'):
+ i += 1
+ return doc[i:-i]
+
+def resolve_targets(txt, targets):
+ """Attempts to return a useful object for the locally or externally defined
+ entity described by targets. If the object is local (defined in txt), a
+ Definition instance is returned. If the object is external (imported or
+ built in), the object itself is returned. If no object can be found, None is
+ returned.
+ """
+
+ count = len(targets)
+ if count==0: return None
+
+ obj = None
+ local = None
+ i = 1
+
+ desc = get_cached_descriptor(txt)
+ b = targets[0].find('(')
+ if b==-1: b = None # Trick to let us use [:b] and get the whole string
+
+ if desc.classes.has_key(targets[0][:b]):
+ local = desc.classes[targets[0][:b]]
+ elif desc.defs.has_key(targets[0]):
+ local = desc.defs[targets[0]]
+ elif desc.vars.has_key(targets[0]):
+ obj = desc.vars[targets[0]].type
+
+ if local:
+ while i < count:
+ b = targets[i].find('(')
+ if b==-1: b = None
+ if hasattr(local, 'classes') and local.classes.has_key(targets[i][:b]):
+ local = local.classes[targets[i][:b]]
+ elif hasattr(local, 'defs') and local.defs.has_key(targets[i]):
+ local = local.defs[targets[i]]
+ elif hasattr(local, 'vars') and local.vars.has_key(targets[i]):
+ obj = local.vars[targets[i]].type
+ local = None
+ i += 1
+ break
+ else:
+ local = None
+ break
+ i += 1
+
+ if local: return local
+
+ if not obj:
+ if desc.imports.has_key(targets[0]):
+ obj = desc.imports[targets[0]]
+ else:
+ builtins = get_builtins()
+ if builtins.has_key(targets[0]):
+ obj = builtins[targets[0]]
+
+ while obj and i < count:
+ if hasattr(obj, targets[i]):
+ obj = getattr(obj, targets[i])
+ else:
+ obj = None
+ break
+ i += 1
+
+ return obj
+
+def get_cached_descriptor(txt, force_parse=0):
+ """Returns the cached ScriptDesc for the specified Text object 'txt'. If the
+ script has not been parsed in the last 'period' seconds it will be reparsed
+ to obtain this descriptor.
+
+ Specifying TP_AUTO for the period (default) will choose a period based on the
+ size of the Text object. Larger texts are parsed less often.
+ """
+
+ global _parse_cache
+
+ parse = True
+ key = hash(txt)
+ if not force_parse and _parse_cache.has_key(key):
+ desc = _parse_cache[key]
+ if desc.parse_due > time():
+ parse = desc.incomplete
+
+ if parse:
+ desc = parse_text(txt)
+
+ return desc
+
+def parse_text(txt):
+ """Parses an entire script's text and returns a ScriptDesc instance
+ containing information about the script.
+
+ If the text is not a valid Python script (for example if brackets are left
+ open), parsing may fail to complete. However, if this occurs, no exception
+ is thrown. Instead the returned ScriptDesc instance will have its incomplete
+ flag set and information processed up to this point will still be accessible.
+ """
+
+ start_time = time()
+ txt.reset()
+ tokens = generate_tokens(txt.readline) # Throws TokenError
+
+ curl, cursor = txt.getCursorPos()
+ linen = curl + 1 # Token line numbers are one-based
+
+ imports = dict()
+ imp_step = 0
+
+ classes = dict()
+ cls_step = 0
+
+ defs = dict()
+ def_step = 0
+
+ vars = dict()
+ var1_step = 0
+ var2_step = 0
+ var3_step = 0
+ var_accum = dict()
+ var_forflag = False
+
+ indent = 0
+ prev_type = -1
+ prev_text = ''
+ incomplete = False
+
+ while True:
+ try:
+ type, text, start, end, line = tokens.next()
+ except StopIteration:
+ break
+ except (TokenError, IndentationError):
+ incomplete = True
+ break
+
+ # Skip all comments and line joining characters
+ if type == COMMENT or type == NL:
+ continue
+
+ #################
+ ## Indentation ##
+ #################
+
+ if type == INDENT:
+ indent += 1
+ elif type == DEDENT:
+ indent -= 1
+
+ #########################
+ ## Module importing... ##
+ #########################
+
+ imp_store = False
+
+ # Default, look for 'from' or 'import' to start
+ if imp_step == 0:
+ if text == 'from':
+ imp_tmp = []
+ imp_step = 1
+ elif text == 'import':
+ imp_from = None
+ imp_tmp = []
+ imp_step = 2
+
+ # Found a 'from', create imp_from in form '???.???...'
+ elif imp_step == 1:
+ if text == 'import':
+ imp_from = '.'.join(imp_tmp)
+ imp_tmp = []
+ imp_step = 2
+ elif type == NAME:
+ imp_tmp.append(text)
+ elif text != '.':
+ imp_step = 0 # Invalid syntax
+
+ # Found 'import', imp_from is populated or None, create imp_name
+ elif imp_step == 2:
+ if text == 'as':
+ imp_name = '.'.join(imp_tmp)
+ imp_step = 3
+ elif type == NAME or text == '*':
+ imp_tmp.append(text)
+ elif text != '.':
+ imp_name = '.'.join(imp_tmp)
+ imp_symb = imp_name
+ imp_store = True
+
+ # Found 'as', change imp_symb to this value and go back to step 2
+ elif imp_step == 3:
+ if type == NAME:
+ imp_symb = text
+ else:
+ imp_store = True
+
+ # Both imp_name and imp_symb have now been populated so we can import
+ if imp_store:
+
+ # Handle special case of 'import *'
+ if imp_name == '*':
+ parent = get_module(imp_from)
+ imports.update(parent.__dict__)
+
+ else:
+ # Try importing the name as a module
+ try:
+ if imp_from:
+ module = get_module(imp_from +'.'+ imp_name)
+ else:
+ module = get_module(imp_name)
+ except (ImportError, ValueError, AttributeError, TypeError):
+ # Try importing name as an attribute of the parent
+ try:
+ module = __import__(imp_from, globals(), locals(), [imp_name])
+ imports[imp_symb] = getattr(module, imp_name)
+ except (ImportError, ValueError, AttributeError, TypeError):
+ pass
+ else:
+ imports[imp_symb] = module
+
+ # More to import from the same module?
+ if text == ',':
+ imp_tmp = []
+ imp_step = 2
+ else:
+ imp_step = 0
+
+ ###################
+ ## Class parsing ##
+ ###################
+
+ # If we are inside a class then def and variable parsing should be done
+ # for the class. Otherwise the definitions are considered global
+
+ # Look for 'class'
+ if cls_step == 0:
+ if text == 'class':
+ cls_name = None
+ cls_lineno = start[0]
+ cls_indent = indent
+ cls_step = 1
+
+ # Found 'class', look for cls_name followed by '(' parents ')'
+ elif cls_step == 1:
+ if not cls_name:
+ if type == NAME:
+ cls_name = text
+ cls_sline = False
+ cls_parents = dict()
+ cls_defs = dict()
+ cls_vars = dict()
+ elif type == NAME:
+ if classes.has_key(text):
+ parent = classes[text]
+ cls_parents[text] = parent
+ cls_defs.update(parent.defs)
+ cls_vars.update(parent.vars)
+ elif text == ':':
+ cls_step = 2
+
+ # Found 'class' name ... ':', now check if it's a single line statement
+ elif cls_step == 2:
+ if type == NEWLINE:
+ cls_sline = False
+ else:
+ cls_sline = True
+ cls_doc = ''
+ cls_step = 3
+
+ elif cls_step == 3:
+ if not cls_doc and type == STRING:
+ cls_doc = _trim_doc(text)
+ if cls_sline:
+ if type == NEWLINE:
+ classes[cls_name] = ClassDesc(cls_name, cls_parents, cls_defs, cls_vars, cls_lineno, cls_doc)
+ cls_step = 0
+ else:
+ if type == DEDENT and indent <= cls_indent:
+ classes[cls_name] = ClassDesc(cls_name, cls_parents, cls_defs, cls_vars, cls_lineno, cls_doc)
+ cls_step = 0
+
+ #################
+ ## Def parsing ##
+ #################
+
+ # Look for 'def'
+ if def_step == 0:
+ if text == 'def':
+ def_name = None
+ def_lineno = start[0]
+ def_step = 1
+
+ # Found 'def', look for def_name followed by '('
+ elif def_step == 1:
+ if type == NAME:
+ def_name = text
+ def_params = []
+ elif def_name and text == '(':
+ def_step = 2
+
+ # Found 'def' name '(', now identify the parameters upto ')'
+ # TODO: Handle ellipsis '...'
+ elif def_step == 2:
+ if type == NAME:
+ def_params.append(text)
+ elif text == ':':
+ def_step = 3
+
+ # Found 'def' ... ':', now check if it's a single line statement
+ elif def_step == 3:
+ if type == NEWLINE:
+ def_sline = False
+ else:
+ def_sline = True
+ def_doc = ''
+ def_step = 4
+
+ elif def_step == 4:
+ if type == STRING:
+ def_doc = _trim_doc(text)
+ newdef = None
+ if def_sline:
+ if type == NEWLINE:
+ newdef = FunctionDesc(def_name, def_params, def_lineno, def_doc)
+ else:
+ if type == NAME:
+ newdef = FunctionDesc(def_name, def_params, def_lineno, def_doc)
+ if newdef:
+ if cls_step > 0: # Parsing a class
+ cls_defs[def_name] = newdef
+ else:
+ defs[def_name] = newdef
+ def_step = 0
+
+ ##########################
+ ## Variable assignation ##
+ ##########################
+
+ if cls_step > 0: # Parsing a class
+ # Look for 'self.???'
+ if var1_step == 0:
+ if text == 'self':
+ var1_step = 1
+ elif var1_step == 1:
+ if text == '.':
+ var_name = None
+ var1_step = 2
+ else:
+ var1_step = 0
+ elif var1_step == 2:
+ if type == NAME:
+ var_name = text
+ if cls_vars.has_key(var_name):
+ var_step = 0
+ else:
+ var1_step = 3
+ elif var1_step == 3:
+ if text == '=':
+ var1_step = 4
+ elif text != ',':
+ var1_step = 0
+ elif var1_step == 4:
+ var_type = None
+ if type == NUMBER:
+ close = end[1]
+ if text.find('.') != -1: var_type = float
+ else: var_type = int
+ elif type == STRING:
+ close = end[1]
+ var_type = str
+ elif text == '[':
+ close = line.find(']', end[1])
+ var_type = list
+ elif text == '(':
+ close = line.find(')', end[1])
+ var_type = tuple
+ elif text == '{':
+ close = line.find('}', end[1])
+ var_type = dict
+ elif text == 'dict':
+ close = line.find(')', end[1])
+ var_type = dict
+ if var_type and close+1 < len(line):
+ if line[close+1] != ' ' and line[close+1] != '\t':
+ var_type = None
+ cls_vars[var_name] = VarDesc(var_name, var_type, start[0])
+ var1_step = 0
+
+ elif def_step > 0: # Parsing a def
+ # Look for 'global ???[,???]'
+ if var2_step == 0:
+ if text == 'global':
+ var2_step = 1
+ elif var2_step == 1:
+ if type == NAME:
+ if not vars.has_key(text):
+ vars[text] = VarDesc(text, None, start[0])
+ elif text != ',' and type != NL:
+ var2_step == 0
+
+ else: # In global scope
+ if var3_step == 0:
+ # Look for names
+ if text == 'for':
+ var_accum = dict()
+ var_forflag = True
+ elif text == '=' or (var_forflag and text == 'in'):
+ var_forflag = False
+ var3_step = 1
+ elif type == NAME:
+ if prev_text != '.' and not vars.has_key(text):
+ var_accum[text] = VarDesc(text, None, start[0])
+ elif not text in [',', '(', ')', '[', ']']:
+ var_accum = dict()
+ var_forflag = False
+ elif var3_step == 1:
+ if len(var_accum) != 1:
+ var_type = None
+ vars.update(var_accum)
+ else:
+ var_name = var_accum.keys()[0]
+ var_type = None
+ if type == NUMBER:
+ if text.find('.') != -1: var_type = float
+ else: var_type = int
+ elif type == STRING: var_type = str
+ elif text == '[': var_type = list
+ elif text == '(': var_type = tuple
+ elif text == '{': var_type = dict
+ vars[var_name] = VarDesc(var_name, var_type, start[0])
+ var3_step = 0
+
+ #######################
+ ## General utilities ##
+ #######################
+
+ prev_type = type
+ prev_text = text
+
+ desc = ScriptDesc(txt.name, imports, classes, defs, vars, incomplete)
+ desc.set_delay(10 * (time()-start_time) + 0.05)
+
+ global _parse_cache
+ _parse_cache[hash(txt)] = desc
+ return desc
+
+def get_modules(since=1):
+ """Returns the set of built-in modules and any modules that have been
+ imported into the system upto 'since' seconds ago.
+ """
+
+ global _modules, _modules_updated
+
+ t = time()
+ if _modules_updated < t - since:
+ _modules.update(sys.modules)
+ _modules_updated = t
+ return _modules.keys()
+
+def suggest_cmp(x, y):
+ """Use this method when sorting a list of suggestions.
+ """
+
+ return cmp(x[0].upper(), y[0].upper())
+
+def get_module(name):
+ """Returns the module specified by its name. The module itself is imported
+ by this method and, as such, any initialization code will be executed.
+ """
+
+ mod = __import__(name)
+ components = name.split('.')
+ for comp in components[1:]:
+ mod = getattr(mod, comp)
+ return mod
+
+def type_char(v):
+ """Returns the character used to signify the type of a variable. Use this
+ method to identify the type character for an item in a suggestion list.
+
+ The following values are returned:
+ 'm' if the parameter is a module
+ 'f' if the parameter is callable
+ 'v' if the parameter is variable or otherwise indeterminable
+
+ """
+
+ if isinstance(v, ModuleType):
+ return 'm'
+ elif callable(v):
+ return 'f'
+ else:
+ return 'v'
+
+def get_context(txt):
+ """Establishes the context of the cursor in the given Blender Text object
+
+ Returns one of:
+ CTX_NORMAL - Cursor is in a normal context
+ CTX_SINGLE_QUOTE - Cursor is inside a single quoted string
+ CTX_DOUBLE_QUOTE - Cursor is inside a double quoted string
+ CTX_COMMENT - Cursor is inside a comment
+
+ """
+
+ l, cursor = txt.getCursorPos()
+ lines = txt.asLines(0, l+1)
+
+ # FIXME: This method is too slow in large files for it to be called as often
+ # as it is. So for lines below the 1000th line we do this... (quorn)
+ if l > 1000: return CTX_NORMAL
+
+ # Detect context (in string or comment)
+ in_str = CTX_NORMAL
+ for line in lines:
+ if l == 0:
+ end = cursor
+ else:
+ end = len(line)
+ l -= 1
+
+ # Comments end at new lines
+ if in_str == CTX_COMMENT:
+ in_str = CTX_NORMAL
+
+ for i in range(end):
+ if in_str == 0:
+ if line[i] == "'": in_str = CTX_SINGLE_QUOTE
+ elif line[i] == '"': in_str = CTX_DOUBLE_QUOTE
+ elif line[i] == '#': in_str = CTX_COMMENT
+ else:
+ if in_str == CTX_SINGLE_QUOTE:
+ if line[i] == "'":
+ in_str = CTX_NORMAL
+ # In again if ' escaped, out again if \ escaped, and so on
+ for a in range(i-1, -1, -1):
+ if line[a] == '\\': in_str = 1-in_str
+ else: break
+ elif in_str == CTX_DOUBLE_QUOTE:
+ if line[i] == '"':
+ in_str = CTX_NORMAL
+ # In again if " escaped, out again if \ escaped, and so on
+ for a in range(i-1, -1, -1):
+ if line[i-a] == '\\': in_str = 2-in_str
+ else: break
+
+ return in_str
+
+def current_line(txt):
+ """Extracts the Python script line at the cursor in the Blender Text object
+ provided and cursor position within this line as the tuple pair (line,
+ cursor).
+ """
+
+ lineindex, cursor = txt.getCursorPos()
+ lines = txt.asLines()
+ line = lines[lineindex]
+
+ # Join previous lines to this line if spanning
+ i = lineindex - 1
+ while i > 0:
+ earlier = lines[i].rstrip()
+ if earlier.endswith('\\'):
+ line = earlier[:-1] + ' ' + line
+ cursor += len(earlier)
+ i -= 1
+
+ # Join later lines while there is an explicit joining character
+ i = lineindex
+ while i < len(lines)-1 and lines[i].rstrip().endswith('\\'):
+ later = lines[i+1].strip()
+ line = line + ' ' + later[:-1]
+ i += 1
+
+ return line, cursor
+
+def get_targets(line, cursor):
+ """Parses a period separated string of valid names preceding the cursor and
+ returns them as a list in the same order.
+ """
+
+ brk = 0
+ targets = []
+ j = cursor
+ i = j-1
+ while i >= 0:
+ if line[i] == ')': brk += 1
+ elif brk:
+ if line[i] == '(': brk -= 1
+ else:
+ if line[i] == '.':
+ targets.insert(0, line[i+1:j]); j=i
+ elif not (line[i].isalnum() or line[i] == '_' or line[i] == '.'):
+ break
+ i -= 1
+ targets.insert(0, line[i+1:j])
+ return targets
+
+def get_defs(txt):
+ """Returns a dictionary which maps definition names in the source code to
+ a list of their parameter names.
+
+ The line 'def doit(one, two, three): print one' for example, results in the
+ mapping 'doit' : [ 'one', 'two', 'three' ]
+ """
+
+ return get_cached_descriptor(txt).defs
+
+def get_vars(txt):
+ """Returns a dictionary of variable names found in the specified Text
+ object. This method locates all names followed directly by an equal sign:
+ 'a = ???' or indirectly as part of a tuple/list assignment or inside a
+ 'for ??? in ???:' block.
+ """
+
+ return get_cached_descriptor(txt).vars
+
+def get_imports(txt):
+ """Returns a dictionary which maps symbol names in the source code to their
+ respective modules.
+
+ The line 'from Blender import Text as BText' for example, results in the
+ mapping 'BText' : <module 'Blender.Text' (built-in)>
+
+ Note that this method imports the modules to provide this mapping as as such
+ will execute any initilization code found within.
+ """
+
+ return get_cached_descriptor(txt).imports
+
+def get_builtins():
+ """Returns a dictionary of built-in modules, functions and variables."""
+
+ return __builtin__.__dict__
+
+
+#################################
+## Debugging utility functions ##
+#################################
+
+def print_cache_for(txt, period=sys.maxint):
+ """Prints out the data cached for a given Text object. If no period is
+ given the text will not be reparsed and the cached version will be returned.
+ Otherwise if the period has expired the text will be reparsed.
+ """
+
+ desc = get_cached_descriptor(txt, period)
+ print '================================================'
+ print 'Name:', desc.name, '('+str(hash(txt))+')'
+ print '------------------------------------------------'
+ print 'Defs:'
+ for name, ddesc in desc.defs.items():
+ print ' ', name, ddesc.params, ddesc.lineno
+ print ' ', ddesc.doc
+ print '------------------------------------------------'
+ print 'Vars:'
+ for name, vdesc in desc.vars.items():
+ print ' ', name, vdesc.type, vdesc.lineno
+ print '------------------------------------------------'
+ print 'Imports:'
+ for name, item in desc.imports.items():
+ print ' ', name.ljust(15), item
+ print '------------------------------------------------'
+ print 'Classes:'
+ for clsnme, clsdsc in desc.classes.items():
+ print ' *********************************'
+ print ' Name:', clsnme
+ print ' ', clsdsc.doc
+ print ' ---------------------------------'
+ print ' Defs:'
+ for name, ddesc in clsdsc.defs.items():
+ print ' ', name, ddesc.params, ddesc.lineno
+ print ' ', ddesc.doc
+ print ' ---------------------------------'
+ print ' Vars:'
+ for name, vdesc in clsdsc.vars.items():
+ print ' ', name, vdesc.type, vdesc.lineno
+ print ' *********************************'
+ print '================================================'
diff --git a/release/scripts/flt_dofedit.py b/release/scripts/flt_dofedit.py
new file mode 100644
index 00000000000..36e8e4d2501
--- /dev/null
+++ b/release/scripts/flt_dofedit.py
@@ -0,0 +1,835 @@
+#!BPY
+
+"""
+Name: 'FLT DOF Editor'
+Blender: 240
+Group: 'Misc'
+Tooltip: 'Degree of Freedom editor for FLT nodes'
+"""
+
+__author__ = "Geoffrey Bantle"
+__version__ = "1.0 11/21/07"
+__email__ = ('scripts', 'Author, ')
+__url__ = ('blender', 'blenderartists.org')
+
+__bpydoc__ ="""\
+This script provides tools for working with OpenFlight databases in Blender. OpenFlight is a
+registered trademark of MultiGen-Paradigm, Inc.
+
+Feature overview and more availible at:
+http://wiki.blender.org/index.php/Scripts/Manual/FLTools
+"""
+
+# --------------------------------------------------------------------------
+# flt_palettemanager.py version 0.1 2005/04/08
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# Copyright (C) 2007: Blender Foundation
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender.Draw as Draw
+from Blender.BGL import *
+import Blender
+import flt_properties
+reload(flt_properties)
+from flt_properties import *
+
+#event codes
+evcode = {
+ "DOF_MAKE" : 100,
+ "DOF_UPDATE" : 138,
+ "DOF_DELETE" : 101,
+ "DOF_TRANSX" : 102,
+ "DOF_TRANSY" : 103,
+ "DOF_TRANSZ" : 104,
+ "DOF_ROTX" : 105,
+ "DOF_ROTY" : 106,
+ "DOF_ROTZ" : 107,
+ "DOF_SCALEX" : 108,
+ "DOF_SCALEY" : 109,
+ "DOF_SCALEZ" : 110,
+ "DOF_MIN_TRANSX" : 111,
+ "DOF_MIN_TRANSY" : 112,
+ "DOF_MIN_TRANSZ" : 113,
+ "DOF_MIN_ROTX" : 114,
+ "DOF_MIN_ROTY" : 115,
+ "DOF_MIN_ROTZ" : 116,
+ "DOF_MIN_SCALEX" : 117,
+ "DOF_MIN_SCALEY" : 118,
+ "DOF_MIN_SCALEZ" : 119,
+ "DOF_MAX_TRANSX" : 120,
+ "DOF_MAX_TRANSY" : 121,
+ "DOF_MAX_TRANSZ" : 122,
+ "DOF_MAX_ROTX" : 123,
+ "DOF_MAX_ROTY" : 124,
+ "DOF_MAX_ROTZ" : 125,
+ "DOF_MAX_SCALEX" : 126,
+ "DOF_MAX_SCALEY" : 127,
+ "DOF_MAX_SCALEZ" : 128,
+ "DOF_STEP_TRANSX" : 129,
+ "DOF_STEP_TRANSY" : 130,
+ "DOF_STEP_TRANSZ" : 131,
+ "DOF_STEP_ROTX" : 132,
+ "DOF_STEP_ROTY" : 133,
+ "DOF_STEP_ROTZ" : 134,
+ "DOF_STEP_SCALEX" : 135,
+ "DOF_STEP_SCALEY" : 136,
+ "DOF_STEP_SCALEZ" : 137
+}
+
+#system
+DOF_MAKE = None
+DOF_UPDATE = None
+DOF_DELETE = None
+
+#toggle buttons
+DOF_TRANSX = None
+DOF_TRANSY = None
+DOF_TRANSZ = None
+DOF_ROTX = None
+DOF_ROTY = None
+DOF_ROTZ = None
+DOF_SCALEX = None
+DOF_SCALEY = None
+DOF_SCALEZ = None
+
+#Minimums
+DOF_MIN_TRANSX = None
+DOF_MIN_TRANSY = None
+DOF_MIN_TRANSZ = None
+DOF_MIN_ROTX = None
+DOF_MIN_ROTY = None
+DOF_MIN_ROTZ = None
+DOF_MIN_SCALEX = None
+DOF_MIN_SCALEY = None
+DOF_MIN_SCALEZ = None
+
+#maximums
+DOF_MAX_TRANSX = None
+DOF_MAX_TRANSY = None
+DOF_MAX_TRANSZ = None
+DOF_MAX_ROTX = None
+DOF_MAX_ROTY = None
+DOF_MAX_ROTZ = None
+DOF_MAX_SCALEX = None
+DOF_MAX_SCALEY = None
+DOF_MAX_SCALEZ = None
+
+#step
+DOF_STEP_TRANSX = None
+DOF_STEP_TRANSY = None
+DOF_STEP_TRANSZ = None
+DOF_STEP_ROTX = None
+DOF_STEP_ROTY = None
+DOF_STEP_ROTZ = None
+DOF_STEP_SCALEX = None
+DOF_STEP_SCALEY = None
+DOF_STEP_SCALEZ = None
+
+#labels
+DOF_ROTSTRING = None
+DOF_TRANSTRING = None
+DOF_SCALESTRING = None
+DOF_EDITLABEL = None
+
+#make ID props easier/morereadable
+zmin = '14d!ZMIN'
+zmax = '15d!ZMAX'
+zcur = '16d!ZCUR'
+zstep = '17d!ZSTEP'
+ymin = '18d!YMIN'
+ymax = '19d!YMAX'
+ycur = '20d!YCUR'
+ystep = '21d!YSTEP'
+xmin = '22d!XMIN'
+xmax = '23d!XMAX'
+xcur = '24d!XCUR'
+xstep = '25d!XSTEP'
+pitchmin = '26d!PITCH-MIN'
+pitchmax = '27d!PITCH-MAX'
+pitchcur = '28d!PITCH-CUR'
+pitchstep = '29d!PITCH-STEP'
+rollmin = '30d!ROLL-MIN'
+rollmax = '31d!ROLL-MAX'
+rollcur = '32d!ROLL-CUR'
+rollstep = '33d!ROLL-STEP'
+yawmin = '34d!YAW-MIN'
+yawmax = '35d!YAW-MAX'
+yawcur = '36d!YAW-CUR'
+yawstep = '37d!YAW-STEP'
+zscalemin = '38d!ZSIZE-MIN'
+zscalemax = '39d!ZSIZE-MAX'
+zscalecur = '40d!ZSIZE-CUR'
+zscalestep = '41d!ZSIZE-STEP'
+yscalemin = '42d!YSIZE-MIN'
+yscalemax = '43d!YSIZE-MAX'
+yscalecur = '44d!YSIZE-CUR'
+yscalestep = '45d!YSIZE-STEP'
+xscalemin = '46d!XSIZE-MIN'
+xscalemax = '47d!XSIZE-MAX'
+xscalecur = '48d!XSIZE-CUR'
+xscalestep = '49d!XSIZE-STEP'
+
+
+
+def update_state():
+ state = dict()
+ state["activeScene"] = Blender.Scene.GetCurrent()
+ state["activeObject"] = state["activeScene"].objects.active
+ if state["activeObject"] and not state["activeObject"].sel:
+ state["activeObject"] = None
+ state["activeMesh"] = None
+ if state["activeObject"] and state["activeObject"].type == 'Mesh':
+ state["activeMesh"] = state["activeObject"].getData(mesh=True)
+
+
+ state["activeFace"] = None
+ if state["activeMesh"]:
+ if state["activeMesh"].faceUV and state["activeMesh"].activeFace != None:
+ state["activeFace"] = state["activeMesh"].faces[state["activeMesh"].activeFace]
+
+
+ #update editmode
+ state["editmode"] = Blender.Window.EditMode()
+
+ return state
+
+def idprops_append(object, typecode, props):
+ object.properties["FLT"] = dict()
+ object.properties["FLT"]['type'] = typecode
+ for prop in props:
+ object.properties["FLT"][prop] = props[prop]
+ object.properties["FLT"]['3t8!id'] = object.name
+
+def idprops_kill():
+ state = update_state()
+ if state["activeObject"] and state["activeObject"].properties.has_key('FLT'):
+ state["activeObject"].properties.pop('FLT')
+
+def idprops_copy(source):
+ state = update_state()
+ if source.properties.has_key('FLT'):
+ for object in state["activeScene"].objects:
+ if object.sel and object != source and (state["activeScene"].Layers & object.Layers):
+ idprops_kill(object)
+ object.properties['FLT'] = dict()
+ for key in source.properties['FLT']:
+ object.properties['FLT'][key] = source.properties['FLT'][key]
+
+def select_by_typecode(typecode):
+ state = update_state()
+
+ for object in state["activeScene"].objects:
+ if object.properties.has_key('FLT') and object.properties['FLT']['type'] == typecode and state["activeScene"].Layers & object.Layers:
+ object.select(1)
+
+def DOF_get_frame():
+ state = update_state()
+
+ if not state["activeObject"] and not id_props_type(state["activeObject"], 14):
+ return
+
+ #Warning! assumes 1 BU == 10 meters.
+ #do origin
+ state["activeObject"].properties['FLT']['5d!ORIGX'] = state["activeObject"].getLocation('worldspace')[0]*10.0
+ state["activeObject"].properties['FLT']['6d!ORIGY'] = state["activeObject"].getLocation('worldspace')[1]*10.0
+ state["activeObject"].properties['FLT']['7d!ORIGZ'] = state["activeObject"].getLocation('worldspace')[2]*10.0
+ #do X axis
+ x = Blender.Mathutils.Vector(1.0,0.0,0.0)
+ x = x * state["activeObject"].getMatrix('worldspace')
+ x = x * 10.0
+ state["activeObject"].properties['FLT']['8d!XAXIS-X'] = x[0]
+ state["activeObject"].properties['FLT']['9d!XAXIS-Y'] = x[1]
+ state["activeObject"].properties['FLT']['10d!XAXIS-Z'] = x[2]
+ #do X/Y plane
+ x = Blender.Mathutils.Vector(0.0,1.0,0.0)
+ x.normalize()
+ x = x * state["activeObject"].getMatrix('worldspace')
+ x = x * 10.0
+ state["activeObject"].properties['FLT']['11d!XYPLANE-X'] = x[0]
+ state["activeObject"].properties['FLT']['12d!XYPLANE-Y'] = x[1]
+ state["activeObject"].properties['FLT']['13d!XZPLANE-Z'] = x[2]
+
+def idprops_type(object, typecode):
+ if object.properties.has_key('FLT') and object.properties['FLT'].has_key('type') and object.properties['FLT']['type'] == typecode:
+ return True
+ return False
+
+#ui type code
+def get_prop(typecode, prop):
+
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], typecode):
+ props = state["activeObject"].properties['FLT']
+ else:
+ props = flt_properties.FLTDOF
+
+ return props[prop]
+
+def set_prop(typecode, prop, value):
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"],typecode):
+ state["activeObject"].properties['FLT'][prop] = value
+
+lockxtrans = (1 << 31)
+lockytrans = (1 << 30)
+lockztrans = (1 << 29)
+lockxrot = (1 << 28)
+lockyrot = (1 << 27)
+lockzrot = (1 << 26)
+lockxscale = (1 << 25)
+lockyscale = (1 << 24)
+lockzscale = (1 << 23)
+
+def get_lockmask(mask):
+ state = update_state()
+ if state["activeObject"]:
+ flag = get_prop(14,'50I!FLAG')
+ if flag & mask:
+ return True
+ return False
+
+def set_lockmask(mask):
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], 14):
+ oldvalue = state["activeObject"].properties['FLT']['50I!FLAG']
+ oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0]
+ oldvalue |= mask
+ state["activeObject"].properties['FLT']['50I!FLAG'] = struct.unpack('>i', struct.pack(">I", oldvalue))[0]
+
+def clear_lockmask(mask):
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], 14):
+ oldvalue = state["activeObject"].properties['FLT']['50I!FLAG']
+ oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0]
+ oldvalue &= ~mask
+ state["activeObject"].properties['FLT']['50I!FLAG'] = struct.unpack('>i',struct.pack('>I',oldvalue))[0]
+
+
+def create_dof():
+ state = update_state()
+ actobj = state["activeObject"]
+ if actobj and not idprops_type(actobj, 14):
+ idprops_kill()
+ idprops_append(actobj,14, flt_properties.FLTDOF)
+ DOF_get_frame()
+
+
+def event(evt,val):
+ if evt == Draw.ESCKEY:
+ Draw.Exit()
+
+def but_event(evt):
+ global DOF_MAKE
+ global DOF_UPDATE
+ global DOF_DELETE
+
+ global DOF_TRANSX
+ global DOF_TRANSY
+ global DOF_TRANSZ
+ global DOF_ROTX
+ global DOF_ROTY
+ global DOF_ROTZ
+ global DOF_SCALEX
+ global DOF_SCALEY
+ global DOF_SCALEZ
+
+ global DOF_MIN_TRANSX
+ global DOF_MIN_TRANSY
+ global DOF_MIN_TRANSZ
+ global DOF_MIN_ROTX
+ global DOF_MIN_ROTY
+ global DOF_MIN_ROTZ
+ global DOF_MIN_SCALEX
+ global DOF_MIN_SCALEY
+ global DOF_MIN_SCALEZ
+
+ global DOF_MAX_TRANSX
+ global DOF_MAX_TRANSY
+ global DOF_MAX_TRANSZ
+ global DOF_MAX_ROTX
+ global DOF_MAX_ROTY
+ global DOF_MAX_ROTZ
+ global DOF_MAX_SCALEX
+ global DOF_MAX_SCALEY
+ global DOF_MAX_SCALEZ
+
+ global DOF_STEP_TRANSX
+ global DOF_STEP_TRANSY
+ global DOF_STEP_TRANSZ
+ global DOF_STEP_ROTX
+ global DOF_STEP_ROTY
+ global DOF_STEP_ROTZ
+ global DOF_STEP_SCALEX
+ global DOF_STEP_SCALEY
+ global DOF_STEP_SCALEZ
+
+ #labels
+ global DOF_ROTSTRING
+ global DOF_TRANSTRING
+ global DOF_SCALESTRING
+
+
+ #masks
+ global lockxtrans
+ global lockytrans
+ global lockztrans
+ global lockxrot
+ global lockyrot
+ global lockzrot
+ global lockxscale
+ global lockyscale
+ global lockzscale
+
+ global zmin
+ global zmax
+ global zcur
+ global zstep
+ global ymin
+ global ymax
+ global ycur
+ global ystep
+ global xmin
+ global xmax
+ global xcur
+ global xstep
+ global pitchmin
+ global pitchmax
+ global pitchcur
+ global pitchstep
+ global rollmin
+ global rollmax
+ global rollcur
+ global rollstep
+ global yawmin
+ global yawmax
+ global yawcur
+ global yawstep
+ global zscalemin
+ global zscalemax
+ global zscalecur
+ global zscalestep
+ global yscalemin
+ global yscalemax
+ global yscalecur
+ global yscalestep
+ global xscalemin
+ global xscalemax
+ global xscalecur
+ global xscalestep
+
+
+
+ #do "system" events
+ if evt == evcode["DOF_MAKE"]:
+ create_dof()
+
+ if evt == evcode["DOF_UPDATE"]:
+ DOF_get_frame()
+
+ if evt == evcode["DOF_DELETE"]:
+ idprops_kill()
+ #do translation lock events
+ if evt == evcode["DOF_TRANSX"]:
+ if DOF_TRANSX.val == True:
+ set_lockmask(lockxtrans)
+ else:
+ clear_lockmask(lockxtrans)
+
+ if evt == evcode["DOF_TRANSY"]:
+ if DOF_TRANSY.val == True:
+ set_lockmask(lockytrans)
+ else:
+ clear_lockmask(lockytrans)
+
+ if evt == evcode["DOF_TRANSZ"]:
+ if DOF_TRANSZ.val == True:
+ set_lockmask(lockztrans)
+ else:
+ clear_lockmask(lockztrans)
+
+
+ #do rotation lock events
+ if evt == evcode["DOF_ROTX"]:
+ if DOF_ROTX.val == True:
+ set_lockmask(lockxrot)
+ else:
+ clear_lockmask(lockxrot)
+
+ if evt == evcode["DOF_ROTY"]:
+ if DOF_ROTY.val == True:
+ set_lockmask(lockyrot)
+ else:
+ clear_lockmask(lockyrot)
+
+ if evt == evcode["DOF_ROTZ"]:
+ if DOF_ROTZ.val == True:
+ set_lockmask(lockzrot)
+ else:
+ clear_lockmask(lockzrot)
+
+ #do scale lock events
+ if evt == evcode["DOF_SCALEX"]:
+ if DOF_SCALEX.val == True:
+ set_lockmask(lockxscale)
+ else:
+ clear_lockmask(lockxscale)
+
+ if evt == evcode["DOF_SCALEY"]:
+ if DOF_SCALEY.val == True:
+ set_lockmask(lockyscale)
+ else:
+ clear_lockmask(lockyscale)
+
+ if evt == evcode["DOF_SCALEZ"]:
+ if DOF_SCALEZ.val == True:
+ set_lockmask(lockzscale)
+ else:
+ clear_lockmask(lockzscale)
+
+
+ #do translation buttons
+ if evt == evcode["DOF_MIN_TRANSX"]:
+ set_prop(14, xmin, DOF_MIN_TRANSX.val)
+ if evt == evcode["DOF_MAX_TRANSX"]:
+ set_prop(14,xmax, DOF_MAX_TRANSX.val)
+ if evt == evcode["DOF_STEP_TRANSX"]:
+ set_prop(14,xstep, DOF_STEP_TRANSX.val)
+
+ if evt == evcode["DOF_MIN_TRANSY"]:
+ set_prop(14, ymin, DOF_MIN_TRANSY.val)
+ if evt == evcode["DOF_MAX_TRANSY"]:
+ set_prop(14,ymax, DOF_MAX_TRANSY.val)
+ if evt == evcode["DOF_STEP_TRANSY"]:
+ set_prop(14,ystep, DOF_STEP_TRANSY.val)
+
+ if evt == evcode["DOF_MIN_TRANSZ"]:
+ set_prop(14, zmin, DOF_MIN_TRANSZ.val)
+ if evt == evcode["DOF_MAX_TRANSZ"]:
+ set_prop(14, zmax, DOF_MAX_TRANSZ.val)
+ if evt == evcode["DOF_STEP_TRANSZ"]:
+ set_prop(14, zstep, DOF_STEP_TRANSZ.val)
+
+ #do rotation buttons
+ if evt == evcode["DOF_MIN_ROTX"]:
+ set_prop(14, pitchmin, DOF_MIN_ROTX.val)
+ if evt == evcode["DOF_MAX_ROTX"]:
+ set_prop(14, pitchmax, DOF_MAX_ROTX.val)
+ if evt == evcode["DOF_STEP_ROTX"]:
+ set_prop(14, pitchstep, DOF_STEP_ROTX.val)
+
+ if evt == evcode["DOF_MIN_ROTY"]:
+ set_prop(14, rollmin, DOF_MIN_ROTY.val)
+ if evt == evcode["DOF_MAX_ROTY"]:
+ set_prop(14, rollmax, DOF_MAX_ROTY.val)
+ if evt == evcode["DOF_STEP_ROTY"]:
+ set_prop(14, rollstep, DOF_STEP_ROTY.val)
+
+ if evt == evcode["DOF_MIN_ROTZ"]:
+ set_prop(14, yawmin, DOF_MIN_ROTZ.val)
+ if evt == evcode["DOF_MAX_ROTZ"]:
+ set_prop(14, yawmax, DOF_MAX_ROTZ.val)
+ if evt == evcode["DOF_STEP_ROTZ"]:
+ set_prop(14, yawstep, DOF_STEP_ROTZ.val)
+
+ #do scale buttons
+ if evt == evcode["DOF_MIN_SCALEX"]:
+ set_prop(14, xscalemin, DOF_MIN_SCALEX.val)
+ if evt == evcode["DOF_MAX_SCALEX"]:
+ set_prop(14, xscalemax, DOF_MAX_SCALEX.val)
+ if evt == evcode["DOF_STEP_SCALEX"]:
+ set_prop(14, xscalestep, DOF_STEP_SCALEX.val)
+
+ if evt == evcode["DOF_MIN_SCALEY"]:
+ set_prop(14, yscalemin, DOF_MIN_SCALEY.val)
+ if evt == evcode["DOF_MAX_SCALEY"]:
+ set_prop(14, yscalemax, DOF_MAX_SCALEY.val)
+ if evt == evcode["DOF_STEP_SCALEY"]:
+ set_prop(14, yscalestep, DOF_STEP_SCALEY.val)
+
+ if evt == evcode["DOF_MIN_SCALEZ"]:
+ set_prop(14, zscalemin, DOF_MIN_SCALEZ.val)
+ if evt == evcode["DOF_MAX_SCALEZ"]:
+ set_prop(14, zscalemax, DOF_MAX_SCALEZ.val)
+ if evt == evcode["DOF_STEP_SCALEZ"]:
+ set_prop(14, zscalestep, DOF_STEP_SCALEZ.val)
+
+
+ Draw.Redraw(1)
+ Blender.Window.RedrawAll()
+
+def draw_propsheet(x,y):
+ #UI buttons
+ global DOF_MAKE
+ global DOF_UPDATE
+ global DOF_DELETE
+
+ global DOF_TRANSX
+ global DOF_TRANSY
+ global DOF_TRANSZ
+ global DOF_ROTX
+ global DOF_ROTY
+ global DOF_ROTZ
+ global DOF_SCALEX
+ global DOF_SCALEY
+ global DOF_SCALEZ
+
+ global DOF_MIN_TRANSX
+ global DOF_MIN_TRANSY
+ global DOF_MIN_TRANSZ
+ global DOF_MIN_ROTX
+ global DOF_MIN_ROTY
+ global DOF_MIN_ROTZ
+ global DOF_MIN_SCALEX
+ global DOF_MIN_SCALEY
+ global DOF_MIN_SCALEZ
+
+ global DOF_MAX_TRANSX
+ global DOF_MAX_TRANSY
+ global DOF_MAX_TRANSZ
+ global DOF_MAX_ROTX
+ global DOF_MAX_ROTY
+ global DOF_MAX_ROTZ
+ global DOF_MAX_SCALEX
+ global DOF_MAX_SCALEY
+ global DOF_MAX_SCALEZ
+
+ global DOF_STEP_TRANSX
+ global DOF_STEP_TRANSY
+ global DOF_STEP_TRANSZ
+ global DOF_STEP_ROTX
+ global DOF_STEP_ROTY
+ global DOF_STEP_ROTZ
+ global DOF_STEP_SCALEX
+ global DOF_STEP_SCALEY
+ global DOF_STEP_SCALEZ
+
+ #labels
+ global DOF_ROTSTRING
+ global DOF_TRANSTRING
+ global DOF_SCALESTRING
+ global DOF_EDITLABEL
+
+ #masks
+ global lockxtrans
+ global lockytrans
+ global lockztrans
+ global lockxrot
+ global lockyrot
+ global lockzrot
+ global lockxscale
+ global lockyscale
+ global lockzscale
+
+ global zmin
+ global zmax
+ global zcur
+ global zstep
+ global ymin
+ global ymax
+ global ycur
+ global ystep
+ global xmin
+ global xmax
+ global xcur
+ global xstep
+ global pitchmin
+ global pitchmax
+ global pitchcur
+ global pitchstep
+ global rollmin
+ global rollmax
+ global rollcur
+ global rollstep
+ global yawmin
+ global yawmax
+ global yawcur
+ global yawstep
+ global zscalemin
+ global zscalemax
+ global zscalecur
+ global zscalestep
+ global yscalemin
+ global yscalemax
+ global yscalecur
+ global yscalestep
+ global xscalemin
+ global xscalemax
+ global xscalecur
+ global xscalestep
+
+
+ global evcode
+
+ state = update_state()
+
+ row_height = 20
+ toggle_width = 50
+ input_width = 100
+ pad = 10
+ origx = x
+ origy = (row_height * 15) + (pad * 15)
+
+
+ #editor label
+ x = origx
+ y = origy
+ #y = y - (row_height + pad)
+ DOF_EDITLABEL = Blender.Draw.Label("FLT Degree of Freedom Editor", x, y, 200, row_height)
+
+
+ #draw Translation limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_TRANSTRING = Blender.Draw.Label("Translation Limits", x, y, input_width, row_height)
+
+
+ #X limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_TRANSX = Blender.Draw.Toggle("LimX", evcode["DOF_TRANSX"], x, y, toggle_width, row_height, get_lockmask(lockxtrans), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_TRANSX = Blender.Draw.Number("MinX", evcode["DOF_MIN_TRANSX"], x, y, input_width, row_height,get_prop(14,xmin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_TRANSX = Blender.Draw.Number("MaxX", evcode["DOF_MAX_TRANSX"], x, y, input_width, row_height,get_prop(14,xmax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_TRANSX = Blender.Draw.Number("StepX", evcode["DOF_STEP_TRANSX"], x, y, input_width, row_height,get_prop(14,xstep), -1000000.0, 1000000.0, "")
+
+ #Y limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_TRANSY = Blender.Draw.Toggle("LimY", evcode["DOF_TRANSY"], x, y, toggle_width, row_height, get_lockmask(lockytrans), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_TRANSY = Blender.Draw.Number("MinY", evcode["DOF_MIN_TRANSY"], x, y, input_width, row_height, get_prop(14,ymin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_TRANSY = Blender.Draw.Number("MaxY", evcode["DOF_MAX_TRANSY"], x, y, input_width, row_height, get_prop(14,ymax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_TRANSY = Blender.Draw.Number("StepY", evcode["DOF_STEP_TRANSY"], x, y, input_width, row_height, get_prop(14,ystep), -1000000.0, 1000000.0, "")
+
+ #Z limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_TRANSZ = Blender.Draw.Toggle("LimZ", evcode["DOF_TRANSZ"], x, y, toggle_width, row_height, get_lockmask(lockztrans), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_TRANSZ = Blender.Draw.Number("MinZ", evcode["DOF_MIN_TRANSZ"], x, y, input_width, row_height, get_prop(14,zmin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_TRANSZ = Blender.Draw.Number("MaxZ", evcode["DOF_MAX_TRANSZ"], x, y, input_width, row_height, get_prop(14,zmax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_TRANSZ = Blender.Draw.Number("StepZ", evcode["DOF_STEP_TRANSZ"], x, y, input_width, row_height, get_prop(14,zstep), -1000000.0, 1000000.0, "")
+
+ #draw Rotation limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_ROTSTRING = Blender.Draw.Label("Rotation Limits", x, y, input_width, row_height)
+
+ #draw Rotation limits
+ #X limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_ROTX = Blender.Draw.Toggle("LimX", evcode["DOF_ROTX"], x, y, toggle_width, row_height, get_lockmask(lockxrot), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_ROTX = Blender.Draw.Number("MinX", evcode["DOF_MIN_ROTX"], x, y, input_width, row_height, get_prop(14,pitchmin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_ROTX = Blender.Draw.Number("MaxX", evcode["DOF_MAX_ROTX"], x, y, input_width, row_height, get_prop(14,pitchmax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_ROTX = Blender.Draw.Number("StepX", evcode["DOF_STEP_ROTX"], x, y, input_width, row_height, get_prop(14,pitchstep), -1000000.0, 1000000.0, "")
+
+ #Y limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_ROTY = Blender.Draw.Toggle("LimY", evcode["DOF_ROTY"], x, y, toggle_width, row_height, get_lockmask(lockyrot), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_ROTY = Blender.Draw.Number("MinY", evcode["DOF_MIN_ROTY"], x, y, input_width, row_height, get_prop(14,rollmin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_ROTY = Blender.Draw.Number("MaxY", evcode["DOF_MAX_ROTY"], x, y, input_width, row_height, get_prop(14,rollmax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_ROTY = Blender.Draw.Number("StepY", evcode["DOF_STEP_ROTY"], x, y, input_width, row_height, get_prop(14,rollstep), -1000000.0, 1000000.0, "")
+
+ #Z limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_ROTZ = Blender.Draw.Toggle("LimZ", evcode["DOF_ROTZ"], x, y, toggle_width, row_height, get_lockmask(lockzrot), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_ROTZ = Blender.Draw.Number("MinZ", evcode["DOF_MIN_ROTZ"], x, y, input_width, row_height, get_prop(14, yawmin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_ROTZ = Blender.Draw.Number("MaxZ", evcode["DOF_MAX_ROTZ"], x, y, input_width, row_height, get_prop(14, yawmax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_ROTZ = Blender.Draw.Number("StepZ", evcode["DOF_STEP_ROTZ"], x, y, input_width, row_height, get_prop(14, yawstep), -1000000.0, 1000000.0, "")
+
+
+ #draw Scale limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_SCALESTRING = Blender.Draw.Label("Scale Limits", x, y, input_width, row_height)
+
+ #draw Scale limits
+ #X limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_SCALEX = Blender.Draw.Toggle("LimX", evcode["DOF_SCALEX"], x, y, toggle_width, row_height, get_lockmask(lockxscale), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_SCALEX = Blender.Draw.Number("MinX", evcode["DOF_MIN_SCALEX"], x, y, input_width, row_height, get_prop(14, xscalemin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_SCALEX = Blender.Draw.Number("MaxX", evcode["DOF_MAX_SCALEX"], x, y, input_width, row_height, get_prop(14, xscalemax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_SCALEX = Blender.Draw.Number("StepX", evcode["DOF_STEP_SCALEX"], x, y, input_width, row_height, get_prop(14, xscalestep), -1000000.0, 1000000.0, "")
+
+ #Y limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_SCALEY = Blender.Draw.Toggle("LimY", evcode["DOF_SCALEY"], x, y, toggle_width, row_height, get_lockmask(lockyscale), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_SCALEY = Blender.Draw.Number("MinY", evcode["DOF_MIN_SCALEY"], x, y, input_width, row_height, get_prop(14, yscalemin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_SCALEY = Blender.Draw.Number("MaxY", evcode["DOF_MAX_SCALEY"], x, y, input_width, row_height, get_prop(14, yscalemax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_SCALEY = Blender.Draw.Number("StepY", evcode["DOF_STEP_SCALEY"], x, y, input_width, row_height, get_prop(14, yscalestep), -1000000.0, 1000000.0, "")
+
+ #Z limits
+ x = origx
+ y = y- (row_height + pad)
+ DOF_SCALEZ = Blender.Draw.Toggle("LimZ", evcode["DOF_SCALEZ"], x, y, toggle_width, row_height, get_lockmask(lockzscale), "")
+ x = x + (toggle_width + pad)
+ DOF_MIN_SCALEZ = Blender.Draw.Number("MinZ", evcode["DOF_MIN_SCALEZ"], x, y, input_width, row_height, get_prop(14, zscalemin), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_MAX_SCALEZ = Blender.Draw.Number("MaxZ", evcode["DOF_MAX_SCALEZ"], x, y, input_width, row_height, get_prop(14, zscalemax), -1000000.0, 1000000.0, "")
+ x = x + (input_width + pad)
+ DOF_STEP_SCALEZ = Blender.Draw.Number("StepZ", evcode["DOF_STEP_SCALEZ"], x, y, input_width, row_height, get_prop(14, zscalestep), -1000000.0, 1000000.0, "")
+
+ #System
+ x = origx
+ y = y - (row_height + (pad)*3)
+ DOF_MAKE = Blender.Draw.PushButton("Make DOF", evcode["DOF_MAKE"], x, y, input_width, row_height, "Make a Dof Node out of Active Object")
+ x = x + (input_width + pad)
+ DOF_UPDATE = Blender.Draw.PushButton("Grab Loc/Rot", evcode["DOF_UPDATE"], x, y, input_width, row_height, "Update the Dof Node position/orientation")
+ x = x + (input_width + pad)
+ DOF_DELETE = Blender.Draw.PushButton("Delete DOF", evcode["DOF_DELETE"], x, y, input_width, row_height, "Delete the Dof Node properties")
+
+
+
+
+def gui():
+ #draw the propsheet/toolbox.
+ psheety = 800
+ #psheetx = psheety + 10
+ draw_propsheet(20,psheety)
+
+Draw.Register(gui,event,but_event)
+ \ No newline at end of file
diff --git a/release/scripts/flt_export.py b/release/scripts/flt_export.py
index 2b9db74c770..c099c8e62d1 100644
--- a/release/scripts/flt_export.py
+++ b/release/scripts/flt_export.py
@@ -525,8 +525,8 @@ class FaceDesc:
def __init__(self):
self.vertex_index_lst = []
self.mface = None
- self.texture_index = -1
- self.material_index = -1
+ self.texture_index = 65535
+ self.material_index = 65535
self.color_index = 127
self.renderstyle = 0
self.twoside = 0
@@ -979,8 +979,14 @@ class FLTNode(Node):
self.header.fw.write_char(0) # Reserved
self.header.fw.write_char(alpha) # Template
self.header.fw.write_short(-1) # Detail tex pat index
- self.header.fw.write_short(face_desc.texture_index) # Tex pattern index
- self.header.fw.write_short(face_desc.material_index) # material index
+ if face_desc.texture_index == -1:
+ self.header.fw.write_ushort(65535)
+ else:
+ self.header.fw.write_ushort(face_desc.texture_index) # Tex pattern index
+ if face_desc.material_index == -1:
+ self.header.fw.write_ushort(65535)
+ else:
+ self.header.fw.write_ushort(face_desc.material_index) # material index
self.header.fw.write_short(0) # SMC code
self.header.fw.write_short(0) # Feature code
self.header.fw.write_int(0) # IR material code
@@ -1015,7 +1021,10 @@ class FLTNode(Node):
self.header.fw.write_ushort(8 + (mtex * 8)) # Length
self.header.fw.write_uint(uvmask) # UV mask
for i in xrange(mtex):
- self.header.fw.write_ushort(face_desc.images[i]) # Tex pattern index
+ if face_desc.images[i] == -1:
+ self.header.fw.write_ushort(65535)
+ else:
+ self.header.fw.write_ushort(face_desc.images[i]) # Tex pattern index
self.header.fw.write_ushort(0) # Tex effect
self.header.fw.write_ushort(0) # Tex Mapping index
self.header.fw.write_ushort(0) # Tex data. User defined
@@ -1070,7 +1079,7 @@ class FLTNode(Node):
if self.opcode == 63 and options.state['externalspath']:
try:
- exportdict['3t200!filename'] = os.path.join(options.state['externalspath'],self.object.DupGroup.name+'.flt')
+ exportdict['3t200!filename'] = os.path.join(options.state['externalspath'],self.object.DupGroup.name+'.flt').replace("\\", "/")
self.header.xrefnames.append(self.object.DupGroup.name)
except:
pass
@@ -1092,7 +1101,7 @@ class FLTNode(Node):
write_prop(self.header.fw,ftype,self.object.properties['FLT']['EXT'][propname],length)
#write extension data
for i in xrange(datalen):
- self.header.fw.write_char(self.object.properties['FLT']['EXT']['data'][i])
+ self.header.fw.write_uchar(struct.unpack('>B', struct.pack('>B', self.object.properties['FLT']['EXT']['data'][i]))[0])
self.write_pop_extension()
@@ -1180,8 +1189,8 @@ class Database(Node):
desc = self.GRR.request_vertex_desc(i)
self.fw.write_short(70) # Vertex with color normal and uv opcode.
self.fw.write_ushort(64) # Length of record
- self.fw.write_ushort(0) # Color name index
- self.fw.write_short(0x20000000) # Flags
+ self.fw.write_ushort(0) # Color name index
+ self.fw.write_short(1 << 14) # Frozen Normal
self.fw.write_double(desc.x)
self.fw.write_double(desc.y)
self.fw.write_double(desc.z)
@@ -1245,7 +1254,7 @@ class Database(Node):
cpalette = defaultp.pal
count = len(cpalette)
for i in xrange(count):
- color = struct.unpack('>BBBB',struct.pack('>I',cpalette[i]))
+ color = struct.unpack('>BBBB',struct.pack('>i',cpalette[i]))
self.fw.write_uchar(color[3]) # alpha
self.fw.write_uchar(color[2]) # b
self.fw.write_uchar(color[1]) # g
diff --git a/release/scripts/flt_lodedit.py b/release/scripts/flt_lodedit.py
new file mode 100644
index 00000000000..58319b9e525
--- /dev/null
+++ b/release/scripts/flt_lodedit.py
@@ -0,0 +1,502 @@
+#!BPY
+
+"""
+Name: 'FLT LOD Editor'
+Blender: 240
+Group: 'Misc'
+Tooltip: 'Level of Detail Edtior for FLT nodes'
+"""
+
+__author__ = "Geoffrey Bantle"
+__version__ = "1.0 11/21/07"
+__email__ = ('scripts', 'Author, ')
+__url__ = ('blender', 'blenderartists.org')
+
+__bpydoc__ ="""\
+This script provides tools for working with OpenFlight databases in Blender. OpenFlight is a
+registered trademark of MultiGen-Paradigm, Inc.
+
+Feature overview and more availible at:
+http://wiki.blender.org/index.php/Scripts/Manual/FLTools
+"""
+
+# --------------------------------------------------------------------------
+# flt_palettemanager.py version 0.1 2005/04/08
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# Copyright (C) 2007: Blender Foundation
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+import Blender.Draw as Draw
+from Blender.BGL import *
+import Blender
+import flt_properties
+reload(flt_properties)
+from flt_properties import *
+
+#event codes
+evcode = {
+ "LOD_MAKE" : 100,
+ "LOD_DELETE" : 101,
+ "LOD_CALC_CENTER" : 102,
+ "LOD_GRAB_CENTER" : 103,
+ "LOD_X" : 104,
+ "LOD_Y" : 105,
+ "LOD_Z" : 106,
+ "LOD_FREEZE" : 107,
+ "LOD_SIG" : 108,
+ "LOD_IN" : 109,
+ "LOD_OUT" : 110,
+ "LOD_TRANS" : 111,
+ "LOD_PREVIOUS" : 112
+}
+
+
+#system
+LOD_MAKE = None #PushButton
+LOD_DELETE = None #PushButton
+LOD_CALC_CENTER = None #PushButton
+LOD_GRAB_CENTER = None #Pushbutton
+LOD_FREEZE = None #Toggle
+LOD_PREVIOUS = None #Toggle
+
+LOD_X = None #Input
+LOD_Y = None #Input
+LOD_Z = None #Input
+
+LOD_SIG = None #Input
+LOD_IN = None #Input
+LOD_OUT = None #Input
+LOD_TRANS = None #Input
+
+#labels
+LOD_EDITLABEL = None
+LOD_SWITCHLABEL = None
+LOD_CENTERLABEL = None
+
+LOD_XLABEL = None
+LOD_YLABEL = None
+LOD_ZLABEL = None
+LOD_SIGLABEL = None
+LOD_INLABEL = None
+LOD_OUTLABEL = None
+LOD_TRANSLABEL = None
+
+
+#ID Props
+switch_in = '5d!switch in'
+switch_out = '6d!switch out'
+xco = '10d!X co'
+yco = '11d!Y co'
+zco = '12d!Z co'
+trans = '13d!Transition'
+sig_size = '14d!Sig Size'
+
+#Flags
+lodflag = '9I!flags'
+previous_mask = (1 << 31)
+freeze_mask = (1 << 29)
+
+def update_state():
+ state = dict()
+ state["activeScene"] = Blender.Scene.GetCurrent()
+ state["activeObject"] = state["activeScene"].objects.active
+ if state["activeObject"] and not state["activeObject"].sel:
+ state["activeObject"] = None
+ state["activeMesh"] = None
+ if state["activeObject"] and state["activeObject"].type == 'Mesh':
+ state["activeMesh"] = state["activeObject"].getData(mesh=True)
+
+ state["activeFace"] = None
+ if state["activeMesh"]:
+ if state["activeMesh"].faceUV and state["activeMesh"].activeFace != None:
+ state["activeFace"] = state["activeMesh"].faces[state["activeMesh"].activeFace]
+
+
+ #update editmode
+ state["editmode"] = Blender.Window.EditMode()
+
+ return state
+
+def idprops_append(object, typecode, props):
+ object.properties["FLT"] = dict()
+ object.properties["FLT"]['type'] = typecode
+ for prop in props:
+ object.properties["FLT"][prop] = props[prop]
+ object.properties["FLT"]['3t8!id'] = object.name
+
+def idprops_kill():
+ state = update_state()
+ if state["activeObject"] and state["activeObject"].properties.has_key('FLT'):
+ state["activeObject"].properties.pop('FLT')
+
+def idprops_copy(source):
+ state = update_state()
+ if source.properties.has_key('FLT'):
+ for object in state["activeScene"].objects:
+ if object.sel and object != source and (state["activeScene"].Layers & object.Layers):
+ idprops_kill(object)
+ object.properties['FLT'] = dict()
+ for key in source.properties['FLT']:
+ object.properties['FLT'][key] = source.properties['FLT'][key]
+
+def select_by_typecode(typecode):
+ state = update_state()
+
+ for object in state["activeScene"].objects:
+ if object.properties.has_key('FLT') and object.properties['FLT']['type'] == typecode and state["activeScene"].Layers & object.Layers:
+ object.select(1)
+
+def idprops_type(object, typecode):
+ if object.properties.has_key('FLT') and object.properties['FLT'].has_key('type') and object.properties['FLT']['type'] == typecode:
+ return True
+ return False
+
+#ui type code
+def get_prop(typecode, prop):
+
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], typecode):
+ props = state["activeObject"].properties['FLT']
+ else:
+ props = flt_properties.FLTLOD
+
+ return props[prop]
+
+def set_prop(typecode, prop, value):
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"],typecode):
+ state["activeObject"].properties['FLT'][prop] = value
+
+
+
+def get_lockmask(mask):
+ global lodflag
+ state = update_state()
+ if state["activeObject"]:
+ flag = get_prop(73,lodflag)
+ if flag & mask:
+ return True
+ return False
+
+def set_lockmask(mask):
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], 73):
+ oldvalue = state["activeObject"].properties['FLT'][lodflag]
+ oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0]
+ oldvalue |= mask
+ state["activeObject"].properties['FLT'][lodflag] = struct.unpack('>i', struct.pack(">I", oldvalue))[0]
+
+def clear_lockmask(mask):
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], 73):
+ oldvalue = state["activeObject"].properties['FLT'][lodflag]
+ oldvalue = struct.unpack('>I', struct.pack('>i', oldvalue))[0]
+ oldvalue &= ~mask
+ state["activeObject"].properties['FLT'][lodflag] = struct.unpack('>i',struct.pack('>I',oldvalue))[0]
+
+def findchildren(object):
+ state = update_state()
+ children = list()
+ for candidate in state["activeScene"].objects:
+ if candidate.parent == object:
+ children.append(candidate)
+ retlist = list(children)
+ for child in children:
+ retlist = retlist + findchildren(child)
+ return retlist
+
+def get_object_center(object):
+ bbox = object.getBoundBox(1)
+ average = Blender.Mathutils.Vector(0.0, 0.0, 0.0)
+
+ for point in bbox:
+ average[0] += point[0]
+ average[1] += point[1]
+ average[2] += point[2]
+
+ average[0] = average[0] / 8.0
+ average[1] = average[1] / 8.0
+ average[2] = average[2] / 8.0
+
+ return average
+
+
+def calc_center():
+
+ global xco
+ global yco
+ global zco
+
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], 73):
+ average = Blender.Mathutils.Vector(0.0, 0.0, 0.0)
+ children = findchildren(state["activeObject"]) #get children objects
+ if children:
+ for child in children:
+ center = get_object_center(child)
+ average[0] += center[0]
+ average[1] += center[1]
+ average[2] += center[2]
+
+ average[0] = average[0] / len(children)
+ average[1] = average[1] / len(children)
+ average[2] = average[2] / len(children)
+
+ set_prop(73, xco, average[0])
+ set_prop(73, yco, average[1])
+ set_prop(73, zco, average[2])
+
+
+def grab_center():
+
+ global xco
+ global yco
+ global zco
+
+ state = update_state()
+ if state["activeObject"] and idprops_type(state["activeObject"], 73):
+ center = Blender.Window.GetCursorPos()
+
+ set_prop(73, xco, center[0])
+ set_prop(73, yco, center[1])
+ set_prop(73, zco, center[2])
+
+
+def create_lod():
+ state = update_state()
+ actobj = state["activeObject"]
+ if actobj and not idprops_type(actobj, 73):
+ idprops_kill()
+ idprops_append(actobj,73, flt_properties.FLTLOD)
+ calc_center()
+
+
+
+def event(evt,val):
+ if evt == Draw.ESCKEY:
+ Draw.Exit()
+
+def but_event(evt):
+
+ global LOD_MAKE
+ global LOD_DELETE
+ global LOD_CALC_CENTER
+ global LOD_GRAB_CENTER
+ global LOD_FREEZE
+ global LOD_PREVIOUS
+ global LOD_X
+ global LOD_Y
+ global LOD_Z
+ global LOD_SIG
+ global LOD_IN
+ global LOD_OUT
+ global LOD_TRANS
+
+ global switch_in
+ global switch_out
+ global xco
+ global yco
+ global zco
+ global trans
+ global sig_size
+
+ global lodflag
+ global previous_mask
+ global freeze_mask
+
+ global evcode
+
+ #do "system" events
+ if evt == evcode["LOD_MAKE"]:
+ create_lod()
+
+ if evt == evcode["LOD_CALC_CENTER"]:
+ calc_center()
+
+ if evt == evcode["LOD_DELETE"]:
+ idprops_kill()
+
+ if evt == evcode["LOD_GRAB_CENTER"]:
+ grab_center()
+
+ #do mask events
+ if evt == evcode["LOD_FREEZE"]:
+ if LOD_FREEZE.val == True:
+ set_lockmask(freeze_mask)
+ else:
+ clear_lockmask(freeze_mask)
+
+ if evt == evcode["LOD_PREVIOUS"]:
+ if LOD_PREVIOUS.val == True:
+ set_lockmask(previous_mask)
+ else:
+ clear_lockmask(previous_mask)
+
+ #do input events
+ if evt == evcode["LOD_X"]:
+ set_prop(73, xco, LOD_X.val)
+ if evt == evcode["LOD_Y"]:
+ set_prop(73, yco, LOD_Y.val)
+ if evt == evcode["LOD_Z"]:
+ set_prop(73, zco, LOD_Z.val)
+ if evt == evcode["LOD_SIG"]:
+ set_prop(73, sig_size, LOD_SIG.val)
+ if evt == evcode["LOD_IN"]:
+ set_prop(73, switch_in, LOD_IN.val)
+ if evt == evcode["LOD_OUT"]:
+ set_prop(73, switch_out, LOD_OUT.val)
+ if evt == evcode["LOD_TRANS"]:
+ set_prop(73, trans, LOD_TRANS.val)
+
+
+ Draw.Redraw(1)
+ Blender.Window.RedrawAll()
+
+def draw_propsheet(x,y):
+
+ global LOD_MAKE
+ global LOD_DELETE
+ global LOD_CALC_CENTER
+ global LOD_GRAB_CENTER
+ global LOD_FREEZE
+ global LOD_PREVIOUS
+ global LOD_X
+ global LOD_Y
+ global LOD_Z
+ global LOD_SIG
+ global LOD_IN
+ global LOD_OUT
+ global LOD_TRANS
+
+ #labels
+ global LOD_EDITLABEL
+ global LOD_SWITCHLABEL
+ global LOD_CENTERLABEL
+ global LOD_XLABEL
+ global LOD_YLABEL
+ global LOD_ZLABEL
+ global LOD_SIGLABEL
+ global LOD_INLABEL
+ global LOD_OUTLABEL
+ global LOD_TRANSLABEL
+
+
+ global switch_in
+ global switch_out
+ global xco
+ global yco
+ global zco
+ global trans
+ global sig_size
+
+ global lodflag
+ global previous_mask
+ global freeze_mask
+
+ global evcode
+
+
+ global evcode
+
+ state = update_state()
+
+ label_width = 100
+ row_height = 20
+ toggle_width = 50
+ input_width = 100
+ pad = 10
+ origx = x
+ origy = (row_height * 16) + (pad * 16)
+
+
+ #editor label
+ x = origx
+ y = origy
+ LOD_EDITLABEL = Blender.Draw.Label("FLT Level of Detail Editor", x, y, 250, row_height)
+
+
+ #Center inputs
+ x = origx
+ y = y- (row_height + pad)
+ LOD_CENTERLABEL = Blender.Draw.Label("LOD center", x, y, label_width, row_height)
+ y = y- (row_height + pad)
+ LOD_XLABEL = Blender.Draw.Label("X Coordinate", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_X = Blender.Draw.Number("", evcode["LOD_X"], x, y, input_width, row_height,get_prop(73,xco), -1000000.0, 1000000.0, "")
+ x = origx
+ y = y- (row_height + pad)
+ LOD_YLABEL = Blender.Draw.Label("Y Coordinate", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_Y = Blender.Draw.Number("", evcode["LOD_Y"], x, y, input_width, row_height,get_prop(73,yco), -1000000.0, 1000000.0, "")
+ x = origx
+ y = y- (row_height + pad)
+ LOD_ZLABEL = Blender.Draw.Label("Z Coordinate", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_Z = Blender.Draw.Number("", evcode["LOD_Z"], x, y, input_width, row_height,get_prop(73,zco), -1000000.0, 1000000.0, "")
+
+
+ #Switch inputs
+ x = origx
+ y = y- (row_height + pad)
+ LOD_SWITCHLABEL = Blender.Draw.Label("Switch Settings", x, y, input_width, row_height)
+ y = y- (row_height + pad)
+ LOD_SIGLABEL = Blender.Draw.Label("Significant Size", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_SIG = Blender.Draw.Number("", evcode["LOD_SIG"], x, y, input_width, row_height, get_prop(73,sig_size), -1000000.0, 1000000.0, "")
+ x = origx
+ y = y- (row_height + pad)
+ LOD_INLABEL = Blender.Draw.Label("Switch In", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_IN = Blender.Draw.Number("", evcode["LOD_IN"], x, y, input_width, row_height, get_prop(73,switch_in), -1000000.0, 1000000.0, "")
+ x = origx
+ y = y- (row_height + pad)
+ LOD_OUTLABEL = Blender.Draw.Label("Switch Out", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_OUT = Blender.Draw.Number("", evcode["LOD_OUT"], x, y, input_width, row_height, get_prop(73,switch_out), -1000000.0, 1000000.0, "")
+ x = origx
+ y = y- (row_height + pad)
+ LOD_TRANSLABEL = Blender.Draw.Label("Transition", x, y, label_width, row_height)
+ x = origx + (label_width + pad)
+ LOD_TRANS = Blender.Draw.Number("", evcode["LOD_TRANS"], x, y, input_width, row_height, get_prop(73,trans), -1000000.0, 1000000.0, "")
+
+
+ x = origx
+ y = y - (row_height + pad)
+ LOD_MAKE = Blender.Draw.PushButton("Make LOD", evcode["LOD_MAKE"], x, y, input_width + label_width + pad, row_height, "Make a LOD Node out of Active Object")
+ y = y - (row_height + pad)
+ LOD_DELETE = Blender.Draw.PushButton("Delete LOD", evcode["LOD_DELETE"], x, y, input_width + label_width + pad, row_height, "Delete the LOD Node properties")
+ y = y - (row_height + pad)
+ LOD_CALC_CENTER = Blender.Draw.PushButton("Calculate Center", evcode["LOD_CALC_CENTER"], x, y, input_width + label_width + pad, row_height, "Calculate the center of this LOD")
+ y = y - (row_height + pad)
+ LOD_GRAB_CENTER = Blender.Draw.PushButton("Grab Center", evcode["LOD_GRAB_CENTER"], x, y, input_width + label_width + pad, row_height, "Grab center from 3d cursor")
+ y = y - (row_height + pad)
+ LOD_FREEZE = Blender.Draw.Toggle("Freeze Center", evcode["LOD_FREEZE"], x, y, input_width + label_width + pad, row_height, get_lockmask(freeze_mask), "")
+ y = y - (row_height + pad)
+ LOD_PREVIOUS = Blender.Draw.Toggle("Previous Range", evcode["LOD_PREVIOUS"], x, y, input_width + label_width + pad, row_height, get_lockmask(previous_mask), "")
+
+def gui():
+ #draw the propsheet/toolbox.
+ psheety = 800
+ #psheetx = psheety + 10
+ draw_propsheet(20,psheety)
+
+Draw.Register(gui,event,but_event)
+ \ No newline at end of file
diff --git a/release/scripts/flt_palettemanager.py b/release/scripts/flt_palettemanager.py
index 6edaf2974ab..c2f1380a6fa 100644
--- a/release/scripts/flt_palettemanager.py
+++ b/release/scripts/flt_palettemanager.py
@@ -25,7 +25,7 @@ http://wiki.blender.org/index.php/Scripts/Manual/FLTools
"""
# --------------------------------------------------------------------------
-# flt_palettemanager.py version 0.1 2005/04/08
+# flt_palettemanager.py version 1.0 2005/04/08
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -55,6 +55,75 @@ import flt_properties
import flt_defaultp as defaultp
from flt_properties import *
+def RGBtoHSV( r, g, b):
+ minc = min( r, g, b )
+ maxc = max( r, g, b )
+ v = maxc
+
+ delta = maxc - minc
+
+ if( max != 0 ):
+ s = delta / maxc
+ else:
+ s = 0
+ h = -1
+ return (h,s,v)
+
+ if( r == maxc ):
+ h = ( g - b ) / delta
+ elif( g == maxc ):
+ h = 2 + ( b - r ) / delta
+ else:
+ h = 4 + ( r - g ) / delta
+
+ h *= 60
+ if( h < 0 ):
+ h += 360
+
+ return(h,s,v)
+
+def HSVtoRGB(h,s,v):
+
+ if( s == 0 ):
+ return (v,v,v)
+
+
+ h /= 60
+ i = math.floor( h)
+ f = h - i
+ p = v * ( 1 - s )
+ q = v * ( 1 - s * f )
+ t = v * ( 1 - s * ( 1 - f ) )
+
+ if i == 0:
+ r = v
+ g = t
+ b = p
+ elif i == 1:
+ r = q
+ g = v
+ b = p
+
+ elif i== 2:
+ r = p
+ g = v
+ b = t
+ elif i==3:
+ r = p
+ g = q
+ b = v
+ elif i==4:
+ r = t
+ g = p
+ b = v
+
+ else:
+ r = v
+ g = p
+ b = q
+
+ return(r,g,b)
+
palette_size = 12
palette_x = 0
@@ -68,6 +137,14 @@ cinc = 1.0 / 1024.0
cstep = 0.0
picker = None
ptt = ""
+
+
+ts1=None
+ts2=None
+ts3=None
+ts4=None
+ts5=None
+
for i in xrange(1024):
colors.append([cstep,cstep,cstep])
cstep = cstep + cinc
@@ -128,7 +205,7 @@ def event(evt,val):
Draw.Redraw(1)
#copy current color and intensity to selected faces.
- elif evt == Draw.CKEY:
+ elif evt == Draw.VKEY:
if Blender.Window.EditMode():
Blender.Window.EditMode(0)
@@ -136,7 +213,7 @@ def event(evt,val):
state = update_state()
#retrieve color from palette
- color = struct.unpack('>BBBB',struct.pack('>I',colors[curswatch]))
+ color = struct.unpack('>BBBB',struct.pack('>i',colors[curswatch]))
actmesh = state["activeMesh"]
if actmesh:
if(Blender.Window.GetKeyQualifiers() != Blender.Window.Qual["CTRL"]):
@@ -182,7 +259,7 @@ def event(evt,val):
Blender.Window.RedrawAll()
#grab color and intensity from active face
- elif evt == Draw.VKEY:
+ elif evt == Draw.CKEY:
if Blender.Window.EditMode():
Blender.Window.EditMode(0)
editmode = 1
@@ -211,6 +288,23 @@ def event(evt,val):
Blender.Window.EditMode(1)
Blender.Window.RedrawAll()
+
+ elif evt == Draw.GKEY:
+ if Blender.Window.EditMode():
+ Blender.Window.EditMode(0)
+ editmode =1
+ state = update_state()
+
+ actmesh = state["activeMesh"]
+ activeFace = state["activeFace"]
+
+ if activeFace and "FLT_COL" in actmesh.faces.properties:
+ (index,intensity) = unpack_face_index(activeFace.getProperty("FLT_COL"))
+ for face in actmesh.faces:
+ (index2, intensity2) = unpack_face_index(face.getProperty("FLT_COL"))
+ if index == index2:
+ face.sel = 1
+
elif evt == Draw.ESCKEY:
Draw.Exit()
@@ -225,11 +319,11 @@ def update_all():
for object in state["activeScene"].objects:
if object.type == "Mesh":
mesh = object.getData(mesh=True)
- if 'FLT_COL' in mesh.faces.properties:
+ if 'FLT_COL' in mesh.faces.properties and "FLT_Fcol" in mesh.getColorLayerNames():
mesh.activeColorLayer = "FLT_Fcol"
for face in mesh.faces:
(index,intensity) = unpack_face_index(face.getProperty('FLT_COL'))
- color = struct.unpack('>BBBB',struct.pack('>I',colors[index]))
+ color = struct.unpack('>BBBB',struct.pack('>i',colors[index]))
#update the vertex colors for this face
for col in face.col:
col.r = int(color[0] * intensity)
@@ -284,8 +378,13 @@ def draw_palette():
global colors
global curint
global curswatch
- global picker
-
+ global picker
+ global ts1
+ global ts2
+ global ts3
+ global ts4
+ global ts5
+
state = update_state()
init_pal()
@@ -297,7 +396,7 @@ def draw_palette():
for x in xrange(32):
ypos = palette_y
for y in xrange(32):
- color = struct.unpack('>BBBB',struct.pack('>I',colors[cid]))
+ color = struct.unpack('>BBBB',struct.pack('>i',colors[cid]))
glColor3f(color[0]/255.0,color[1]/255.0,color[2]/255.0)
glBegin(GL_POLYGON)
glVertex2i(xpos,ypos)
@@ -328,7 +427,7 @@ def draw_palette():
xpos = xpos + ssize
#draw intensity gradient
- color = struct.unpack('>BBBB',struct.pack('>I',colors[curswatch]))
+ color = struct.unpack('>BBBB',struct.pack('>i',colors[curswatch]))
color = [color[0]/255.0,color[1]/255.0,color[2]/255.0]
colsteps = [color[0]/255.0,color[1]/255.0,color[2]/255.0]
stripwidth = (palette_size * 32.0) / 256
@@ -355,15 +454,15 @@ def draw_palette():
xpos = ((palette_size*32) * (1.0 - curint)) + palette_x
glColor3f(1.0,1.0,1.0)
glBegin(GL_LINE_LOOP)
- glVertex2i(xpos-6,grady-1)
- glVertex2i(xpos+6,grady-1)
- glVertex2i(xpos+6,grady+palette_size+1)
- glVertex2i(xpos-6,grady+palette_size+1)
+ glVertex2i(int(xpos-6),int(grady-1))
+ glVertex2i(int(xpos+6),int(grady-1))
+ glVertex2i(int(xpos+6),int(grady+palette_size+1))
+ glVertex2i(int(xpos-6),int(grady+palette_size+1))
#glVertex2i(xpos-6,grady+7)
glEnd()
#draw color picker
- color = struct.unpack('>BBBB',struct.pack('>I',colors[curswatch]))
+ color = struct.unpack('>BBBB',struct.pack('>i',colors[curswatch]))
pickcol = (color[0]/255.0,color[1]/255.0,color[2]/255.0)
picker = Blender.Draw.ColorPicker(1,highlight[0][0]+1,highlight[0][1]+1,ssize-2,ssize-2,pickcol,ptt)
@@ -377,6 +476,24 @@ def draw_palette():
glVertex2i(highlight[0][0],highlight[0][1])
glEnd()
+ #draw text string explanations
+ xpos = palette_size*32+20
+ ypos = palette_size*32+10
+ glRasterPos2d(xpos,ypos)
+ ts1 = Blender.Draw.Text("FLT Palette Manager V 1.0")
+ ypos = ypos - 20
+ glRasterPos2d(xpos,ypos)
+ ts3 = Blender.Draw.Text("CKEY - Copy Active Face Color*")
+ ypos = ypos - 20
+ glRasterPos2d(xpos,ypos)
+ ts2 = Blender.Draw.Text("VKEY - Paste Color to Selected Faces")
+ ypos = ypos - 20
+ glRasterPos2d(xpos,ypos)
+ ts4 = Blender.Draw.Text("GKEY - Select Faces With Same Color")
+ ypos = ypos - 15
+ glRasterPos2d(xpos,ypos)
+ ts5 = Blender.Draw.Text("(*Requires mesh with UV coordinates)", 'small')
+
def gui():
glClearColor(0.5,0.5,0.5,1.0)
glClear(GL_COLOR_BUFFER_BIT)
@@ -385,4 +502,4 @@ def gui():
init_pal()
Draw.Register(gui,event,but_event)
-
+ \ No newline at end of file
diff --git a/release/scripts/flt_properties.py b/release/scripts/flt_properties.py
index bc7c972ca66..4c841e9c0c0 100644
--- a/release/scripts/flt_properties.py
+++ b/release/scripts/flt_properties.py
@@ -197,7 +197,10 @@ def write_prop(fw,type,value,length):
elif type == 'i':
fw.write_int(value)
elif type == 'I':
- fw.write_uint(value)
+ #NOTE!:
+ #there is no unsigned int type in python, but we can only store signed ints in ID props
+ newvalue = struct.unpack('>I', struct.pack('>i', value))[0]
+ fw.write_uint(newvalue)
elif type == 'd':
fw.write_double(value)
elif type == 'f':
@@ -267,16 +270,16 @@ FLTObjectDisplay = [10]
FLTLOD = {
'3t8!id' : 'L',
'4i!reserved' : 0,
- '5d!switch in' : 0,
- '6d!switch out' : 0,
+ '5d!switch in' : 0.0,
+ '6d!switch out' : 0.0,
'7s!sfx ID1' : 0,
'8s!sfx ID2' : 0,
'9I!flags' : 0,
- '10d!X co' : 0,
- '11d!Y co' : 0,
- '12d!Z co' : 0,
- '13d!Transition' : 0,
- '14d!Sig Size' : 0
+ '10d!X co' : 0.0,
+ '11d!Y co' : 0.0,
+ '12d!Z co' : 0.0,
+ '13d!Transition' : 0.0,
+ '14d!Sig Size' : 0.0
}
FLTLODDisplay = [4]
diff --git a/release/scripts/import_dxf.py b/release/scripts/import_dxf.py
index ce7df610d98..bb0119a9a81 100644
--- a/release/scripts/import_dxf.py
+++ b/release/scripts/import_dxf.py
@@ -2,15 +2,15 @@
"""
Name: 'Autodesk DXF (.dxf)'
-Blender: 244
+Blender: 246
Group: 'Import'
Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).'
"""
__author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
-__version__ = '1.0.12 - 2008.06.05 by migius'
+__version__ = '1.12 - 2008.08.03 by migius'
__url__ = ["http://blenderartists.org/forum/showthread.php?t=84319",
"http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"]
-__email__ = ["Kitsune_e(at)yahoo.com", "migius(at)4d-vectors.de"]
+__email__ = ["migius(at)4d-vectors.de","Kitsune_e(at)yahoo.com"]
__bpydoc__ = """\
This script imports objects from DXF (2d/3d) into Blender.
@@ -19,7 +19,7 @@ Supported DXF format versions: from (r2.5) r12 up to 2008.
Enhanced features are:
- configurable object filtering and geometry manipulation,
- configurable material pre-processing,
-- DXF-data analyze and raporting.
+- DXF-code analyze and reporting.
Supported DXF r12 objects:
LINE,
@@ -41,10 +41,10 @@ XREF (External Reference).
Supported DXF>r12 objects:
ELLIPSE,
-LWPOLYLINE (LightWeight Polylines),
-(wip v1.0.12) SPLINE,
-(wip v1.0.13) MLINE,
-(wip v1.0.13) MTEXT
+LWPOLYLINE (LightWeight Polyline),
+SPLINE,
+(wip v1.13) MLINE,
+(wip v1.13) MTEXT
Unsupported objects:
DXF r12: DIMENSION.
@@ -60,7 +60,7 @@ Supported layout modes:
Supported scene definition objescts produced with AVE_RENDER:
scene: selection of lights assigned to the camera,
lights: DIRECT, OVERHEAD, SH_SPOT,
-(wip v1.0.13 import of AVE_RENDER material definitions)
+(wip v1.13 import of AVE_RENDER material definitions)
Hierarchy:
Entire DXF BLOCK hierarchy is preserved after import into Blender
@@ -73,7 +73,7 @@ thickness,
width,
color,
layer,
-(wip v1.0.12: XDATA, grouped status)
+(wip v1.13: XDATA, grouped status)
It is recommended to use DXF-object properties for assign Blender materials.
Notes:
@@ -88,7 +88,7 @@ in creating new objects in scene database - probably a database management probl
"""
History:
- v1.0 - 2008.01. by migius
+ v1.0 - 2007/2008 by migius
planned tasks:
-- (to see more, search for "--todo--" in script code)
-- command-line-mode/batch-mode
@@ -109,9 +109,22 @@ History:
-- bug: Registry recall from hd_cache ?? only win32 bug??
-- support DXF-definitions of scene, lights and cameras
-- support ortho mode for VIEWs and VPORTs as cameras
- -- add support for SPLINEs
- v1.0.12: 2008.06.05 by migius
+
+ v1.12 - 2008.08.03 by migius
+ c2 warningfix: relocating of globals: layersmap, oblist
+ c2 modif UI: buttons newScene+targetLayer moved to start panel
+ v1.12 - 2008.07.04 by migius
+ c1 added control Curve's OrderU parameter
+ c1 modif UI: preset buttons X-2D-3D moved to start panel
+ b6 added handling exception of not registered LAYERs (Hammer-HL-editor DXF output)
+ b5 rebuild UI: global preset 2D for Curve-Import
+ b5 added UI-options: PL-MESH N+N plmesh_flip and normals_out
+ b5 added support for SPLINEs, added control OrderU parameter
+ b5 rewrote draw module for NURBS_curve and Bezier_curve
+ v1.12 - 2008.06.22 by migius
+ b4 change versioning system 1.0.12 -> 1.12
+ b4 print at start version-info to console
b3 bugfix: ob.name conflict with existing meshes (different ob.name/mesh.name)
v1.0.12: 2008.05.24 by migius
b2 added support for LWPOLYLINEs
@@ -310,16 +323,16 @@ except ImportError:
#print 'psyco not imported'
pass
-print '\n\n\n\n'
-print 'DXF-Importer *** start ***' #---------------------
+#try: Curve.orderU
+
+print '\n\n\n'
+print 'DXF-Importer v%s *** start ***' %(__version__) #---------------------
SCENE = None
WORLDX = Mathutils.Vector((1,0,0))
WORLDY = Mathutils.Vector((1,1,0))
WORLDZ = Mathutils.Vector((0,0,1))
-oblist = [] #to be sure, it is an empty list
-
G_SCALE = 1.0 #(0.0001-1000) global scaling factor for all dxf data
G_ORIGIN_X = 0.0 #global translation-vector (x,y,z) in DXF units
G_ORIGIN_Y = 0.0
@@ -335,12 +348,15 @@ MIN_WIDTH = MIN_DIST * 10.0 #minimal width by forced width
TRIM_LIMIT = 3.0 #limit for triming of polylines-wide-segments (values:0.0 - 5.0)
ELEVATION = 0.0 #standard elevation = coordinate Z
-TARGET_LAYER = 3 #target blender_layer
-GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-group
-cur_COUNTER = 0 #counter for progress_bar
-M_OBJ = False
BYBLOCK = 0
BYLAYER = 256
+TARGET_LAYER = 3 #target blender_layer
+GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-group
+LAYER_DEF_NAME = 'AAAA' #default layer name
+LAYER_DEF_COLOR = 4 #default layer color
+E_M = 0
+LAB = "*) parts under construction"
+M_OBJ = 0
FILENAME_MAX = 180 #max length of path+file_name string (FILE_MAXDIR + FILE_MAXFILE)
MAX_NAMELENGTH = 17 #max_effective_obnamelength in blender =21=17+(.001)
@@ -366,27 +382,27 @@ class View: #-----------------------------------------------------------------
self.type = obj.type
self.name = obj.get_type(2)[0]
- self.data = obj.data[:]
+# self.data = obj.data[:]
- self.centerX = getit(obj.data, 10, 0.0) #view center pointX (in DCS)
- self.centerY = getit(obj.data, 20, 0.0) #view center pointY (in DCS)
+ self.centerX = getit(obj, 10, 0.0) #view center pointX (in DCS)
+ self.centerY = getit(obj, 20, 0.0) #view center pointY (in DCS)
self.height = obj.get_type(40)[0] #view height (in DCS)
self.width = obj.get_type(41)[0] #view width (in DCS)
self.dir = [0,0,0]
- self.dir[0] = getit(obj.data, 11, 0.0) #view directionX from target (in WCS)
- self.dir[1] = getit(obj.data, 21, 0.0) #
- self.dir[2] = getit(obj.data, 31, 0.0) #
+ self.dir[0] = getit(obj, 11, 0.0) #view directionX from target (in WCS)
+ self.dir[1] = getit(obj, 21, 0.0) #
+ self.dir[2] = getit(obj, 31, 0.0) #
self.target = [0,0,0]
- self.target[0] = getit(obj.data, 12, 0.0) #target pointX(in WCS)
- self.target[1] = getit(obj.data, 22, 0.0) #
- self.target[2] = getit(obj.data, 32, 0.0) #
+ self.target[0] = getit(obj, 12, 0.0) #target pointX(in WCS)
+ self.target[1] = getit(obj, 22, 0.0) #
+ self.target[2] = getit(obj, 32, 0.0) #
self.length = obj.get_type(42)[0] #Lens length
- self.clip_front = getit(obj.data, 43) #Front clipping plane (offset from target point)
- self.clip_back = getit(obj.data, 44) #Back clipping plane (offset from target point)
+ self.clip_front = getit(obj, 43) #Front clipping plane (offset from target point)
+ self.clip_back = getit(obj, 44) #Back clipping plane (offset from target point)
self.twist = obj.get_type(50)[0] #view twist angle in degrees
self.flags = getit(obj, 70, 0)
@@ -450,28 +466,28 @@ class Vport: #-----------------------------------------------------------------
self.type = obj.type
self.name = obj.get_type(2)[0]
- self.data = obj.data[:]
+# self.data = obj.data[:]
#print 'deb:vport name, data:', self.name #-------
#print 'deb:vport data:', self.data #-------
self.height = obj.get_type(40)[0] #vport height (in DCS)
- self.centerX = getit(obj.data, 12, 0.0) #vport center pointX (in DCS)
- self.centerY = getit(obj.data, 22, 0.0) #vport center pointY (in DCS)
+ self.centerX = getit(obj, 12, 0.0) #vport center pointX (in DCS)
+ self.centerY = getit(obj, 22, 0.0) #vport center pointY (in DCS)
self.width = self.height * obj.get_type(41)[0] #vport aspect ratio - width (in DCS)
self.dir = [0,0,0]
- self.dir[0] = getit(obj.data, 16, 0.0) #vport directionX from target (in WCS)
- self.dir[1] = getit(obj.data, 26, 0.0) #
- self.dir[2] = getit(obj.data, 36, 0.0) #
+ self.dir[0] = getit(obj, 16, 0.0) #vport directionX from target (in WCS)
+ self.dir[1] = getit(obj, 26, 0.0) #
+ self.dir[2] = getit(obj, 36, 0.0) #
self.target = [0,0,0]
- self.target[0] = getit(obj.data, 17, 0.0) #target pointX(in WCS)
- self.target[1] = getit(obj.data, 27, 0.0) #
- self.target[2] = getit(obj.data, 37, 0.0) #
+ self.target[0] = getit(obj, 17, 0.0) #target pointX(in WCS)
+ self.target[1] = getit(obj, 27, 0.0) #
+ self.target[2] = getit(obj, 37, 0.0) #
self.length = obj.get_type(42)[0] #Lens length
- self.clip_front = getit(obj.data, 43) #Front clipping plane (offset from target point)
- self.clip_back = getit(obj.data, 44) #Back clipping plane (offset from target point)
+ self.clip_front = getit(obj, 43) #Front clipping plane (offset from target point)
+ self.clip_back = getit(obj, 44) #Back clipping plane (offset from target point)
self.twist = obj.get_type(51)[0] #view twist angle
self.flags = getit(obj, 70, 0)
@@ -528,29 +544,36 @@ class Layer: #-----------------------------------------------------------------
"""Class for objects representing dxf LAYERs.
"""
def __init__(self, obj, name=None, color=None, frozen=None):
- """Expects an object of type layer as input.
+ """Expects an dxfobject of type layer as input.
+ if no dxfobject - creates surogate layer with default parameters
"""
- self.type = obj.type
- self.data = obj.data[:]
-
- if name:
- self.name = name
- #self.bfname = name #--todo---see layernamesmap in f_getLayersmap ---
- else:
- self.name = obj.get_type(2)[0] #layer name of object
-
- if color:
- self.color = color
- else:
- self.color = obj.get_type(62)[0] #color of object
-
- if frozen:
- self.frozen = frozen
- else:
- self.flags = obj.get_type(70)[0]
- self.frozen = self.flags & 1
-
+ if obj==None:
+ self.type = 'layer'
+ if name: self.name = name
+ else: self.name = LAYER_DEF_NAME
+
+ if color: self.color = color
+ else: self.color = LAYER_DEF_COLOR
+
+ if frozen!=None: self.frozen = frozen
+ else: self.frozen = 0
+ else:
+ if obj.type=='layer':
+ self.type = obj.type
+ #self.data = obj.data[:]
+ if name: self.name = name
+ #self.bfname = name #--todo---see layernamesmap in f_getLayersmap ---
+ else: self.name = obj.get_type(2)[0] #layer name of object
+
+ if color: self.color = color
+ else: self.color = obj.get_type(62)[0] #color of object
+
+ if frozen!=None: self.frozen = frozen
+ else:
+ self.flags = obj.get_type(70)[0]
+ self.frozen = self.flags & 1
+
def __repr__(self):
return "%s: name - %s, color - %s" %(self.__class__.__name__, self.name, self.color)
@@ -615,15 +638,15 @@ class Solid: #-----------------------------------------------------------------
raise TypeError, "Wrong type \'%s\' for solid/trace object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
self.space = getit(obj, 67, 0)
self.thic = getit(obj, 39, 0)
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.extrusion = get_extrusion(obj.data)
- self.points = self.get_points(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.extrusion = get_extrusion(obj)
+ self.points = self.get_points(obj)
@@ -736,16 +759,16 @@ class Line: #-----------------------------------------------------------------
if not obj.type == 'line':
raise TypeError, "Wrong type \'%s\' for line object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
self.space = getit(obj, 67, 0)
self.thic = getit(obj, 39, 0)
#print 'deb:self.thic: ', self.thic #---------------------
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.extrusion = get_extrusion(obj.data)
- self.points = self.get_points(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.extrusion = get_extrusion(obj)
+ self.points = self.get_points(obj)
def get_points(self, data):
@@ -883,16 +906,16 @@ class Point: #-----------------------------------------------------------------
if not obj.type == 'point':
raise TypeError, "Wrong type %s for point object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
self.space = getit(obj, 67, 0)
self.thic = getit(obj, 39, 0)
#print 'deb:self.thic: ', self.thic #---------------------
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.extrusion = get_extrusion(obj.data)
- self.points = self.get_points(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.extrusion = get_extrusion(obj)
+ self.points = self.get_points(obj)
def get_points(self, data):
@@ -922,7 +945,7 @@ class Point: #-----------------------------------------------------------------
thic = settings.var['thick_min']
if thic < settings.var['dist_min']: thic = settings.var['dist_min']
- if True: #--todo-- points_as in [1,3,4,5]:
+ if points_as in [1,3,4,5]:
if True: # points_as in [1,5]: # as 'empty'
c = 'Empty'
elif points_as == 3: # as 'thin sphere'
@@ -969,11 +992,8 @@ class Polyline: #--------------------------------------------------------------
if not obj.type == 'polyline':
raise TypeError, "Wrong type %s for polyline object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
- #print 'deb:polyline.obj.data[:]:\n', obj.data[:] #------------------------
- self.points = []
+# self.data = obj.data[:]
- # optional data (with defaults)
self.space = getit(obj, 67, 0)
self.elevation = getit(obj, 30, 0)
#print 'deb:elevation: ', self.elevation #---------------
@@ -983,7 +1003,7 @@ class Polyline: #--------------------------------------------------------------
self.flags = getit(obj, 70, 0)
self.closed = self.flags & 1 # closed in the M direction
self.curved = self.flags & 2 # Bezier-curve-fit vertices have been added
- self.spline = self.flags & 4 # Bspline-fit vertices have been added
+ self.spline = self.flags & 4 # NURBS-curve-fit vertices have been added
self.poly3d = self.flags & 8 # 3D-polyline
self.plmesh = self.flags & 16 # 3D-polygon mesh
self.closeN = self.flags & 32 # closed in the N direction
@@ -1002,18 +1022,18 @@ class Polyline: #--------------------------------------------------------------
self.vectorsN = getit(obj, 72, None) # PolyMesh: expansion in M-direction / PolyFace: number of faces
#self.resolM = getit(obj, 73, None) # resolution of surface in M direction
#self.resolN = getit(obj, 74, None) # resolution of surface in N direction
- self.curvetyp = getit(obj, 75, 0) # type of curve/surface: 0=None/5=Quadric/6=Cubic/8=Bezier
- self.curvNormal = False
- self.curvQBspline = False
- self.curvCBspline = False
+ self.curvNoFitted = False
+ self.curvQuadrati = False
+ self.curvCubicBsp = False
self.curvBezier = False
- if self.curvetyp == 0: self.curvNormal = True
- elif self.curvetyp == 5: self.curvQBspline = True
- elif self.curvetyp == 6: self.curvCBspline = True
- elif self.curvetyp == 8: self.curvBezier = True
+ curvetype = getit(obj, 75, 0) # type of curve/surface: 0=None/5=Quadric/6=Cubic/8=Bezier
+ if curvetype == 0: self.curvNoFitted = True
+ elif curvetype == 5: self.curvQuadrati = True
+ elif curvetype == 6: self.curvCubicBsp = True
+ elif curvetype == 8: self.curvBezier = True
- self.layer = getit(obj.data, 8, None)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.extrusion = get_extrusion(obj)
self.points = [] #list with vertices coordinats
self.faces = [] #list with vertices assigment to faces
@@ -1026,9 +1046,65 @@ class Polyline: #--------------------------------------------------------------
+ def doubles_out(self, settings, d_points):
+ """routine to sort out of double.vertices-----------------------------
+ """
+ minimal_dist = settings.var['dist_min'] * 0.1
+ dv_count = 0
+ temp_points = []
+ for i in xrange(len(d_points)-1):
+ point = d_points[i]
+ point2 = d_points[i+1]
+ #print 'deb:double.vertex p1,p2', point, point2 #------------------------
+ delta = Mathutils.Vector(point2.loc) - Mathutils.Vector(point.loc)
+ if delta.length > minimal_dist:
+ temp_points.append(point)
+ else:
+ dv_count+=1
+ #print 'deb:drawPoly2d double.vertex sort out! count=', dv_count #------------------------
+ temp_points.append(d_points[-1]) #------ incl. last vertex -------------
+ #if self.closed: temp_points.append(d_points[1]) #------ loop start vertex -------------
+ d_points = temp_points #-----vertex.list without "double.vertices"
+ #print 'deb:drawPoly2d d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------
+ return d_points
+
+
+ def tribles_out(self, settings, d_points):
+ """routine to sort out of three_in_place.vertices-----------------------------
+ """
+ minimal_dist = settings.var['dist_min'] * 0.1
+ dv_count = 0
+ temp_points = []
+ for i in xrange(len(d_points)-2):
+ point1 = d_points[i]
+ point2 = d_points[i+1]
+ point3 = d_points[i+2]
+ #print 'deb:double.vertex p1,p2', point, point2 #------------------------
+ delta12 = Mathutils.Vector(point2.loc) - Mathutils.Vector(point1.loc)
+ delta23 = Mathutils.Vector(point3.loc) - Mathutils.Vector(point2.loc)
+ if delta12.length < minimal_dist and delta23.length < minimal_dist:
+ dv_count+=1
+ else:
+ temp_points.append(point1)
+ #print 'deb:drawPoly2d double.vertex sort out! count=', dv_count #------------------------
+ point1 = d_points[-2]
+ point2 = d_points[-1]
+ delta12 = Mathutils.Vector(point2.loc) - Mathutils.Vector(point1.loc)
+ if delta12.length > minimal_dist:
+ temp_points.append(d_points[-2]) #------ incl. 2last vertex -------------
+ temp_points.append(d_points[-1]) #------ incl. 1last vertex -------------
+ #if self.closed: temp_points.append(d_points[1]) #------ loop start vertex -------------
+ d_points = temp_points #-----vertex.list without "double.vertices"
+ #print 'deb:drawPoly2d d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------
+ return d_points
+
+
def draw(self, settings): #-------------%%%% DRAW POLYLINE %%%---------------
"""for POLYLINE: generate Blender_geometry.
"""
+ #print 'deb:drawPOLYLINE.START:----------------' #------------------------
+ #print 'deb:POLYLINEdraw self.pltype:', self.pltype #------------------------
+ #print 'deb:POLYLINEdraw self.points:\n', self.points #------------------------
ob = []
#---- 3dPolyFace - mesh with free topology
if self.pltype=='plface' and settings.drawTypes['plmesh']:
@@ -1036,20 +1112,28 @@ class Polyline: #--------------------------------------------------------------
#---- 3dPolyMesh - mesh with ortogonal topology
elif self.pltype=='plmesh' and settings.drawTypes['plmesh']:
ob = self.drawPlMesh(settings)
+
#---- 2dPolyline - plane polyline with arc/wide/thic segments
elif self.pltype=='poly2d' and settings.drawTypes['polyline']:
- if settings.var['plines_as'] == 5: # and self.spline:
+ if settings.var['plines_as'] in [5,6]: # and self.spline:
ob = self.drawPolyCurve(settings)
else:
ob = self.drawPoly2d(settings)
+
#---- 3dPolyline - non-plane polyline (thin segments = without arc/wide/thic)
elif self.pltype=='poly3d' and settings.drawTypes['pline3']:
- if settings.var['plines3_as'] == 5: # and self.spline:
+ if settings.var['plines3_as'] in [5,6]: # and self.spline:
ob = self.drawPolyCurve(settings)
else:
ob = self.drawPoly2d(settings)
- return ob
+ #---- Spline - curved polyline (thin segments = without arc/wide/thic)
+ elif self.pltype=='spline' and settings.drawTypes['spline']:
+ if settings.var['splines_as'] in [5,6]:
+ ob = self.drawPolyCurve(settings)
+ else:
+ ob = self.drawPoly2d(settings)
+ return ob
def drawPlFace(self, settings): #---- 3dPolyFace - mesh with free topology
@@ -1065,6 +1149,10 @@ class Polyline: #--------------------------------------------------------------
else:
points.append(point.loc)
+ if settings.var['plmesh_flip']: # ----------------------
+ for face in faces:
+ face.reverse()
+ face = [face[-1]] + face[:-1]
#print 'deb:drawPlFace: len of points_list:\n', len(points) #-----------------------
#print 'deb:drawPlFace: len of faces_list:\n', len(faces) #-----------------------
@@ -1076,6 +1164,10 @@ class Polyline: #--------------------------------------------------------------
ob = SCENE.objects.new(me) # create a new mesh_object
me.verts.extend(points) # add vertices to mesh
me.faces.extend(faces) # add faces to the mesh
+ if settings.var['normals_out']: # ----------------------
+ #me.flipNormals()
+ me.recalcNormals(0)
+ #me.update()
#print 'deb:drawPlFace: len of me.faces:\n', len(me.faces) #-----------------------
if settings.var['meshSmooth_on']: # ----------------------
@@ -1123,7 +1215,10 @@ class Polyline: #--------------------------------------------------------------
ob = SCENE.objects.new(me) # create a new mesh_object
me.verts.extend([point.loc for point in self.points]) # add vertices to mesh
me.faces.extend(faces) # add faces to the mesh
-
+ if settings.var['normals_out']: # ----------------------
+ #me.flipNormals()
+ me.recalcNormals(0)
+ #me.update()
if settings.var['meshSmooth_on']: # ----------------------
for i in xrange(len(faces)):
me.faces[i].smooth = True
@@ -1142,9 +1237,9 @@ class Polyline: #--------------------------------------------------------------
#print 'deb:drawPoly2d exit, cause POLYLINE has less than 2 vertices' #---------
return
- if self.spline: pline_typ = 'ps' # Polyline-nurbSpline
- elif self.curved: pline_typ = 'pc' # Polyline-bezierCurve
- else: pline_typ = 'pl' # Polyline
+ if self.spline: pline_typ = 'ps' # Polyline-NURBSpline
+ elif self.curved: pline_typ = 'pc' # Polyline-BezierCurve
+ else: pline_typ = 'pl' # Polyline classic
obname = '%s_%s' %(pline_typ, self.layer) # create object_name from layer name
obname = obname[:MAX_NAMELENGTH]
d_points = []
@@ -1160,6 +1255,10 @@ class Polyline: #--------------------------------------------------------------
point.loc[2] = self.elevation
d_points.append(point)
+ #d_points = self.tribles_out(settings, d_points)
+ #d_points = self.doubles_out(settings, d_points)
+ #print 'deb:drawPolyCurve d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------
+
thic = set_thick(self.thic, settings)
if thic != 0.0: #hack: Blender<2.45 curve-extrusion
LocZ = d_points[0].loc[2]
@@ -1173,12 +1272,14 @@ class Polyline: #--------------------------------------------------------------
pline = Curve.New(obname) # create new curve data
#pline.setResolu(24) #--todo-----
- if self.spline: # NURBSplines-----OK-----
+ if False: #old self.spline: # NURBSplines-----OK-----
#print 'deb:polyline2dCurve.draw self.spline!' #---------------
weight1 = 0.5
weight2 = 1.0
- # generate middlepoints except start/end-segments ---
- if self.curvQBspline:
+ if self.curvQuadrati:
+ # Bezier-curve form simulated in NURBS-curve
+ # generate middlepoints except start/end-segments ---
+ #print 'deb:polyline2dCurve.draw extraQBspline!' #---------------
temp_points = []
point = d_points[0].loc
point.append(weight1)
@@ -1231,7 +1332,27 @@ class Polyline: #--------------------------------------------------------------
else:
curve.flagU = 0 # Set curve not cyclic=open
- elif self.curved: #--Bezier-curves---OK-------
+ if self.spline: # NURBSplines-----OK-----
+ #print 'deb:polyline2dCurve.draw self.spline!' #---------------
+ nurbs_points = []
+ for d in d_points:
+ pkt = d.loc
+ pkt.append(d.weight)
+ nurbs_points.append(pkt)
+ firstpoint = nurbs_points[0]
+ curve = pline.appendNurb(firstpoint)
+ curve.setType(4) # set curvetype NURBS
+ for point in nurbs_points[1:]:
+ curve.append(point)
+ if self.closed:
+ curve.flagU = 1+0 # Set curve cyclic=close and uni
+ else:
+ curve.flagU = 0+2 # Set curve not cyclic=open
+ try: curve.orderU = 5 # works only with >2.46svn080625
+ except AttributeError: pass
+ #print 'deb: dir(curve):', dir(curve) #----------------
+
+ elif False: #orig self.curved: #--Bezier-curves---OK-------
#print 'deb:polyline2dCurve.draw self.curved!' #---------------
curve = pline.appendNurb(BezTriple.New(d_points[0]))
for p in d_points[1:]:
@@ -1245,7 +1366,45 @@ class Polyline: #--------------------------------------------------------------
curve[0].handleTypes = [FREE, ALIGN] #remi--todo-----
curve[-1].handleTypes = [ALIGN, FREE] #remi--todo-----
- else: #--straight line- and arc-segments----OK------
+ elif self.curved: #--SPLINE as Bezier-curves---wip------
+ #print 'deb:polyline2dCurve.draw self.curved!' #---------------
+ begtangent, endtangent = None, None
+ if d_points[0].tangent:
+ begtangent = d_points[0]
+ d_points = d_points[1:]
+ if d_points[-1].tangent:
+ endtangent = d_points[-1]
+ d_points = d_points[:-1]
+ curve = pline.appendNurb(BezTriple.New(d_points[0]))
+ for p in d_points[1:]:
+ curve.append(BezTriple.New(p))
+ for point in curve:
+ point.handleTypes = [AUTO, AUTO]
+ #curve.setType(1) #Bezier curve
+ if self.closed:
+ curve.flagU = 5 #1 # Set curve cyclic=close
+ else:
+ curve.flagU = 4 #0 # Set curve not cyclic=open
+ if begtangent:
+ #print 'deb:polyline2dCurve.draw curve[0].vec:', curve[0].vec #-----
+ #print 'deb:polyline2dCurve.draw begtangent:', begtangent #-----
+ p0h1,p0,p0h2 = curve[0].vec
+ p0h1 = [p0h1[i]+begtangent[i] for i in range(3)]
+ curve.__setitem__(0,BezTriple.New(p0h1+p0+p0h2))
+ curve[0].handleTypes = [FREE, ALIGN] #remi--todo-----
+ if endtangent:
+ #print 'deb:polyline2dCurve.draw curve[-1].vec:', curve[-1].vec #-----
+ #print 'deb:polyline2dCurve.draw endtangent:', endtangent #-----
+ p0h1,p0,p0h2 = curve[-1].vec
+ p0h2 = [p0h2[i]+endtangent[i] for i in range(3)]
+ #print 'deb:drawPlineCurve: p0h2:', p0h2 #----------
+ curve.__setitem__(-1,BezTriple.New(p0h1+p0+p0h2))
+ #print 'deb:polyline2dCurve.draw curve[-1].vec:', curve[-1].vec #-----
+ curve[-1].handleTypes = [ALIGN, FREE] #remi--todo-----
+
+
+
+ else: #-- only straight line- and arc-segments----OK------
#print 'deb:polyline2dCurve.draw curve:', curve #-----
points = []
arc_res = settings.var['curve_arc']
@@ -1403,8 +1562,10 @@ class Polyline: #--------------------------------------------------------------
#print 'deb:drawPoly2d len of d_pointsList ====== ', len(d_points) #------------------------
#print 'deb:drawPoly2d d_pointsList ======:\n ', d_points #------------------------
+ d_points = self.doubles_out(settings, d_points)
+ #print 'deb:drawPolyCurve d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------
- # routine to sort out of "double.vertices" ------------------------------------
+ """# routine to sort out of "double.vertices" ------------------------------------
minimal_dist = settings.var['dist_min'] * 0.1
temp_points = []
for i in xrange(len(d_points)-1):
@@ -1419,6 +1580,7 @@ class Polyline: #--------------------------------------------------------------
#if self.closed: temp_points.append(d_points[1]) #------ loop start vertex -------------
d_points = temp_points #-----vertex.list without "double.vertices"
#print 'deb:drawPoly2d d_pointsList =after DV-outsorting=====:\n ', d_points #------------------------
+ """
#print 'deb:drawPoly2d len of d_pointsList ====== ', len(d_points) #------------------------
if len(d_points) < 2: #if too few vertex, then return
@@ -1836,12 +1998,16 @@ class Vertex(object): #--------------------------------------------------------
self.swidth = None #0
self.ewidth = None #0
self.bulge = 0
+ self.tangent = False
+ self.weight = 1.0
if obj is not None:
if not obj.type == 'vertex':
raise TypeError, "Wrong type %s for vertex object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
- self.get_props(obj.data)
+# self.data = obj.data[:]
+ self.get_props(obj)
+ else:
+ pass
#print 'deb:Vertex.init.END:----------------' #------------------------
@@ -1862,18 +2028,22 @@ class Vertex(object): #--------------------------------------------------------
self.flags = getit(data, 70, 0) # flags
self.curved = self.flags&1 # Bezier-curve-fit:additional-vertex
- self.curv_t = self.flags&2 # Bezier-curve-fit:tangent exists
- self.spline = self.flags&8 # Bspline-fit:additional-vertex
- self.splin2 = self.flags&16 # Bspline-fit:control-vertex
+ self.curved_t = self.flags&2 # Bezier-curve-fit:tangent exists
+ self.spline = self.flags&8 # NURBSpline-fit:additional-vertex
+ self.spline_c = self.flags&16 # NURBSpline-fit:control-vertex
self.poly3d = self.flags&32 # polyline3d:control-vertex
self.plmesh = self.flags&64 # polymesh3d:control-vertex
self.plface = self.flags&128 # polyface
# if PolyFace.Vertex with Face_definition
- if self.curv_t:
- self.curv_tangent = getit(data, 50, None) # curve_tangent
-
- if self.plface and not self.plmesh:
+ if self.curved_t:
+ self.curve_tangent = getit(data, 50, None) # curve_tangent
+ if not self.curve_tangent==None:
+ self.tangent = True
+ #elif self.spline_c: # NURBSpline:control-vertex
+ # self.weight = getit(data, 41, 1.0) # weight od control point
+
+ elif self.plface and not self.plmesh:
v1 = getit(data, 71, 0) # polyface:Face.vertex 1.
v2 = getit(data, 72, 0) # polyface:Face.vertex 2.
v3 = getit(data, 73, 0) # polyface:Face.vertex 3.
@@ -1938,8 +2108,7 @@ class Vertex(object): #--------------------------------------------------------
class Spline(Polyline): #-----------------------------------------------------------------
"""Class for objects representing dxf SPLINEs.
"""
- def __init__(self, obj):
- """Expects an entity object of type spline as input.
+ """Expects an entity object of type spline as input.
100 - Subclass marker (AcDbSpline)
210,220, 230 - Normal vector (omitted if the spline is nonplanar) X,Y,Z values of normal vector
70 - Spline flag (bit coded):
@@ -1963,12 +2132,13 @@ class Spline(Polyline): #------------------------------------------------------
DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entry per control point)
11,21, 31 - Fit points (in WCS) one entry per fit point.
X,Y,Z values of fit points (in WCS) (one entry per fit point)
- """
+ """
+ def __init__(self, obj):
#print 'deb:Spline.START:----------------' #------------------------
if not obj.type == 'spline':
raise TypeError, "Wrong type %s for spline object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.num_points = obj.get_type(73)[0]
@@ -1992,30 +2162,42 @@ DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entr
self.planar = self.flags & 8 # Planar
self.linear = self.flags & 16 # Linear (and Planar)
- self.degree = getit(obj, 71, 0) # Degree of the spline curve
- self.curvNormal = False
- self.curvQBspline = False
- self.curvCBspline = False
+ self.curvNoFitted = False
+ self.curvQuadrati = False
+ self.curvCubicBsp = False
self.curvBezier = False
- if self.degree == 0: self.curvNormal = True
- elif self.degree == 1: self.curvQBspline = True
- elif self.degree == 2: self.curvCBspline = True
+ self.degree = getit(obj, 71, 0) # Degree of the spline curve
+ if self.degree == 0: self.curvNoFitted = True
+ elif self.degree == 1: self.curvQuadrati = True
+ elif self.degree == 2: self.curvCubicBsp = True
#elif self.degree == 3: self.curvBezier = True
- elif self.degree == 3: self.spline = True
+ #elif self.degree == 3: self.spline = True
- self.num_knots = getit(obj, 72, 0) # Number of knots
- self.num_contr = getit(obj, 73, 0) # Number of control points
- self.num_fitpk = getit(obj, 74, 0) # Number of fit points (if any)
+ self.knotpk_len = getit(obj, 72, 0) # Number of knots
+ self.ctrlpk_len = getit(obj, 73, 0) # Number of control points
+ self.fit_pk_len = getit(obj, 74, 0) # Number of fit points (if any)
+
+ #print 'deb:Spline self.fit_pk_len=', self.fit_pk_len #------------------------
+ #self.fit_pk_len = 0 # temp for debug
+ if self.fit_pk_len and 'spline_as'==5:
+ self.spline = False
+ self.curved = True
+ else:
+ self.spline = True
+ self.curved = False
- self.layer = getit(obj.data, 8, None)
- self.extrusion = get_extrusion(obj.data)
+ self.knotpk_tol = getit(obj, 42, 0.0000001) # Knot tolerance (default = 0.0000001)
+ self.ctrlpk_tol = getit(obj, 43, 0.0000001) # Control-point tolerance (default = 0.0000001)
+ self.fit_pk_tol = getit(obj, 44, 0.0000000001) # Fit tolerance (default = 0.0000000001)
- self.points = self.get_points(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.extrusion = get_extrusion(obj)
- if self.planar: self.pltype = 'poly2d'
- else: self.pltype = 'poly3d'
- self.curved = False
- #self.curved = False
+ self.pltype = 'spline' # spline is a 2D- or 3D-polyline
+
+ self.points = self.get_points(obj.data)
+ #self.knots_val = self.get_knots_val(obj.data) # 40 - Knot value (one entry per knot)
+ #self.knots_wgh = self.get_knots_wgh(obj.data) # 41 - Weight (default 1)
#print 'deb:Spline obj.data:\n', obj.data #------------------------
#print 'deb:Spline self.points:\n', self.points #------------------------
@@ -2032,61 +2214,70 @@ DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entr
20:yvalue
for each vert
"""
- num = self.num_contr
point = None
points = []
+ pointend = None
#point = Vertex()
- for item in data:
- #print 'deb:Spline item:', item #------------------------
- if item[0] == 10: # control point
- if point: points.append(point)
- point = Vertex()
- point.curved = True
- point.x = item[1]
- elif item[0] == 20: # 20 = y
- point.y = item[1]
- elif item[0] == 30: # 30 = z
- point.z = item[1]
-
- elif item[0] == 11: # fit point
- if point: points.append(point)
- point = Vertex()
- point.curved = True
- point.x = item[1]
- elif item[0] == 21: # 20 = y
- point.y = item[1]
- elif item[0] == 31: # 30 = z
- point.z = item[1]
-
- elif item[0] == 12: # start tangent
- if point: points.append(point)
- point = Vertex()
- point.curved = True
- point.x = item[1]
- elif item[0] == 22: # = y
- point.y = item[1]
- elif item[0] == 32: # = z
- point.z = item[1]
-
- elif item[0] == 13: # end tangent
- if point: points.append(point)
- point = Vertex()
- point.curved = True
- point.x = item[1]
- elif item[0] == 23: # 20 = y
- point.y = item[1]
- elif item[0] == 33: # 30 = z
- point.z = item[1]
+ if self.spline: # NURBSpline definition
+ for item in data:
+ #print 'deb:Spline.get_points spilne_item:', item #------------------------
+ if item[0] == 10: # control point
+ if point: points.append(point)
+ point = Vertex()
+ point.curved = True
+ point.x = item[1]
+ elif item[0] == 20: # 20 = y
+ point.y = item[1]
+ elif item[0] == 30: # 30 = z
+ point.z = item[1]
+ elif item[0] == 41: # 41 = weight
+ point.weight = item[1]
+ #print 'deb:Spline.get_points control point:', point #------------------------
+
+ elif self.curved: # Bezier definition
+ for item in data:
+ #print 'deb:Spline.get_points curved_item:', item #------------------------
+ if item[0] == 11: # fit point
+ if point: points.append(point)
+ point = Vertex()
+ point.tangent = False
+ point.x = item[1]
+ elif item[0] == 21: # 20 = y
+ point.y = item[1]
+ elif item[0] == 31: # 30 = z
+ point.z = item[1]
+ #print 'deb:Spline.get_points fit point:', point #------------------------
+
+ elif item[0] == 12: # start tangent
+ if point: points.append(point)
+ point = Vertex()
+ point.tangent = True
+ point.x = item[1]
+ elif item[0] == 22: # = y
+ point.y = item[1]
+ elif item[0] == 32: # = z
+ point.z = item[1]
+ #print 'deb:Spline.get_points fit begtangent:', point #------------------------
+
+ elif item[0] == 13: # end tangent
+ if point: points.append(point)
+ pointend = Vertex()
+ pointend.tangent = True
+ pointend.x = item[1]
+ elif item[0] == 23: # 20 = y
+ pointend.y = item[1]
+ elif item[0] == 33: # 30 = z
+ pointend.z = item[1]
+ #print 'deb:Spline.get_points fit endtangent:', pointend #------------------------
points.append(point)
+ if self.curved and pointend:
+ points.append(pointend)
#print 'deb:Spline points:\n', points #------------------------
return points
-
-
def __repr__(self):
return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points)
-
class LWpolyline(Polyline): #-------------------------------------------------------------
@@ -2099,7 +2290,7 @@ class LWpolyline(Polyline): #--------------------------------------------------
if not obj.type == 'lwpolyline':
raise TypeError, "Wrong type %s for polyline object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.num_points = obj.get_type(90)[0]
@@ -2118,8 +2309,8 @@ class LWpolyline(Polyline): #--------------------------------------------------
self.flags = getit(obj, 70, 0)
self.closed = self.flags&1 # byte coded, 1 = closed, 128 = plinegen
- self.layer = getit(obj.data, 8, None)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.extrusion = get_extrusion(obj)
self.points = self.get_points(obj.data)
@@ -2167,72 +2358,10 @@ class LWpolyline(Polyline): #--------------------------------------------------
return points
-
def __repr__(self):
return "%s: layer - %s, points - %s" %(self.__class__.__name__, self.layer, self.points)
- def draw_old(self, settings):
- """for LWPOLYLINE: generate Blender_geometry.
- """
- #print 'deb:LWpolyline.draw.START:----------------' #------------------------
- points = []
- obname = 'lw_%s' %self.layer # create object name from layer name
- obname = obname[:MAX_NAMELENGTH]
- #settings.var['curves_on'] == True
- #print 'deb:index_len: ', len(self.points) #------------------
- for i, point in enumerate(self.points):
- #print 'deb:index: ', i #------------------
- if not point.bulge:
- points.append(point.loc)
- elif point.bulge and not self.closed and i == len(self.points)-1:
- points.append(point.loc)
- elif point.bulge: #
- if i == len(self.points)-1:
- point2 = self.points[0]
- else:
- point2 = self.points[i+1]
- arc_res = settings.var['arc_res']/sqrt(settings.var['arc_rad'])
- verts, center = calcBulge(point, point2, arc_res)
-# if i == len(self.points)-1:
-# if self.closed:
-# verts.pop() #remove last(=first) vertex
-# else:
-# verts.pop() #remove last vertex, because this point will be writen as the next vertex
- points.extend(verts)
-
- thic = self.thic
- if settings.var['thick_force'] and thic == 0: thic = settings.var['thick_min']
- if settings.var['thick_on'] and thic != 0:
- len1 = len(points)
- points.extend([[point[0], point[1], point[2]+thic] for point in points])
- faces = []
- #print 'deb:len1:', len1 #-----------------------
- faces = [[num, num+1, num+len1+1, num+len1] for num in xrange(len1 - 1)]
- if self.closed:
- faces.append([len1-1, 0, len1, 2*len1-1])
- #print 'deb:faces_list:\n', faces #-----------------------
- me = Mesh.New(obname) # create a new mesh
- ob = SCENE.objects.new(me) # create a new mesh_object
- me.verts.extend(points) # add vertices to mesh
- me.faces.extend(faces) # add faces to the mesh
- else:
- edges = [[num, num+1] for num in xrange(len(points)-1)]
- if self.closed:
- edges.append([len(points)-1, 0])
- #print 'deb:edges_list:\n', edges #-----------------------
- me = Mesh.New(obname) # create a new mesh
- ob = SCENE.objects.new(me) # create a new mesh_object
- me.verts.extend(points) # add vertices to mesh
- me.edges.extend(edges) # add edges to the mesh
-
- ob.LocZ = self.elevation
- transform(self.extrusion, 0, ob)
-
- #print 'deb:LWpolyline.draw.END:----------------' #------------------------
- return ob
-
-
class Text: #-----------------------------------------------------------------
"""Class for objects representing dxf TEXT.
"""
@@ -2242,7 +2371,7 @@ class Text: #-----------------------------------------------------------------
if not obj.type == 'text':
raise TypeError, "Wrong type %s for text object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.height = 1.7 * obj.get_type(40)[0] #text.height
@@ -2274,14 +2403,13 @@ class Text: #-----------------------------------------------------------------
#3=aligned, 4=middle, 5=fit
self.halignment = getit(obj, 72, 0)
- self.layer = getit(obj.data, 8, None)
- self.loc1, self.loc2 = self.get_loc(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc1, self.loc2 = self.get_loc(obj)
if self.loc2[0] != None and self.halignment != 5:
self.loc = self.loc2
else:
self.loc = self.loc1
- self.extrusion = get_extrusion(obj.data)
-
+ self.extrusion = get_extrusion(obj)
def get_loc(self, data):
@@ -2390,13 +2518,13 @@ class Mtext: #-----------------------------------------------------------------
if not obj.type == 'mtext':
raise TypeError, "Wrong type %s for mtext object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.height = obj.get_type(40)[0]
self.width = obj.get_type(41)[0]
self.alignment = obj.get_type(71)[0] # alignment 1=TL, 2=TC, 3=TR, 4=ML, 5=MC, 6=MR, 7=BL, 8=BC, 9=BR
- self.value = self.get_text(obj.data) # The text string value
+ self.value = self.get_text(obj) # The text string value
# optional data (with defaults)
self.space = getit(obj, 67, 0)
@@ -2406,9 +2534,9 @@ class Mtext: #-----------------------------------------------------------------
self.width_factor = getit(obj, 42, 1) # Scaling factor along local x axis
self.line_space = getit(obj, 44, 1) # percentage of default
- self.layer = getit(obj.data, 8, None)
- self.loc = self.get_loc(obj.data)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc = self.get_loc(obj)
+ self.extrusion = get_extrusion(obj)
def get_text(self, data):
@@ -2487,7 +2615,7 @@ class Circle: #----------------------------------------------------------------
if not obj.type == 'circle':
raise TypeError, "Wrong type %s for circle object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.radius = obj.get_type(40)[0]
@@ -2497,9 +2625,9 @@ class Circle: #----------------------------------------------------------------
self.thic = getit(obj, 39, 0)
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.loc = self.get_loc(obj.data)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc = self.get_loc(obj)
+ self.extrusion = get_extrusion(obj)
@@ -2700,7 +2828,7 @@ class Arc: #-----------------------------------------------------------------
if not obj.type == 'arc':
raise TypeError, "Wrong type %s for arc object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.radius = obj.get_type(40)[0]
@@ -2712,9 +2840,9 @@ class Arc: #-----------------------------------------------------------------
self.thic = getit(obj, 39, 0)
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.loc = self.get_loc(obj.data)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc = self.get_loc(obj)
+ self.extrusion = get_extrusion(obj)
#print 'deb:Arc__init__: center, radius, start, end:\n', self.loc, self.radius, self.start_angle, self.end_angle #---------
@@ -2898,7 +3026,7 @@ class BlockRecord: #-----------------------------------------------------------
if not obj.type == 'block_record':
raise TypeError, "Wrong type %s for block_record object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.name = getit(obj, 2, None)
@@ -2954,8 +3082,8 @@ class Block: #-----------------------------------------------------------------
self.entities = dxfObject('block_contents') #creates empty entities_container for this block
self.entities.data = objectify([ent for ent in obj.data if type(ent) != list])
- self.layer = getit(obj.data, 8, None)
- self.loc = self.get_loc(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc = self.get_loc(obj)
#print 'deb:Block %s data:\n%s' %(self.name, self.data) #------------
#print 'deb:Block %s self.entities.data:\n%s' %(self.name, self.entities.data) #------------
@@ -2999,11 +3127,11 @@ class Insert: #----------------------------------------------------------------
self.space = getit(obj, 67, 0)
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.loc = self.get_loc(obj.data)
- self.scale = self.get_scale(obj.data)
- self.rows, self.columns = self.get_array(obj.data)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc = self.get_loc(obj)
+ self.scale = self.get_scale(obj)
+ self.rows, self.columns = self.get_array(obj)
+ self.extrusion = get_extrusion(obj)
#self.flags = getit(obj.data, 66, 0) #
#self.attrib = self.flags & 1
@@ -3205,7 +3333,7 @@ class Ellipse: #---------------------------------------------------------------
if not obj.type == 'ellipse':
raise TypeError, "Wrong type %s for ellipse object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# required data
self.ratio = obj.get_type(40)[0] # Ratio of minor axis to major axis
@@ -3217,10 +3345,10 @@ class Ellipse: #---------------------------------------------------------------
self.thic = getit(obj, 39, 0.0)
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.loc = self.get_loc(obj.data)
- self.major = self.get_major(obj.data)
- self.extrusion = get_extrusion(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.loc = self.get_loc(obj)
+ self.major = self.get_major(obj)
+ self.extrusion = get_extrusion(obj)
def get_loc(self, data):
@@ -3468,14 +3596,14 @@ class Face: #-----------------------------------------------------------------
if not obj.type == '3dface':
raise TypeError, "Wrong type %s for 3dface object!" %obj.type
self.type = obj.type
- self.data = obj.data[:]
+# self.data = obj.data[:]
# optional data (with defaults)
self.space = getit(obj, 67, 0)
self.color_index = getit(obj, 62, BYLAYER)
- self.layer = getit(obj.data, 8, None)
- self.points = self.get_points(obj.data)
+ self.layer = getit(obj, 8, None)
+ self.points = self.get_points(obj)
def get_points(self, data):
@@ -3582,11 +3710,11 @@ type_map = {
'point':Point,
'3dface':Face,
'line':Line,
-# 'mline':MLine,
+# 'mline':MLine,
'polyline':Polyline,
'lwpolyline':LWpolyline,
'spline':Spline,
-# 'region':Region,
+# 'region':Region,
'trace':Solid,
'solid':Solid,
'text':Text,
@@ -3623,12 +3751,12 @@ def objectify(data): #---------------------------------------------------------
if item.type == 'vertex':
#print 'deb:objectify gosub Vertex--------' #-------------
v = Vertex(item)
- if pline.spline: # if Bspline-curve
+ if pline.spline: # if NURBSpline-curve
# then for Blender-mesh filter only additional_vertices
# OR
# then for Blender-curve filter only spline_control_vertices
- if (v.spline and not curves_on) or (curves_on and v.splin2): #correct for real NURBS-import
- #if (v.spline and not curves_on) or (curves_on and not v.splin2): #fake for Bezier-emulation of NURBS-import
+ if (v.spline and not curves_on) or (curves_on and v.spline_c): #correct for real NURBS-import
+ #if (v.spline and not curves_on) or (curves_on and not v.spline_c): #fake for Bezier-emulation of NURBS-import
pline.points.append(v)
elif pline.curved: # if Bezier-curve
# then for Blender-mesh filter only curve_additional_vertices
@@ -3685,7 +3813,7 @@ class MatColors: #-------------------------------------------------------------
the material.
"""
- def __init__(self, layersmap):
+ def __init__(self):
"""Expects a map - a dictionary mapping layer names to layers.
"""
#self.layersmap = layersmap # a dictionary of layername:layerobject
@@ -3709,8 +3837,9 @@ class MatColors: #-------------------------------------------------------------
#layer = Layer(name=color, color=256, frozen=False)
#layersmap[color] = layer
#color = 0
- if layersmap: color = layersmap[color].color
- if color == 256: # color 0 = BYLAYER
+ if color in layersmap.keys():
+ color = layersmap[color].color
+ if color == 256: # color 256 = BYLAYER
#--todo-- should looking for color of LAYER
#if layersmap: color = layersmap[color].color
color = 3
@@ -3749,7 +3878,7 @@ class MatLayers: #-------------------------------------------------------------
the material.
"""
- def __init__(self, layersmap):
+ def __init__(self):
"""Expects a map - a dictionary mapping layer names to layers.
"""
#self.layersmap = layersmap # a dictionary of layername:layer
@@ -3896,6 +4025,11 @@ class Settings: #--------------------------------------------------------------
'0'
]
+ self.var['groupFilter_on'] = False #deb:remi------------
+ self.acceptedLayers = ['3',
+ '0'
+ ]
+
#self.var['blockFilter_on'] = 0 #deb:remi------------
self.acceptedBlocks = ['WALL_1871',
'BOX02'
@@ -3953,8 +4087,8 @@ class Settings: #--------------------------------------------------------------
if self.var['optimization'] == 0: self.var['one_mesh_on'] = 0
# The section:tables may be partialy or completely missing.
self.layersTable = False
- self.colMaterials = MatColors({}) #A container for dxf-color based materials
- self.layMaterials = MatLayers({}) #A container for dxf-layer based materials
+ self.colMaterials = MatColors() #A container for dxf-color based materials
+ self.layMaterials = MatLayers() #A container for dxf-layer based materials
#self.collayMaterials = MatColLayers({}) #A container for dxf-color+layer based materials
global layersmap, layernamesmap
layersmap, layernamesmap = {}, {}
@@ -3974,8 +4108,8 @@ class Settings: #--------------------------------------------------------------
if layers: #----------------------------------
# Read the layers table and get the layer colors
layersmap, layernamesmap = getLayersmap(layers)
- self.colMaterials = MatColors(layersmap)
- self.layMaterials = MatLayers(layersmap)
+ #self.colMaterials = MatColors()
+ #self.layMaterials = MatLayers()
else:
self.write("File contains no table:layers!")
@@ -4441,19 +4575,20 @@ def rotXY_Vec(rotation, vec): #------------------------------------------------
-def getLayersmap(layers): #------------------------------------------------------
+def getLayersmap(dxflayers): #------------------------------------------------------
"""Build two dictionaries: 1.layername:layer object, and 2.layername:layername_short
+ gets set of layers from TABLES SECTION LAYERS
"""
layersmap = {}
layernamesmap = {}
- for item in layers.data:
+ for item in dxflayers.data:
if type(item) != list and item.type == 'layer':
layersmap[item.name] = item
layername_short = item.name[:MAX_NAMELENGTH-1]
i = 0 #sufix for layernames cause Blender-objectnames-limits
while layername_short in layernamesmap.keys():
i += 1
- suffix = str(i)
+ suffix = str(i) #--todo--set zero-leading number format
layername_short = layername_short[:-2] + suffix
layernamesmap[item.name] = layername_short
@@ -4546,6 +4681,7 @@ def drawer(_type, entities, settings, block_def): #----------------------------
If 'block_def': the entities are to be added to the Blender 'group'.
"""
+ global layersmap, layersmapshort
#print 'deb:drawer _type, entities:\n ', _type, entities #-----------------------
if entities:
@@ -4579,6 +4715,21 @@ def drawer(_type, entities, settings, block_def): #----------------------------
#entities = [entity for entity in entities if entity.layer[0] in ['M','3','0'] and not entity.layer.endswith('H')]
entities = [entity for entity in entities if entity.layer in settings.acceptedLayers]
+ # patch for incomplete layer table in HL2-DXF-files
+ if layersmap:
+ for entity in entities:
+ oblayer = entity.layer
+ if oblayer not in layersmap.keys():
+ layer_obj = Layer(None, name=oblayer)
+ layersmap[oblayer] = layer_obj
+ layername_short = oblayer[:MAX_NAMELENGTH-1]
+ i = 0 #sufix for layernames cause Blender-objectnames-limits
+ while layername_short in layernamesmap.keys():
+ i += 1
+ suffix = str(i) #--todo--set zero-leading number format
+ layername_short = layername_short[:-2] + suffix
+ layernamesmap[oblayer] = layername_short
+
# filtering only objects on not-frozen layers
if layersmap and not settings.var['layFrozen_on']:
entities = [entity for entity in entities if not layersmap[entity.layer].frozen]
@@ -4785,7 +4936,7 @@ def setMaterial_from(entity, ob, settings, block_def): #-----------------------
mat = settings.colMaterials(entity.color_index)
elif settings.var['material_from'] == 2: # 2= material from layer_name
- mat = settings.layMaterials(layername = entity.layer)
+ mat = settings.layMaterials(layername=entity.layer)
elif settings.var['material_from'] == 3: # 3= material from layer+color
mat = settings.layMaterials(layername=entity.layer, color=entity.color_index)
@@ -5104,7 +5255,7 @@ EVENT_HELP = 9
EVENT_PRESETCURV = 10
EVENT_PRESETS = 11
EVENT_DXF_DIR = 12
-EVENT_DXF_NAME = 13
+# = 13
EVENT_LIST = 14
EVENT_ORIGIN = 15
EVENT_SCALE = 16
@@ -5119,12 +5270,12 @@ GUI_B = {} # GUI-buttons dictionary for drawingTypes
# settings default, initialize ------------------------
points_as_menu = "convert to: %t|empty %x1|mesh.vertex %x2|thin sphere %x3|thin box %x4|*curve.vertex %x5"
-lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|curve %x5"
+lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
mlines_as_menu = "convert to: %t|*edge %x1|*mesh %x2|*thin cylinder %x3|*thin box %x|*curve %x5"
-plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5"
-splines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5"
-plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|curve %x5"
-plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2"
+plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
+splines_as_menu = "convert to: %t|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
+plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
+plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2|NURBS-surface %x6"
solids_as_menu = "convert to: %t|*edge %x1|mesh %x2"
blocks_as_menu = "convert to: %t|dupliGroup %x1|*real.Group %x2|*exploded %x3"
texts_as_menu = "convert to: %t|text %x1|*mesh %x2|*curve %x5"
@@ -5166,6 +5317,9 @@ keywords_org = {
'xref_on' : 1,
'block_nn': 0,
'blockFilter_on': 0,
+ 'layerFilter_on': 0,
+ 'colorFilter_on': 0,
+ 'groupFilter_on': 0,
'newScene_on' : 1,
'target_layer' : TARGET_LAYER,
'group_bylayer_on' : GROUP_BYLAYER,
@@ -5187,7 +5341,6 @@ keywords_org = {
'dist_force': 0,
'material_on': 1,
'material_from': 2,
- 'pl_3d' : 1,
'fill_on' : 1,
'meshSmooth_on': 1,
'curve_res' : CURV_RESOLUTION,
@@ -5197,6 +5350,8 @@ keywords_org = {
'thin_res' : THIN_RESOLUTION,
'pl_trim_max' : TRIM_LIMIT,
'pl_trim_on': 1,
+ 'plmesh_flip': 0,
+ 'normals_out': 0,
'paper_space_on': 0,
'layFrozen_on': 0,
'Z_force_on': 0,
@@ -5205,7 +5360,7 @@ keywords_org = {
'lines_as' : 2,
'mlines_as' : 2,
'plines_as' : 2,
- 'splines_as' : 2,
+ 'splines_as' : 5,
'plines3_as': 2,
'plmesh_as' : 2,
'solids_as' : 2,
@@ -5221,7 +5376,7 @@ drawTypes_org = {
'ellipse': 1,
'mline' : 0,
'polyline': 1,
- 'spline': 0,
+ 'spline': 1,
'plmesh': 1,
'pline3': 1,
'lwpolyline': 1,
@@ -5244,6 +5399,9 @@ for k, v in drawTypes_org.iteritems():
GUI_B[k] = Draw.Create(v)
#print 'deb:init GUI_A: ', GUI_A #---------------
#print 'deb:init GUI_B: ', GUI_B #---------------
+
+model_space_on = Draw.Create(1)
+
# initialize settings-object controls how dxf entities are drawn
settings = Settings(keywords_org, drawTypes_org)
@@ -5397,12 +5555,13 @@ def resetDefaultConfig(): #-----------------------------------------------
updateConfig(keywords_org, drawTypes_org)
-def presetConfig_curv(): #-----------------------------------------------
+def presetConfig_curv(activate): #-----------------------------------------------
"""Sets settings/config/materials for curve representation.
"""
global GUI_A
- if GUI_A['curves_on'].val == 1:
+ if activate:
+ GUI_A['curves_on'].val = 1
GUI_A['points_as'].val = 5
GUI_A['lines_as'].val = 5
GUI_A['mlines_as'].val = 5
@@ -5410,11 +5569,12 @@ def presetConfig_curv(): #-----------------------------------------------
GUI_A['splines_as'].val = 5
GUI_A['plines3_as'].val = 5
else:
+ GUI_A['curves_on'].val = 0
GUI_A['points_as'].val = 2
GUI_A['lines_as'].val = 2
GUI_A['mlines_as'].val = 2
GUI_A['plines_as'].val = 2
- GUI_A['splines_as'].val = 2
+ GUI_A['splines_as'].val = 6
GUI_A['plines3_as'].val = 2
@@ -5422,7 +5582,7 @@ def resetDefaultConfig_2D(): #-----------------------------------------------
"""Sets settings/config/materials to defaults 2D.
"""
-# presetConfig_curv()
+ presetConfig_curv(1)
keywords2d = {
'views_on' : 0,
'cams_on' : 0,
@@ -5434,7 +5594,6 @@ def resetDefaultConfig_2D(): #-----------------------------------------------
'width_force': 0,
'dist_on' : 1,
'dist_force': 0,
- 'pl_3d' : 0,
'fill_on' : 0,
'pl_trim_on': 1,
'Z_force_on': 0,
@@ -5452,9 +5611,9 @@ def resetDefaultConfig_2D(): #-----------------------------------------------
'ellipse': 1,
'mline' : 0,
'polyline': 1,
- 'spline': 0,
+ 'spline': 1,
'plmesh': 0,
- 'pline3': 0,
+ 'pline3': 1,
'lwpolyline': 1,
'text' : 1,
'mtext' : 0,
@@ -5472,8 +5631,11 @@ def resetDefaultConfig_3D(): #-----------------------------------------------
"""Sets settings/config/materials to defaults 3D.
"""
-# presetConfig_curv()
+ presetConfig_curv(0)
keywords3d = {
+# 'views_on' : 1,
+# 'cams_on' : 1,
+# 'lights_on' : 1,
'vGroup_on' : 1,
'thick_on' : 1,
'thick_force': 0,
@@ -5481,7 +5643,6 @@ def resetDefaultConfig_3D(): #-----------------------------------------------
'width_force': 0,
'dist_on' : 1,
'dist_force': 0,
- 'pl_3d' : 0,
'fill_on' : 1,
'pl_trim_on': 1,
'Z_force_on': 0,
@@ -5499,11 +5660,11 @@ def resetDefaultConfig_3D(): #-----------------------------------------------
'ellipse': 1,
'mline' : 0,
'polyline': 1,
- 'spline': 0,
+ 'spline': 1,
'plmesh': 1,
'pline3': 1,
'lwpolyline': 1,
- 'text' : 1,
+ 'text' : 0,
'mtext' : 0,
'block' : 1,
'insert': 1,
@@ -5557,6 +5718,7 @@ def draw_UI(): #---------------------------------------------------------------
"""
global GUI_A, GUI_B #__version__
global user_preset, iniFileName, dxfFileName, config_UI, g_scale_as
+ global model_space_on
# This is for easy layout changes
but_0c = 70 #button 1.column width
@@ -5567,8 +5729,8 @@ def draw_UI(): #---------------------------------------------------------------
butt_margin = 10
menu_w = (3 * butt_margin) + but_0c + but_1c + but_2c + but_3c #menu width
- simple_menu_h = 80
- extend_menu_h = 370
+ simple_menu_h = 100
+ extend_menu_h = 350
y = simple_menu_h # y is menu upper.y
if config_UI.val: y += extend_menu_h
x = 20 #menu left.x
@@ -5584,7 +5746,7 @@ def draw_UI(): #---------------------------------------------------------------
y += 30
colorbox(x, y+20, x+menu_w+menu_margin*2, menu_margin)
- Draw.Label("DXF-Importer ver." + __version__, but0c, y, menu_w, 20)
+ Draw.Label("DXF-Importer v" + __version__, but0c, y, menu_w, 20)
if config_UI.val:
b0, b0_ = but0c, but_0c + butt_margin
@@ -5645,25 +5807,23 @@ def draw_UI(): #---------------------------------------------------------------
y -= 10
y -= 20
Draw.BeginAlign()
- GUI_B['plmesh'] = Draw.Toggle('POLY-MESH/FACE', EVENT_NONE, b0, y, b0_+b1_, 20, GUI_B['plmesh'].val, "support dxf-POLYMESH/POLYFACE on/off")
+ GUI_B['plmesh'] = Draw.Toggle('PL-MESH/FACE', EVENT_NONE, b0, y, b0_+b1_-40, 20, GUI_B['plmesh'].val, "support dxf-POLYMESH/POLYFACE on/off")
# GUI_A['plmesh_as'] = Draw.Menu(plmesh_as_menu, EVENT_NONE, but1c, y, but_1c, 20, GUI_A['plmesh_as'].val, "select target Blender-object")
+ GUI_A['plmesh_flip'] = Draw.Toggle('N', EVENT_NONE, b1+b1_-40, y, 20, 20, GUI_A['plmesh_flip'].val, "flip DXF normals on/off")
+ GUI_A['normals_out'] = Draw.Toggle('N', EVENT_NONE, b1+b1_-20, y, 20, 20, GUI_A['normals_out'].val, "force Blender normals to outside on/off")
Draw.EndAlign()
y -= 20
- Draw.BeginAlign()
GUI_B['solid'] = Draw.Toggle('SOLID', EVENT_NONE, b0, y, b0_, 20, GUI_B['solid'].val, "support dxf-SOLID and TRACE on/off")
GUI_B['face'] = Draw.Toggle('3DFACE', EVENT_NONE, b1, y, b1_, 20, GUI_B['face'].val, "support dxf-3DFACE on/off")
# GUI_A['solids_as'] = Draw.Menu(solids_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['solids_as'].val, "select target Blender-object")
- Draw.EndAlign()
#print 'deb:support solid, trace', GUI_B['trace'].val, GUI_B['solid'].val # ------------
y -= 20
- Draw.BeginAlign()
GUI_B['text'] = Draw.Toggle('TEXT', EVENT_NONE, b0, y, b0_, 20, GUI_B['text'].val, "support dxf-TEXT on/off")
GUI_B['mtext'] = Draw.Toggle('*MTEXT', EVENT_NONE, b1, y, b1_, 20, GUI_B['mtext'].val, "(*wip)support dxf-MTEXT on/off")
# GUI_A['texts_as'] = Draw.Menu(texts_as_menu, EVENT_NONE, but3c, y, but_3c, 20, GUI_A['texts_as'].val, "select target Blender-object")
- Draw.EndAlign()
y -= 20
Draw.BeginAlign()
@@ -5671,13 +5831,14 @@ def draw_UI(): #---------------------------------------------------------------
GUI_B['insert'].val = GUI_B['block'].val
if GUI_B['block'].val:
GUI_A['block_nn'] = Draw.Toggle('n', EVENT_NONE, b1-30, y, 15, 20, GUI_A['block_nn'].val, "support hatch/noname BLOCKs *X... on/off")
- GUI_A['blockFilter_on'] = Draw.Toggle('F', EVENT_NONE, b1-15, y, 15, 20, GUI_A['blockFilter_on'].val, "(*wip) support name filtering of BLOCKs on/off")
- GUI_A['xref_on'] = Draw.Toggle('Xref', EVENT_NONE, b1, y, 20, 20, GUI_A['xref_on'].val, "support place holder for XREF-BLOCKs on/off")
+ GUI_A['xref_on'] = Draw.Toggle('Xref', EVENT_NONE, b1-15, y, 35, 20, GUI_A['xref_on'].val, "support for XREF-BLOCKs (place holders) on/off")
GUI_A['blocks_as'] = Draw.Menu(blocks_as_menu, EVENT_NONE, b1+20, y, b1_-20, 20, GUI_A['blocks_as'].val, "select target representation for imported BLOCKs")
Draw.EndAlign()
y -= 20
+ y -= 20
+
Draw.BeginAlign()
GUI_A['views_on'] = Draw.Toggle('views', EVENT_NONE, b0, y, b0_-25, 20, GUI_A['views_on'].val, "imports VIEWs and VIEWPORTs as cameras on/off")
GUI_A['cams_on'] = Draw.Toggle('*cams', EVENT_NONE, b1-25, y, b1_-25, 20, GUI_A['cams_on'].val, "(*wip) support ASHADE cameras on/off")
@@ -5688,19 +5849,28 @@ def draw_UI(): #---------------------------------------------------------------
if y < y_down: y_down = y
# -----end supported objects--------------------------------------
- b0, b0_ = but0c, but_0c + butt_margin
- b1, b1_ = but1c, but_1c
-
y_top = y_down
y = y_top
y -= 10
y -= 20
+ but_ = menu_w / 6
+ b0 = but0c + (menu_w - but_*6)/2
Draw.BeginAlign()
- GUI_A['material_on'] = Draw.Toggle('material', EVENT_REDRAW, b0, y, b0_-20, 20, GUI_A['material_on'].val, "support for material assignment on/off")
- if GUI_A['material_on'].val:
- GUI_A['material_from'] = Draw.Menu(material_from_menu, EVENT_NONE, b1-20, y, b1_+20, 20, GUI_A['material_from'].val, "material assignment from?")
+ GUI_A['paper_space_on'] = Draw.Toggle('paper', EVENT_NONE, b0+but_*0, y, but_, 20, GUI_A['paper_space_on'].val, "import only from Paper-Space on/off")
+ GUI_A['layFrozen_on'] = Draw.Toggle ('frozen', EVENT_NONE, b0+but_*1, y, but_, 20, GUI_A['layFrozen_on'].val, "import also from frozen LAYERs on/off")
+ GUI_A['layerFilter_on'] = Draw.Toggle('layer', EVENT_NONE, b0+but_*2, y, but_, 20, GUI_A['layerFilter_on'].val, "(*wip) LAYER filtering on/off")
+ GUI_A['colorFilter_on'] = Draw.Toggle('color', EVENT_NONE, b0+but_*3, y, but_, 20, GUI_A['colorFilter_on'].val, "(*wip) COLOR filtering on/off")
+ GUI_A['groupFilter_on'] = Draw.Toggle('group', EVENT_NONE, b0+but_*4, y, but_, 20, GUI_A['groupFilter_on'].val, "(*wip) GROUP filtering on/off")
+ GUI_A['blockFilter_on'] = Draw.Toggle('block', EVENT_NONE, b0+but_*5, y, but_, 20, GUI_A['blockFilter_on'].val, "(*wip) BLOCK filtering on/off")
+ #GUI_A['dummy_on'] = Draw.Toggle('-', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['dummy_on'].val, "dummy on/off")
Draw.EndAlign()
+ # -----end filters--------------------------------------
+
+ b0, b0_ = but0c, but_0c + butt_margin
+ b1, b1_ = but1c, but_1c
+
+ y -= 10
y -= 20
Draw.BeginAlign()
GUI_A['g_origin_on'] = Draw.Toggle('glob.reLoc', EVENT_REDRAW, b0, y, b0_, 20, GUI_A['g_origin_on'].val, "global relocate all DXF objects on/off")
@@ -5750,9 +5920,9 @@ def draw_UI(): #---------------------------------------------------------------
y -= 10
y -= 20
Draw.BeginAlign()
- GUI_A['meshSmooth_on'] = Draw.Toggle('smooth', EVENT_NONE, b0, y, b0_-20, 20, GUI_A['meshSmooth_on'].val, "mesh smooth for circles/arcsegments on/off")
- GUI_A['pl_trim_on'] = Draw.Toggle('trim', EVENT_NONE, b1-20, y, 32, 20, GUI_A['pl_trim_on'].val, "intersection of POLYLINE-wide-segments on/off")
- GUI_A['pl_trim_max'] = Draw.Number('', EVENT_NONE, b1+12, y, b1_-12, 20, GUI_A['pl_trim_max'].val, 0, 5, "limit for intersection of POLYLINE-wide-segments: 0.0-5.0")
+ GUI_A['meshSmooth_on'] = Draw.Toggle('smooth', EVENT_NONE, b0, y, b0_-20, 20, GUI_A['meshSmooth_on'].val, "mesh smooth for circles/arc-segments on/off")
+ GUI_A['pl_trim_on'] = Draw.Toggle('trim', EVENT_NONE, b1-20, y, 32, 20, GUI_A['pl_trim_on'].val, "clean intersection of POLYLINE-wide-segments on/off")
+ GUI_A['pl_trim_max'] = Draw.Number('', EVENT_NONE, b1+12, y, b1_-12, 20, GUI_A['pl_trim_max'].val, 0, 5, "threshold intersection of POLYLINE-wide-segments: 0.0-5.0")
Draw.EndAlign()
y -= 20
@@ -5765,21 +5935,21 @@ def draw_UI(): #---------------------------------------------------------------
y -= 20
Draw.BeginAlign()
- GUI_A['curves_on'] = Draw.Toggle('to Curves', EVENT_PRESETCURV, b0, y, b0_, 20, GUI_A['curves_on'].val, "import into curves instead into meshes on/off")
- GUI_A['curve_arc'] = Draw.Number('', EVENT_NONE, b1, y, b1_/2, 20, GUI_A['curve_arc'].val, 3, 32, "Bezier circle: amount of segments: 3-32")
- GUI_A['curve_res'] = Draw.Number('', EVENT_NONE, b1+b1_/2, y, b1_/2, 20, GUI_A['curve_res'].val, 1, 128, "Set the Curve's U-resolution value: 1-128")
+ GUI_A['curve_arc'] = Draw.Number('', EVENT_NONE, b0, y, b0_/2, 20, GUI_A['curve_arc'].val, 3, 32, "Bezier circle: amount of segments: 3-32")
+ GUI_A['curve_res'] = Draw.Number('', EVENT_NONE, b0+b0_/2, y, b0_/2, 20, GUI_A['curve_res'].val, 1, 128, "Set the Curve's U-resolution value: 1-128")
+ GUI_A['curves_on'] = Draw.Toggle('to Curves', EVENT_PRESETCURV, b1, y, b1_, 20, GUI_A['curves_on'].val, "set Curve as target object type on/off")
Draw.EndAlign()
y -= 20
- GUI_A['group_bylayer_on'] = Draw.Toggle('Lay', EVENT_NONE, b0, y, 30, 20, GUI_A['group_bylayer_on'].val, "grouping entities from the same layer on/off")
- GUI_A['vGroup_on'] = Draw.Toggle('vGroups', EVENT_NONE, b0+30, y, b1_-10, 20, GUI_A['vGroup_on'].val, "support Blender-VertexGroups on/off")
+ GUI_A['group_bylayer_on'] = Draw.Toggle('Layer', EVENT_NONE, b0, y, 30, 20, GUI_A['group_bylayer_on'].val, "DXF-entities group by layer on/off")
+ GUI_A['vGroup_on'] = Draw.Toggle('vGroups', EVENT_NONE, b0+30, y, b1_-10, 20, GUI_A['vGroup_on'].val, "sort faces into VertexGroups on/off")
GUI_A['one_mesh_on'] = Draw.Toggle('oneMesh', EVENT_NONE, b1+10, y, b1_-10, 20, GUI_A['one_mesh_on'].val, "draw DXF-entities into one mesh-object. Recommended for big DXF-files. on/off")
y -= 30
Draw.BeginAlign()
- GUI_A['paper_space_on'] = Draw.Toggle('paper space', EVENT_NONE, b0, y, b0_+20, 20, GUI_A['paper_space_on'].val, "import only layout (paper space) on/off")
- GUI_A['layFrozen_on'] = Draw.Toggle('frozen', EVENT_NONE, b1+20, y, b1_-20, 20, GUI_A['layFrozen_on'].val, "import also from frozen layers on/off")
- #GUI_A['dummy_on'] = Draw.Toggle('-', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['dummy_on'].val, "dummy on/off")
+ GUI_A['material_on'] = Draw.Toggle('material', EVENT_REDRAW, b0, y, b0_-20, 20, GUI_A['material_on'].val, "support for material assignment on/off")
+ if GUI_A['material_on'].val:
+ GUI_A['material_from'] = Draw.Menu(material_from_menu, EVENT_NONE, b1-20, y, b1_+20, 20, GUI_A['material_from'].val, "material assignment from?")
Draw.EndAlign()
y_down = y
@@ -5821,8 +5991,9 @@ def draw_UI(): #---------------------------------------------------------------
Draw.EndAlign()
y -= 30
- GUI_A['newScene_on'] = Draw.Toggle('newScene', EVENT_NONE, b0, y, b0_, 20, GUI_A['newScene_on'].val, "creates new Blender-Scene for each import on/off")
- GUI_A['target_layer'] = Draw.Number('layer', EVENT_NONE, b1, y, b1_, 20, GUI_A['target_layer'].val, 1, 18, "imports into this Blender-layer (<19> reserved for block_definitions)")
+ but, but_ = but2c, 25
+ Draw.BeginAlign()
+ Draw.EndAlign()
if y < y_down: y_down = y
# -----end options --------------------------------------
@@ -5835,45 +6006,60 @@ def draw_UI(): #---------------------------------------------------------------
y -= 30
Draw.BeginAlign()
Draw.PushButton('INI file >', EVENT_CHOOSE_INI, but0c, y, but_0c, 20, 'Select INI-file from project directory')
- iniFileName = Draw.String(' :', EVENT_NONE, but1c, y, menu_w-but_0c-butt_margin, 20, iniFileName.val, FILENAME_MAX, "write here the name of the INI-file")
+ iniFileName = Draw.String(' :', EVENT_NONE, but1c, y, menu_w-but_1c-60, 20, iniFileName.val, FILENAME_MAX, "write here the name of the INI-file")
+ but = but4c-60
+ Draw.PushButton('#', EVENT_PRESETS, but, y, 20, 20, "toggle Preset-INI-files")
+ Draw.PushButton('L', EVENT_LOAD_INI, but+20, y, 20, 20, 'Loads configuration from ini-file: %s' % iniFileName.val)
+ Draw.PushButton('S', EVENT_SAVE_INI, but+40, y, 20, 20, 'Saves configuration to ini-file: %s' % iniFileName.val)
Draw.EndAlign()
- y -= 20
- Draw.BeginAlign()
- Draw.PushButton('#', EVENT_PRESETS, but0c, y, 20, 20, "tipist for Preset-INI-files")
- Draw.PushButton('Load', EVENT_LOAD_INI, but0c+20, y, but_0c-20, 20, '.Loads configuration from ini-file: %s' % iniFileName.val)
- Draw.PushButton('Save', EVENT_SAVE_INI, but1c, y, but_1c-20, 20, 'Saves configuration to ini-file: %s' % iniFileName.val)
- Draw.EndAlign()
- but_ = (but_2c+but_3c)/4
- but = but2c
- Draw.PushButton('reset', EVENT_RESET, but, y, but_, 20, "reset configuration to defaults")
- Draw.PushButton('2D', EVENT_PRESET2D, but+but_, y, but_, 20, 'set configuration for 2D import')
- Draw.PushButton('3D', EVENT_PRESET3D, but+but_*2, y, but_, 20, 'set configuration for 3D import')
- GUI_A['optimization'] = Draw.Number('', EVENT_NONE, but4c-35, y, 35, 20, GUI_A['optimization'].val, 0, 3, "Optimization Level: 0=Debug/directDrawing, 1=Verbose, 2=ProgressBar, 3=silentMode/fastest")
+ b0, b0_ = but2c, but_2c + butt_margin
+ b1, b1_ = but3c, but_3c
y = simple_menu_h
+ bm = butt_margin/2
+
+ #y -= 10
Draw.BeginAlign()
Draw.PushButton('DXFfile >', EVENT_CHOOSE_DXF, but0c, y, but_0c, 20, 'Select DXF-file from project directory')
dxfFileName = Draw.String(' :', EVENT_NONE, but1c, y, but_1c+but_2c+but_3c-20, 20, dxfFileName.val, FILENAME_MAX, "type the name of DXF-file or type *.dxf for multi-import")
- Draw.PushButton('*.*', EVENT_DXF_DIR, but3c+but_3c-20, y, 20, 20, 'Set asterisk * as filter')
+ Draw.PushButton('*.*', EVENT_DXF_DIR, but3c+but_3c-20, y, 20, 20, 'import all dxf files from this directory')
Draw.EndAlign()
+ y -= 30
+ config_UI = Draw.Toggle('CONFIG', EVENT_REDRAW, but0c, y, but_0c+bm, 20, config_UI.val, 'Advanced configuration on/off' )
+ Draw.BeginAlign()
+ but, but_ = but1c, but_1c+bm
+ but_ /= 3
+ Draw.PushButton('X', EVENT_RESET, but, y, 15, 20, "reset configuration to defaults")
+ Draw.PushButton('2D', EVENT_PRESET2D, but+but_, y, but_, 20, 'set configuration for 2D import')
+ Draw.PushButton('3D', EVENT_PRESET3D, but+(but_*2), y, but_, 20, 'set configuration for 3D import')
+ Draw.EndAlign()
- y -= 50
Draw.BeginAlign()
- Draw.PushButton('EXIT', EVENT_EXIT, but0c, y, but_0c, 40, '' )
- Draw.PushButton('HELP', EVENT_HELP, but1c, y, but_1c-20, 20, 'calls BlenderWiki for Manual, Updates and Support.')
- Draw.PushButton('?', EVENT_LIST, but1c+but_1c-20, y, 20, 20, 'DXF analyze tool: print listing of LAYERs and BLOCKs into the text file .INF')
- Draw.PushButton('START IMPORT', EVENT_START, but2c, y, but_2c+but_3c+butt_margin, 40, 'Start the import procedure')
+ GUI_A['newScene_on'] = Draw.Toggle('newScene', EVENT_NONE, but2c, y, but_2c, 20, GUI_A['newScene_on'].val, "create new Scene for each imported dxf file on/off")
+ GUI_A['target_layer'] = Draw.Number('layer', EVENT_NONE, but3c, y, but_3c, 20, GUI_A['target_layer'].val, 1, 18, "target Blender-layer (<19> reserved for block_definitions)")
Draw.EndAlign()
- config_UI = Draw.Toggle('CONFIG', EVENT_REDRAW, but1c-butt_margin/2, y+20, but_1c+butt_margin, 20, config_UI.val, 'Advanced configuration on/off' )
+ y -= 40
+ Draw.PushButton('EXIT', EVENT_EXIT, but0c, y, but_0c+bm, 20, '' )
+ Draw.PushButton('HELP', EVENT_HELP, but1c, y, but_1c+bm, 20, 'calls DXF-Importer Manual Page on Wiki.Blender.org')
+ Draw.BeginAlign()
+ GUI_A['optimization'] = Draw.Number('', EVENT_NONE, but2c, y+20, 40, 20, GUI_A['optimization'].val, 0, 3, "Optimization Level: 0=Debug/directDrawing, 1=Verbose, 2=ProgressBar, 3=SilentMode")
+ Draw.EndAlign()
+ Draw.BeginAlign()
+ Draw.PushButton('TEST', EVENT_LIST, but2c, y, 40, 20, 'DXF-Analyze-Tool: reads data from selected dxf file and writes report in project_directory/dxf_blendname.INF')
+ Draw.PushButton('START IMPORT', EVENT_START, but2c+40, y, but_2c-40+but_3c+butt_margin, 40, 'Start the import process. For Cancel go to console and hit Ctrl-C')
+ Draw.EndAlign()
+
+
+
y -= 20
Draw.BeginAlign()
Draw.Label(' ', but0c-menu_margin, y, menu_margin, 20)
- Draw.Label("*) parts under construction", but0c, y, menu_w, 20)
+ Draw.Label(LAB, but0c, y, menu_w, 20)
Draw.Label(' ', but0c+menu_w, y, menu_margin, 20)
Draw.EndAlign()
@@ -5930,7 +6116,7 @@ def bevent(evt):
resetDefaultConfig_3D()
Draw.Redraw()
elif (evt==EVENT_PRESETCURV):
- presetConfig_curv()
+ presetConfig_curv(GUI_A['curves_on'].val)
Draw.Redraw()
elif (evt==EVENT_PRESETS):
user_preset += 1
@@ -5974,11 +6160,6 @@ http://wiki.blender.org/index.php?title=Scripts/Manual/Import/DXF-3D')
# update_RegistryKey('dxfFileName', dxfFileName.val)
GUI_A['newScene_on'].val = 1
Draw.Redraw()
-# elif (evt==EVENT_DXF_NAME):
-# dirname == Blender.sys.dirname(Blender.Get('filename'))
-# update_RegistryKey('DirName', dirname)
-# #print 'deb:EVENT_DXF_NAME dxfFileName.val:', dxfFileName.val #--------------
-# update_RegistryKey('dxfFileName', dxfFileName.val)
elif (evt==EVENT_CHOOSE_DXF):
filename = '' # '*.dxf'
if dxfFileName.val: filename = dxfFileName.val
@@ -5986,6 +6167,7 @@ http://wiki.blender.org/index.php?title=Scripts/Manual/Import/DXF-3D')
elif (evt==EVENT_START):
dxfFile = dxfFileName.val
#print 'deb: dxfFile file: ', dxfFile #----------------------
+ if E_M: dxfFileName.val, dxfFile = e_mode(dxfFile) #evaluation mode
update_RegistryKey('dxfFileName', dxfFileName.val)
if dxfFile.lower().endswith('*.dxf'):
if Draw.PupMenu('DXF importer: OK?|will import all DXF-files from:|%s' % dxfFile) == 1:
diff --git a/release/scripts/mesh_cleanup.py b/release/scripts/mesh_cleanup.py
index 608201acb98..27adca335cb 100644
--- a/release/scripts/mesh_cleanup.py
+++ b/release/scripts/mesh_cleanup.py
@@ -121,25 +121,29 @@ def rem_unused_materials(me):
material_users= dict( [(i,0) for i in xrange(len_materials)] )
for f in me.faces:
+ f_mat = f.mat
# Make sure the face index isnt too big. this happens sometimes.
- if f.mat >= len_materials:
- f.mat=0
- material_users[f.mat] += 1
+ if f_mat >= len_materials:
+ f_mat = f.mat = 0
+ material_users[f_mat] += 1
- mat_idx_subtract= 0
- reindex_mapping= dict( [(i,0) for i in xrange(len_materials)] )
- i= len_materials
- while i:
- i-=1
-
+ # mat_idx_subtract= 0
+ # reindex_mapping= dict( [(i,0) for i in xrange(len_materials)] )
+
+ reindex_mapping_ls = range(len_materials)
+ for i in range(len_materials-1, -1, -1):
if material_users[i] == 0:
- mat_idx_subtract+=1
- reindex_mapping[i]= mat_idx_subtract
- materials.pop(i)
+ del reindex_mapping_ls[i]
+ del materials[i]
rem_materials+=1
+ reindex_mapping= {}
+
+ for i, mat in enumerate(reindex_mapping_ls):
+ reindex_mapping[mat] = i
+
for f in me.faces:
- f.mat= f.mat - reindex_mapping[f.mat]
+ f.mat= reindex_mapping[f.mat]
me.materials= materials
return rem_materials
@@ -449,4 +453,4 @@ def main():
if __name__ == '__main__':
- main()
+ main() \ No newline at end of file
diff --git a/release/scripts/object_find.py b/release/scripts/object_find.py
index 0cfd6ad1d92..f12af07e3e4 100644
--- a/release/scripts/object_find.py
+++ b/release/scripts/object_find.py
@@ -61,8 +61,20 @@ def get_object_images(ob):
me.activeUVLayer = orig_uvlayer
+
+ # Now get material images
+ for mat in me.materials:
+ if mat:
+ for mtex in mat.getTextures():
+ if mtex:
+ tex = mtex.tex
+ i = tex.getImage()
+ if i: unique_images[i.name] = i
+
return unique_images.values()
+
+
# Todo, support other object types, materials
return []
@@ -118,7 +130,7 @@ def main():
def activate(ob, scn):
bpy.data.scenes.active = scn
scn.objects.selected = []
- scn.Layers = ob.Layers
+ scn.Layers = ob.Layers & (1<<20)-1
ob.sel = 1
def name_cmp(name_search, name_found):
@@ -195,11 +207,13 @@ def main():
activate(ob, scn)
return
if NAME_TEXTURE:
- for tex in mat.getTextures():
- if tex:
- if name_cmp(NAME_MATERIAL, tex.name):
- activate(ob, scn)
- return
+ for mtex in mat.getTextures():
+ if mtex:
+ tex = mtex.tex
+ if tex:
+ if name_cmp(NAME_TEXTURE, tex.name):
+ activate(ob, scn)
+ return
Draw.PupMenu('No Objects Found')
diff --git a/release/scripts/ply_export.py b/release/scripts/ply_export.py
index cecde5a0b59..19a4a60674e 100644
--- a/release/scripts/ply_export.py
+++ b/release/scripts/ply_export.py
@@ -13,7 +13,7 @@ from Blender import Mesh, Scene, Window, sys, Image, Draw
import BPyMesh
__author__ = "Bruce Merry"
-__version__ = "0.92"
+__version__ = "0.93"
__bpydoc__ = """\
This script exports Stanford PLY files from Blender. It supports normals,
colours, and texture coordinates per face or per vertex.
@@ -37,6 +37,8 @@ Only one mesh can be exported at a time.
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Vector rounding se we can use as keys
#
+# Updated on Aug 11, 2008 by Campbell Barton
+# - added 'comment' prefix to comments - Needed to comply with the PLY spec.
#
# Updated on Jan 1, 2007 by Gabe Ghearing
# - fixed normals so they are correctly smooth/flat
@@ -162,7 +164,7 @@ def file_callback(filename):
file.write('ply\n')
file.write('format ascii 1.0\n')
- file.write('Created by Blender3D %s - www.blender.org, source file: %s\n' % (Blender.Get('version'), Blender.Get('filename').split('/')[-1].split('\\')[-1] ))
+ file.write('comment Created by Blender3D %s - www.blender.org, source file: %s\n' % (Blender.Get('version'), Blender.Get('filename').split('/')[-1].split('\\')[-1] ))
file.write('element vertex %d\n' % len(verts))
@@ -210,7 +212,6 @@ def file_callback(filename):
if faceUV: uvcoord= rvec2d(uv[j])
elif vertexUV: uvcoord= rvec2d(v.uvco)
if vertexColors: color= col[j].r, col[j].g, col[j].b
- co = v.co
file.write('%d ' % vdict[v.index][normal, uvcoord, color])
diff --git a/release/scripts/rvk1_torvk2.py b/release/scripts/rvk1_torvk2.py
index c723efb61a7..a48d065813a 100644
--- a/release/scripts/rvk1_torvk2.py
+++ b/release/scripts/rvk1_torvk2.py
@@ -14,7 +14,7 @@ __url__ = ("blender", "blenderartists.org",
__version__ = "2007/04/27"
__bpydoc__ = """\
-"DEFORM to RVK2" copies deform data (except EDGESPLIT,DECIMATE,SUBSURF,BOOLEAN,
+"DEFORM to RVK2" copies deform data (except EDGESPLIT,DECIMATE,SUBSURF,BOOLEAN,
BUILD,MIRROR,ARRAY) of the active object to the RVK (relative vertex key) of
the other selected object.
@@ -25,7 +25,7 @@ key.
The new version of this scrit (Blender 2.43) manages the modifier changes.
There are a lot of modifiers but only the ones which just deforms the shape
can be used : LATTICE, CURVE, WAVE, ARMATURE. You can unset these modifiers
-from the script.
+from the script.
Usage:
@@ -35,7 +35,7 @@ the 3d View. If the active object has subsurf turned on and nonzero subdiv
level, the script will ask if it should change that. Before copying data to
the rvk it will also ask whether it should replace or add a new vertex group.
-
+
"""
#----------------------------------------------
@@ -70,7 +70,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
# Copy the rvk (1, or armature, lattice, or
# any mesh deformation except surface
@@ -83,7 +83,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# download the script :
# http://jmsoler.free.fr/util/blenderfile/py/rvk1_torvk2.py
# Communicate upon problems or errors:
-# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
+# http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender
#----------------------------------------------
# Page officielle :
# http://jmsoler.free.fr/util/blenderfile/py/rvk1_torvk2.py
@@ -101,22 +101,22 @@ def Value(t):
exec "t=Modifier.Types.%s"%t
return t
-def deform2rvk():
+def deform2rvk():
POSSMOD_list=['EDGESPLIT',
'DECIMATE',
- 'SUBSURF',
- 'BOOLEAN',
+ 'SUBSURF',
+ 'BOOLEAN',
'BUILD',
- 'MIRROR',
+ 'MIRROR',
'ARRAY']
AUTHMOD_list=['LATTICE',
- 'CURVE',
+ 'CURVE',
'WAVE',
'ARMATURE']
MODIFIERS=0
-
+
BMOD=[['Possible Modifiers'],
['Allowed Modifiers']]
@@ -129,8 +129,8 @@ def deform2rvk():
# =============================================================
# must be 2 meshes ============================================
# =============================================================
- if RVK1.getType()=='Mesh' and RVK2.getType()=='Mesh':
- FRAME=Blender.Get('curframe')
+ if RVK1.getType()=='Mesh' and RVK2.getType()=='Mesh':
+ FRAME=Blender.Get('curframe')
DATA2=RVK2.getData()
if DEBUG: print DATA2.getKey()
# ============================================================
@@ -151,7 +151,7 @@ def deform2rvk():
# === Bloc Menu Modifiers ===1 doc =================
# ===================================================
m=0
- for mod in MODRVK1:
+ for mod in MODRVK1:
if DEBUG: print mod.type
if mod.type in POSSMOD:
BMOD[0].append([Draw.Create(0),mod.type,
@@ -183,7 +183,7 @@ def deform2rvk():
retval = Blender.Draw.PupBlock("MESH 2 RVK", block)
# ===================================================
# === unset Modifiers =============================
- # ===================================================
+ # ===================================================
for B in BMOD[0][1:]:
if DEBUG: print B[2]
MODRVK1[B[2]][Modifier.Settings.RENDER]=0
@@ -193,12 +193,12 @@ def deform2rvk():
# ===================================================
# === update Modifiers =============================
# ===================================================
- RVK1.makeDisplayList()
+ #RVK1.makeDisplayList()
# =======================================================
# === get deformed mesh ================================
# =======================================================
RVK1NAME=Object.GetSelected()[0].getName()
- meshrvk1=NMesh.GetRawFromObject(RVK1NAME)
+ meshrvk1=NMesh.GetRawFromObject(RVK1NAME)
if DEBUG: print len(meshrvk1.verts)
# =======================================================
# === get normal mesh for vertex group =================
@@ -209,18 +209,18 @@ def deform2rvk():
# =======================================================
DATA2=RVK2.getData()
if DEBUG: print len(meshrvk1.verts)
- if DEBUG: print len(DATA2.verts)
+ if DEBUG: print len(DATA2.verts)
# ========================================================
# ===== is there the same number of vertices =============
# ========================================================
- if len(meshrvk1.verts)==len(DATA2.verts):
- name = "Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 "
+ if len(meshrvk1.verts)==len(DATA2.verts):
+ name = "Do you want to replace or add vertex groups ? %t| YES %x1| NO ? %x2 "
result = Draw.PupMenu(name)
- if result==1:
+ if result==1:
# =====================================================
# ===== Do we save vertex groups ? ===================
# =====================================================
- GROUPNAME2=DATA2.getVertGroupNames()
+ GROUPNAME2=DATA2.getVertGroupNames()
if len(GROUPNAME2)!=0:
for GROUP2 in GROUPNAME2:
DATA2.removeVertGroup(GROUP2)
@@ -233,11 +233,11 @@ def deform2rvk():
# ===== now copy the vertices coords =====================
# ========================================================
for v in meshrvk1.verts:
- i= meshrvk1.verts.index(v)
+ i= meshrvk1.verts.index(v)
v1=DATA2.verts[i]
for n in [0,1,2]:
v1.co[n]=v.co[n]
- DATA2.update()
+ DATA2.update()
DATA2.insertKey(FRAME,'relative')
DATA2.update()
RVK2.makeDisplayList()
@@ -251,23 +251,23 @@ def deform2rvk():
if not B[1]:
MODRVK1[B[2]][Modifier.Settings.RENDER]|=B[-2]
else:
- name = "Meshes Objects must the same number of vertices %t| Ok. %x1"
+ name = "Meshes Objects must the same number of vertices %t| Ok. %x1"
result = Draw.PupMenu(name)
return
else:
- name = "Second Object must have at least a shape key %t| Ok. %x1"
+ name = "Second Object must have at least a shape key %t| Ok. %x1"
result = Draw.PupMenu(name)
return
- else:
- name = "Object must be Meshes %t| Ok. %x1"
+ else:
+ name = "Object must be Meshes %t| Ok. %x1"
result = Draw.PupMenu(name)
- return
+ return
else :
- name = "At least 2 Meshes as to be selected %t| Ok. %x1"
+ name = "At least 2 Meshes as to be selected %t| Ok. %x1"
result = Draw.PupMenu(name)
return
- Blender.Redraw()
+ Blender.Redraw()
EDITMODE=Blender.Window.EditMode()
Blender.Window.EditMode(0)
deform2rvk()
-Blender.Window.EditMode(EDITMODE)
+Blender.Window.EditMode(EDITMODE) \ No newline at end of file
diff --git a/release/scripts/scripttemplate_text_plugin.py b/release/scripts/scripttemplate_text_plugin.py
new file mode 100644
index 00000000000..4ae562736d3
--- /dev/null
+++ b/release/scripts/scripttemplate_text_plugin.py
@@ -0,0 +1,69 @@
+#!BPY
+"""
+Name: 'Text Plugin'
+Blender: 246
+Group: 'ScriptTemplate'
+Tooltip: 'Add a new text for writing a text plugin'
+"""
+
+from Blender import Window
+import bpy
+
+script_data = \
+'''#!BPY
+"""
+Name: 'My Plugin Script'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Ctrl+Alt+U'
+Tooltip: 'Put some useful info here'
+"""
+
+# Add a licence here if you wish to re-distribute, we recommend the GPL
+
+from Blender import Window, sys
+import BPyTextPlugin, bpy
+
+def my_script_util(txt):
+ # This function prints out statistical information about a script
+
+ desc = BPyTextPlugin.get_cached_descriptor(txt)
+ print '---------------------------------------'
+ print 'Script Name:', desc.name
+ print 'Classes:', len(desc.classes)
+ print ' ', desc.classes.keys()
+ print 'Functions:', len(desc.defs)
+ print ' ', desc.defs.keys()
+ print 'Variables:', len(desc.vars)
+ print ' ', desc.vars.keys()
+
+def main():
+
+ # Gets the active text object, there can be many in one blend file.
+ txt = bpy.data.texts.active
+
+ # Silently return if the script has been run with no active text
+ if not txt:
+ return
+
+ # Text plug-ins should run quickly so we time it here
+ Window.WaitCursor(1)
+ t = sys.time()
+
+ # Run our utility function
+ my_script_util(txt)
+
+ # Timing the script is a good way to be aware on any speed hits when scripting
+ print 'Plugin script finished in %.2f seconds' % (sys.time()-t)
+ Window.WaitCursor(0)
+
+
+# This lets you import the script without running it
+if __name__ == '__main__':
+ main()
+'''
+
+new_text = bpy.data.texts.new('textplugin_template.py')
+new_text.write(script_data)
+bpy.data.texts.active = new_text
+Window.RedrawAll()
diff --git a/release/scripts/sysinfo.py b/release/scripts/sysinfo.py
index 9f24885829c..3a671e7221e 100644
--- a/release/scripts/sysinfo.py
+++ b/release/scripts/sysinfo.py
@@ -94,6 +94,8 @@ output = Blender.Text.New(output_filename)
output.write(header + "\n\n")
+output.write("%s\n\n" % Blender.Get('buildinfo'))
+
output.write("Platform: %s\n========\n\n" % sys.platform)
output.write("Python:\n======\n\n")
diff --git a/release/scripts/textplugin_functiondocs.py b/release/scripts/textplugin_functiondocs.py
new file mode 100644
index 00000000000..41c8d4842a0
--- /dev/null
+++ b/release/scripts/textplugin_functiondocs.py
@@ -0,0 +1,64 @@
+#!BPY
+"""
+Name: 'Function Documentation | Ctrl I'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Ctrl+I'
+Tooltip: 'Attempts to display documentation about the function preceding the cursor.'
+"""
+
+# Only run if we have the required modules
+try:
+ import bpy
+ from BPyTextPlugin import *
+except ImportError:
+ OK = False
+else:
+ OK = True
+
+def main():
+ txt = bpy.data.texts.active
+ if not txt:
+ return
+
+ (line, c) = current_line(txt)
+
+ # Check we are in a normal context
+ if get_context(txt) != CTX_NORMAL:
+ return
+
+ # Identify the name under the cursor
+ llen = len(line)
+ while c<llen and (line[c].isalnum() or line[c]=='_'):
+ c += 1
+
+ targets = get_targets(line, c)
+
+ # If no name under cursor, look backward to see if we're in function parens
+ if len(targets) == 0 or targets[0] == '':
+ # Look backwards for first '(' without ')'
+ b = 0
+ found = False
+ for i in range(c-1, -1, -1):
+ if line[i] == ')': b += 1
+ elif line[i] == '(':
+ b -= 1
+ if b < 0:
+ found = True
+ c = i
+ break
+ if found: targets = get_targets(line, c)
+ if len(targets) == 0 or targets[0] == '':
+ return
+
+ obj = resolve_targets(txt, targets)
+ if not obj: return
+
+ if isinstance(obj, Definition): # Local definition
+ txt.showDocs(obj.doc)
+ elif hasattr(obj, '__doc__') and obj.__doc__:
+ txt.showDocs(obj.__doc__)
+
+# Check we are running as a script and not imported as a module
+if __name__ == "__main__" and OK:
+ main()
diff --git a/release/scripts/textplugin_imports.py b/release/scripts/textplugin_imports.py
new file mode 100644
index 00000000000..ec608243c2b
--- /dev/null
+++ b/release/scripts/textplugin_imports.py
@@ -0,0 +1,91 @@
+#!BPY
+"""
+Name: 'Import Complete|Space'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Space'
+Tooltip: 'Lists modules when import or from is typed'
+"""
+
+# Only run if we have the required modules
+try:
+ import bpy, sys
+ from BPyTextPlugin import *
+except ImportError:
+ OK = False
+else:
+ OK = True
+
+def main():
+ txt = bpy.data.texts.active
+ if not txt:
+ return
+
+ line, c = current_line(txt)
+
+ # Check we are in a normal context
+ if get_context(txt) != CTX_NORMAL:
+ return
+
+ pos = line.rfind('from ', 0, c)
+
+ # No 'from' found
+ if pos == -1:
+ # Check instead for straight 'import xxxx'
+ pos2 = line.rfind('import ', 0, c)
+ if pos2 != -1:
+ pos2 += 7
+ for i in range(pos2, c):
+ if line[i]==',' or (line[i]==' ' and line[i-1]==','):
+ pos2 = i+1
+ elif not line[i].isalnum() and line[i] != '_':
+ return
+ items = [(m, 'm') for m in get_modules()]
+ items.sort(cmp = suggest_cmp)
+ txt.suggest(items, line[pos2:c].strip())
+ return
+
+ # Found 'from xxxxx' before cursor
+ immediate = True
+ pos += 5
+ for i in range(pos, c):
+ if not line[i].isalnum() and line[i] != '_' and line[i] != '.':
+ immediate = False
+ break
+
+ # Immediate 'from' followed by at most a module name
+ if immediate:
+ items = [(m, 'm') for m in get_modules()]
+ items.sort(cmp = suggest_cmp)
+ txt.suggest(items, line[pos:c])
+ return
+
+ # Found 'from' earlier, suggest import if not already there
+ pos2 = line.rfind('import ', pos, c)
+
+ # No 'import' found after 'from' so suggest it
+ if pos2 == -1:
+ txt.suggest([('import', 'k')], '')
+ return
+
+ # Immediate 'import' before cursor and after 'from...'
+ for i in range(pos2+7, c):
+ if line[i]==',' or (line[i]==' ' and line[i-1]==','):
+ pass
+ elif not line[i].isalnum() and line[i] != '_':
+ return
+ between = line[pos:pos2-1].strip()
+ try:
+ mod = get_module(between)
+ except ImportError:
+ return
+
+ items = [('*', 'k')]
+ for (k,v) in mod.__dict__.items():
+ items.append((k, type_char(v)))
+ items.sort(cmp = suggest_cmp)
+ txt.suggest(items, '')
+
+# Check we are running as a script and not imported as a module
+if __name__ == "__main__" and OK:
+ main()
diff --git a/release/scripts/textplugin_membersuggest.py b/release/scripts/textplugin_membersuggest.py
new file mode 100644
index 00000000000..7c0de78b704
--- /dev/null
+++ b/release/scripts/textplugin_membersuggest.py
@@ -0,0 +1,90 @@
+#!BPY
+"""
+Name: 'Member Suggest | .'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Period'
+Tooltip: 'Lists members of the object preceding the cursor in the current text space'
+"""
+
+# Only run if we have the required modules
+try:
+ import bpy
+ from BPyTextPlugin import *
+except ImportError:
+ OK = False
+else:
+ OK = True
+
+def main():
+ txt = bpy.data.texts.active
+ if not txt:
+ return
+
+ (line, c) = current_line(txt)
+
+ # Check we are in a normal context
+ if get_context(txt) != CTX_NORMAL:
+ return
+
+ targets = get_targets(line, c)
+
+ if targets[0] == '': # Check if we are looking at a constant [] {} '' etc.
+ i = c - len('.'.join(targets)) - 1
+ if i >= 0:
+ if line[i] == '"' or line[i] == "'":
+ targets[0] = 'str'
+ elif line[i] == '}':
+ targets[0] = 'dict'
+ elif line[i] == ']': # Could be array elem x[y] or list [y]
+ i = line.rfind('[', 0, i) - 1
+ while i >= 0:
+ if line[i].isalnum() or line[i] == '_':
+ break
+ elif line[i] != ' ' and line[i] != '\t':
+ i = -1
+ break
+ i -= 1
+ if i < 0:
+ targets[0] = 'list'
+
+ obj = resolve_targets(txt, targets[:-1])
+ if not obj:
+ return
+
+ items = []
+
+ if isinstance(obj, VarDesc):
+ obj = obj.type
+
+ if isinstance(obj, Definition): # Locally defined
+ if hasattr(obj, 'classes'):
+ items.extend([(s, 'f') for s in obj.classes.keys()])
+ if hasattr(obj, 'defs'):
+ items.extend([(s, 'f') for s in obj.defs.keys()])
+ if hasattr(obj, 'vars'):
+ items.extend([(s, 'v') for s in obj.vars.keys()])
+
+ else: # Otherwise we have an imported or builtin object
+ try:
+ attr = obj.__dict__.keys()
+ except AttributeError:
+ attr = dir(obj)
+ else:
+ if not attr: attr = dir(obj)
+
+ for k in attr:
+ try:
+ v = getattr(obj, k)
+ except (AttributeError, TypeError): # Some attributes are not readable
+ pass
+ else:
+ items.append((k, type_char(v)))
+
+ if items != []:
+ items.sort(cmp = suggest_cmp)
+ txt.suggest(items, targets[-1])
+
+# Check we are running as a script and not imported as a module
+if __name__ == "__main__" and OK:
+ main()
diff --git a/release/scripts/textplugin_outliner.py b/release/scripts/textplugin_outliner.py
new file mode 100644
index 00000000000..3879a2819a5
--- /dev/null
+++ b/release/scripts/textplugin_outliner.py
@@ -0,0 +1,142 @@
+#!BPY
+"""
+Name: 'Code Outline | Ctrl T'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Ctrl+T'
+Tooltip: 'Provides a menu for jumping to class and functions definitions.'
+"""
+
+# Only run if we have the required modules
+try:
+ import bpy
+ from BPyTextPlugin import *
+ from Blender import Draw
+except ImportError:
+ OK = False
+else:
+ OK = True
+
+def make_menu(items, eventoffs):
+ n = len(items)
+ if n < 20:
+ return [(items[i], i+1+eventoffs) for i in range(len(items))]
+
+ letters = []
+ check = 'abcdefghijklmnopqrstuvwxyz_' # Names cannot start 0-9
+ for c in check:
+ for item in items:
+ if item[0].lower() == c:
+ letters.append(c)
+ break
+
+ entries = {}
+ i = 0
+ for item in items:
+ i += 1
+ c = item[0].lower()
+ entries.setdefault(c, []).append((item, i+eventoffs))
+
+ subs = []
+ for c in letters:
+ subs.append((c, entries[c]))
+
+ return subs
+
+def find_word(txt, word):
+ i = 0
+ txt.reset()
+ while True:
+ try:
+ line = txt.readline()
+ except StopIteration:
+ break
+ c = line.find(word)
+ if c != -1:
+ txt.setCursorPos(i, c)
+ break
+ i += 1
+
+def main():
+ txt = bpy.data.texts.active
+ if not txt:
+ return
+
+ # Identify word under cursor
+ if get_context(txt) == CTX_NORMAL:
+ line, c = current_line(txt)
+ start = c-1
+ end = c
+ while start >= 0:
+ if not line[start].lower() in 'abcdefghijklmnopqrstuvwxyz0123456789_':
+ break
+ start -= 1
+ while end < len(line):
+ if not line[end].lower() in 'abcdefghijklmnopqrstuvwxyz0123456789_':
+ break
+ end += 1
+ word = line[start+1:end]
+ if word in KEYWORDS:
+ word = None
+ else:
+ word = None
+
+ script = get_cached_descriptor(txt)
+ items = []
+ desc = None
+
+ tmp = script.classes.keys()
+ tmp.sort(cmp = suggest_cmp)
+ class_menu = make_menu(tmp, len(items))
+ class_menu_length = len(tmp)
+ items.extend(tmp)
+
+ tmp = script.defs.keys()
+ tmp.sort(cmp = suggest_cmp)
+ defs_menu = make_menu(tmp, len(items))
+ defs_menu_length = len(tmp)
+ items.extend(tmp)
+
+ tmp = script.vars.keys()
+ tmp.sort(cmp = suggest_cmp)
+ vars_menu = make_menu(tmp, len(items))
+ vars_menu_length = len(tmp)
+ items.extend(tmp)
+
+ menu = [('Script %t', 0),
+ ('Classes', class_menu),
+ ('Functions', defs_menu),
+ ('Variables', vars_menu)]
+ if word:
+ menu.extend([None, ('Locate', [(word, -10)])])
+
+ i = Draw.PupTreeMenu(menu)
+ if i == -1:
+ return
+
+ # Chosen to search for word under cursor
+ if i == -10:
+ if script.classes.has_key(word):
+ desc = script.classes[word]
+ elif script.defs.has_key(word):
+ desc = script.defs[word]
+ elif script.vars.has_key(word):
+ desc = script.vars[word]
+ else:
+ find_word(txt, word)
+ return
+ else:
+ i -= 1
+ if i < class_menu_length:
+ desc = script.classes[items[i]]
+ elif i < class_menu_length + defs_menu_length:
+ desc = script.defs[items[i]]
+ elif i < class_menu_length + defs_menu_length + vars_menu_length:
+ desc = script.vars[items[i]]
+
+ if desc:
+ txt.setCursorPos(desc.lineno-1, 0)
+
+# Check we are running as a script and not imported as a module
+if __name__ == "__main__" and OK:
+ main()
diff --git a/release/scripts/textplugin_suggest.py b/release/scripts/textplugin_suggest.py
new file mode 100644
index 00000000000..d8122212d3b
--- /dev/null
+++ b/release/scripts/textplugin_suggest.py
@@ -0,0 +1,94 @@
+#!BPY
+"""
+Name: 'Suggest All | Ctrl Space'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Ctrl+Space'
+Tooltip: 'Performs suggestions based on the context of the cursor'
+"""
+
+# Only run if we have the required modules
+try:
+ import bpy
+ from BPyTextPlugin import *
+except ImportError:
+ OK = False
+else:
+ OK = True
+
+def check_membersuggest(line, c):
+ pos = line.rfind('.', 0, c)
+ if pos == -1:
+ return False
+ for s in line[pos+1:c]:
+ if not s.isalnum() and s != '_':
+ return False
+ return True
+
+def check_imports(line, c):
+ pos = line.rfind('import ', 0, c)
+ if pos > -1:
+ for s in line[pos+7:c]:
+ if not s.isalnum() and s != '_':
+ return False
+ return True
+ pos = line.rfind('from ', 0, c)
+ if pos > -1:
+ for s in line[pos+5:c]:
+ if not s.isalnum() and s != '_':
+ return False
+ return True
+ return False
+
+def main():
+ txt = bpy.data.texts.active
+ if not txt:
+ return
+
+ line, c = current_line(txt)
+
+ # Check we are in a normal context
+ if get_context(txt) != CTX_NORMAL:
+ return
+
+ # Check the character preceding the cursor and execute the corresponding script
+
+ if check_membersuggest(line, c):
+ import textplugin_membersuggest
+ textplugin_membersuggest.main()
+ return
+
+ elif check_imports(line, c):
+ import textplugin_imports
+ textplugin_imports.main()
+ return
+
+ # Otherwise we suggest globals, keywords, etc.
+ list = []
+ targets = get_targets(line, c)
+ desc = get_cached_descriptor(txt)
+
+ for k in KEYWORDS:
+ list.append((k, 'k'))
+
+ for k, v in get_builtins().items():
+ list.append((k, type_char(v)))
+
+ for k, v in desc.imports.items():
+ list.append((k, type_char(v)))
+
+ for k, v in desc.classes.items():
+ list.append((k, 'f'))
+
+ for k, v in desc.defs.items():
+ list.append((k, 'f'))
+
+ for k, v in desc.vars.items():
+ list.append((k, 'v'))
+
+ list.sort(cmp = suggest_cmp)
+ txt.suggest(list, targets[-1])
+
+# Check we are running as a script and not imported as a module
+if __name__ == "__main__" and OK:
+ main()
diff --git a/release/scripts/textplugin_templates.py b/release/scripts/textplugin_templates.py
new file mode 100644
index 00000000000..8f949563ac0
--- /dev/null
+++ b/release/scripts/textplugin_templates.py
@@ -0,0 +1,123 @@
+#!BPY
+"""
+Name: 'Template Completion | Tab'
+Blender: 246
+Group: 'TextPlugin'
+Shortcut: 'Tab'
+Tooltip: 'Completes templates based on the text preceding the cursor'
+"""
+
+# Only run if we have the required modules
+try:
+ import bpy
+ from BPyTextPlugin import *
+ from Blender import Text
+except ImportError:
+ OK = False
+else:
+ OK = True
+
+templates = {
+ 'ie':
+ 'if ${1:cond}:\n'
+ '\t${2}\n'
+ 'else:\n'
+ '\t${3}\n',
+ 'iei':
+ 'if ${1:cond}:\n'
+ '\t${2}\n'
+ 'elif:\n'
+ '\t${3}\n'
+ 'else:\n'
+ '\t${4}\n',
+ 'def':
+ 'def ${1:name}(${2:params}):\n'
+ '\t"""(${2}) - ${3:comment}"""\n'
+ '\t${4}',
+ 'cls':
+ 'class ${1:name}(${2:parent}):\n'
+ '\t"""${3:docs}"""\n'
+ '\t\n'
+ '\tdef __init__(self, ${4:params}):\n'
+ '\t\t"""Creates a new ${1}"""\n'
+ '\t\t${5}',
+ 'class':
+ 'class ${1:name}(${2:parent}):\n'
+ '\t"""${3:docs}"""\n'
+ '\t\n'
+ '\tdef __init__(self, ${4:params}):\n'
+ '\t\t"""Creates a new ${1}"""\n'
+ '\t\t${5}'
+}
+
+def main():
+ txt = bpy.data.texts.active
+ if not txt:
+ return
+
+ row, c = txt.getCursorPos()
+ line = txt.asLines(row, row+1)[0]
+ indent=0
+ while indent<c and (line[indent]==' ' or line[indent]=='\t'):
+ indent += 1
+
+ # Check we are in a normal context
+ if get_context(txt) != CTX_NORMAL:
+ return
+
+ targets = get_targets(line, c-1);
+ if len(targets) != 1: return
+
+ color = (0, 192, 32)
+
+ for trigger, template in templates.items():
+ if trigger != targets[0]: continue
+ inserts = {}
+ txt.delete(-len(trigger)-1)
+ y, x = txt.getCursorPos()
+ first = None
+
+ # Insert template text and parse for insertion points
+ count = len(template); i = 0
+ while i < count:
+ if i<count-1 and template[i]=='$' and template[i+1]=='{':
+ i += 2
+ e = template.find('}', i)
+ item = template[i:e].split(':')
+ if len(item)<2: item.append('')
+ if not inserts.has_key(item[0]):
+ inserts[item[0]] = (item[1], [(x, y)])
+ else:
+ inserts[item[0]][1].append((x, y))
+ item[1] = inserts[item[0]][0]
+ if not first: first = (item[1], x, y)
+ txt.insert(item[1])
+ x += len(item[1])
+ i = e
+ else:
+ txt.insert(template[i])
+ if template[i] == '\n':
+ txt.insert(line[:indent])
+ y += 1
+ x = indent
+ else:
+ x += 1
+ i += 1
+
+ # Insert markers at insertion points
+ for id, (text, points) in inserts.items():
+ for x, y in points:
+ txt.setCursorPos(y, x)
+ txt.setSelectPos(y, x+len(text))
+ txt.markSelection((hash(text)+int(id)) & 0xFFFF, color,
+ Text.TMARK_TEMP | Text.TMARK_EDITALL)
+ if first:
+ text, x, y = first
+ txt.setCursorPos(y, x)
+ txt.setSelectPos(y, x+len(text))
+ break
+
+
+# Check we are running as a script and not imported as a module
+if __name__ == "__main__" and OK:
+ main()
diff --git a/release/scripts/weightpaint_clean.py b/release/scripts/weightpaint_clean.py
index ba1896f011e..ca2184bade4 100644
--- a/release/scripts/weightpaint_clean.py
+++ b/release/scripts/weightpaint_clean.py
@@ -25,7 +25,7 @@ It removes very low weighted verts from the current group with a weight option.
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -51,13 +51,14 @@ def weightClean(me, PREF_THRESH, PREF_KEEP_SINGLE, PREF_OTHER_GROUPS):
for wd in vWeightDict:
l = len(wd)
if not PREF_KEEP_SINGLE or l > 1:
+ # cant use iteritems because the dict is having items removed
for group in wd.keys():
w= wd[group]
if w <= PREF_THRESH:
# small weight, remove.
del wd[group]
rem_count +=1
- l-=1
+ l-=1
if PREF_KEEP_SINGLE and l == 1:
break
@@ -117,4 +118,4 @@ def main():
Draw.PupMenu('Removed %i verts from groups' % rem_count)
if __name__=='__main__':
- main() \ No newline at end of file
+ main()
diff --git a/release/text/copyright.txt b/release/text/copyright.txt
index 6082af3033f..9f49dd4587a 100644
--- a/release/text/copyright.txt
+++ b/release/text/copyright.txt
@@ -56,7 +56,7 @@
information, claims of third parties, damages as a result of injury to
any person, or any other loss) arising out of or in connection with the
license granted under this License Agreement or the use of or inability
- to use the Software, even if VF has been advised of the possibility of
+ to use the Software, even if BF has been advised of the possibility of
such damages.
5. User warning and indemnification
diff --git a/source/Makefile b/source/Makefile
index d06962cbe3f..aebeb8f30c2 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -104,6 +104,8 @@ COMLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
COMLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a
COMLIB += $(OCGDIR)/blender/avi/$(DEBUG_DIR)libavi.a
COMLIB += $(NAN_JPEG)/lib/libjpeg.a
+COMLIB += $(OCGDIR)/blender/gpu/$(DEBUG_DIR)libgpu.a
+COMLIB += $(NAN_GLEW)/lib/libglew.a
ifneq ($(NAN_NO_KETSJI),true)
COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a
@@ -157,7 +159,6 @@ COMLIB += $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a
COMLIB += $(NAN_PNG)/lib/libpng.a
COMLIB += $(OCGDIR)/blender/yafray/$(DEBUG_DIR)libyafrayexport.a
COMLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
-COMLIB += $(NAN_GLEW)/lib/libglew.a
ifeq ($(WITH_QUICKTIME), true)
COMLIB += $(OCGDIR)/blender/blenderqt/$(DEBUG_DIR)libblenderqt.a
@@ -250,6 +251,7 @@ SPLIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
# but somehow it consistently fails to resolve these symbols... or
# can I just not check them? nm claims they aren't...
SPLIB += $(OCGDIR)/blender/blenkernel/blenkernel_blc/$(DEBUG_DIR)libblenkernel_blc.a
+SPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
# These three need to be explicitly mentioned on the cl, because
# if they are offered as a lib, they are optimized away. (nzc)
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 966bf5f7be4..a21eadf15fa 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SUBDIRS(avi nodes blenkernel blenlib blenloader blenpluginapi imbuf imbuf/intern/cineon makesdna python radiosity readblenfile render src yafray)
+SUBDIRS(avi nodes blenkernel blenlib blenloader blenpluginapi imbuf imbuf/intern/cineon gpu makesdna python radiosity readblenfile render src yafray)
IF(WITH_INTERNATIONAL)
SUBDIRS(ftfont)
diff --git a/source/blender/Makefile b/source/blender/Makefile
index 937512f34bd..52abd2cdddb 100644
--- a/source/blender/Makefile
+++ b/source/blender/Makefile
@@ -33,7 +33,7 @@ include nan_definitions.mk
DIRS = blenloader readblenfile
DIRS += avi imbuf render radiosity blenlib blenkernel blenpluginapi
DIRS += makesdna src yafray
-DIRS += python nodes
+DIRS += python nodes gpu
ifeq ($(WITH_FREETYPE2), true)
DIRS += ftfont
diff --git a/source/blender/SConscript b/source/blender/SConscript
index 09d30ddafd0..6ab6110d5ea 100644
--- a/source/blender/SConscript
+++ b/source/blender/SConscript
@@ -7,6 +7,7 @@ SConscript(['avi/SConscript',
'blenlib/SConscript',
'blenloader/SConscript',
'blenpluginapi/SConscript',
+ 'gpu/SConscript',
'imbuf/SConscript',
'imbuf/intern/cineon/SConscript',
'makesdna/SConscript',
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index f61b300f708..171a73f72c4 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -55,6 +55,7 @@ struct EditMesh;
struct ModifierData;
struct MCol;
struct ColorBand;
+struct GPUVertexAttribs;
/* number of sub-elements each mesh element has (for interpolation) */
#define SUB_ELEMS_VERT 0
@@ -198,7 +199,8 @@ struct DerivedMesh {
*
* Also called for *final* editmode DerivedMeshes
*/
- void (*drawFacesSolid)(DerivedMesh *dm, int (*setMaterial)(int));
+ void (*drawFacesSolid)(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs));
/* Draw all faces
* o If useTwoSided, draw front and back using col arrays
@@ -215,6 +217,13 @@ struct DerivedMesh {
int (*setDrawOptions)(struct MTFace *tface,
struct MCol *mcol, int matnr));
+ /* Draw all faces with GLSL materials
+ * o setMaterial is called for every different material nr
+ * o Only if setMaterial returns true
+ */
+ void (*drawFacesGLSL)(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs));
+
/* Draw mapped faces (no color, or texture)
* o Only if !setDrawOptions or
* setDrawOptions(userData, mapped-face-index, drawSmooth_r)
@@ -241,6 +250,15 @@ struct DerivedMesh {
int index),
void *userData);
+ /* Draw mapped faces with GLSL materials
+ * o setMaterial is called for every different material nr
+ * o setDrawOptions is called for every face
+ * o Only if setMaterial and setDrawOptions return true
+ */
+ void (*drawMappedFacesGLSL)(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs),
+ int (*setDrawOptions)(void *userData, int index), void *userData);
+
/* Draw mapped edges as lines
* o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge)
* returns true
@@ -437,5 +455,36 @@ void weight_to_rgb(float input, float *fr, float *fg, float *fb);
/* determines required DerivedMesh data according to view and edit modes */
CustomDataMask get_viewedit_datamask();
+/* convert layers requested by a GLSL material to actually available layers in
+ * the DerivedMesh, with both a pointer for arrays and an offset for editmesh */
+typedef struct DMVertexAttribs {
+ struct {
+ struct MTFace *array;
+ int emOffset, glIndex;
+ } tface[MAX_MTFACE];
+
+ struct {
+ struct MCol *array;
+ int emOffset, glIndex;
+ } mcol[MAX_MCOL];
+
+ struct {
+ float (*array)[3];
+ int emOffset, glIndex;
+ } tang;
+
+ struct {
+ float (*array)[3];
+ int emOffset, glIndex;
+ } orco;
+
+ int tottface, totmcol, tottang, totorco;
+} DMVertexAttribs;
+
+void DM_vertex_attributes_from_gpu(DerivedMesh *dm,
+ struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs);
+
+void DM_add_tangent_layer(DerivedMesh *dm);
+
#endif
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 716eac81b55..4a13fa31f6c 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -159,7 +159,7 @@ float get_action_frame(struct Object *ob, float cframe);
/* map strip time to global time (frame nr) */
float get_action_frame_inv(struct Object *ob, float cframe);
/* builds a list of NlaIpoChannel with ipo values to write in datablock */
-void extract_ipochannels_from_action(ListBase *lb, struct ID *id, struct bAction *act, char *name, float ctime);
+void extract_ipochannels_from_action(ListBase *lb, struct ID *id, struct bAction *act, const char *name, float ctime);
/* write values returned by extract_ipochannels_from_action, returns the number of value written */
int execute_ipochannels(ListBase *lb);
diff --git a/source/blender/blenkernel/BKE_bad_level_calls.h b/source/blender/blenkernel/BKE_bad_level_calls.h
index 3e45749c26a..8dee9a27f49 100644
--- a/source/blender/blenkernel/BKE_bad_level_calls.h
+++ b/source/blender/blenkernel/BKE_bad_level_calls.h
@@ -115,10 +115,6 @@ void free_editArmature(void);
void docenter_new(void);
int saveover(char *str);
-/* image.c */
-#include "DNA_image_types.h"
-void free_realtime_image(Image *ima); // has to become a callback, opengl stuff
-
/* ipo.c */
void copy_view3d_lock(short val); // was a hack, to make scene layer ipo's possible
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index f76cdbc64b7..e403fc33e06 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -40,8 +40,8 @@ extern "C" {
struct ListBase;
struct MemFile;
-#define BLENDER_VERSION 246
-#define BLENDER_SUBVERSION 0
+#define BLENDER_VERSION 247
+#define BLENDER_SUBVERSION 1
#define BLENDER_MINVERSION 245
#define BLENDER_MINSUBVERSION 15
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
new file mode 100644
index 00000000000..dd9ea61f24b
--- /dev/null
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -0,0 +1,98 @@
+/**
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2006 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): André Pinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BKE_BVHUTILS_H
+#define BKE_BVHUTILS_H
+
+#include "BLI_kdopbvh.h"
+
+/*
+ * This header encapsulates necessary code to buld a BVH
+ */
+
+struct DerivedMesh;
+struct MVert;
+struct MFace;
+
+/*
+ * struct that kepts basic information about a BVHTree build from a mesh
+ */
+typedef struct BVHTreeFromMesh
+{
+ struct BVHTree *tree;
+
+ /* default callbacks to bvh nearest and raycast */
+ BVHTree_NearestPointCallback nearest_callback;
+ BVHTree_RayCastCallback raycast_callback;
+
+ /* Mesh represented on this BVHTree */
+ struct DerivedMesh *mesh;
+
+ /* Vertex array, so that callbacks have instante access to data */
+ struct MVert *vert;
+ struct MFace *face;
+
+ /* radius for raycast */
+ float sphere_radius;
+
+} BVHTreeFromMesh;
+
+/*
+ * Builds a bvh tree where nodes are the vertexs of the given mesh.
+ * Configures BVHTreeFromMesh.
+ *
+ * The tree is build in mesh space coordinates, this means special care must be made on queries
+ * so that the coordinates and rays are first translated on the mesh local coordinates.
+ * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse
+ * a BVHTree.
+ *
+ * free_bvhtree_from_mesh should be called when the tree is no longer needed.
+ */
+void bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
+
+/*
+ * Builds a bvh tree where nodes are the faces of the given mesh.
+ * Configures BVHTreeFromMesh.
+ *
+ * The tree is build in mesh space coordinates, this means special care must be made on queries
+ * so that the coordinates and rays are first translated on the mesh local coordinates.
+ * Reason for this is that later bvh_from_mesh_* might use a cache system and so it becames possible to reuse
+ * a BVHTree.
+ *
+ * free_bvhtree_from_mesh should be called when the tree is no longer needed.
+ */
+void bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
+
+/*
+ * Frees data allocated by a call to bvhtree_from_mesh_*.
+ */
+void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data);
+
+#endif
+
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index 2966d932a49..c483148e4de 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -119,8 +119,10 @@ FaceCollPair;
/////////////////////////////////////////////////
// used in modifier.c from collision.c
/////////////////////////////////////////////////
+
BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert *x, unsigned int numverts, float epsilon );
void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int numfaces, MVert *x, MVert *xnew, int numverts, int moving );
+
/////////////////////////////////////////////////
LinkNode *BLI_linklist_append_fast ( LinkNode **listp, void *ptr );
@@ -134,6 +136,15 @@ void collisions_compute_barycentric ( float pv[3], float p1[3], float p2[3], flo
void interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float v3[3], double w1, double w2, double w3 );
/////////////////////////////////////////////////
+// used in effect.c
+/////////////////////////////////////////////////
+CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj);
+
+/////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////
#endif
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h
index e78882220a9..555b467b1d6 100644
--- a/source/blender/blenkernel/BKE_colortools.h
+++ b/source/blender/blenkernel/BKE_colortools.h
@@ -57,6 +57,7 @@ void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf);
void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
void curvemapping_initialize(struct CurveMapping *cumap);
+void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
#endif
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index e84c7d30956..c84b690bc49 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -32,9 +32,11 @@
#ifndef BKE_CUSTOMDATA_H
#define BKE_CUSTOMDATA_H
+#include "BLO_sys_types.h" // for intptr_t support
+
struct CustomData;
struct CustomDataLayer;
-typedef long CustomDataMask;
+typedef intptr_t CustomDataMask;
extern const CustomDataMask CD_MASK_BAREMESH;
extern const CustomDataMask CD_MASK_MESH;
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index a1975dd4265..e982806a6cc 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -38,6 +38,7 @@
struct Object;
struct ListBase;
struct bDeformGroup;
+struct MDeformVert;
void copy_defgroups (struct ListBase *lb1, struct ListBase *lb2);
struct bDeformGroup *copy_defgroup (struct bDeformGroup *ingroup);
@@ -46,5 +47,8 @@ int get_defgroup_num (struct Object *ob, struct bDeformGroup *dg);
int get_named_vertexgroup_num (Object *ob, char *name);
void unique_vertexgroup_name (struct bDeformGroup *dg, struct Object *ob);
+float deformvert_get_weight(const struct MDeformVert *dvert, int group_num);
+float vertexgroup_get_vertex_weight(const struct MDeformVert *dvert, int index, int group_num);
+
#endif
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 3763a659f2f..6475f7a71ac 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -37,6 +37,7 @@ struct Effect;
struct ListBase;
struct Particle;
struct Group;
+struct RNG;
typedef struct pEffectorCache {
struct pEffectorCache *next, *prev;
@@ -64,6 +65,11 @@ struct ListBase *pdInitEffectors(struct Object *obsrc, struct Group *group);
void pdEndEffectors(struct ListBase *lb);
void pdDoEffectors(struct ListBase *lb, float *opco, float *force, float *speed, float cur_time, float loc_time, unsigned int flags);
+/* required for particle_system.c */
+void do_physical_effector(Object *ob, float *opco, short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise_factor, float charge, float pa_size);
+float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float *vec_to_part);
+
+
#endif
diff --git a/source/blender/blenkernel/BKE_endian.h b/source/blender/blenkernel/BKE_endian.h
index 1757103eaf6..dc5efd5ea46 100644
--- a/source/blender/blenkernel/BKE_endian.h
+++ b/source/blender/blenkernel/BKE_endian.h
@@ -33,11 +33,11 @@
#define BKE_ENDIANNESS(a) { \
union { \
- long l; \
- char c[sizeof (long)]; \
+ intptr_t l; \
+ char c[sizeof (intptr_t)]; \
} u; \
u.l = 1; \
- a = (u.c[sizeof (long) - 1] == 1) ? 1 : 0; \
+ a = (u.c[sizeof (intptr_t) - 1] == 1) ? 1 : 0; \
}
#endif
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 8c9634cba06..1cc336db69e 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -218,8 +218,15 @@ typedef struct Global {
#define G_FILE_NO_UI (1 << 10)
#define G_FILE_GAME_TO_IPO (1 << 11)
#define G_FILE_GAME_MAT (1 << 12)
-#define G_FILE_DIAPLAY_LISTS (1 << 13)
+#define G_FILE_DISPLAY_LISTS (1 << 13)
#define G_FILE_SHOW_PHYSICS (1 << 14)
+#define G_FILE_GAME_MAT_GLSL (1 << 15)
+#define G_FILE_GLSL_NO_LIGHTS (1 << 16)
+#define G_FILE_GLSL_NO_SHADERS (1 << 17)
+#define G_FILE_GLSL_NO_SHADOWS (1 << 18)
+#define G_FILE_GLSL_NO_RAMPS (1 << 19)
+#define G_FILE_GLSL_NO_NODES (1 << 20)
+#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21)
/* G.windowstate */
#define G_WINDOWSTATE_USERDEF 0
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 2d7d0e9286f..2274c54ad3b 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -46,6 +46,7 @@ struct ID;
typedef union {
int i;
float f;
+ double d;
char *str;
struct ID *id;
struct {
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index d4ae76e8984..2ca4b3aa39a 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -68,7 +68,6 @@ void mball_to_mesh(struct ListBase *lb, struct Mesh *me);
void nurbs_to_mesh(struct Object *ob);
void free_dverts(struct MDeformVert *dvert, int totvert);
void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert); /* __NLA */
-int update_realtime_texture(struct MTFace *tface, double time);
void mesh_delete_material_index(struct Mesh *me, int index);
void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index b3b68a9b3ff..01c54663c6d 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -47,6 +47,9 @@ struct rctf;
struct ListBase;
struct RenderData;
struct Scene;
+struct GPUMaterial;
+struct GPUNode;
+struct GPUNodeStack;
#define SOCK_IN 1
#define SOCK_OUT 2
@@ -91,6 +94,9 @@ typedef struct bNodeType {
void *pynode; /* holds pointer to python script */
void *pydict; /* holds pointer to python script dictionary (scope)*/
+ /* gpu */
+ int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out);
+
} bNodeType;
/* node->exec, now in use for composites (#define for break is same as ready yes) */
@@ -252,6 +258,8 @@ void nodeShaderSynchronizeID(struct bNode *node, int copyto);
extern void (*node_shader_lamp_loop)(struct ShadeInput *, struct ShadeResult *);
void set_node_shader_lamp_loop(void (*lamp_loop_func)(struct ShadeInput *, struct ShadeResult *));
+void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat);
+
/* ************** COMPOSITE NODES *************** */
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
new file mode 100644
index 00000000000..e8276238ff2
--- /dev/null
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -0,0 +1,146 @@
+/**
+ * BKE_shrinkwrap.h
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BKE_SHRINKWRAP_H
+#define BKE_SHRINKWRAP_H
+
+/* mesh util */
+//TODO: move this somewhere else
+#include "BKE_customdata.h"
+struct DerivedMesh;
+struct Object;
+struct DerivedMesh *object_get_derived_final(struct Object *ob, CustomDataMask dataMask);
+
+
+/* SpaceTransform stuff */
+/*
+ * TODO: move this somewhere else
+ *
+ * this structs encapsulates all needed data to convert between 2 coordinate spaces
+ * (where conversion can be represented by a matrix multiplication)
+ *
+ * This is used to reduce the number of arguments to pass to functions that need to perform
+ * this kind of operation and make it easier for the coder, as he/she doenst needs to recode
+ * the matrix calculation.
+ *
+ * A SpaceTransform is initialized using:
+ * space_transform_setup( &data, ob1, ob2 )
+ *
+ * After that the following calls can be used:
+ * space_transform_apply (&data, co); //converts a coordinate in ob1 coords space to the corresponding ob2 coords
+ * space_transform_invert(&data, co); //converts a coordinate in ob2 coords space to the corresponding ob1 coords
+ *
+ * //Same Concept as space_transform_apply and space_transform_invert, but no is normalized after conversion
+ * space_transform_apply_normal (&data, &no);
+ * space_transform_invert_normal(&data, &no);
+ *
+ */
+struct Object;
+
+typedef struct SpaceTransform
+{
+ float local2target[4][4];
+ float target2local[4][4];
+
+} SpaceTransform;
+
+void space_transform_from_matrixs(SpaceTransform *data, float local[][4], float target[][4]);
+#define space_transform_setup(data, local, target) space_transform_from_matrixs(data, (local)->obmat, (target)->obmat)
+
+void space_transform_apply (const SpaceTransform *data, float *co);
+void space_transform_invert(const SpaceTransform *data, float *co);
+
+void space_transform_apply_normal (const SpaceTransform *data, float *no);
+void space_transform_invert_normal(const SpaceTransform *data, float *no);
+
+/* Shrinkwrap stuff */
+#include "BKE_bvhutils.h"
+
+/*
+ * Shrinkwrap is composed by a set of functions and options that define the type of shrink.
+ *
+ * 3 modes are available:
+ * - Nearest vertex
+ * - Nearest surface
+ * - Normal projection
+ *
+ * ShrinkwrapCalcData encapsulates all needed data for shrinkwrap functions.
+ * (So that you dont have to pass an enormous ammount of arguments to functions)
+ */
+
+struct Object;
+struct DerivedMesh;
+struct ShrinkwrapModifierData;
+struct BVHTree;
+
+
+typedef struct ShrinkwrapCalcData
+{
+ ShrinkwrapModifierData *smd; //shrinkwrap modifier data
+
+ struct Object *ob; //object we are applying shrinkwrap to
+ struct DerivedMesh *original; //mesh before shrinkwrap
+
+ float (*vertexCos)[3]; //vertexs being shrinkwraped
+ int numVerts;
+
+ struct DerivedMesh *target; //mesh we are shrinking to
+ SpaceTransform local2target; //transform to move bettwem local and target space
+
+ float keepDist; //Distance to kept from target (units are in local space)
+
+} ShrinkwrapCalcData;
+
+void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *data);
+void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *data);
+void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data);
+
+void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts);
+
+/*
+ * This function casts a ray in the given BVHTree.. but it takes into consideration the space_transform, that is:
+ *
+ * if transf was configured with "space_transform_setup( &transf, ob1, ob2 )"
+ * then the input (vert, dir, BVHTreeRayHit) must be defined in ob1 coordinates space
+ * and the BVHTree must be built in ob2 coordinate space.
+ *
+ * Thus it provides an easy way to cast the same ray across several trees (where each tree was built on its own coords space)
+ */
+int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+
+/*
+ * NULL initializers to local data
+ */
+#define NULL_ShrinkwrapCalcData {NULL, }
+#define NULL_BVHTreeFromMesh {NULL, }
+#define NULL_BVHTreeRayHit {NULL, }
+#define NULL_BVHTreeNearest {0, }
+
+
+#endif
+
diff --git a/source/blender/blenkernel/BKE_suggestions.h b/source/blender/blenkernel/BKE_suggestions.h
new file mode 100644
index 00000000000..d58b8f58bf5
--- /dev/null
+++ b/source/blender/blenkernel/BKE_suggestions.h
@@ -0,0 +1,93 @@
+/**
+ * $Id: $
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008, Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BKE_SUGGESTIONS_H
+#define BKE_SUGGESTIONS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ****************************************************************************
+Suggestions should be added in sorted order although a linear sorting method is
+implemented. The list is then divided up based on the prefix provided by
+update_suggestions:
+
+Example:
+ Prefix: ab
+ aaa <-- first
+ aab
+ aba <-- firstmatch
+ abb <-- lastmatch
+ baa
+ bab <-- last
+**************************************************************************** */
+
+struct Text;
+
+typedef struct SuggItem {
+ struct SuggItem *prev, *next;
+ char *name;
+ char type;
+} SuggItem;
+
+typedef struct SuggList {
+ SuggItem *first, *last;
+ SuggItem *firstmatch, *lastmatch;
+ SuggItem *selected;
+ int top;
+} SuggList;
+
+/* Free all text tool memory */
+void free_texttools();
+
+/* Used to identify which Text object the current tools should appear against */
+void texttool_text_set_active(Text *text);
+void texttool_text_clear();
+short texttool_text_is_active(Text *text);
+
+/* Suggestions */
+void texttool_suggest_add(const char *name, char type);
+void texttool_suggest_prefix(const char *prefix);
+void texttool_suggest_clear();
+SuggItem *texttool_suggest_first();
+SuggItem *texttool_suggest_last();
+void texttool_suggest_select(SuggItem *sel);
+SuggItem *texttool_suggest_selected();
+int *texttool_suggest_top();
+
+/* Documentation */
+void texttool_docs_show(const char *docs);
+char *texttool_docs_get();
+void texttool_docs_clear();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 6f891ab4887..002c804f17f 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -52,20 +52,24 @@ void txt_free_cut_buffer (void);
char* txt_to_buf (struct Text *text);
void txt_clean_text (struct Text *text);
void txt_order_cursors (struct Text *text);
-int txt_find_string (struct Text *text, char *findstr);
+int txt_find_string (struct Text *text, char *findstr, int wrap);
int txt_has_sel (struct Text *text);
int txt_get_span (struct TextLine *from, struct TextLine *to);
void txt_move_up (struct Text *text, short sel);
void txt_move_down (struct Text *text, short sel);
void txt_move_left (struct Text *text, short sel);
void txt_move_right (struct Text *text, short sel);
+void txt_jump_left (struct Text *text, short sel);
+void txt_jump_right (struct Text *text, short sel);
void txt_move_bof (struct Text *text, short sel);
void txt_move_eof (struct Text *text, short sel);
void txt_move_bol (struct Text *text, short sel);
void txt_move_eol (struct Text *text, short sel);
void txt_move_toline (struct Text *text, unsigned int line, short sel);
+void txt_move_to (struct Text *text, unsigned int line, unsigned int ch, short sel);
void txt_pop_sel (struct Text *text);
void txt_delete_char (struct Text *text);
+void txt_delete_word (struct Text *text);
void txt_copy_sel (struct Text *text);
void txt_sel_all (struct Text *text);
void txt_sel_line (struct Text *text);
@@ -80,8 +84,10 @@ void txt_do_undo (struct Text *text);
void txt_do_redo (struct Text *text);
void txt_split_curline (struct Text *text);
void txt_backspace_char (struct Text *text);
+void txt_backspace_word (struct Text *text);
int txt_add_char (struct Text *text, char add);
-void txt_find_panel (struct SpaceText *st, int again);
+int txt_replace_char (struct Text *text, char add);
+void find_and_replace (struct SpaceText *st, short mode);
void run_python_script (struct SpaceText *st);
int jumptoline_interactive (struct SpaceText *st);
void txt_export_to_object (struct Text *text);
@@ -94,6 +100,17 @@ int setcurr_tab (struct Text *text);
void convert_tabs (struct SpaceText *st, int tab);
void txt_copy_clipboard (struct Text *text);
void txt_paste_clipboard (struct Text *text);
+
+void txt_add_marker (struct Text *text, struct TextLine *line, int start, int end, char color[4], int group, int flags);
+short txt_clear_marker_region (struct Text *text, struct TextLine *line, int start, int end, int group, int flags);
+short txt_clear_markers (struct Text *text, int group, int flags);
+struct TextMarker *txt_find_marker (struct Text *text, struct TextLine *line, int curs, int group, int flags);
+struct TextMarker *txt_find_marker_region (struct Text *text, struct TextLine *line, int start, int end, int group, int flags);
+struct TextMarker *txt_prev_marker (struct Text *text, struct TextMarker *marker);
+struct TextMarker *txt_next_marker (struct Text *text, struct TextMarker *marker);
+struct TextMarker *txt_prev_marker_color (struct Text *text, struct TextMarker *marker);
+struct TextMarker *txt_next_marker_color (struct Text *text, struct TextMarker *marker);
+
/* Undo opcodes */
/* Simple main cursor movement */
@@ -135,6 +152,14 @@ void txt_paste_clipboard (struct Text *text);
#define UNDO_COMMENT 034
#define UNDO_UNCOMMENT 035
+/* Find and replace flags */
+#define TXT_FIND_WRAP 0x01
+#define TXT_FIND_ALLTEXTS 0x02
+
+/* Marker flags */
+#define TMARK_TEMP 0x01 /* Remove on non-editing events, don't save */
+#define TMARK_EDITALL 0x02 /* Edit all markers of the same group as one */
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index 78a8f60caeb..cfcae3c44bc 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -53,6 +53,7 @@ void free_plugin_tex(struct PluginTex *pit);
void init_colorband(struct ColorBand *coba, int rangetype);
struct ColorBand *add_colorband(int rangetype);
int do_colorband(struct ColorBand *coba, float in, float out[4]);
+void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
void default_tex(struct Tex *tex);
struct Tex *add_texture(char *name);
@@ -62,6 +63,7 @@ struct Tex *copy_texture(struct Tex *tex);
void make_local_texture(struct Tex *tex);
void autotexname(struct Tex *tex);
struct Tex *give_current_texture(struct Object *ob, int act);
+struct Tex *give_current_world_texture(void);
struct TexMapping *add_mapping(void);
void init_mapping(struct TexMapping *texmap);
@@ -72,6 +74,7 @@ void BKE_free_envmap(struct EnvMap *env);
struct EnvMap *BKE_add_envmap(void);
struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
+int BKE_texture_dependsOnTime(const struct Tex *texture);
#endif
diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h
index a96a3e10f40..d647a74c6e2 100644
--- a/source/blender/blenkernel/BKE_utildefines.h
+++ b/source/blender/blenkernel/BKE_utildefines.h
@@ -55,6 +55,8 @@
#define ELEM7(a, b, c, d, e, f, g, h) ( ELEM3(a, b, c, d) || ELEM4(a, e, f, g, h) )
#define ELEM8(a, b, c, d, e, f, g, h, i) ( ELEM4(a, b, c, d, e) || ELEM4(a, f, g, h, i) )
#define ELEM9(a, b, c, d, e, f, g, h, i, j) ( ELEM4(a, b, c, d, e) || ELEM5(a, f, g, h, i, j) )
+#define ELEM10(a, b, c, d, e, f, g, h, i, j, k) ( ELEM4(a, b, c, d, e) || ELEM6(a, f, g, h, i, j, k) )
+#define ELEM11(a, b, c, d, e, f, g, h, i, j, k, l) ( ELEM4(a, b, c, d, e) || ELEM7(a, f, g, h, i, j, k, l) )
/* shift around elements */
#define SHIFT3(type, a, b, c) { type tmp; tmp = a; a = c; c = b; b = tmp; }
@@ -197,8 +199,8 @@
/* Warning-free macros for storing ints in pointers. Use these _only_
* for storing an int in a pointer, not a pointer in an int (64bit)! */
-#define SET_INT_IN_POINTER(i) ((void*)(long)(i))
-#define GET_INT_FROM_POINTER(i) ((int)(long)(i))
+#define SET_INT_IN_POINTER(i) ((void*)(intptr_t)(i))
+#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
#endif
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 9088b410e27..0345711c9c3 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -32,7 +32,7 @@ SET(INC
../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern
../../../intern/iksolver/extern ../blenloader ../quicktime
../../../intern/bmfont ../../../extern/bullet2/src
- ../nodes
+ ../nodes ../../../extern/glew/include ../gpu
${SDL_INC}
${ZLIB_INC}
${PYTHON_INC}
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 1bb98239a68..db67251f44e 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -10,6 +10,7 @@ incs += ' #/intern/iksolver/extern ../blenloader ../quicktime'
incs += ' #/extern/bullet2/src'
incs += ' #/intern/bmfont'
incs += ' #/intern/opennl/extern'
+incs += ' ../gpu #/extern/glew/include'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_OPENGL_INC']
diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
index c913820205b..4b6cb5e0999 100644
--- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c
+++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
@@ -1,4 +1,3 @@
-
/**
* $Id$
*
@@ -118,10 +117,14 @@ float BPY_pydriver_eval(struct IpoDriver *driver)
{
return 0;
}
+
+/*
int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value)
{
return 0;
}
+*/
+
void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type){}
void InitNode(struct BPy_Node *self, struct bNode *node){}
void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi){}
@@ -173,10 +176,6 @@ void free_editMesh(struct EditMesh *em){}
void docenter_new(void){}
int saveover(char *str){ return 0;}
-/* image.c */
-#include "DNA_image_types.h"
-void free_realtime_image(Image *ima){} // has to become a callback, opengl stuff
-
/* ipo.c */
void copy_view3d_lock(short val){} // was a hack, to make scene layer ipo's possible
@@ -355,7 +354,8 @@ TimeMarker *get_frame_marker(int frame){return 0;};
/* editseq.c */
Sequence *get_forground_frame_seq(int frame){return 0;};
-void set_last_seq(Sequence *seq){};
+void clear_last_seq(Sequence *seq){};
+
/* modifier.c stub */
void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index 9dcb6b6e7fa..1652b24e1e5 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -7,6 +7,8 @@
#include "CCGSubSurf.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/***/
typedef unsigned char byte;
@@ -35,7 +37,7 @@ typedef struct _EHash {
#define EHASH_alloc(eh, nb) ((eh)->allocatorIFC.alloc((eh)->allocator, nb))
#define EHASH_free(eh, ptr) ((eh)->allocatorIFC.free((eh)->allocator, ptr))
-#define EHASH_hash(eh, item) (((unsigned long) (item))%((unsigned int) (eh)->curSize))
+#define EHASH_hash(eh, item) (((uintptr_t) (item))%((unsigned int) (eh)->curSize))
static EHash *_ehash_new(int estimatedNumEntries, CCGAllocatorIFC *allocatorIFC, CCGAllocatorHDL allocator) {
EHash *eh = allocatorIFC->alloc(allocator, sizeof(*eh));
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 4d3f9143b85..328dcada01a 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -59,6 +59,7 @@
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
#include "BLI_linklist.h"
+#include "BLI_memarena.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_customdata.h"
@@ -78,6 +79,8 @@
#include "BKE_utildefines.h"
#include "BKE_particle.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef WITH_VERSE
#include "BKE_verse.h"
#endif
@@ -85,6 +88,10 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
+#include "GPU_draw.h"
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+
// headers for fluidsim bobj meshes
#include <stdlib.h>
#include "LBM_fluidsim.h"
@@ -408,6 +415,8 @@ void DM_swap_face_data(DerivedMesh *dm, int index, int *corner_indices)
CustomData_swap(&dm->faceData, index, corner_indices);
}
+///
+
static DerivedMesh *getMeshDerivedMesh(Mesh *me, Object *ob, float (*vertCos)[3])
{
DerivedMesh *dm = CDDM_from_mesh(me, ob);
@@ -478,7 +487,7 @@ static void emDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData,
EditVert *eve;
for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next)
func(userData, i, emdm->vertexCos[(int) eed->v1->tmp.l], emdm->vertexCos[(int) eed->v2->tmp.l]);
} else {
@@ -496,7 +505,7 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
EditVert *eve;
for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
glBegin(GL_LINES);
for(i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) {
@@ -531,7 +540,7 @@ static void emDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(vo
EditVert *eve;
for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
glBegin(GL_LINES);
for (i=0,eed= emdm->em->edges.first; eed; i++,eed= eed->next) {
@@ -618,7 +627,7 @@ static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use
if (emdm->vertexCos) {
for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
}
for(i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) {
@@ -636,7 +645,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
EditVert *eve;
for (i=0,eve=emdm->em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
for (i=0,efa= emdm->em->faces.first; efa; i++,efa= efa->next) {
int drawSmooth = (efa->flag & ME_SMOOTH);
@@ -732,7 +741,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
EditVert *eve;
for (i=0,eve=em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) {
MTFace *tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -891,6 +900,162 @@ static void emDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void
emDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData);
}
+static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs),
+ int (*setDrawOptions)(void *userData, int index), void *userData)
+{
+ EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
+ EditMesh *em= emdm->em;
+ float (*vertexCos)[3]= emdm->vertexCos;
+ float (*vertexNos)[3]= emdm->vertexNos;
+ EditVert *eve;
+ EditFace *efa;
+ DMVertexAttribs attribs;
+ GPUVertexAttribs gattribs;
+ MTFace *tf;
+ int transp, new_transp, orig_transp, tfoffset;
+ int i, b, matnr, new_matnr, dodraw, layer;
+
+ dodraw = 0;
+ matnr = -1;
+
+ transp = GPU_get_material_blend_mode();
+ orig_transp = transp;
+ layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE);
+ tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset;
+
+ memset(&attribs, 0, sizeof(attribs));
+
+ /* always use smooth shading even for flat faces, else vertex colors wont interpolate */
+ glShadeModel(GL_SMOOTH);
+
+ for (i=0,eve=em->verts.first; eve; eve= eve->next)
+ eve->tmp.l = (long) i++;
+
+#define PASSATTRIB(efa, eve, vert) { \
+ if(attribs.totorco) { \
+ float *orco = attribs.orco.array[eve->tmp.l]; \
+ glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \
+ } \
+ for(b = 0; b < attribs.tottface; b++) { \
+ MTFace *tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \
+ glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]); \
+ } \
+ for(b = 0; b < attribs.totmcol; b++) { \
+ MCol *cp = (MCol*)((char*)efa->data + attribs.mcol[b].emOffset); \
+ GLubyte col[4]; \
+ col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \
+ glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \
+ } \
+ if(attribs.tottang) { \
+ float *tang = attribs.tang.array[i*4 + vert]; \
+ glVertexAttrib3fvARB(attribs.tang.glIndex, tang); \
+ } \
+}
+
+ for (i=0,efa= em->faces.first; efa; i++,efa= efa->next) {
+ int drawSmooth= (efa->flag & ME_SMOOTH);
+
+ if(setDrawOptions && !setDrawOptions(userData, i))
+ continue;
+
+ new_matnr = efa->mat_nr + 1;
+ if(new_matnr != matnr) {
+ dodraw = setMaterial(matnr = new_matnr, &gattribs);
+ if(dodraw)
+ DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
+ }
+
+ if(tfoffset != -1) {
+ tf = (MTFace*)((char*)efa->data)+tfoffset;
+ new_transp = tf->transp;
+
+ if(new_transp != transp) {
+ if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
+ GPU_set_material_blend_mode(orig_transp);
+ else
+ GPU_set_material_blend_mode(new_transp);
+ transp = new_transp;
+ }
+ }
+
+ if(dodraw) {
+ glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
+ if (!drawSmooth) {
+ if(vertexCos) glNormal3fv(emdm->faceNos[i]);
+ else glNormal3fv(efa->n);
+
+ PASSATTRIB(efa, efa->v1, 0);
+ if(vertexCos) glVertex3fv(vertexCos[(int) efa->v1->tmp.l]);
+ else glVertex3fv(efa->v1->co);
+
+ PASSATTRIB(efa, efa->v2, 1);
+ if(vertexCos) glVertex3fv(vertexCos[(int) efa->v2->tmp.l]);
+ else glVertex3fv(efa->v2->co);
+
+ PASSATTRIB(efa, efa->v3, 2);
+ if(vertexCos) glVertex3fv(vertexCos[(int) efa->v3->tmp.l]);
+ else glVertex3fv(efa->v3->co);
+
+ if(efa->v4) {
+ PASSATTRIB(efa, efa->v4, 3);
+ if(vertexCos) glVertex3fv(vertexCos[(int) efa->v4->tmp.l]);
+ else glVertex3fv(efa->v4->co);
+ }
+ } else {
+ PASSATTRIB(efa, efa->v1, 0);
+ if(vertexCos) {
+ glNormal3fv(vertexNos[(int) efa->v1->tmp.l]);
+ glVertex3fv(vertexCos[(int) efa->v1->tmp.l]);
+ }
+ else {
+ glNormal3fv(efa->v1->no);
+ glVertex3fv(efa->v1->co);
+ }
+
+ PASSATTRIB(efa, efa->v2, 1);
+ if(vertexCos) {
+ glNormal3fv(vertexNos[(int) efa->v2->tmp.l]);
+ glVertex3fv(vertexCos[(int) efa->v2->tmp.l]);
+ }
+ else {
+ glNormal3fv(efa->v2->no);
+ glVertex3fv(efa->v2->co);
+ }
+
+ PASSATTRIB(efa, efa->v3, 2);
+ if(vertexCos) {
+ glNormal3fv(vertexNos[(int) efa->v3->tmp.l]);
+ glVertex3fv(vertexCos[(int) efa->v3->tmp.l]);
+ }
+ else {
+ glNormal3fv(efa->v3->no);
+ glVertex3fv(efa->v3->co);
+ }
+
+ if(efa->v4) {
+ PASSATTRIB(efa, efa->v4, 3);
+ if(vertexCos) {
+ glNormal3fv(vertexNos[(int) efa->v4->tmp.l]);
+ glVertex3fv(vertexCos[(int) efa->v4->tmp.l]);
+ }
+ else {
+ glNormal3fv(efa->v4->no);
+ glVertex3fv(efa->v4->co);
+ }
+ }
+ }
+ glEnd();
+ }
+ }
+}
+
+static void emDM_drawFacesGLSL(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs))
+{
+ dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
+}
+
static void emDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3])
{
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
@@ -1052,7 +1217,7 @@ void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
/* store vertex indices in tmp union */
for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i)
- ev->tmp.l = (long) i;
+ ev->tmp.l = (intptr_t) i;
for( ; ee; ee = ee->next, ++edge_r) {
edge_r->crease = (unsigned char) (ee->crease*255.0f);
@@ -1080,7 +1245,7 @@ void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
/* store vertexes indices in tmp union */
for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i)
- ev->tmp.l = (long) i;
+ ev->tmp.l = (intptr_t) i;
for( ; ef; ef = ef->next, ++face_r) {
face_r->mat_nr = ef->mat_nr;
@@ -1096,6 +1261,43 @@ void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
}
}
+static void *emDM_getFaceDataArray(DerivedMesh *dm, int type)
+{
+ EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
+ EditMesh *em= emdm->em;
+ EditFace *efa;
+ char *data, *emdata;
+ void *datalayer;
+ int index, offset, size;
+
+ datalayer = DM_get_face_data_layer(dm, type);
+ if(datalayer)
+ return datalayer;
+
+ /* layers are store per face for editmesh, we convert to a temporary
+ * data layer array in the derivedmesh when these are requested */
+ if(type == CD_MTFACE || type == CD_MCOL) {
+ index = CustomData_get_layer_index(&em->fdata, type);
+
+ if(index != -1) {
+ offset = em->fdata.layers[index].offset;
+ size = CustomData_sizeof(type);
+
+ DM_add_face_layer(dm, type, CD_CALLOC, NULL);
+ index = CustomData_get_layer_index(&dm->faceData, type);
+ dm->faceData.layers[index].flag |= CD_FLAG_TEMPORARY;
+
+ data = datalayer = DM_get_face_data_layer(dm, type);
+ for(efa=em->faces.first; efa; efa=efa->next, data+=size) {
+ emdata = CustomData_em_get(&em->fdata, efa->data, type);
+ memcpy(data, emdata, size);
+ }
+ }
+ }
+
+ return datalayer;
+}
+
static void emDM_release(DerivedMesh *dm)
{
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
@@ -1131,6 +1333,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
emdm->dm.copyVertArray = emDM_copyVertArray;
emdm->dm.copyEdgeArray = emDM_copyEdgeArray;
emdm->dm.copyFaceArray = emDM_copyFaceArray;
+ emdm->dm.getFaceDataArray = emDM_getFaceDataArray;
emdm->dm.foreachMappedVert = emDM_foreachMappedVert;
emdm->dm.foreachMappedEdge = emDM_foreachMappedEdge;
@@ -1141,7 +1344,9 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
emdm->dm.drawMappedEdgesInterp = emDM_drawMappedEdgesInterp;
emdm->dm.drawMappedFaces = emDM_drawMappedFaces;
emdm->dm.drawMappedFacesTex = emDM_drawMappedFacesTex;
+ emdm->dm.drawMappedFacesGLSL = emDM_drawMappedFacesGLSL;
emdm->dm.drawFacesTex = emDM_drawFacesTex;
+ emdm->dm.drawFacesGLSL = emDM_drawFacesGLSL;
emdm->dm.drawUVEdges = emDM_drawUVEdges;
emdm->dm.release = emDM_release;
@@ -1167,7 +1372,7 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
int i;
for (i=0,eve=em->verts.first; eve; eve= eve->next)
- eve->tmp.l = (long) i++;
+ eve->tmp.l = (intptr_t) i++;
emdm->vertexNos = MEM_callocN(sizeof(*emdm->vertexNos)*i, "emdm_vno");
emdm->faceNos = MEM_mallocN(sizeof(*emdm->faceNos)*totface, "emdm_vno");
@@ -1571,7 +1776,7 @@ static void vDM_drawUVEdges(DerivedMesh *dm)
}
/* draw all VerseFaces */
-static void vDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
+static void vDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int, void *attribs))
{
VDerivedMesh *vdm = (VDerivedMesh*)dm;
struct VerseFace *vface;
@@ -1671,6 +1876,8 @@ static void vDM_drawMappedFacesTex(
int (*setDrawParams)(void *userData, int index),
void *userData)
{
+ /* not supported yet */
+ vDM_drawFacesTex(dm, NULL);
}
/**/
@@ -1812,19 +2019,23 @@ CustomDataMask get_viewedit_datamask()
ScrArea *sa;
/* check if we need tfaces & mcols due to face select or texture paint */
- if(FACESEL_PAINT_TEST || G.f & G_TEXTUREPAINT) {
+ if(FACESEL_PAINT_TEST || G.f & G_TEXTUREPAINT)
mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
- } else {
- /* check if we need tfaces & mcols due to view mode */
- for(sa = G.curscreen->areabase.first; sa; sa = sa->next) {
- if(sa->spacetype == SPACE_VIEW3D) {
- View3D *view = sa->spacedata.first;
- if(view->drawtype == OB_SHADED) {
- /* this includes normals for mesh_create_shadedColors */
- mask |= CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_NORMAL | CD_MASK_ORCO;
- }
- if((view->drawtype == OB_TEXTURE) || ((view->drawtype == OB_SOLID) && (view->flag2 & V3D_SOLID_TEX))) {
- mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
+
+ /* check if we need tfaces & mcols due to view mode */
+ for(sa = G.curscreen->areabase.first; sa; sa = sa->next) {
+ if(sa->spacetype == SPACE_VIEW3D) {
+ View3D *view = sa->spacedata.first;
+ if(view->drawtype == OB_SHADED) {
+ /* this includes normals for mesh_create_shadedColors */
+ mask |= CD_MASK_MTFACE | CD_MASK_MCOL | CD_MASK_NORMAL | CD_MASK_ORCO;
+ }
+ if((view->drawtype == OB_TEXTURE) || ((view->drawtype == OB_SOLID) && (view->flag2 & V3D_SOLID_TEX))) {
+ mask |= CD_MASK_MTFACE | CD_MASK_MCOL;
+
+ if((G.fileflags & G_FILE_GAME_MAT) &&
+ (G.fileflags & G_FILE_GAME_MAT_GLSL)) {
+ mask |= CD_MASK_ORCO;
}
}
}
@@ -1837,13 +2048,41 @@ CustomDataMask get_viewedit_datamask()
return mask;
}
-static DerivedMesh *create_orco_dm(Object *ob, Mesh *me)
+static float *get_editmesh_orco_verts(EditMesh *em)
+{
+ EditVert *eve;
+ float *orco;
+ int a, totvert;
+
+ /* these may not really be the orco's, but it's only for preview.
+ * could be solver better once, but isn't simple */
+
+ totvert= 0;
+ for(eve=em->verts.first; eve; eve=eve->next)
+ totvert++;
+
+ orco = MEM_mallocN(sizeof(float)*3*totvert, "EditMesh Orco");
+
+ for(a=0, eve=em->verts.first; eve; eve=eve->next, a+=3)
+ VECCOPY(orco+a, eve->co);
+
+ return orco;
+}
+
+static DerivedMesh *create_orco_dm(Object *ob, Mesh *me, EditMesh *em)
{
DerivedMesh *dm;
float (*orco)[3];
- dm= CDDM_from_mesh(me, ob);
- orco= (float(*)[3])get_mesh_orco_verts(ob);
+ if(em) {
+ dm= CDDM_from_editmesh(em, me);
+ orco= (float(*)[3])get_editmesh_orco_verts(em);
+ }
+ else {
+ dm= CDDM_from_mesh(me, ob);
+ orco= (float(*)[3])get_mesh_orco_verts(ob);
+ }
+
CDDM_apply_vert_coords(dm, orco);
CDDM_calc_normals(dm);
MEM_freeN(orco);
@@ -1851,7 +2090,7 @@ static DerivedMesh *create_orco_dm(Object *ob, Mesh *me)
return dm;
}
-static void add_orco_dm(Object *ob, DerivedMesh *dm, DerivedMesh *orcodm)
+static void add_orco_dm(Object *ob, EditMesh *em, DerivedMesh *dm, DerivedMesh *orcodm)
{
float (*orco)[3], (*layerorco)[3];
int totvert;
@@ -1866,8 +2105,10 @@ static void add_orco_dm(Object *ob, DerivedMesh *dm, DerivedMesh *orcodm)
else
dm->getVertCos(dm, orco);
}
- else
- orco= (float(*)[3])get_mesh_orco_verts(ob);
+ else {
+ if(em) orco= (float(*)[3])get_editmesh_orco_verts(em);
+ else orco= (float(*)[3])get_mesh_orco_verts(ob);
+ }
transform_mesh_orco_verts(ob->data, orco, totvert, 0);
@@ -2013,7 +2254,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3],
if(dm && mti->requiredDataMask) {
mask = mti->requiredDataMask(md);
if(mask & CD_MASK_ORCO)
- add_orco_dm(ob, dm, orcodm);
+ add_orco_dm(ob, NULL, dm, orcodm);
}
/* How to apply modifier depends on (a) what we already have as
@@ -2066,7 +2307,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3],
mask= (CustomDataMask)curr->link;
if(mask & CD_MASK_ORCO) {
if(!orcodm)
- orcodm= create_orco_dm(ob, me);
+ orcodm= create_orco_dm(ob, me, NULL);
mask &= ~CD_MASK_ORCO;
DM_set_only_copy(orcodm, mask);
@@ -2143,10 +2384,10 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3],
/* add an orco layer if needed */
if(dataMask & CD_MASK_ORCO) {
- add_orco_dm(ob, finaldm, orcodm);
+ add_orco_dm(ob, NULL, finaldm, orcodm);
if(deform_r && *deform_r)
- add_orco_dm(ob, *deform_r, NULL);
+ add_orco_dm(ob, NULL, *deform_r, NULL);
}
*final_r = finaldm;
@@ -2202,7 +2443,8 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r,
EditMesh *em = G.editMesh;
ModifierData *md;
float (*deformedVerts)[3] = NULL;
- DerivedMesh *dm;
+ CustomDataMask mask;
+ DerivedMesh *dm, *orcodm = NULL;
int i, numVerts = 0, cageIndex = modifiers_getCageIndex(ob, NULL);
LinkNode *datamasks, *curr;
@@ -2227,6 +2469,13 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r,
if(!editmesh_modifier_is_enabled(md, dm))
continue;
+ /* add an orco layer if needed by this modifier */
+ if(dm && mti->requiredDataMask) {
+ mask = mti->requiredDataMask(md);
+ if(mask & CD_MASK_ORCO)
+ add_orco_dm(ob, em, dm, orcodm);
+ }
+
/* How to apply modifier depends on (a) what we already have as
* a result of previous modifiers (could be a DerivedMesh or just
* deformed vertices) and (b) what type the modifier is.
@@ -2277,6 +2526,23 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r,
}
}
+ /* create an orco derivedmesh in parallel */
+ mask= (CustomDataMask)curr->link;
+ if(mask & CD_MASK_ORCO) {
+ if(!orcodm)
+ orcodm= create_orco_dm(ob, ob->data, em);
+
+ mask &= ~CD_MASK_ORCO;
+ DM_set_only_copy(orcodm, mask);
+ ndm = mti->applyModifierEM(md, ob, em, orcodm);
+
+ if(ndm) {
+ /* if the modifier returned a new dm, release the old one */
+ if(orcodm && orcodm != ndm) orcodm->release(orcodm);
+ orcodm = ndm;
+ }
+ }
+
/* set the DerivedMesh to only copy needed data */
DM_set_only_copy(dm, (CustomDataMask)curr->link);
@@ -2335,6 +2601,13 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r,
deformedVerts = NULL;
}
+ /* add an orco layer if needed */
+ if(dataMask & CD_MASK_ORCO)
+ add_orco_dm(ob, em, *final_r, orcodm);
+
+ if(orcodm)
+ orcodm->release(orcodm);
+
if(deformedVerts)
MEM_freeN(deformedVerts);
}
@@ -2629,7 +2902,7 @@ void multires_render_final(Object *ob, Mesh *me, DerivedMesh **dm, float *vert_c
old->release(old);
if(dataMask & CD_MASK_ORCO)
- add_orco_dm(ob, *dm, NULL);
+ add_orco_dm(ob, NULL, *dm, NULL);
/* Restore the original verts */
me->mr->newlvl= BLI_countlist(&me->mr->levels);
@@ -2844,6 +3117,214 @@ int editmesh_get_first_deform_matrices(float (**deformmats)[3][3], float (**defo
return numleft;
}
+/* ******************* GLSL ******************** */
+
+void DM_add_tangent_layer(DerivedMesh *dm)
+{
+ /* mesh vars */
+ MTFace *mtface, *tf;
+ MFace *mface, *mf;
+ MVert *mvert, *v1, *v2, *v3, *v4;
+ MemArena *arena= NULL;
+ VertexTangent **vtangents= NULL;
+ float (*orco)[3]= NULL, (*tangent)[3];
+ float *uv1, *uv2, *uv3, *uv4, *vtang;
+ float fno[3], tang[3], uv[4][2];
+ int i, j, len, mf_vi[4], totvert, totface;
+
+ if(CustomData_get_layer_index(&dm->faceData, CD_TANGENT) != -1)
+ return;
+
+ /* check we have all the needed layers */
+ totvert= dm->getNumVerts(dm);
+ totface= dm->getNumFaces(dm);
+
+ mvert= dm->getVertArray(dm);
+ mface= dm->getFaceArray(dm);
+ mtface= dm->getFaceDataArray(dm, CD_MTFACE);
+
+ if(!mtface) {
+ orco= dm->getVertDataArray(dm, CD_ORCO);
+ if(!orco)
+ return;
+ }
+
+ /* create tangent layer */
+ DM_add_face_layer(dm, CD_TANGENT, CD_CALLOC, NULL);
+ tangent= DM_get_face_data_layer(dm, CD_TANGENT);
+
+ /* allocate some space */
+ arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
+ BLI_memarena_use_calloc(arena);
+ vtangents= MEM_callocN(sizeof(VertexTangent*)*totvert, "VertexTangent");
+
+ /* sum tangents at connected vertices */
+ for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++) {
+ v1= &mvert[mf->v1];
+ v2= &mvert[mf->v2];
+ v3= &mvert[mf->v3];
+
+ if (mf->v4) {
+ v4= &mvert[mf->v4];
+ CalcNormFloat4(v4->co, v3->co, v2->co, v1->co, fno);
+ }
+ else {
+ v4= NULL;
+ CalcNormFloat(v3->co, v2->co, v1->co, fno);
+ }
+
+ if(mtface) {
+ uv1= tf->uv[0];
+ uv2= tf->uv[1];
+ uv3= tf->uv[2];
+ uv4= tf->uv[3];
+ }
+ else {
+ uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
+ spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]);
+ spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]);
+ spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]);
+ if(v4)
+ spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]);
+ }
+
+ tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang);
+ sum_or_add_vertex_tangent(arena, &vtangents[mf->v1], tang, uv1);
+ sum_or_add_vertex_tangent(arena, &vtangents[mf->v2], tang, uv2);
+ sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3);
+
+ if(mf->v4) {
+ v4= &mvert[mf->v4];
+
+ tangent_from_uv(uv1, uv3, uv4, v1->co, v3->co, v4->co, fno, tang);
+ sum_or_add_vertex_tangent(arena, &vtangents[mf->v1], tang, uv1);
+ sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3);
+ sum_or_add_vertex_tangent(arena, &vtangents[mf->v4], tang, uv4);
+ }
+ }
+
+ /* write tangent to layer */
+ for(i=0, tf=mtface, mf=mface; i < totface; mf++, tf++, i++, tangent+=4) {
+ len= (mf->v4)? 4 : 3;
+
+ if(mtface) {
+ uv1= tf->uv[0];
+ uv2= tf->uv[1];
+ uv3= tf->uv[2];
+ uv4= tf->uv[3];
+ }
+ else {
+ uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
+ spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]);
+ spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]);
+ spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]);
+ if(len==4)
+ spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]);
+ }
+
+ mf_vi[0]= mf->v1;
+ mf_vi[1]= mf->v2;
+ mf_vi[2]= mf->v3;
+ mf_vi[3]= mf->v4;
+
+ for(j=0; j<len; j++) {
+ vtang= find_vertex_tangent(vtangents[mf_vi[j]], mtface ? tf->uv[j] : uv[j]);
+
+ VECCOPY(tangent[j], vtang);
+ Normalize(tangent[j]);
+ }
+ }
+
+ BLI_memarena_free(arena);
+ MEM_freeN(vtangents);
+}
+
+void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, DMVertexAttribs *attribs)
+{
+ CustomData *vdata, *fdata, *tfdata = NULL;
+ int a, b, layer;
+
+ /* From the layers requested by the GLSL shader, figure out which ones are
+ * actually available for this derivedmesh, and retrieve the pointers */
+
+ memset(attribs, 0, sizeof(DMVertexAttribs));
+
+ vdata = &dm->vertData;
+ fdata = &dm->faceData;
+
+ /* ugly hack, editmesh derivedmesh doesn't copy face data, this way we
+ * can use offsets instead */
+ if(dm->release == emDM_release)
+ tfdata = &((EditMeshDerivedMesh*)dm)->em->fdata;
+ else
+ tfdata = fdata;
+
+ /* add a tangent layer if necessary */
+ for(b = 0; b < gattribs->totlayer; b++)
+ if(gattribs->layer[b].type == CD_TANGENT)
+ if(CustomData_get_layer_index(fdata, CD_TANGENT) == -1)
+ DM_add_tangent_layer(dm);
+
+ for(b = 0; b < gattribs->totlayer; b++) {
+ if(gattribs->layer[b].type == CD_MTFACE) {
+ /* uv coordinates */
+ if(gattribs->layer[b].name[0])
+ layer = CustomData_get_named_layer_index(tfdata, CD_MTFACE,
+ gattribs->layer[b].name);
+ else
+ layer = CustomData_get_active_layer_index(tfdata, CD_MTFACE);
+
+ if(layer != -1) {
+ a = attribs->tottface++;
+
+ attribs->tface[a].array = tfdata->layers[layer].data;
+ attribs->tface[a].emOffset = tfdata->layers[layer].offset;
+ attribs->tface[a].glIndex = gattribs->layer[b].glindex;
+ }
+ }
+ else if(gattribs->layer[b].type == CD_MCOL) {
+ /* vertex colors */
+ if(gattribs->layer[b].name[0])
+ layer = CustomData_get_named_layer_index(tfdata, CD_MCOL,
+ gattribs->layer[b].name);
+ else
+ layer = CustomData_get_active_layer_index(tfdata, CD_MCOL);
+
+ if(layer != -1) {
+ a = attribs->totmcol++;
+
+ attribs->mcol[a].array = tfdata->layers[layer].data;
+ attribs->mcol[a].emOffset = tfdata->layers[layer].offset;
+ attribs->mcol[a].glIndex = gattribs->layer[b].glindex;
+ }
+ }
+ else if(gattribs->layer[b].type == CD_TANGENT) {
+ /* tangents */
+ layer = CustomData_get_layer_index(fdata, CD_TANGENT);
+
+ if(layer != -1) {
+ attribs->tottang = 1;
+
+ attribs->tang.array = fdata->layers[layer].data;
+ attribs->tang.emOffset = fdata->layers[layer].offset;
+ attribs->tang.glIndex = gattribs->layer[b].glindex;
+ }
+ }
+ else if(gattribs->layer[b].type == CD_ORCO) {
+ /* original coordinates */
+ layer = CustomData_get_layer_index(vdata, CD_ORCO);
+
+ if(layer != -1) {
+ attribs->totorco = 1;
+
+ attribs->orco.array = vdata->layers[layer].data;
+ attribs->orco.emOffset = vdata->layers[layer].offset;
+ attribs->orco.glIndex = gattribs->layer[b].glindex;
+ }
+ }
+ }
+}
+
/* ************************* fluidsim bobj file handling **************************** */
#ifndef DISABLE_ELBEEM
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile
index 74c6c551a83..8921ea5d3b7 100644
--- a/source/blender/blenkernel/intern/Makefile
+++ b/source/blender/blenkernel/intern/Makefile
@@ -36,6 +36,7 @@ include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
# OpenGL and Python
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
@@ -74,6 +75,9 @@ CPPFLAGS += -I$(NAN_ZLIB)/include
#path to nodes
CPPFLAGS += -I../../nodes
+#path to gpu
+CPPFLAGS += -I../../gpu
+
# path to our own external headerfiles
CPPFLAGS += -I..
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 5b96bf11056..043ede5987a 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -347,6 +347,8 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
VECCOPY(pchan->loc, chan->loc);
VECCOPY(pchan->size, chan->size);
QUATCOPY(pchan->quat, chan->quat);
+ Mat4CpyMat4(pchan->chan_mat, (float(*)[4])chan->chan_mat);
+ Mat4CpyMat4(pchan->pose_mat, (float(*)[4])chan->pose_mat);
pchan->flag= chan->flag;
con= chan->constraints.first;
@@ -860,7 +862,7 @@ typedef struct NlaIpoChannel {
int type;
} NlaIpoChannel;
-void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime)
+void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, const char *name, float ctime)
{
bActionChannel *achan= get_action_channel(act, name);
IpoCurve *icu;
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 1f8dd74a6eb..e2ce4b9f6f3 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -303,7 +303,7 @@ static void group_duplilist(ListBase *lb, Object *ob, int level, int animated)
DupliObject *dob;
Group *group;
GroupObject *go;
- float mat[4][4];
+ float mat[4][4], tmat[4][4];
if(ob->dup_group==NULL) return;
group= ob->dup_group;
@@ -320,7 +320,15 @@ static void group_duplilist(ListBase *lb, Object *ob, int level, int animated)
/* note, if you check on layer here, render goes wrong... it still deforms verts and uses parent imat */
if(go->ob!=ob) {
- Mat4MulMat4(mat, go->ob->obmat, ob->obmat);
+ /* Group Dupli Offset, should apply after everything else */
+ if (group->dupli_ofs[0] || group->dupli_ofs[1] || group->dupli_ofs[2]) {
+ Mat4CpyMat4(tmat, go->ob->obmat);
+ VecSubf(tmat[3], tmat[3], group->dupli_ofs);
+ Mat4MulMat4(mat, tmat, ob->obmat);
+ } else {
+ Mat4MulMat4(mat, go->ob->obmat, ob->obmat);
+ }
+
dob= new_dupli_object(lb, go->ob, mat, ob->lay, 0, OB_DUPLIGROUP, animated);
dob->no_draw= (dob->origlay & group->layer)==0;
@@ -734,9 +742,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
ParticleCacheKey *cache;
ParticleSystemModifierData *psmd;
float ctime, pa_time, scale = 1.0f;
- float tmat[4][4], mat[4][4], obrotmat[4][4], pamat[4][4], size=0.0;
+ float tmat[4][4], mat[4][4], pamat[4][4], size=0.0;
float (*obmat)[4], (*oldobmat)[4];
- float xvec[3] = {-1.0, 0.0, 0.0}, q[4];
int lay, a, b, k, step_nbr = 0, counter, hair = 0;
int totpart, totchild, totgroup=0, pa_num;
@@ -898,14 +905,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
/* to give ipos in object correct offset */
where_is_object_time(ob, ctime-pa_time);
- if(!hair) {
- vectoquat(xvec, ob->trackflag, ob->upflag, q);
- QuatToMat4(q, obrotmat);
- obrotmat[3][3]= 1.0f;
- Mat4MulMat4(mat, obrotmat, pamat);
- }
- else
- Mat4CpyMat4(mat, pamat);
+ Mat4CpyMat4(mat, pamat);
Mat4MulMat4(tmat, obmat, mat);
Mat4MulFloat3((float *)tmat, size*scale);
@@ -1067,7 +1067,8 @@ static void object_duplilist_recursive(ID *id, Object *ob, ListBase *duplilist,
}
}
-/* note; group dupli's already set transform matrix. see note in group_duplilist() */
+/* Returns a list of DupliObject
+ * note; group dupli's already set transform matrix. see note in group_duplilist() */
ListBase *object_duplilist(Scene *sce, Object *ob)
{
ListBase *duplilist= MEM_mallocN(sizeof(ListBase), "duplilist");
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index aca51e56c6e..1fe6447752e 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -525,6 +525,7 @@ typedef struct UndoElem {
char str[FILE_MAXDIR+FILE_MAXFILE];
char name[MAXUNDONAME];
MemFile memfile;
+ uintptr_t undosize;
} UndoElem;
static ListBase undobase={NULL, NULL};
@@ -555,6 +556,7 @@ static int read_undosave(UndoElem *uel)
/* name can be a dynamic string */
void BKE_write_undo(char *name)
{
+ uintptr_t maxmem, totmem, memused;
int nr, success;
UndoElem *uel;
@@ -616,8 +618,36 @@ void BKE_write_undo(char *name)
if(curundo->prev) prevfile= &(curundo->prev->memfile);
+ memused= MEM_get_memory_in_use();
success= BLO_write_file_mem(prevfile, &curundo->memfile, G.fileflags, &err);
-
+ curundo->undosize= MEM_get_memory_in_use() - memused;
+ }
+
+ if(U.undomemory != 0) {
+ /* limit to maximum memory (afterwards, we can't know in advance) */
+ totmem= 0;
+ maxmem= ((uintptr_t)U.undomemory)*1024*1024;
+
+ /* keep at least two (original + other) */
+ uel= undobase.last;
+ while(uel && uel->prev) {
+ totmem+= uel->undosize;
+ if(totmem>maxmem) break;
+ uel= uel->prev;
+ }
+
+ if(uel) {
+ if(uel->prev && uel->prev->prev)
+ uel= uel->prev;
+
+ while(undobase.first!=uel) {
+ UndoElem *first= undobase.first;
+ BLI_remlink(&undobase, first);
+ /* the merge is because of compression */
+ BLO_merge_memfile(&first->memfile, &first->next->memfile);
+ MEM_freeN(first);
+ }
+ }
}
}
@@ -683,14 +713,14 @@ char *BKE_undo_menu_string(void)
UndoElem *uel;
DynStr *ds= BLI_dynstr_new();
char *menu;
-
+
BLI_dynstr_append(ds, "Global Undo History %t");
for(uel= undobase.first; uel; uel= uel->next) {
BLI_dynstr_append(ds, "|");
BLI_dynstr_append(ds, uel->name);
}
-
+
menu= BLI_dynstr_get_cstring(ds);
BLI_dynstr_free(ds);
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
new file mode 100644
index 00000000000..ae449843d2a
--- /dev/null
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -0,0 +1,577 @@
+/**
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): André Pinto.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "BKE_bvhutils.h"
+
+#include "DNA_object_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_meshdata_types.h"
+
+#include "BKE_DerivedMesh.h"
+#include "BKE_utildefines.h"
+#include "BKE_deform.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_displist.h"
+#include "BKE_global.h"
+
+#include "BLI_arithb.h"
+
+/* Math stuff for ray casting on mesh faces and for nearest surface */
+
+static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2)
+{
+ float dist;
+
+ if(RayIntersectsTriangle((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL))
+ return dist;
+
+ return FLT_MAX;
+}
+
+static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2)
+{
+
+ float idist;
+ float p1[3];
+ float plane_normal[3], hit_point[3];
+
+ CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal);
+
+ VECADDFAC( p1, ray->origin, ray->direction, m_dist);
+ if(SweepingSphereIntersectsTriangleUV((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point))
+ {
+ return idist * m_dist;
+ }
+
+ return FLT_MAX;
+}
+
+
+/*
+ * Function adapted from David Eberly's distance tools (LGPL)
+ * http://www.geometrictools.com/LibFoundation/Distance/Distance.html
+ */
+static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest )
+{
+ float diff[3];
+ float e0[3];
+ float e1[3];
+ float A00;
+ float A01;
+ float A11;
+ float B0;
+ float B1;
+ float C;
+ float Det;
+ float S;
+ float T;
+ float sqrDist;
+ int lv = -1, le = -1;
+
+ VECSUB(diff, v0, p);
+ VECSUB(e0, v1, v0);
+ VECSUB(e1, v2, v0);
+
+ A00 = INPR ( e0, e0 );
+ A01 = INPR( e0, e1 );
+ A11 = INPR ( e1, e1 );
+ B0 = INPR( diff, e0 );
+ B1 = INPR( diff, e1 );
+ C = INPR( diff, diff );
+ Det = fabs( A00 * A11 - A01 * A01 );
+ S = A01 * B1 - A11 * B0;
+ T = A01 * B0 - A00 * B1;
+
+ if ( S + T <= Det )
+ {
+ if ( S < 0.0f )
+ {
+ if ( T < 0.0f ) // Region 4
+ {
+ if ( B0 < 0.0f )
+ {
+ T = 0.0f;
+ if ( -B0 >= A00 )
+ {
+ S = (float)1.0;
+ sqrDist = A00 + 2.0f * B0 + C;
+ lv = 1;
+ }
+ else
+ {
+ if(fabs(A00) > FLT_EPSILON)
+ S = -B0/A00;
+ else
+ S = 0.0f;
+ sqrDist = B0 * S + C;
+ le = 0;
+ }
+ }
+ else
+ {
+ S = 0.0f;
+ if ( B1 >= 0.0f )
+ {
+ T = 0.0f;
+ sqrDist = C;
+ lv = 0;
+ }
+ else if ( -B1 >= A11 )
+ {
+ T = 1.0f;
+ sqrDist = A11 + 2.0f * B1 + C;
+ lv = 2;
+ }
+ else
+ {
+ if(fabs(A11) > FLT_EPSILON)
+ T = -B1 / A11;
+ else
+ T = 0.0f;
+ sqrDist = B1 * T + C;
+ le = 1;
+ }
+ }
+ }
+ else // Region 3
+ {
+ S = 0.0f;
+ if ( B1 >= 0.0f )
+ {
+ T = 0.0f;
+ sqrDist = C;
+ lv = 0;
+ }
+ else if ( -B1 >= A11 )
+ {
+ T = 1.0f;
+ sqrDist = A11 + 2.0f * B1 + C;
+ lv = 2;
+ }
+ else
+ {
+ if(fabs(A11) > FLT_EPSILON)
+ T = -B1 / A11;
+ else
+ T = 0.0;
+ sqrDist = B1 * T + C;
+ le = 1;
+ }
+ }
+ }
+ else if ( T < 0.0f ) // Region 5
+ {
+ T = 0.0f;
+ if ( B0 >= 0.0f )
+ {
+ S = 0.0f;
+ sqrDist = C;
+ lv = 0;
+ }
+ else if ( -B0 >= A00 )
+ {
+ S = 1.0f;
+ sqrDist = A00 + 2.0f * B0 + C;
+ lv = 1;
+ }
+ else
+ {
+ if(fabs(A00) > FLT_EPSILON)
+ S = -B0 / A00;
+ else
+ S = 0.0f;
+ sqrDist = B0 * S + C;
+ le = 0;
+ }
+ }
+ else // Region 0
+ {
+ // Minimum at interior lv
+ float invDet;
+ if(fabs(Det) > FLT_EPSILON)
+ invDet = 1.0f / Det;
+ else
+ invDet = 0.0f;
+ S *= invDet;
+ T *= invDet;
+ sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0) +
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ }
+ }
+ else
+ {
+ float tmp0, tmp1, numer, denom;
+
+ if ( S < 0.0f ) // Region 2
+ {
+ tmp0 = A01 + B0;
+ tmp1 = A11 + B1;
+ if ( tmp1 > tmp0 )
+ {
+ numer = tmp1 - tmp0;
+ denom = A00 - 2.0f * A01 + A11;
+ if ( numer >= denom )
+ {
+ S = 1.0f;
+ T = 0.0f;
+ sqrDist = A00 + 2.0f * B0 + C;
+ lv = 1;
+ }
+ else
+ {
+ if(fabs(denom) > FLT_EPSILON)
+ S = numer / denom;
+ else
+ S = 0.0f;
+ T = 1.0f - S;
+ sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) +
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ le = 2;
+ }
+ }
+ else
+ {
+ S = 0.0f;
+ if ( tmp1 <= 0.0f )
+ {
+ T = 1.0f;
+ sqrDist = A11 + 2.0f * B1 + C;
+ lv = 2;
+ }
+ else if ( B1 >= 0.0f )
+ {
+ T = 0.0f;
+ sqrDist = C;
+ lv = 0;
+ }
+ else
+ {
+ if(fabs(A11) > FLT_EPSILON)
+ T = -B1 / A11;
+ else
+ T = 0.0f;
+ sqrDist = B1 * T + C;
+ le = 1;
+ }
+ }
+ }
+ else if ( T < 0.0f ) // Region 6
+ {
+ tmp0 = A01 + B1;
+ tmp1 = A00 + B0;
+ if ( tmp1 > tmp0 )
+ {
+ numer = tmp1 - tmp0;
+ denom = A00 - 2.0f * A01 + A11;
+ if ( numer >= denom )
+ {
+ T = 1.0f;
+ S = 0.0f;
+ sqrDist = A11 + 2.0f * B1 + C;
+ lv = 2;
+ }
+ else
+ {
+ if(fabs(denom) > FLT_EPSILON)
+ T = numer / denom;
+ else
+ T = 0.0f;
+ S = 1.0f - T;
+ sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) +
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ le = 2;
+ }
+ }
+ else
+ {
+ T = 0.0f;
+ if ( tmp1 <= 0.0f )
+ {
+ S = 1.0f;
+ sqrDist = A00 + 2.0f * B0 + C;
+ lv = 1;
+ }
+ else if ( B0 >= 0.0f )
+ {
+ S = 0.0f;
+ sqrDist = C;
+ lv = 0;
+ }
+ else
+ {
+ if(fabs(A00) > FLT_EPSILON)
+ S = -B0 / A00;
+ else
+ S = 0.0f;
+ sqrDist = B0 * S + C;
+ le = 0;
+ }
+ }
+ }
+ else // Region 1
+ {
+ numer = A11 + B1 - A01 - B0;
+ if ( numer <= 0.0f )
+ {
+ S = 0.0f;
+ T = 1.0f;
+ sqrDist = A11 + 2.0f * B1 + C;
+ lv = 2;
+ }
+ else
+ {
+ denom = A00 - 2.0f * A01 + A11;
+ if ( numer >= denom )
+ {
+ S = 1.0f;
+ T = 0.0f;
+ sqrDist = A00 + 2.0f * B0 + C;
+ lv = 1;
+ }
+ else
+ {
+ if(fabs(denom) > FLT_EPSILON)
+ S = numer / denom;
+ else
+ S = 0.0f;
+ T = 1.0f - S;
+ sqrDist = S * ( A00 * S + A01 * T + 2.0f * B0 ) +
+ T * ( A01 * S + A11 * T + 2.0f * B1 ) + C;
+ le = 2;
+ }
+ }
+ }
+ }
+
+ // Account for numerical round-off error
+ if ( sqrDist < FLT_EPSILON )
+ sqrDist = 0.0f;
+
+ {
+ float w[3], x[3], y[3], z[3];
+ VECCOPY(w, v0);
+ VECCOPY(x, e0);
+ VecMulf(x, S);
+ VECCOPY(y, e1);
+ VecMulf(y, T);
+ VECADD(z, w, x);
+ VECADD(z, z, y);
+ //VECSUB(d, p, z);
+ VECCOPY(nearest, z);
+ // d = p - ( v0 + S * e0 + T * e1 );
+ }
+ *v = lv;
+ *e = le;
+
+ return sqrDist;
+}
+
+
+/*
+ * BVH from meshs callbacks
+ */
+
+// Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces.
+// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
+static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest)
+{
+ const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata;
+ MVert *vert = data->vert;
+ MFace *face = data->face + index;
+
+ float *t0, *t1, *t2, *t3;
+ t0 = vert[ face->v1 ].co;
+ t1 = vert[ face->v2 ].co;
+ t2 = vert[ face->v3 ].co;
+ t3 = face->v4 ? vert[ face->v4].co : NULL;
+
+
+ do
+ {
+ float nearest_tmp[3], dist;
+ int vertex, edge;
+
+ dist = nearest_point_in_tri_surface(t0, t1, t2, co, &vertex, &edge, nearest_tmp);
+ if(dist < nearest->dist)
+ {
+ nearest->index = index;
+ nearest->dist = dist;
+ VECCOPY(nearest->co, nearest_tmp);
+ CalcNormFloat(t0, t1, t2, nearest->no);
+ }
+
+ t1 = t2;
+ t2 = t3;
+ t3 = NULL;
+
+ } while(t2);
+}
+
+// Callback to bvh tree raycast. The tree must bust have been built using bvhtree_from_mesh_faces.
+// userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
+static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
+{
+ const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata;
+ MVert *vert = data->vert;
+ MFace *face = data->face + index;
+
+ float *t0, *t1, *t2, *t3;
+ t0 = vert[ face->v1 ].co;
+ t1 = vert[ face->v2 ].co;
+ t2 = vert[ face->v3 ].co;
+ t3 = face->v4 ? vert[ face->v4].co : NULL;
+
+
+ do
+ {
+ float dist;
+ if(data->sphere_radius == 0.0f)
+ dist = ray_tri_intersection(ray, hit->dist, t0, t1, t2);
+ else
+ dist = sphereray_tri_intersection(ray, data->sphere_radius, hit->dist, t0, t1, t2);
+
+ if(dist >= 0 && dist < hit->dist)
+ {
+ hit->index = index;
+ hit->dist = dist;
+ VECADDFAC(hit->co, ray->origin, ray->direction, dist);
+
+ CalcNormFloat(t0, t1, t2, hit->no);
+ }
+
+ t1 = t2;
+ t2 = t3;
+ t3 = NULL;
+
+ } while(t2);
+}
+
+/*
+ * BVH builders
+ */
+// Builds a bvh tree.. where nodes are the vertexs of the given mesh
+void bvhtree_from_mesh_verts(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis)
+{
+ int i;
+ int numVerts= mesh->getNumVerts(mesh);
+ MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT);
+ BVHTree *tree = NULL;
+
+ memset(data, 0, sizeof(*data));
+
+ if(vert == NULL)
+ {
+ printf("bvhtree cant be build: cant get a vertex array");
+ return;
+ }
+
+ tree = BLI_bvhtree_new(numVerts, epsilon, tree_type, axis);
+ if(tree != NULL)
+ {
+ for(i = 0; i < numVerts; i++)
+ BLI_bvhtree_insert(tree, i, vert[i].co, 1);
+
+ BLI_bvhtree_balance(tree);
+
+ data->tree = tree;
+
+ //a NULL nearest callback works fine
+ //remeber the min distance to point is the same as the min distance to BV of point
+ data->nearest_callback = NULL;
+ data->raycast_callback = NULL;
+
+ data->mesh = mesh;
+ data->vert = mesh->getVertDataArray(mesh, CD_MVERT);
+ data->face = mesh->getFaceDataArray(mesh, CD_MFACE);
+
+ data->sphere_radius = epsilon;
+ }
+}
+
+// Builds a bvh tree.. where nodes are the faces of the given mesh.
+void bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis)
+{
+ int i;
+ int numFaces= mesh->getNumFaces(mesh);
+ MVert *vert = mesh->getVertDataArray(mesh, CD_MVERT);
+ MFace *face = mesh->getFaceDataArray(mesh, CD_MFACE);
+ BVHTree *tree = NULL;
+
+ memset(data, 0, sizeof(*data));
+
+ if(vert == NULL && face == NULL)
+ {
+ printf("bvhtree cant be build: cant get a vertex/face array");
+ return;
+ }
+
+ /* Create a bvh-tree of the given target */
+ tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis);
+ if(tree != NULL)
+ {
+ for(i = 0; i < numFaces; i++)
+ {
+ float co[4][3];
+ VECCOPY(co[0], vert[ face[i].v1 ].co);
+ VECCOPY(co[1], vert[ face[i].v2 ].co);
+ VECCOPY(co[2], vert[ face[i].v3 ].co);
+ if(face[i].v4)
+ VECCOPY(co[3], vert[ face[i].v4 ].co);
+
+ BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3);
+ }
+ BLI_bvhtree_balance(tree);
+
+ data->tree = tree;
+ data->nearest_callback = mesh_faces_nearest_point;
+ data->raycast_callback = mesh_faces_spherecast;
+
+ data->mesh = mesh;
+ data->vert = mesh->getVertDataArray(mesh, CD_MVERT);
+ data->face = mesh->getFaceDataArray(mesh, CD_MFACE);
+
+ data->sphere_radius = epsilon;
+ }
+}
+
+// Frees data allocated by a call to bvhtree_from_mesh_*.
+void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
+{
+ if(data->tree)
+ {
+ BLI_bvhtree_free(data->tree);
+ memset( data, 0, sizeof(data) );
+ }
+}
+
+
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 472df3d0f26..9d5dcb8109b 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -58,6 +58,10 @@
#include "MEM_guardedalloc.h"
+#include "GPU_draw.h"
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+
#include <string.h>
#include <limits.h>
@@ -243,7 +247,7 @@ static void cdDM_drawLooseEdges(DerivedMesh *dm)
glEnd();
}
-static void cdDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
+static void cdDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int, void *attribs))
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mvert = cddm->mvert;
@@ -271,7 +275,7 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
|| new_shademodel != shademodel) {
glEnd();
- drawCurrentMat = setMaterial(matnr = new_matnr);
+ drawCurrentMat = setMaterial(matnr = new_matnr, NULL);
glShadeModel(shademodel = new_shademodel);
glBegin(glmode = new_glmode);
@@ -556,6 +560,134 @@ static void cdDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void
cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData);
}
+static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData)
+{
+ CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
+ GPUVertexAttribs gattribs;
+ DMVertexAttribs attribs;
+ MVert *mvert = cddm->mvert;
+ MFace *mface = cddm->mface;
+ MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE);
+ float (*nors)[3] = dm->getFaceDataArray(dm, CD_NORMAL);
+ int a, b, dodraw, smoothnormal, matnr, new_matnr;
+ int transp, new_transp, orig_transp;
+ int orig, *index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
+
+ matnr = -1;
+ smoothnormal = 0;
+ dodraw = 0;
+ transp = GPU_get_material_blend_mode();
+ orig_transp = transp;
+
+ memset(&attribs, 0, sizeof(attribs));
+
+ glShadeModel(GL_SMOOTH);
+ glBegin(GL_QUADS);
+
+ for(a = 0; a < dm->numFaceData; a++, mface++) {
+ new_matnr = mface->mat_nr + 1;
+
+ if(new_matnr != matnr) {
+ glEnd();
+
+ dodraw = setMaterial(matnr = new_matnr, &gattribs);
+ if(dodraw)
+ DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
+
+ glBegin(GL_QUADS);
+ }
+
+ if(!dodraw) {
+ continue;
+ }
+ else if(setDrawOptions) {
+ orig = index[a];
+
+ if(orig == ORIGINDEX_NONE)
+ continue;
+ else if(!setDrawOptions(userData, orig))
+ continue;
+ }
+
+ if(tf) {
+ new_transp = tf[a].transp;
+
+ if(new_transp != transp) {
+ glEnd();
+
+ if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
+ GPU_set_material_blend_mode(orig_transp);
+ else
+ GPU_set_material_blend_mode(new_transp);
+ transp = new_transp;
+
+ glBegin(GL_QUADS);
+ }
+ }
+
+ smoothnormal = (mface->flag & ME_SMOOTH);
+
+ if(!smoothnormal) {
+ if(nors) {
+ glNormal3fv(nors[a]);
+ }
+ else {
+ /* TODO ideally a normal layer should always be available */
+ float nor[3];
+ if(mface->v4) {
+ CalcNormFloat4(mvert[mface->v1].co, mvert[mface->v2].co,
+ mvert[mface->v3].co, mvert[mface->v4].co,
+ nor);
+ } else {
+ CalcNormFloat(mvert[mface->v1].co, mvert[mface->v2].co,
+ mvert[mface->v3].co, nor);
+ }
+ glNormal3fv(nor);
+ }
+ }
+
+#define PASSVERT(index, vert) { \
+ if(attribs.totorco) \
+ glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]); \
+ for(b = 0; b < attribs.tottface; b++) { \
+ MTFace *tf = &attribs.tface[b].array[a]; \
+ glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]); \
+ } \
+ for(b = 0; b < attribs.totmcol; b++) { \
+ MCol *cp = &attribs.mcol[b].array[a*4 + vert]; \
+ GLubyte col[4]; \
+ col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \
+ glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \
+ } \
+ if(attribs.tottang) { \
+ float *tang = attribs.tang.array[a*4 + vert]; \
+ glVertexAttrib3fvARB(attribs.tang.glIndex, tang); \
+ } \
+ if(smoothnormal) \
+ glNormal3sv(mvert[index].no); \
+ glVertex3fv(mvert[index].co); \
+}
+
+ PASSVERT(mface->v1, 0);
+ PASSVERT(mface->v2, 1);
+ PASSVERT(mface->v3, 2);
+ if(mface->v4)
+ PASSVERT(mface->v4, 3)
+ else
+ PASSVERT(mface->v3, 2)
+
+#undef PASSVERT
+ }
+ glEnd();
+
+ glShadeModel(GL_FLAT);
+}
+
+static void cdDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs))
+{
+ dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
+}
+
static void cdDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
@@ -713,8 +845,10 @@ static CDDerivedMesh *cdDM_create(const char *desc)
dm->drawFacesSolid = cdDM_drawFacesSolid;
dm->drawFacesColored = cdDM_drawFacesColored;
dm->drawFacesTex = cdDM_drawFacesTex;
+ dm->drawFacesGLSL = cdDM_drawFacesGLSL;
dm->drawMappedFaces = cdDM_drawMappedFaces;
dm->drawMappedFacesTex = cdDM_drawMappedFacesTex;
+ dm->drawMappedFacesGLSL = cdDM_drawMappedFacesGLSL;
dm->foreachMappedVert = cdDM_foreachMappedVert;
dm->foreachMappedEdge = cdDM_foreachMappedEdge;
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index c7817b017ef..dbc94571cad 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -155,7 +155,7 @@ void cloth_init ( ClothModifierData *clmd )
BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon)
{
- int i;
+ unsigned int i;
BVHTree *bvhtree;
Cloth *cloth = clmd->clothObject;
ClothVertex *verts;
@@ -196,7 +196,7 @@ BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon)
BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon)
{
- int i;
+ unsigned int i;
BVHTree *bvhtree;
Cloth *cloth = clmd->clothObject;
ClothVertex *verts;
@@ -782,11 +782,11 @@ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh *
/* can be optimized to do all groups in one loop */
static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
{
- unsigned int i = 0;
- unsigned int j = 0;
+ int i = 0;
+ int j = 0;
MDeformVert *dvert = NULL;
Cloth *clothObj = NULL;
- unsigned int numverts = dm->getNumVerts ( dm );
+ int numverts = dm->getNumVerts ( dm );
float goalfac = 0;
ClothVertex *verts = NULL;
@@ -857,7 +857,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *dm, float framenr, int first)
{
- unsigned int i = 0;
+ int i = 0;
MVert *mvert = NULL;
ClothVertex *verts = NULL;
float tnull[3] = {0,0,0};
@@ -1082,13 +1082,13 @@ int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
Cloth *cloth = clmd->clothObject;
ClothSpring *spring = NULL, *tspring = NULL, *tspring2 = NULL;
unsigned int struct_springs = 0, shear_springs=0, bend_springs = 0;
- unsigned int i = 0;
- unsigned int numverts = dm->getNumVerts ( dm );
- unsigned int numedges = dm->getNumEdges ( dm );
- unsigned int numfaces = dm->getNumFaces ( dm );
+ int i = 0;
+ int numverts = dm->getNumVerts ( dm );
+ int numedges = dm->getNumEdges ( dm );
+ int numfaces = dm->getNumFaces ( dm );
MEdge *medge = CDDM_get_edges ( dm );
MFace *mface = CDDM_get_faces ( dm );
- unsigned int index2 = 0; // our second vertex index
+ int index2 = 0; // our second vertex index
LinkNode **edgelist = NULL;
EdgeHash *edgehash = NULL;
LinkNode *search = NULL, *search2 = NULL;
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 6dfb77504fb..b5e09d551f0 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -31,10 +31,11 @@
#include "BKE_cloth.h"
-#include "DNA_group_types.h"
-#include "DNA_object_types.h"
#include "DNA_cloth_types.h"
+#include "DNA_group_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
+#include "DNA_object_force.h"
#include "DNA_scene_types.h"
#include "BKE_DerivedMesh.h"
@@ -1291,116 +1292,6 @@ int cloth_collision_moving ( ClothModifierData *clmd, CollisionModifierData *col
return 1;
}
-int cloth_do_selfcollisions(ClothModifierData * clmd)
-{
- int ret2 = 0, l;
- Cloth *cloth = clmd->clothObject;
-
- if ( clmd->clothObject->bvhselftree )
- {
- for(l = 0; l < clmd->coll_parms->self_loop_count; l++)
- {
- BVHTreeOverlap *overlap = NULL;
- ClothVertex *verts = clmd->clothObject->verts; // needed for openMP
- int k;
- int ret = 0, result = 0;
-
- // search for overlapping collision pairs
- overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result );
-
-// #pragma omp parallel for private(k, i, j) schedule(static)
- for ( k = 0; k < result; k++ )
- {
- float temp[3];
- float length = 0;
- float mindistance;
- int i, j;
-
- i = overlap[k].indexA;
- j = overlap[k].indexB;
-
- mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len );
-
- if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )
- {
- if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
- && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) )
- {
- continue;
- }
- }
-
- VECSUB ( temp, verts[i].tx, verts[j].tx );
-
- if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
-
- // check for adjacent points (i must be smaller j)
- if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) )
- {
- continue;
- }
-
- length = Normalize ( temp );
-
- if ( length < mindistance )
- {
- float correction = mindistance - length;
-
- if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
- {
- VecMulf ( temp, -correction );
- VECADD ( verts[j].tx, verts[j].tx, temp );
- }
- else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED )
- {
- VecMulf ( temp, correction );
- VECADD ( verts[i].tx, verts[i].tx, temp );
- }
- else
- {
- VecMulf ( temp, -correction*0.5 );
- VECADD ( verts[j].tx, verts[j].tx, temp );
-
- VECSUB ( verts[i].tx, verts[i].tx, temp );
- }
- ret = 1;
- ret2 += ret;
- }
- else
- {
- // check for approximated time collisions
- }
- }
-
- if ( overlap )
- MEM_freeN ( overlap );
-
- if(!ret)
- break;
-
- }
- ////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////
- // SELFCOLLISIONS: update velocities
- ////////////////////////////////////////////////////////////
- if ( ret2 )
- {
- int i;
- ClothVertex *verts = clmd->clothObject->verts; // needed for openMP
-
- for ( i = 0; i < cloth->numverts; i++ )
- {
- if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) )
- {
- VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold );
- }
- }
- }
- ////////////////////////////////////////////////////////////
- }
- return ret2;
-}
// return all collision objects in scene
// collision object will exclude self
@@ -1417,9 +1308,34 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
for ( base = G.scene->base.first; base; base = base->next )
{
coll_ob = base->object;
- collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
-
- if ( !collmd )
+
+ if(coll_ob->pd && coll_ob->pd->deflect)
+ {
+ collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
+ }
+
+ if ( collmd )
+ {
+ if(coll_ob == self)
+ continue;
+
+ if(numobj >= maxobj)
+ {
+ // realloc
+ int oldmax = maxobj;
+ CollisionModifierData **tmp;
+ maxobj *= 2;
+ tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray");
+ memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax);
+ MEM_freeN(objs);
+ objs = tmp;
+
+ }
+
+ objs[numobj] = collmd;
+ numobj++;
+ }
+ else
{
if ( coll_ob->dup_group )
{
@@ -1429,8 +1345,12 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
for ( go= group->gobject.first; go; go= go->next )
{
coll_ob = go->ob;
-
- collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
+ collmd = NULL;
+
+ if(coll_ob->pd && coll_ob->pd->deflect)
+ {
+ collmd = ( CollisionModifierData * ) modifiers_findByType ( coll_ob, eModifierType_Collision );
+ }
if ( !collmd )
continue;
@@ -1457,27 +1377,6 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj)
numobj++;
}
}
- }
- else
- {
- if(coll_ob == self)
- continue;
-
- if(numobj >= maxobj)
- {
- // realloc
- int oldmax = maxobj;
- CollisionModifierData **tmp;
- maxobj *= 2;
- tmp = MEM_callocN(sizeof(CollisionModifierData *)*maxobj, "CollisionObjectsArray");
- memcpy(tmp, objs, sizeof(CollisionModifierData *)*oldmax);
- MEM_freeN(objs);
- objs = tmp;
-
- }
-
- objs[numobj] = collmd;
- numobj++;
}
}
*numcollobj = numobj;
@@ -1547,7 +1446,7 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f
{
Cloth *cloth=NULL;
BVHTree *cloth_bvh=NULL;
- long i=0, numfaces = 0, numverts = 0;
+ int i=0, numfaces = 0, numverts = 0, k, l, j;
int rounds = 0; // result counts applied collisions; ic is for debug output;
ClothVertex *verts = NULL;
int ret = 0, ret2 = 0;
@@ -1594,6 +1493,9 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f
BVHTreeOverlap *overlap = NULL;
int result = 0;
+ if(!collmd->bvhtree)
+ continue;
+
/* move object to position (step) in time */
collision_move_object ( collmd, step + dt, step );
@@ -1647,21 +1549,122 @@ int cloth_bvh_objcollision ( Object *ob, ClothModifierData * clmd, float step, f
VECADD ( verts[i].tx, verts[i].txold, verts[i].tv );
}
////////////////////////////////////////////////////////////
-
+
////////////////////////////////////////////////////////////
// Test on *simple* selfcollisions
////////////////////////////////////////////////////////////
if ( clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF )
{
- ret2 += cloth_do_selfcollisions(clmd);
+ for(l = 0; l < clmd->coll_parms->self_loop_count; l++)
+ {
+ // TODO: add coll quality rounds again
+ BVHTreeOverlap *overlap = NULL;
+ int result = 0;
+
+ // collisions = 1;
+ verts = cloth->verts; // needed for openMP
+
+ numfaces = clmd->clothObject->numfaces;
+ numverts = clmd->clothObject->numverts;
+
+ verts = cloth->verts;
+
+ if ( cloth->bvhselftree )
+ {
+ // search for overlapping collision pairs
+ overlap = BLI_bvhtree_overlap ( cloth->bvhselftree, cloth->bvhselftree, &result );
+
+ // #pragma omp parallel for private(k, i, j) schedule(static)
+ for ( k = 0; k < result; k++ )
+ {
+ float temp[3];
+ float length = 0;
+ float mindistance;
+
+ i = overlap[k].indexA;
+ j = overlap[k].indexB;
+
+ mindistance = clmd->coll_parms->selfepsilon* ( cloth->verts[i].avg_spring_len + cloth->verts[j].avg_spring_len );
+
+ if ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL )
+ {
+ if ( ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
+ && ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED ) )
+ {
+ continue;
+ }
+ }
+
+ VECSUB ( temp, verts[i].tx, verts[j].tx );
+
+ if ( ( ABS ( temp[0] ) > mindistance ) || ( ABS ( temp[1] ) > mindistance ) || ( ABS ( temp[2] ) > mindistance ) ) continue;
+
+ // check for adjacent points (i must be smaller j)
+ if ( BLI_edgehash_haskey ( cloth->edgehash, MIN2(i, j), MAX2(i, j) ) )
+ {
+ continue;
+ }
+
+ length = Normalize ( temp );
+
+ if ( length < mindistance )
+ {
+ float correction = mindistance - length;
+
+ if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
+ {
+ VecMulf ( temp, -correction );
+ VECADD ( verts[j].tx, verts[j].tx, temp );
+ }
+ else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED )
+ {
+ VecMulf ( temp, correction );
+ VECADD ( verts[i].tx, verts[i].tx, temp );
+ }
+ else
+ {
+ VecMulf ( temp, -correction*0.5 );
+ VECADD ( verts[j].tx, verts[j].tx, temp );
+
+ VECSUB ( verts[i].tx, verts[i].tx, temp );
+ }
+ ret = 1;
+ ret2 += ret;
+ }
+ else
+ {
+ // check for approximated time collisions
+ }
+ }
+
+ if ( overlap )
+ MEM_freeN ( overlap );
+
+ }
+ }
+ ////////////////////////////////////////////////////////////
+
+ ////////////////////////////////////////////////////////////
+ // SELFCOLLISIONS: update velocities
+ ////////////////////////////////////////////////////////////
+ if ( ret2 )
+ {
+ for ( i = 0; i < cloth->numverts; i++ )
+ {
+ if ( ! ( verts [i].flags & CLOTH_VERT_FLAG_PINNED ) )
+ {
+ VECSUB ( verts[i].tv, verts[i].tx, verts[i].txold );
+ }
+ }
+ }
+ ////////////////////////////////////////////////////////////
}
- ////////////////////////////////////////////////////////////
}
while ( ret2 && ( clmd->coll_parms->loop_count>rounds ) );
if(collobjs)
- + MEM_freeN(collobjs);
+ MEM_freeN(collobjs);
return MIN2 ( ret, 1 );
}
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 295b8fe3552..45b8bb7935c 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -730,3 +730,24 @@ void curvemapping_initialize(CurveMapping *cumap)
curvemap_make_table(cumap->cm+a, &cumap->clipr);
}
}
+
+void curvemapping_table_RGBA(CurveMapping *cumap, float **array, int *size)
+{
+ int a;
+
+ *size = CM_TABLE+1;
+ *array = MEM_callocN(sizeof(float)*(*size)*4, "CurveMapping");
+ curvemapping_initialize(cumap);
+
+ for(a=0; a<*size; a++) {
+ if(cumap->cm[0].table)
+ (*array)[a*4+0]= cumap->cm[0].table[a].y;
+ if(cumap->cm[1].table)
+ (*array)[a*4+1]= cumap->cm[1].table[a].y;
+ if(cumap->cm[2].table)
+ (*array)[a*4+2]= cumap->cm[2].table[a].y;
+ if(cumap->cm[3].table)
+ (*array)[a*4+3]= cumap->cm[3].table[a].y;
+ }
+}
+
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 068501780bc..efb03b71438 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -367,19 +367,12 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
case CONSTRAINT_SPACE_WORLD: /* ---------- FROM WORLDSPACE ---------- */
{
/* world to pose */
- if (to==CONSTRAINT_SPACE_POSE || to==CONSTRAINT_SPACE_LOCAL || to==CONSTRAINT_SPACE_PARLOCAL) {
- Mat4Invert(imat, ob->obmat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, imat);
- }
+ Mat4Invert(imat, ob->obmat);
+ Mat4CpyMat4(tempmat, mat);
+ Mat4MulMat4(mat, tempmat, imat);
- /* pose to local */
- if (to == CONSTRAINT_SPACE_LOCAL) {
- /* call self with slightly different values */
- constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
- }
- /* pose to local + parent */
- else if (to == CONSTRAINT_SPACE_PARLOCAL) {
+ /* use pose-space as stepping stone for other spaces... */
+ if (ELEM(to, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_PARLOCAL)) {
/* call self with slightly different values */
constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
}
@@ -445,69 +438,66 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
break;
case CONSTRAINT_SPACE_LOCAL: /* ------------ FROM LOCALSPACE --------- */
{
- /* local to pose */
- if (to==CONSTRAINT_SPACE_POSE || to==CONSTRAINT_SPACE_WORLD) {
- /* do inverse procedure that was done for pose to local */
- if (pchan->bone) {
- /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
- if (pchan->parent) {
- float offs_bone[4][4];
+ /* local to pose - do inverse procedure that was done for pose to local */
+ if (pchan->bone) {
+ /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
+ if (pchan->parent) {
+ float offs_bone[4][4];
+
+ /* construct offs_bone the same way it is done in armature.c */
+ Mat4CpyMat3(offs_bone, pchan->bone->bone_mat);
+ VECCOPY(offs_bone[3], pchan->bone->head);
+ offs_bone[3][1]+= pchan->bone->parent->length;
+
+ if (pchan->bone->flag & BONE_HINGE) {
+ /* pose_mat = par_pose-space_location * chan_mat */
+ float tmat[4][4];
- /* construct offs_bone the same way it is done in armature.c */
- Mat4CpyMat3(offs_bone, pchan->bone->bone_mat);
- VECCOPY(offs_bone[3], pchan->bone->head);
- offs_bone[3][1]+= pchan->bone->parent->length;
+ /* the rotation of the parent restposition */
+ Mat4CpyMat4(tmat, pchan->bone->parent->arm_mat);
- if (pchan->bone->flag & BONE_HINGE) {
- /* pose_mat = par_pose-space_location * chan_mat */
- float tmat[4][4];
-
- /* the rotation of the parent restposition */
- Mat4CpyMat4(tmat, pchan->bone->parent->arm_mat);
-
- /* the location of actual parent transform */
- VECCOPY(tmat[3], offs_bone[3]);
- offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
- Mat4MulVecfl(pchan->parent->pose_mat, tmat[3]);
-
- Mat4MulMat4(diff_mat, offs_bone, tmat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, diff_mat);
- }
- else {
- /* pose_mat = par_pose_mat * bone_mat * chan_mat */
- Mat4MulMat4(diff_mat, offs_bone, pchan->parent->pose_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, diff_mat);
- }
+ /* the location of actual parent transform */
+ VECCOPY(tmat[3], offs_bone[3]);
+ offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
+ Mat4MulVecfl(pchan->parent->pose_mat, tmat[3]);
+
+ Mat4MulMat4(diff_mat, offs_bone, tmat);
+ Mat4CpyMat4(tempmat, mat);
+ Mat4MulMat4(mat, tempmat, diff_mat);
}
else {
- Mat4CpyMat4(diff_mat, pchan->bone->arm_mat);
-
+ /* pose_mat = par_pose_mat * bone_mat * chan_mat */
+ Mat4MulMat4(diff_mat, offs_bone, pchan->parent->pose_mat);
Mat4CpyMat4(tempmat, mat);
Mat4MulMat4(mat, tempmat, diff_mat);
}
}
+ else {
+ Mat4CpyMat4(diff_mat, pchan->bone->arm_mat);
+
+ Mat4CpyMat4(tempmat, mat);
+ Mat4MulMat4(mat, tempmat, diff_mat);
+ }
}
- /* local to world */
- if (to == CONSTRAINT_SPACE_WORLD) {
+
+ /* use pose-space as stepping stone for other spaces */
+ if (ELEM(to, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_PARLOCAL)) {
/* call self with slightly different values */
constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
- }
+ }
}
break;
case CONSTRAINT_SPACE_PARLOCAL: /* -------------- FROM LOCAL WITH PARENT ---------- */
{
- /* local to pose */
- if (to==CONSTRAINT_SPACE_POSE || to==CONSTRAINT_SPACE_WORLD) {
- if (pchan->bone) {
- Mat4CpyMat4(diff_mat, pchan->bone->arm_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, diff_mat, tempmat);
- }
+ /* local + parent to pose */
+ if (pchan->bone) {
+ Mat4CpyMat4(diff_mat, pchan->bone->arm_mat);
+ Mat4CpyMat4(tempmat, mat);
+ Mat4MulMat4(mat, diff_mat, tempmat);
}
- /* local to world */
- if (to == CONSTRAINT_SPACE_WORLD) {
+
+ /* use pose-space as stepping stone for other spaces */
+ if (ELEM(to, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL)) {
/* call self with slightly different values */
constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
}
@@ -558,8 +548,8 @@ static void contarget_get_mesh_mat (Object *ob, char *substring, float mat[][4])
if (dgroup < 0) return;
/* get DerivedMesh */
- if (G.obedit && G.editMesh) {
- /* we are in editmode, so get a special derived mesh */
+ if ((G.obedit == ob) && (G.editMesh)) {
+ /* target is in editmode, so get a special derived mesh */
dm = CDDM_from_editmesh(G.editMesh, ob->data);
}
else {
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 501293ecd81..2c1f6bb84c1 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -265,14 +265,34 @@ static void layerSwap_tface(void *data, int *corner_indices)
{
MTFace *tf = data;
float uv[4][2];
+ const static short pin_flags[4] =
+ { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 };
+ const static char sel_flags[4] =
+ { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 };
+ short unwrap = tf->unwrap & ~(TF_PIN1 | TF_PIN2 | TF_PIN3 | TF_PIN4);
+ char flag = tf->flag & ~(TF_SEL1 | TF_SEL2 | TF_SEL3 | TF_SEL4);
int j;
for(j = 0; j < 4; ++j) {
- uv[j][0] = tf->uv[corner_indices[j]][0];
- uv[j][1] = tf->uv[corner_indices[j]][1];
+ int source_index = corner_indices[j];
+
+ uv[j][0] = tf->uv[source_index][0];
+ uv[j][1] = tf->uv[source_index][1];
+
+ // swap pinning flags around
+ if(tf->unwrap & pin_flags[source_index]) {
+ unwrap |= pin_flags[j];
+ }
+
+ // swap selection flags around
+ if(tf->flag & sel_flags[source_index]) {
+ flag |= sel_flags[j];
+ }
}
memcpy(tf->uv, uv, sizeof(tf->uv));
+ tf->unwrap = unwrap;
+ tf->flag = flag;
}
static void layerDefault_tface(void *data, int count)
@@ -532,13 +552,14 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
{sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
{sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL},
{sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL},
- {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol}
+ {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol},
+ {sizeof(float)*3*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}
};
const char *LAYERTYPENAMES[CD_NUMTYPES] = {
"CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace", "CDMTFace",
"CDMCol", "CDOrigIndex", "CDNormal", "CDFlags","CDMFloatProperty",
- "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV", "CDMloopCol"};
+ "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent"};
const CustomDataMask CD_MASK_BAREMESH =
CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE;
@@ -552,7 +573,7 @@ const CustomDataMask CD_MASK_EDITMESH =
const CustomDataMask CD_MASK_DERIVEDMESH =
CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE |
CD_MASK_MCOL | CD_MASK_ORIGINDEX | CD_MASK_PROP_FLT | CD_MASK_PROP_INT |
- CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORCO;
+ CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORCO | CD_MASK_TANGENT;
const CustomDataMask CD_MASK_BMESH =
CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_PROP_STR;
const CustomDataMask CD_MASK_FACECORNERS =
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index ab53571b62d..3143c5e4df2 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -220,3 +220,31 @@ void unique_vertexgroup_name (bDeformGroup *dg, Object *ob)
}
}
}
+
+float deformvert_get_weight(const struct MDeformVert *dvert, int group_num)
+{
+ if(dvert)
+ {
+ const MDeformWeight *dw = dvert->dw;
+ int i;
+
+ for(i=dvert->totweight; i>0; i--, dw++)
+ if(dw->def_nr == group_num)
+ return dw->weight;
+ }
+
+ /* Not found */
+ return 0.0;
+}
+
+float vertexgroup_get_vertex_weight(const struct MDeformVert *dvert, int index, int group_num)
+{
+ if(group_num == -1)
+ return 1.0;
+
+ if(dvert == 0)
+ return 0.0;
+
+ return deformvert_get_weight(dvert+index, group_num);
+}
+
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 298e4b81d5b..3b79f6689c0 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -88,6 +88,8 @@
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
static void boundbox_displist(Object *ob);
@@ -986,9 +988,9 @@ void filldisplist(ListBase *dispbase, ListBase *to)
efa= fillfacebase.first;
index= dlnew->index;
while(efa) {
- index[0]= (long)efa->v1->tmp.l;
- index[1]= (long)efa->v2->tmp.l;
- index[2]= (long)efa->v3->tmp.l;
+ index[0]= (intptr_t)efa->v1->tmp.l;
+ index[1]= (intptr_t)efa->v2->tmp.l;
+ index[2]= (intptr_t)efa->v3->tmp.l;
index+= 3;
efa= efa->next;
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 4588ef800e1..72f70cf17ff 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -59,6 +59,7 @@
#include "BKE_armature.h"
#include "BKE_bad_level_calls.h"
#include "BKE_blender.h"
+#include "BKE_collision.h"
#include "BKE_constraint.h"
#include "BKE_deform.h"
#include "BKE_depsgraph.h"
@@ -157,6 +158,13 @@ static void add_to_effectorcache(ListBase *lb, Object *ob, Object *obsrc)
}
}
else if(pd->forcefield) {
+
+ if(pd->forcefield == PFIELD_WIND)
+ {
+ pd->rng = rng_new(1);
+ rng_srandom(pd->rng, (unsigned int)(ceil(PIL_check_seconds_timer()))); // use better seed
+ }
+
ec= MEM_callocN(sizeof(pEffectorCache), "effector cache");
ec->ob= ob;
BLI_addtail(lb, ec);
@@ -205,13 +213,288 @@ void pdEndEffectors(ListBase *lb)
pEffectorCache *ec;
/* restore full copy */
for(ec= lb->first; ec; ec= ec->next)
+ {
+ if(ec->ob->pd && (ec->ob->pd->forcefield == PFIELD_WIND))
+ rng_free(ec->ob->pd->rng);
+
*(ec->ob)= ec->obcopy;
+ }
BLI_freelistN(lb);
}
}
+/************************************************/
+/* Effectors */
+/************************************************/
+
+// triangle - ray callback function
+static void eff_tri_ray_hit(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
+{
+ // whenever we hit a bounding box, we don't check further
+ hit->dist = -1;
+ hit->index = 1;
+}
+
+// get visibility of a wind ray
+static float eff_calc_visibility(Object *ob, float *co, float *dir)
+{
+ CollisionModifierData **collobjs = NULL;
+ int numcollobj = 0, i;
+ float norm[3], len = 0.0;
+ float visibility = 1.0;
+
+ collobjs = get_collisionobjects(ob, &numcollobj);
+
+ if(!collobjs)
+ return 0;
+
+ VECCOPY(norm, dir);
+ VecMulf(norm, -1.0);
+ len = Normalize(norm);
+
+ // check all collision objects
+ for(i = 0; i < numcollobj; i++)
+ {
+ CollisionModifierData *collmd = collobjs[i];
+
+ if(collmd->bvhtree)
+ {
+ BVHTreeRayHit hit;
+
+ hit.index = -1;
+ hit.dist = len + FLT_EPSILON;
+
+ // check if the way is blocked
+ if(BLI_bvhtree_ray_cast(collmd->bvhtree, co, norm, &hit, eff_tri_ray_hit, NULL)>=0)
+ {
+ // visibility is only between 0 and 1, calculated from 1-absorption
+ visibility *= MAX2(0.0, MIN2(1.0, (1.0-((float)collmd->absorption)*0.01)));
+
+ if(visibility <= 0.0f)
+ break;
+ }
+ }
+ }
+
+ MEM_freeN(collobjs);
+
+ return visibility;
+}
+
+// noise function for wind e.g.
+static float wind_func(struct RNG *rng, float strength)
+{
+ int random = (rng_getInt(rng)+1) % 65535; // max 2357
+ float force = rng_getFloat(rng) + 1.0f;
+ float ret;
+ float sign = 0;
+
+ sign = (random > 32000.0) ? 1.0: -1.0; // dividing by 2 is not giving equal sign distribution
+
+ ret = sign*((float)random / force)*strength/65535.0f;
+
+ return ret;
+}
+
+
+static float falloff_func(float fac, int usemin, float mindist, int usemax, float maxdist, float power)
+{
+ if(!usemin)
+ mindist= 0.0f;
+
+ if(fac < mindist) {
+ return 1.0f;
+ }
+ else if(usemax) {
+ if(fac>maxdist || (maxdist-mindist)<=0.0f)
+ return 0.0f;
+
+ fac= (fac-mindist)/(maxdist-mindist);
+ return 1.0f - (float)pow((double)fac, (double)power);
+ }
+ else
+ return pow((double)1.0f+fac-mindist, (double)-power);
+}
+
+static float falloff_func_dist(PartDeflect *pd, float fac)
+{
+ return falloff_func(fac, pd->flag&PFIELD_USEMIN, pd->mindist, pd->flag&PFIELD_USEMAX, pd->maxdist, pd->f_power);
+}
+
+static float falloff_func_rad(PartDeflect *pd, float fac)
+{
+ return falloff_func(fac, pd->flag&PFIELD_USEMINR, pd->minrad, pd->flag&PFIELD_USEMAXR, pd->maxrad, pd->f_power_r);
+}
+
+float effector_falloff(PartDeflect *pd, float *eff_velocity, float *vec_to_part)
+{
+ float eff_dir[3], temp[3];
+ float falloff=1.0, fac, r_fac;
+
+ if(pd->forcefield==PFIELD_LENNARDJ)
+ return falloff; /* Lennard-Jones field has it's own falloff built in */
+
+ VecCopyf(eff_dir,eff_velocity);
+ Normalize(eff_dir);
+
+ if(pd->flag & PFIELD_POSZ && Inpf(eff_dir,vec_to_part)<0.0f)
+ falloff=0.0f;
+ else switch(pd->falloff){
+ case PFIELD_FALL_SPHERE:
+ fac=VecLength(vec_to_part);
+ falloff= falloff_func_dist(pd, fac);
+ break;
+
+ case PFIELD_FALL_TUBE:
+ fac=Inpf(vec_to_part,eff_dir);
+ falloff= falloff_func_dist(pd, ABS(fac));
+ if(falloff == 0.0f)
+ break;
+
+ VECADDFAC(temp,vec_to_part,eff_dir,-fac);
+ r_fac=VecLength(temp);
+ falloff*= falloff_func_rad(pd, r_fac);
+ break;
+ case PFIELD_FALL_CONE:
+ fac=Inpf(vec_to_part,eff_dir);
+ falloff= falloff_func_dist(pd, ABS(fac));
+ if(falloff == 0.0f)
+ break;
+
+ r_fac=saacos(fac/VecLength(vec_to_part))*180.0f/(float)M_PI;
+ falloff*= falloff_func_rad(pd, r_fac);
+
+ break;
+ }
+
+ return falloff;
+}
+
+void do_physical_effector(Object *ob, float *opco, short type, float force_val, float distance, float falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar, struct RNG *rng, float noise_factor, float charge, float pa_size)
+{
+ float mag_vec[3]={0,0,0};
+ float temp[3], temp2[3];
+ float eff_vel[3];
+ float noise = 0, visibility;
+
+ // calculate visibility
+ visibility = eff_calc_visibility(ob, opco, vec_to_part);
+ if(visibility <= 0.0)
+ return;
+ falloff *= visibility;
+
+ VecCopyf(eff_vel,eff_velocity);
+ Normalize(eff_vel);
+
+ switch(type){
+ case PFIELD_WIND:
+ VECCOPY(mag_vec,eff_vel);
+
+ // add wind noise here, only if we have wind
+ if((noise_factor > 0.0f) && (force_val > FLT_EPSILON))
+ noise = wind_func(rng, noise_factor);
+
+ VecMulf(mag_vec,(force_val+noise)*falloff);
+ VecAddf(field,field,mag_vec);
+ break;
+
+ case PFIELD_FORCE:
+ if(planar)
+ Projf(mag_vec,vec_to_part,eff_vel);
+ else
+ VecCopyf(mag_vec,vec_to_part);
+
+ Normalize(mag_vec);
+
+ VecMulf(mag_vec,force_val*falloff);
+ VecAddf(field,field,mag_vec);
+ break;
+
+ case PFIELD_VORTEX:
+ Crossf(mag_vec,eff_vel,vec_to_part);
+
+ Normalize(mag_vec);
+
+ VecMulf(mag_vec,force_val*distance*falloff);
+ VecAddf(field,field,mag_vec);
+
+ break;
+ case PFIELD_MAGNET:
+ if(planar)
+ VecCopyf(temp,eff_vel);
+ else
+ /* magnetic field of a moving charge */
+ Crossf(temp,eff_vel,vec_to_part);
+
+ Normalize(temp);
+
+ Crossf(temp2,velocity,temp);
+ VecAddf(mag_vec,mag_vec,temp2);
+
+ VecMulf(mag_vec,force_val*falloff);
+ VecAddf(field,field,mag_vec);
+ break;
+ case PFIELD_HARMONIC:
+ if(planar)
+ Projf(mag_vec,vec_to_part,eff_vel);
+ else
+ VecCopyf(mag_vec,vec_to_part);
+
+ Normalize(mag_vec);
+
+ VecMulf(mag_vec,force_val*falloff);
+ VecSubf(field,field,mag_vec);
+
+ VecCopyf(mag_vec,velocity);
+ /* 1.9 is an experimental value to get critical damping at damp=1.0 */
+ VecMulf(mag_vec,damp*1.9f*(float)sqrt(force_val));
+ VecSubf(field,field,mag_vec);
+ break;
+ case PFIELD_CHARGE:
+ if(planar)
+ Projf(mag_vec,vec_to_part,eff_vel);
+ else
+ VecCopyf(mag_vec,vec_to_part);
+
+ Normalize(mag_vec);
+
+ VecMulf(mag_vec,charge*force_val*falloff);
+ VecAddf(field,field,mag_vec);
+ break;
+ case PFIELD_LENNARDJ:
+ {
+ float fac;
+
+ if(planar) {
+ Projf(mag_vec,vec_to_part,eff_vel);
+ distance = VecLength(mag_vec);
+ }
+ else
+ VecCopyf(mag_vec,vec_to_part);
+
+ /* at this distance the field is 60 times weaker than maximum */
+ if(distance > 2.22 * (size+pa_size))
+ break;
+
+ fac = pow((size+pa_size)/distance,6.0);
+
+ fac = - fac * (1.0 - fac) / distance;
+
+ /* limit the repulsive term drastically to avoid huge forces */
+ fac = ((fac>2.0) ? 2.0 : fac);
+
+ /* 0.003715 is the fac value at 2.22 times (size+pa_size),
+ substracted to avoid discontinuity at the border
+ */
+ VecMulf(mag_vec, force_val * (fac-0.0037315));
+ VecAddf(field,field,mag_vec);
+ break;
+ }
+ }
+}
+
/* -------- pdDoEffectors() --------
generic force/speed system, now used for particles and softbodies
lb = listbase with objects that take part in effecting
@@ -244,13 +527,10 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float
pEffectorCache *ec;
PartDeflect *pd;
float vect_to_vert[3];
- float f_force, force_vec[3];
float *obloc;
- float distance, force_val, ffall_val;
- float guidecollect[3], guidedist= 0.0f;
- int cur_frame;
- guidecollect[0]= guidecollect[1]= guidecollect[2]=0.0f;
+ float distance, vec_to_part[3];
+ float falloff;
/* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */
/* Check for min distance here? (yes would be cool to add that, ton) */
@@ -261,178 +541,28 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float
pd= ob->pd;
/* Get IPO force strength and fall off values here */
- if (has_ipo_code(ob->ipo, OB_PD_FSTR))
- force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, cur_time);
- else
- force_val = pd->f_strength;
-
- if (has_ipo_code(ob->ipo, OB_PD_FFALL))
- ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, cur_time);
- else
- ffall_val = pd->f_power;
-
- /* Need to set r.cfra for paths (investigate, ton) (uses ob->ctime now, ton) */
- if(ob->ctime!=cur_time) {
- cur_frame = G.scene->r.cfra;
- G.scene->r.cfra = (int)cur_time;
- where_is_object_time(ob, cur_time);
- G.scene->r.cfra = cur_frame;
- }
+ where_is_object_time(ob,cur_time);
/* use center of object for distance calculus */
- obloc= ob->obmat[3];
- VECSUB(vect_to_vert, obloc, opco);
- distance = VecLength(vect_to_vert);
-
- if((pd->flag & PFIELD_USEMAX) && distance>pd->maxdist && pd->forcefield != PFIELD_GUIDE)
- ; /* don't do anything */
- else if((pd->flag & PFIELD_USEMIN) && distance<pd->mindist && pd->forcefield != PFIELD_GUIDE)
+ VecSubf(vec_to_part, opco, ob->obmat[3]);
+ distance = VecLength(vec_to_part);
+
+ falloff=effector_falloff(pd,ob->obmat[2],vec_to_part);
+
+ if(falloff<=0.0f)
; /* don't do anything */
- else if(pd->forcefield == PFIELD_WIND) {
- VECCOPY(force_vec, ob->obmat[2]);
-
- /* wind works harder perpendicular to normal, would be nice for softbody later (ton) */
-
- /* Limit minimum distance to vertex so that */
- /* the force is not too big */
- if (distance < 0.001) distance = 0.001f;
- f_force = (force_val)*(1/(1000 * (float)pow((double)distance, (double)ffall_val)));
- /* this option for softbody only */
- if(flags && PE_WIND_AS_SPEED){
- speed[0] -= (force_vec[0] * f_force );
- speed[1] -= (force_vec[1] * f_force );
- speed[2] -= (force_vec[2] * f_force );
- }
- else{
- force[0] += force_vec[0]*f_force;
- force[1] += force_vec[1]*f_force;
- force[2] += force_vec[2]*f_force;
- }
- }
- else if(pd->forcefield == PFIELD_FORCE) {
-
- /* only use center of object */
- obloc= ob->obmat[3];
-
- /* Now calculate the gravitational force */
- VECSUB(vect_to_vert, obloc, opco);
- distance = VecLength(vect_to_vert);
-
- /* Limit minimum distance to vertex so that */
- /* the force is not too big */
- if (distance < 0.001) distance = 0.001f;
- f_force = (force_val)*(1.0/(1000.0 * (float)pow((double)distance, (double)ffall_val)));
- force[0] += (vect_to_vert[0] * f_force );
- force[1] += (vect_to_vert[1] * f_force );
- force[2] += (vect_to_vert[2] * f_force );
- }
- else if(pd->forcefield == PFIELD_VORTEX) {
- float vortexvec[3];
+ else {
+ float field[3]={0,0,0}, tmp[3];
+ VECCOPY(field, force);
+ do_physical_effector(ob, opco, pd->forcefield,pd->f_strength,distance,
+ falloff,pd->f_dist,pd->f_damp,ob->obmat[2],vec_to_part,
+ speed,force,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise, 0.0f, 0.0f);
- /* only use center of object */
- obloc= ob->obmat[3];
-
- /* Now calculate the vortex force */
- VECSUB(vect_to_vert, obloc, opco);
- distance = VecLength(vect_to_vert);
-
- Crossf(force_vec, ob->obmat[2], vect_to_vert);
- Normalize(force_vec);
-
- /* Limit minimum distance to vertex so that */
- /* the force is not too big */
- if (distance < 0.001) distance = 0.001f;
- f_force = (force_val)*(1.0/(100.0 * (float)pow((double)distance, (double)ffall_val)));
- vortexvec[0]= -(force_vec[0] * f_force );
- vortexvec[1]= -(force_vec[1] * f_force );
- vortexvec[2]= -(force_vec[2] * f_force );
-
- /* this option for softbody only */
- if(flags &&PE_WIND_AS_SPEED) {
- speed[0]+= vortexvec[0];
- speed[1]+= vortexvec[1];
- speed[2]+= vortexvec[2];
- }
- else {
- /* since vortex alters the speed, we have to correct for the previous vortex result */
- speed[0]+= vortexvec[0] - ec->oldspeed[0];
- speed[1]+= vortexvec[1] - ec->oldspeed[1];
- speed[2]+= vortexvec[2] - ec->oldspeed[2];
-
- VECCOPY(ec->oldspeed, vortexvec);
+ // for softbody backward compatibility
+ if(flags & PE_WIND_AS_SPEED){
+ VECSUB(tmp, force, field);
+ VECSUB(speed, speed, tmp);
}
}
- else if(pd->forcefield == PFIELD_GUIDE) {
- float guidevec[4], guidedir[3];
- float mindist= force_val; /* force_val is actually mindist in the UI */
-
- distance= ec->guide_dist;
-
- /* WARNING: bails out with continue here */
- if((pd->flag & PFIELD_USEMAX) && distance>pd->maxdist) continue;
-
- /* calculate contribution factor for this guide */
- if(distance<=mindist) f_force= 1.0f;
- else if(pd->flag & PFIELD_USEMAX) {
- if(distance>pd->maxdist || mindist>=pd->maxdist) f_force= 0.0f;
- else {
- f_force= 1.0f - (distance-mindist)/(pd->maxdist - mindist);
- if(ffall_val!=0.0f)
- f_force = (float)pow(f_force, ffall_val+1.0);
- }
- }
- else {
- f_force= 1.0f/(1.0f + distance-mindist);
- if(ffall_val!=0.0f)
- f_force = (float)pow(f_force, ffall_val+1.0);
- }
-
- /* now derive path point from loc_time */
- if(pd->flag & PFIELD_GUIDE_PATH_ADD)
- where_on_path(ob, f_force*loc_time*ec->time_scale, guidevec, guidedir);
- else
- where_on_path(ob, loc_time*ec->time_scale, guidevec, guidedir);
-
- VECSUB(guidedir, guidevec, ec->oldloc);
- VECCOPY(ec->oldloc, guidevec);
-
- Mat4Mul3Vecfl(ob->obmat, guidedir);
- VecMulf(guidedir, ec->scale); /* correction for lifetime and speed */
-
- /* we subtract the speed we gave it previous step */
- VECCOPY(guidevec, guidedir);
- VECSUB(guidedir, guidedir, ec->oldspeed);
- VECCOPY(ec->oldspeed, guidevec);
-
- /* if it fully contributes, we stop */
- if(f_force==1.0) {
- VECCOPY(guidecollect, guidedir);
- guidedist= 1.0f;
- break;
- }
- else if(guidedist<1.0f) {
- VecMulf(guidedir, f_force);
- VECADD(guidecollect, guidecollect, guidedir);
- guidedist += f_force;
- }
- }
- }
-
- /* all guides are accumulated here */
- if(guidedist!=0.0f) {
- if(guidedist!=1.0f) VecMulf(guidecollect, 1.0f/guidedist);
- VECADD(speed, speed, guidecollect);
}
}
-
-
-/* for paf start to end, store all matrices for objects */
-typedef struct pMatrixCache {
- float obmat[4][4];
- float imat[3][3];
-} pMatrixCache;
-
-/* for fluidsim win32 debug messages */
-#if defined(WIN32) && (!(defined snprintf))
-#define snprintf _snprintf
-#endif
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index cab7865c1b6..b9e3c593ddf 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -50,6 +50,8 @@
#include "BKE_icons.h"
#include "BKE_utildefines.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#define GS(a) (*((short *)(a)))
/* GLOBALS */
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 2ef2f3a1b77..b16f52571f6 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -54,7 +54,8 @@ static char idp_size_table[] = {
sizeof(float)*16, /*Matrix type, deprecated*/
0, /*arrays don't have a fixed size*/
sizeof(ListBase), /*Group type*/
- sizeof(void*)
+ sizeof(void*),
+ sizeof(double)
};
@@ -365,10 +366,14 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name)
prop = MEM_callocN(sizeof(IDProperty), "IDProperty float");
*(float*)&prop->data.val = val.f;
break;
+ case IDP_DOUBLE:
+ prop = MEM_callocN(sizeof(IDProperty), "IDProperty float");
+ *(double*)&prop->data.val = val.d;
+ break;
case IDP_ARRAY:
{
- /*for now, we only support float and int arrays*/
- if (val.array.type == IDP_FLOAT || val.array.type == IDP_INT) {
+ /*for now, we only support float and int and double arrays*/
+ if (val.array.type == IDP_FLOAT || val.array.type == IDP_INT || val.array.type == IDP_DOUBLE) {
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
prop->len = prop->totallen = val.array.len;
prop->subtype = val.array.type;
@@ -411,6 +416,10 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name)
prop->type = type;
strncpy(prop->name, name, MAX_IDPROP_NAME);
+
+ /*security null byte*/
+ prop->name[MAX_IDPROP_NAME-1] = 0;
+
return prop;
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index b6c8ad59e08..27fa00ac239 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -53,6 +53,7 @@
#include "DNA_packedFile_types.h"
#include "DNA_scene_types.h"
#include "DNA_camera_types.h"
+#include "DNA_sequence_types.h"
#include "DNA_texture_types.h"
#include "DNA_userdef_types.h"
@@ -77,15 +78,17 @@
#include "RE_pipeline.h"
-/* bad level; call to free_realtime_image */
-#include "BKE_bad_level_calls.h"
-
/* for stamp drawing to an image */
#include "BMF_Api.h"
#include "blendef.h"
#include "BSE_time.h"
+#include "GPU_extensions.h"
+#include "GPU_draw.h"
+
+#include "BLO_sys_types.h" // for intptr_t support
+
/* max int, to indicate we don't store sequences in ibuf */
#define IMA_NO_INDEX 0x7FEFEFEF
@@ -238,7 +241,7 @@ static void image_free_buffers(Image *ima)
ima->rr= NULL;
}
- free_realtime_image(ima);
+ GPU_free_image(ima);
ima->ok= IMA_OK;
}
@@ -618,7 +621,7 @@ void free_old_images()
This gives textures a "second chance" to be used before dying.
*/
if(ima->bindcode || ima->repbind) {
- free_realtime_image(ima);
+ GPU_free_image(ima);
ima->lastused = ctime;
}
/* Otherwise, just kill the buffers */
@@ -630,11 +633,11 @@ void free_old_images()
}
}
-static unsigned long image_mem_size(Image *ima)
+static uintptr_t image_mem_size(Image *ima)
{
ImBuf *ibuf, *ibufm;
int level;
- unsigned long size = 0;
+ uintptr_t size = 0;
size= 0;
for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) {
@@ -656,7 +659,7 @@ static unsigned long image_mem_size(Image *ima)
void BKE_image_print_memlist(void)
{
Image *ima;
- unsigned long size, totsize= 0;
+ uintptr_t size, totsize= 0;
for(ima= G.main->image.first; ima; ima= ima->id.next)
totsize += image_mem_size(ima);
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index 297ac0b1530..93e35a4db06 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -1354,25 +1354,57 @@ DO_INLINE void cloth_apply_spring_force(ClothModifierData *clmd, ClothSpring *s,
}
}
+
+static void CalcFloat( float *v1, float *v2, float *v3, float *n)
+{
+ float n1[3],n2[3];
+
+ n1[0]= v1[0]-v2[0];
+ n2[0]= v2[0]-v3[0];
+ n1[1]= v1[1]-v2[1];
+ n2[1]= v2[1]-v3[1];
+ n1[2]= v1[2]-v2[2];
+ n2[2]= v2[2]-v3[2];
+ n[0]= n1[1]*n2[2]-n1[2]*n2[1];
+ n[1]= n1[2]*n2[0]-n1[0]*n2[2];
+ n[2]= n1[0]*n2[1]-n1[1]*n2[0];
+}
+
+static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
+{
+ /* real cross! */
+ float n1[3],n2[3];
+
+ n1[0]= v1[0]-v3[0];
+ n1[1]= v1[1]-v3[1];
+ n1[2]= v1[2]-v3[2];
+
+ n2[0]= v2[0]-v4[0];
+ n2[1]= v2[1]-v4[1];
+ n2[2]= v2[2]-v4[2];
+
+ n[0]= n1[1]*n2[2]-n1[2]*n2[1];
+ n[1]= n1[2]*n2[0]-n1[0]*n2[2];
+ n[2]= n1[0]*n2[1]-n1[1]*n2[0];
+}
+
float calculateVertexWindForce(float wind[3], float vertexnormal[3])
{
- return fabs(INPR(wind, vertexnormal));
+ return (INPR(wind, vertexnormal));
}
void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M)
{
/* Collect forces and derivatives: F,dFdX,dFdV */
Cloth *cloth = clmd->clothObject;
- long i = 0;
+ int i = 0;
float spring_air = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */
float gravity[3];
float tm2[3][3] = {{-spring_air,0,0}, {0,-spring_air,0},{0,0,-spring_air}};
MFace *mfaces = cloth->mfaces;
- //ClothVertex *verts = cloth->verts;
- float wind_normalized[3];
unsigned int numverts = cloth->numverts;
LinkNode *search = cloth->springs;
-
+ lfVector *winvec;
VECCOPY(gravity, clmd->sim_parms->gravity);
mul_fvector_S(gravity, gravity, 0.001f); /* scale gravity force */
@@ -1387,7 +1419,7 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec
/* multiply lF with mass matrix
// force = mass * acceleration (in this case: gravity)
*/
- for(i = 0; i < (long)numverts; i++)
+ for(i = 0; i < numverts; i++)
{
float temp[3];
VECCOPY(temp, lF[i]);
@@ -1399,70 +1431,61 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec
/* handle external forces like wind */
if(effectors)
{
- for(i = 0; i < cloth->numfaces; i++)
+ // 0 = force, 1 = normalized force
+ winvec = create_lfvector(cloth->numverts);
+
+ if(!winvec)
+ printf("winvec: out of memory in implicit.c\n");
+
+ // precalculate wind forces
+ for(i = 0; i < cloth->numverts; i++)
{
- float vertexnormal[3]={0,0,0};
float speed[3] = {0.0f, 0.0f,0.0f};
- float force[3]= {0.0f, 0.0f, 0.0f};
+ pdDoEffectors(effectors, lX[i], winvec[i], speed, (float)G.scene->r.cfra, 0.0f, 0);
+ }
+
+ for(i = 0; i < cloth->numfaces; i++)
+ {
+ float trinormal[3]={0,0,0}; // normalized triangle normal
+ float triunnormal[3]={0,0,0}; // not-normalized-triangle normal
+ float tmp[3]={0,0,0};
+ float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0;
+ factor *= 0.02;
+
+ // calculate face normal
if(mfaces[i].v4)
- CalcNormFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],vertexnormal);
+ CalcFloat4(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],lX[mfaces[i].v4],triunnormal);
else
- CalcNormFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],vertexnormal);
+ CalcFloat(lX[mfaces[i].v1],lX[mfaces[i].v2],lX[mfaces[i].v3],triunnormal);
- pdDoEffectors(effectors, lX[mfaces[i].v1], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
- VECCOPY(wind_normalized, speed);
- Normalize(wind_normalized);
- VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal));
+ VECCOPY(trinormal, triunnormal);
+ Normalize(trinormal);
- if(mfaces[i].v4)
- {
- VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], wind_normalized, 0.25);
- }
- else
- {
- VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], wind_normalized, 1.0 / 3.0);
- }
+ // add wind from v1
+ VECCOPY(tmp, trinormal);
+ VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v1], triunnormal));
+ VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], tmp, factor);
- speed[0] = speed[1] = speed[2] = 0.0;
- pdDoEffectors(effectors, lX[mfaces[i].v2], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
- VECCOPY(wind_normalized, speed);
- Normalize(wind_normalized);
- VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal));
- if(mfaces[i].v4)
- {
- VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], wind_normalized, 0.25);
- }
- else
- {
- VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], wind_normalized, 1.0 / 3.0);
- }
+ // add wind from v2
+ VECCOPY(tmp, trinormal);
+ VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v2], triunnormal));
+ VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], tmp, factor);
- speed[0] = speed[1] = speed[2] = 0.0;
- pdDoEffectors(effectors, lX[mfaces[i].v3], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
- VECCOPY(wind_normalized, speed);
- Normalize(wind_normalized);
- VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal));
- if(mfaces[i].v4)
- {
- VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], wind_normalized, 0.25);
- }
- else
- {
- VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], wind_normalized, 1.0 / 3.0);
- }
+ // add wind from v3
+ VECCOPY(tmp, trinormal);
+ VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v3], triunnormal));
+ VECADDS(lF[mfaces[i].v3], lF[mfaces[i].v3], tmp, factor);
- speed[0] = speed[1] = speed[2] = 0.0;
+ // add wind from v4
if(mfaces[i].v4)
{
- pdDoEffectors(effectors, lX[mfaces[i].v4], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
- VECCOPY(wind_normalized, speed);
- Normalize(wind_normalized);
- VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal));
- VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], wind_normalized, 0.25);
+ VECCOPY(tmp, trinormal);
+ VecMulf(tmp, calculateVertexWindForce(winvec[mfaces[i].v4], triunnormal));
+ VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], tmp, factor);
}
-
}
+ del_lfvector(winvec);
}
// calculate spring forces
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 59eb3837aab..e8a25aaaf80 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -182,7 +182,7 @@ int part_ar[PART_TOTIPO]= {
PART_EMIT_FREQ, PART_EMIT_LIFE, PART_EMIT_VEL, PART_EMIT_AVE, PART_EMIT_SIZE,
PART_AVE, PART_SIZE, PART_DRAG, PART_BROWN, PART_DAMP, PART_LENGTH, PART_CLUMP,
PART_GRAV_X, PART_GRAV_Y, PART_GRAV_Z, PART_KINK_AMP, PART_KINK_FREQ, PART_KINK_SHAPE,
- PART_BB_TILT
+ PART_BB_TILT, PART_PD_FSTR, PART_PD_FFALL, PART_PD_FMAXD, PART_PD2_FSTR, PART_PD2_FFALL, PART_PD2_FMAXD
};
@@ -1390,6 +1390,14 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type)
else if(icu->adrcode & MA_MAP8) mtex= ma->mtex[7];
else if(icu->adrcode & MA_MAP9) mtex= ma->mtex[8];
else if(icu->adrcode & MA_MAP10) mtex= ma->mtex[9];
+ else if(icu->adrcode & MA_MAP12) mtex= ma->mtex[11];
+ else if(icu->adrcode & MA_MAP11) mtex= ma->mtex[10];
+ else if(icu->adrcode & MA_MAP13) mtex= ma->mtex[12];
+ else if(icu->adrcode & MA_MAP14) mtex= ma->mtex[13];
+ else if(icu->adrcode & MA_MAP15) mtex= ma->mtex[14];
+ else if(icu->adrcode & MA_MAP16) mtex= ma->mtex[15];
+ else if(icu->adrcode & MA_MAP17) mtex= ma->mtex[16];
+ else if(icu->adrcode & MA_MAP18) mtex= ma->mtex[17];
if(mtex) {
poin= give_mtex_poin(mtex, icu->adrcode & (MA_MAP1-1) );
@@ -1479,7 +1487,14 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type)
else if(icu->adrcode & MA_MAP8) mtex= wo->mtex[7];
else if(icu->adrcode & MA_MAP9) mtex= wo->mtex[8];
else if(icu->adrcode & MA_MAP10) mtex= wo->mtex[9];
-
+ else if(icu->adrcode & MA_MAP11) mtex= wo->mtex[10];
+ else if(icu->adrcode & MA_MAP12) mtex= wo->mtex[11];
+ else if(icu->adrcode & MA_MAP13) mtex= wo->mtex[12];
+ else if(icu->adrcode & MA_MAP14) mtex= wo->mtex[13];
+ else if(icu->adrcode & MA_MAP15) mtex= wo->mtex[14];
+ else if(icu->adrcode & MA_MAP16) mtex= wo->mtex[15];
+ else if(icu->adrcode & MA_MAP17) mtex= wo->mtex[16];
+ else if(icu->adrcode & MA_MAP18) mtex= wo->mtex[17];
if(mtex) {
poin= give_mtex_poin(mtex, icu->adrcode & (MA_MAP1-1) );
}
@@ -1524,6 +1539,14 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type)
else if(icu->adrcode & MA_MAP8) mtex= la->mtex[7];
else if(icu->adrcode & MA_MAP9) mtex= la->mtex[8];
else if(icu->adrcode & MA_MAP10) mtex= la->mtex[9];
+ else if(icu->adrcode & MA_MAP11) mtex= la->mtex[10];
+ else if(icu->adrcode & MA_MAP12) mtex= la->mtex[11];
+ else if(icu->adrcode & MA_MAP13) mtex= la->mtex[12];
+ else if(icu->adrcode & MA_MAP14) mtex= la->mtex[13];
+ else if(icu->adrcode & MA_MAP15) mtex= la->mtex[14];
+ else if(icu->adrcode & MA_MAP16) mtex= la->mtex[15];
+ else if(icu->adrcode & MA_MAP17) mtex= la->mtex[16];
+ else if(icu->adrcode & MA_MAP18) mtex= la->mtex[17];
if(mtex) {
poin= give_mtex_poin(mtex, icu->adrcode & (MA_MAP1-1) );
@@ -1608,6 +1631,18 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type)
poin= &(part->kink_shape); break;
case PART_BB_TILT:
poin= &(part->bb_tilt); break;
+ case PART_PD_FSTR:
+ poin= (part->pd?(&(part->pd->f_strength)):NULL); break;
+ case PART_PD_FFALL:
+ poin= (part->pd?(&(part->pd->f_power)):NULL); break;
+ case PART_PD_FMAXD:
+ poin= (part->pd?(&(part->pd->maxdist)):NULL); break;
+ case PART_PD2_FSTR:
+ poin= (part->pd2?(&(part->pd2->f_strength)):NULL); break;
+ case PART_PD2_FFALL:
+ poin= (part->pd2?(&(part->pd2->f_power)):NULL); break;
+ case PART_PD2_FMAXD:
+ poin= (part->pd2?(&(part->pd2->maxdist)):NULL); break;
}
}
@@ -1660,6 +1695,8 @@ void set_icu_vars(IpoCurve *icu)
icu->ymax= 5.0; break;
case MA_ADD:
icu->ymax= 1.0; break;
+ case MA_EMIT:
+ icu->ymax= 2.0; break;
default:
icu->ymax= 1.0; break;
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 3983eecdaba..f05b84f6e90 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -61,6 +61,8 @@
#include "BPY_extern.h"
+#include "GPU_material.h"
+
/* used in UI and render */
Material defmaterial;
@@ -96,6 +98,9 @@ void free_material(Material *ma)
ntreeFreeTree(ma->nodetree);
MEM_freeN(ma->nodetree);
}
+
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
}
void init_material(Material *ma)
@@ -207,6 +212,8 @@ Material *copy_material(Material *ma)
if(ma->nodetree) {
man->nodetree= ntreeCopyTree(ma->nodetree, 0); /* 0 == full new tree */
}
+
+ man->gpumaterial.first= man->gpumaterial.last= NULL;
return man;
}
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 43e48c3bacd..77b9ea4fa2d 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -79,45 +79,6 @@
#include "BLI_editVert.h"
#include "BLI_arithb.h"
-int update_realtime_texture(MTFace *tface, double time)
-{
- Image *ima;
- int inc = 0;
- float diff;
- int newframe;
-
- ima = tface->tpage;
-
- if (!ima)
- return 0;
-
- if (ima->lastupdate<0)
- ima->lastupdate = 0;
-
- if (ima->lastupdate>time)
- ima->lastupdate=(float)time;
-
- if(ima->tpageflag & IMA_TWINANIM) {
- if(ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1;
-
- /* check: is the bindcode not in the array? Then free. (still to do) */
-
- diff = (float)(time-ima->lastupdate);
-
- inc = (int)(diff*(float)ima->animspeed);
-
- ima->lastupdate+=((float)inc/(float)ima->animspeed);
-
- newframe = ima->lastframe+inc;
-
- if (newframe > (int)ima->twend)
- newframe = (int)ima->twsta-1 + (newframe-ima->twend)%(ima->twend-ima->twsta);
-
- ima->lastframe = newframe;
- }
- return inc;
-}
-
void mesh_update_customdata_pointers(Mesh *me)
{
me->mvert = CustomData_get_layer(&me->vdata, CD_MVERT);
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index f13f8ef0298..4c74fe1cca2 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -97,9 +97,12 @@
#include "BKE_material.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
+#include "BKE_texture.h"
#include "BKE_utildefines.h"
#include "depsgraph_private.h"
#include "BKE_bmesh.h"
+#include "BKE_deform.h"
+#include "BKE_shrinkwrap.h"
#include "LOD_DependKludge.h"
#include "LOD_decimation.h"
@@ -1130,8 +1133,18 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
mface[numFaces].v1 = vert_map[mface[numFaces].v1];
mface[numFaces].v2 = vert_map[mface[numFaces].v2];
mface[numFaces].v3 = vert_map[mface[numFaces].v3];
- if(mface[numFaces].v4)
+ if(mface[numFaces].v4) {
mface[numFaces].v4 = vert_map[mface[numFaces].v4];
+
+ test_index_face(&mface[numFaces], &result->faceData,
+ numFaces, 4);
+ }
+ else
+ {
+ test_index_face(&mface[numFaces], &result->faceData,
+ numFaces, 3);
+ }
+
origindex[numFaces] = ORIGINDEX_NONE;
numFaces++;
@@ -1221,8 +1234,17 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
mface[numFaces].v1 = vert_map[mface[numFaces].v1];
mface[numFaces].v2 = vert_map[mface[numFaces].v2];
mface[numFaces].v3 = vert_map[mface[numFaces].v3];
- if(mface[numFaces].v4)
+ if(mface[numFaces].v4) {
mface[numFaces].v4 = vert_map[mface[numFaces].v4];
+
+ test_index_face(&mface[numFaces], &result->faceData,
+ numFaces, 4);
+ }
+ else
+ {
+ test_index_face(&mface[numFaces], &result->faceData,
+ numFaces, 3);
+ }
origindex[numFaces] = ORIGINDEX_NONE;
numFaces++;
@@ -2980,6 +3002,20 @@ CustomDataMask displaceModifier_requiredDataMask(ModifierData *md)
return dataMask;
}
+static int displaceModifier_dependsOnTime(ModifierData *md)
+{
+ DisplaceModifierData *dmd = (DisplaceModifierData *)md;
+
+ if(dmd->texture)
+ {
+ return BKE_texture_dependsOnTime(dmd->texture);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
static void displaceModifier_foreachObjectLink(ModifierData *md, Object *ob,
ObjectWalkFunc walk, void *userData)
{
@@ -5459,7 +5495,7 @@ static void collisionModifier_deformVerts(
numverts = dm->getNumVerts ( dm );
- if(current_time > collmd->time)
+ if((current_time > collmd->time)|| (BKE_ptcache_get_continue_physics()))
{
// check if mesh has changed
if(collmd->x && (numverts != collmd->numverts))
@@ -6086,22 +6122,6 @@ CustomDataMask explodeModifier_requiredDataMask(ModifierData *md)
return dataMask;
}
-/* this should really be put somewhere permanently */
-static float vert_weight(MDeformVert *dvert, int group)
-{
- MDeformWeight *dw;
- int i;
-
- if(dvert) {
- dw= dvert->dw;
- for(i= dvert->totweight; i>0; i--, dw++) {
- if(dw->def_nr == group) return dw->weight;
- if(i==1) break; /*otherwise dw will point to somewhere it shouldn't*/
- }
- }
- return 0.0;
-}
-
static void explodeModifier_createFacepa(ExplodeModifierData *emd,
ParticleSystemModifierData *psmd,
Object *ob, DerivedMesh *dm)
@@ -6145,7 +6165,7 @@ static void explodeModifier_createFacepa(ExplodeModifierData *emd,
for(i=0; i<totvert; i++){
val = BLI_frand();
val = (1.0f-emd->protect)*val + emd->protect*0.5f;
- if(val < vert_weight(dvert+i,emd->vgroup-1))
+ if(val < deformvert_get_weight(dvert+i,emd->vgroup-1))
vertpa[i] = -1;
}
}
@@ -7202,6 +7222,126 @@ static void meshdeformModifier_deformVertsEM(
dm->release(dm);
}
+
+/* Shrinkwrap */
+
+static void shrinkwrapModifier_initData(ModifierData *md)
+{
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
+ smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE;
+ smd->shrinkOpts = MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR;
+ smd->keepDist = 0.0f;
+
+ smd->target = NULL;
+ smd->auxTarget = NULL;
+}
+
+static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target)
+{
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)md;
+ ShrinkwrapModifierData *tsmd = (ShrinkwrapModifierData*)target;
+
+ tsmd->target = smd->target;
+ tsmd->auxTarget = smd->auxTarget;
+
+ strcpy(tsmd->vgroup_name, smd->vgroup_name);
+
+ tsmd->keepDist = smd->keepDist;
+ tsmd->shrinkType= smd->shrinkType;
+ tsmd->shrinkOpts= smd->shrinkOpts;
+}
+
+CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md)
+{
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
+ CustomDataMask dataMask = 0;
+
+ /* ask for vertexgroups if we need them */
+ if(smd->vgroup_name[0])
+ dataMask |= (1 << CD_MDEFORMVERT);
+
+ if(smd->shrinkType == MOD_SHRINKWRAP_PROJECT
+ && smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
+ dataMask |= (1 << CD_MVERT);
+
+ return dataMask;
+}
+
+static int shrinkwrapModifier_isDisabled(ModifierData *md)
+{
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
+ return !smd->target;
+}
+
+
+static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData)
+{
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
+
+ walk(userData, ob, &smd->target);
+ walk(userData, ob, &smd->auxTarget);
+}
+
+static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+{
+ DerivedMesh *dm = NULL;
+ CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md);
+
+ /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */
+ if(shrinkwrapModifier_requiredDataMask(md))
+ {
+ if(derivedData) dm = CDDM_copy(derivedData);
+ else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+ else return;
+
+ if(dataMask & CD_MVERT)
+ {
+ CDDM_apply_vert_coords(dm, vertexCos);
+ CDDM_calc_normals(dm);
+ }
+ }
+
+ shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts);
+
+ if(dm)
+ dm->release(dm);
+}
+
+static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+{
+ DerivedMesh *dm = NULL;
+ CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md);
+
+ if(dataMask)
+ {
+ if(derivedData) dm = CDDM_copy(derivedData);
+ else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob->data);
+ else return;
+
+ if(dataMask & CD_MVERT)
+ {
+ CDDM_apply_vert_coords(dm, vertexCos);
+ CDDM_calc_normals(dm);
+ }
+ }
+
+ shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, ob, dm, vertexCos, numVerts);
+
+ if(dm)
+ dm->release(dm);
+}
+
+static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *forest, Object *ob, DagNode *obNode)
+{
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
+
+ if (smd->target)
+ dag_add_relation(forest, dag_get_node(forest, smd->target), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier");
+
+ if (smd->auxTarget)
+ dag_add_relation(forest, dag_get_node(forest, smd->auxTarget), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier");
+}
+
/***/
static ModifierTypeInfo typeArr[NUM_MODIFIER_TYPES];
@@ -7335,6 +7475,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti->initData = displaceModifier_initData;
mti->copyData = displaceModifier_copyData;
mti->requiredDataMask = displaceModifier_requiredDataMask;
+ mti->dependsOnTime = displaceModifier_dependsOnTime;
mti->foreachObjectLink = displaceModifier_foreachObjectLink;
mti->foreachIDLink = displaceModifier_foreachIDLink;
mti->updateDepgraph = displaceModifier_updateDepgraph;
@@ -7522,6 +7663,21 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti->requiredDataMask = explodeModifier_requiredDataMask;
mti->applyModifier = explodeModifier_applyModifier;
+ mti = INIT_TYPE(Shrinkwrap);
+ mti->type = eModifierTypeType_OnlyDeform;
+ mti->flags = eModifierTypeFlag_AcceptsMesh
+ | eModifierTypeFlag_AcceptsCVs
+ | eModifierTypeFlag_SupportsEditmode
+ | eModifierTypeFlag_EnableInEditmode;
+ mti->initData = shrinkwrapModifier_initData;
+ mti->copyData = shrinkwrapModifier_copyData;
+ mti->requiredDataMask = shrinkwrapModifier_requiredDataMask;
+ mti->isDisabled = shrinkwrapModifier_isDisabled;
+ mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink;
+ mti->deformVerts = shrinkwrapModifier_deformVerts;
+ mti->deformVertsEM = shrinkwrapModifier_deformVertsEM;
+ mti->updateDepgraph = shrinkwrapModifier_updateDepgraph;
+
typeArrInit = 0;
#undef INIT_TYPE
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 4e36df35a14..4dfe651c01f 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -68,6 +68,9 @@
#include "SHD_node.h"
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+
static ListBase empty_list = {NULL, NULL};
ListBase node_all_composit = {NULL, NULL};
ListBase node_all_shaders = {NULL, NULL};
@@ -2352,6 +2355,117 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
ntreeEndExecTree(ntree);
}
+/* GPU material from shader nodes */
+
+static void gpu_from_node_stack(ListBase *sockets, bNodeStack **ns, GPUNodeStack *gs)
+{
+ bNodeSocket *sock;
+ int i;
+
+ for (sock=sockets->first, i=0; sock; sock=sock->next, i++) {
+ memset(&gs[i], 0, sizeof(gs[i]));
+
+ QUATCOPY(gs[i].vec, ns[i]->vec);
+ gs[i].link= ns[i]->data;
+
+ if (sock->type == SOCK_VALUE)
+ gs[i].type= GPU_FLOAT;
+ else if (sock->type == SOCK_VECTOR)
+ gs[i].type= GPU_VEC3;
+ else if (sock->type == SOCK_RGBA)
+ gs[i].type= GPU_VEC4;
+ else
+ gs[i].type= GPU_NONE;
+
+ gs[i].name = "";
+ gs[i].hasinput= ns[i]->hasinput;
+ gs[i].hasoutput= ns[i]->hasinput;
+ gs[i].sockettype= ns[i]->sockettype;
+ }
+
+ gs[i].type= GPU_NONE;
+}
+
+static void data_from_gpu_stack(ListBase *sockets, bNodeStack **ns, GPUNodeStack *gs)
+{
+ bNodeSocket *sock;
+ int i;
+
+ for (sock=sockets->first, i=0; sock; sock=sock->next, i++) {
+ ns[i]->data= gs[i].link;
+ ns[i]->hasinput= gs[i].hasinput;
+ ns[i]->hasoutput= gs[i].hasoutput;
+ ns[i]->sockettype= gs[i].sockettype;
+ }
+}
+
+static void gpu_node_group_execute(bNodeStack *stack, GPUMaterial *mat, bNode *gnode, bNodeStack **in, bNodeStack **out)
+{
+ bNode *node;
+ bNodeTree *ntree= (bNodeTree *)gnode->id;
+ bNodeStack *nsin[MAX_SOCKET]; /* arbitrary... watch this */
+ bNodeStack *nsout[MAX_SOCKET]; /* arbitrary... watch this */
+ GPUNodeStack gpuin[MAX_SOCKET+1], gpuout[MAX_SOCKET+1];
+ int doit = 0;
+
+ if(ntree==NULL) return;
+
+ stack+= gnode->stack_index;
+
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->typeinfo->gpufunc) {
+ group_node_get_stack(node, stack, nsin, nsout, in, out);
+
+ doit = 0;
+
+ /* for groups, only execute outputs for edited group */
+ if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+ if(gnode->flag & NODE_GROUP_EDIT)
+ if(node->flag & NODE_DO_OUTPUT)
+ doit = 1;
+ }
+ else
+ doit = 1;
+
+ if(doit) {
+ gpu_from_node_stack(&node->inputs, nsin, gpuin);
+ gpu_from_node_stack(&node->outputs, nsout, gpuout);
+ if(node->typeinfo->gpufunc(mat, node, gpuin, gpuout))
+ data_from_gpu_stack(&node->outputs, nsout, gpuout);
+ }
+ }
+ }
+}
+
+void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat)
+{
+ bNode *node;
+ bNodeStack *stack;
+ bNodeStack *nsin[MAX_SOCKET]; /* arbitrary... watch this */
+ bNodeStack *nsout[MAX_SOCKET]; /* arbitrary... watch this */
+ GPUNodeStack gpuin[MAX_SOCKET+1], gpuout[MAX_SOCKET+1];
+
+ if((ntree->init & NTREE_EXEC_INIT)==0)
+ ntreeBeginExecTree(ntree);
+
+ stack= ntree->stack;
+
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->typeinfo->gpufunc) {
+ node_get_stack(node, stack, nsin, nsout);
+ gpu_from_node_stack(&node->inputs, nsin, gpuin);
+ gpu_from_node_stack(&node->outputs, nsout, gpuout);
+ if(node->typeinfo->gpufunc(mat, node, gpuin, gpuout))
+ data_from_gpu_stack(&node->outputs, nsout, gpuout);
+ }
+ else if(node->type==NODE_GROUP && node->id) {
+ node_get_stack(node, stack, nsin, nsout);
+ gpu_node_group_execute(stack, mat, node, nsin, nsout);
+ }
+ }
+
+ ntreeEndExecTree(ntree);
+}
/* **************** call to switch lamploop for material node ************ */
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 7b36e46d45e..3ed169ff77d 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -112,6 +112,8 @@
#include "BPY_extern.h"
+#include "GPU_material.h"
+
#include "blendef.h"
/* Local function protos */
@@ -268,6 +270,7 @@ void free_object(Object *ob)
}
if(ob->soft) sbFree(ob->soft);
if(ob->fluidsimSettings) fluidsimSettingsFree(ob->fluidsimSettings);
+ if(ob->gpulamp.first) GPU_lamp_free(ob);
}
static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Object **obpoin)
@@ -694,9 +697,11 @@ float dof_camera(Object *ob)
if (cam->dof_ob) {
/* too simple, better to return the distance on the view axis only
* return VecLenf(ob->obmat[3], cam->dof_ob->obmat[3]); */
+ float mat[4][4], obmat[4][4];
- float mat[4][4];
- Mat4Invert(ob->imat, ob->obmat);
+ Mat4CpyMat4(obmat, ob->obmat);
+ Mat4Ortho(obmat);
+ Mat4Invert(ob->imat, obmat);
Mat4MulMat4(mat, cam->dof_ob->obmat, ob->imat);
return fabs(mat[3][2]);
}
@@ -918,7 +923,7 @@ Object *add_only_object(int type, char *name)
QuatOne(ob->dquat);
#endif
- ob->col[0]= ob->col[1]= ob->col[2]= 0.0;
+ ob->col[0]= ob->col[1]= ob->col[2]= 1.0;
ob->col[3]= 1.0;
ob->loc[0]= ob->loc[1]= ob->loc[2]= 0.0;
@@ -1226,6 +1231,7 @@ Object *copy_object(Object *ob)
obn->vnode = NULL;
#endif
+ obn->gpulamp.first = obn->gpulamp.last = NULL;
return obn;
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 24a3d348ae7..15d6f71073f 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -320,8 +320,14 @@ int psys_check_enabled(Object *ob, ParticleSystem *psys)
/************************************************/
void psys_free_settings(ParticleSettings *part)
{
- if(part->pd)
+ if(part->pd) {
MEM_freeN(part->pd);
+ part->pd = NULL;
+ }
+ if(part->pd2) {
+ MEM_freeN(part->pd2);
+ part->pd2 = NULL;
+ }
}
void free_hair(ParticleSystem *psys, int softbody)
@@ -373,8 +379,11 @@ void psys_free_children(ParticleSystem *psys)
}
/* free everything */
void psys_free(Object *ob, ParticleSystem * psys)
-{
+{
if(psys){
+ int nr = 0;
+ ParticleSystem * tpsys;
+
if(ob->particlesystem.first == NULL && G.f & G_PARTICLEEDIT)
G.f &= ~G_PARTICLEEDIT;
@@ -400,6 +409,21 @@ void psys_free(Object *ob, ParticleSystem * psys)
if(psys->effectors.first)
psys_end_effectors(psys);
+
+ // check if we are last non-visible particle system
+ for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next){
+ if(tpsys->part)
+ {
+ if(ELEM(tpsys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
+ {
+ nr++;
+ break;
+ }
+ }
+ }
+ // clear do-not-draw-flag
+ if(!nr)
+ ob->transflag &= ~OB_DUPLIPARTS;
if(psys->part){
psys->part->id.us--;
@@ -411,7 +435,7 @@ void psys_free(Object *ob, ParticleSystem * psys)
if(psys->pointcache)
BKE_ptcache_free(psys->pointcache);
-
+
MEM_freeN(psys);
}
}
@@ -3015,6 +3039,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part)
partn= copy_libblock(part);
if(partn->pd) partn->pd= MEM_dupallocN(part->pd);
+ if(partn->pd2) partn->pd2= MEM_dupallocN(part->pd2);
return partn;
}
@@ -3744,6 +3769,9 @@ int psys_get_particle_state(Object *ob, ParticleSystem *psys, int p, ParticleKey
/* TODO: pa_clump vgroup */
do_clump(state,key1,t,part->clumpfac,part->clumppow,1.0);
+
+ if(psys->lattice)
+ calc_latt_deform(state->co,1.0f);
}
else{
if (pa) { /* TODO PARTICLE - should this ever be NULL? - Campbell */
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 7dca87d5c13..71dd2f64c72 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -60,6 +60,7 @@
#include "BKE_bad_level_calls.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_displist.h"
+#include "BKE_effect.h"
#include "BKE_particle.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
@@ -75,6 +76,8 @@
#include "BKE_modifier.h"
#include "BKE_scene.h"
+#include "PIL_time.h"
+
#include "BSE_headerbuttons.h"
#include "blendef.h"
@@ -2208,174 +2211,6 @@ static int get_particles_from_cache(Object *ob, ParticleSystem *psys, int cfra)
/************************************************/
/* Effectors */
/************************************************/
-static float falloff_func(float fac, int usemin, float mindist, int usemax, float maxdist, float power)
-{
- if(!usemin)
- mindist= 0.0f;
-
- if(fac < mindist) {
- return 1.0f;
- }
- else if(usemax) {
- if(fac>maxdist || (maxdist-mindist)<=0.0f)
- return 0.0f;
-
- fac= (fac-mindist)/(maxdist-mindist);
- return 1.0f - (float)pow((double)fac, (double)power);
- }
- else
- return pow((double)1.0f+fac-mindist, (double)-power);
-}
-
-static float falloff_func_dist(PartDeflect *pd, float fac)
-{
- return falloff_func(fac, pd->flag&PFIELD_USEMIN, pd->mindist, pd->flag&PFIELD_USEMAX, pd->maxdist, pd->f_power);
-}
-
-static float falloff_func_rad(PartDeflect *pd, float fac)
-{
- return falloff_func(fac, pd->flag&PFIELD_USEMINR, pd->minrad, pd->flag&PFIELD_USEMAXR, pd->maxrad, pd->f_power_r);
-}
-
-static float effector_falloff(PartDeflect *pd, float *eff_velocity, float *vec_to_part)
-{
- float eff_dir[3], temp[3];
- float falloff=1.0, fac, r_fac;
-
- VecCopyf(eff_dir,eff_velocity);
- Normalize(eff_dir);
-
- if(pd->flag & PFIELD_POSZ && Inpf(eff_dir,vec_to_part)<0.0f)
- falloff=0.0f;
- else switch(pd->falloff){
- case PFIELD_FALL_SPHERE:
- fac=VecLength(vec_to_part);
- falloff= falloff_func_dist(pd, fac);
- break;
-
- case PFIELD_FALL_TUBE:
- fac=Inpf(vec_to_part,eff_dir);
- falloff= falloff_func_dist(pd, ABS(fac));
- if(falloff == 0.0f)
- break;
-
- VECADDFAC(temp,vec_to_part,eff_dir,-fac);
- r_fac=VecLength(temp);
- falloff*= falloff_func_rad(pd, r_fac);
- break;
- case PFIELD_FALL_CONE:
- fac=Inpf(vec_to_part,eff_dir);
- falloff= falloff_func_dist(pd, ABS(fac));
- if(falloff == 0.0f)
- break;
-
- r_fac=saacos(fac/VecLength(vec_to_part))*180.0f/(float)M_PI;
- falloff*= falloff_func_rad(pd, r_fac);
-
- break;
-// case PFIELD_FALL_INSIDE:
- //for(i=0; i<totface; i++,mface++){
- // VECCOPY(v1,mvert[mface->v1].co);
- // VECCOPY(v2,mvert[mface->v2].co);
- // VECCOPY(v3,mvert[mface->v3].co);
-
- // if(AxialLineIntersectsTriangle(a,co1, co2, v2, v3, v1, &lambda)){
- // if(from==PART_FROM_FACE)
- // (pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
- // else /* store number of intersections */
- // (pa+(int)(lambda*size[a])*a0mul)->loop++;
- // }
- //
- // if(mface->v4){
- // VECCOPY(v4,mvert[mface->v4].co);
-
- // if(AxialLineIntersectsTriangle(a,co1, co2, v4, v1, v3, &lambda)){
- // if(from==PART_FROM_FACE)
- // (pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
- // else
- // (pa+(int)(lambda*size[a])*a0mul)->loop++;
- // }
- // }
- //}
-
-// break;
- }
-
- return falloff;
-}
-static void do_physical_effector(short type, float force_val, float distance, float falloff, float size, float damp,
- float *eff_velocity, float *vec_to_part, float *velocity, float *field, int planar)
-{
- float mag_vec[3]={0,0,0};
- float temp[3], temp2[3];
- float eff_vel[3];
-
- VecCopyf(eff_vel,eff_velocity);
- Normalize(eff_vel);
-
- switch(type){
- case PFIELD_WIND:
- VECCOPY(mag_vec,eff_vel);
-
- VecMulf(mag_vec,force_val*falloff);
- VecAddf(field,field,mag_vec);
- break;
-
- case PFIELD_FORCE:
- if(planar)
- Projf(mag_vec,vec_to_part,eff_vel);
- else
- VecCopyf(mag_vec,vec_to_part);
-
- VecMulf(mag_vec,force_val*falloff);
- VecAddf(field,field,mag_vec);
- break;
-
- case PFIELD_VORTEX:
- Crossf(mag_vec,eff_vel,vec_to_part);
- Normalize(mag_vec);
-
- VecMulf(mag_vec,force_val*distance*falloff);
- VecAddf(field,field,mag_vec);
-
- break;
- case PFIELD_MAGNET:
- if(planar)
- VecCopyf(temp,eff_vel);
- else
- /* magnetic field of a moving charge */
- Crossf(temp,eff_vel,vec_to_part);
-
- Crossf(temp2,velocity,temp);
- VecAddf(mag_vec,mag_vec,temp2);
-
- VecMulf(mag_vec,force_val*falloff);
- VecAddf(field,field,mag_vec);
- break;
- case PFIELD_HARMONIC:
- if(planar)
- Projf(mag_vec,vec_to_part,eff_vel);
- else
- VecCopyf(mag_vec,vec_to_part);
-
- VecMulf(mag_vec,force_val*falloff);
- VecSubf(field,field,mag_vec);
-
- VecCopyf(mag_vec,velocity);
- /* 1.9 is an experimental value to get critical damping at damp=1.0 */
- VecMulf(mag_vec,damp*1.9f*(float)sqrt(force_val));
- VecSubf(field,field,mag_vec);
- break;
- case PFIELD_NUCLEAR:
- /*pow here is root of cosine expression below*/
- //rad=(float)pow(2.0,-1.0/power)*distance/size;
- //VECCOPY(mag_vec,vec_to_part);
- //Normalize(mag_vec);
- //VecMulf(mag_vec,(float)cos(3.0*M_PI/2.0*(1.0-1.0/(pow(rad,power)+1.0)))/(rad+0.2f));
- //VECADDFAC(field,field,mag_vec,force_val);
- break;
- }
-}
static void do_texture_effector(Tex *tex, short mode, short is_2d, float nabla, short object, float *pa_co, float obmat[4][4], float force_val, float falloff, float *field)
{
TexResult result[4];
@@ -2468,7 +2303,15 @@ static void add_to_effectors(ListBase *lb, Object *ob, Object *obsrc, ParticleSy
}
}
else if(pd->forcefield)
+ {
type |= PSYS_EC_EFFECTOR;
+
+ if(pd->forcefield == PFIELD_WIND)
+ {
+ pd->rng = rng_new(1);
+ rng_srandom(pd->rng, (unsigned int)(ceil(PIL_check_seconds_timer()))); // use better seed
+ }
+ }
}
if(pd && pd->deflect)
@@ -2493,10 +2336,11 @@ static void add_to_effectors(ListBase *lb, Object *ob, Object *obsrc, ParticleSy
for(i=0; epsys; epsys=epsys->next,i++){
type=0;
- if(epsys!=psys){
+ if(epsys!=psys || (psys->part->flag & PART_SELF_EFFECT)){
epart=epsys->part;
- if(epsys->part->pd && epsys->part->pd->forcefield)
+ if((epsys->part->pd && epsys->part->pd->forcefield)
+ || (epsys->part->pd2 && epsys->part->pd2->forcefield))
type=PSYS_EC_PARTICLE;
if(epart->type==PART_REACTOR) {
@@ -2579,6 +2423,9 @@ void psys_end_effectors(ParticleSystem *psys)
if(ec->tree)
BLI_kdtree_free(ec->tree);
+
+ if(ec->ob->pd && (ec->ob->pd->forcefield == PFIELD_WIND))
+ rng_free(ec->ob->pd->rng);
}
BLI_freelistN(lb);
@@ -2745,35 +2592,31 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P
ListBase *lb=&psys->effectors;
ParticleEffectorCache *ec;
float distance, vec_to_part[3];
- float falloff;
+ float falloff, charge = 0.0f;
int p;
/* check all effector objects for interaction */
if(lb->first){
+ if(psys->part->pd && psys->part->pd->forcefield==PFIELD_CHARGE){
+ /* Only the charge of the effected particle is used for
+ interaction, not fall-offs. If the fall-offs aren't the
+ same this will be unphysical, but for animation this
+ could be the wanted behavior. If you want physical
+ correctness the fall-off should be spherical 2.0 anyways.
+ */
+ charge = psys->part->pd->f_strength;
+ }
+ if(psys->part->pd2 && psys->part->pd2->forcefield==PFIELD_CHARGE){
+ charge += psys->part->pd2->f_strength;
+ }
for(ec = lb->first; ec; ec= ec->next){
eob= ec->ob;
if(ec->type & PSYS_EC_EFFECTOR){
pd=eob->pd;
if(psys->part->type!=PART_HAIR && psys->part->integrator)
where_is_object_time(eob,cfra);
- /* Get IPO force strength and fall off values here */
- //if (has_ipo_code(eob->ipo, OB_PD_FSTR))
- // force_val = IPO_GetFloatValue(eob->ipo, OB_PD_FSTR, cfra);
- //else
- // force_val = pd->f_strength;
-
- //if (has_ipo_code(eob->ipo, OB_PD_FFALL))
- // ffall_val = IPO_GetFloatValue(eob->ipo, OB_PD_FFALL, cfra);
- //else
- // ffall_val = pd->f_power;
-
- //if (has_ipo_code(eob->ipo, OB_PD_FMAXD))
- // maxdist = IPO_GetFloatValue(eob->ipo, OB_PD_FMAXD, cfra);
- //else
- // maxdist = pd->maxdist;
/* use center of object for distance calculus */
- //obloc= eob->obmat[3];
VecSubf(vec_to_part, state->co, eob->obmat[3]);
distance = VecLength(vec_to_part);
@@ -2786,22 +2629,22 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P
pd->flag & PFIELD_TEX_OBJECT, (pd->flag & PFIELD_TEX_ROOTCO) ? rootco : state->co, eob->obmat,
pd->f_strength, falloff, force_field);
} else {
- do_physical_effector(pd->forcefield,pd->f_strength,distance,
- falloff,pd->f_dist,pd->f_damp,eob->obmat[2],vec_to_part,
- pa->state.vel,force_field,pd->flag&PFIELD_PLANAR);
+ do_physical_effector(eob, state->co, pd->forcefield,pd->f_strength,distance,
+ falloff,0.0,pd->f_damp,eob->obmat[2],vec_to_part,
+ pa->state.vel,force_field,pd->flag&PFIELD_PLANAR,pd->rng,pd->f_noise,charge,pa->size);
}
}
if(ec->type & PSYS_EC_PARTICLE){
- int totepart;
+ int totepart, i;
epsys= BLI_findlink(&eob->particlesystem,ec->psys_nbr);
epart= epsys->part;
- pd= epart->pd;
+ pd=epart->pd;
totepart= epsys->totpart;
if(totepart <= 0)
continue;
- if(pd->forcefield==PFIELD_HARMONIC){
+ if(pd && pd->forcefield==PFIELD_HARMONIC){
/* every particle is mapped to only one harmonic effector particle */
p= pa_no%epsys->totpart;
totepart= p+1;
@@ -2813,31 +2656,27 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P
epsys->lattice=psys_get_lattice(ob,psys);
for(; p<totepart; p++){
+ /* particle skips itself as effector */
+ if(epsys==psys && p == pa_no) continue;
+
epa = epsys->particles + p;
estate.time=-1.0;
if(psys_get_particle_state(eob,epsys,p,&estate,0)){
VECSUB(vec_to_part, state->co, estate.co);
distance = VecLength(vec_to_part);
-
- //if(pd->forcefield==PFIELD_HARMONIC){
- // //if(cfra < epa->time + radius){ /* radius is fade-in in ui */
- // // eforce*=(cfra-epa->time)/radius;
- // //}
- //}
- //else{
- // /* Limit minimum distance to effector particle so that */
- // /* the force is not too big */
- // if (distance < 0.001) distance = 0.001f;
- //}
- falloff=effector_falloff(pd,estate.vel,vec_to_part);
+ for(i=0, pd = epart->pd; i<2; i++,pd = epart->pd2) {
+ if(pd==NULL || pd->forcefield==0) continue;
- if(falloff<=0.0f)
- ; /* don't do anything */
- else
- do_physical_effector(pd->forcefield,pd->f_strength,distance,
- falloff,epart->size,pd->f_damp,estate.vel,vec_to_part,
- state->vel,force_field,0);
+ falloff=effector_falloff(pd,estate.vel,vec_to_part);
+
+ if(falloff<=0.0f)
+ ; /* don't do anything */
+ else
+ do_physical_effector(eob, state->co, pd->forcefield,pd->f_strength,distance,
+ falloff,epart->size,pd->f_damp,estate.vel,vec_to_part,
+ state->vel,force_field,0, pd->rng, pd->f_noise,charge,pa->size);
+ }
}
else if(pd->forcefield==PFIELD_HARMONIC && cfra-framestep <= epa->dietime && cfra>epa->dietime){
/* first step after key release */
@@ -3948,27 +3787,44 @@ static void boid_body(BoidVecFunc *bvf, ParticleData *pa, ParticleSystem *psys,
bvf->Addf(dvec,dvec,bvec);
bvf->Addf(state->co,state->co,dvec);
- /* air speed from wind effectors */
- if(psys->effectors.first){
+ /* air speed from wind and vortex effectors */
+ if(psys->effectors.first) {
ParticleEffectorCache *ec;
- for(ec=psys->effectors.first; ec; ec=ec->next){
- if(ec->type & PSYS_EC_EFFECTOR){
+ for(ec=psys->effectors.first; ec; ec=ec->next) {
+ if(ec->type & PSYS_EC_EFFECTOR) {
Object *eob = ec->ob;
PartDeflect *pd = eob->pd;
+ float direction[3], vec_to_part[3];
+ float falloff;
+
+ if(pd->f_strength != 0.0f) {
+ VecCopyf(direction, eob->obmat[2]);
+ VecSubf(vec_to_part, state->co, eob->obmat[3]);
+
+ falloff=effector_falloff(pd, direction, vec_to_part);
+
+ switch(pd->forcefield) {
+ case PFIELD_WIND:
+ if(falloff <= 0.0f)
+ ; /* don't do anything */
+ else {
+ Normalize(direction);
+ VecMulf(direction, pd->f_strength * falloff);
+ bvf->Addf(state->co, state->co, direction);
+ }
+ break;
+ case PFIELD_VORTEX:
+ {
+ float distance, mag_vec[3];
+ Crossf(mag_vec, direction, vec_to_part);
+ Normalize(mag_vec);
- if(pd->forcefield==PFIELD_WIND && pd->f_strength!=0.0){
- float distance, wind[3];
- VecCopyf(wind,eob->obmat[2]);
- distance=VecLenf(state->co,eob->obmat[3]);
-
- if (distance < 0.001) distance = 0.001f;
+ distance = VecLength(vec_to_part);
- if(pd->flag&PFIELD_USEMAX && distance > pd->maxdist)
- ;
- else{
- Normalize(wind);
- VecMulf(wind,pd->f_strength/(float)pow((double)distance,(double)pd->f_power));
- bvf->Addf(state->co,state->co,wind);
+ VecMulf(mag_vec, pd->f_strength * distance * falloff);
+ bvf->Addf(state->co, state->co, mag_vec);
+ break;
+ }
}
}
}
@@ -4019,7 +3875,7 @@ static void boid_body(BoidVecFunc *bvf, ParticleData *pa, ParticleSystem *psys,
state->vel[2]=0.0;
state->co[2]=part->groundz;
- if(psys->keyed_ob){
+ if(psys->keyed_ob && (psys->keyed_ob->type == OB_MESH)){
Object *zob=psys->keyed_ob;
int min_face;
float co1[3],co2[3],min_d=2.0,min_w[4],imat[4][4];
@@ -4653,7 +4509,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
PTCacheID pid;
int totpart, oldtotpart, totchild, oldtotchild, p;
float disp, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0;
- int init= 0, distr= 0, alloc= 0, usecache= 0;
+ int init= 0, distr= 0, alloc= 0, usecache= 0, only_children_changed= 0;
int framenr, framedelta, startframe, endframe;
part= psys->part;
@@ -4720,6 +4576,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
totchild = get_psys_tot_child(psys);
if(oldtotpart != totpart || (psys->part->childtype && oldtotchild != totchild)) {
+ only_children_changed = (oldtotpart == totpart);
realloc_particles(ob, psys, totpart);
alloc = 1;
distr= 1;
@@ -4740,14 +4597,17 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
if((psys->part->type == PART_HAIR) && !(psys->flag & PSYS_HAIR_DONE))
/* don't generate children while growing hair - waste of time */
- psys_free_children(psys);
- else if(get_psys_tot_child(psys))
- distribute_particles(ob, psys, PART_FROM_CHILD);
+ psys_free_children(psys);
+ else if(get_psys_tot_child(psys))
+ distribute_particles(ob, psys, PART_FROM_CHILD);
}
- initialize_all_particles(ob, psys, psmd);
- if(alloc)
- reset_all_particles(ob, psys, psmd, 0.0, cfra, oldtotpart);
+ if(only_children_changed==0) {
+ initialize_all_particles(ob, psys, psmd);
+
+ if(alloc)
+ reset_all_particles(ob, psys, psmd, 0.0, cfra, oldtotpart);
+ }
/* flag for possible explode modifiers after this system */
psmd->flag |= eParticleSystemFlag_Pars;
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index fcf1c7ce311..47d11bb9d29 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -153,6 +153,9 @@ void init_sensor(bSensor *sens)
case SENS_ACTUATOR:
sens->data= MEM_callocN(sizeof(bActuatorSensor), "actsens");
break;
+ case SENS_DELAY:
+ sens->data= MEM_callocN(sizeof(bDelaySensor), "delaysens");
+ break;
case SENS_MOUSE:
ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens");
ms->type= LEFTMOUSE;
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 089a80a9fea..afdcdff8742 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -304,7 +304,7 @@ void set_scene_bg(Scene *sce)
int flag;
// Note: this here is defined in editseq.c (BIF_editseq.h), NOT in blenkernel!
- set_last_seq(NULL);
+ clear_last_seq();
G.scene= sce;
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
new file mode 100644
index 00000000000..c60535cade2
--- /dev/null
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -0,0 +1,588 @@
+/**
+ * shrinkwrap.c
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): André Pinto
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#include <string.h>
+#include <float.h>
+#include <math.h>
+#include <memory.h>
+#include <stdio.h>
+#include <time.h>
+#include <assert.h>
+
+#include "DNA_object_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_mesh_types.h"
+
+#include "BKE_shrinkwrap.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_utildefines.h"
+#include "BKE_deform.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_displist.h"
+#include "BKE_global.h"
+#include "BKE_subsurf.h"
+
+#include "BLI_arithb.h"
+#include "BLI_kdtree.h"
+#include "BLI_kdopbvh.h"
+
+#include "RE_raytrace.h"
+#include "MEM_guardedalloc.h"
+
+
+/* Util macros */
+#define TO_STR(a) #a
+#define JOIN(a,b) a##b
+
+#define OUT_OF_MEMORY() ((void)printf("Shrinkwrap: Out of memory\n"))
+
+/* Benchmark macros */
+#if !defined(_WIN32) && 0
+
+#include <sys/time.h>
+
+#define BENCH(a) \
+ do { \
+ double _t1, _t2; \
+ struct timeval _tstart, _tend; \
+ clock_t _clock_init = clock(); \
+ gettimeofday ( &_tstart, NULL); \
+ (a); \
+ gettimeofday ( &_tend, NULL); \
+ _t1 = ( double ) _tstart.tv_sec + ( double ) _tstart.tv_usec/ ( 1000*1000 ); \
+ _t2 = ( double ) _tend.tv_sec + ( double ) _tend.tv_usec/ ( 1000*1000 ); \
+ printf("%s: %fs (real) %fs (cpu)\n", #a, _t2-_t1, (float)(clock()-_clock_init)/CLOCKS_PER_SEC);\
+ } while(0)
+
+#else
+
+#define BENCH(a) (a)
+
+#endif
+
+typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *co, float *normal);
+
+/* get derived mesh */
+//TODO is anyfunction that does this? returning the derivedFinal witouth we caring if its in edit mode or not?
+DerivedMesh *object_get_derived_final(Object *ob, CustomDataMask dataMask)
+{
+ if (ob==G.obedit)
+ {
+ DerivedMesh *final = NULL;
+ editmesh_get_derived_cage_and_final(&final, dataMask);
+ return final;
+ }
+ else
+ return mesh_get_derived_final(ob, dataMask);
+}
+
+/* Space transform */
+void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float target[4][4])
+{
+ float itarget[4][4];
+ Mat4Invert(itarget, target);
+ Mat4MulSerie(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0);
+ Mat4Invert(data->target2local, data->local2target);
+}
+
+void space_transform_apply(const SpaceTransform *data, float *co)
+{
+ VecMat4MulVecfl(co, ((SpaceTransform*)data)->local2target, co);
+}
+
+void space_transform_invert(const SpaceTransform *data, float *co)
+{
+ VecMat4MulVecfl(co, ((SpaceTransform*)data)->target2local, co);
+}
+
+void space_transform_apply_normal(const SpaceTransform *data, float *no)
+{
+ Mat4Mul3Vecfl( ((SpaceTransform*)data)->local2target, no);
+ Normalize(no); // TODO: could we just determine de scale value from the matrix?
+}
+
+void space_transform_invert_normal(const SpaceTransform *data, float *no)
+{
+ Mat4Mul3Vecfl(((SpaceTransform*)data)->target2local, no);
+ Normalize(no); // TODO: could we just determine de scale value from the matrix?
+}
+
+/*
+ * Returns the squared distance between two given points
+ */
+static float squared_dist(const float *a, const float *b)
+{
+ float tmp[3];
+ VECSUB(tmp, a, b);
+ return INPR(tmp, tmp);
+}
+
+/* Main shrinkwrap function */
+void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts)
+{
+
+ ShrinkwrapCalcData calc = NULL_ShrinkwrapCalcData;
+
+ //remove loop dependencies on derived meshs (TODO should this be done elsewhere?)
+ if(smd->target == ob) smd->target = NULL;
+ if(smd->auxTarget == ob) smd->auxTarget = NULL;
+
+
+ //Configure Shrinkwrap calc data
+ calc.smd = smd;
+ calc.ob = ob;
+ calc.original = dm;
+ calc.numVerts = numVerts;
+ calc.vertexCos = vertexCos;
+
+ if(smd->target)
+ {
+ //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array
+ calc.target = CDDM_copy( object_get_derived_final(smd->target, CD_MASK_BAREMESH) );
+
+ //TODO there might be several "bugs" on non-uniform scales matrixs.. because it will no longer be nearest surface, not sphere projection
+ //because space has been deformed
+ space_transform_setup(&calc.local2target, ob, smd->target);
+
+ calc.keepDist = smd->keepDist; //TODO: smd->keepDist is in global units.. must change to local
+ }
+
+
+ //Projecting target defined - lets work!
+ if(calc.target)
+ {
+ switch(smd->shrinkType)
+ {
+ case MOD_SHRINKWRAP_NEAREST_SURFACE:
+ BENCH(shrinkwrap_calc_nearest_surface_point(&calc));
+ break;
+
+ case MOD_SHRINKWRAP_PROJECT:
+ BENCH(shrinkwrap_calc_normal_projection(&calc));
+ break;
+
+ case MOD_SHRINKWRAP_NEAREST_VERTEX:
+ BENCH(shrinkwrap_calc_nearest_vertex(&calc));
+ break;
+ }
+ }
+
+ //free memory
+ if(calc.target)
+ calc.target->release( calc.target );
+}
+
+/*
+ * Shrinkwrap to the nearest vertex
+ *
+ * it builds a kdtree of vertexs we can attach to and then
+ * for each vertex performs a nearest vertex search on the tree
+ */
+void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
+{
+ int i;
+ const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name);
+ MDeformVert *const dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL;
+
+ BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;
+ BVHTreeNearest nearest = NULL_BVHTreeNearest;
+
+
+ BENCH(bvhtree_from_mesh_verts(&treeData, calc->target, 0.0, 2, 6));
+ if(treeData.tree == NULL) return OUT_OF_MEMORY();
+
+ //Setup nearest
+ nearest.index = -1;
+ nearest.dist = FLT_MAX;
+
+#pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(treeData,calc) schedule(static)
+ for(i = 0; i<calc->numVerts; ++i)
+ {
+ float *co = calc->vertexCos[i];
+ float tmp_co[3];
+ float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup);
+ if(weight == 0.0f) continue;
+
+ VECCOPY(tmp_co, co);
+ space_transform_apply(&calc->local2target, tmp_co); //Convert the coordinates to the tree coordinates
+
+ //Use local proximity heuristics (to reduce the nearest search)
+ //
+ //If we already had an hit before.. we assume this vertex is going to have a close hit to that other vertex
+ //so we can initiate the "nearest.dist" with the expected value to that last hit.
+ //This will lead in prunning of the search tree.
+ if(nearest.index != -1)
+ nearest.dist = squared_dist(tmp_co, nearest.co);
+ else
+ nearest.dist = FLT_MAX;
+
+ BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData);
+
+
+ //Found the nearest vertex
+ if(nearest.index != -1)
+ {
+ //Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
+ float dist = sasqrt(nearest.dist);
+ if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist;
+
+ //Convert the coordinates back to mesh coordinates
+ VECCOPY(tmp_co, nearest.co);
+ space_transform_invert(&calc->local2target, tmp_co);
+
+ VecLerpf(co, co, tmp_co, weight); //linear interpolation
+ }
+ }
+
+ free_bvhtree_from_mesh(&treeData);
+}
+
+/*
+ * This function raycast a single vertex and updates the hit if the "hit" is considered valid.
+ * Returns TRUE if "hit" was updated.
+ * Opts control whether an hit is valid or not
+ * Supported options are:
+ * MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored)
+ * MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored)
+ */
+int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
+{
+ float tmp_co[3], tmp_no[3];
+ const float *co, *no;
+ BVHTreeRayHit hit_tmp;
+
+ //Copy from hit (we need to convert hit rays from one space coordinates to the other
+ memcpy( &hit_tmp, hit, sizeof(hit_tmp) );
+
+ //Apply space transform (TODO readjust dist)
+ if(transf)
+ {
+ VECCOPY( tmp_co, vert );
+ space_transform_apply( transf, tmp_co );
+ co = tmp_co;
+
+ VECCOPY( tmp_no, dir );
+ space_transform_apply_normal( transf, tmp_no );
+ no = tmp_no;
+
+ hit_tmp.dist *= Mat4ToScalef( ((SpaceTransform*)transf)->local2target );
+ }
+ else
+ {
+ co = vert;
+ no = dir;
+ }
+
+ hit_tmp.index = -1;
+
+ BLI_bvhtree_ray_cast(tree, co, no, &hit_tmp, callback, userdata);
+
+ if(hit_tmp.index != -1)
+ {
+ float dot = INPR( dir, hit_tmp.no);
+
+ if(((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot <= 0.0f)
+ || ((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot >= 0.0f))
+ return FALSE; //Ignore hit
+
+
+ //Inverting space transform (TODO make coeherent with the initial dist readjust)
+ if(transf)
+ {
+ space_transform_invert( transf, hit_tmp.co );
+ space_transform_invert_normal( transf, hit_tmp.no );
+
+ hit_tmp.dist = VecLenf( (float*)vert, hit_tmp.co );
+ }
+
+ memcpy(hit, &hit_tmp, sizeof(hit_tmp) );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
+{
+ int i;
+
+ //Options about projection direction
+ const char use_normal = calc->smd->shrinkOpts;
+ float proj_axis[3] = {0.0f, 0.0f, 0.0f};
+ MVert *vert = NULL; //Needed in case of vertex normal
+ DerivedMesh* ss_mesh = NULL;
+
+ //Vertex group data
+ const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name);
+ const MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL;
+
+
+ //Raycast and tree stuff
+ BVHTreeRayHit hit;
+ BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh; //target
+
+ //auxiliar target
+ DerivedMesh * aux_mesh = NULL;
+ BVHTreeFromMesh auxData= NULL_BVHTreeFromMesh;
+ SpaceTransform local2aux;
+
+do
+{
+
+ //Prepare data to retrieve the direction in which we should project each vertex
+ if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
+ {
+ //No Mvert information: jump to "free memory and return" part
+ if(calc->original == NULL) break;
+
+ if(calc->smd->subsurfLevels)
+ {
+ SubsurfModifierData smd;
+ memset(&smd, 0, sizeof(smd));
+ smd.subdivType = ME_CC_SUBSURF; //catmull clark
+ smd.levels = calc->smd->subsurfLevels; //levels
+
+ ss_mesh = subsurf_make_derived_from_derived(calc->original, &smd, FALSE, NULL, 0, 0);
+
+ if(ss_mesh)
+ {
+ vert = ss_mesh->getVertDataArray(ss_mesh, CD_MVERT);
+ if(vert)
+ {
+ //TRICKY: this code assumes subsurface will have the transformed original vertices
+ //in their original order at the end of the vert array.
+ vert = vert
+ + ss_mesh->getNumVerts(ss_mesh)
+ - calc->original->getNumVerts(calc->original);
+ }
+ }
+
+ //To make sure we are not letting any memory behind
+ assert(smd.emCache == NULL);
+ assert(smd.mCache == NULL);
+ }
+ else
+ vert = calc->original->getVertDataArray(calc->original, CD_MVERT);
+
+ //Not able to get vert information: jump to "free memory and return" part
+ if(vert == NULL) break;
+ }
+ else
+ {
+ //The code supports any axis that is a combination of X,Y,Z.. altought currently UI only allows to set the 3 diferent axis
+ if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) proj_axis[0] = 1.0f;
+ if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) proj_axis[1] = 1.0f;
+ if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f;
+
+ Normalize(proj_axis);
+
+ //Invalid projection direction: jump to "free memory and return" part
+ if(INPR(proj_axis, proj_axis) < FLT_EPSILON) break;
+ }
+
+ //If the user doesn't allows to project in any direction of projection axis... then theres nothing todo.
+ if((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0)
+ break; //jump to "free memory and return" part
+
+
+ //Build target tree
+ BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keepDist, 4, 6));
+ if(treeData.tree == NULL)
+ break; //jump to "free memory and return" part
+
+
+ //Build auxiliar target
+ if(calc->smd->auxTarget)
+ {
+ space_transform_setup( &local2aux, calc->ob, calc->smd->auxTarget);
+
+ aux_mesh = CDDM_copy( object_get_derived_final(calc->smd->auxTarget, CD_MASK_BAREMESH) ); //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array
+ if(aux_mesh)
+ BENCH(bvhtree_from_mesh_faces(&auxData, aux_mesh, 0.0, 4, 6));
+ else
+ printf("Auxiliar target finalDerived mesh is null\n");
+ }
+
+
+ //Now, everything is ready to project the vertexs!
+#pragma omp parallel for private(i,hit) schedule(static)
+ for(i = 0; i<calc->numVerts; ++i)
+ {
+ float *co = calc->vertexCos[i];
+ float tmp_co[3], tmp_no[3];
+ float lim = 10000.0f; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that
+ float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup);
+
+ if(weight == 0.0f) continue;
+
+ if(ss_mesh)
+ {
+ VECCOPY(tmp_co, vert[i].co);
+ }
+ else
+ {
+ VECCOPY(tmp_co, co);
+ }
+
+
+ if(vert)
+ NormalShortToFloat(tmp_no, vert[i].no);
+ else
+ VECCOPY( tmp_no, proj_axis );
+
+
+ hit.index = -1;
+ hit.dist = lim;
+
+
+ //Project over positive direction of axis
+ if(use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR)
+ {
+
+ if(auxData.tree)
+ normal_projection_project_vertex(0, tmp_co, tmp_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData);
+
+ normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData);
+ }
+
+ //Project over negative direction of axis
+ if(use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)
+ {
+ float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] };
+
+
+ if(auxData.tree)
+ normal_projection_project_vertex(0, tmp_co, inv_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData);
+
+ normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData);
+ }
+
+
+ if(hit.index != -1)
+ {
+ VecLerpf(co, co, hit.co, weight);
+ }
+ }
+
+
+//Simple do{} while(0) structure to allow to easily jump to the "free memory and return" part
+} while(0);
+
+ //free data structures
+
+ free_bvhtree_from_mesh(&treeData);
+ free_bvhtree_from_mesh(&auxData);
+
+ if(aux_mesh)
+ aux_mesh->release(aux_mesh);
+
+ if(ss_mesh)
+ ss_mesh->release(ss_mesh);
+}
+
+/*
+ * Shrinkwrap moving vertexs to the nearest surface point on the target
+ *
+ * it builds a BVHTree from the target mesh and then performs a
+ * NN matchs for each vertex
+ */
+void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
+{
+ int i;
+
+ const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name);
+ const MDeformVert *const dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL;
+
+ BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;
+ BVHTreeNearest nearest = NULL_BVHTreeNearest;
+
+
+
+ //Create a bvh-tree of the given target
+ BENCH(bvhtree_from_mesh_faces( &treeData, calc->target, 0.0, 2, 6));
+ if(treeData.tree == NULL) return OUT_OF_MEMORY();
+
+ //Setup nearest
+ nearest.index = -1;
+ nearest.dist = FLT_MAX;
+
+
+ //Find the nearest vertex
+#pragma omp parallel for default(none) private(i) firstprivate(nearest) shared(calc,treeData) schedule(static)
+ for(i = 0; i<calc->numVerts; ++i)
+ {
+ float *co = calc->vertexCos[i];
+ float tmp_co[3];
+ float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup);
+ if(weight == 0.0f) continue;
+
+ //Convert the vertex to tree coordinates
+ VECCOPY(tmp_co, co);
+ space_transform_apply(&calc->local2target, tmp_co);
+
+ //Use local proximity heuristics (to reduce the nearest search)
+ //
+ //If we already had an hit before.. we assume this vertex is going to have a close hit to that other vertex
+ //so we can initiate the "nearest.dist" with the expected value to that last hit.
+ //This will lead in prunning of the search tree.
+ if(nearest.index != -1)
+ nearest.dist = squared_dist(tmp_co, nearest.co);
+ else
+ nearest.dist = FLT_MAX;
+
+ BLI_bvhtree_find_nearest(treeData.tree, tmp_co, &nearest, treeData.nearest_callback, &treeData);
+
+ //Found the nearest vertex
+ if(nearest.index != -1)
+ {
+ if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE)
+ {
+ //Make the vertex stay on the front side of the face
+ VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keepDist);
+ }
+ else
+ {
+ //Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
+ float dist = sasqrt( nearest.dist );
+ if(dist > FLT_EPSILON)
+ VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
+ else
+ VECCOPY( tmp_co, nearest.co );
+ }
+
+ //Convert the coordinates back to mesh coordinates
+ space_transform_invert(&calc->local2target, tmp_co);
+ VecLerpf(co, co, tmp_co, weight); //linear interpolation
+ }
+ }
+
+
+ free_bvhtree_from_mesh(&treeData);
+}
+
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 9005db1312f..508b2233536 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -69,6 +69,8 @@ variables on the UI for now
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_ghash.h"
+#include "BLI_threads.h"
+
#include "BKE_curve.h"
#include "BKE_effect.h"
#include "BKE_global.h"
@@ -118,6 +120,20 @@ typedef struct SBScratch {
float aabbmin[3],aabbmax[3];
}SBScratch;
+typedef struct SB_thread_context{
+ Object *ob;
+ float forcetime;
+ float timenow;
+ int ifirst;
+ int ilast;
+ ListBase *do_effector;
+ int do_deflector;
+ float fieldfactor;
+ float windfactor;
+ int nr;
+ int tot;
+}SB_thread_context;
+
#define NLF_BUILD 1
#define NLF_SOLVE 2
@@ -1514,17 +1530,15 @@ int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp
-void scan_for_ext_spring_forces(Object *ob,float timenow)
+void _scan_for_ext_spring_forces(Object *ob,float timenow,int ifirst,int ilast, struct ListBase *do_effector)
{
SoftBody *sb = ob->soft;
- ListBase *do_effector;
int a;
float damp;
float feedback[3];
- do_effector= pdInitEffectors(ob,NULL);
if (sb && sb->totspring){
- for(a=0; a<sb->totspring; a++) {
+ for(a=ifirst; a<ilast; a++) {
BodySpring *bs = &sb->bspring[a];
bs->ext_force[0]=bs->ext_force[1]=bs->ext_force[2]=0.0f;
feedback[0]=feedback[1]=feedback[2]=0.0f;
@@ -1584,9 +1598,88 @@ void scan_for_ext_spring_forces(Object *ob,float timenow)
}
}
}
- if(do_effector)
- pdEndEffectors(do_effector);
}
+
+
+void scan_for_ext_spring_forces(Object *ob,float timenow)
+{
+ SoftBody *sb = ob->soft;
+ ListBase *do_effector= NULL;
+ do_effector= pdInitEffectors(ob,NULL);
+ if (sb){
+ _scan_for_ext_spring_forces(ob,timenow,0,sb->totspring,do_effector);
+ }
+ if(do_effector)
+ pdEndEffectors(do_effector);
+}
+
+void *exec_scan_for_ext_spring_forces(void *data)
+{
+ SB_thread_context *pctx = (SB_thread_context*)data;
+ _scan_for_ext_spring_forces(pctx->ob,pctx->timenow,pctx->ifirst,pctx->ilast,pctx->do_effector);
+ return 0;
+}
+
+void sb_sfesf_threads_run(struct Object *ob, float timenow,int totsprings,int *ptr_to_break_func())
+{
+ ListBase *do_effector = NULL;
+ ListBase threads;
+ SB_thread_context *sb_threads;
+ int i, totthread,left,dec;
+ int lowsprings =100; /* wild guess .. may increase with better thread management 'above' or even be UI option sb->spawn_cf_threads_nopts */
+
+ do_effector= pdInitEffectors(ob,NULL);
+
+ /* figure the number of threads while preventing pretty pointless threading overhead */
+ if(G.scene->r.mode & R_FIXED_THREADS)
+ totthread= G.scene->r.threads;
+ else
+ totthread= BLI_system_thread_count();
+ /* what if we got zillions of CPUs running but less to spread*/
+ while ((totsprings/totthread < lowsprings) && (totthread > 1)) {
+ totthread--;
+ }
+
+ sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBSpringsThread");
+ memset(sb_threads, 0, sizeof(SB_thread_context)*totthread);
+ left = totsprings;
+ dec = totsprings/totthread +1;
+ for(i=0; i<totthread; i++) {
+ sb_threads[i].ob = ob;
+ sb_threads[i].forcetime = 0.0; // not used here
+ sb_threads[i].timenow = timenow;
+ sb_threads[i].ilast = left;
+ left = left - dec;
+ if (left >0){
+ sb_threads[i].ifirst = left;
+ }
+ else
+ sb_threads[i].ifirst = 0;
+ sb_threads[i].do_effector = do_effector;
+ sb_threads[i].do_deflector = 0;// not used here
+ sb_threads[i].fieldfactor = 0.0f;// not used here
+ sb_threads[i].windfactor = 0.0f;// not used here
+ sb_threads[i].nr= i;
+ sb_threads[i].tot= totthread;
+ }
+ if(totthread > 1) {
+ BLI_init_threads(&threads, exec_scan_for_ext_spring_forces, totthread);
+
+ for(i=0; i<totthread; i++)
+ BLI_insert_thread(&threads, &sb_threads[i]);
+
+ BLI_end_threads(&threads);
+ }
+ else
+ exec_scan_for_ext_spring_forces(&sb_threads[0]);
+ /* clean up */
+ MEM_freeN(sb_threads);
+
+ if(do_effector)
+ pdEndEffectors(do_effector);
+}
+
+
/* --- the spring external section*/
int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,float*cb,float*cc)
@@ -2023,109 +2116,72 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
}
-static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int nl_flags)
+/* since this is definitely the most CPU consuming task here .. try to spread it */
+/* core function _softbody_calc_forces_slice_in_a_thread */
+/* result is int to be able to flag user break */
+int _softbody_calc_forces_slice_in_a_thread(Object *ob, float forcetime, float timenow,int ifirst,int ilast,int *ptr_to_break_func(),ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor)
{
-/* rule we never alter free variables :bp->vec bp->pos in here !
- * this will ruin adaptive stepsize AKA heun! (BM)
- */
+ float iks;
+ int bb,do_selfcollision,do_springcollision,do_aero;
+ int number_of_points_here = ilast - ifirst;
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
- BodyPoint *bproot;
- BodySpring *bs;
- ListBase *do_effector;
- float iks, ks, kd, gravity;
- float fieldfactor = 1000.0f, windfactor = 250.0f;
- float tune = sb->ballstiff;
- int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero;
-
-
-/* jacobian
- NLboolean success;
-
- if(nl_flags){
- nlBegin(NL_SYSTEM);
- nlBegin(NL_MATRIX);
- }
-*/
-
-
- gravity = sb->grav * sb_grav_force_scale(ob);
-
+ /* intitialize */
+ if (sb) {
/* check conditions for various options */
- do_deflector= query_external_colliders(ob);
- do_effector= pdInitEffectors(ob,NULL);
+ /* +++ could be done on object level to squeeze out the last bits of it */
do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF));
do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL);
do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
-
- iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
- bproot= sb->bpoint; /* need this for proper spring addressing */
-
+ /* --- could be done on object level to squeeze out the last bits of it */
+ }
+ else {
+ printf("Error expected a SB here \n");
+ return (999);
+ }
-
- if (do_springcollision || do_aero) scan_for_ext_spring_forces(ob,timenow);
- if (do_deflector) {
- float defforce[3];
- do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow);
+/* debugerin */
+ if (sb->totpoint < ifirst) {
+ printf("Aye 998");
+ return (998);
}
+/* debugerin */
- for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+
+ bp = &sb->bpoint[ifirst];
+ for(bb=number_of_points_here; bb>0; bb--, bp++) {
/* clear forces accumulator */
bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
- if(nl_flags & NLF_BUILD){
- //int ia =3*(sb->totpoint-a);
- //int op =3*sb->totpoint;
- /* dF/dV = v */
- /* jacobioan
- nlMatrixAdd(op+ia,ia,-forcetime);
- nlMatrixAdd(op+ia+1,ia+1,-forcetime);
- nlMatrixAdd(op+ia+2,ia+2,-forcetime);
-
- nlMatrixAdd(ia,ia,1);
- nlMatrixAdd(ia+1,ia+1,1);
- nlMatrixAdd(ia+2,ia+2,1);
-
- nlMatrixAdd(op+ia,op+ia,1);
- nlMatrixAdd(op+ia+1,op+ia+1,1);
- nlMatrixAdd(op+ia+2,op+ia+2,1);
- */
-
-
- }
-
/* naive ball self collision */
/* needs to be done if goal snaps or not */
if(do_selfcollision){
int attached;
BodyPoint *obp;
+ BodySpring *bs;
int c,b;
float velcenter[3],dvel[3],def[3];
float distance;
float compare;
+ float bstune = sb->ballstiff;
- for(c=sb->totpoint, obp= sb->bpoint; c>=a; c--, obp++) {
-
- //if ((bp->octantflag & obp->octantflag) == 0) continue;
-
+ for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) {
compare = (obp->colball + bp->colball);
VecSubf(def, bp->pos, obp->pos);
-
/* rather check the AABBoxes before ever calulating the real distance */
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
-
distance = Normalize(def);
if (distance < compare ){
/* exclude body points attached with a spring */
attached = 0;
for(b=obp->nofsprings;b>0;b--){
bs = sb->bspring + obp->springs[b-1];
- if (( sb->totpoint-a == bs->v2) || ( sb->totpoint-a == bs->v1)){
+ if (( ilast-bb == bs->v2) || ( ilast-bb == bs->v1)){
attached=1;
continue;}
}
if (!attached){
- float f = tune/(distance) + tune/(compare*compare)*distance - 2.0f*tune/compare ;
+ float f = bstune/(distance) + bstune/(compare*compare)*distance - 2.0f*bstune/compare ;
VecMidf(velcenter, bp->vec, obp->vec);
VecSubf(dvel,velcenter,bp->vec);
@@ -2134,38 +2190,12 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
Vec3PlusStVec(bp->force,sb->balldamp,dvel);
- if(nl_flags & NLF_BUILD){
- //int ia =3*(sb->totpoint-a);
- //int ic =3*(sb->totpoint-c);
- //int op =3*sb->totpoint;
- //float mvel = forcetime*sb->nodemass*sb->balldamp;
- //float mpos = forcetime*tune*(1.0f-sb->balldamp);
- /*some quick and dirty entries to the jacobian*/
- //dfdx_goal(ia,ia,op,mpos);
- //dfdv_goal(ia,ia,mvel);
- /* exploit force(a,b) == -force(b,a) part1/2 */
- //dfdx_goal(ic,ic,op,mpos);
- //dfdv_goal(ic,ic,mvel);
-
-
- /*TODO sit down an X-out the true jacobian entries*/
- /*well does not make to much sense because the eigenvalues
- of the jacobian go negative; and negative eigenvalues
- on a complex iterative system z(n+1)=A * z(n)
- give imaginary roots in the charcateristic polynom
- --> solutions that to z(t)=u(t)* exp ( i omega t) --> oscilations we don't want here
- where u(t) is a unknown amplitude function (worst case rising fast)
- */
- }
-
/* exploit force(a,b) == -force(b,a) part2/2 */
VecSubf(dvel,velcenter,obp->vec);
VecMulf(dvel,sb->nodemass);
Vec3PlusStVec(obp->force,sb->balldamp,dvel);
Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
-
-
}
}
}
@@ -2179,20 +2209,13 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
/* do goal stuff */
if(ob->softflag & OB_SB_GOAL) {
/* true elastic goal */
+ float ks,kd;
VecSubf(auxvect,bp->pos,bp->origT);
ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ;
bp->force[0]+= -ks*(auxvect[0]);
bp->force[1]+= -ks*(auxvect[1]);
bp->force[2]+= -ks*(auxvect[2]);
- if(nl_flags & NLF_BUILD){
- //int ia =3*(sb->totpoint-a);
- //int op =3*(sb->totpoint);
- /* depending on my pos */
- //dfdx_goal(ia,ia,op,ks*forcetime);
- }
-
-
/* calulate damping forces generated by goals*/
VecSubf(velgoal,bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob) ;
@@ -2202,13 +2225,6 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
bp->force[0]-= kd * (auxvect[0]);
bp->force[1]-= kd * (auxvect[1]);
bp->force[2]-= kd * (auxvect[2]);
- if(nl_flags & NLF_BUILD){
- //int ia =3*(sb->totpoint-a);
- Normalize(auxvect);
- /* depending on my vel */
- //dfdv_goal(ia,ia,kd*forcetime);
- }
-
}
else {
bp->force[0]-= kd * (velgoal[0] - bp->vec[0]);
@@ -2218,14 +2234,15 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
}
/* done goal stuff */
-
/* gravitation */
+ if (sb){
+ float gravity = sb->grav * sb_grav_force_scale(ob);
bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */
- //bp->force[1]-= gravity*sb->nodemass; /* individual mass of node here */
-
+ }
/* particle field & vortex */
if(do_effector) {
+ float kd;
float force[3]= {0.0f, 0.0f, 0.0f};
float speed[3]= {0.0f, 0.0f, 0.0f};
float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
@@ -2246,21 +2263,12 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
}
else {
/* BP friction in media (not) moving*/
- kd= sb->mediafrict* sb_fric_force_scale(ob);
+ float kd = sb->mediafrict* sb_fric_force_scale(ob);
/* assume it to be proportional to actual velocity */
bp->force[0]-= bp->vec[0]*kd;
bp->force[1]-= bp->vec[1]*kd;
bp->force[2]-= bp->vec[2]*kd;
/* friction in media done */
- if(nl_flags & NLF_BUILD){
- //int ia =3*(sb->totpoint-a);
- /* da/dv = */
-
-// nlMatrixAdd(ia,ia,forcetime*kd);
-// nlMatrixAdd(ia+1,ia+1,forcetime*kd);
-// nlMatrixAdd(ia+2,ia+2,forcetime*kd);
- }
-
}
/* +++cached collision targets */
bp->choke = 0.0f;
@@ -2268,44 +2276,30 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
bp->flag &= ~SBF_DOFUZZY;
if(do_deflector) {
float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion;
- kd = 1.0f;
+ float kd = 1.0f;
if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){
- if ((!nl_flags)&&(intrusion < 0.0f)){
- /*bjornmose: uugh.. what an evil hack
- violation of the 'don't touch bp->pos in here' rule
- but works nice, like this-->
- we predict the solution beeing out of the collider
- in heun step No1 and leave the heun step No2 adapt to it
- so we kind of introduced a implicit solver for this case
- */
- Vec3PlusStVec(bp->pos,-intrusion,facenormal);
-
- sb->scratch->flag |= SBF_DOFUZZY;
- bp->flag |= SBF_DOFUZZY;
- bp->choke = sb->choke*0.01f;
- }
- else{
+ if (intrusion < 0.0f){
+ sb->scratch->flag |= SBF_DOFUZZY;
+ bp->flag |= SBF_DOFUZZY;
+ bp->choke = sb->choke*0.01f;
+ }
+
VECSUB(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
- }
- Vec3PlusStVec(bp->force,kd,defforce);
- if (nl_flags & NLF_BUILD){
- // int ia =3*(sb->totpoint-a);
- // int op =3*sb->totpoint;
- //dfdx_goal(ia,ia,op,mpos); // don't do unless you know
- //dfdv_goal(ia,ia,-cf);
-
- }
-
+
+ Vec3PlusStVec(bp->force,kd,defforce);
}
}
/* ---cached collision targets */
/* +++springs */
+ iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
if(ob->softflag & OB_SB_EDGES) {
if (sb->bspring){ /* spring list exists at all ? */
+ int b;
+ BodySpring *bs;
for(b=bp->nofsprings;b>0;b--){
bs = sb->bspring + bp->springs[b-1];
if (do_springcollision || do_aero){
@@ -2315,90 +2309,530 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int
}
// sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags)
- sb_spring_force(ob,sb->totpoint-a,bs,iks,forcetime,nl_flags);
+ sb_spring_force(ob,ilast-bb,bs,iks,forcetime,0);
}/* loop springs */
}/* existing spring list */
}/*any edges*/
/* ---springs */
}/*omit on snap */
}/*loop all bp's*/
+return 0; /*done fine*/
+}
+void *exec_softbody_calc_forces(void *data)
+{
+ SB_thread_context *pctx = (SB_thread_context*)data;
+ _softbody_calc_forces_slice_in_a_thread(pctx->ob,pctx->forcetime,pctx->timenow,pctx->ifirst,pctx->ilast,NULL,pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor);
+ return 0;
+}
+
+void sb_cf_threads_run(struct Object *ob, float forcetime, float timenow,int totpoint,int *ptr_to_break_func(),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor)
+{
+ ListBase threads;
+ SB_thread_context *sb_threads;
+ int i, totthread,left,dec;
+ int lowpoints =100; /* wild guess .. may increase with better thread management 'above' or even be UI option sb->spawn_cf_threads_nopts */
+
+ /* figure the number of threads while preventing pretty pointless threading overhead */
+ if(G.scene->r.mode & R_FIXED_THREADS)
+ totthread= G.scene->r.threads;
+ else
+ totthread= BLI_system_thread_count();
+ /* what if we got zillions of CPUs running but less to spread*/
+ while ((totpoint/totthread < lowpoints) && (totthread > 1)) {
+ totthread--;
+ }
+
+ /* printf("sb_cf_threads_run spawning %d threads \n",totthread); */
+
+ sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBThread");
+ memset(sb_threads, 0, sizeof(SB_thread_context)*totthread);
+ left = totpoint;
+ dec = totpoint/totthread +1;
+ for(i=0; i<totthread; i++) {
+ sb_threads[i].ob = ob;
+ sb_threads[i].forcetime = forcetime;
+ sb_threads[i].timenow = timenow;
+ sb_threads[i].ilast = left;
+ left = left - dec;
+ if (left >0){
+ sb_threads[i].ifirst = left;
+ }
+ else
+ sb_threads[i].ifirst = 0;
+ sb_threads[i].do_effector = do_effector;
+ sb_threads[i].do_deflector = do_deflector;
+ sb_threads[i].fieldfactor = fieldfactor;
+ sb_threads[i].windfactor = windfactor;
+ sb_threads[i].nr= i;
+ sb_threads[i].tot= totthread;
+ }
+
+
+ if(totthread > 1) {
+ BLI_init_threads(&threads, exec_softbody_calc_forces, totthread);
+
+ for(i=0; i<totthread; i++)
+ BLI_insert_thread(&threads, &sb_threads[i]);
+
+ BLI_end_threads(&threads);
+ }
+ else
+ exec_softbody_calc_forces(&sb_threads[0]);
+ /* clean up */
+ MEM_freeN(sb_threads);
+}
+
+static void softbody_calc_forcesEx(Object *ob, float forcetime, float timenow, int nl_flags)
+{
+/* rule we never alter free variables :bp->vec bp->pos in here !
+ * this will ruin adaptive stepsize AKA heun! (BM)
+ */
+ SoftBody *sb= ob->soft; /* is supposed to be there */
+ BodyPoint *bproot;
+ ListBase *do_effector;
+ float iks, gravity;
+ float fieldfactor = 1000.0f, windfactor = 250.0f;
+ int do_deflector,do_selfcollision,do_springcollision,do_aero;
+
+ gravity = sb->grav * sb_grav_force_scale(ob);
+
+ /* check conditions for various options */
+ do_deflector= query_external_colliders(ob);
+ do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF));
+ do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL);
+ do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
+
+ iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
+ bproot= sb->bpoint; /* need this for proper spring addressing */
+
+ if (do_springcollision || do_aero)
+ sb_sfesf_threads_run(ob,timenow,sb->totspring,NULL);
+
+ /* after spring scan because it uses Effoctors too */
+ do_effector= pdInitEffectors(ob,NULL);
+
+ if (do_deflector) {
+ float defforce[3];
+ do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow);
+ }
+
+ sb_cf_threads_run(ob,forcetime,timenow,sb->totpoint,NULL,do_effector,do_deflector,fieldfactor,windfactor);
/* finally add forces caused by face collision */
if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow);
/* finish matrix and solve */
-#if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be usefull .. so keep that BM
- if(nl_flags & NLF_SOLVE){
- //double sct,sst=PIL_check_seconds_timer();
- for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- int iv =3*(sb->totpoint-a);
- int ip =3*(2*sb->totpoint-a);
- int n;
- for (n=0;n<3;n++) {nlRightHandSideSet(0, iv+n, bp->force[0+n]);}
- for (n=0;n<3;n++) {nlRightHandSideSet(0, ip+n, bp->vec[0+n]);}
+ if(do_effector) pdEndEffectors(do_effector);
+}
+
+
+
+
+static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int nl_flags)
+{
+ /* redirection to the new threaded Version */
+ if (!(G.rt & 0x10)){ // 16
+ softbody_calc_forcesEx(ob, forcetime, timenow, nl_flags);
+ return;
+ }
+ else{
+ /* so the following will die */
+ /* |||||||||||||||||||||||||| */
+ /* VVVVVVVVVVVVVVVVVVVVVVVVVV */
+ /*backward compatibility note:
+ fixing bug [17428] which forces adaptive step size to tiny steps
+ in some situations
+ .. keeping G.rt==17 0x11 option for old files 'needing' the bug*/
+
+ /* rule we never alter free variables :bp->vec bp->pos in here !
+ * this will ruin adaptive stepsize AKA heun! (BM)
+ */
+ SoftBody *sb= ob->soft; /* is supposed to be there */
+ BodyPoint *bp;
+ BodyPoint *bproot;
+ BodySpring *bs;
+ ListBase *do_effector;
+ float iks, ks, kd, gravity;
+ float fieldfactor = 1000.0f, windfactor = 250.0f;
+ float tune = sb->ballstiff;
+ int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero;
+
+
+ /* jacobian
+ NLboolean success;
+
+ if(nl_flags){
+ nlBegin(NL_SYSTEM);
+ nlBegin(NL_MATRIX);
}
- nlEnd(NL_MATRIX);
- nlEnd(NL_SYSTEM);
+ */
+
+
+ gravity = sb->grav * sb_grav_force_scale(ob);
+
+ /* check conditions for various options */
+ do_deflector= query_external_colliders(ob);
+ do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF));
+ do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL);
+ do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
- if ((G.rt >0) && (nl_flags & NLF_BUILD))
- {
- printf("####MEE#####\n");
- nlPrintMatrix();
+ iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
+ bproot= sb->bpoint; /* need this for proper spring addressing */
+
+ if (do_springcollision || do_aero) scan_for_ext_spring_forces(ob,timenow);
+ /* after spring scan because it uses Effoctors too */
+ do_effector= pdInitEffectors(ob,NULL);
+
+ if (do_deflector) {
+ float defforce[3];
+ do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow);
}
- success= nlSolveAdvanced(NULL, 1);
+ for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ /* clear forces accumulator */
+ bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
+ if(nl_flags & NLF_BUILD){
+ //int ia =3*(sb->totpoint-a);
+ //int op =3*sb->totpoint;
+ /* dF/dV = v */
+ /* jacobioan
+ nlMatrixAdd(op+ia,ia,-forcetime);
+ nlMatrixAdd(op+ia+1,ia+1,-forcetime);
+ nlMatrixAdd(op+ia+2,ia+2,-forcetime);
+
+ nlMatrixAdd(ia,ia,1);
+ nlMatrixAdd(ia+1,ia+1,1);
+ nlMatrixAdd(ia+2,ia+2,1);
+
+ nlMatrixAdd(op+ia,op+ia,1);
+ nlMatrixAdd(op+ia+1,op+ia+1,1);
+ nlMatrixAdd(op+ia+2,op+ia+2,1);
+ */
- // nlPrintMatrix(); /* for debug purpose .. anyhow cropping B vector looks like working */
- if(success){
- float f;
- int index =0;
- /* for debug purpose .. anyhow cropping B vector looks like working */
- if (G.rt >0)
- for(a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- f=nlGetVariable(0,index);
- printf("(%f ",f);index++;
- f=nlGetVariable(0,index);
- printf("%f ",f);index++;
- f=nlGetVariable(0,index);
- printf("%f)",f);index++;
+
+ }
+
+ /* naive ball self collision */
+ /* needs to be done if goal snaps or not */
+ if(do_selfcollision){
+ int attached;
+ BodyPoint *obp;
+ int c,b;
+ float velcenter[3],dvel[3],def[3];
+ float distance;
+ float compare;
+
+ for(c=sb->totpoint, obp= sb->bpoint; c>=a; c--, obp++) {
+
+ //if ((bp->octantflag & obp->octantflag) == 0) continue;
+
+ compare = (obp->colball + bp->colball);
+ VecSubf(def, bp->pos, obp->pos);
+
+ /* rather check the AABBoxes before ever calulating the real distance */
+ /* mathematically it is completly nuts, but performace is pretty much (3) times faster */
+ if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
+
+ distance = Normalize(def);
+ if (distance < compare ){
+ /* exclude body points attached with a spring */
+ attached = 0;
+ for(b=obp->nofsprings;b>0;b--){
+ bs = sb->bspring + obp->springs[b-1];
+ if (( sb->totpoint-a == bs->v2) || ( sb->totpoint-a == bs->v1)){
+ attached=1;
+ continue;}
+ }
+ if (!attached){
+ float f = tune/(distance) + tune/(compare*compare)*distance - 2.0f*tune/compare ;
+
+ VecMidf(velcenter, bp->vec, obp->vec);
+ VecSubf(dvel,velcenter,bp->vec);
+ VecMulf(dvel,sb->nodemass);
+
+ Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
+ Vec3PlusStVec(bp->force,sb->balldamp,dvel);
+
+ if(nl_flags & NLF_BUILD){
+ //int ia =3*(sb->totpoint-a);
+ //int ic =3*(sb->totpoint-c);
+ //int op =3*sb->totpoint;
+ //float mvel = forcetime*sb->nodemass*sb->balldamp;
+ //float mpos = forcetime*tune*(1.0f-sb->balldamp);
+ /*some quick and dirty entries to the jacobian*/
+ //dfdx_goal(ia,ia,op,mpos);
+ //dfdv_goal(ia,ia,mvel);
+ /* exploit force(a,b) == -force(b,a) part1/2 */
+ //dfdx_goal(ic,ic,op,mpos);
+ //dfdv_goal(ic,ic,mvel);
+
+
+ /*TODO sit down an X-out the true jacobian entries*/
+ /*well does not make to much sense because the eigenvalues
+ of the jacobian go negative; and negative eigenvalues
+ on a complex iterative system z(n+1)=A * z(n)
+ give imaginary roots in the charcateristic polynom
+ --> solutions that to z(t)=u(t)* exp ( i omega t) --> oscilations we don't want here
+ where u(t) is a unknown amplitude function (worst case rising fast)
+ */
+ }
+
+ /* exploit force(a,b) == -force(b,a) part2/2 */
+ VecSubf(dvel,velcenter,obp->vec);
+ VecMulf(dvel,sb->nodemass);
+
+ Vec3PlusStVec(obp->force,sb->balldamp,dvel);
+ Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
+
+
+ }
+ }
}
+ }
+ /* naive ball self collision done */
- index =0;
- for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ if(bp->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */
+ float auxvect[3];
+ float velgoal[3];
+
+ /* do goal stuff */
+ if(ob->softflag & OB_SB_GOAL) {
+ /* true elastic goal */
+ VecSubf(auxvect,bp->pos,bp->origT);
+ ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ;
+ bp->force[0]+= -ks*(auxvect[0]);
+ bp->force[1]+= -ks*(auxvect[1]);
+ bp->force[2]+= -ks*(auxvect[2]);
+
+ if(nl_flags & NLF_BUILD){
+ //int ia =3*(sb->totpoint-a);
+ //int op =3*(sb->totpoint);
+ /* depending on my pos */
+ //dfdx_goal(ia,ia,op,ks*forcetime);
+ }
+
+
+ /* calulate damping forces generated by goals*/
+ VecSubf(velgoal,bp->origS, bp->origE);
+ kd = sb->goalfrict * sb_fric_force_scale(ob) ;
+ VecAddf(auxvect,velgoal,bp->vec);
+
+ if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */
+ bp->force[0]-= kd * (auxvect[0]);
+ bp->force[1]-= kd * (auxvect[1]);
+ bp->force[2]-= kd * (auxvect[2]);
+ if(nl_flags & NLF_BUILD){
+ //int ia =3*(sb->totpoint-a);
+ Normalize(auxvect);
+ /* depending on my vel */
+ //dfdv_goal(ia,ia,kd*forcetime);
+ }
+
+ }
+ else {
+ bp->force[0]-= kd * (velgoal[0] - bp->vec[0]);
+ bp->force[1]-= kd * (velgoal[1] - bp->vec[1]);
+ bp->force[2]-= kd * (velgoal[2] - bp->vec[2]);
+ }
+ }
+ /* done goal stuff */
+
+
+ /* gravitation */
+ bp->force[2]-= gravity*sb->nodemass; /* individual mass of node here */
+ //bp->force[1]-= gravity*sb->nodemass; /* individual mass of node here */
+
+
+ /* particle field & vortex */
+ if(do_effector) {
+ float force[3]= {0.0f, 0.0f, 0.0f};
+ float speed[3]= {0.0f, 0.0f, 0.0f};
+ float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
+
+ pdDoEffectors(do_effector, bp->pos, force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
+
+ /* apply forcefield*/
+ VecMulf(force,fieldfactor* eval_sb_fric_force_scale);
+ VECADD(bp->force, bp->force, force);
+
+ /* BP friction in moving media */
+ kd= sb->mediafrict* eval_sb_fric_force_scale;
+ bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale);
+ bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale);
+ bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale);
+ /* now we'll have nice centrifugal effect for vortex */
+
+ }
+ else {
+ /* BP friction in media (not) moving*/
+ kd= sb->mediafrict* sb_fric_force_scale(ob);
+ /* assume it to be proportional to actual velocity */
+ bp->force[0]-= bp->vec[0]*kd;
+ bp->force[1]-= bp->vec[1]*kd;
+ bp->force[2]-= bp->vec[2]*kd;
+ /* friction in media done */
+ if(nl_flags & NLF_BUILD){
+ //int ia =3*(sb->totpoint-a);
+ /* da/dv = */
+
+ // nlMatrixAdd(ia,ia,forcetime*kd);
+ // nlMatrixAdd(ia+1,ia+1,forcetime*kd);
+ // nlMatrixAdd(ia+2,ia+2,forcetime*kd);
+ }
+
+ }
+ /* +++cached collision targets */
+ bp->choke = 0.0f;
+ bp->choke2 = 0.0f;
+ bp->flag &= ~SBF_DOFUZZY;
+ if(do_deflector) {
+ float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion;
+ kd = 1.0f;
+
+ if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){
+ if ((!nl_flags)&&(intrusion < 0.0f)){
+ if(G.rt & 0x01){ // 17 we did check for bit 0x10 before
+ /*fixing bug [17428] this forces adaptive step size to tiny steps
+ in some situations .. keeping G.rt==17 option for old files 'needing' the bug
+ */
+ /*bjornmose: uugh.. what an evil hack
+ violation of the 'don't touch bp->pos in here' rule
+ but works nice, like this-->
+ we predict the solution beeing out of the collider
+ in heun step No1 and leave the heun step No2 adapt to it
+ so we kind of introduced a implicit solver for this case
+ */
+ Vec3PlusStVec(bp->pos,-intrusion,facenormal);
+ }
+ else{
+
+ VECSUB(cfforce,bp->vec,vel);
+ Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
+ }
+
+
+ sb->scratch->flag |= SBF_DOFUZZY;
+ bp->flag |= SBF_DOFUZZY;
+ bp->choke = sb->choke*0.01f;
+ }
+ else{
+ VECSUB(cfforce,bp->vec,vel);
+ Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
+ }
+ Vec3PlusStVec(bp->force,kd,defforce);
+ if (nl_flags & NLF_BUILD){
+ // int ia =3*(sb->totpoint-a);
+ // int op =3*sb->totpoint;
+ //dfdx_goal(ia,ia,op,mpos); // don't do unless you know
+ //dfdv_goal(ia,ia,-cf);
+
+ }
+
+ }
+
+ }
+ /* ---cached collision targets */
+
+ /* +++springs */
+ if(ob->softflag & OB_SB_EDGES) {
+ if (sb->bspring){ /* spring list exists at all ? */
+ for(b=bp->nofsprings;b>0;b--){
+ bs = sb->bspring + bp->springs[b-1];
+ if (do_springcollision || do_aero){
+ VecAddf(bp->force,bp->force,bs->ext_force);
+ if (bs->flag & BSF_INTERSECT)
+ bp->choke = bs->cf;
+
+ }
+ // sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags)
+ // rather remove nl_falgs from code .. will make things a lot cleaner
+ sb_spring_force(ob,sb->totpoint-a,bs,iks,forcetime,0);
+ }/* loop springs */
+ }/* existing spring list */
+ }/*any edges*/
+ /* ---springs */
+ }/*omit on snap */
+ }/*loop all bp's*/
+
+
+ /* finally add forces caused by face collision */
+ if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow);
+
+ /* finish matrix and solve */
+#if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be usefull .. so keep that BM
+ if(nl_flags & NLF_SOLVE){
+ //double sct,sst=PIL_check_seconds_timer();
+ for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ int iv =3*(sb->totpoint-a);
+ int ip =3*(2*sb->totpoint-a);
+ int n;
+ for (n=0;n<3;n++) {nlRightHandSideSet(0, iv+n, bp->force[0+n]);}
+ for (n=0;n<3;n++) {nlRightHandSideSet(0, ip+n, bp->vec[0+n]);}
+ }
+ nlEnd(NL_MATRIX);
+ nlEnd(NL_SYSTEM);
+
+ if ((G.rt == 32) && (nl_flags & NLF_BUILD))
+ {
+ printf("####MEE#####\n");
+ nlPrintMatrix();
+ }
+
+ success= nlSolveAdvanced(NULL, 1);
+
+ // nlPrintMatrix(); /* for debug purpose .. anyhow cropping B vector looks like working */
+ if(success){
+ float f;
+ int index =0;
+ /* for debug purpose .. anyhow cropping B vector looks like working */
+ if (G.rt ==32)
+ for(a=2*sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ f=nlGetVariable(0,index);
+ printf("(%f ",f);index++;
+ f=nlGetVariable(0,index);
+ printf("%f ",f);index++;
+ f=nlGetVariable(0,index);
+ printf("%f)",f);index++;
+ }
+
+ index =0;
+ for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ f=nlGetVariable(0,index);
+ bp->impdv[0] = f; index++;
+ f=nlGetVariable(0,index);
+ bp->impdv[1] = f; index++;
+ f=nlGetVariable(0,index);
+ bp->impdv[2] = f; index++;
+ }
+ /*
+ for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
f=nlGetVariable(0,index);
- bp->impdv[0] = f; index++;
+ bp->impdx[0] = f; index++;
f=nlGetVariable(0,index);
- bp->impdv[1] = f; index++;
+ bp->impdx[1] = f; index++;
f=nlGetVariable(0,index);
- bp->impdv[2] = f; index++;
- }
- /*
+ bp->impdx[2] = f; index++;
+ }
+ */
+ }
+ else{
+ printf("Matrix inversion failed \n");
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- f=nlGetVariable(0,index);
- bp->impdx[0] = f; index++;
- f=nlGetVariable(0,index);
- bp->impdx[1] = f; index++;
- f=nlGetVariable(0,index);
- bp->impdx[2] = f; index++;
+ VECCOPY(bp->impdv,bp->force);
}
- */
- }
- else{
- printf("Matrix inversion failed \n");
- for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- VECCOPY(bp->impdv,bp->force);
+
}
+ //sct=PIL_check_seconds_timer();
+ //if (sct-sst > 0.01f) printf(" implicit solver time %f %s \r",sct-sst,ob->id.name);
}
-
- //sct=PIL_check_seconds_timer();
- //if (sct-sst > 0.01f) printf(" implicit solver time %f %s \r",sct-sst,ob->id.name);
- }
- /* cleanup */
+ /* cleanup */
#endif
- if(do_effector) pdEndEffectors(do_effector);
+ if(do_effector) pdEndEffectors(do_effector);
+ }
}
+
static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *err, int mid_flags)
{
/* time evolution */
@@ -2458,7 +2892,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* x(t + dt) = x(t) + v(t~) * dt */
VecMulf(dx,forcetime);
- /* the freezer */
+ /* the freezer coming sooner or later */
/*
if ((Inpf(dx,dx)<freezeloc )&&(Inpf(bp->force,bp->force)<freezeforce )){
bp->frozen /=2;
@@ -3529,6 +3963,7 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime)
* we don't want to lock up the system if physics fail
*/
int loops =0 ;
+
SoftHeunTol = sb->rklimit; /* humm .. this should be calculated from sb parameters and sizes */
if (sb->minloops > 0) forcetimemax = 1.0f / sb->minloops;
@@ -3546,13 +3981,13 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime)
sb->scratch->flag &= ~SBF_DOFUZZY;
/* do predictive euler step */
softbody_calc_forces(ob, forcetime,timedone/dtime,0);
- softbody_apply_forces(ob, forcetime, 1, NULL,mid_flags);
+ softbody_apply_forces(ob, forcetime, 1, NULL,mid_flags);
/* crop new slope values to do averaged slope step */
softbody_calc_forces(ob, forcetime,timedone/dtime,0);
- softbody_apply_forces(ob, forcetime, 2, &err,mid_flags);
+ softbody_apply_forces(ob, forcetime, 2, &err,mid_flags);
softbody_apply_goalsnap(ob);
if (err > SoftHeunTol) { /* error needs to be scaled to some quantity */
@@ -3603,7 +4038,7 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime)
// if(G.f & G_DEBUG){
if(sb->solverflags & SBSO_MONITOR ){
if (loops > HEUNWARNLIMIT) /* monitor high loop counts */
- printf("\r needed %d steps/frame ",loops);
+ printf("\r needed %d steps/frame",loops);
}
}
@@ -3627,7 +4062,7 @@ static void softbody_step(Object *ob, SoftBody *sb, float dtime)
if(sb->solverflags & SBSO_MONITOR ){
sct=PIL_check_seconds_timer();
- if (sct-sst > 0.5f) printf(" solver time %f %s \r",sct-sst,ob->id.name);
+ if ((sct-sst > 0.5f) || (G.f & G_DEBUG)) printf(" solver time %f sec %s \n",sct-sst,ob->id.name);
}
}
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index bba79bd6d28..f334fc39daa 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -61,6 +61,10 @@
#include "BIF_gl.h"
+#include "GPU_draw.h"
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+
#include "CCGSubSurf.h"
typedef struct _VertData {
@@ -1599,7 +1603,7 @@ static void ccgDM_glNormalFast(float *a, float *b, float *c, float *d)
}
/* Only used by non-editmesh types */
-static void ccgDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int)) {
+static void ccgDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int, void *attribs)) {
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
@@ -1621,7 +1625,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int)) {
mat_nr= 0;
}
- if (!setMaterial(mat_nr+1))
+ if (!setMaterial(mat_nr+1, NULL))
continue;
glShadeModel(drawSmooth? GL_SMOOTH: GL_FLAT);
@@ -1666,6 +1670,168 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int)) {
ccgFaceIterator_free(fi);
}
+
+ /* Only used by non-editmesh types */
+static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData) {
+ CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
+ CCGSubSurf *ss = ccgdm->ss;
+ CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
+ GPUVertexAttribs gattribs;
+ DMVertexAttribs attribs;
+ MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE);
+ int gridSize = ccgSubSurf_getGridSize(ss);
+ int gridFaces = gridSize - 1;
+ int edgeSize = ccgSubSurf_getEdgeSize(ss);
+ int transp, orig_transp, new_transp;
+ char *faceFlags = DM_get_face_data_layer(dm, CD_FLAGS);
+ int a, b, i, doDraw, numVerts, matnr, new_matnr, totface;
+
+ doDraw = 0;
+ numVerts = 0;
+ matnr = -1;
+ transp = GPU_get_material_blend_mode();
+ orig_transp = transp;
+
+ memset(&attribs, 0, sizeof(attribs));
+
+#define PASSATTRIB(dx, dy, vert) { \
+ if(attribs.totorco) { \
+ index = getFaceIndex(ss, f, S, x+dx, y+dy, edgeSize, gridSize); \
+ glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]); \
+ } \
+ for(b = 0; b < attribs.tottface; b++) { \
+ MTFace *tf = &attribs.tface[b].array[a]; \
+ glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]); \
+ } \
+ for(b = 0; b < attribs.totmcol; b++) { \
+ MCol *cp = &attribs.mcol[b].array[a*4 + vert]; \
+ GLubyte col[4]; \
+ col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a; \
+ glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col); \
+ } \
+ if(attribs.tottang) { \
+ float *tang = attribs.tang.array[a*4 + vert]; \
+ glVertexAttrib3fvARB(attribs.tang.glIndex, tang); \
+ } \
+}
+
+ totface = ccgSubSurf_getNumFaces(ss);
+ for(a = 0, i = 0; i < totface; i++) {
+ CCGFace *f = ccgdm->faceMap[i].face;
+ int S, x, y, drawSmooth;
+ int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f));
+ int origIndex = ccgDM_getFaceMapIndex(ccgdm, ss, f);
+
+ numVerts = ccgSubSurf_getFaceNumVerts(ss, f);
+
+ if(faceFlags) {
+ drawSmooth = (faceFlags[index*4] & ME_SMOOTH);
+ new_matnr= faceFlags[index*4 + 1] + 1;
+ }
+ else {
+ drawSmooth = 1;
+ new_matnr= 1;
+ }
+
+ if(new_matnr != matnr) {
+ doDraw = setMaterial(matnr = new_matnr, &gattribs);
+ if(doDraw)
+ DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
+ }
+
+ if(!doDraw || (setDrawOptions && !setDrawOptions(userData, origIndex))) {
+ a += gridFaces*gridFaces*numVerts;
+ continue;
+ }
+
+ if(tf) {
+ new_transp = tf[i].transp;
+
+ if(new_transp != transp) {
+ if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
+ GPU_set_material_blend_mode(orig_transp);
+ else
+ GPU_set_material_blend_mode(new_transp);
+ transp = new_transp;
+ }
+ }
+
+ glShadeModel(drawSmooth? GL_SMOOTH: GL_FLAT);
+ for (S=0; S<numVerts; S++) {
+ VertData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
+ VertData *vda, *vdb;
+
+ if (drawSmooth) {
+ for (y=0; y<gridFaces; y++) {
+ glBegin(GL_QUAD_STRIP);
+ for (x=0; x<gridFaces; x++) {
+ vda = &faceGridData[(y+0)*gridSize + x];
+ vdb = &faceGridData[(y+1)*gridSize + x];
+
+ PASSATTRIB(0, 0, 0);
+ glNormal3fv(vda->no);
+ glVertex3fv(vda->co);
+
+ PASSATTRIB(0, 1, 1);
+ glNormal3fv(vdb->no);
+ glVertex3fv(vdb->co);
+
+ if(x != gridFaces-1)
+ a++;
+ }
+
+ vda = &faceGridData[(y+0)*gridSize + x];
+ vdb = &faceGridData[(y+1)*gridSize + x];
+
+ PASSATTRIB(0, 0, 3);
+ glNormal3fv(vda->no);
+ glVertex3fv(vda->co);
+
+ PASSATTRIB(0, 1, 2);
+ glNormal3fv(vdb->no);
+ glVertex3fv(vdb->co);
+
+ glEnd();
+
+ a++;
+ }
+ } else {
+ glBegin(GL_QUADS);
+ for (y=0; y<gridFaces; y++) {
+ for (x=0; x<gridFaces; x++) {
+ float *aco = faceGridData[(y+0)*gridSize + x].co;
+ float *bco = faceGridData[(y+0)*gridSize + x + 1].co;
+ float *cco = faceGridData[(y+1)*gridSize + x + 1].co;
+ float *dco = faceGridData[(y+1)*gridSize + x].co;
+
+ ccgDM_glNormalFast(aco, bco, cco, dco);
+
+ PASSATTRIB(0, 1, 1);
+ glVertex3fv(dco);
+ PASSATTRIB(1, 1, 2);
+ glVertex3fv(cco);
+ PASSATTRIB(1, 0, 3);
+ glVertex3fv(bco);
+ PASSATTRIB(0, 0, 0);
+ glVertex3fv(aco);
+
+ a++;
+ }
+ }
+ glEnd();
+ }
+ }
+ }
+
+#undef PASSATTRIB
+
+ ccgFaceIterator_free(fi);
+}
+
+static void ccgDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs)) {
+ dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
+}
+
static void ccgDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2) {
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
@@ -2143,8 +2309,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.drawFacesSolid = ccgDM_drawFacesSolid;
ccgdm->dm.drawFacesColored = ccgDM_drawFacesColored;
ccgdm->dm.drawFacesTex = ccgDM_drawFacesTex;
+ ccgdm->dm.drawFacesGLSL = ccgDM_drawFacesGLSL;
ccgdm->dm.drawMappedFaces = ccgDM_drawMappedFaces;
ccgdm->dm.drawMappedFacesTex = ccgDM_drawMappedFacesTex;
+ ccgdm->dm.drawMappedFacesGLSL = ccgDM_drawMappedFacesGLSL;
ccgdm->dm.drawUVEdges = ccgDM_drawUVEdges;
ccgdm->dm.drawMappedEdgesInterp = ccgDM_drawMappedEdgesInterp;
diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c
new file mode 100644
index 00000000000..6530909336c
--- /dev/null
+++ b/source/blender/blenkernel/intern/suggestions.c
@@ -0,0 +1,254 @@
+/**
+ * $Id: $
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008, Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Ian Thompson.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "MEM_guardedalloc.h"
+#include "BLI_blenlib.h"
+#include "DNA_text_types.h"
+#include "BKE_text.h"
+#include "BKE_suggestions.h"
+
+/**********************/
+/* Static definitions */
+/**********************/
+
+static Text *activeToolText = NULL;
+static SuggList suggestions = {NULL, NULL, NULL, NULL, NULL};
+static char *documentation = NULL;
+//static int doc_lines = 0;
+
+static int txttl_cmp(const char *first, const char *second, int len) {
+ int cmp, i;
+ for (cmp=0, i=0; i<len; i++) {
+ if ( (cmp= toupper(first[i])-toupper(second[i])) ) {
+ break;
+ }
+ }
+ return cmp;
+}
+
+static void txttl_free_suggest() {
+ SuggItem *item, *prev;
+ for (item = suggestions.last; item; item=prev) {
+ prev = item->prev;
+ MEM_freeN(item);
+ }
+ suggestions.first = suggestions.last = NULL;
+ suggestions.firstmatch = suggestions.lastmatch = NULL;
+ suggestions.selected = NULL;
+ suggestions.top = 0;
+}
+
+static void txttl_free_docs() {
+ if (documentation) {
+ MEM_freeN(documentation);
+ documentation = NULL;
+ }
+}
+
+/**************************/
+/* General tool functions */
+/**************************/
+
+void free_texttools() {
+ txttl_free_suggest();
+ txttl_free_docs();
+}
+
+void texttool_text_set_active(Text *text) {
+ if (activeToolText == text) return;
+ texttool_text_clear();
+ activeToolText = text;
+}
+
+void texttool_text_clear() {
+ free_texttools();
+ activeToolText = NULL;
+}
+
+short texttool_text_is_active(Text *text) {
+ return activeToolText==text ? 1 : 0;
+}
+
+/***************************/
+/* Suggestion list methods */
+/***************************/
+
+void texttool_suggest_add(const char *name, char type) {
+ SuggItem *newitem, *item;
+ int len, cmp;
+
+ newitem = MEM_mallocN(sizeof(SuggItem) + strlen(name) + 1, "SuggestionItem");
+ if (!newitem) {
+ printf("Failed to allocate memory for suggestion.\n");
+ return;
+ }
+
+ newitem->name = (char *) (newitem + 1);
+ len = strlen(name);
+ strncpy(newitem->name, name, len);
+ newitem->name[len] = '\0';
+ newitem->type = type;
+ newitem->prev = newitem->next = NULL;
+
+ /* Perform simple linear search for ordered storage */
+ if (!suggestions.first || !suggestions.last) {
+ suggestions.first = suggestions.last = newitem;
+ } else {
+ cmp = -1;
+ for (item=suggestions.last; item; item=item->prev) {
+ cmp = txttl_cmp(name, item->name, len);
+
+ /* Newitem comes after this item, insert here */
+ if (cmp >= 0) {
+ newitem->prev = item;
+ if (item->next)
+ item->next->prev = newitem;
+ newitem->next = item->next;
+ item->next = newitem;
+
+ /* At last item, set last pointer here */
+ if (item == suggestions.last)
+ suggestions.last = newitem;
+ break;
+ }
+ }
+ /* Reached beginning of list, insert before first */
+ if (cmp < 0) {
+ newitem->next = suggestions.first;
+ suggestions.first->prev = newitem;
+ suggestions.first = newitem;
+ }
+ }
+ suggestions.firstmatch = suggestions.lastmatch = suggestions.selected = NULL;
+ suggestions.top= 0;
+}
+
+void texttool_suggest_prefix(const char *prefix) {
+ SuggItem *match, *first, *last;
+ int cmp, len = strlen(prefix), top = 0;
+
+ if (!suggestions.first) return;
+ if (len==0) {
+ suggestions.selected = suggestions.firstmatch = suggestions.first;
+ suggestions.lastmatch = suggestions.last;
+ return;
+ }
+
+ first = last = NULL;
+ for (match=suggestions.first; match; match=match->next) {
+ cmp = txttl_cmp(prefix, match->name, len);
+ if (cmp==0) {
+ if (!first) {
+ first = match;
+ suggestions.top = top;
+ }
+ } else if (cmp<0) {
+ if (!last) {
+ last = match->prev;
+ break;
+ }
+ }
+ top++;
+ }
+ if (first) {
+ if (!last) last = suggestions.last;
+ suggestions.firstmatch = first;
+ suggestions.lastmatch = last;
+ suggestions.selected = first;
+ } else {
+ suggestions.firstmatch = NULL;
+ suggestions.lastmatch = NULL;
+ suggestions.selected = NULL;
+ suggestions.top = 0;
+ }
+}
+
+void texttool_suggest_clear() {
+ txttl_free_suggest();
+}
+
+SuggItem *texttool_suggest_first() {
+ return suggestions.firstmatch;
+}
+
+SuggItem *texttool_suggest_last() {
+ return suggestions.lastmatch;
+}
+
+void texttool_suggest_select(SuggItem *sel) {
+ suggestions.selected = sel;
+}
+
+SuggItem *texttool_suggest_selected() {
+ return suggestions.selected;
+}
+
+int *texttool_suggest_top() {
+ return &suggestions.top;
+}
+
+/*************************/
+/* Documentation methods */
+/*************************/
+
+void texttool_docs_show(const char *docs) {
+ int len;
+
+ if (!docs) return;
+
+ len = strlen(docs);
+
+ if (documentation) {
+ MEM_freeN(documentation);
+ documentation = NULL;
+ }
+
+ /* Ensure documentation ends with a '\n' */
+ if (docs[len-1] != '\n') {
+ documentation = MEM_mallocN(len+2, "Documentation");
+ strncpy(documentation, docs, len);
+ documentation[len++] = '\n';
+ } else {
+ documentation = MEM_mallocN(len+1, "Documentation");
+ strncpy(documentation, docs, len);
+ }
+ documentation[len] = '\0';
+}
+
+char *texttool_docs_get() {
+ return documentation;
+}
+
+void texttool_docs_clear() {
+ txttl_free_docs();
+}
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 53b7bb975a3..5f1a1e63da4 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -30,6 +30,8 @@
*/
#include <string.h> /* strstr */
+#include <sys/types.h>
+#include <sys/stat.h>
#include "MEM_guardedalloc.h"
@@ -81,12 +83,19 @@ The st->top determines at what line the top of the text is displayed.
If the user moves the cursor the st containing that cursor should
be popped ... other st's retain their own top location.
-*/ /***************/
-
+Markers
+--
+The mrk->flags define the behaviour and relationships between markers. The
+upper two bytes are used to hold a group ID, the lower two are normal flags. If
+TMARK_EDITALL is set the group ID defines which other markers should be edited.
-/****************/ /*
- Undo
+The mrk->clr field is used to visually group markers where the flags may not
+match. A template system, for example, may allow editing of repeating tokens
+(in one group) but include other marked positions (in another group) all in the
+same template with the same colour.
+Undo
+--
Undo/Redo works by storing
events in a queue, and a pointer
to the current position in the
@@ -145,6 +154,7 @@ void free_text(Text *text)
}
BLI_freelistN(&text->lines);
+ BLI_freelistN(&text->markers);
if(text->name) MEM_freeN(text->name);
MEM_freeN(text->undo_buf);
@@ -169,10 +179,11 @@ Text *add_empty_text(char *name)
ta->flags= TXT_ISDIRTY | TXT_ISTMP | TXT_ISMEM;
ta->lines.first= ta->lines.last= NULL;
+ ta->markers.first= ta->markers.last= NULL;
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(1, "textline_string");
- tmp->format= (char*) MEM_mallocN(2, "Syntax_format");
+ tmp->format= NULL;
tmp->line[0]=0;
tmp->len= 0;
@@ -209,11 +220,12 @@ static void cleanup_textline(TextLine * tl)
int reopen_text(Text *text)
{
FILE *fp;
- int i, llen, len;
+ int i, llen, len, res;
unsigned char *buffer;
TextLine *tmp;
char sfile[FILE_MAXFILE];
char str[FILE_MAXDIR+FILE_MAXFILE];
+ struct stat st;
if (!text || !text->name) return 0;
@@ -242,7 +254,7 @@ int reopen_text(Text *text)
text->undo_len= TXT_INIT_UNDO;
text->undo_buf= MEM_mallocN(text->undo_len, "undo buf");
- text->flags= TXT_ISDIRTY | TXT_ISTMP;
+ text->flags= TXT_ISTMP;
fseek(fp, 0L, SEEK_END);
len= ftell(fp);
@@ -256,6 +268,9 @@ int reopen_text(Text *text)
len = fread(buffer, 1, len, fp);
fclose(fp);
+
+ res= stat(str, &st);
+ text->mtime= st.st_mtime;
text->nlines=0;
i=0;
@@ -264,7 +279,7 @@ int reopen_text(Text *text)
if (buffer[i]=='\n') {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
- tmp->format= (char*) MEM_mallocN(llen+2, "Syntax_format");
+ tmp->format= NULL;
if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
tmp->line[llen]=0;
@@ -284,7 +299,7 @@ int reopen_text(Text *text)
if (llen!=0 || text->nlines==0) {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
- tmp->format= (char*) MEM_mallocN(llen+2, "Syntax_format");
+ tmp->format= NULL;
if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
@@ -307,12 +322,13 @@ int reopen_text(Text *text)
Text *add_text(char *file)
{
FILE *fp;
- int i, llen, len;
+ int i, llen, len, res;
unsigned char *buffer;
TextLine *tmp;
Text *ta;
char sfile[FILE_MAXFILE];
char str[FILE_MAXDIR+FILE_MAXFILE];
+ struct stat st;
BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE);
if (G.scene) /* can be NULL (bg mode) */
@@ -326,6 +342,7 @@ Text *add_text(char *file)
ta->id.us= 1;
ta->lines.first= ta->lines.last= NULL;
+ ta->markers.first= ta->markers.last= NULL;
ta->curl= ta->sell= NULL;
/* ta->flags= TXT_ISTMP | TXT_ISEXT; */
@@ -348,6 +365,9 @@ Text *add_text(char *file)
len = fread(buffer, 1, len, fp);
fclose(fp);
+
+ res= stat(str, &st);
+ ta->mtime= st.st_mtime;
ta->nlines=0;
i=0;
@@ -356,7 +376,7 @@ Text *add_text(char *file)
if (buffer[i]=='\n') {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
- tmp->format= (char*) MEM_mallocN(llen+2, "Syntax_format");
+ tmp->format= NULL;
if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
tmp->line[llen]=0;
@@ -376,7 +396,7 @@ Text *add_text(char *file)
if (llen!=0 || ta->nlines==0) {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= (char*) MEM_mallocN(llen+1, "textline_string");
- tmp->format= (char*) MEM_mallocN(llen+2, "Syntax_format");
+ tmp->format= NULL;
if(llen) memcpy(tmp->line, &buffer[i-llen], llen);
@@ -410,6 +430,7 @@ Text *copy_text(Text *ta)
tan->flags = ta->flags | TXT_ISDIRTY | TXT_ISTMP;
tan->lines.first= tan->lines.last= NULL;
+ tan->markers.first= tan->markers.last= NULL;
tan->curl= tan->sell= NULL;
tan->nlines= ta->nlines;
@@ -419,7 +440,7 @@ Text *copy_text(Text *ta)
while (line) {
tmp= (TextLine*) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= MEM_mallocN(line->len+1, "textline_string");
- tmp->format= MEM_mallocN(line->len+2, "Syntax_format");
+ tmp->format= NULL;
strcpy(tmp->line, line->line);
@@ -440,14 +461,14 @@ Text *copy_text(Text *ta)
/* Editing utility functions */
/*****************************/
-static void make_new_line (TextLine *line, char *newline, char *newformat)
+static void make_new_line (TextLine *line, char *newline)
{
if (line->line) MEM_freeN(line->line);
if (line->format) MEM_freeN(line->format);
line->line= newline;
line->len= strlen(newline);
- line->format= newformat;
+ line->format= NULL;
}
static TextLine *txt_new_line(char *str)
@@ -458,7 +479,7 @@ static TextLine *txt_new_line(char *str)
tmp= (TextLine *) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= MEM_mallocN(strlen(str)+1, "textline_string");
- tmp->format= MEM_mallocN(strlen(str)+2, "Syntax_format");
+ tmp->format= NULL;
strcpy(tmp->line, str);
@@ -476,7 +497,7 @@ static TextLine *txt_new_linen(char *str, int n)
tmp= (TextLine *) MEM_mallocN(sizeof(TextLine), "textline");
tmp->line= MEM_mallocN(n+1, "textline_string");
- tmp->format= MEM_mallocN(n+2, "Syntax_format");
+ tmp->format= NULL;
BLI_strncpy(tmp->line, str, n+1);
@@ -553,6 +574,19 @@ static void txt_make_dirty (Text *text)
if (text->compiled) BPY_free_compiled_text(text);
}
+/* 0:whitespace, 1:punct, 2:alphanumeric */
+static short txt_char_type (char ch)
+{
+ if (ch <= ' ') return 0;
+ if (ch <= '/') return 1;
+ if (ch <= '9') return 2;
+ if (ch <= '@') return 1;
+ if (ch <= 'Z') return 2;
+ if (ch <= '`') return 1;
+ if (ch <= 'z') return 2;
+ return 1;
+}
+
/****************************/
/* Cursor utility functions */
/****************************/
@@ -606,8 +640,7 @@ void txt_move_up(Text *text, short sel)
if(!undoing) txt_undo_add_op(text, sel?UNDO_SUP:UNDO_CUP);
}
} else {
- *charp= 0;
- if(!undoing) txt_undo_add_op(text, sel?UNDO_SUP:UNDO_CUP);
+ txt_move_bol(text, sel);
}
if(!sel) txt_pop_sel(text);
@@ -632,8 +665,7 @@ void txt_move_down(Text *text, short sel)
} else
if(!undoing) txt_undo_add_op(text, sel?UNDO_SDOWN:UNDO_CDOWN);
} else {
- *charp= (*linep)->len;
- if(!undoing) txt_undo_add_op(text, sel?UNDO_SDOWN:UNDO_CDOWN);
+ txt_move_eol(text, sel);
}
if(!sel) txt_pop_sel(text);
@@ -689,6 +721,68 @@ void txt_move_right(Text *text, short sel)
if(!sel) txt_pop_sel(text);
}
+void txt_jump_left(Text *text, short sel)
+{
+ TextLine **linep, *oldl;
+ int *charp, oldc, count, i;
+ unsigned char oldu;
+
+ if (!text) return;
+ if(sel) txt_curs_sel(text, &linep, &charp);
+ else { txt_pop_first(text); txt_curs_cur(text, &linep, &charp); }
+ if (!*linep) return;
+
+ oldl= *linep;
+ oldc= *charp;
+ oldu= undoing;
+ undoing= 1; /* Don't push individual moves to undo stack */
+
+ count= 0;
+ for (i=0; i<3; i++) {
+ if (count < 2) {
+ while (*charp>0 && txt_char_type((*linep)->line[*charp-1])==i) {
+ txt_move_left(text, sel);
+ count++;
+ }
+ }
+ }
+ if (count==0) txt_move_left(text, sel);
+
+ undoing= oldu;
+ if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, oldl), oldc, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+}
+
+void txt_jump_right(Text *text, short sel)
+{
+ TextLine **linep, *oldl;
+ int *charp, oldc, count, i;
+ unsigned char oldu;
+
+ if (!text) return;
+ if(sel) txt_curs_sel(text, &linep, &charp);
+ else { txt_pop_last(text); txt_curs_cur(text, &linep, &charp); }
+ if (!*linep) return;
+
+ oldl= *linep;
+ oldc= *charp;
+ oldu= undoing;
+ undoing= 1; /* Don't push individual moves to undo stack */
+
+ count= 0;
+ for (i=0; i<3; i++) {
+ if (count < 2) {
+ while (*charp<(*linep)->len && txt_char_type((*linep)->line[*charp])==i) {
+ txt_move_right(text, sel);
+ count++;
+ }
+ }
+ }
+ if (count==0) txt_move_right(text, sel);
+
+ undoing= oldu;
+ if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, oldl), oldc, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+}
+
void txt_move_bol (Text *text, short sel)
{
TextLine **linep;
@@ -761,6 +855,11 @@ void txt_move_eof (Text *text, short sel)
void txt_move_toline (Text *text, unsigned int line, short sel)
{
+ txt_move_to(text, line, 0, sel);
+}
+
+void txt_move_to (Text *text, unsigned int line, unsigned int ch, short sel)
+{
TextLine **linep, *oldl;
int *charp, oldc;
unsigned int i;
@@ -777,10 +876,12 @@ void txt_move_toline (Text *text, unsigned int line, short sel)
if ((*linep)->next) *linep= (*linep)->next;
else break;
}
- *charp= 0;
+ if (ch>(*linep)->len)
+ ch= (*linep)->len;
+ *charp= ch;
if(!sel) txt_pop_sel(text);
- if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, oldl), oldc, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
+ if(!undoing) txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, txt_get_span(text->lines.first, oldl), oldc, txt_get_span(text->lines.first, *linep), (unsigned short)*charp);
}
/****************************/
@@ -865,7 +966,9 @@ int txt_has_sel(Text *text)
static void txt_delete_sel (Text *text)
{
TextLine *tmpl;
- char *buf, *format;
+ TextMarker *mrk;
+ char *buf;
+ int move, lineno;
if (!text) return;
if (!text->curl) return;
@@ -882,13 +985,33 @@ static void txt_delete_sel (Text *text)
}
buf= MEM_mallocN(text->curc+(text->sell->len - text->selc)+1, "textline_string");
- format= MEM_mallocN(text->curc+(text->sell->len - text->selc)+2, "Syntax_format");
+ if (text->curl != text->sell) {
+ txt_clear_marker_region(text, text->curl, text->curc, text->curl->len, 0, 0);
+ move= txt_get_span(text->curl, text->sell);
+ } else {
+ mrk= txt_find_marker_region(text, text->curl, text->curc, text->selc, 0, 0);
+ if (mrk && (mrk->start > text->curc || mrk->end < text->selc))
+ txt_clear_marker_region(text, text->curl, text->curc, text->selc, 0, 0);
+ move= 0;
+ }
+
+ mrk= txt_find_marker_region(text, text->sell, text->selc-1, text->sell->len, 0, 0);
+ if (mrk) {
+ lineno= mrk->lineno;
+ do {
+ mrk->lineno -= move;
+ if (mrk->start > text->curc) mrk->start -= text->selc - text->curc;
+ mrk->end -= text->selc - text->curc;
+ mrk= mrk->next;
+ } while (mrk && mrk->lineno==lineno);
+ }
+
strncpy(buf, text->curl->line, text->curc);
strcpy(buf+text->curc, text->sell->line + text->selc);
buf[text->curc+(text->sell->len - text->selc)]=0;
- make_new_line(text->curl, buf, format);
+ make_new_line(text->curl, buf);
tmpl= text->sell;
while (tmpl != text->curl) {
@@ -995,22 +1118,31 @@ char *txt_to_buf (Text *text)
return buf;
}
-int txt_find_string(Text *text, char *findstr)
+int txt_find_string(Text *text, char *findstr, int wrap)
{
TextLine *tl, *startl;
char *s= NULL;
+ int oldcl, oldsl, oldcc, oldsc;
if (!text || !text->curl || !text->sell) return 0;
txt_order_cursors(text);
+ oldcl= txt_get_span(text->lines.first, text->curl);
+ oldsl= txt_get_span(text->lines.first, text->sell);
tl= startl= text->sell;
+ oldcc= text->curc;
+ oldsc= text->selc;
s= strstr(&tl->line[text->selc], findstr);
while (!s) {
tl= tl->next;
- if (!tl)
- tl= text->lines.first;
+ if (!tl) {
+ if (wrap)
+ tl= text->lines.first;
+ else
+ break;
+ }
s= strstr(tl->line, findstr);
if (tl==startl)
@@ -1018,10 +1150,10 @@ int txt_find_string(Text *text, char *findstr)
}
if (s) {
- text->curl= text->sell= tl;
- text->curc= (int) (s-tl->line);
- text->selc= text->curc + strlen(findstr);
-
+ int newl= txt_get_span(text->lines.first, tl);
+ int newc= (int)(s-tl->line);
+ txt_move_to(text, newl, newc, 0);
+ txt_move_to(text, newl, newc + strlen(findstr), 1);
return 1;
} else
return 0;
@@ -1621,7 +1753,6 @@ void txt_do_undo(Text *text)
case UNDO_SWAP:
txt_curs_swap(text);
- txt_do_undo(text); /* swaps should appear transparent */
break;
case UNDO_DBLOCK:
@@ -1736,6 +1867,19 @@ void txt_do_undo(Text *text)
break;
}
+
+ /* next undo step may need evaluating */
+ if (text->undo_pos>=0) {
+ switch (text->undo_buf[text->undo_pos]) {
+ case UNDO_STO:
+ txt_do_undo(text);
+ txt_do_redo(text); /* selections need restoring */
+ break;
+ case UNDO_SWAP:
+ txt_do_undo(text); /* swaps should appear transparent */
+ break;
+ }
+ }
undoing= 0;
}
@@ -1810,7 +1954,7 @@ void txt_do_redo(Text *text)
case UNDO_SWAP:
txt_curs_swap(text);
- txt_do_undo(text); /* swaps should appear transparent a*/
+ txt_do_redo(text); /* swaps should appear transparent a*/
break;
case UNDO_CTO:
@@ -1947,22 +2091,37 @@ void txt_do_redo(Text *text)
void txt_split_curline (Text *text)
{
TextLine *ins;
- char *left, *right, *fleft, *fright;
+ TextMarker *mrk;
+ char *left, *right;
+ int lineno= -1;
if (!text) return;
if (!text->curl) return;
- txt_delete_sel(text);
+ txt_delete_sel(text);
+
+ /* Move markers */
+
+ lineno= txt_get_span(text->lines.first, text->curl);
+ mrk= text->markers.first;
+ while (mrk) {
+ if (mrk->lineno==lineno && mrk->start>text->curc) {
+ mrk->lineno++;
+ mrk->start -= text->curc;
+ mrk->end -= text->curc;
+ } else if (mrk->lineno > lineno) {
+ mrk->lineno++;
+ }
+ mrk= mrk->next;
+ }
/* Make the two half strings */
left= MEM_mallocN(text->curc+1, "textline_string");
- fleft= MEM_mallocN(text->curc+2, "Syntax_format");
if (text->curc) memcpy(left, text->curl->line, text->curc);
left[text->curc]=0;
right= MEM_mallocN(text->curl->len - text->curc+1, "textline_string");
- fright= MEM_mallocN(text->curl->len - text->curc+2, "Syntax_format");
if (text->curl->len - text->curc) memcpy(right, text->curl->line+text->curc, text->curl->len-text->curc);
right[text->curl->len - text->curc]=0;
@@ -1973,11 +2132,11 @@ void txt_split_curline (Text *text)
ins= MEM_mallocN(sizeof(TextLine), "textline");
ins->line= left;
- ins->format= fleft;
+ ins->format= NULL;
ins->len= text->curc;
text->curl->line= right;
- text->curl->format= fright;
+ text->curl->format= NULL;
text->curl->len= text->curl->len - text->curc;
BLI_insertlinkbefore(&text->lines, text->curl, ins);
@@ -1993,9 +2152,23 @@ void txt_split_curline (Text *text)
static void txt_delete_line (Text *text, TextLine *line)
{
+ TextMarker *mrk=NULL, *nxt;
+ int lineno= -1;
+
if (!text) return;
if (!text->curl) return;
+ lineno= txt_get_span(text->lines.first, line);
+ mrk= text->markers.first;
+ while (mrk) {
+ nxt= mrk->next;
+ if (mrk->lineno==lineno)
+ BLI_freelinkN(&text->markers, mrk);
+ else if (mrk->lineno > lineno)
+ mrk->lineno--;
+ mrk= nxt;
+ }
+
BLI_remlink (&text->lines, line);
if (line->line) MEM_freeN(line->line);
@@ -2009,21 +2182,35 @@ static void txt_delete_line (Text *text, TextLine *line)
static void txt_combine_lines (Text *text, TextLine *linea, TextLine *lineb)
{
- char *tmp, *format;
+ char *tmp;
+ TextMarker *mrk= NULL;
+ int lineno=-1;
if (!text) return;
if(!linea || !lineb) return;
+
+ mrk= txt_find_marker_region(text, lineb, 0, lineb->len, 0, 0);
+ if (mrk) {
+ lineno= mrk->lineno;
+ do {
+ mrk->lineno--;
+ mrk->start += linea->len;
+ mrk->end += linea->len;
+ mrk= mrk->next;
+ } while (mrk && mrk->lineno==lineno);
+ }
+ if (lineno==-1) lineno= txt_get_span(text->lines.first, lineb);
+ if (!mrk) mrk= text->markers.first;
tmp= MEM_mallocN(linea->len+lineb->len+1, "textline_string");
- format= MEM_mallocN(linea->len+lineb->len+1, "Syntax_format");
strcpy(tmp, linea->line);
strcat(tmp, lineb->line);
- make_new_line(linea, tmp, format);
+ make_new_line(linea, tmp);
- txt_delete_line(text, lineb);
+ txt_delete_line(text, lineb);
txt_make_dirty(text);
txt_clean_text(text);
@@ -2037,8 +2224,9 @@ void txt_delete_char (Text *text)
if (!text->curl) return;
if (txt_has_sel(text)) { /* deleting a selection */
- txt_delete_sel(text);
- return;
+ txt_delete_sel(text);
+ txt_make_dirty(text);
+ return;
}
else if (text->curc== text->curl->len) { /* Appending two lines */
if (text->curl->next) {
@@ -2047,6 +2235,25 @@ void txt_delete_char (Text *text)
}
} else { /* Just deleting a char */
int i= text->curc;
+
+ TextMarker *mrk= txt_find_marker_region(text, text->curl, i-1, text->curl->len, 0, 0);
+ if (mrk) {
+ int lineno= mrk->lineno;
+ if (mrk->end==i) {
+ if ((mrk->flags & TMARK_TEMP) && !(mrk->flags & TMARK_EDITALL)) {
+ txt_clear_markers(text, mrk->group, TMARK_TEMP);
+ } else {
+ //TextMarker *nxt= mrk->next;
+ BLI_freelinkN(&text->markers, mrk);
+ }
+ return;
+ }
+ do {
+ if (mrk->start>i) mrk->start--;
+ mrk->end--;
+ mrk= mrk->next;
+ } while (mrk && mrk->lineno==lineno);
+ }
c= text->curl->line[i];
while(i< text->curl->len) {
@@ -2064,6 +2271,12 @@ void txt_delete_char (Text *text)
if(!undoing) txt_undo_add_charop(text, UNDO_DEL, c);
}
+void txt_delete_word (Text *text)
+{
+ txt_jump_right(text, 1);
+ txt_delete_sel(text);
+}
+
void txt_backspace_char (Text *text)
{
char c='\n';
@@ -2072,8 +2285,9 @@ void txt_backspace_char (Text *text)
if (!text->curl) return;
if (txt_has_sel(text)) { /* deleting a selection */
- txt_delete_sel(text);
- return;
+ txt_delete_sel(text);
+ txt_make_dirty(text);
+ return;
}
else if (text->curc==0) { /* Appending two lines */
if (!text->curl->prev) return;
@@ -2083,19 +2297,38 @@ void txt_backspace_char (Text *text)
txt_combine_lines(text, text->curl, text->curl->next);
txt_pop_sel(text);
- }
+ }
else { /* Just backspacing a char */
- int i= text->curc-1;
-
- c= text->curl->line[i];
- while(i< text->curl->len) {
- text->curl->line[i]= text->curl->line[i+1];
- i++;
- }
- text->curl->len--;
- text->curc--;
+ int i= text->curc-1;
+
+ TextMarker *mrk= txt_find_marker_region(text, text->curl, i, text->curl->len, 0, 0);
+ if (mrk) {
+ int lineno= mrk->lineno;
+ if (mrk->start==i+1) {
+ if ((mrk->flags & TMARK_TEMP) && !(mrk->flags & TMARK_EDITALL)) {
+ txt_clear_markers(text, mrk->group, TMARK_TEMP);
+ } else {
+ //TextMarker *nxt= mrk->next;
+ BLI_freelinkN(&text->markers, mrk);
+ }
+ return;
+ }
+ do {
+ if (mrk->start>i) mrk->start--;
+ mrk->end--;
+ mrk= mrk->next;
+ } while (mrk && mrk->lineno==lineno);
+ }
- txt_pop_sel(text);
+ c= text->curl->line[i];
+ while(i< text->curl->len) {
+ text->curl->line[i]= text->curl->line[i+1];
+ i++;
+ }
+ text->curl->len--;
+ text->curc--;
+
+ txt_pop_sel(text);
}
txt_make_dirty(text);
@@ -2104,10 +2337,17 @@ void txt_backspace_char (Text *text)
if(!undoing) txt_undo_add_charop(text, UNDO_BS, c);
}
+void txt_backspace_word (Text *text)
+{
+ txt_jump_left(text, 1);
+ txt_delete_sel(text);
+}
+
int txt_add_char (Text *text, char add)
{
- int len;
- char *tmp, *format;
+ int len, lineno;
+ char *tmp;
+ TextMarker *mrk;
if (!text) return 0;
if (!text->curl) return 0;
@@ -2119,8 +2359,17 @@ int txt_add_char (Text *text, char add)
txt_delete_sel(text);
+ mrk= txt_find_marker_region(text, text->curl, text->curc-1, text->curl->len, 0, 0);
+ if (mrk) {
+ lineno= mrk->lineno;
+ do {
+ if (mrk->start>text->curc) mrk->start++;
+ mrk->end++;
+ mrk= mrk->next;
+ } while (mrk && mrk->lineno==lineno);
+ }
+
tmp= MEM_mallocN(text->curl->len+2, "textline_string");
- format= MEM_mallocN(text->curl->len+4, "Syntax_format");
if(text->curc) memcpy(tmp, text->curl->line, text->curc);
tmp[text->curc]= add;
@@ -2128,7 +2377,7 @@ int txt_add_char (Text *text, char add)
len= text->curl->len - text->curc;
if(len>0) memcpy(tmp+text->curc+1, text->curl->line+text->curc, len);
tmp[text->curl->len+1]=0;
- make_new_line(text->curl, tmp, format);
+ make_new_line(text->curl, tmp);
text->curc++;
@@ -2141,10 +2390,42 @@ int txt_add_char (Text *text, char add)
return 1;
}
+int txt_replace_char (Text *text, char add)
+{
+ char del;
+
+ if (!text) return 0;
+ if (!text->curl) return 0;
+
+ /* If text is selected or we're at the end of the line just use txt_add_char */
+ if (text->curc==text->curl->len || txt_has_sel(text) || add=='\n') {
+ TextMarker *mrk;
+ int i= txt_add_char(text, add);
+ mrk= txt_find_marker(text, text->curl, text->curc, 0, 0);
+ if (mrk && mrk->end==text->curc) mrk->end--;
+ return i;
+ }
+
+ del= text->curl->line[text->curc];
+ text->curl->line[text->curc]= (unsigned char) add;
+ text->curc++;
+ txt_pop_sel(text);
+
+ txt_make_dirty(text);
+ txt_clean_text(text);
+
+ /* Should probably create a new op for this */
+ if(!undoing) {
+ txt_undo_add_charop(text, UNDO_DEL, del);
+ txt_undo_add_charop(text, UNDO_INSERT, add);
+ }
+ return 1;
+}
+
void indent(Text *text)
{
int len, num;
- char *tmp, *format;
+ char *tmp;
char add = '\t';
if (!text) return;
@@ -2155,7 +2436,6 @@ void indent(Text *text)
while (TRUE)
{
tmp= MEM_mallocN(text->curl->len+2, "textline_string");
- format= MEM_mallocN(text->curl->len+3, "Syntax_format");
text->curc = 0;
if(text->curc) memcpy(tmp, text->curl->line, text->curc);
@@ -2165,7 +2445,7 @@ void indent(Text *text)
if(len>0) memcpy(tmp+text->curc+1, text->curl->line+text->curc, len);
tmp[text->curl->len+1]=0;
- make_new_line(text->curl, tmp, format);
+ make_new_line(text->curl, tmp);
text->curc++;
@@ -2246,7 +2526,7 @@ void unindent(Text *text)
void comment(Text *text)
{
int len, num;
- char *tmp, *format;
+ char *tmp;
char add = '#';
if (!text) return;
@@ -2257,7 +2537,6 @@ void comment(Text *text)
while (TRUE)
{
tmp= MEM_mallocN(text->curl->len+2, "textline_string");
- format = MEM_mallocN(text->curl->len+3, "Syntax_format");
text->curc = 0;
if(text->curc) memcpy(tmp, text->curl->line, text->curc);
@@ -2267,7 +2546,7 @@ void comment(Text *text)
if(len>0) memcpy(tmp+text->curc+1, text->curl->line+text->curc, len);
tmp[text->curl->len+1]=0;
- make_new_line(text->curl, tmp, format);
+ make_new_line(text->curl, tmp);
text->curc++;
@@ -2398,3 +2677,148 @@ int setcurr_tab (Text *text)
return i;
}
+/*********************************/
+/* Text marker utility functions */
+/*********************************/
+
+static int color_match(TextMarker *a, TextMarker *b) {
+ return (a->color[0]==b->color[0] &&
+ a->color[1]==b->color[1] &&
+ a->color[2]==b->color[2] &&
+ a->color[3]==b->color[3]);
+}
+
+/* Creates and adds a marker to the list maintaining sorted order */
+void txt_add_marker(Text *text, TextLine *line, int start, int end, char color[4], int group, int flags) {
+ TextMarker *tmp, *marker;
+
+ marker= MEM_mallocN(sizeof(TextMarker), "text_marker");
+
+ marker->lineno= txt_get_span(text->lines.first, line);
+ marker->start= MIN2(start, end);
+ marker->end= MAX2(start, end);
+ marker->group= group;
+ marker->flags= flags;
+
+ marker->color[0]= color[0];
+ marker->color[1]= color[1];
+ marker->color[2]= color[2];
+ marker->color[3]= color[3];
+
+ for (tmp=text->markers.last; tmp; tmp=tmp->prev)
+ if (tmp->lineno < marker->lineno || (tmp->lineno==marker->lineno && tmp->start < marker->start))
+ break;
+
+ if (tmp) BLI_insertlinkafter(&text->markers, tmp, marker);
+ else BLI_addhead(&text->markers, marker);
+}
+
+/* Returns the first matching marker on the specified line between two points.
+ If the group or flags fields are non-zero the returned flag must be in the
+ specified group and have at least the specified flags set. */
+TextMarker *txt_find_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags) {
+ TextMarker *marker, *next;
+ int lineno= txt_get_span(text->lines.first, line);
+
+ for (marker=text->markers.first; marker; marker=next) {
+ next= marker->next;
+
+ if (group && marker->group != group) continue;
+ else if ((marker->flags & flags) != flags) continue;
+ else if (marker->lineno < lineno) continue;
+ else if (marker->lineno > lineno) break;
+
+ if ((marker->start==marker->end && start<=marker->start && marker->start<=end) ||
+ (marker->start<end && marker->end>start))
+ return marker;
+ }
+ return NULL;
+}
+
+/* Clears all markers on the specified line between two points. If the group or
+ flags fields are non-zero the returned flag must be in the specified group
+ and have at least the specified flags set. */
+short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags) {
+ TextMarker *marker, *next;
+ int lineno= txt_get_span(text->lines.first, line);
+ short cleared= 0;
+
+ for (marker=text->markers.first; marker; marker=next) {
+ next= marker->next;
+
+ if (group && marker->group != group) continue;
+ else if ((marker->flags & flags) != flags) continue;
+ else if (marker->lineno < lineno) continue;
+ else if (marker->lineno > lineno) break;
+
+ if ((marker->start==marker->end && start<=marker->start && marker->start<=end) ||
+ (marker->start<end && marker->end>start)) {
+ BLI_freelinkN(&text->markers, marker);
+ cleared= 1;
+ }
+ }
+ return cleared;
+}
+
+/* Clears all markers in the specified group (if given) with at least the
+ specified flags set. Useful for clearing temporary markers (group=0,
+ flags=TMARK_TEMP) */
+short txt_clear_markers(Text *text, int group, int flags) {
+ TextMarker *marker, *next;
+ short cleared= 0;
+
+ for (marker=text->markers.first; marker; marker=next) {
+ next= marker->next;
+
+ if ((!group || marker->group==group) &&
+ (marker->flags & flags) == flags) {
+ BLI_freelinkN(&text->markers, marker);
+ cleared= 1;
+ }
+ }
+ return cleared;
+}
+
+/* Finds the marker at the specified line and cursor position with at least the
+ specified flags set in the given group (if non-zero). */
+TextMarker *txt_find_marker(Text *text, TextLine *line, int curs, int group, int flags) {
+ TextMarker *marker;
+ int lineno= txt_get_span(text->lines.first, line);
+
+ for (marker=text->markers.first; marker; marker=marker->next) {
+ if (group && marker->group != group) continue;
+ else if ((marker->flags & flags) != flags) continue;
+ else if (marker->lineno < lineno) continue;
+ else if (marker->lineno > lineno) break;
+
+ if (marker->start <= curs && curs <= marker->end)
+ return marker;
+ }
+ return NULL;
+}
+
+/* Finds the previous marker in the same group. If no other is found, the same
+ marker will be returned */
+TextMarker *txt_prev_marker(Text *text, TextMarker *marker) {
+ TextMarker *tmp= marker;
+ while (tmp) {
+ if (tmp->prev) tmp= tmp->prev;
+ else tmp= text->markers.last;
+ if (tmp->group == marker->group)
+ return tmp;
+ }
+ return NULL; /* Only if marker==NULL */
+}
+
+/* Finds the next marker in the same group. If no other is found, the same
+ marker will be returned */
+TextMarker *txt_next_marker(Text *text, TextMarker *marker) {
+ TextMarker *tmp= marker;
+ while (tmp) {
+ if (tmp->next) tmp= tmp->next;
+ else tmp= text->markers.first;
+ if (tmp->group == marker->group)
+ return tmp;
+ }
+ return NULL; /* Only if marker==NULL */
+}
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 37804bf68ac..bb726887d32 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -53,6 +53,8 @@
#include "DNA_world_types.h"
#include "DNA_brush_types.h"
#include "DNA_node_types.h"
+#include "DNA_color_types.h"
+#include "DNA_scene_types.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -389,6 +391,17 @@ int do_colorband(ColorBand *coba, float in, float out[4])
return 1; /* OK */
}
+void colorband_table_RGBA(ColorBand *coba, float **array, int *size)
+{
+ int a;
+
+ *size = CM_TABLE+1;
+ *array = MEM_callocN(sizeof(float)*(*size)*4, "ColorBand");
+
+ for(a=0; a<*size; a++)
+ do_colorband(coba, (float)a/(float)CM_TABLE, &(*array)[a*4]);
+}
+
/* ******************* TEX ************************ */
void free_texture(Tex *tex)
@@ -544,6 +557,8 @@ Tex *copy_texture(Tex *tex)
if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
else texn->ima= 0;
+ id_us_plus((ID *)texn->ipo);
+
if(texn->plugin) {
texn->plugin= MEM_dupallocN(texn->plugin);
open_plugin_tex(texn->plugin);
@@ -731,7 +746,7 @@ Tex *give_current_texture(Object *ob, int act)
bNode *node;
if(ob==0) return 0;
- if(ob->totcol==0) return 0;
+ if(ob->totcol==0 && !(ob->type==OB_LAMP)) return 0;
if(ob->type==OB_LAMP) {
la=(Lamp *)ob->data;
@@ -775,6 +790,18 @@ Tex *give_current_texture(Object *ob, int act)
return tex;
}
+Tex *give_current_world_texture(void)
+{
+ MTex *mtex = 0;
+ Tex *tex = 0;
+
+ if(!(G.scene->world)) return 0;
+
+ mtex= G.scene->world->mtex[(int)(G.scene->world->texact)];
+ if(mtex) tex= mtex->tex;
+
+ return tex;
+}
/* ------------------------------------------------------------------------- */
@@ -832,3 +859,19 @@ void BKE_free_envmap(EnvMap *env)
}
/* ------------------------------------------------------------------------- */
+int BKE_texture_dependsOnTime(const struct Tex *texture)
+{
+ if(texture->plugin) {
+ // assume all plugins depend on time
+ return 1;
+ } else if( texture->ima &&
+ ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
+ return 1;
+ } else if(texture->ipo) {
+ // assume any ipo means the texture is animated
+ return 1;
+ }
+ return 0;
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index c22b6f79e08..4448231b2b4 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -260,6 +260,7 @@ void Vec2Mulf(float *v1, float f);
void Vec2Addf(float *v, float *v1, float *v2);
void Vec2Subf(float *v, float *v1, float *v2);
void Vec2Copyf(float *v1, float *v2);
+void Vec2Lerpf(float *target, float *a, float *b, float t);
void AxisAngleToQuat(float *q, float *axis, float angle);
void vectoquat(float *vec, short axis, short upflag, float *q);
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h
index e24ccad12fb..c59cd2dab4e 100644
--- a/source/blender/blenlib/BLI_blenlib.h
+++ b/source/blender/blenlib/BLI_blenlib.h
@@ -73,7 +73,6 @@ extern ListBase fillvertbase;
* @attention Defined in scanfill.c
*/
extern ListBase filledgebase;
-extern int totblock;
extern char btempdir[]; /* creator.c temp dir used instead of U.tempdir, set with BLI_where_is_temp( btempdir, 1 ); */
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index d42663e17c7..447f6a2a485 100644
--- a/source/blender/blenlib/BLI_editVert.h
+++ b/source/blender/blenlib/BLI_editVert.h
@@ -38,6 +38,8 @@
#include "DNA_customdata_types.h"
#include "DNA_mesh_types.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
struct DerivedMesh;
struct RetopoPaintData;
@@ -53,7 +55,7 @@ typedef struct EditVert
struct EditEdge *e;
struct EditFace *f;
void *p;
- long l;
+ intptr_t l;
float fp;
} tmp;
float no[3]; /*vertex normal */
@@ -95,7 +97,7 @@ typedef struct EditEdge
struct EditEdge *e;
struct EditFace *f;
void *p;
- long l;
+ intptr_t l;
float fp;
} tmp;
short f1, f2; /* short, f1 is (ab)used in subdiv */
@@ -122,7 +124,7 @@ typedef struct EditFace
struct EditEdge *e;
struct EditFace *f;
void *p;
- long l;
+ intptr_t l;
float fp;
} tmp;
float n[3], cent[3];
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h
index b81ff0ee66f..6d9a17efebf 100644
--- a/source/blender/blenlib/BLI_kdopbvh.h
+++ b/source/blender/blenlib/BLI_kdopbvh.h
@@ -1,5 +1,7 @@
/**
*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -40,6 +42,35 @@ typedef struct BVHTreeOverlap {
int indexB;
} BVHTreeOverlap;
+typedef struct BVHTreeNearest
+{
+ int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */
+ float co[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */
+ float no[3]; /* normal at nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */
+ float dist; /* squared distance to search arround */
+} BVHTreeNearest;
+
+typedef struct BVHTreeRay
+{
+ float origin[3]; /* ray origin */
+ float direction[3]; /* ray direction */
+} BVHTreeRay;
+
+typedef struct BVHTreeRayHit
+{
+ int index; /* index of the tree node (untouched if no hit is found) */
+ float co[3]; /* coordinates of the hit point */
+ float no[3]; /* normal on hit point */
+ float dist; /* distance to the hit point */
+} BVHTreeRayHit;
+
+/* callback must update nearest in case it finds a nearest result */
+typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, BVHTreeNearest *nearest);
+
+/* callback must update hit in case it finds a nearest successful hit */
+typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
+
+
BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis);
void BLI_bvhtree_free(BVHTree *tree);
@@ -56,5 +87,10 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result)
float BLI_bvhtree_getepsilon(BVHTree *tree);
+/* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */
+int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata);
+
+int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+
#endif // BLI_KDOPBVH_H
diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h
index 0e534783c17..266aa347aff 100644
--- a/source/blender/blenlib/BLI_rand.h
+++ b/source/blender/blenlib/BLI_rand.h
@@ -44,6 +44,7 @@ struct RNG* rng_new (unsigned int seed);
void rng_free (struct RNG* rng);
void rng_seed (struct RNG* rng, unsigned int seed);
+void rng_srandom(struct RNG *rng, unsigned int seed);
int rng_getInt (struct RNG* rng);
double rng_getDouble (struct RNG* rng);
float rng_getFloat (struct RNG* rng);
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h
index 11150075bac..3bb63506c95 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -61,6 +61,10 @@
// These definitions are also in arithb for simplicity
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
@@ -116,5 +120,9 @@ int closedir (DIR *dp);
void get_default_root(char *root);
int check_file_chars(char *filename);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __WINSTUFF_H__ */
diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript
index 649d3cb5659..65cebf02f62 100644
--- a/source/blender/blenlib/SConscript
+++ b/source/blender/blenlib/SConscript
@@ -24,4 +24,4 @@ if env['OURPLATFORM'] == 'linux2':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
-env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [85,195], compileflags =cflags )
+env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core', 'intern', 'player'], priority = [85,150,195], compileflags =cflags )
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 227cb8f5e9a..e9271ca3bb5 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -34,6 +34,8 @@
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -256,11 +258,7 @@ int BLI_ghashutil_ptrcmp(void *a, void *b) {
}
unsigned int BLI_ghashutil_inthash(void *ptr) {
-#if defined(_WIN64)
- unsigned __int64 key = (unsigned __int64)ptr;
-#else
- unsigned long key = (unsigned long)ptr;
-#endif
+ uintptr_t key = (uintptr_t)ptr;
key += ~(key << 16);
key ^= (key >> 5);
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index a97b9ca6672..9f82a816147 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -28,8 +28,9 @@
#include "math.h"
#include <stdio.h>
-#include <stdlib.h>
+#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include "MEM_guardedalloc.h"
@@ -42,15 +43,19 @@
#include <omp.h>
#endif
+
+
+#define MAX_TREETYPE 32
+#define DEFAULT_FIND_NEAREST_HEAP_SIZE 1024
+
typedef struct BVHNode
{
- struct BVHNode **children; // max 8 children
- struct BVHNode *parent; // needed for bottom - top update
- float *bv; // Bounding volume of all nodes, max 13 axis
- int index; /* face, edge, vertex index */
- char totnode; // how many nodes are used, used for speedup
- char traversed; // how many nodes already traversed until this level?
- char main_axis;
+ struct BVHNode **children;
+ struct BVHNode *parent; // some user defined traversed need that
+ float *bv; // Bounding volume of all nodes, max 13 axis
+ int index; // face, edge, vertex index
+ char totnode; // how many nodes are used, used for speedup
+ char main_axis; // Axis used to split this node
} BVHNode;
struct BVHTree
@@ -72,8 +77,34 @@ typedef struct BVHOverlapData
BVHTree *tree1, *tree2;
BVHTreeOverlap *overlap;
int i, max_overlap; /* i is number of overlaps */
+ int start_axis, stop_axis;
} BVHOverlapData;
-////////////////////////////////////////
+
+typedef struct BVHNearestData
+{
+ BVHTree *tree;
+ const float *co;
+ BVHTree_NearestPointCallback callback;
+ void *userdata;
+ float proj[13]; //coordinates projection over axis
+ BVHTreeNearest nearest;
+
+} BVHNearestData;
+
+typedef struct BVHRayCastData
+{
+ BVHTree *tree;
+
+ BVHTree_RayCastCallback callback;
+ void *userdata;
+
+
+ BVHTreeRay ray;
+ float ray_dot_axis[13];
+
+ BVHTreeRayHit hit;
+} BVHRayCastData;
+////////////////////////////////////////m
////////////////////////////////////////////////////////////////////////
@@ -90,6 +121,72 @@ static float KDOP_AXES[13][3] =
{0, 1.0, -1.0}
};
+/*
+ * Generic push and pop heap
+ */
+#define PUSH_HEAP_BODY(HEAP_TYPE,PRIORITY,heap,heap_size) \
+{ \
+ HEAP_TYPE element = heap[heap_size-1]; \
+ int child = heap_size-1; \
+ while(child != 0) \
+ { \
+ int parent = (child-1) / 2; \
+ if(PRIORITY(element, heap[parent])) \
+ { \
+ heap[child] = heap[parent]; \
+ child = parent; \
+ } \
+ else break; \
+ } \
+ heap[child] = element; \
+}
+
+#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY,heap,heap_size) \
+{ \
+ HEAP_TYPE element = heap[heap_size-1]; \
+ int parent = 0; \
+ while(parent < (heap_size-1)/2 ) \
+ { \
+ int child2 = (parent+1)*2; \
+ if(PRIORITY(heap[child2-1], heap[child2])) \
+ --child2; \
+ \
+ if(PRIORITY(element, heap[child2])) \
+ break; \
+ \
+ heap[parent] = heap[child2]; \
+ parent = child2; \
+ } \
+ heap[parent] = element; \
+}
+
+int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item)
+{
+ int new_max_size = *max_size * 2;
+ void *new_memblock = NULL;
+
+ if(new_size <= *max_size)
+ return TRUE;
+
+ if(*memblock == local_memblock)
+ {
+ new_memblock = malloc( size_per_item * new_max_size );
+ memcpy( new_memblock, *memblock, size_per_item * *max_size );
+ }
+ else
+ new_memblock = realloc(*memblock, size_per_item * new_max_size );
+
+ if(new_memblock)
+ {
+ *memblock = new_memblock;
+ *max_size = new_max_size;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Introsort
// with permission deriven from the following Java code:
@@ -244,7 +341,7 @@ int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){
int begin = _begin, end = _end, cut;
while(end-begin > 3)
{
- cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis );
+ cut = bvh_partition(a, begin, end, bvh_medianof3(a, begin, (begin+end)/2, end-1, axis), axis );
if(cut <= n)
begin = cut;
else
@@ -255,124 +352,15 @@ int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){
return n;
}
-
//////////////////////////////////////////////////////////////////////////////////////////////////////
-void BLI_bvhtree_free(BVHTree *tree)
-{
- if(tree)
- {
- MEM_freeN(tree->nodes);
- MEM_freeN(tree->nodearray);
- MEM_freeN(tree->nodebv);
- MEM_freeN(tree->nodechild);
- MEM_freeN(tree);
- }
-}
-
-BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
-{
- BVHTree *tree;
- int numbranches=0, i;
-
- // only support up to octree
- if(tree_type > 8)
- return NULL;
-
- tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree");
-
- if(tree)
- {
- tree->epsilon = epsilon;
- tree->tree_type = tree_type;
- tree->axis = axis;
-
- if(axis == 26)
- {
- tree->start_axis = 0;
- tree->stop_axis = 13;
- }
- else if(axis == 18)
- {
- tree->start_axis = 7;
- tree->stop_axis = 13;
- }
- else if(axis == 14)
- {
- tree->start_axis = 0;
- tree->stop_axis = 7;
- }
- else if(axis == 8) // AABB
- {
- tree->start_axis = 0;
- tree->stop_axis = 4;
- }
- else if(axis == 6) // OBB
- {
- tree->start_axis = 0;
- tree->stop_axis = 3;
- }
- else
- {
- MEM_freeN(tree);
- return NULL;
- }
-
-
- // calculate max number of branches, our bvh kdop is "almost perfect"
- for(i = 1; i <= (int)ceil((float)((float)log(maxsize)/(float)log(tree_type))); i++)
- numbranches += (pow(tree_type, i) / tree_type);
-
- tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*(numbranches+maxsize + tree_type), "BVHNodes");
-
- if(!tree->nodes)
- {
- MEM_freeN(tree);
- return NULL;
- }
-
- tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * (numbranches+maxsize + tree_type), "BVHNodeBV");
- if(!tree->nodebv)
- {
- MEM_freeN(tree->nodes);
- MEM_freeN(tree);
- }
-
- tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * (numbranches+maxsize + tree_type), "BVHNodeBV");
- if(!tree->nodechild)
- {
- MEM_freeN(tree->nodebv);
- MEM_freeN(tree->nodes);
- MEM_freeN(tree);
- }
-
- tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)*(numbranches+maxsize + tree_type), "BVHNodeArray");
-
- if(!tree->nodearray)
- {
- MEM_freeN(tree->nodechild);
- MEM_freeN(tree->nodebv);
- MEM_freeN(tree->nodes);
- MEM_freeN(tree);
- return NULL;
- }
-
- //link the dynamic bv and child links
- for(i=0; i< numbranches+maxsize + tree_type; i++)
- {
- tree->nodearray[i].bv = tree->nodebv + i * axis;
- tree->nodearray[i].children = tree->nodechild + i * tree_type;
- }
-
- }
-
- return tree;
-}
-
-
+/*
+ * BVHTree bounding volumes functions
+ */
static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving)
{
float newminmax;
+ float *bv = node->bv;
int i, k;
// don't init boudings for the moving case
@@ -380,8 +368,8 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi
{
for (i = tree->start_axis; i < tree->stop_axis; i++)
{
- node->bv[2*i] = FLT_MAX;
- node->bv[2*i + 1] = -FLT_MAX;
+ bv[2*i] = FLT_MAX;
+ bv[2*i + 1] = -FLT_MAX;
}
}
@@ -391,10 +379,10 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi
for (i = tree->start_axis; i < tree->stop_axis; i++)
{
newminmax = INPR(&co[k * 3], KDOP_AXES[i]);
- if (newminmax < node->bv[2 * i])
- node->bv[2 * i] = newminmax;
- if (newminmax > node->bv[(2 * i) + 1])
- node->bv[(2 * i) + 1] = newminmax;
+ if (newminmax < bv[2 * i])
+ bv[2 * i] = newminmax;
+ if (newminmax > bv[(2 * i) + 1])
+ bv[(2 * i) + 1] = newminmax;
}
}
}
@@ -405,6 +393,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end)
float newmin,newmax;
int i, j;
float *bv = node->bv;
+
for (i = tree->start_axis; i < tree->stop_axis; i++)
{
@@ -426,37 +415,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end)
bv[(2 * i) + 1] = newmax;
}
}
-}
-
-int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints)
-{
- BVHNode *node= NULL;
- int i;
-
- // insert should only possible as long as tree->totbranch is 0
- if(tree->totbranch > 0)
- return 0;
-
- if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes))
- return 0;
-
- // TODO check if have enough nodes in array
-
- node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]);
- tree->totleaf++;
-
- create_kdop_hull(tree, node, co, numpoints, 0);
-
- // inflate the bv with some epsilon
- for (i = tree->start_axis; i < tree->stop_axis; i++)
- {
- node->bv[(2 * i)] -= tree->epsilon; // minimum
- node->bv[(2 * i) + 1] += tree->epsilon; // maximum
- }
- node->index= index;
-
- return 1;
}
// only supports x,y,z axis in the moment
@@ -484,46 +443,76 @@ static char get_largest_axis(float *bv)
}
}
-static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char lastaxis)
+// bottom-up update of bvh node BV
+// join the children on the parent BV
+static void node_join(BVHTree *tree, BVHNode *node)
{
- char laxis;
- int i, tend;
- BVHNode *tnode;
- int slice = (end-start+tree->tree_type-1)/tree->tree_type; //division rounded up
+ int i, j;
- // Determine which axis to split along
- laxis = get_largest_axis(node->bv);
+ for (i = tree->start_axis; i < tree->stop_axis; i++)
+ {
+ node->bv[2*i] = FLT_MAX;
+ node->bv[2*i + 1] = -FLT_MAX;
+ }
- // split nodes along longest axis
- for (i=0; start < end; start += slice, i++) //i counts the current child
- {
- tend = start + slice;
-
- if(tend > end) tend = end;
-
- if(tend-start == 1) // ok, we have 1 left for this node
+ for (i = 0; i < tree->tree_type; i++)
+ {
+ if (node->children[i])
{
- node->children[i] = tree->nodes[start];
- node->children[i]->parent = node;
+ for (j = tree->start_axis; j < tree->stop_axis; j++)
+ {
+ // update minimum
+ if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)])
+ node->bv[(2 * j)] = node->children[i]->bv[(2 * j)];
+
+ // update maximum
+ if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1])
+ node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1];
+ }
}
else
- {
- tnode = node->children[i] = tree->nodes[tree->totleaf + tree->totbranch] = &(tree->nodearray[tree->totbranch + tree->totleaf]);
- tree->totbranch++;
- tnode->parent = node;
-
- if(tend != end)
- partition_nth_element(tree->nodes, start, end, tend, laxis);
- refit_kdop_hull(tree, tnode, start, tend);
- bvh_div_nodes(tree, tnode, start, tend, laxis);
- }
- node->totnode++;
+ break;
}
-
- return;
+}
+
+/*
+ * Debug and information functions
+ */
+static void bvhtree_print_tree(BVHTree *tree, BVHNode *node, int depth)
+{
+ int i;
+ for(i=0; i<depth; i++) printf(" ");
+ printf(" - %d (%ld): ", node->index, node - tree->nodearray);
+ for(i=2*tree->start_axis; i<2*tree->stop_axis; i++)
+ printf("%.3f ", node->bv[i]);
+ printf("\n");
+
+ for(i=0; i<tree->tree_type; i++)
+ if(node->children[i])
+ bvhtree_print_tree(tree, node->children[i], depth+1);
+}
+
+static void bvhtree_info(BVHTree *tree)
+{
+ printf("BVHTree info\n");
+ printf("tree_type = %d, axis = %d, epsilon = %f\n", tree->tree_type, tree->axis, tree->epsilon);
+ printf("nodes = %d, branches = %d, leafs = %d\n", tree->totbranch + tree->totleaf, tree->totbranch, tree->totleaf);
+ printf("Memory per node = %ldbytes\n", sizeof(BVHNode) + sizeof(BVHNode*)*tree->tree_type + sizeof(float)*tree->axis);
+ printf("BV memory = %dbytes\n", MEM_allocN_len(tree->nodebv));
+
+ printf("Total memory = %ldbytes\n", sizeof(BVHTree)
+ + MEM_allocN_len(tree->nodes)
+ + MEM_allocN_len(tree->nodearray)
+ + MEM_allocN_len(tree->nodechild)
+ + MEM_allocN_len(tree->nodebv)
+ );
+
+// bvhtree_print_tree(tree, tree->nodes[tree->totleaf], 0);
}
#if 0
+
+
static void verify_tree(BVHTree *tree)
{
int i, j, check = 0;
@@ -571,29 +560,473 @@ static void verify_tree(BVHTree *tree)
printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf);
}
#endif
+
+//Helper data and structures to build a min-leaf generalized implicit tree
+//This code can be easily reduced (basicly this is only method to calculate pow(k, n) in O(1).. and stuff like that)
+typedef struct BVHBuildHelper
+{
+ int tree_type; //
+ int totleafs; //
+
+ int leafs_per_child [32]; //Min number of leafs that are archievable from a node at depth N
+ int branches_on_level[32]; //Number of nodes at depth N (tree_type^N)
+
+ int remain_leafs; //Number of leafs that are placed on the level that is not 100% filled
+
+} BVHBuildHelper;
+
+static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data)
+{
+ int depth = 0;
+ int remain;
+ int nnodes;
+
+ data->totleafs = tree->totleaf;
+ data->tree_type= tree->tree_type;
+
+ //Calculate the smallest tree_type^n such that tree_type^n >= num_leafs
+ for(
+ data->leafs_per_child[0] = 1;
+ data->leafs_per_child[0] < data->totleafs;
+ data->leafs_per_child[0] *= data->tree_type
+ );
+
+ data->branches_on_level[0] = 1;
+
+ //We could stop the loop first (but I am lazy to find out when)
+ for(depth = 1; depth < 32; depth++)
+ {
+ data->branches_on_level[depth] = data->branches_on_level[depth-1] * data->tree_type;
+ data->leafs_per_child [depth] = data->leafs_per_child [depth-1] / data->tree_type;
+ }
+
+ remain = data->totleafs - data->leafs_per_child[1];
+ nnodes = (remain + data->tree_type - 2) / (data->tree_type - 1);
+ data->remain_leafs = remain + nnodes;
+}
+
+// return the min index of all the leafs archivable with the given branch
+static int implicit_leafs_index(BVHBuildHelper *data, int depth, int child_index)
+{
+ int min_leaf_index = child_index * data->leafs_per_child[depth-1];
+ if(min_leaf_index <= data->remain_leafs)
+ return min_leaf_index;
+ else if(data->leafs_per_child[depth])
+ return data->totleafs - (data->branches_on_level[depth-1] - child_index) * data->leafs_per_child[depth];
+ else
+ return data->remain_leafs;
+}
+
+/**
+ * Generalized implicit tree build
+ *
+ * An implicit tree is a tree where its structure is implied, thus there is no need to store child pointers or indexs.
+ * Its possible to find the position of the child or the parent with simple maths (multiplication and adittion). This type
+ * of tree is for example used on heaps.. where node N has its childs at indexs N*2 and N*2+1.
+ *
+ * Altought in this case the tree type is general.. and not know until runtime.
+ * tree_type stands for the maximum number of childs that a tree node can have.
+ * All tree types >= 2 are supported.
+ *
+ * Advantages of the used trees include:
+ * - No need to store child/parent relations (they are implicit);
+ * - Any node child always has an index greater than the parent;
+ * - Brother nodes are sequencial in memory;
+ *
+ *
+ * Some math relations derived for general implicit trees:
+ *
+ * K = tree_type, ( 2 <= K )
+ * ROOT = 1
+ * N child of node A = A * K + (2 - K) + N, (0 <= N < K)
+ *
+ * Util methods:
+ * TODO...
+ * (looping elements, knowing if its a leaf or not.. etc...)
+ */
+
+// This functions returns the number of branches needed to have the requested number of leafs.
+static int implicit_needed_branches(int tree_type, int leafs)
+{
+ return MAX2(1, (leafs + tree_type - 3) / (tree_type-1) );
+}
+
+/*
+ * This function handles the problem of "sorting" the leafs (along the split_axis).
+ *
+ * It arranges the elements in the given partitions such that:
+ * - any element in partition N is less or equal to any element in partition N+1.
+ * - if all elements are diferent all partition will get the same subset of elements
+ * as if the array was sorted.
+ *
+ * partition P is described as the elements in the range ( nth[P] , nth[P+1] ]
+ *
+ * TODO: This can be optimized a bit by doing a specialized nth_element instead of K nth_elements
+ */
+static void split_leafs(BVHNode **leafs_array, int *nth, int partitions, int split_axis)
+{
+ int i;
+ for(i=0; i < partitions-1; i++)
+ {
+ if(nth[i] >= nth[partitions])
+ break;
+
+ partition_nth_element(leafs_array, nth[i], nth[partitions], nth[i+1], split_axis);
+ }
+}
+
+/*
+ * This functions builds an optimal implicit tree from the given leafs.
+ * Where optimal stands for:
+ * - The resulting tree will have the smallest number of branches;
+ * - At most only one branch will have NULL childs;
+ * - All leafs will be stored at level N or N+1.
+ *
+ * This function creates an implicit tree on branches_array, the leafs are given on the leafs_array.
+ *
+ * The tree is built per depth levels. First branchs at depth 1.. then branches at depth 2.. etc..
+ * The reason is that we can build level N+1 from level N witouth any data dependencies.. thus it allows
+ * to use multithread building.
+ *
+ * To archieve this is necessary to find how much leafs are accessible from a certain branch, BVHBuildHelper
+ * implicit_needed_branches and implicit_leafs_index are auxiliar functions to solve that "optimal-split".
+ */
+static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, BVHNode **leafs_array, int num_leafs)
+{
+ int i;
+
+ const int tree_type = tree->tree_type;
+ const int tree_offset = 2 - tree->tree_type; //this value is 0 (on binary trees) and negative on the others
+ const int num_branches= implicit_needed_branches(tree_type, num_leafs);
+
+ BVHBuildHelper data;
+ int depth;
+
+ // set parent from root node to NULL
+ BVHNode *tmp = branches_array+0;
+ tmp->parent = NULL;
+
+ //Most of bvhtree code relies on 1-leaf trees having at least one branch
+ //We handle that special case here
+ if(num_leafs == 1)
+ {
+ BVHNode *root = branches_array+0;
+ refit_kdop_hull(tree, root, 0, num_leafs);
+ root->main_axis = get_largest_axis(root->bv) / 2;
+ root->totnode = 1;
+ root->children[0] = leafs_array[0];
+ root->children[0]->parent = root;
+ return;
+ }
+
+ branches_array--; //Implicit trees use 1-based indexs
+
+ build_implicit_tree_helper(tree, &data);
+
+ //Loop tree levels (log N) loops
+ for(i=1, depth = 1; i <= num_branches; i = i*tree_type + tree_offset, depth++)
+ {
+ const int first_of_next_level = i*tree_type + tree_offset;
+ const int end_j = MIN2(first_of_next_level, num_branches + 1); //index of last branch on this level
+ int j;
+
+ //Loop all branches on this level
+#pragma omp parallel for private(j) schedule(static)
+ for(j = i; j < end_j; j++)
+ {
+ int k;
+ const int parent_level_index= j-i;
+ BVHNode* parent = branches_array + j;
+ int nth_positions[ MAX_TREETYPE + 1];
+ char split_axis;
+
+ int parent_leafs_begin = implicit_leafs_index(&data, depth, parent_level_index);
+ int parent_leafs_end = implicit_leafs_index(&data, depth, parent_level_index+1);
+
+ //This calculates the bounding box of this branch
+ //and chooses the largest axis as the axis to divide leafs
+ refit_kdop_hull(tree, parent, parent_leafs_begin, parent_leafs_end);
+ split_axis = get_largest_axis(parent->bv);
+
+ //Save split axis (this can be used on raytracing to speedup the query time)
+ parent->main_axis = split_axis / 2;
+
+ //Split the childs along the split_axis, note: its not needed to sort the whole leafs array
+ //Only to assure that the elements are partioned on a way that each child takes the elements
+ //it would take in case the whole array was sorted.
+ //Split_leafs takes care of that "sort" problem.
+ nth_positions[ 0] = parent_leafs_begin;
+ nth_positions[tree_type] = parent_leafs_end;
+ for(k = 1; k < tree_type; k++)
+ {
+ int child_index = j * tree_type + tree_offset + k;
+ int child_level_index = child_index - first_of_next_level; //child level index
+ nth_positions[k] = implicit_leafs_index(&data, depth+1, child_level_index);
+ }
+
+ split_leafs(leafs_array, nth_positions, tree_type, split_axis);
+
+
+ //Setup children and totnode counters
+ //Not really needed but currently most of BVH code relies on having an explicit children structure
+ for(k = 0; k < tree_type; k++)
+ {
+ int child_index = j * tree_type + tree_offset + k;
+ int child_level_index = child_index - first_of_next_level; //child level index
+
+ int child_leafs_begin = implicit_leafs_index(&data, depth+1, child_level_index);
+ int child_leafs_end = implicit_leafs_index(&data, depth+1, child_level_index+1);
+
+ if(child_leafs_end - child_leafs_begin > 1)
+ {
+ parent->children[k] = branches_array + child_index;
+ parent->children[k]->parent = parent;
+ }
+ else if(child_leafs_end - child_leafs_begin == 1)
+ {
+ parent->children[k] = leafs_array[ child_leafs_begin ];
+ parent->children[k]->parent = parent;
+ }
+ else
+ break;
+
+ parent->totnode = k+1;
+ }
+ }
+ }
+}
+
+
+/*
+ * BLI_bvhtree api
+ */
+BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
+{
+ BVHTree *tree;
+ int numnodes, i;
+
+ // theres not support for trees below binary-trees :P
+ if(tree_type < 2)
+ return NULL;
+ if(tree_type > MAX_TREETYPE)
+ return NULL;
+
+ tree = (BVHTree *)MEM_callocN(sizeof(BVHTree), "BVHTree");
+
+ //tree epsilon must be >= FLT_EPSILON
+ //so that tangent rays can still hit a bounding volume..
+ //this bug would show up when casting a ray aligned with a kdop-axis and with an edge of 2 faces
+ epsilon = MAX2(FLT_EPSILON, epsilon);
+
+ if(tree)
+ {
+ tree->epsilon = epsilon;
+ tree->tree_type = tree_type;
+ tree->axis = axis;
+
+ if(axis == 26)
+ {
+ tree->start_axis = 0;
+ tree->stop_axis = 13;
+ }
+ else if(axis == 18)
+ {
+ tree->start_axis = 7;
+ tree->stop_axis = 13;
+ }
+ else if(axis == 14)
+ {
+ tree->start_axis = 0;
+ tree->stop_axis = 7;
+ }
+ else if(axis == 8) // AABB
+ {
+ tree->start_axis = 0;
+ tree->stop_axis = 4;
+ }
+ else if(axis == 6) // OBB
+ {
+ tree->start_axis = 0;
+ tree->stop_axis = 3;
+ }
+ else
+ {
+ MEM_freeN(tree);
+ return NULL;
+ }
+
+
+ //Allocate arrays
+ numnodes = maxsize + implicit_needed_branches(tree_type, maxsize) + tree_type;
+
+ tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*numnodes, "BVHNodes");
+
+ if(!tree->nodes)
+ {
+ MEM_freeN(tree);
+ return NULL;
+ }
+
+ tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * numnodes, "BVHNodeBV");
+ if(!tree->nodebv)
+ {
+ MEM_freeN(tree->nodes);
+ MEM_freeN(tree);
+ }
+
+ tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * tree_type * numnodes, "BVHNodeBV");
+ if(!tree->nodechild)
+ {
+ MEM_freeN(tree->nodebv);
+ MEM_freeN(tree->nodes);
+ MEM_freeN(tree);
+ }
+
+ tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* numnodes, "BVHNodeArray");
+
+ if(!tree->nodearray)
+ {
+ MEM_freeN(tree->nodechild);
+ MEM_freeN(tree->nodebv);
+ MEM_freeN(tree->nodes);
+ MEM_freeN(tree);
+ return NULL;
+ }
+
+ //link the dynamic bv and child links
+ for(i=0; i< numnodes; i++)
+ {
+ tree->nodearray[i].bv = tree->nodebv + i * axis;
+ tree->nodearray[i].children = tree->nodechild + i * tree_type;
+ }
+
+ }
+
+ return tree;
+}
+
+void BLI_bvhtree_free(BVHTree *tree)
+{
+ if(tree)
+ {
+ MEM_freeN(tree->nodes);
+ MEM_freeN(tree->nodearray);
+ MEM_freeN(tree->nodebv);
+ MEM_freeN(tree->nodechild);
+ MEM_freeN(tree);
+ }
+}
+
void BLI_bvhtree_balance(BVHTree *tree)
{
- BVHNode *node;
+ int i;
+
+ BVHNode* branches_array = tree->nodearray + tree->totleaf;
+ BVHNode** leafs_array = tree->nodes;
+
+ //This function should only be called once (some big bug goes here if its being called more than once per tree)
+ assert(tree->totbranch == 0);
+
+ //Build the implicit tree
+ non_recursive_bvh_div_nodes(tree, branches_array, leafs_array, tree->totleaf);
+
+ //current code expects the branches to be linked to the nodes array
+ //we perform that linkage here
+ tree->totbranch = implicit_needed_branches(tree->tree_type, tree->totleaf);
+ for(i = 0; i < tree->totbranch; i++)
+ tree->nodes[tree->totleaf + i] = branches_array + i;
+
+ //bvhtree_info(tree);
+}
+
+int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints)
+{
+ int i;
+ BVHNode *node = NULL;
- if(tree->totleaf == 0)
- return;
+ // insert should only possible as long as tree->totbranch is 0
+ if(tree->totbranch > 0)
+ return 0;
+
+ if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes)))
+ return 0;
+
+ // TODO check if have enough nodes in array
- // create root node
node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]);
- tree->totbranch++;
+ tree->totleaf++;
+
+ create_kdop_hull(tree, node, co, numpoints, 0);
+ node->index= index;
+
+ // inflate the bv with some epsilon
+ for (i = tree->start_axis; i < tree->stop_axis; i++)
+ {
+ node->bv[(2 * i)] -= tree->epsilon; // minimum
+ node->bv[(2 * i) + 1] += tree->epsilon; // maximum
+ }
+
+ return 1;
+}
+
+
+// call before BLI_bvhtree_update_tree()
+int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints)
+{
+ int i;
+ BVHNode *node= NULL;
+
+ // check if index exists
+ if(index > tree->totleaf)
+ return 0;
- // refit root bvh node
- refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf);
- // create + balance tree
- bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0);
+ node = tree->nodearray + index;
+
+ create_kdop_hull(tree, node, co, numpoints, 0);
+
+ if(co_moving)
+ create_kdop_hull(tree, node, co_moving, numpoints, 1);
- // verify_tree(tree);
+ // inflate the bv with some epsilon
+ for (i = tree->start_axis; i < tree->stop_axis; i++)
+ {
+ node->bv[(2 * i)] -= tree->epsilon; // minimum
+ node->bv[(2 * i) + 1] += tree->epsilon; // maximum
+ }
+
+ return 1;
+}
+
+// call BLI_bvhtree_update_node() first for every node/point/triangle
+void BLI_bvhtree_update_tree(BVHTree *tree)
+{
+ //Update bottom=>top
+ //TRICKY: the way we build the tree all the childs have an index greater than the parent
+ //This allows us todo a bottom up update by starting on the biger numbered branch
+
+ BVHNode** root = tree->nodes + tree->totleaf;
+ BVHNode** index = tree->nodes + tree->totleaf + tree->totbranch-1;
+
+ for (; index >= root; index--)
+ node_join(tree, *index);
}
+float BLI_bvhtree_getepsilon(BVHTree *tree)
+{
+ return tree->epsilon;
+}
+
+
+/*
+ * BLI_bvhtree_overlap
+ */
// overlap - is it possbile for 2 bv's to collide ?
-static int tree_overlap(float *bv1, float *bv2, int start_axis, int stop_axis)
+static int tree_overlap(BVHNode *node1, BVHNode *node2, int start_axis, int stop_axis)
{
+ float *bv1 = node1->bv;
+ float *bv2 = node2->bv;
+
float *bv1_end = bv1 + (stop_axis<<1);
bv1 += start_axis<<1;
@@ -613,7 +1046,7 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2)
{
int j;
- if(tree_overlap(node1->bv, node2->bv, MIN2(data->tree1->start_axis, data->tree2->start_axis), MIN2(data->tree1->stop_axis, data->tree2->stop_axis)))
+ if(tree_overlap(node1, node2, data->start_axis, data->stop_axis))
{
// check if node1 is a leaf
if(!node1->totnode)
@@ -675,11 +1108,11 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result)
BVHOverlapData **data;
// check for compatibility of both trees (can't compare 14-DOP with 18-DOP)
- if((tree1->axis != tree2->axis) && ((tree1->axis == 14) || tree2->axis == 14))
+ if((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18))
return 0;
// fast check root nodes for collision before doing big splitting + traversal
- if(!tree_overlap(tree1->nodes[tree1->totleaf]->bv, tree2->nodes[tree2->totleaf]->bv, MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis)))
+ if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis)))
return 0;
data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star");
@@ -694,6 +1127,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result)
data[j]->tree2 = tree2;
data[j]->max_overlap = MAX2(tree1->totleaf, tree2->totleaf);
data[j]->i = 0;
+ data[j]->start_axis = MIN2(tree1->start_axis, tree2->start_axis);
+ data[j]->stop_axis = MIN2(tree1->stop_axis, tree2->stop_axis );
}
#pragma omp parallel for private(j) schedule(static)
@@ -725,88 +1160,366 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result)
}
-// bottom up update of bvh tree:
-// join the 4 children here
-static void node_join(BVHTree *tree, BVHNode *node)
+/*
+ * Nearest neighbour - BLI_bvhtree_find_nearest
+ */
+static float squared_dist(const float *a, const float *b)
{
- int i, j;
-
- for (i = tree->start_axis; i < tree->stop_axis; i++)
+ float tmp[3];
+ VECSUB(tmp, a, b);
+ return INPR(tmp, tmp);
+}
+
+//Determines the nearest point of the given node BV. Returns the squared distance to that point.
+static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest)
+{
+ int i;
+ const float *bv = node->bv;
+
+ //nearest on AABB hull
+ for(i=0; i != 3; i++, bv += 2)
{
- node->bv[2*i] = FLT_MAX;
- node->bv[2*i + 1] = -FLT_MAX;
+ if(bv[0] > data->proj[i])
+ nearest[i] = bv[0];
+ else if(bv[1] < data->proj[i])
+ nearest[i] = bv[1];
+ else
+ nearest[i] = data->proj[i];
}
-
- for (i = 0; i < tree->tree_type; i++)
+
+/*
+ //nearest on a general hull
+ VECCOPY(nearest, data->co);
+ for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2)
{
- if (node->children[i])
+ float proj = INPR( nearest, KDOP_AXES[i]);
+ float dl = bv[0] - proj;
+ float du = bv[1] - proj;
+
+ if(dl > 0)
{
- for (j = tree->start_axis; j < tree->stop_axis; j++)
+ VECADDFAC(nearest, nearest, KDOP_AXES[i], dl);
+ }
+ else if(du < 0)
+ {
+ VECADDFAC(nearest, nearest, KDOP_AXES[i], du);
+ }
+ }
+*/
+ return squared_dist(data->co, nearest);
+}
+
+
+typedef struct NodeDistance
+{
+ BVHNode *node;
+ float dist;
+
+} NodeDistance;
+
+#define NodeDistance_priority(a,b) ( (a).dist < (b).dist )
+
+// TODO: use a priority queue to reduce the number of nodes looked on
+static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
+{
+ if(node->totnode == 0)
+ {
+ if(data->callback)
+ data->callback(data->userdata , node->index, data->co, &data->nearest);
+ else
+ {
+ data->nearest.index = node->index;
+ data->nearest.dist = calc_nearest_point(data, node, data->nearest.co);
+ }
+ }
+ else
+ {
+ //Better heuristic to pick the closest node to dive on
+ int i;
+ float nearest[3];
+
+ if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1])
+ {
+
+ for(i=0; i != node->totnode; i++)
{
- // update minimum
- if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)])
- node->bv[(2 * j)] = node->children[i]->bv[(2 * j)];
-
- // update maximum
- if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1])
- node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1];
+ if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
+ dfs_find_nearest_dfs(data, node->children[i]);
}
}
else
- break;
+ {
+ for(i=node->totnode-1; i >= 0 ; i--)
+ {
+ if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
+ dfs_find_nearest_dfs(data, node->children[i]);
+ }
+ }
}
}
-// call before BLI_bvhtree_update_tree()
-int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints)
+static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
{
- BVHNode *node= NULL;
- int i = 0;
-
- // check if index exists
- if(index > tree->totleaf)
- return 0;
-
- node = tree->nodearray + index;
-
- create_kdop_hull(tree, node, co, numpoints, 0);
-
- if(co_moving)
- create_kdop_hull(tree, node, co_moving, numpoints, 1);
-
- // inflate the bv with some epsilon
- for (i = tree->start_axis; i < tree->stop_axis; i++)
+ float nearest[3], sdist;
+ sdist = calc_nearest_point(data, node, nearest);
+ if(sdist >= data->nearest.dist) return;
+ dfs_find_nearest_dfs(data, node);
+}
+
+
+static void NodeDistance_push_heap(NodeDistance *heap, int heap_size)
+PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size)
+
+static void NodeDistance_pop_heap(NodeDistance *heap, int heap_size)
+POP_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size)
+
+//NN function that uses an heap.. this functions leads to an optimal number of min-distance
+//but for normal tri-faces and BV 6-dop.. a simple dfs with local heuristics (as implemented
+//in source/blender/blenkernel/intern/shrinkwrap.c) works faster.
+//
+//It may make sense to use this function if the callback queries are very slow.. or if its impossible
+//to get a nice heuristic
+//
+//this function uses "malloc/free" instead of the MEM_* because it intends to be openmp safe
+static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
+{
+ int i;
+ NodeDistance default_heap[DEFAULT_FIND_NEAREST_HEAP_SIZE];
+ NodeDistance *heap=default_heap, current;
+ int heap_size = 0, max_heap_size = sizeof(default_heap)/sizeof(default_heap[0]);
+ float nearest[3];
+
+ int callbacks = 0, push_heaps = 0;
+
+ if(node->totnode == 0)
{
- node->bv[(2 * i)] -= tree->epsilon; // minimum
- node->bv[(2 * i) + 1] += tree->epsilon; // maximum
+ dfs_find_nearest_dfs(data, node);
+ return;
}
-
- return 1;
+
+ current.node = node;
+ current.dist = calc_nearest_point(data, node, nearest);
+
+ while(current.dist < data->nearest.dist)
+ {
+// printf("%f : %f\n", current.dist, data->nearest.dist);
+ for(i=0; i< current.node->totnode; i++)
+ {
+ BVHNode *child = current.node->children[i];
+ if(child->totnode == 0)
+ {
+ callbacks++;
+ dfs_find_nearest_dfs(data, child);
+ }
+ else
+ {
+ //adjust heap size
+ if(heap_size >= max_heap_size
+ && ADJUST_MEMORY(default_heap, (void**)&heap, heap_size+1, &max_heap_size, sizeof(heap[0])) == FALSE)
+ {
+ printf("WARNING: bvh_find_nearest got out of memory\n");
+
+ if(heap != default_heap)
+ free(heap);
+
+ return;
+ }
+
+ heap[heap_size].node = current.node->children[i];
+ heap[heap_size].dist = calc_nearest_point(data, current.node->children[i], nearest);
+
+ if(heap[heap_size].dist >= data->nearest.dist) continue;
+ heap_size++;
+
+ NodeDistance_push_heap(heap, heap_size);
+ // PUSH_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size);
+ push_heaps++;
+ }
+ }
+
+ if(heap_size == 0) break;
+
+ current = heap[0];
+ NodeDistance_pop_heap(heap, heap_size);
+// POP_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size);
+ heap_size--;
+ }
+
+// printf("hsize=%d, callbacks=%d, pushs=%d\n", heap_size, callbacks, push_heaps);
+
+ if(heap != default_heap)
+ free(heap);
}
-// call BLI_bvhtree_update_node() first for every node/point/triangle
-void BLI_bvhtree_update_tree(BVHTree *tree)
+
+int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
{
- BVHNode *leaf, *parent;
-
- // reset tree traversing flag
- for (leaf = tree->nodearray + tree->totleaf; leaf != tree->nodearray + tree->totleaf + tree->totbranch; leaf++)
- leaf->traversed = 0;
+ int i;
+
+ BVHNearestData data;
+ BVHNode* root = tree->nodes[tree->totleaf];
+
+ //init data to search
+ data.tree = tree;
+ data.co = co;
+
+ data.callback = callback;
+ data.userdata = userdata;
+
+ for(i = data.tree->start_axis; i != data.tree->stop_axis; i++)
+ {
+ data.proj[i] = INPR(data.co, KDOP_AXES[i]);
+ }
+
+ if(nearest)
+ {
+ memcpy( &data.nearest , nearest, sizeof(*nearest) );
+ }
+ else
+ {
+ data.nearest.index = -1;
+ data.nearest.dist = FLT_MAX;
+ }
+
+ //dfs search
+ if(root)
+ dfs_find_nearest_begin(&data, root);
+
+ //copy back results
+ if(nearest)
+ {
+ memcpy(nearest, &data.nearest, sizeof(*nearest));
+ }
+
+ return data.nearest.index;
+}
+
+
+/*
+ * Raycast - BLI_bvhtree_ray_cast
+ *
+ * raycast is done by performing a DFS on the BVHTree and saving the closest hit
+ */
+
+//Determines the distance that the ray must travel to hit the bounding volume of the given node
+static float ray_nearest_hit(BVHRayCastData *data, BVHNode *node)
+{
+ int i;
+ const float *bv = node->bv;
+
+ float low = 0, upper = data->hit.dist;
+
+ for(i=0; i != 3; i++, bv += 2)
+ {
+ if(data->ray_dot_axis[i] == 0.0f)
+ {
+ //axis aligned ray
+ if(data->ray.origin[i] < bv[0]
+ || data->ray.origin[i] > bv[1])
+ return FLT_MAX;
+ }
+ else
+ {
+ float ll = (bv[0] - data->ray.origin[i]) / data->ray_dot_axis[i];
+ float lu = (bv[1] - data->ray.origin[i]) / data->ray_dot_axis[i];
+
+ if(data->ray_dot_axis[i] > 0.0f)
+ {
+ if(ll > low) low = ll;
+ if(lu < upper) upper = lu;
+ }
+ else
+ {
+ if(lu > low) low = lu;
+ if(ll < upper) upper = ll;
+ }
- for (leaf = tree->nodearray; leaf != tree->nodearray + tree->totleaf; leaf++)
+ if(low > upper) return FLT_MAX;
+ }
+ }
+ return low;
+}
+
+static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
+{
+ int i;
+
+ //ray-bv is really fast.. and simple tests revealed its worth to test it
+ //before calling the ray-primitive functions
+ float dist = ray_nearest_hit(data, node);
+ if(dist >= data->hit.dist) return;
+
+ if(node->totnode == 0)
{
- for (parent = leaf->parent; parent; parent = parent->parent)
+ if(data->callback)
+ data->callback(data->userdata, node->index, &data->ray, &data->hit);
+ else
{
- parent->traversed++; // we tried to go up in hierarchy
- if (parent->traversed < parent->totnode)
- break; // we do not need to check further
- else
- node_join(tree, parent);
+ data->hit.index = node->index;
+ data->hit.dist = dist;
+ VECADDFAC(data->hit.co, data->ray.origin, data->ray.direction, dist);
+ }
+ }
+ else
+ {
+ //pick loop direction to dive into the tree (based on ray direction and split axis)
+ if(data->ray_dot_axis[ node->main_axis ] > 0.0f)
+ {
+ for(i=0; i != node->totnode; i++)
+ {
+ dfs_raycast(data, node->children[i]);
+ }
+ }
+ else
+ {
+ for(i=node->totnode-1; i >= 0; i--)
+ {
+ dfs_raycast(data, node->children[i]);
+ }
}
}
}
-float BLI_bvhtree_getepsilon(BVHTree *tree)
+int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
{
- return tree->epsilon;
+ int i;
+ BVHRayCastData data;
+ BVHNode * root = tree->nodes[tree->totleaf];
+
+ data.tree = tree;
+
+ data.callback = callback;
+ data.userdata = userdata;
+
+ VECCOPY(data.ray.origin, co);
+ VECCOPY(data.ray.direction, dir);
+
+ Normalize(data.ray.direction);
+
+ for(i=0; i<3; i++)
+ {
+ data.ray_dot_axis[i] = INPR( data.ray.direction, KDOP_AXES[i]);
+
+ if(fabs(data.ray_dot_axis[i]) < FLT_EPSILON)
+ data.ray_dot_axis[i] = 0.0;
+ }
+
+
+ if(hit)
+ memcpy( &data.hit, hit, sizeof(*hit) );
+ else
+ {
+ data.hit.index = -1;
+ data.hit.dist = FLT_MAX;
+ }
+
+ if(root)
+ dfs_raycast(&data, root);
+
+
+ if(hit)
+ memcpy( hit, &data.hit, sizeof(*hit) );
+
+ return data.hit.index;
}
+
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index b7598ec0c4d..50f8ba0fcde 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -2113,6 +2113,14 @@ void VecLerpf(float *target, float *a, float *b, float t)
target[2]= s*a[2] + t*b[2];
}
+void Vec2Lerpf(float *target, float *a, float *b, float t)
+{
+ float s = 1.0f-t;
+
+ target[0]= s*a[0] + t*b[0];
+ target[1]= s*a[1] + t*b[1];
+}
+
void VecMidf(float *v, float *v1, float *v2)
{
v[0]= 0.5f*(v1[0]+ v2[0]);
@@ -2536,11 +2544,6 @@ int IsectPQ2Df(float pt[2], float v1[2], float v2[2], float v3[2], float v4[2])
}
-
- /* copied from Geometry.c - todo - move to arithb.c or some other generic place we can reuse */
-#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
-#define POINT_IN_TRI(p0,p1,p2,p3) ((SIDE_OF_LINE(p1,p2,p0)>=0) && (SIDE_OF_LINE(p2,p3,p0)>=0) && (SIDE_OF_LINE(p3,p1,p0)>=0))
-
/**
*
* @param min
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index acd53e5d516..db7bae8a91d 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -42,6 +42,8 @@
#define TRF 2
#define TLF 4
#define BRF 8
+#define CORNERFLAGS (BLF|TRF|TLF|BRF)
+
#define BL 0
#define TR 1
#define TL 2
@@ -159,7 +161,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
vert->blb = vert->brb = vert->tlb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = 15 &~ TRF;
+ vert->free = CORNERFLAGS &~ TRF;
vert->trb = box;
vert->index = i; i++;
box->v[BL] = vert; vert++;
@@ -167,7 +169,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
vert->trb= vert->brb = vert->tlb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = 15 &~ BLF;
+ vert->free = CORNERFLAGS &~ BLF;
vert->blb = box;
vert->index = i; i++;
box->v[TR] = vert; vert++;
@@ -175,7 +177,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
vert->trb = vert->blb = vert->tlb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = 15 &~ BRF;
+ vert->free = CORNERFLAGS &~ BRF;
vert->brb = box;
vert->index = i; i++;
box->v[TL] = vert; vert++;
@@ -183,7 +185,7 @@ void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height)
vert->trb = vert->blb = vert->brb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
- vert->free = 15 &~ TLF;
+ vert->free = CORNERFLAGS &~ TLF;
vert->tlb = box;
vert->index = i; i++;
box->v[BR] = vert; vert++;
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 96de5e99f4f..2acbbbe6712 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -62,6 +62,8 @@
#include "BKE_utildefines.h"
#include <errno.h>
+#include "BLO_sys_types.h" // for intptr_t support
+
/* implementations: */
char *first_slash(char *string) {
char *ffslash, *fbslash;
@@ -72,7 +74,7 @@ char *first_slash(char *string) {
if (!ffslash) return fbslash;
else if (!fbslash) return ffslash;
- if ((long)ffslash < (long)fbslash) return ffslash;
+ if ((intptr_t)ffslash < (intptr_t)fbslash) return ffslash;
else return fbslash;
}
@@ -85,7 +87,7 @@ char *BLI_last_slash(const char *string) {
if (!lfslash) return lbslash;
else if (!lbslash) return lfslash;
- if ((long)lfslash < (long)lbslash) return lbslash;
+ if ((intptr_t)lfslash < (intptr_t)lbslash) return lbslash;
else return lfslash;
}
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 8b979f9ed23..74f152ac635 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -405,7 +405,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
lcode = charcode;
}
- err = FT_Set_Charmap( face, (FT_CharMap) FT_ENCODING_UNICODE );
+ err = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
return vfd;
}
diff --git a/source/blender/blenlib/intern/psfont.c b/source/blender/blenlib/intern/psfont.c
index 498c87cdef9..216246dcdd7 100644
--- a/source/blender/blenlib/intern/psfont.c
+++ b/source/blender/blenlib/intern/psfont.c
@@ -43,6 +43,8 @@
#include "DNA_packedFile_types.h"
#include "DNA_curve_types.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -54,7 +56,7 @@ typedef struct chardesc {
short llx, lly; /* bounding box */
short urx, ury;
short *data; /* char data */
- long datalen;
+ intptr_t datalen;
} chardesc;
typedef struct objfnt {
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c
index ccc478203fe..c484a307393 100644
--- a/source/blender/blenlib/intern/rand.c
+++ b/source/blender/blenlib/intern/rand.c
@@ -81,6 +81,16 @@ void rng_seed(RNG *rng, unsigned int seed) {
rng->X= (((r_uint64) seed)<<16) | LOWSEED;
}
+void rng_srandom(RNG *rng, unsigned int seed) {
+ extern unsigned char hash[]; // noise.c
+
+ rng_seed(rng, seed + hash[seed & 255]);
+ seed= rng_getInt(rng);
+ rng_seed(rng, seed + hash[seed & 255]);
+ seed= rng_getInt(rng);
+ rng_seed(rng, seed + hash[seed & 255]);
+}
+
int rng_getInt(RNG *rng) {
rng->X= (MULTIPLIER*rng->X + ADDEND)&MASK;
return (int) (rng->X>>17);
@@ -132,13 +142,7 @@ void BLI_srand(unsigned int seed) {
/* using hash table to create better seed */
void BLI_srandom(unsigned int seed) {
- extern unsigned char hash[]; // noise.c
-
- rng_seed(&theBLI_rng, seed + hash[seed & 255]);
- seed= rng_getInt(&theBLI_rng);
- rng_seed(&theBLI_rng, seed + hash[seed & 255]);
- seed= rng_getInt(&theBLI_rng);
- rng_seed(&theBLI_rng, seed + hash[seed & 255]);
+ rng_srandom(&theBLI_rng, seed);
}
int BLI_rand(void) {
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 48ebf770e1b..a31121148e3 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -1970,7 +1970,7 @@ void BLI_timestr(double _time, char *str)
int BLI_int_from_pointer(void *poin)
{
- long lval= (long)poin;
+ intptr_t lval= (intptr_t)poin;
return (int)(lval>>3);
}
@@ -1978,17 +1978,17 @@ int BLI_int_from_pointer(void *poin)
void *BLI_pointer_from_int(int val)
{
static int firsttime= 1;
- static long basevalue= 0;
+ static intptr_t basevalue= 0;
if(firsttime) {
void *poin= malloc(10000);
- basevalue= (long)poin;
+ basevalue= (intptr_t)poin;
basevalue &= ~PMASK;
printf("base: %d pointer %p\n", basevalue, poin); /* debug */
firsttime= 0;
free(poin);
}
- return (void *)(basevalue | (((long)val)<<3));
+ return (void *)(basevalue | (((intptr_t)val)<<3));
}
#else
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h
index a1885894fe3..49155260b31 100644
--- a/source/blender/blenloader/BLO_sys_types.h
+++ b/source/blender/blenloader/BLO_sys_types.h
@@ -43,17 +43,13 @@
#ifdef __cplusplus
extern "C" {
#endif
-
-#ifdef FREE_WINDOWS
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-#endif
#if defined(_WIN32) && !defined(FREE_WINDOWS)
/* The __intXX are built-in types of the visual complier! So we don't
* need to include anything else here. */
+
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
@@ -64,6 +60,24 @@ typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
+#ifndef _INTPTR_T_DEFINED
+#ifdef _WIN64
+typedef __int64 intptr_t;
+#else
+typedef long intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned long uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+
#elif defined(__linux__)
/* Linux-i386, Linux-Alpha, Linux-ppc */
@@ -73,6 +87,10 @@ typedef unsigned __int64 uint64_t;
#include <inttypes.h>
+#elif defined(FREE_WINDOWS)
+
+#include <stdint.h>
+
#else
/* FreeBSD, Irix, Solaris */
@@ -80,6 +98,7 @@ typedef unsigned __int64 uint64_t;
#endif /* ifdef platform for types */
+
#ifdef _WIN32
#define htonl(x) correctByteOrder(x)
#define ntohl(x) correctByteOrder(x)
diff --git a/source/blender/blenloader/intern/genfile.c b/source/blender/blenloader/intern/genfile.c
index 87c859de839..86338ca9e89 100644
--- a/source/blender/blenloader/intern/genfile.c
+++ b/source/blender/blenloader/intern/genfile.c
@@ -58,6 +58,8 @@
#include "genfile.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/* gcc 4.1 on mingw was complaining that __int64 was alredy defined
actually is saw the line below as typedef long long long long...
Anyhow, since its alredy defined, its safe to do an ifndef here- Cambpell*/
@@ -315,7 +317,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
/* in sdna->data the data, now we convert that to something understandable */
{
int *data, *verg;
- long nr;
+ intptr_t nr;
short *sp;
char str[8], *cp;
@@ -351,7 +353,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
cp++;
nr++;
}
- nr= (long)cp; /* prevent BUS error */
+ nr= (intptr_t)cp; /* prevent BUS error */
nr= (nr+3) & ~3;
cp= (char *)nr;
@@ -389,7 +391,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
cp++;
nr++;
}
- nr= (long)cp; /* prevent BUS error */
+ nr= (intptr_t)cp; /* prevent BUS error */
nr= (nr+3) & ~3;
cp= (char *)nr;
@@ -1098,7 +1100,7 @@ int dna_elem_offset(struct SDNA *sdna, char *stype, char *vartype, char *name)
int SDNAnr= dna_findstruct_nr(sdna, stype);
short *spo= sdna->structs[SDNAnr];
char *cp= find_elem(sdna, vartype, name, spo, NULL, NULL);
- return (int)((long)cp);
+ return (int)((intptr_t)cp);
}
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index f56b261efe2..5a75b5c8b11 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -63,6 +63,8 @@
#include "BLO_readblenfile.h"
+#include "BLO_sys_types.h" // needed for intptr_t
+
/**
* IDType stuff, I plan to move this
* out into its own file + prefix, and
@@ -193,7 +195,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
buf[2]= buf[2]?buf[2]:' ';
buf[3]= buf[3]?buf[3]:' ';
- fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long)bhead->len+sizeof(BHead));
+ fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead));
}
}
fprintf(fp, "]\n");
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 090b1d7c6b6..91e17c42da8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1138,6 +1138,8 @@ void blo_make_image_pointer_map(FileData *fd)
Link *ibuf= ima->ibufs.first;
for(; ibuf; ibuf= ibuf->next)
oldnewmap_insert(fd->imamap, ibuf, ibuf, 0);
+ if(ima->gputexture)
+ oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0);
}
for(; sce; sce= sce->id.next) {
if(sce->nodetree) {
@@ -1172,8 +1174,11 @@ void blo_end_image_pointer_map(FileData *fd)
if(NULL==newimaadr(fd, ibuf)) { /* so was restored */
BLI_remlink(&ima->ibufs, ibuf);
ima->bindcode= 0;
+ ima->gputexture= NULL;
}
}
+
+ ima->gputexture= newimaadr(fd, ima->gputexture);
}
for(; sce; sce= sce->id.next) {
if(sce->nodetree) {
@@ -1347,8 +1352,14 @@ void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, void *fd)
prop->data.pointer = newdataadr(fd, prop->data.pointer);
if (switch_endian) {
- for (i=0; i<prop->len; i++) {
- SWITCH_INT(((int*)prop->data.pointer)[i]);
+ if (prop->subtype != IDP_DOUBLE) {
+ for (i=0; i<prop->len; i++) {
+ SWITCH_INT(((int*)prop->data.pointer)[i]);
+ }
+ } else {
+ for (i=0; i<prop->len; i++) {
+ SWITCH_LONGINT(((double*)prop->data.pointer)[i]);
+ }
}
}
}
@@ -1385,6 +1396,24 @@ void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, void *fd)
case IDP_ARRAY:
IDP_DirectLinkArray(prop, switch_endian, fd);
break;
+ case IDP_DOUBLE:
+ /*erg, stupid doubles. since I'm storing them
+ in the same field as int val; val2 in the
+ IDPropertyData struct, they have to deal with
+ endianness specifically
+
+ in theory, val and val2 would've already been swapped
+ if switch_endian is true, so we have to first unswap
+ them then reswap them as a single 64-bit entity.
+ */
+
+ if (switch_endian) {
+ SWITCH_INT(prop->data.val);
+ SWITCH_INT(prop->data.val2);
+ SWITCH_LONGINT(prop->data.val);
+ }
+
+ break;
}
}
@@ -2249,6 +2278,7 @@ static void direct_link_text(FileData *fd, Text *text)
*/
link_list(fd, &text->lines);
+ link_list(fd, &text->markers);
text->curl= newdataadr(fd, text->curl);
text->sell= newdataadr(fd, text->sell);
@@ -2315,8 +2345,10 @@ static void direct_link_image(FileData *fd, Image *ima)
ima->ibufs.first= ima->ibufs.last= NULL;
/* if not restored, we keep the binded opengl index */
- if(ima->ibufs.first==NULL)
+ if(ima->ibufs.first==NULL) {
ima->bindcode= 0;
+ ima->gputexture= NULL;
+ }
ima->anim= NULL;
ima->rr= NULL;
@@ -2527,6 +2559,7 @@ static void direct_link_material(FileData *fd, Material *ma)
direct_link_nodetree(fd, ma->nodetree);
ma->preview = direct_link_preview_image(fd, ma->preview);
+ ma->gpumaterial.first = ma->gpumaterial.last = NULL;
}
/* ************ READ PARTICLE SETTINGS ***************** */
@@ -2558,6 +2591,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
{
part->pd= newdataadr(fd, part->pd);
+ part->pd2= newdataadr(fd, part->pd2);
}
static void lib_link_particlesystems(FileData *fd, ID *id, ListBase *particles)
@@ -2918,11 +2952,9 @@ static void lib_link_object(FileData *fd, Main *main)
sens= ob->sensors.first;
while(sens) {
- if(ob->id.lib==NULL) { // done in expand_main
- for(a=0; a<sens->totlinks; a++) {
- sens->links[a]= newglobadr(fd, sens->links[a]);
- }
- }
+ for(a=0; a<sens->totlinks; a++)
+ sens->links[a]= newglobadr(fd, sens->links[a]);
+
if(sens->type==SENS_TOUCH) {
bTouchSensor *ts= sens->data;
ts->ma= newlibadr(fd, ob->id.lib, ts->ma);
@@ -2937,11 +2969,9 @@ static void lib_link_object(FileData *fd, Main *main)
cont= ob->controllers.first;
while(cont) {
- if(ob->id.lib==NULL) { // done in expand_main
- for(a=0; a<cont->totlinks; a++) {
- cont->links[a]= newglobadr(fd, cont->links[a]);
- }
- }
+ for(a=0; a<cont->totlinks; a++)
+ cont->links[a]= newglobadr(fd, cont->links[a]);
+
if(cont->type==CONT_PYTHON) {
bPythonCont *pc= cont->data;
pc->text= newlibadr(fd, ob->id.lib, pc->text);
@@ -3368,6 +3398,7 @@ static void direct_link_object(FileData *fd, Object *ob)
ob->bb= NULL;
ob->derivedDeform= NULL;
ob->derivedFinal= NULL;
+ ob->gpulamp.first= ob->gpulamp.last= NULL;
}
/* ************ READ SCENE ***************** */
@@ -3569,9 +3600,9 @@ static void direct_link_scene(FileData *fd, Scene *sce)
{
Sequence temp;
char *poin;
- long offset;
+ intptr_t offset;
- offset= ((long)&(temp.seqbase)) - ((long)&temp);
+ offset= ((intptr_t)&(temp.seqbase)) - ((intptr_t)&temp);
/* root pointer */
if(ed->seqbasep == old_seqbasep) {
@@ -4070,7 +4101,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
while(se) {
se->v1= newdataadr(fd, se->v1);
se->v2= newdataadr(fd, se->v2);
- if( (long)se->v1 > (long)se->v2) {
+ if( (intptr_t)se->v1 > (intptr_t)se->v2) {
sv= se->v1;
se->v1= se->v2;
se->v2= sv;
@@ -4142,6 +4173,9 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
sima->cumap= newdataadr(fd, sima->cumap);
if(sima->cumap)
direct_link_curvemapping(fd, sima->cumap);
+ sima->gpd= newdataadr(fd, sima->gpd);
+ if (sima->gpd)
+ link_gpencil(fd, sima->gpd);
sima->iuser.ok= 1;
}
else if(sl->spacetype==SPACE_NODE) {
@@ -4161,15 +4195,6 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
link_gpencil(fd, sseq->gpd);
}
}
- else if(sl->spacetype==SPACE_ACTION) {
- SpaceAction *sact= (SpaceAction *)sl;
-
- /* WARNING: action-editor doesn't have it's own gpencil data!
- * so only adjust pointer, but DON'T LINK
- */
- if (sact->gpd)
- sact->gpd= newdataadr(fd, sact->gpd);
- }
}
sa->v1= newdataadr(fd, sa->v1);
@@ -4855,6 +4880,49 @@ void idproperties_fix_group_lengths(ListBase idlist)
}
}
+void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
+{
+ Material *ma;
+ MFace *mf;
+ MTFace *tf;
+ int a, b, texalpha;
+
+ /* verify we have a tface layer */
+ for(b=0; b<me->fdata.totlayer; b++)
+ if(me->fdata.layers[b].type == CD_MTFACE)
+ break;
+
+ if(b == me->fdata.totlayer)
+ return;
+
+ /* if we do, set alpha sort if the game engine did it before */
+ for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ if(mf->mat_nr < me->totcol) {
+ ma= newlibadr(fd, lib, me->mat[mf->mat_nr]);
+ texalpha = 0;
+
+ for(b=0; ma && b<MAX_MTEX; b++)
+ if(ma->mtex && ma->mtex[b] && ma->mtex[b]->mapto & MAP_ALPHA)
+ texalpha = 1;
+ }
+ else {
+ ma= NULL;
+ texalpha = 0;
+ }
+
+ for(b=0; b<me->fdata.totlayer; b++) {
+ if(me->fdata.layers[b].type == CD_MTFACE) {
+ tf = ((MTFace*)me->fdata.layers[b].data) + a;
+
+ tf->mode &= ~TF_ALPHASORT;
+ if(ma && (ma->mode & MA_ZTRA))
+ if(ELEM(tf->transp, TF_ALPHA, TF_ADD) || (texalpha && (tf->transp != TF_CLIP)))
+ tf->mode |= TF_ALPHASORT;
+ }
+ }
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -7672,35 +7740,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
idproperties_fix_group_lengths(main->brush);
idproperties_fix_group_lengths(main->particle);
}
-
- /* only needed until old bad svn/RC1,2 files are saved with a > 17 version -dg */
- if(main->versionfile == 245 && main->subversionfile < 17) {
- ModifierData *md;
- Object *ob;
-
- for(ob = main->object.first; ob; ob= ob->id.next) {
- for(md=ob->modifiers.first; md; ) {
- if(md->type==eModifierType_Cloth) {
- ModifierData *next;
- MEM_freeN(((ClothModifierData *)md)->sim_parms);
- MEM_freeN(((ClothModifierData *)md)->coll_parms);
- MEM_freeN(((ClothModifierData *)md)->point_cache);
- ((ClothModifierData *)md)->sim_parms = NULL;
- ((ClothModifierData *)md)->coll_parms = NULL;
- ((ClothModifierData *)md)->point_cache = NULL;
- next=md->next;
- BLI_remlink(&ob->modifiers, md);
- md = next;
- }
- else
- md = md->next;
- }
- }
- }
/* sun/sky */
- if ((main->versionfile < 246) ){
+ if(main->versionfile < 246) {
Lamp *la;
+
for(la=main->lamp.first; la; la= la->id.next) {
la->sun_effect_type = 0;
la->horizon_brightness = 1.0;
@@ -7716,6 +7760,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ if(main->versionfile <= 246 && main->subversionfile < 1){
+ Mesh *me;
+
+ for(me=main->mesh.first; me; me= me->id.next)
+ alphasort_version_246(fd, lib, me);
+ }
+
+ if(main->versionfile <= 246 && main->subversionfile < 1){
+ Object *ob;
+ for(ob = main->object.first; ob; ob= ob->id.next) {
+ if(ob->pd && (ob->pd->forcefield == PFIELD_WIND))
+ ob->pd->f_noise = 0.0;
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
@@ -8432,9 +8491,6 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
sens= ob->sensors.first;
while(sens) {
- for(a=0; a<sens->totlinks; a++) {
- sens->links[a]= newglobadr(fd, sens->links[a]);
- }
if(sens->type==SENS_TOUCH) {
bTouchSensor *ts= sens->data;
expand_doit(fd, mainvar, ts->ma);
@@ -8448,9 +8504,6 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
cont= ob->controllers.first;
while(cont) {
- for(a=0; a<cont->totlinks; a++) {
- cont->links[a]= newglobadr(fd, cont->links[a]);
- }
if(cont->type==CONT_PYTHON) {
bPythonCont *pc= cont->data;
expand_doit(fd, mainvar, pc->text);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index b59dd851dfe..44634a7468c 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -533,7 +533,9 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
if(part->id.us>0 || wd->current) {
/* write LibData */
writestruct(wd, ID_PA, "ParticleSettings", 1, part);
+ if (part->id.properties) IDP_WriteProperty(part->id.properties, wd);
writestruct(wd, DATA, "PartDeflect", 1, part->pd);
+ writestruct(wd, DATA, "PartDeflect", 1, part->pd2);
}
part= part->id.next;
}
@@ -607,6 +609,9 @@ static void write_sensors(WriteData *wd, ListBase *lb)
case SENS_ACTUATOR:
writestruct(wd, DATA, "bActuatorSensor", 1, sens->data);
break;
+ case SENS_DELAY:
+ writestruct(wd, DATA, "bDelaySensor", 1, sens->data);
+ break;
case SENS_COLLISION:
writestruct(wd, DATA, "bCollisionSensor", 1, sens->data);
break;
@@ -1693,7 +1698,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
writestruct(wd, DATA, "SpaceImage", 1, sl);
if(sima->cumap)
- write_curvemapping(wd, sima->cumap);
+ write_curvemapping(wd, sima->cumap);
+ if(sima->gpd)
+ write_gpencil(wd, sima->gpd);
}
else if(sl->spacetype==SPACE_IMASEL) {
writestruct(wd, DATA, "SpaceImaSel", 1, sl);
@@ -1844,6 +1851,7 @@ static void write_texts(WriteData *wd, ListBase *idbase)
{
Text *text;
TextLine *tmp;
+ TextMarker *mrk;
text= idbase->first;
while(text) {
@@ -1867,7 +1875,16 @@ static void write_texts(WriteData *wd, ListBase *idbase)
writedata(wd, DATA, tmp->len+1, tmp->line);
tmp= tmp->next;
}
+
+ /* write markers */
+ mrk= text->markers.first;
+ while (mrk) {
+ writestruct(wd, DATA, "TextMarker", 1, mrk);
+ mrk= mrk->next;
+ }
}
+
+
text= text->id.next;
}
@@ -2274,7 +2291,7 @@ static int handle_append_runtime(int handle, char *exename, char **cause_r) {
unsigned char buf[1024];
int count, progfd= -1;
- if (!runtime) {
+ if (!BLI_exists(runtime)) {
cause= "Unable to find runtime";
goto cleanup;
}
diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c
index e65148a0b04..9c08a0b2f9d 100644
--- a/source/blender/blenpluginapi/intern/pluginapi.c
+++ b/source/blender/blenpluginapi/intern/pluginapi.c
@@ -50,10 +50,12 @@
#include "plugin.h"
#include "MEM_guardedalloc.h"
+#include "BLO_sys_types.h" // needed for intptr_t
+
#include "BLI_blenlib.h" /* util and noise functions */
#include "BLI_threads.h" /* For threadsfe guardedalloc malloc/calloc/free */
#include "IMB_imbuf.h" /* image buffer stuff */
-#define GET_INT_FROM_POINTER(i) ((int)(long)(i)) /* should use BKE_utildefines.h */
+#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* should use BKE_utildefines.h */
/* -------------------------------------------------------------------------- */
/* stuff from util.h */
diff --git a/source/blender/freestyle/SConscript b/source/blender/freestyle/SConscript
index 93c931cdbfe..e6631178a3a 100644
--- a/source/blender/freestyle/SConscript
+++ b/source/blender/freestyle/SConscript
@@ -6,7 +6,7 @@ sources = []
defs = []
incs = ''
-incs += '../blenkernel ../blenlib ../imbuf ../makesdna ../python '
+incs += '../blenkernel ../blenloader ../blenlib ../imbuf ../makesdna ../python '
incs += '../render/extern/include ../render/intern/include ../include ../src'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_PNG_INC']
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
new file mode 100644
index 00000000000..4d376f47d91
--- /dev/null
+++ b/source/blender/gpu/CMakeLists.txt
@@ -0,0 +1,34 @@
+# $Id: CMakeLists.txt 14444 2008-04-16 22:40:48Z hos $
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+FILE(GLOB SRC intern/*.c)
+
+SET(INC
+ . ../blenlib ../blenkernel ../makesdna ../include
+ ../../../extern/glew/include ../../../intern/guardedalloc ../imbuf)
+
+BLENDERLIB(bf_gpu "${SRC}" "${INC}")
+
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
new file mode 100644
index 00000000000..2399e7b6a8c
--- /dev/null
+++ b/source/blender/gpu/GPU_draw.h
@@ -0,0 +1,116 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This shader is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This shader is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this shader; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef GPU_GAME_H
+#define GPU_GAME_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct MTFace;
+struct Image;
+struct Scene;
+struct Object;
+
+/* OpenGL drawing functions related to shading. These are also
+ * shared with the game engine, where there were previously
+ * duplicates of some of these functions. */
+
+/* Initialize
+ * - sets the default Blender opengl state, if in doubt, check
+ * the contents of this function
+ * - this is called when starting Blender, for opengl rendering,
+ * and for switching back from the game engine for example. */
+
+void GPU_state_init(void);
+
+/* Material drawing
+ * - first the state is initialized by a particular object and
+ * it's materials
+ * - after this, materials can be quickly enabled by their number,
+ * GPU_enable_material returns 0 if drawing should be skipped
+ * - after drawing, the material must be disabled again */
+
+void GPU_set_object_materials(struct Scene *scene, struct Object *ob,
+ int glsl, int *do_alpha_pass);
+int GPU_enable_material(int nr, void *attribs);
+void GPU_disable_material(void);
+
+void GPU_set_material_blend_mode(int blendmode);
+int GPU_get_material_blend_mode(void);
+
+/* TexFace drawing
+ * - this is mutually exclusive with material drawing, a mesh should
+ * be drawn using one or the other
+ * - passing NULL clears the state again */
+
+int GPU_set_tpage(struct MTFace *tface);
+
+/* Lights
+ * - returns how many lights were enabled
+ * - this affects fixed functions materials and texface, not glsl */
+
+int GPU_default_lights(void);
+int GPU_scene_object_lights(struct Scene *scene, struct Object *ob,
+ int lay, float viewmat[][4]);
+
+/* Text render
+ * - based on moving uv coordinates */
+
+void GPU_render_text(struct MTFace *tface, int mode,
+ const char *textstr, int textlen, unsigned int *col,
+ float *v1, float *v2, float *v3, float *v4, int glattrib);
+
+/* Mipmap settings
+ * - these will free textures on changes */
+
+void GPU_set_mipmap(int mipmap);
+void GPU_set_linear_mipmap(int linear);
+void GPU_paint_set_mipmap(int mipmap);
+
+/* Image updates and free
+ * - these deal with images bound as opengl textures */
+
+void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h);
+void GPU_update_images_framechange(void);
+int GPU_update_image_time(struct Image *ima, double time);
+int GPU_verify_image(struct Image *ima, int tftile, int tfmode, int compare);
+void GPU_free_image(struct Image *ima);
+void GPU_free_images(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
new file mode 100644
index 00000000000..d3faa81ebb1
--- /dev/null
+++ b/source/blender/gpu/GPU_extensions.h
@@ -0,0 +1,144 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This shader is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This shader is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this shader; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef GPU_EXTENSIONS_H
+#define GPU_EXTENSIONS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* GPU extensions support */
+
+struct Image;
+struct ImageUser;
+
+struct GPUTexture;
+typedef struct GPUTexture GPUTexture;
+
+struct GPUFrameBuffer;
+typedef struct GPUFrameBuffer GPUFrameBuffer;
+
+struct GPUShader;
+typedef struct GPUShader GPUShader;
+
+void GPU_extensions_init(void); /* call this before running any of the functions below */
+void GPU_extensions_exit(void);
+int GPU_extensions_minimum_support(void);
+int GPU_print_error(char *str);
+
+/* GPU Texture
+ - always returns unsigned char RGBA textures
+ - if texture with non square dimensions is created, depending on the
+ graphics card capabilities the texture may actually be stored in a
+ larger texture with power of two dimensions. the actual dimensions
+ may be querd with GPU_texture_opengl_width/height. GPU_texture_coord_2f
+ calls glTexCoord2f with the coordinates adjust for this.
+ - can use reference counting:
+ - reference counter after GPU_texture_create is 1
+ - GPU_texture_ref increases by one
+ - GPU_texture_free decreases by one, and frees if 0
+ - if created with from_blender, will not free the texture
+*/
+
+GPUTexture *GPU_texture_create_1D(int w, float *pixels);
+GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels);
+GPUTexture *GPU_texture_create_depth(int w, int h);
+GPUTexture *GPU_texture_from_blender(struct Image *ima,
+ struct ImageUser *iuser, double time);
+void GPU_texture_free(GPUTexture *tex);
+
+void GPU_texture_ref(GPUTexture *tex);
+
+void GPU_texture_bind(GPUTexture *tex, int number);
+void GPU_texture_unbind(GPUTexture *tex);
+
+GPUFrameBuffer *GPU_texture_framebuffer(GPUTexture *tex);
+
+int GPU_texture_target(GPUTexture *tex);
+int GPU_texture_opengl_width(GPUTexture *tex);
+int GPU_texture_opengl_height(GPUTexture *tex);
+
+/* GPU Framebuffer
+ - this is a wrapper for an OpenGL framebuffer object (FBO). in practice
+ multiple FBO's may be created, to get around limitations on the number
+ of attached textures and the dimension requirements.
+ - after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
+ be called before rendering to the window framebuffer again */
+
+GPUFrameBuffer *GPU_framebuffer_create();
+int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex);
+void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex);
+void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex);
+void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex);
+void GPU_framebuffer_free(GPUFrameBuffer *fb);
+
+void GPU_framebuffer_restore();
+
+/* GPU Shader
+ - only for fragment shaders now
+ - must call texture bind before setting a texture as uniform! */
+
+GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUShader *lib);
+GPUShader *GPU_shader_create_lib(const char *code);
+void GPU_shader_free(GPUShader *shader);
+
+void GPU_shader_bind(GPUShader *shader);
+void GPU_shader_unbind();
+
+int GPU_shader_get_uniform(GPUShader *shader, char *name);
+void GPU_shader_uniform_vector(GPUShader *shader, int location, int length,
+ int arraysize, float *value);
+void GPU_shader_uniform_texture(GPUShader *shader, int location, GPUTexture *tex);
+
+int GPU_shader_get_attribute(GPUShader *shader, char *name);
+
+/* Vertex attributes for shaders */
+
+#define GPU_MAX_ATTRIB 32
+
+typedef struct GPUVertexAttribs {
+ struct {
+ int type;
+ int glindex;
+ char name[32];
+ } layer[GPU_MAX_ATTRIB];
+
+ int totlayer;
+} GPUVertexAttribs;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
new file mode 100644
index 00000000000..ccc687858f4
--- /dev/null
+++ b/source/blender/gpu/GPU_material.h
@@ -0,0 +1,169 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This shader is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This shader is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this shader; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __GPU_MATERIAL__
+#define __GPU_MATERIAL__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct Image;
+struct ImageUser;
+struct Material;
+struct Object;
+struct Lamp;
+struct bNode;
+struct LinkNode;
+struct Scene;
+struct GPUVertexAttribs;
+struct GPUNode;
+struct GPUNodeLink;
+struct GPUNodeStack;
+struct GPUMaterial;
+struct GPUTexture;
+struct GPULamp;
+
+typedef struct GPUNode GPUNode;
+typedef struct GPUNodeLink GPUNodeLink;
+typedef struct GPUMaterial GPUMaterial;
+typedef struct GPULamp GPULamp;
+
+/* Functions to create GPU Materials nodes */
+
+typedef enum GPUType {
+ GPU_NONE = 0,
+ GPU_FLOAT = 1,
+ GPU_VEC2 = 2,
+ GPU_VEC3 = 3,
+ GPU_VEC4 = 4,
+ GPU_MAT3 = 9,
+ GPU_MAT4 = 16,
+ GPU_TEX1D = 1001,
+ GPU_TEX2D = 1002,
+ GPU_SHADOW2D = 1003,
+ GPU_ATTRIB = 3001
+} GPUType;
+
+typedef enum GPUBuiltin {
+ GPU_VIEW_MATRIX = 1,
+ GPU_OBJECT_MATRIX = 2,
+ GPU_INVERSE_VIEW_MATRIX = 4,
+ GPU_INVERSE_OBJECT_MATRIX = 8,
+ GPU_VIEW_POSITION = 16,
+ GPU_VIEW_NORMAL = 32,
+ GPU_OBCOLOR = 64
+} GPUBuiltin;
+
+typedef enum GPUBlendMode {
+ GPU_BLEND_SOLID = 0,
+ GPU_BLEND_ADD = 1,
+ GPU_BLEND_ALPHA = 2,
+ GPU_BLEND_CLIP = 4
+} GPUBlendMode;
+
+typedef struct GPUNodeStack {
+ GPUType type;
+ char *name;
+ float vec[4];
+ struct GPUNodeLink *link;
+ short hasinput;
+ short hasoutput;
+ short sockettype;
+} GPUNodeStack;
+
+GPUNodeLink *GPU_attribute(int type, char *name);
+GPUNodeLink *GPU_uniform(float *num);
+GPUNodeLink *GPU_dynamic_uniform(float *num);
+GPUNodeLink *GPU_image(struct Image *ima, struct ImageUser *iuser);
+GPUNodeLink *GPU_texture(int size, float *pixels);
+GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex);
+GPUNodeLink *GPU_socket(GPUNodeStack *sock);
+GPUNodeLink *GPU_builtin(GPUBuiltin builtin);
+
+int GPU_link(GPUMaterial *mat, char *name, ...);
+int GPU_stack_link(GPUMaterial *mat, char *name, GPUNodeStack *in, GPUNodeStack *out, ...);
+
+void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link);
+void GPU_material_enable_alpha(GPUMaterial *material);
+GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4]);
+
+/* High level functions to create and use GPU materials */
+
+GPUMaterial *GPU_material_from_blender(struct Scene *scene, struct Material *ma);
+void GPU_material_free(struct Material *ma);
+
+void GPU_materials_free();
+
+void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time);
+void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float viewmat[][4], float viewinv[][4], float obcol[4]);
+void GPU_material_unbind(GPUMaterial *material);
+int GPU_material_bound(GPUMaterial *material);
+
+void GPU_material_vertex_attributes(GPUMaterial *material,
+ struct GPUVertexAttribs *attrib);
+
+/* Exported shading */
+
+typedef struct GPUShadeInput {
+ GPUMaterial *gpumat;
+ struct Material *mat;
+
+ GPUNodeLink *rgb, *specrgb, *vn, *view, *vcol, *ref;
+ GPUNodeLink *alpha, *refl, *spec, *emit, *har, *amb;
+} GPUShadeInput;
+
+typedef struct GPUShadeResult {
+ GPUNodeLink *diff, *spec, *combined, *alpha;
+} GPUShadeResult;
+
+void GPU_shadeinput_set(GPUMaterial *mat, struct Material *ma, GPUShadeInput *shi);
+void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr);
+
+/* Lamps */
+
+GPULamp *GPU_lamp_from_blender(struct Scene *scene, struct Object *ob, struct Object *par);
+void GPU_lamp_free(struct Object *ob);
+
+int GPU_lamp_has_shadow_buffer(GPULamp *lamp);
+void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize, float winmat[][4]);
+void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp);
+
+void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]);
+int GPU_lamp_shadow_layer(GPULamp *lamp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__GPU_MATERIAL__*/
+
diff --git a/source/blender/gpu/Makefile b/source/blender/gpu/Makefile
new file mode 100644
index 00000000000..b9bde147115
--- /dev/null
+++ b/source/blender/gpu/Makefile
@@ -0,0 +1,37 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License. See http://www.blender.org/BL/ for information
+# about this.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+SOURCEDIR = source/blender/gpu
+DIRS = intern
+
+include nan_subdirs.mk
diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript
new file mode 100644
index 00000000000..8ccd4b7b24c
--- /dev/null
+++ b/source/blender/gpu/SConscript
@@ -0,0 +1,11 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('intern/*.c')
+
+incs = '../blenlib ../blenkernel ../makesdna ../include'
+incs += ' #/extern/glew/include #intern/guardedalloc ../imbuf .'
+
+incs += ' ' + env['BF_OPENGL_INC']
+
+env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core', 'player'], priority=[65, 20] )
diff --git a/source/blender/gpu/intern/Makefile b/source/blender/gpu/intern/Makefile
new file mode 100644
index 00000000000..733ee3f764c
--- /dev/null
+++ b/source/blender/gpu/intern/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License. See http://www.blender.org/BL/ for information
+# about this.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+#
+
+LIBNAME = gpu
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+ifeq ($(OS),$(findstring $(OS), "beos darwin freebsd linux openbsd solaris windows"))
+ CFLAGS += -funsigned-char
+endif
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I../
+
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
new file mode 100644
index 00000000000..00efe6e1572
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -0,0 +1,1441 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "GL/glew.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_customdata_types.h"
+#include "DNA_image_types.h"
+#include "DNA_listBase.h"
+#include "DNA_material_types.h"
+
+#include "BLI_dynstr.h"
+#include "BLI_blenlib.h"
+#include "BLI_ghash.h"
+#include "BLI_heap.h"
+
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "GPU_material.h"
+#include "GPU_extensions.h"
+
+#include "BLO_sys_types.h" // for intptr_t support
+
+#include "gpu_codegen.h"
+
+#include <string.h>
+#include <stdarg.h>
+
+#ifdef _WIN32
+#ifndef vsnprintf
+#define vsnprintf _vsnprintf
+#endif
+#ifndef snprintf
+#define snprintf _snprintf
+#endif
+#endif
+
+extern char datatoc_gpu_shader_material_glsl[];
+extern char datatoc_gpu_shader_vertex_glsl[];
+
+/* structs and defines */
+
+typedef enum GPUDataSource {
+ GPU_SOURCE_VEC_UNIFORM,
+ GPU_SOURCE_BUILTIN,
+ GPU_SOURCE_TEX_PIXEL,
+ GPU_SOURCE_TEX,
+ GPU_SOURCE_ATTRIB
+} GPUDataSource;
+
+static char* GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4",
+ 0, 0, 0, 0, "mat3", 0, 0, 0, 0, 0, 0, "mat4"};
+
+struct GPUNode {
+ struct GPUNode *next, *prev;
+
+ char *name;
+ int tag;
+
+ ListBase inputs;
+ ListBase outputs;
+};
+
+struct GPUNodeLink {
+ GPUNodeStack *socket;
+
+ int attribtype;
+ char *attribname;
+
+ int image;
+
+ int texture;
+ int texturesize;
+
+ void *ptr1, *ptr2;
+
+ int dynamic;
+
+ int type;
+ int users;
+
+ GPUTexture *dynamictex;
+
+ GPUBuiltin builtin;
+
+ struct GPUOutput *output;
+};
+
+typedef struct GPUOutput {
+ struct GPUOutput *next, *prev;
+
+ GPUNode *node;
+ int type; /* data type = length of vector/matrix */
+ GPUNodeLink *link; /* output link */
+ int id; /* unique id as created by code generator */
+} GPUOutput;
+
+typedef struct GPUInput {
+ struct GPUInput *next, *prev;
+
+ GPUNode *node;
+
+ int type; /* datatype */
+ int source; /* data source */
+
+ int id; /* unique id as created by code generator */
+ int texid; /* number for multitexture */
+ int attribid; /* id for vertex attributes */
+ int bindtex; /* input is responsible for binding the texture? */
+ int definetex; /* input is responsible for defining the pixel? */
+ int textarget; /* GL_TEXTURE_* */
+ int textype; /* datatype */
+
+ struct Image *ima; /* image */
+ struct ImageUser *iuser;/* image user */
+ float *dynamicvec; /* vector data in case it is dynamic */
+ GPUTexture *tex; /* input texture, only set at runtime */
+ int shaderloc; /* id from opengl */
+ char shadername[32]; /* name in shader */
+
+ float vec[16]; /* vector data */
+ GPUNodeLink *link;
+ int dynamictex; /* dynamic? */
+ int attribtype; /* attribute type */
+ char attribname[32]; /* attribute name */
+ int attribfirst; /* this is the first one that is bound */
+ GPUBuiltin builtin; /* builtin uniform */
+} GPUInput;
+
+struct GPUPass {
+ struct GPUPass *next, *prev;
+
+ ListBase inputs;
+ struct GPUOutput *output;
+ struct GPUShader *shader;
+};
+
+/* Strings utility */
+
+static void BLI_dynstr_printf(DynStr *dynstr, const char *format, ...)
+{
+ va_list args;
+ int retval;
+ char str[2048];
+
+ va_start(args, format);
+ retval = vsnprintf(str, sizeof(str), format, args);
+ va_end(args);
+
+ if (retval >= sizeof(str))
+ fprintf(stderr, "BLI_dynstr_printf: limit exceeded\n");
+ else
+ BLI_dynstr_append(dynstr, str);
+}
+
+/* GLSL code parsing for finding function definitions.
+ * These are stored in a hash for lookup when creating a material. */
+
+static GHash *FUNCTION_HASH= NULL;
+static char *FUNCTION_PROTOTYPES= NULL;
+static GPUShader *FUNCTION_LIB= NULL;
+
+static int gpu_str_prefix(char *str, char *prefix)
+{
+ while(*str && *prefix) {
+ if(*str != *prefix)
+ return 0;
+
+ str++;
+ prefix++;
+ }
+
+ return (*prefix == '\0');
+}
+
+static char *gpu_str_skip_token(char *str, char *token, int max)
+{
+ int len = 0;
+
+ /* skip a variable/function name */
+ while(*str) {
+ if(ELEM6(*str, ' ', '(', ')', ',', '\t', '\n'))
+ break;
+ else {
+ if(token && len < max-1) {
+ *token= *str;
+ token++;
+ len++;
+ }
+ str++;
+ }
+ }
+
+ if(token)
+ *token= '\0';
+
+ /* skip the next special characters:
+ * note the missing ')' */
+ while(*str) {
+ if(ELEM5(*str, ' ', '(', ',', '\t', '\n'))
+ str++;
+ else
+ break;
+ }
+
+ return str;
+}
+
+static void gpu_parse_functions_string(GHash *hash, char *code)
+{
+ GPUFunction *function;
+ int i, type, qual;
+
+ while((code = strstr(code, "void "))) {
+ function = MEM_callocN(sizeof(GPUFunction), "GPUFunction");
+
+ code = gpu_str_skip_token(code, NULL, 0);
+ code = gpu_str_skip_token(code, function->name, MAX_FUNCTION_NAME);
+
+ /* get parameters */
+ while(*code && *code != ')') {
+ /* test if it's an input or output */
+ qual = FUNCTION_QUAL_IN;
+ if(gpu_str_prefix(code, "out "))
+ qual = FUNCTION_QUAL_OUT;
+ if(gpu_str_prefix(code, "inout "))
+ qual = FUNCTION_QUAL_INOUT;
+ if((qual != FUNCTION_QUAL_IN) || gpu_str_prefix(code, "in "))
+ code = gpu_str_skip_token(code, NULL, 0);
+
+ /* test for type */
+ type= 0;
+ for(i=1; i<=16; i++) {
+ if(GPU_DATATYPE_STR[i] && gpu_str_prefix(code, GPU_DATATYPE_STR[i])) {
+ type= i;
+ break;
+ }
+ }
+
+ if(!type && gpu_str_prefix(code, "sampler2DShadow"))
+ type= GPU_SHADOW2D;
+ if(!type && gpu_str_prefix(code, "sampler1D"))
+ type= GPU_TEX1D;
+ if(!type && gpu_str_prefix(code, "sampler2D"))
+ type= GPU_TEX2D;
+
+ if(type) {
+ /* add paramater */
+ code = gpu_str_skip_token(code, NULL, 0);
+ code = gpu_str_skip_token(code, NULL, 0);
+ function->paramqual[function->totparam]= qual;
+ function->paramtype[function->totparam]= type;
+ function->totparam++;
+ }
+ else {
+ fprintf(stderr, "GPU invalid function parameter in %s.\n", function->name);
+ break;
+ }
+ }
+
+ if(strlen(function->name) == 0 || function->totparam == 0) {
+ fprintf(stderr, "GPU functions parse error.\n");
+ MEM_freeN(function);
+ break;
+ }
+
+ BLI_ghash_insert(hash, function->name, function);
+ }
+}
+
+static char *gpu_generate_function_prototyps(GHash *hash)
+{
+ DynStr *ds = BLI_dynstr_new();
+ GHashIterator *ghi;
+ GPUFunction *function;
+ char *name, *prototypes;
+ int a;
+
+ /* automatically generate function prototypes to add to the top of the
+ * generated code, to avoid have to add the actual code & recompile all */
+ ghi = BLI_ghashIterator_new(hash);
+
+ for(; !BLI_ghashIterator_isDone(ghi); BLI_ghashIterator_step(ghi)) {
+ name = BLI_ghashIterator_getValue(ghi);
+ function = BLI_ghashIterator_getValue(ghi);
+
+ BLI_dynstr_printf(ds, "void %s(", name);
+ for(a=0; a<function->totparam; a++) {
+ if(function->paramqual[a] == FUNCTION_QUAL_OUT)
+ BLI_dynstr_append(ds, "out ");
+ else if(function->paramqual[a] == FUNCTION_QUAL_INOUT)
+ BLI_dynstr_append(ds, "inout ");
+
+ if(function->paramtype[a] == GPU_TEX1D)
+ BLI_dynstr_append(ds, "sampler1D");
+ else if(function->paramtype[a] == GPU_TEX2D)
+ BLI_dynstr_append(ds, "sampler2D");
+ else if(function->paramtype[a] == GPU_SHADOW2D)
+ BLI_dynstr_append(ds, "sampler2DShadow");
+ else
+ BLI_dynstr_append(ds, GPU_DATATYPE_STR[function->paramtype[a]]);
+
+ BLI_dynstr_printf(ds, " param%d", a);
+
+ if(a != function->totparam-1)
+ BLI_dynstr_append(ds, ", ");
+ }
+ BLI_dynstr_append(ds, ");\n");
+ }
+
+ BLI_dynstr_append(ds, "\n");
+
+ prototypes = BLI_dynstr_get_cstring(ds);
+ BLI_dynstr_free(ds);
+
+ return prototypes;
+}
+
+GPUFunction *GPU_lookup_function(char *name)
+{
+ if(!FUNCTION_HASH) {
+ FUNCTION_HASH = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp);
+ gpu_parse_functions_string(FUNCTION_HASH, datatoc_gpu_shader_material_glsl);
+ FUNCTION_PROTOTYPES = gpu_generate_function_prototyps(FUNCTION_HASH);
+ FUNCTION_LIB = GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);
+ }
+
+ return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, name);
+}
+
+void GPU_extensions_exit(void)
+{
+ extern Material defmaterial; // render module abuse...
+
+ if(defmaterial.gpumaterial.first)
+ GPU_material_free(&defmaterial);
+
+ if(FUNCTION_HASH) {
+ BLI_ghash_free(FUNCTION_HASH, NULL, (GHashValFreeFP)MEM_freeN);
+ FUNCTION_HASH = NULL;
+ }
+ if(FUNCTION_PROTOTYPES) {
+ MEM_freeN(FUNCTION_PROTOTYPES);
+ FUNCTION_PROTOTYPES = NULL;
+ }
+ if(FUNCTION_LIB) {
+ GPU_shader_free(FUNCTION_LIB);
+ FUNCTION_LIB = NULL;
+ }
+}
+
+/* GLSL code generation */
+
+static void codegen_convert_datatype(DynStr *ds, int from, int to, char *tmp, int id)
+{
+ char name[1024];
+
+ snprintf(name, sizeof(name), "%s%d", tmp, id);
+
+ if (from == to) {
+ BLI_dynstr_append(ds, name);
+ }
+ else if (to == GPU_FLOAT) {
+ if (from == GPU_VEC4)
+ BLI_dynstr_printf(ds, "dot(%s.rgb, vec3(0.35, 0.45, 0.2))", name);
+ else if (from == GPU_VEC3)
+ BLI_dynstr_printf(ds, "dot(%s, vec3(0.33))", name);
+ else if (from == GPU_VEC2)
+ BLI_dynstr_printf(ds, "%s.r", name);
+ }
+ else if (to == GPU_VEC2) {
+ if (from == GPU_VEC4)
+ BLI_dynstr_printf(ds, "vec2(dot(%s.rgb, vec3(0.35, 0.45, 0.2)), %s.a)", name, name);
+ else if (from == GPU_VEC3)
+ BLI_dynstr_printf(ds, "vec2(dot(%s.rgb, vec3(0.33)), 1.0)", name);
+ else if (from == GPU_FLOAT)
+ BLI_dynstr_printf(ds, "vec2(%s, 1.0)", name);
+ }
+ else if (to == GPU_VEC3) {
+ if (from == GPU_VEC4)
+ BLI_dynstr_printf(ds, "%s.rgb", name);
+ else if (from == GPU_VEC2)
+ BLI_dynstr_printf(ds, "vec3(%s.r, %s.r, %s.r)", name, name, name);
+ else if (from == GPU_FLOAT)
+ BLI_dynstr_printf(ds, "vec3(%s, %s, %s)", name, name, name);
+ }
+ else {
+ if (from == GPU_VEC3)
+ BLI_dynstr_printf(ds, "vec4(%s, 1.0)", name);
+ else if (from == GPU_VEC2)
+ BLI_dynstr_printf(ds, "vec4(%s.r, %s.r, %s.r, %s.g)", name, name, name, name);
+ else if (from == GPU_FLOAT)
+ BLI_dynstr_printf(ds, "vec4(%s, %s, %s, 1.0)", name, name, name);
+ }
+}
+
+static void codegen_print_datatype(DynStr *ds, int type, float *data)
+{
+ int i;
+
+ BLI_dynstr_printf(ds, "%s(", GPU_DATATYPE_STR[type]);
+
+ for(i=0; i<type; i++) {
+ BLI_dynstr_printf(ds, "%f", data[i]);
+ if(i == type-1)
+ BLI_dynstr_append(ds, ")");
+ else
+ BLI_dynstr_append(ds, ", ");
+ }
+}
+
+static int codegen_input_has_texture(GPUInput *input)
+{
+ if (input->link)
+ return 0;
+ else if(input->ima)
+ return 1;
+ else
+ return input->tex != 0;
+}
+
+char *GPU_builtin_name(GPUBuiltin builtin)
+{
+ if(builtin == GPU_VIEW_MATRIX)
+ return "unfviewmat";
+ else if(builtin == GPU_OBJECT_MATRIX)
+ return "unfobmat";
+ else if(builtin == GPU_INVERSE_VIEW_MATRIX)
+ return "unfinvviewmat";
+ else if(builtin == GPU_INVERSE_OBJECT_MATRIX)
+ return "unfinvobmat";
+ else if(builtin == GPU_VIEW_POSITION)
+ return "varposition";
+ else if(builtin == GPU_VIEW_NORMAL)
+ return "varnormal";
+ else if(builtin == GPU_OBCOLOR)
+ return "unfobcolor";
+ else
+ return "";
+}
+
+static void codegen_set_unique_ids(ListBase *nodes)
+{
+ GHash *bindhash, *definehash;
+ GPUNode *node;
+ GPUInput *input;
+ GPUOutput *output;
+ int id = 1, texid = 0;
+
+ bindhash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
+ definehash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
+
+ for (node=nodes->first; node; node=node->next) {
+ for (input=node->inputs.first; input; input=input->next) {
+ /* set id for unique names of uniform variables */
+ input->id = id++;
+ input->bindtex = 0;
+ input->definetex = 0;
+
+ /* set texid used for settings texture slot with multitexture */
+ if (codegen_input_has_texture(input) &&
+ ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) {
+ if (input->link) {
+ /* input is texture from buffer, assign only one texid per
+ buffer to avoid sampling the same texture twice */
+ if (!BLI_ghash_haskey(bindhash, input->link)) {
+ input->texid = texid++;
+ input->bindtex = 1;
+ BLI_ghash_insert(bindhash, input->link, SET_INT_IN_POINTER(input->texid));
+ }
+ else
+ input->texid = GET_INT_FROM_POINTER(BLI_ghash_lookup(bindhash, input->link));
+ }
+ else if(input->ima) {
+ /* input is texture from image, assign only one texid per
+ buffer to avoid sampling the same texture twice */
+ if (!BLI_ghash_haskey(bindhash, input->ima)) {
+ input->texid = texid++;
+ input->bindtex = 1;
+ BLI_ghash_insert(bindhash, input->ima, SET_INT_IN_POINTER(input->texid));
+ }
+ else
+ input->texid = GET_INT_FROM_POINTER(BLI_ghash_lookup(bindhash, input->ima));
+ }
+ else {
+ /* input is user created texture, we know there there is
+ only one, so assign new texid */
+ input->bindtex = 1;
+ input->texid = texid++;
+ }
+
+ /* make sure this pixel is defined exactly once */
+ if (input->source == GPU_SOURCE_TEX_PIXEL) {
+ if(input->ima) {
+ if (!BLI_ghash_haskey(definehash, input->ima)) {
+ input->definetex = 1;
+ BLI_ghash_insert(definehash, input->ima, SET_INT_IN_POINTER(input->texid));
+ }
+ }
+ else {
+ if (!BLI_ghash_haskey(definehash, input->link)) {
+ input->definetex = 1;
+ BLI_ghash_insert(definehash, input->link, SET_INT_IN_POINTER(input->texid));
+ }
+ }
+ }
+ }
+ }
+
+ for (output=node->outputs.first; output; output=output->next)
+ /* set id for unique names of tmp variables storing output */
+ output->id = id++;
+ }
+
+ BLI_ghash_free(bindhash, NULL, NULL);
+ BLI_ghash_free(definehash, NULL, NULL);
+}
+
+static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes)
+{
+ GPUNode *node;
+ GPUInput *input;
+ char *name;
+ int builtins = 0;
+
+ /* print uniforms */
+ for (node=nodes->first; node; node=node->next) {
+ for (input=node->inputs.first; input; input=input->next) {
+ if ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL)) {
+ /* create exactly one sampler for each texture */
+ if (codegen_input_has_texture(input) && input->bindtex)
+ BLI_dynstr_printf(ds, "uniform %s samp%d;\n",
+ (input->textype == GPU_TEX1D)? "sampler1D":
+ (input->textype == GPU_TEX2D)? "sampler2D": "sampler2DShadow",
+ input->texid);
+ }
+ else if(input->source == GPU_SOURCE_BUILTIN) {
+ /* only define each builting uniform/varying once */
+ if(!(builtins & input->builtin)) {
+ builtins |= input->builtin;
+ name = GPU_builtin_name(input->builtin);
+
+ if(gpu_str_prefix(name, "unf")) {
+ BLI_dynstr_printf(ds, "uniform %s %s;\n",
+ GPU_DATATYPE_STR[input->type], name);
+ }
+ else {
+ BLI_dynstr_printf(ds, "varying %s %s;\n",
+ GPU_DATATYPE_STR[input->type], name);
+ }
+ }
+ }
+ else if (input->source == GPU_SOURCE_VEC_UNIFORM) {
+ if(input->dynamicvec) {
+ /* only create uniforms for dynamic vectors */
+ BLI_dynstr_printf(ds, "uniform %s unf%d;\n",
+ GPU_DATATYPE_STR[input->type], input->id);
+ }
+ else {
+ /* for others use const so the compiler can do folding */
+ BLI_dynstr_printf(ds, "const %s cons%d = ",
+ GPU_DATATYPE_STR[input->type], input->id);
+ codegen_print_datatype(ds, input->type, input->vec);
+ BLI_dynstr_append(ds, ";\n");
+ }
+ }
+ else if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
+ BLI_dynstr_printf(ds, "varying %s var%d;\n",
+ GPU_DATATYPE_STR[input->type], input->attribid);
+ }
+ }
+ }
+
+ BLI_dynstr_append(ds, "\n");
+}
+
+static void codegen_declare_tmps(DynStr *ds, ListBase *nodes)
+{
+ GPUNode *node;
+ GPUInput *input;
+ GPUOutput *output;
+
+ for (node=nodes->first; node; node=node->next) {
+ /* load pixels from textures */
+ for (input=node->inputs.first; input; input=input->next) {
+ if (input->source == GPU_SOURCE_TEX_PIXEL) {
+ if (codegen_input_has_texture(input) && input->definetex) {
+ BLI_dynstr_printf(ds, "\tvec4 tex%d = texture2D(", input->texid);
+ BLI_dynstr_printf(ds, "samp%d, gl_TexCoord[%d].st);\n",
+ input->texid, input->texid);
+ }
+ }
+ }
+
+ /* declare temporary variables for node output storage */
+ for (output=node->outputs.first; output; output=output->next)
+ BLI_dynstr_printf(ds, "\t%s tmp%d;\n",
+ GPU_DATATYPE_STR[output->type], output->id);
+ }
+
+ BLI_dynstr_append(ds, "\n");
+}
+
+static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *finaloutput)
+{
+ GPUNode *node;
+ GPUInput *input;
+ GPUOutput *output;
+
+ for (node=nodes->first; node; node=node->next) {
+ BLI_dynstr_printf(ds, "\t%s(", node->name);
+
+ for (input=node->inputs.first; input; input=input->next) {
+ if (input->source == GPU_SOURCE_TEX) {
+ BLI_dynstr_printf(ds, "samp%d", input->texid);
+ if (input->link)
+ BLI_dynstr_printf(ds, ", gl_TexCoord[%d].st", input->texid);
+ }
+ else if (input->source == GPU_SOURCE_TEX_PIXEL) {
+ if (input->link && input->link->output)
+ codegen_convert_datatype(ds, input->link->output->type, input->type,
+ "tmp", input->link->output->id);
+ else
+ codegen_convert_datatype(ds, input->link->output->type, input->type,
+ "tex", input->texid);
+ }
+ else if(input->source == GPU_SOURCE_BUILTIN)
+ BLI_dynstr_printf(ds, "%s", GPU_builtin_name(input->builtin));
+ else if(input->source == GPU_SOURCE_VEC_UNIFORM) {
+ if(input->dynamicvec)
+ BLI_dynstr_printf(ds, "unf%d", input->id);
+ else
+ BLI_dynstr_printf(ds, "cons%d", input->id);
+ }
+ else if (input->source == GPU_SOURCE_ATTRIB)
+ BLI_dynstr_printf(ds, "var%d", input->attribid);
+
+ BLI_dynstr_append(ds, ", ");
+ }
+
+ for (output=node->outputs.first; output; output=output->next) {
+ BLI_dynstr_printf(ds, "tmp%d", output->id);
+ if (output->next)
+ BLI_dynstr_append(ds, ", ");
+ }
+
+ BLI_dynstr_append(ds, ");\n");
+ }
+
+ BLI_dynstr_append(ds, "\n\tgl_FragColor = ");
+ codegen_convert_datatype(ds, finaloutput->type, GPU_VEC4, "tmp", finaloutput->id);
+ BLI_dynstr_append(ds, ";\n");
+}
+
+static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const char *name)
+{
+ DynStr *ds = BLI_dynstr_new();
+ char *code;
+
+ BLI_dynstr_append(ds, FUNCTION_PROTOTYPES);
+
+ codegen_set_unique_ids(nodes);
+ codegen_print_uniforms_functions(ds, nodes);
+
+ //if(G.f & G_DEBUG)
+ // BLI_dynstr_printf(ds, "/* %s */\n", name);
+
+ BLI_dynstr_append(ds, "void main(void)\n");
+ BLI_dynstr_append(ds, "{\n");
+
+ codegen_declare_tmps(ds, nodes);
+ codegen_call_functions(ds, nodes, output);
+
+ BLI_dynstr_append(ds, "}\n");
+
+ /* create shader */
+ code = BLI_dynstr_get_cstring(ds);
+ BLI_dynstr_free(ds);
+
+ //if(G.f & G_DEBUG) printf("%s\n", code);
+
+ return code;
+}
+
+static char *code_generate_vertex(ListBase *nodes)
+{
+ DynStr *ds = BLI_dynstr_new();
+ GPUNode *node;
+ GPUInput *input;
+ char *code;
+
+ for (node=nodes->first; node; node=node->next) {
+ for (input=node->inputs.first; input; input=input->next) {
+ if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
+ BLI_dynstr_printf(ds, "attribute %s att%d;\n",
+ GPU_DATATYPE_STR[input->type], input->attribid);
+ BLI_dynstr_printf(ds, "varying %s var%d;\n",
+ GPU_DATATYPE_STR[input->type], input->attribid);
+ }
+ }
+ }
+
+ BLI_dynstr_append(ds, "\n");
+ BLI_dynstr_append(ds, datatoc_gpu_shader_vertex_glsl);
+
+ for (node=nodes->first; node; node=node->next)
+ for (input=node->inputs.first; input; input=input->next)
+ if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
+ if(input->attribtype == CD_TANGENT) /* silly exception */
+ BLI_dynstr_printf(ds, "\tvar%d = gl_NormalMatrix * ", input->attribid);
+ else
+ BLI_dynstr_printf(ds, "\tvar%d = ", input->attribid);
+
+ BLI_dynstr_printf(ds, "att%d;\n", input->attribid);
+ }
+
+ BLI_dynstr_append(ds, "}\n\n");
+
+ code = BLI_dynstr_get_cstring(ds);
+
+ BLI_dynstr_free(ds);
+
+ //if(G.f & G_DEBUG) printf("%s\n", code);
+
+ return code;
+}
+
+/* GPU pass binding/unbinding */
+
+GPUShader *GPU_pass_shader(GPUPass *pass)
+{
+ return pass->shader;
+}
+
+void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
+{
+ GPUShader *shader = pass->shader;
+ GPUNode *node;
+ GPUInput *next, *input;
+ ListBase *inputs = &pass->inputs;
+ int extract, z;
+
+ memset(inputs, 0, sizeof(*inputs));
+
+ if(!shader)
+ return;
+
+ GPU_shader_bind(shader);
+
+ for (node=nodes->first; node; node=node->next) {
+ z = 0;
+ for (input=node->inputs.first; input; input=next, z++) {
+ next = input->next;
+
+ /* attributes don't need to be bound, they already have
+ * an id that the drawing functions will use */
+ if(input->source == GPU_SOURCE_ATTRIB ||
+ input->source == GPU_SOURCE_BUILTIN)
+ continue;
+
+ if (input->ima || input->tex)
+ snprintf(input->shadername, sizeof(input->shadername), "samp%d", input->texid);
+ else
+ snprintf(input->shadername, sizeof(input->shadername), "unf%d", input->id);
+
+ /* pass non-dynamic uniforms to opengl */
+ extract = 0;
+
+ if(input->ima || input->tex) {
+ if (input->bindtex)
+ extract = 1;
+ }
+ else if(input->dynamicvec)
+ extract = 1;
+
+ if(extract)
+ input->shaderloc = GPU_shader_get_uniform(shader, input->shadername);
+
+ /* extract nodes */
+ if(extract) {
+ BLI_remlink(&node->inputs, input);
+ BLI_addtail(inputs, input);
+ }
+ }
+ }
+
+ GPU_shader_unbind(shader);
+}
+
+void GPU_pass_bind(GPUPass *pass, double time)
+{
+ GPUInput *input;
+ GPUShader *shader = pass->shader;
+ ListBase *inputs = &pass->inputs;
+
+ if (!shader)
+ return;
+
+ GPU_shader_bind(shader);
+
+ /* now bind the textures */
+ for (input=inputs->first; input; input=input->next) {
+ if (input->ima)
+ input->tex = GPU_texture_from_blender(input->ima, input->iuser, time);
+
+ if(input->ima || input->tex) {
+ if(input->tex) {
+ GPU_texture_bind(input->tex, input->texid);
+ GPU_shader_uniform_texture(shader, input->shaderloc, input->tex);
+ }
+ }
+ }
+}
+
+void GPU_pass_update_uniforms(GPUPass *pass)
+{
+ GPUInput *input;
+ GPUShader *shader = pass->shader;
+ ListBase *inputs = &pass->inputs;
+
+ if (!shader)
+ return;
+
+ /* pass dynamic inputs to opengl, others were removed */
+ for (input=inputs->first; input; input=input->next)
+ if(!(input->ima || input->tex))
+ GPU_shader_uniform_vector(shader, input->shaderloc, input->type, 1,
+ input->dynamicvec);
+}
+
+void GPU_pass_unbind(GPUPass *pass)
+{
+ GPUInput *input;
+ GPUShader *shader = pass->shader;
+ ListBase *inputs = &pass->inputs;
+
+ if (!shader)
+ return;
+
+ for (input=inputs->first; input; input=input->next) {
+ if (input->tex)
+ if(input->bindtex)
+ GPU_texture_unbind(input->tex);
+ if (input->ima)
+ input->tex = 0;
+ }
+
+ GPU_shader_unbind(shader);
+}
+
+/* Node Link Functions */
+
+GPUNodeLink *GPU_node_link_create(int type)
+{
+ GPUNodeLink *link = MEM_callocN(sizeof(GPUNodeLink), "GPUNodeLink");
+ link->type = type;
+ link->users++;
+
+ return link;
+}
+
+void GPU_node_link_free(GPUNodeLink *link)
+{
+ link->users--;
+
+ if (link->users < 0)
+ fprintf(stderr, "GPU_node_link_free: negative refcount\n");
+
+ if (link->users == 0) {
+ if (link->output)
+ link->output->link = NULL;
+ MEM_freeN(link);
+ }
+}
+
+/* Node Functions */
+
+GPUNode *GPU_node_begin(char *name)
+{
+ GPUNode *node = MEM_callocN(sizeof(GPUNode), "GPUNode");
+
+ node->name = name;
+
+ return node;
+}
+
+void GPU_node_end(GPUNode *node)
+{
+ /* empty */
+}
+
+static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
+{
+ GPUInput *input;
+ GPUNode *outnode;
+ char *name;
+
+ if(link->output) {
+ outnode = link->output->node;
+ name = outnode->name;
+
+ if(strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
+ input = MEM_dupallocN(outnode->inputs.first);
+ input->type = type;
+ if(input->link)
+ input->link->users++;
+ BLI_addtail(&node->inputs, input);
+ return;
+ }
+ }
+
+ input = MEM_callocN(sizeof(GPUInput), "GPUInput");
+ input->node = node;
+
+ if(link->builtin) {
+ /* builtin uniform */
+ input->type = type;
+ input->source = GPU_SOURCE_BUILTIN;
+ input->builtin = link->builtin;
+
+ MEM_freeN(link);
+ }
+ else if(link->output) {
+ /* link to a node output */
+ input->type = type;
+ input->source = GPU_SOURCE_TEX_PIXEL;
+ input->link = link;
+ link->users++;
+ }
+ else if(link->dynamictex) {
+ /* dynamic texture, GPUTexture is updated/deleted externally */
+ input->type = type;
+ input->source = GPU_SOURCE_TEX;
+
+ input->tex = link->dynamictex;
+ input->textarget = GL_TEXTURE_2D;
+ input->textype = type;
+ input->dynamictex = 1;
+ MEM_freeN(link);
+ }
+ else if(link->texture) {
+ /* small texture created on the fly, like for colorbands */
+ input->type = GPU_VEC4;
+ input->source = GPU_SOURCE_TEX;
+ input->textype = type;
+
+ if (type == GPU_TEX1D) {
+ input->tex = GPU_texture_create_1D(link->texturesize, link->ptr1);
+ input->textarget = GL_TEXTURE_1D;
+ }
+ else {
+ input->tex = GPU_texture_create_2D(link->texturesize, link->texturesize, link->ptr2);
+ input->textarget = GL_TEXTURE_2D;
+ }
+
+ MEM_freeN(link->ptr1);
+ MEM_freeN(link);
+ }
+ else if(link->image) {
+ /* blender image */
+ input->type = GPU_VEC4;
+ input->source = GPU_SOURCE_TEX;
+
+ input->ima = link->ptr1;
+ input->textarget = GL_TEXTURE_2D;
+ input->textype = GPU_TEX2D;
+ MEM_freeN(link);
+ }
+ else if(link->attribtype) {
+ /* vertex attribute */
+ input->type = type;
+ input->source = GPU_SOURCE_ATTRIB;
+
+ input->attribtype = link->attribtype;
+ BLI_strncpy(input->attribname, link->attribname, sizeof(input->attribname));
+ MEM_freeN(link);
+ }
+ else {
+ /* uniform vector */
+ input->type = type;
+ input->source = GPU_SOURCE_VEC_UNIFORM;
+
+ memcpy(input->vec, link->ptr1, type*sizeof(float));
+ if(link->dynamic)
+ input->dynamicvec= link->ptr1;
+ MEM_freeN(link);
+ }
+
+ BLI_addtail(&node->inputs, input);
+}
+
+static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock)
+{
+ GPUNodeLink *link;
+
+ if(sock->link) {
+ gpu_node_input_link(node, sock->link, sock->type);
+ }
+ else {
+ link = GPU_node_link_create(0);
+ link->ptr1 = sock->vec;
+ gpu_node_input_link(node, link, sock->type);
+ }
+}
+
+void GPU_node_output(GPUNode *node, int type, char *name, GPUNodeLink **link)
+{
+ GPUOutput *output = MEM_callocN(sizeof(GPUOutput), "GPUOutput");
+
+ output->type = type;
+ output->node = node;
+
+ if (link) {
+ *link = output->link = GPU_node_link_create(type);
+ output->link->output = output;
+
+ /* note: the caller owns the reference to the linkfer, GPUOutput
+ merely points to it, and if the node is destroyed it will
+ set that pointer to NULL */
+ }
+
+ BLI_addtail(&node->outputs, output);
+}
+
+void GPU_inputs_free(ListBase *inputs)
+{
+ GPUInput *input;
+
+ for(input=inputs->first; input; input=input->next) {
+ if(input->link)
+ GPU_node_link_free(input->link);
+ else if(input->tex && !input->dynamictex)
+ GPU_texture_free(input->tex);
+ }
+
+ BLI_freelistN(inputs);
+}
+
+void GPU_node_free(GPUNode *node)
+{
+ GPUOutput *output;
+
+ GPU_inputs_free(&node->inputs);
+
+ for (output=node->outputs.first; output; output=output->next)
+ if (output->link) {
+ output->link->output = NULL;
+ GPU_node_link_free(output->link);
+ }
+
+ BLI_freelistN(&node->outputs);
+ MEM_freeN(node);
+}
+
+void GPU_nodes_free(ListBase *nodes)
+{
+ GPUNode *node;
+
+ while (nodes->first) {
+ node = nodes->first;
+ BLI_remlink(nodes, node);
+ GPU_node_free(node);
+ }
+}
+
+/* vertex attributes */
+
+void gpu_nodes_get_vertex_attributes(ListBase *nodes, GPUVertexAttribs *attribs)
+{
+ GPUNode *node;
+ GPUInput *input;
+ int a;
+
+ /* convert attributes requested by node inputs to an array of layers,
+ * checking for duplicates and assigning id's starting from zero. */
+
+ memset(attribs, 0, sizeof(*attribs));
+
+ for(node=nodes->first; node; node=node->next) {
+ for(input=node->inputs.first; input; input=input->next) {
+ if(input->source == GPU_SOURCE_ATTRIB) {
+ for(a=0; a<attribs->totlayer; a++) {
+ if(attribs->layer[a].type == input->attribtype &&
+ strcmp(attribs->layer[a].name, input->attribname) == 0)
+ break;
+ }
+
+ if(a == attribs->totlayer && a < GPU_MAX_ATTRIB) {
+ input->attribid = attribs->totlayer++;
+ input->attribfirst = 1;
+
+ attribs->layer[a].type = input->attribtype;
+ attribs->layer[a].glindex = input->attribid;
+ BLI_strncpy(attribs->layer[a].name, input->attribname,
+ sizeof(attribs->layer[a].name));
+ }
+ else
+ input->attribid = attribs->layer[a].glindex;
+ }
+ }
+ }
+}
+
+void gpu_nodes_get_builtin_flag(ListBase *nodes, int *builtin)
+{
+ GPUNode *node;
+ GPUInput *input;
+
+ *builtin= 0;
+
+ for(node=nodes->first; node; node=node->next)
+ for(input=node->inputs.first; input; input=input->next)
+ if(input->source == GPU_SOURCE_BUILTIN)
+ *builtin |= input->builtin;
+}
+
+/* varargs linking */
+
+GPUNodeLink *GPU_attribute(int type, char *name)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->attribtype= type;
+ link->attribname= name;
+
+ return link;
+}
+
+GPUNodeLink *GPU_uniform(float *num)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->ptr1= num;
+ link->ptr2= NULL;
+
+ return link;
+}
+
+GPUNodeLink *GPU_dynamic_uniform(float *num)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->ptr1= num;
+ link->ptr2= NULL;
+ link->dynamic= 1;
+
+ return link;
+}
+
+GPUNodeLink *GPU_image(Image *ima, ImageUser *iuser)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->image= 1;
+ link->ptr1= ima;
+ link->ptr2= iuser;
+
+ return link;
+}
+
+GPUNodeLink *GPU_texture(int size, float *pixels)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->texture = 1;
+ link->texturesize = size;
+ link->ptr1= pixels;
+
+ return link;
+}
+
+GPUNodeLink *GPU_dynamic_texture(GPUTexture *tex)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->dynamic = 1;
+ link->dynamictex = tex;
+
+ return link;
+}
+
+GPUNodeLink *GPU_socket(GPUNodeStack *sock)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->socket= sock;
+
+ return link;
+}
+
+GPUNodeLink *GPU_builtin(GPUBuiltin builtin)
+{
+ GPUNodeLink *link = GPU_node_link_create(0);
+
+ link->builtin= builtin;
+
+ return link;
+}
+
+int GPU_link(GPUMaterial *mat, char *name, ...)
+{
+ GPUNode *node;
+ GPUFunction *function;
+ GPUNodeLink *link, **linkptr;
+ va_list params;
+ int i;
+
+ function = GPU_lookup_function(name);
+ if(!function) {
+ fprintf(stderr, "GPU failed to find function %s\n", name);
+ return 0;
+ }
+
+ node = GPU_node_begin(name);
+
+ va_start(params, name);
+ for(i=0; i<function->totparam; i++) {
+ if(function->paramqual[i] != FUNCTION_QUAL_IN) {
+ linkptr= va_arg(params, GPUNodeLink**);
+ GPU_node_output(node, function->paramtype[i], "", linkptr);
+ }
+ else {
+ link= va_arg(params, GPUNodeLink*);
+ gpu_node_input_link(node, link, function->paramtype[i]);
+ }
+ }
+ va_end(params);
+
+ GPU_node_end(node);
+
+ gpu_material_add_node(mat, node);
+
+ return 1;
+}
+
+int GPU_stack_link(GPUMaterial *mat, char *name, GPUNodeStack *in, GPUNodeStack *out, ...)
+{
+ GPUNode *node;
+ GPUFunction *function;
+ GPUNodeLink *link, **linkptr;
+ va_list params;
+ int i, totin, totout;
+
+ function = GPU_lookup_function(name);
+ if(!function) {
+ fprintf(stderr, "GPU failed to find function %s\n", name);
+ return 0;
+ }
+
+ node = GPU_node_begin(name);
+ totin = 0;
+ totout = 0;
+
+ if(in) {
+ for(i = 0; in[i].type != GPU_NONE; i++) {
+ gpu_node_input_socket(node, &in[i]);
+ totin++;
+ }
+ }
+
+ if(out) {
+ for(i = 0; out[i].type != GPU_NONE; i++) {
+ GPU_node_output(node, out[i].type, out[i].name, &out[i].link);
+ totout++;
+ }
+ }
+
+ va_start(params, out);
+ for(i=0; i<function->totparam; i++) {
+ if(function->paramqual[i] != FUNCTION_QUAL_IN) {
+ if(totout == 0) {
+ linkptr= va_arg(params, GPUNodeLink**);
+ GPU_node_output(node, function->paramtype[i], "", linkptr);
+ }
+ else
+ totout--;
+ }
+ else {
+ if(totin == 0) {
+ link= va_arg(params, GPUNodeLink*);
+ if(link->socket)
+ gpu_node_input_socket(node, link->socket);
+ else
+ gpu_node_input_link(node, link, function->paramtype[i]);
+ }
+ else
+ totin--;
+ }
+ }
+ va_end(params);
+
+ GPU_node_end(node);
+
+ gpu_material_add_node(mat, node);
+
+ return 1;
+}
+
+int GPU_link_changed(GPUNodeLink *link)
+{
+ GPUNode *node;
+ GPUInput *input;
+ char *name;
+
+ if(link->output) {
+ node = link->output->node;
+ name = node->name;
+
+ if(strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
+ input = node->inputs.first;
+ return (input->link != NULL);
+ }
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+/* Pass create/free */
+
+void gpu_nodes_tag(GPUNodeLink *link)
+{
+ GPUNode *node;
+ GPUInput *input;
+
+ if(!link->output)
+ return;
+
+ node = link->output->node;
+ if(node->tag)
+ return;
+
+ node->tag= 1;
+ for(input=node->inputs.first; input; input=input->next)
+ if(input->link)
+ gpu_nodes_tag(input->link);
+}
+
+void gpu_nodes_prune(ListBase *nodes, GPUNodeLink *outlink)
+{
+ GPUNode *node, *next;
+
+ for(node=nodes->first; node; node=node->next)
+ node->tag= 0;
+
+ gpu_nodes_tag(outlink);
+
+ for(node=nodes->first; node; node=next) {
+ next = node->next;
+
+ if(!node->tag) {
+ BLI_remlink(nodes, node);
+ GPU_node_free(node);
+ }
+ }
+}
+
+GPUPass *GPU_generate_pass(ListBase *nodes, GPUNodeLink *outlink, GPUVertexAttribs *attribs, int *builtins, const char *name)
+{
+ GPUShader *shader;
+ GPUPass *pass;
+ char *vertexcode, *fragmentcode;
+
+ if(!FUNCTION_LIB) {
+ GPU_nodes_free(nodes);
+ return NULL;
+ }
+
+ /* prune unused nodes */
+ gpu_nodes_prune(nodes, outlink);
+
+ gpu_nodes_get_vertex_attributes(nodes, attribs);
+ gpu_nodes_get_builtin_flag(nodes, builtins);
+
+ /* generate code and compile with opengl */
+ fragmentcode = code_generate_fragment(nodes, outlink->output, name);
+ vertexcode = code_generate_vertex(nodes);
+ shader = GPU_shader_create(vertexcode, fragmentcode, FUNCTION_LIB);
+ MEM_freeN(fragmentcode);
+ MEM_freeN(vertexcode);
+
+ /* failed? */
+ if (!shader) {
+ memset(attribs, 0, sizeof(*attribs));
+ memset(builtins, 0, sizeof(*builtins));
+ GPU_nodes_free(nodes);
+ return NULL;
+ }
+
+ /* create pass */
+ pass = MEM_callocN(sizeof(GPUPass), "GPUPass");
+
+ pass->output = outlink->output;
+ pass->shader = shader;
+
+ /* extract dynamic inputs and throw away nodes */
+ GPU_nodes_extract_dynamic_inputs(pass, nodes);
+ GPU_nodes_free(nodes);
+
+ return pass;
+}
+
+void GPU_pass_free(GPUPass *pass)
+{
+ GPU_shader_free(pass->shader);
+ GPU_inputs_free(&pass->inputs);
+ MEM_freeN(pass);
+}
+
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
new file mode 100644
index 00000000000..53b52f24f16
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -0,0 +1,87 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __GPU_CODEGEN_H__
+#define __GPU_CODEGEN_H__
+
+#include "DNA_listBase.h"
+
+struct ListBase;
+struct GPUShader;
+struct GPUOutput;
+struct GPUNode;
+struct GPUVertexAttribs;
+
+#define MAX_FUNCTION_NAME 64
+#define MAX_PARAMETER 32
+
+#define FUNCTION_QUAL_IN 0
+#define FUNCTION_QUAL_OUT 1
+#define FUNCTION_QUAL_INOUT 2
+
+typedef struct GPUFunction {
+ char name[MAX_FUNCTION_NAME];
+ int paramtype[MAX_PARAMETER];
+ int paramqual[MAX_PARAMETER];
+ int totparam;
+} GPUFunction;
+
+GPUFunction *GPU_lookup_function(char *name);
+
+/* Pass Generation
+ - Takes a list of nodes and a desired output, and makes a pass. This
+ will take ownership of the nodes and free them early if unused or
+ at the end if used.
+*/
+
+struct GPUPass;
+typedef struct GPUPass GPUPass;
+
+GPUPass *GPU_generate_pass(ListBase *nodes, struct GPUNodeLink *outlink,
+ struct GPUVertexAttribs *attribs, int *builtin, const char *name);
+
+struct GPUShader *GPU_pass_shader(GPUPass *pass);
+
+void GPU_pass_bind(GPUPass *pass, double time);
+void GPU_pass_update_uniforms(GPUPass *pass);
+void GPU_pass_unbind(GPUPass *pass);
+
+void GPU_pass_free(GPUPass *pass);
+
+/* Material calls */
+
+char *GPU_builtin_name(GPUBuiltin builtin);
+void gpu_material_add_node(struct GPUMaterial *material, struct GPUNode *node);
+int GPU_link_changed(struct GPUNodeLink *link);
+
+#endif
+
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
new file mode 100644
index 00000000000..8922846f365
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -0,0 +1,1167 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+#include "GL/glew.h"
+
+#include "DNA_image_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_view3d_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "BKE_bmfont.h"
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_main.h"
+#include "BKE_material.h"
+#include "BKE_node.h"
+#include "BKE_object.h"
+#include "BKE_utildefines.h"
+
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+#include "GPU_draw.h"
+
+/* These are some obscure rendering functions shared between the
+ * game engine and the blender, in this module to avoid duplicaten
+ * and abstract them away from the rest a bit */
+
+/* Text Rendering */
+
+static void gpu_mcol(unsigned int ucol)
+{
+ /* mcol order is swapped */
+ char *cp= (char *)&ucol;
+ glColor3ub(cp[3], cp[2], cp[1]);
+}
+
+void GPU_render_text(MTFace *tface, int mode,
+ const char *textstr, int textlen, unsigned int *col,
+ float *v1, float *v2, float *v3, float *v4, int glattrib)
+{
+ if (mode & TF_BMFONT) {
+ Image* ima;
+ int characters, index, character;
+ float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance;
+
+ characters = textlen;
+
+ ima = (Image*)tface->tpage;
+ if (ima == NULL)
+ characters = 0;
+
+ // color has been set
+ if (tface->mode & TF_OBCOL)
+ col= NULL;
+ else if (!col)
+ glColor3f(1.0f, 1.0f, 1.0f);
+
+ glPushMatrix();
+ for (index = 0; index < characters; index++) {
+ float uv[4][2];
+
+ // lets calculate offset stuff
+ character = textstr[index];
+
+ // space starts at offset 1
+ // character = character - ' ' + 1;
+ matrixGlyph((ImBuf *)ima->ibufs.first, character, & centerx, &centery,
+ &sizex, &sizey, &transx, &transy, &movex, &movey, &advance);
+
+ uv[0][0] = (tface->uv[0][0] - centerx) * sizex + transx;
+ uv[0][1] = (tface->uv[0][1] - centery) * sizey + transy;
+ uv[1][0] = (tface->uv[1][0] - centerx) * sizex + transx;
+ uv[1][1] = (tface->uv[1][1] - centery) * sizey + transy;
+ uv[2][0] = (tface->uv[2][0] - centerx) * sizex + transx;
+ uv[2][1] = (tface->uv[2][1] - centery) * sizey + transy;
+
+ glBegin(GL_POLYGON);
+ if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[0]);
+ else glTexCoord2fv(uv[0]);
+ if(col) gpu_mcol(col[0]);
+ glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]);
+
+ if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[1]);
+ else glTexCoord2fv(uv[1]);
+ if(col) gpu_mcol(col[1]);
+ glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]);
+
+ if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[2]);
+ else glTexCoord2fv(uv[2]);
+ if(col) gpu_mcol(col[2]);
+ glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]);
+
+ if(v4) {
+ uv[3][0] = (tface->uv[3][0] - centerx) * sizex + transx;
+ uv[3][1] = (tface->uv[3][1] - centery) * sizey + transy;
+
+ if(glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[3]);
+ else glTexCoord2fv(uv[3]);
+ if(col) gpu_mcol(col[3]);
+ glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]);
+ }
+ glEnd();
+
+ glTranslatef(advance, 0.0, 0.0);
+ }
+ glPopMatrix();
+ }
+}
+
+/* Checking powers of two for images since opengl 1.x requires it */
+
+static int is_pow2(int num)
+{
+ /* (n&(n-1)) zeros the least significant bit of n */
+ return ((num)&(num-1))==0;
+}
+
+static int smaller_pow2(int num)
+{
+ while (!is_pow2(num))
+ num= num&(num-1);
+
+ return num;
+}
+
+static int is_pow2_limit(int num)
+{
+ /* take texture clamping into account */
+ if (U.glreslimit != 0 && num > U.glreslimit)
+ return 0;
+
+ return ((num)&(num-1))==0;
+}
+
+static int smaller_pow2_limit(int num)
+{
+ /* take texture clamping into account */
+ if (U.glreslimit != 0 && num > U.glreslimit)
+ return U.glreslimit;
+
+ return smaller_pow2(num);
+}
+
+/* Current OpenGL state caching for GPU_set_tpage */
+
+static struct GPUTextureState {
+ int curtile, tile;
+ int curtilemode, tilemode;
+ int curtileXRep, tileXRep;
+ int curtileYRep, tileYRep;
+ Image *ima, *curima;
+
+ int domipmap, linearmipmap;
+
+ int alphamode;
+ MTFace *lasttface;
+} GTS = {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 1, 0, -1, NULL};
+
+/* Mipmap settings */
+
+void GPU_set_mipmap(int mipmap)
+{
+ if (GTS.domipmap != (mipmap != 0)) {
+ GPU_free_images();
+ GTS.domipmap = mipmap != 0;
+ }
+}
+
+void GPU_set_linear_mipmap(int linear)
+{
+ if (GTS.linearmipmap != (linear != 0)) {
+ GPU_free_images();
+ GTS.linearmipmap = linear != 0;
+ }
+}
+
+static int gpu_get_mipmap(void)
+{
+ return GTS.domipmap && (!(G.f & G_TEXTUREPAINT));
+}
+
+static GLenum gpu_get_mipmap_filter()
+{
+ return GTS.linearmipmap? GL_LINEAR_MIPMAP_LINEAR: GL_LINEAR_MIPMAP_NEAREST;
+}
+
+/* Set OpenGL state for an MTFace */
+
+static void gpu_make_repbind(Image *ima)
+{
+ ImBuf *ibuf;
+
+ ibuf = BKE_image_get_ibuf(ima, NULL);
+ if(ibuf==NULL)
+ return;
+
+ if(ima->repbind) {
+ glDeleteTextures(ima->totbind, (GLuint *)ima->repbind);
+ MEM_freeN(ima->repbind);
+ ima->repbind= 0;
+ ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
+ }
+
+ ima->totbind= ima->xrep*ima->yrep;
+
+ if(ima->totbind>1)
+ ima->repbind= MEM_callocN(sizeof(int)*ima->totbind, "repbind");
+}
+
+static void gpu_clear_tpage()
+{
+ if(GTS.lasttface==0)
+ return;
+
+ GTS.lasttface= 0;
+ GTS.curtile= 0;
+ GTS.curima= 0;
+ if(GTS.curtilemode!=0) {
+ glMatrixMode(GL_TEXTURE);
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ }
+ GTS.curtilemode= 0;
+ GTS.curtileXRep=0;
+ GTS.curtileYRep=0;
+ GTS.alphamode= -1;
+
+ glDisable(GL_BLEND);
+ glDisable(GL_TEXTURE_2D);
+ glDisable(GL_TEXTURE_GEN_S);
+ glDisable(GL_TEXTURE_GEN_T);
+ glDisable(GL_ALPHA_TEST);
+}
+
+static void gpu_set_blend_mode(GPUBlendMode blendmode)
+{
+ if(blendmode == GPU_BLEND_SOLID) {
+ glDisable(GL_BLEND);
+ glDisable(GL_ALPHA_TEST);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+ else if(blendmode==GPU_BLEND_ADD) {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE);
+ glDisable(GL_ALPHA_TEST);
+ }
+ else if(blendmode==GPU_BLEND_ALPHA) {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ /* if U.glalphaclip == 1.0, some cards go bonkers...
+ * turn off alpha test in this case */
+
+ /* added after 2.45 to clip alpha */
+ if(U.glalphaclip == 1.0) {
+ glDisable(GL_ALPHA_TEST);
+ }
+ else {
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, U.glalphaclip);
+ }
+ }
+ else if(blendmode==GPU_BLEND_CLIP) {
+ glDisable(GL_BLEND);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, 0.5f);
+ }
+}
+
+static void gpu_verify_alpha_mode(MTFace *tface)
+{
+ /* verify alpha blending modes */
+ if(GTS.alphamode == tface->transp)
+ return;
+
+ gpu_set_blend_mode(tface->transp);
+ GTS.alphamode= tface->transp;
+}
+
+static void gpu_verify_reflection(Image *ima)
+{
+ if (ima && (ima->flag & IMA_REFLECT)) {
+ /* enable reflection mapping */
+ glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+ glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+
+ glEnable(GL_TEXTURE_GEN_S);
+ glEnable(GL_TEXTURE_GEN_T);
+ }
+ else {
+ /* disable reflection mapping */
+ glDisable(GL_TEXTURE_GEN_S);
+ glDisable(GL_TEXTURE_GEN_T);
+ }
+}
+
+int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare)
+{
+ ImBuf *ibuf = NULL;
+ unsigned int *bind = NULL;
+ int rectw, recth, tpx=0, tpy=0, y;
+ unsigned int *rectrow, *tilerectrow;
+ unsigned int *tilerect= NULL, *scalerect= NULL, *rect= NULL;
+ short texwindx, texwindy, texwinsx, texwinsy;
+
+ /* initialize tile mode and number of repeats */
+ GTS.ima = ima;
+ GTS.tilemode= (tfmode & TF_TILES) || (ima && (ima->tpageflag & IMA_TWINANIM));
+ GTS.tileXRep = 0;
+ GTS.tileYRep = 0;
+
+ /* setting current tile according to frame */
+ if(ima && (ima->tpageflag & IMA_TWINANIM))
+ GTS.tile= ima->lastframe;
+ else
+ GTS.tile= tftile;
+
+ if(ima) {
+ GTS.tileXRep = ima->xrep;
+ GTS.tileYRep = ima->yrep;
+ }
+
+ /* if same image & tile, we're done */
+ if(compare && ima == GTS.curima && GTS.curtile == GTS.tile &&
+ GTS.tilemode == GTS.curtilemode && GTS.curtileXRep == GTS.tileXRep &&
+ GTS.curtileYRep == GTS.tileYRep)
+ return (ima!=0);
+
+ /* if tiling mode or repeat changed, change texture matrix to fit */
+ if(GTS.tilemode!=GTS.curtilemode || GTS.curtileXRep!=GTS.tileXRep ||
+ GTS.curtileYRep != GTS.tileYRep) {
+
+ glMatrixMode(GL_TEXTURE);
+ glLoadIdentity();
+
+ if((tfmode & TF_TILES) && ima!=NULL)
+ glScalef(ima->xrep, ima->yrep, 1.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ }
+
+ /* check if we have a valid image */
+ if(ima==NULL || ima->ok==0)
+ return 0;
+
+ /* check if we have a valid image buffer */
+ ibuf= BKE_image_get_ibuf(ima, NULL);
+
+ if(ibuf==NULL)
+ return 0;
+
+ /* ensure we have a char buffer and not only float */
+ if ((ibuf->rect==NULL) && ibuf->rect_float)
+ IMB_rect_from_float(ibuf);
+
+ if(GTS.tilemode) {
+ /* tiled mode */
+ if(ima->repbind==0) gpu_make_repbind(ima);
+ if(GTS.tile>=ima->totbind) GTS.tile= 0;
+
+ /* this happens when you change repeat buttons */
+ if(ima->repbind) bind= &ima->repbind[GTS.tile];
+ else bind= &ima->bindcode;
+
+ if(*bind==0) {
+
+ texwindx= ibuf->x/ima->xrep;
+ texwindy= ibuf->y/ima->yrep;
+
+ if(GTS.tile>=ima->xrep*ima->yrep)
+ GTS.tile= ima->xrep*ima->yrep-1;
+
+ texwinsy= GTS.tile / ima->xrep;
+ texwinsx= GTS.tile - texwinsy*ima->xrep;
+
+ texwinsx*= texwindx;
+ texwinsy*= texwindy;
+
+ tpx= texwindx;
+ tpy= texwindy;
+
+ rect= ibuf->rect + texwinsy*ibuf->x + texwinsx;
+ }
+ }
+ else {
+ /* regular image mode */
+ bind= &ima->bindcode;
+
+ if(*bind==0) {
+ tpx= ibuf->x;
+ tpy= ibuf->y;
+ rect= ibuf->rect;
+ }
+ }
+
+ if(*bind != 0) {
+ /* enable opengl drawing with textures */
+ glBindTexture(GL_TEXTURE_2D, *bind);
+ return *bind;
+ }
+
+ rectw = tpx;
+ recth = tpy;
+
+ /* for tiles, copy only part of image into buffer */
+ if (GTS.tilemode) {
+ tilerect= MEM_mallocN(rectw*recth*sizeof(*tilerect), "tilerect");
+
+ for (y=0; y<recth; y++) {
+ rectrow= &rect[y*ibuf->x];
+ tilerectrow= &tilerect[y*rectw];
+
+ memcpy(tilerectrow, rectrow, tpx*sizeof(*rectrow));
+ }
+
+ rect= tilerect;
+ }
+
+ /* scale if not a power of two */
+ if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) {
+ rectw= smaller_pow2_limit(rectw);
+ recth= smaller_pow2_limit(recth);
+
+ scalerect= MEM_mallocN(rectw*recth*sizeof(*scalerect), "scalerect");
+ gluScaleImage(GL_RGBA, tpx, tpy, GL_UNSIGNED_BYTE, rect, rectw, recth, GL_UNSIGNED_BYTE, scalerect);
+ rect= scalerect;
+ }
+
+ /* create image */
+ glGenTextures(1, (GLuint *)bind);
+ glBindTexture( GL_TEXTURE_2D, *bind);
+
+ if (!gpu_get_mipmap()) {
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ else {
+ gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, rectw, recth, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter());
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ ima->tpageflag |= IMA_MIPMAP_COMPLETE;
+ }
+
+ /* set to modulate with vertex color */
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ /* clean up */
+ if (tilerect)
+ MEM_freeN(tilerect);
+ if (scalerect)
+ MEM_freeN(scalerect);
+
+ return *bind;
+}
+
+static void gpu_verify_repeat(Image *ima)
+{
+ /* set either clamp or repeat in X/Y */
+ if (ima->tpageflag & IMA_CLAMP_U)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ else
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+
+ if (ima->tpageflag & IMA_CLAMP_V)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ else
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+}
+
+int GPU_set_tpage(MTFace *tface)
+{
+ Image *ima;
+
+ /* check if we need to clear the state */
+ if(tface==0) {
+ gpu_clear_tpage();
+ return 0;
+ }
+
+ ima= tface->tpage;
+ GTS.lasttface= tface;
+
+ gpu_verify_alpha_mode(tface);
+ gpu_verify_reflection(ima);
+
+ if(GPU_verify_image(ima, tface->tile, tface->mode, 1)) {
+ GTS.curtile= GTS.tile;
+ GTS.curima= GTS.ima;
+ GTS.curtilemode= GTS.tilemode;
+ GTS.curtileXRep = GTS.tileXRep;
+ GTS.curtileYRep = GTS.tileYRep;
+
+ glEnable(GL_TEXTURE_2D);
+ }
+ else {
+ glDisable(GL_TEXTURE_2D);
+
+ GTS.curtile= 0;
+ GTS.curima= 0;
+ GTS.curtilemode= 0;
+ GTS.curtileXRep = 0;
+ GTS.curtileYRep = 0;
+
+ return 0;
+ }
+
+ gpu_verify_repeat(ima);
+
+ /* Did this get lost in the image recode? */
+ /* tag_image_time(ima);*/
+
+ return 1;
+}
+
+/* these two functions are called on entering and exiting texture paint mode,
+ temporary disabling/enabling mipmapping on all images for quick texture
+ updates with glTexSubImage2D. images that didn't change don't have to be
+ re-uploaded to OpenGL */
+void GPU_paint_set_mipmap(int mipmap)
+{
+ Image* ima;
+
+ if(!GTS.domipmap)
+ return;
+
+ if(mipmap) {
+ for(ima=G.main->image.first; ima; ima=ima->id.next) {
+ if(ima->bindcode) {
+ if(ima->tpageflag & IMA_MIPMAP_COMPLETE) {
+ glBindTexture(GL_TEXTURE_2D, ima->bindcode);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter());
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ else
+ GPU_free_image(ima);
+ }
+ }
+
+ }
+ else {
+ for(ima=G.main->image.first; ima; ima=ima->id.next) {
+ if(ima->bindcode) {
+ glBindTexture(GL_TEXTURE_2D, ima->bindcode);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ }
+ }
+}
+
+void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
+{
+ ImBuf *ibuf;
+
+ ibuf = BKE_image_get_ibuf(ima, NULL);
+
+ if (ima->repbind || gpu_get_mipmap() || !ima->bindcode || !ibuf ||
+ (!is_pow2(ibuf->x) || !is_pow2(ibuf->y)) ||
+ (w == 0) || (h == 0)) {
+ /* these cases require full reload still */
+ GPU_free_image(ima);
+ }
+ else {
+ /* for the special case, we can do a partial update
+ * which is much quicker for painting */
+ GLint row_length, skip_pixels, skip_rows;
+
+ glGetIntegerv(GL_UNPACK_ROW_LENGTH, &row_length);
+ glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skip_pixels);
+ glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skip_rows);
+
+ if ((ibuf->rect==NULL) && ibuf->rect_float)
+ IMB_rect_from_float(ibuf);
+
+ glBindTexture(GL_TEXTURE_2D, ima->bindcode);
+
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, ibuf->x);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, x);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, y);
+
+ glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA,
+ GL_UNSIGNED_BYTE, ibuf->rect);
+
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length);
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows);
+
+ if(ima->tpageflag & IMA_MIPMAP_COMPLETE)
+ ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
+ }
+}
+
+void GPU_update_images_framechange(void)
+{
+ Image *ima;
+
+ for(ima=G.main->image.first; ima; ima=ima->id.next) {
+ if(ima->tpageflag & IMA_TWINANIM) {
+ if(ima->twend >= ima->xrep*ima->yrep)
+ ima->twend= ima->xrep*ima->yrep-1;
+
+ /* check: is bindcode not in the array? free. (to do) */
+
+ ima->lastframe++;
+ if(ima->lastframe > ima->twend)
+ ima->lastframe= ima->twsta;
+ }
+ }
+}
+
+int GPU_update_image_time(Image *ima, double time)
+{
+ int inc = 0;
+ float diff;
+ int newframe;
+
+ if (!ima)
+ return 0;
+
+ if (ima->lastupdate<0)
+ ima->lastupdate = 0;
+
+ if (ima->lastupdate>time)
+ ima->lastupdate=(float)time;
+
+ if(ima->tpageflag & IMA_TWINANIM) {
+ if(ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1;
+
+ /* check: is the bindcode not in the array? Then free. (still to do) */
+
+ diff = (float)(time-ima->lastupdate);
+ inc = (int)(diff*(float)ima->animspeed);
+
+ ima->lastupdate+=((float)inc/(float)ima->animspeed);
+
+ newframe = ima->lastframe+inc;
+
+ if(newframe > (int)ima->twend) {
+ if(ima->twend-ima->twsta != 0)
+ newframe = (int)ima->twsta-1 + (newframe-ima->twend)%(ima->twend-ima->twsta);
+ else
+ newframe = ima->twsta;
+ }
+
+ ima->lastframe = newframe;
+ }
+
+ return inc;
+}
+
+void GPU_free_image(Image *ima)
+{
+ /* free regular image binding */
+ if(ima->bindcode) {
+ glDeleteTextures(1, (GLuint *)&ima->bindcode);
+ ima->bindcode= 0;
+ ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
+ }
+
+ /* free glsl image binding */
+ if(ima->gputexture) {
+ GPU_texture_free(ima->gputexture);
+ ima->gputexture= NULL;
+ }
+
+ /* free repeated image binding */
+ if(ima->repbind) {
+ glDeleteTextures(ima->totbind, (GLuint *)ima->repbind);
+
+ MEM_freeN(ima->repbind);
+ ima->repbind= NULL;
+ ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
+ }
+}
+
+void GPU_free_images(void)
+{
+ Image* ima;
+
+ for(ima=G.main->image.first; ima; ima=ima->id.next)
+ GPU_free_image(ima);
+}
+
+/* OpenGL Materials */
+
+/* materials start counting at # one.... */
+#define MAXMATBUF (MAXMAT+1)
+
+/* OpenGL state caching for materials */
+
+static struct GPUMaterialState {
+ float matbuf[MAXMATBUF][2][4];
+ int totmat;
+
+ Material *gmatbuf[MAXMATBUF];
+ Material *gboundmat;
+ Object *gob;
+ Scene *gscene;
+
+ GPUBlendMode blendmode[MAXMATBUF];
+ int alphapass;
+
+ int lastmatnr, lastretval;
+ GPUBlendMode lastblendmode;
+} GMS;
+
+Material *gpu_active_node_material(Material *ma)
+{
+ if(ma && ma->use_nodes && ma->nodetree) {
+ bNode *node= nodeGetActiveID(ma->nodetree, ID_MA);
+
+ if(node)
+ return (Material *)node->id;
+ else
+ return NULL;
+ }
+
+ return ma;
+}
+
+void GPU_set_object_materials(Scene *scene, Object *ob, int glsl, int *do_alpha_pass)
+{
+ extern Material defmaterial; /* from material.c */
+ Material *ma;
+ GPUMaterial *gpumat;
+ GPUBlendMode blendmode;
+ int a;
+
+ /* initialize state */
+ memset(&GMS, 0, sizeof(GMS));
+ GMS.lastmatnr = -1;
+ GMS.lastretval = -1;
+ GMS.lastblendmode = GPU_BLEND_SOLID;
+
+ GMS.gob = ob;
+ GMS.gscene = scene;
+ GMS.totmat= ob->totcol;
+
+ GMS.alphapass = (G.vd && G.vd->transp);
+ if(do_alpha_pass)
+ *do_alpha_pass = 0;
+
+ /* no materials assigned? */
+ if(ob->totcol==0) {
+ GMS.matbuf[0][0][0]= defmaterial.r;
+ GMS.matbuf[0][0][1]= defmaterial.g;
+ GMS.matbuf[0][0][2]= defmaterial.b;
+ GMS.matbuf[0][0][3]= 1.0;
+
+ GMS.matbuf[0][1][0]= defmaterial.specr;
+ GMS.matbuf[0][1][1]= defmaterial.specg;
+ GMS.matbuf[0][1][2]= defmaterial.specb;
+ GMS.matbuf[0][1][3]= 1.0;
+
+ /* do material 1 too, for displists! */
+ QUATCOPY(GMS.matbuf[1][0], GMS.matbuf[0][0]);
+ QUATCOPY(GMS.matbuf[1][1], GMS.matbuf[0][1]);
+
+ if(glsl) {
+ GMS.gmatbuf[0]= &defmaterial;
+ GPU_material_from_blender(GMS.gscene, &defmaterial);
+ }
+
+ GMS.blendmode[0]= GPU_BLEND_SOLID;
+ }
+
+ /* setup materials */
+ for(a=1; a<=ob->totcol; a++) {
+ /* find a suitable material */
+ ma= give_current_material(ob, a);
+ if(!glsl) ma= gpu_active_node_material(ma);
+ if(ma==NULL) ma= &defmaterial;
+
+ /* this shouldn't happen .. */
+ if(a>=MAXMATBUF)
+ continue;
+
+ /* create glsl material if requested */
+ gpumat = (glsl)? GPU_material_from_blender(GMS.gscene, ma): NULL;
+
+ if(gpumat) {
+ /* do glsl only if creating it succeed, else fallback */
+ GMS.gmatbuf[a]= ma;
+ blendmode = GPU_material_blend_mode(gpumat, ob->col);
+ }
+ else {
+ /* fixed function opengl materials */
+ if (ma->mode & MA_SHLESS) {
+ GMS.matbuf[a][0][0]= ma->r;
+ GMS.matbuf[a][0][1]= ma->g;
+ GMS.matbuf[a][0][2]= ma->b;
+ } else {
+ GMS.matbuf[a][0][0]= (ma->ref+ma->emit)*ma->r;
+ GMS.matbuf[a][0][1]= (ma->ref+ma->emit)*ma->g;
+ GMS.matbuf[a][0][2]= (ma->ref+ma->emit)*ma->b;
+
+ GMS.matbuf[a][1][0]= ma->spec*ma->specr;
+ GMS.matbuf[a][1][1]= ma->spec*ma->specg;
+ GMS.matbuf[a][1][2]= ma->spec*ma->specb;
+ GMS.matbuf[a][1][3]= 1.0;
+ }
+
+ blendmode = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
+ if(do_alpha_pass && GMS.alphapass)
+ GMS.matbuf[a][0][3]= ma->alpha;
+ else
+ GMS.matbuf[a][0][3]= 1.0f;
+ }
+
+ /* setting do_alpha_pass = 1 indicates this object needs to be
+ * drawn in a second alpha pass for improved blending */
+ if(do_alpha_pass) {
+ GMS.blendmode[a]= blendmode;
+ if(ELEM(blendmode, GPU_BLEND_ALPHA, GPU_BLEND_ADD) && !GMS.alphapass)
+ *do_alpha_pass= 1;
+ }
+ }
+
+ /* let's start with a clean state */
+ GPU_disable_material();
+}
+
+int GPU_enable_material(int nr, void *attribs)
+{
+ GPUVertexAttribs *gattribs = attribs;
+ GPUMaterial *gpumat;
+ GPUBlendMode blendmode;
+
+ /* prevent index to use un-initialized array items */
+ if(nr>GMS.totmat)
+ nr= GMS.totmat;
+
+ if(gattribs)
+ memset(gattribs, 0, sizeof(*gattribs));
+
+ /* keep current material */
+ if(nr>=MAXMATBUF || nr==GMS.lastmatnr)
+ return GMS.lastretval;
+
+ /* unbind glsl material */
+ if(GMS.gboundmat) {
+ if(GMS.alphapass) glDepthMask(0);
+ GPU_material_unbind(GPU_material_from_blender(GMS.gscene, GMS.gboundmat));
+ GMS.gboundmat= NULL;
+ }
+
+ /* draw materials with alpha in alpha pass */
+ GMS.lastmatnr = nr;
+ GMS.lastretval = ELEM(GMS.blendmode[nr], GPU_BLEND_SOLID, GPU_BLEND_CLIP);
+ if(GMS.alphapass)
+ GMS.lastretval = !GMS.lastretval;
+
+ if(GMS.lastretval) {
+ if(gattribs && GMS.gmatbuf[nr]) {
+ /* bind glsl material and get attributes */
+ Material *mat = GMS.gmatbuf[nr];
+
+ gpumat = GPU_material_from_blender(GMS.gscene, mat);
+ GPU_material_vertex_attributes(gpumat, gattribs);
+ GPU_material_bind(gpumat, GMS.gob->lay, G.vd->lay, 1.0);
+ GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, G.vd->viewmat, G.vd->viewinv, GMS.gob->col);
+ GMS.gboundmat= mat;
+
+ if(GMS.alphapass) glDepthMask(1);
+ }
+ else {
+ /* or do fixed function opengl material */
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, GMS.matbuf[nr][0]);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, GMS.matbuf[nr][1]);
+ }
+
+ /* set (alpha) blending mode */
+ blendmode = (GMS.alphapass)? GPU_BLEND_ALPHA: GPU_BLEND_SOLID;
+ GPU_set_material_blend_mode(blendmode);
+ }
+
+ return GMS.lastretval;
+}
+
+void GPU_set_material_blend_mode(int blendmode)
+{
+ if(GMS.lastblendmode == blendmode)
+ return;
+
+ gpu_set_blend_mode(blendmode);
+ GMS.lastblendmode = blendmode;
+}
+
+int GPU_get_material_blend_mode(void)
+{
+ return GMS.lastblendmode;
+}
+
+void GPU_disable_material(void)
+{
+ GMS.lastmatnr= -1;
+ GMS.lastretval= 1;
+
+ if(GMS.gboundmat) {
+ if(GMS.alphapass) glDepthMask(0);
+ GPU_material_unbind(GPU_material_from_blender(GMS.gscene, GMS.gboundmat));
+ GMS.gboundmat= NULL;
+ }
+
+ GPU_set_material_blend_mode(GPU_BLEND_SOLID);
+}
+
+/* Lights */
+
+int GPU_default_lights(void)
+{
+ int a, count = 0;
+
+ /* initialize */
+ if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
+ U.light[0].flag= 1;
+ U.light[0].vec[0]= -0.3; U.light[0].vec[1]= 0.3; U.light[0].vec[2]= 0.9;
+ U.light[0].col[0]= 0.8; U.light[0].col[1]= 0.8; U.light[0].col[2]= 0.8;
+ U.light[0].spec[0]= 0.5; U.light[0].spec[1]= 0.5; U.light[0].spec[2]= 0.5;
+ U.light[0].spec[3]= 1.0;
+
+ U.light[1].flag= 0;
+ U.light[1].vec[0]= 0.5; U.light[1].vec[1]= 0.5; U.light[1].vec[2]= 0.1;
+ U.light[1].col[0]= 0.4; U.light[1].col[1]= 0.4; U.light[1].col[2]= 0.8;
+ U.light[1].spec[0]= 0.3; U.light[1].spec[1]= 0.3; U.light[1].spec[2]= 0.5;
+ U.light[1].spec[3]= 1.0;
+
+ U.light[2].flag= 0;
+ U.light[2].vec[0]= 0.3; U.light[2].vec[1]= -0.3; U.light[2].vec[2]= -0.2;
+ U.light[2].col[0]= 0.8; U.light[2].col[1]= 0.5; U.light[2].col[2]= 0.4;
+ U.light[2].spec[0]= 0.5; U.light[2].spec[1]= 0.4; U.light[2].spec[2]= 0.3;
+ U.light[2].spec[3]= 1.0;
+ }
+
+ glLightfv(GL_LIGHT0, GL_POSITION, U.light[0].vec);
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, U.light[0].col);
+ glLightfv(GL_LIGHT0, GL_SPECULAR, U.light[0].spec);
+
+ glLightfv(GL_LIGHT1, GL_POSITION, U.light[1].vec);
+ glLightfv(GL_LIGHT1, GL_DIFFUSE, U.light[1].col);
+ glLightfv(GL_LIGHT1, GL_SPECULAR, U.light[1].spec);
+
+ glLightfv(GL_LIGHT2, GL_POSITION, U.light[2].vec);
+ glLightfv(GL_LIGHT2, GL_DIFFUSE, U.light[2].col);
+ glLightfv(GL_LIGHT2, GL_SPECULAR, U.light[2].spec);
+
+ for(a=0; a<8; a++) {
+ if(a<3) {
+ if(U.light[a].flag) {
+ glEnable(GL_LIGHT0+a);
+ count++;
+ }
+ else
+ glDisable(GL_LIGHT0+a);
+
+ // clear stuff from other opengl lamp usage
+ glLightf(GL_LIGHT0+a, GL_SPOT_CUTOFF, 180.0);
+ glLightf(GL_LIGHT0+a, GL_CONSTANT_ATTENUATION, 1.0);
+ glLightf(GL_LIGHT0+a, GL_LINEAR_ATTENUATION, 0.0);
+ }
+ else
+ glDisable(GL_LIGHT0+a);
+ }
+
+ glDisable(GL_LIGHTING);
+
+ glDisable(GL_COLOR_MATERIAL);
+
+ return count;
+}
+
+int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4])
+{
+ Base *base;
+ Lamp *la;
+ int count;
+ float position[4], direction[4], energy[4];
+
+ /* disable all lights */
+ for(count=0; count<8; count++)
+ glDisable(GL_LIGHT0+count);
+
+ count= 0;
+
+ for(base=scene->base.first; base; base=base->next) {
+ if(base->object->type!=OB_LAMP)
+ continue;
+
+ if(!(base->lay & lay) || !(base->lay & ob->lay))
+ continue;
+
+ la= base->object->data;
+
+ /* setup lamp transform */
+ glPushMatrix();
+ glLoadMatrixf((float *)viewmat);
+
+ where_is_object_simul(base->object);
+
+ if(la->type==LA_SUN) {
+ /* sun lamp */
+ VECCOPY(position, base->object->obmat[2]);
+ direction[3]= 0.0;
+
+ glLightfv(GL_LIGHT0+count, GL_POSITION, direction);
+ }
+ else {
+ /* other lamps with attenuation */
+ VECCOPY(position, base->object->obmat[3]);
+ position[3]= 1.0f;
+
+ glLightfv(GL_LIGHT0+count, GL_POSITION, position);
+ glLightf(GL_LIGHT0+count, GL_CONSTANT_ATTENUATION, 1.0);
+ glLightf(GL_LIGHT0+count, GL_LINEAR_ATTENUATION, la->att1/la->dist);
+ glLightf(GL_LIGHT0+count, GL_QUADRATIC_ATTENUATION, la->att2/(la->dist*la->dist));
+
+ if(la->type==LA_SPOT) {
+ /* spot lamp */
+ direction[0]= -base->object->obmat[2][0];
+ direction[1]= -base->object->obmat[2][1];
+ direction[2]= -base->object->obmat[2][2];
+ glLightfv(GL_LIGHT0+count, GL_SPOT_DIRECTION, direction);
+ glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, la->spotsize/2.0);
+ glLightf(GL_LIGHT0+count, GL_SPOT_EXPONENT, 128.0*la->spotblend);
+ }
+ else
+ glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, 180.0);
+ }
+
+ /* setup energy */
+ energy[0]= la->energy*la->r;
+ energy[1]= la->energy*la->g;
+ energy[2]= la->energy*la->b;
+ energy[3]= 1.0;
+
+ glLightfv(GL_LIGHT0+count, GL_DIFFUSE, energy);
+ glLightfv(GL_LIGHT0+count, GL_SPECULAR, energy);
+ glEnable(GL_LIGHT0+count);
+
+ glPopMatrix();
+
+ count++;
+ if(count==8)
+ break;
+ }
+
+ return count;
+}
+
+/* Default OpenGL State */
+
+void GPU_state_init(void)
+{
+ /* also called when doing opengl rendering and in the game engine */
+ float mat_ambient[] = { 0.0, 0.0, 0.0, 0.0 };
+ float mat_specular[] = { 0.5, 0.5, 0.5, 1.0 };
+ float mat_shininess[] = { 35.0 };
+ int a, x, y;
+ GLubyte pat[32*32];
+ const GLubyte *patc= pat;
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
+
+ GPU_default_lights();
+
+ /* no local viewer, looks ugly in ortho mode */
+ /* glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, &one); */
+
+ glDepthFunc(GL_LEQUAL);
+ /* scaling matrices */
+ glEnable(GL_NORMALIZE);
+
+ glShadeModel(GL_FLAT);
+
+ glDisable(GL_ALPHA_TEST);
+ glDisable(GL_BLEND);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_FOG);
+ glDisable(GL_LIGHTING);
+ glDisable(GL_LOGIC_OP);
+ glDisable(GL_STENCIL_TEST);
+ glDisable(GL_TEXTURE_1D);
+ glDisable(GL_TEXTURE_2D);
+
+ /* default on, disable/enable should be local per function */
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+
+ glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
+ glPixelTransferi(GL_RED_SCALE, 1);
+ glPixelTransferi(GL_RED_BIAS, 0);
+ glPixelTransferi(GL_GREEN_SCALE, 1);
+ glPixelTransferi(GL_GREEN_BIAS, 0);
+ glPixelTransferi(GL_BLUE_SCALE, 1);
+ glPixelTransferi(GL_BLUE_BIAS, 0);
+ glPixelTransferi(GL_ALPHA_SCALE, 1);
+ glPixelTransferi(GL_ALPHA_BIAS, 0);
+
+ glPixelTransferi(GL_DEPTH_BIAS, 0);
+ glPixelTransferi(GL_DEPTH_SCALE, 1);
+ glDepthRange(0.0, 1.0);
+
+ a= 0;
+ for(x=0; x<32; x++) {
+ for(y=0; y<4; y++) {
+ if( (x) & 1) pat[a++]= 0x88;
+ else pat[a++]= 0x22;
+ }
+ }
+
+ glPolygonStipple(patc);
+
+ glMatrixMode(GL_TEXTURE);
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+
+ glFrontFace(GL_CCW);
+ glCullFace(GL_BACK);
+ glDisable(GL_CULL_FACE);
+}
+
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
new file mode 100644
index 00000000000..d900f9c63f2
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -0,0 +1,987 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "GL/glew.h"
+
+#include "DNA_listBase.h"
+#include "DNA_image_types.h"
+#include "DNA_userdef_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BKE_image.h"
+#include "BKE_global.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "GPU_draw.h"
+#include "GPU_extensions.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Extensions support */
+
+/* extensions used:
+ - texture border clamp: 1.3 core
+ - fragement shader: 2.0 core
+ - framebuffer object: ext specification
+ - multitexture 1.3 core
+ - arb non power of two: 2.0 core
+ - pixel buffer objects? 2.1 core
+ - arb draw buffers? 2.0 core
+*/
+
+struct GPUGlobal {
+ GLint maxtextures;
+ GLuint currentfb;
+ int minimumsupport;
+} GG = {1, 0, 0};
+
+void GPU_extensions_init()
+{
+ glewInit();
+
+ /* glewIsSupported("GL_VERSION_2_0") */
+
+ if (GLEW_ARB_multitexture)
+ glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &GG.maxtextures);
+
+ GG.minimumsupport = 1;
+ if (!GLEW_ARB_multitexture) GG.minimumsupport = 0;
+ if (!GLEW_ARB_vertex_shader) GG.minimumsupport = 0;
+ if (!GLEW_ARB_fragment_shader) GG.minimumsupport = 0;
+}
+
+int GPU_extensions_minimum_support()
+{
+ return GG.minimumsupport;
+}
+
+int GPU_print_error(char *str)
+{
+ GLenum errCode;
+
+ if (G.f & G_DEBUG) {
+ if ((errCode = glGetError()) != GL_NO_ERROR) {
+ fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static void GPU_print_framebuffer_error(GLenum status)
+{
+ fprintf(stderr, "GPUFrameBuffer: framebuffer incomplete error %d\n",
+ (int)status);
+
+ switch(status) {
+ case GL_FRAMEBUFFER_COMPLETE_EXT:
+ break;
+ case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
+ fprintf(stderr, "Incomplete attachment.\n");
+ break;
+ case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
+ fprintf(stderr, "Unsupported framebuffer format.\n");
+ break;
+ case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
+ fprintf(stderr, "Missing attachment.\n");
+ break;
+ case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
+ fprintf(stderr, "Attached images must have same dimensions.\n");
+ break;
+ case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
+ fprintf(stderr, "Attached images must have same format.\n");
+ break;
+ case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
+ fprintf(stderr, "Missing draw buffer.\n");
+ break;
+ case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
+ fprintf(stderr, "Missing read buffer.\n");
+ break;
+ default:
+ fprintf(stderr, "Unknown.\n");
+ break;
+ }
+}
+
+/* GPUTexture */
+
+struct GPUTexture {
+ int w, h; /* width/height */
+ int number; /* number for multitexture binding */
+ int refcount; /* reference count */
+ GLenum target; /* GL_TEXTURE_* */
+ GLuint bindcode; /* opengl identifier for texture */
+ int fromblender; /* we got the texture from Blender */
+
+ GPUFrameBuffer *fb; /* GPUFramebuffer this texture is attached to */
+ int depth; /* is a depth texture? */
+};
+
+#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
+static unsigned char *GPU_texture_convert_pixels(int length, float *fpixels)
+{
+ unsigned char *pixels, *p;
+ float *fp;
+ int a, len;
+
+ len = 4*length;
+ fp = fpixels;
+ p = pixels = MEM_callocN(sizeof(unsigned char)*len, "GPUTexturePixels");
+
+ for (a=0; a<len; a++, p++, fp++)
+ *p = FTOCHAR((*fp));
+
+ return pixels;
+}
+
+static int is_pow2(int n)
+{
+ return ((n)&(n-1))==0;
+}
+
+static int larger_pow2(int n)
+{
+ if (is_pow2(n))
+ return n;
+
+ while(!is_pow2(n))
+ n= n&(n-1);
+
+ return n*2;
+}
+
+static void GPU_glTexSubImageEmpty(GLenum target, GLenum format, int x, int y, int w, int h)
+{
+ void *pixels = MEM_callocN(sizeof(char)*4*w*h, "GPUTextureEmptyPixels");
+
+ if (target == GL_TEXTURE_1D)
+ glTexSubImage1D(target, 0, x, w, format, GL_UNSIGNED_BYTE, pixels);
+ else
+ glTexSubImage2D(target, 0, x, y, w, h, format, GL_UNSIGNED_BYTE, pixels);
+
+ MEM_freeN(pixels);
+}
+
+static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, int depth)
+{
+ GPUTexture *tex;
+ GLenum type, format, internalformat;
+ void *pixels = NULL;
+
+ if(depth && !GLEW_ARB_depth_texture)
+ return NULL;
+
+ tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
+ tex->w = w;
+ tex->h = h;
+ tex->number = -1;
+ tex->refcount = 1;
+ tex->target = (n == 1)? GL_TEXTURE_1D: GL_TEXTURE_2D;
+ tex->depth = depth;
+
+ glGenTextures(1, &tex->bindcode);
+
+ if (!tex->bindcode) {
+ fprintf(stderr, "GPUTexture: texture create failed: %d\n",
+ (int)glGetError());
+ GPU_texture_free(tex);
+ return NULL;
+ }
+
+ if (!GLEW_ARB_texture_non_power_of_two) {
+ tex->w = larger_pow2(tex->w);
+ tex->h = larger_pow2(tex->h);
+ }
+
+ tex->number = 0;
+ glBindTexture(tex->target, tex->bindcode);
+
+ if(depth) {
+ type = GL_UNSIGNED_BYTE;
+ format = GL_DEPTH_COMPONENT;
+ internalformat = GL_DEPTH_COMPONENT;
+ }
+ else {
+ type = GL_UNSIGNED_BYTE;
+ format = GL_RGBA;
+ internalformat = GL_RGBA8;
+
+ if (fpixels)
+ pixels = GPU_texture_convert_pixels(w*h, fpixels);
+ }
+
+ if (tex->target == GL_TEXTURE_1D) {
+ glTexImage1D(tex->target, 0, internalformat, tex->w, 0, format, type, 0);
+
+ if (fpixels) {
+ glTexSubImage1D(tex->target, 0, 0, w, format, type,
+ pixels? pixels: fpixels);
+
+ if (tex->w > w)
+ GPU_glTexSubImageEmpty(tex->target, format, w, 0,
+ tex->w-w, 1);
+ }
+ }
+ else {
+ glTexImage2D(tex->target, 0, internalformat, tex->w, tex->h, 0,
+ format, type, 0);
+
+ if (fpixels) {
+ glTexSubImage2D(tex->target, 0, 0, 0, w, h,
+ format, type, pixels? pixels: fpixels);
+
+ if (tex->w > w)
+ GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w-w, tex->h);
+ if (tex->h > h)
+ GPU_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h-h);
+ }
+ }
+
+ if (pixels)
+ MEM_freeN(pixels);
+
+ if(depth) {
+ glTexParameteri(tex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(tex->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(tex->target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE);
+ glTexParameteri(tex->target, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);
+ glTexParameteri(tex->target, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY);
+ }
+ else {
+ glTexParameteri(tex->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(tex->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+
+ if (tex->target != GL_TEXTURE_1D) {
+ /* CLAMP_TO_BORDER is an OpenGL 1.3 core feature */
+ GLenum wrapmode = (depth)? GL_CLAMP_TO_EDGE: GL_CLAMP_TO_BORDER;
+ glTexParameteri(tex->target, GL_TEXTURE_WRAP_S, wrapmode);
+ glTexParameteri(tex->target, GL_TEXTURE_WRAP_T, wrapmode);
+
+#if 0
+ float borderColor[] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
+#endif
+ }
+ else
+ glTexParameteri(tex->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+
+ return tex;
+}
+
+GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time)
+{
+ GPUTexture *tex;
+ GLint w, h, border, lastbindcode, bindcode;
+
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
+
+ GPU_update_image_time(ima, time);
+ bindcode = GPU_verify_image(ima, 0, 0, 0);
+
+ if(ima->gputexture) {
+ ima->gputexture->bindcode = bindcode;
+ glBindTexture(GL_TEXTURE_2D, lastbindcode);
+ return ima->gputexture;
+ }
+
+ if(!bindcode) {
+ glBindTexture(GL_TEXTURE_2D, lastbindcode);
+ return NULL;
+ }
+
+ tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
+ tex->bindcode = bindcode;
+ tex->number = -1;
+ tex->refcount = 1;
+ tex->target = GL_TEXTURE_2D;
+ tex->fromblender = 1;
+
+ ima->gputexture= tex;
+
+ if (!glIsTexture(tex->bindcode)) {
+ GPU_print_error("Blender Texture");
+ }
+ else {
+ glBindTexture(GL_TEXTURE_2D, tex->bindcode);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BORDER, &border);
+
+ tex->w = w - border;
+ tex->h = h - border;
+ }
+
+ glBindTexture(GL_TEXTURE_2D, lastbindcode);
+
+ return tex;
+}
+
+GPUTexture *GPU_texture_create_1D(int w, float *fpixels)
+{
+ GPUTexture *tex = GPU_texture_create_nD(w, 1, 1, fpixels, 0);
+
+ if (tex)
+ GPU_texture_unbind(tex);
+
+ return tex;
+}
+
+GPUTexture *GPU_texture_create_2D(int w, int h, float *fpixels)
+{
+ GPUTexture *tex = GPU_texture_create_nD(w, h, 2, fpixels, 0);
+
+ if (tex)
+ GPU_texture_unbind(tex);
+
+ return tex;
+}
+
+GPUTexture *GPU_texture_create_depth(int w, int h)
+{
+ GPUTexture *tex = GPU_texture_create_nD(w, h, 2, NULL, 1);
+
+ if (tex)
+ GPU_texture_unbind(tex);
+
+ return tex;
+}
+
+void GPU_texture_bind(GPUTexture *tex, int number)
+{
+ GLenum arbnumber;
+
+ if (number >= GG.maxtextures) {
+ GPU_print_error("Not enough texture slots.");
+ return;
+ }
+
+ if(number == -1)
+ return;
+
+ GPU_print_error("Pre Texture Bind");
+
+ arbnumber = (GLenum)((GLuint)GL_TEXTURE0_ARB + number);
+ if (number != 0) glActiveTextureARB(arbnumber);
+ glBindTexture(tex->target, tex->bindcode);
+ glEnable(tex->target);
+ if (number != 0) glActiveTextureARB(GL_TEXTURE0_ARB);
+
+ tex->number = number;
+
+ GPU_print_error("Post Texture Bind");
+}
+
+void GPU_texture_unbind(GPUTexture *tex)
+{
+ GLenum arbnumber;
+
+ if (tex->number >= GG.maxtextures) {
+ GPU_print_error("Not enough texture slots.");
+ return;
+ }
+
+ if(tex->number == -1)
+ return;
+
+ GPU_print_error("Pre Texture Unbind");
+
+ arbnumber = (GLenum)((GLuint)GL_TEXTURE0_ARB + tex->number);
+ if (tex->number != 0) glActiveTextureARB(arbnumber);
+ glBindTexture(tex->target, 0);
+ glDisable(tex->target);
+ if (tex->number != 0) glActiveTextureARB(GL_TEXTURE0_ARB);
+
+ tex->number = -1;
+
+ GPU_print_error("Post Texture Unbind");
+}
+
+void GPU_texture_free(GPUTexture *tex)
+{
+ tex->refcount--;
+
+ if (tex->refcount < 0)
+ fprintf(stderr, "GPUTexture: negative refcount\n");
+
+ if (tex->refcount == 0) {
+ if (tex->fb)
+ GPU_framebuffer_texture_detach(tex->fb, tex);
+ if (tex->bindcode && !tex->fromblender)
+ glDeleteTextures(1, &tex->bindcode);
+
+ MEM_freeN(tex);
+ }
+}
+
+void GPU_texture_ref(GPUTexture *tex)
+{
+ tex->refcount++;
+}
+
+int GPU_texture_target(GPUTexture *tex)
+{
+ return tex->target;
+}
+
+int GPU_texture_opengl_width(GPUTexture *tex)
+{
+ return tex->w;
+}
+
+int GPU_texture_opengl_height(GPUTexture *tex)
+{
+ return tex->h;
+}
+
+GPUFrameBuffer *GPU_texture_framebuffer(GPUTexture *tex)
+{
+ return tex->fb;
+}
+
+/* GPUFrameBuffer */
+
+struct GPUFrameBuffer {
+ GLuint object;
+ GPUTexture *colortex;
+ GPUTexture *depthtex;
+};
+
+GPUFrameBuffer *GPU_framebuffer_create()
+{
+ GPUFrameBuffer *fb;
+
+ if (!GLEW_EXT_framebuffer_object)
+ return NULL;
+
+ fb= MEM_callocN(sizeof(GPUFrameBuffer), "GPUFrameBuffer");
+ glGenFramebuffersEXT(1, &fb->object);
+
+ if (!fb->object) {
+ fprintf(stderr, "GPUFFrameBuffer: framebuffer gen failed. %d\n",
+ (int)glGetError());
+ GPU_framebuffer_free(fb);
+ return NULL;
+ }
+
+ return fb;
+}
+
+int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex)
+{
+ GLenum status;
+ GLenum attachment;
+
+ if(tex->depth)
+ attachment = GL_DEPTH_ATTACHMENT_EXT;
+ else
+ attachment = GL_COLOR_ATTACHMENT0_EXT;
+
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb->object);
+ GG.currentfb = fb->object;
+
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attachment,
+ tex->target, tex->bindcode, 0);
+
+ if(tex->depth) {
+ glDrawBuffer(GL_NONE);
+ glReadBuffer(GL_NONE);
+ }
+ else {
+ glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
+ glReadBuffer(GL_NONE);
+ }
+
+ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ GPU_framebuffer_restore();
+ GPU_print_framebuffer_error(status);
+ return 0;
+ }
+
+ if(tex->depth)
+ fb->depthtex = tex;
+ else
+ fb->colortex = tex;
+
+ tex->fb= fb;
+
+ return 1;
+}
+
+void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex)
+{
+ GLenum attachment;
+
+ if(!tex->fb)
+ return;
+
+ if(GG.currentfb != tex->fb->object) {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, tex->fb->object);
+ GG.currentfb = tex->fb->object;
+ }
+
+ if(tex->depth) {
+ fb->depthtex = NULL;
+ attachment = GL_DEPTH_ATTACHMENT_EXT;
+ }
+ else {
+ fb->colortex = NULL;
+ attachment = GL_COLOR_ATTACHMENT0_EXT;
+ }
+
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attachment,
+ tex->target, 0, 0);
+
+ tex->fb = NULL;
+}
+
+void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex)
+{
+ /* push attributes */
+ glPushAttrib(GL_ENABLE_BIT);
+ glPushAttrib(GL_VIEWPORT_BIT);
+ glDisable(GL_SCISSOR_TEST);
+
+ /* bind framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, tex->fb->object);
+
+ /* push matrices and set default viewport and matrix */
+ glViewport(0, 0, tex->w, tex->h);
+ GG.currentfb = tex->fb->object;
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+}
+
+void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex)
+{
+ /* restore matrix */
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+
+ /* restore attributes */
+ glPopAttrib();
+ glPopAttrib();
+ glEnable(GL_SCISSOR_TEST);
+}
+
+void GPU_framebuffer_free(GPUFrameBuffer *fb)
+{
+ if(fb->depthtex)
+ GPU_framebuffer_texture_detach(fb, fb->depthtex);
+ if(fb->colortex)
+ GPU_framebuffer_texture_detach(fb, fb->colortex);
+
+ if(fb->object) {
+ glDeleteFramebuffersEXT(1, &fb->object);
+
+ if (GG.currentfb == fb->object) {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ GG.currentfb = 0;
+ }
+ }
+
+ MEM_freeN(fb);
+}
+
+void GPU_framebuffer_restore()
+{
+ if (GG.currentfb != 0) {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ GG.currentfb = 0;
+ }
+}
+
+/* GPUShader */
+
+struct GPUShader {
+ GLhandleARB object; /* handle for full shader */
+ GLhandleARB vertex; /* handle for vertex shader */
+ GLhandleARB fragment; /* handle for fragment shader */
+ GLhandleARB lib; /* handle for libment shader */
+ int totattrib; /* total number of attributes */
+};
+
+static void shader_print_errors(char *task, char *log, const char *code)
+{
+ const char *c, *pos, *end = code + strlen(code);
+ int line = 1;
+
+ fprintf(stderr, "GPUShader: %s error:\n", task);
+
+ if(G.f & G_DEBUG) {
+ c = code;
+ while ((c < end) && (pos = strchr(c, '\n'))) {
+ fprintf(stderr, "%2d ", line);
+ fwrite(c, (pos+1)-c, 1, stderr);
+ c = pos+1;
+ line++;
+ }
+
+ fprintf(stderr, "%s", c);
+ }
+
+ fprintf(stderr, "%s\n", log);
+}
+
+GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUShader *lib)
+{
+ GLint status;
+ GLcharARB log[5000];
+ GLsizei length = 0;
+ GPUShader *shader;
+
+ if (!GLEW_ARB_vertex_shader || !GLEW_ARB_fragment_shader)
+ return NULL;
+
+ shader = MEM_callocN(sizeof(GPUShader), "GPUShader");
+
+ if(vertexcode)
+ shader->vertex = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
+ if(fragcode)
+ shader->fragment = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
+ shader->object = glCreateProgramObjectARB();
+
+ if (!shader->object ||
+ (vertexcode && !shader->vertex) ||
+ (fragcode && !shader->fragment)) {
+ fprintf(stderr, "GPUShader, object creation failed.\n");
+ GPU_shader_free(shader);
+ return NULL;
+ }
+
+ if(lib && lib->lib)
+ glAttachObjectARB(shader->object, lib->lib);
+
+ if(vertexcode) {
+ glAttachObjectARB(shader->object, shader->vertex);
+ glShaderSourceARB(shader->vertex, 1, (const char**)&vertexcode, NULL);
+
+ glCompileShaderARB(shader->vertex);
+ glGetObjectParameterivARB(shader->vertex, GL_OBJECT_COMPILE_STATUS_ARB, &status);
+
+ if (!status) {
+ glValidateProgramARB(shader->vertex);
+ glGetInfoLogARB(shader->vertex, sizeof(log), &length, log);
+ shader_print_errors("compile", log, vertexcode);
+
+ GPU_shader_free(shader);
+ return NULL;
+ }
+ }
+
+ if(fragcode) {
+ glAttachObjectARB(shader->object, shader->fragment);
+ glShaderSourceARB(shader->fragment, 1, (const char**)&fragcode, NULL);
+
+ glCompileShaderARB(shader->fragment);
+ glGetObjectParameterivARB(shader->fragment, GL_OBJECT_COMPILE_STATUS_ARB, &status);
+
+ if (!status) {
+ glValidateProgramARB(shader->fragment);
+ glGetInfoLogARB(shader->fragment, sizeof(log), &length, log);
+ shader_print_errors("compile", log, fragcode);
+
+ GPU_shader_free(shader);
+ return NULL;
+ }
+ }
+
+ glLinkProgramARB(shader->object);
+ glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status);
+ if (!status) {
+ glGetInfoLogARB(shader->object, sizeof(log), &length, log);
+ shader_print_errors("linking", log, fragcode);
+
+ GPU_shader_free(shader);
+ return NULL;
+ }
+
+ return shader;
+}
+
+GPUShader *GPU_shader_create_lib(const char *code)
+{
+ GLint status;
+ GLcharARB log[5000];
+ GLsizei length = 0;
+ GPUShader *shader;
+
+ if (!GLEW_ARB_vertex_shader || !GLEW_ARB_fragment_shader)
+ return NULL;
+
+ shader = MEM_callocN(sizeof(GPUShader), "GPUShader");
+
+ shader->lib = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
+
+ if (!shader->lib) {
+ fprintf(stderr, "GPUShader, object creation failed.\n");
+ GPU_shader_free(shader);
+ return NULL;
+ }
+
+ glShaderSourceARB(shader->lib, 1, (const char**)&code, NULL);
+
+ glCompileShaderARB(shader->lib);
+ glGetObjectParameterivARB(shader->lib, GL_OBJECT_COMPILE_STATUS_ARB, &status);
+
+ if (!status) {
+ glValidateProgramARB(shader->lib);
+ glGetInfoLogARB(shader->lib, sizeof(log), &length, log);
+ shader_print_errors("compile", log, code);
+
+ GPU_shader_free(shader);
+ return NULL;
+ }
+
+ return shader;
+}
+
+void GPU_shader_bind(GPUShader *shader)
+{
+ GPU_print_error("Pre Shader Bind");
+ glUseProgramObjectARB(shader->object);
+ GPU_print_error("Post Shader Bind");
+}
+
+void GPU_shader_unbind()
+{
+ GPU_print_error("Pre Shader Unbind");
+ glUseProgramObjectARB(0);
+ GPU_print_error("Post Shader Unbind");
+}
+
+void GPU_shader_free(GPUShader *shader)
+{
+ if (shader->lib)
+ glDeleteObjectARB(shader->lib);
+ if (shader->vertex)
+ glDeleteObjectARB(shader->vertex);
+ if (shader->fragment)
+ glDeleteObjectARB(shader->fragment);
+ if (shader->object)
+ glDeleteObjectARB(shader->object);
+ MEM_freeN(shader);
+}
+
+int GPU_shader_get_uniform(GPUShader *shader, char *name)
+{
+ return glGetUniformLocationARB(shader->object, name);
+}
+
+void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, float *value)
+{
+ if(location == -1)
+ return;
+
+ GPU_print_error("Pre Uniform Vector");
+
+ if (length == 1) glUniform1fvARB(location, arraysize, value);
+ else if (length == 2) glUniform2fvARB(location, arraysize, value);
+ else if (length == 3) glUniform3fvARB(location, arraysize, value);
+ else if (length == 4) glUniform4fvARB(location, arraysize, value);
+ else if (length == 9) glUniformMatrix3fvARB(location, arraysize, 0, value);
+ else if (length == 16) glUniformMatrix4fvARB(location, arraysize, 0, value);
+
+ GPU_print_error("Post Uniform Vector");
+}
+
+void GPU_shader_uniform_texture(GPUShader *shader, int location, GPUTexture *tex)
+{
+ GLenum arbnumber;
+
+ if (tex->number >= GG.maxtextures) {
+ GPU_print_error("Not enough texture slots.");
+ return;
+ }
+
+ if(tex->number == -1)
+ return;
+
+ if(location == -1)
+ return;
+
+ GPU_print_error("Pre Uniform Texture");
+
+ arbnumber = (GLenum)((GLuint)GL_TEXTURE0_ARB + tex->number);
+
+ if (tex->number != 0) glActiveTextureARB(arbnumber);
+ glBindTexture(tex->target, tex->bindcode);
+ glUniform1iARB(location, tex->number);
+ glEnable(tex->target);
+ if (tex->number != 0) glActiveTextureARB(GL_TEXTURE0_ARB);
+
+ GPU_print_error("Post Uniform Texture");
+}
+
+int GPU_shader_get_attribute(GPUShader *shader, char *name)
+{
+ int index;
+
+ GPU_print_error("Pre Get Attribute");
+
+ index = glGetAttribLocationARB(shader->object, name);
+
+ GPU_print_error("Post Get Attribute");
+
+ return index;
+}
+
+#if 0
+/* GPUPixelBuffer */
+
+typedef struct GPUPixelBuffer {
+ GLuint bindcode[2];
+ GLuint current;
+ int datasize;
+ int numbuffers;
+ int halffloat;
+} GPUPixelBuffer;
+
+void GPU_pixelbuffer_free(GPUPixelBuffer *pb)
+{
+ if (pb->bindcode[0])
+ glDeleteBuffersARB(pb->numbuffers, pb->bindcode);
+ MEM_freeN(pb);
+}
+
+GPUPixelBuffer *gpu_pixelbuffer_create(int x, int y, int halffloat, int numbuffers)
+{
+ GPUPixelBuffer *pb;
+
+ if (!GLEW_ARB_multitexture || !GLEW_EXT_pixel_buffer_object)
+ return NULL;
+
+ pb = MEM_callocN(sizeof(GPUPixelBuffer), "GPUPBO");
+ pb->datasize = x*y*4*((halffloat)? 16: 8);
+ pb->numbuffers = numbuffers;
+ pb->halffloat = halffloat;
+
+ glGenBuffersARB(pb->numbuffers, pb->bindcode);
+
+ if (!pb->bindcode[0]) {
+ fprintf(stderr, "GPUPixelBuffer allocation failed\n");
+ GPU_pixelbuffer_free(pb);
+ return NULL;
+ }
+
+ return pb;
+}
+
+void GPU_pixelbuffer_texture(GPUTexture *tex, GPUPixelBuffer *pb)
+{
+ void *pixels;
+ int i;
+
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
+
+ for (i = 0; i < pb->numbuffers; i++) {
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->bindcode[pb->current]);
+ glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->datasize, NULL,
+ GL_STREAM_DRAW_ARB);
+
+ pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY);
+ /*memcpy(pixels, _oImage.data(), pb->datasize);*/
+
+ if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT)) {
+ fprintf(stderr, "Could not unmap opengl PBO\n");
+ break;
+ }
+ }
+
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
+}
+
+static int pixelbuffer_map_into_gpu(GLuint bindcode)
+{
+ void *pixels;
+
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
+ pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY);
+
+ /* do stuff in pixels */
+
+ if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT)) {
+ fprintf(stderr, "Could not unmap opengl PBO\n");
+ return 0;
+ }
+
+ return 1;
+}
+
+static void pixelbuffer_copy_to_texture(GPUTexture *tex, GPUPixelBuffer *pb, GLuint bindcode)
+{
+ GLenum type = (pb->halffloat)? GL_HALF_FLOAT_NV: GL_UNSIGNED_BYTE;
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
+
+ glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, tex->w, tex->h,
+ GL_RGBA, type, NULL);
+
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
+}
+
+void GPU_pixelbuffer_async_to_gpu(GPUTexture *tex, GPUPixelBuffer *pb)
+{
+ int newbuffer;
+
+ if (pb->numbuffers == 1) {
+ pixelbuffer_copy_to_texture(tex, pb, pb->bindcode[0]);
+ pixelbuffer_map_into_gpu(pb->bindcode[0]);
+ }
+ else {
+ pb->current = (pb->current+1)%pb->numbuffers;
+ newbuffer = (pb->current+1)%pb->numbuffers;
+
+ pixelbuffer_map_into_gpu(pb->bindcode[newbuffer]);
+ pixelbuffer_copy_to_texture(tex, pb, pb->bindcode[pb->current]);
+ }
+}
+#endif
+
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
new file mode 100644
index 00000000000..d4da2866d96
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -0,0 +1,1496 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Brecht Van Lommel.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <string.h>
+
+#include "GL/glew.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_image_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_listBase.h"
+#include "DNA_material_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_texture_types.h"
+#include "DNA_view3d_types.h"
+#include "DNA_world_types.h"
+
+#include "BKE_anim.h"
+#include "BKE_colortools.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_node.h"
+#include "BKE_scene.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+
+#include "gpu_codegen.h"
+
+#include <string.h>
+
+/* Structs */
+
+typedef enum DynMatProperty {
+ DYN_LAMP_CO = 1,
+ DYN_LAMP_VEC = 2,
+ DYN_LAMP_IMAT = 4,
+ DYN_LAMP_PERSMAT = 8,
+} DynMatProperty;
+
+struct GPUMaterial {
+ Scene *scene;
+ Material *ma;
+
+ /* for creating the material */
+ ListBase nodes;
+ GPUNodeLink *outlink;
+
+ /* for binding the material */
+ GPUPass *pass;
+ GPUVertexAttribs attribs;
+ int bound;
+ int builtins;
+ int alpha, obcolalpha;
+ int dynproperty;
+
+ /* for passing uniforms */
+ int viewmatloc, invviewmatloc;
+ int obmatloc, invobmatloc;
+ int obcolloc;
+
+ ListBase lamps;
+};
+
+struct GPULamp {
+ Scene *scene;
+ Object *ob;
+ Object *par;
+ Lamp *la;
+
+ int type, mode, lay;
+
+ float dynenergy, dyncol[3];
+ float energy, col[3];
+
+ float co[3], vec[3];
+ float dynco[3], dynvec[3];
+ float obmat[4][4];
+ float imat[4][4];
+ float dynimat[4][4];
+
+ float spotsi, spotbl, k;
+ float dist, att1, att2;
+
+ float bias, d, clipend;
+ int size;
+
+ int falloff_type;
+ struct CurveMapping *curfalloff;
+
+ float winmat[4][4];
+ float viewmat[4][4];
+ float persmat[4][4];
+ float dynpersmat[4][4];
+
+ GPUFrameBuffer *fb;
+ GPUTexture *tex;
+
+ ListBase materials;
+};
+
+/* Functions */
+
+static GPUMaterial *GPU_material_construct_begin(Material *ma)
+{
+ GPUMaterial *material = MEM_callocN(sizeof(GPUMaterial), "GPUMaterial");
+
+ material->ma= ma;
+
+ return material;
+}
+
+static void gpu_material_set_attrib_id(GPUMaterial *material)
+{
+ GPUVertexAttribs *attribs;
+ GPUShader *shader;
+ GPUPass *pass;
+ char name[32];
+ int a, b;
+
+ attribs= &material->attribs;
+ pass= material->pass;
+ if(!pass) {
+ attribs->totlayer = 0;
+ return;
+ }
+
+ shader= GPU_pass_shader(pass);
+ if(!shader) {
+ attribs->totlayer = 0;
+ return;
+ }
+
+ /* convert from attribute number to the actual id assigned by opengl,
+ * in case the attrib does not get a valid index back, it was probably
+ * removed by the glsl compiler by dead code elimination */
+
+ for(a=0, b=0; a<attribs->totlayer; a++) {
+ sprintf(name, "att%d", attribs->layer[a].glindex);
+ attribs->layer[a].glindex = GPU_shader_get_attribute(shader, name);
+
+ if(attribs->layer[a].glindex >= 0) {
+ attribs->layer[b] = attribs->layer[a];
+ b++;
+ }
+ }
+
+ attribs->totlayer = b;
+}
+
+static int GPU_material_construct_end(GPUMaterial *material)
+{
+ if (material->outlink) {
+ GPUNodeLink *outlink;
+ GPUShader *shader;
+
+ outlink = material->outlink;
+ material->pass = GPU_generate_pass(&material->nodes, outlink,
+ &material->attribs, &material->builtins, material->ma->id.name);
+
+ if(!material->pass)
+ return 0;
+
+ gpu_material_set_attrib_id(material);
+
+ shader = GPU_pass_shader(material->pass);
+
+ if(material->builtins & GPU_VIEW_MATRIX)
+ material->viewmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_VIEW_MATRIX));
+ if(material->builtins & GPU_INVERSE_VIEW_MATRIX)
+ material->invviewmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_INVERSE_VIEW_MATRIX));
+ if(material->builtins & GPU_OBJECT_MATRIX)
+ material->obmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_OBJECT_MATRIX));
+ if(material->builtins & GPU_INVERSE_OBJECT_MATRIX)
+ material->invobmatloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_INVERSE_OBJECT_MATRIX));
+ if(material->builtins & GPU_OBCOLOR)
+ material->obcolloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_OBCOLOR));
+
+ return 1;
+ }
+
+ return 0;
+}
+
+void GPU_material_free(Material *ma)
+{
+ LinkData *link;
+ LinkData *nlink, *mlink, *next;
+
+ for(link=ma->gpumaterial.first; link; link=link->next) {
+ GPUMaterial *material = link->data;
+
+ if(material->pass)
+ GPU_pass_free(material->pass);
+
+ for(nlink=material->lamps.first; nlink; nlink=nlink->next) {
+ GPULamp *lamp = nlink->data;
+
+ for(mlink=lamp->materials.first; mlink; mlink=next) {
+ next = mlink->next;
+ if(mlink->data == ma)
+ BLI_freelinkN(&lamp->materials, mlink);
+ }
+ }
+
+ BLI_freelistN(&material->lamps);
+
+ MEM_freeN(material);
+ }
+
+ BLI_freelistN(&ma->gpumaterial);
+}
+
+void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time)
+{
+ if(material->pass) {
+ LinkData *nlink;
+ GPULamp *lamp;
+
+ /* handle layer lamps */
+ for(nlink=material->lamps.first; nlink; nlink=nlink->next) {
+ lamp= nlink->data;
+
+ if((lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) {
+ lamp->dynenergy = lamp->energy;
+ VECCOPY(lamp->dyncol, lamp->col);
+ }
+ else {
+ lamp->dynenergy = 0.0f;
+ lamp->dyncol[0]= lamp->dyncol[1]= lamp->dyncol[2] = 0.0f;
+ }
+ }
+
+ GPU_pass_bind(material->pass, time);
+ material->bound = 1;
+ }
+}
+
+void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float viewmat[][4], float viewinv[][4], float obcol[4])
+{
+ if(material->pass) {
+ GPUShader *shader = GPU_pass_shader(material->pass);
+ LinkData *nlink;
+ GPULamp *lamp;
+ float invmat[4][4], col[4];
+
+ /* handle builtins */
+ if(material->builtins & GPU_VIEW_MATRIX) {
+ GPU_shader_uniform_vector(shader, material->viewmatloc, 16, 1, (float*)viewmat);
+ }
+ if(material->builtins & GPU_INVERSE_VIEW_MATRIX) {
+ GPU_shader_uniform_vector(shader, material->invviewmatloc, 16, 1, (float*)viewinv);
+ }
+ if(material->builtins & GPU_OBJECT_MATRIX) {
+ GPU_shader_uniform_vector(shader, material->obmatloc, 16, 1, (float*)obmat);
+ }
+ if(material->builtins & GPU_INVERSE_OBJECT_MATRIX) {
+ Mat4Invert(invmat, obmat);
+ GPU_shader_uniform_vector(shader, material->invobmatloc, 16, 1, (float*)invmat);
+ }
+ if(material->builtins & GPU_OBCOLOR) {
+ QUATCOPY(col, obcol);
+ CLAMP(col[3], 0.0f, 1.0f);
+ GPU_shader_uniform_vector(shader, material->obcolloc, 4, 1, col);
+ }
+
+ /* update lamps */
+ for(nlink=material->lamps.first; nlink; nlink=nlink->next) {
+ lamp= nlink->data;
+
+ if(material->dynproperty & DYN_LAMP_VEC) {
+ VECCOPY(lamp->dynvec, lamp->vec);
+ Normalize(lamp->dynvec);
+ VecMulf(lamp->dynvec, -1.0f);
+ Mat4Mul3Vecfl(viewmat, lamp->dynvec);
+ }
+
+ if(material->dynproperty & DYN_LAMP_CO) {
+ VECCOPY(lamp->dynco, lamp->co);
+ Mat4MulVecfl(viewmat, lamp->dynco);
+ }
+
+ if(material->dynproperty & DYN_LAMP_IMAT)
+ Mat4MulMat4(lamp->dynimat, viewinv, lamp->imat);
+ if(material->dynproperty & DYN_LAMP_PERSMAT)
+ Mat4MulMat4(lamp->dynpersmat, viewinv, lamp->persmat);
+ }
+
+ GPU_pass_update_uniforms(material->pass);
+ }
+}
+
+void GPU_material_unbind(GPUMaterial *material)
+{
+ if (material->pass) {
+ material->bound = 0;
+ GPU_pass_unbind(material->pass);
+ }
+}
+
+int GPU_material_bound(GPUMaterial *material)
+{
+ return material->bound;
+}
+
+void GPU_material_vertex_attributes(GPUMaterial *material, GPUVertexAttribs *attribs)
+{
+ *attribs = material->attribs;
+}
+
+void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link)
+{
+ if(!material->outlink)
+ material->outlink= link;
+}
+
+void GPU_material_enable_alpha(GPUMaterial *material)
+{
+ material->alpha= 1;
+}
+
+GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[3])
+{
+ if(material->alpha || (material->obcolalpha && obcol[3] < 1.0f))
+ return GPU_BLEND_ALPHA;
+ else
+ return GPU_BLEND_SOLID;
+}
+
+void gpu_material_add_node(GPUMaterial *material, GPUNode *node)
+{
+ BLI_addtail(&material->nodes, node);
+}
+
+/* Code generation */
+
+static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **lv, GPUNodeLink **dist)
+{
+ GPUNodeLink *visifac, *inpr;
+
+ /* from get_lamp_visibility */
+ if(lamp->type==LA_SUN || lamp->type==LA_HEMI) {
+ mat->dynproperty |= DYN_LAMP_VEC;
+ GPU_link(mat, "lamp_visibility_sun_hemi", GPU_dynamic_uniform(lamp->dynvec), lv, dist, &visifac);
+ return visifac;
+ }
+ else {
+ mat->dynproperty |= DYN_LAMP_CO;
+ GPU_link(mat, "lamp_visibility_other", GPU_builtin(GPU_VIEW_POSITION), GPU_dynamic_uniform(lamp->dynco), lv, dist, &visifac);
+
+ if(lamp->type==LA_AREA)
+ return visifac;
+
+ switch(lamp->falloff_type)
+ {
+ case LA_FALLOFF_CONSTANT:
+ break;
+ case LA_FALLOFF_INVLINEAR:
+ GPU_link(mat, "lamp_falloff_invlinear", GPU_uniform(&lamp->dist), *dist, &visifac);
+ break;
+ case LA_FALLOFF_INVSQUARE:
+ GPU_link(mat, "lamp_falloff_invsquare", GPU_uniform(&lamp->dist), *dist, &visifac);
+ break;
+ case LA_FALLOFF_SLIDERS:
+ GPU_link(mat, "lamp_falloff_sliders", GPU_uniform(&lamp->dist), GPU_uniform(&lamp->att1), GPU_uniform(&lamp->att2), *dist, &visifac);
+ break;
+ case LA_FALLOFF_CURVE:
+ {
+ float *array;
+ int size;
+
+ curvemapping_table_RGBA(lamp->curfalloff, &array, &size);
+ GPU_link(mat, "lamp_falloff_curve", GPU_uniform(&lamp->dist), GPU_texture(size, array), *dist, &visifac);
+ }
+ break;
+ }
+
+ if(lamp->mode & LA_SPHERE)
+ GPU_link(mat, "lamp_visibility_sphere", GPU_uniform(&lamp->dist), *dist, visifac, &visifac);
+
+ if(lamp->type == LA_SPOT) {
+ if(lamp->mode & LA_SQUARE) {
+ mat->dynproperty |= DYN_LAMP_VEC|DYN_LAMP_IMAT;
+ GPU_link(mat, "lamp_visibility_spot_square", GPU_dynamic_uniform(lamp->dynvec), GPU_dynamic_uniform((float*)lamp->dynimat), *lv, &inpr);
+ }
+ else {
+ mat->dynproperty |= DYN_LAMP_VEC;
+ GPU_link(mat, "lamp_visibility_spot_circle", GPU_dynamic_uniform(lamp->dynvec), *lv, &inpr);
+ }
+
+ GPU_link(mat, "lamp_visibility_spot", GPU_uniform(&lamp->spotsi), GPU_uniform(&lamp->spotbl), inpr, visifac, &visifac);
+ }
+
+ GPU_link(mat, "lamp_visibility_clamp", visifac, &visifac);
+
+ return visifac;
+ }
+}
+
+#if 0
+static void area_lamp_vectors(LampRen *lar)
+{
+ float xsize= 0.5*lar->area_size, ysize= 0.5*lar->area_sizey, multifac;
+
+ /* make it smaller, so area light can be multisampled */
+ multifac= 1.0f/sqrt((float)lar->ray_totsamp);
+ xsize *= multifac;
+ ysize *= multifac;
+
+ /* corner vectors */
+ lar->area[0][0]= lar->co[0] - xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
+ lar->area[0][1]= lar->co[1] - xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
+ lar->area[0][2]= lar->co[2] - xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[1][0]= lar->co[0] - xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
+ lar->area[1][1]= lar->co[1] - xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
+ lar->area[1][2]= lar->co[2] - xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[2][0]= lar->co[0] + xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
+ lar->area[2][1]= lar->co[1] + xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
+ lar->area[2][2]= lar->co[2] + xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[3][0]= lar->co[0] + xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
+ lar->area[3][1]= lar->co[1] + xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
+ lar->area[3][2]= lar->co[2] + xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
+ /* only for correction button size, matrix size works on energy */
+ lar->areasize= lar->dist*lar->dist/(4.0*xsize*ysize);
+}
+#endif
+
+static void ramp_blend(GPUMaterial *mat, GPUNodeLink *fac, GPUNodeLink *col1, GPUNodeLink *col2, int type, GPUNodeLink **outcol)
+{
+ static char *names[] = {"mix_blend", "mix_add", "mix_mult", "mix_sub",
+ "mix_screen", "mix_div", "mix_diff", "mix_dark", "mix_light",
+ "mix_overlay", "mix_dodge", "mix_burn", "mix_hue", "mix_sat",
+ "mix_val", "mix_color"};
+
+ GPU_link(mat, names[type], fac, col1, col2, outcol);
+}
+
+static void do_colorband_blend(GPUMaterial *mat, ColorBand *coba, GPUNodeLink *fac, float rampfac, int type, GPUNodeLink *incol, GPUNodeLink **outcol)
+{
+ GPUNodeLink *tmp, *alpha, *col;
+ float *array;
+ int size;
+
+ /* do colorband */
+ colorband_table_RGBA(coba, &array, &size);
+ GPU_link(mat, "valtorgb", fac, GPU_texture(size, array), &col, &tmp);
+
+ /* use alpha in fac */
+ GPU_link(mat, "mtex_alpha_from_col", col, &alpha);
+ GPU_link(mat, "math_multiply", alpha, GPU_uniform(&rampfac), &fac);
+
+ /* blending method */
+ ramp_blend(mat, fac, incol, col, type, outcol);
+}
+
+static void ramp_diffuse_result(GPUShadeInput *shi, GPUNodeLink **diff)
+{
+ Material *ma= shi->mat;
+ GPUMaterial *mat= shi->gpumat;
+ GPUNodeLink *fac;
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS)) {
+ if(ma->ramp_col) {
+ if(ma->rampin_col==MA_RAMP_IN_RESULT) {
+ GPU_link(mat, "ramp_rgbtobw", *diff, &fac);
+
+ /* colorband + blend */
+ do_colorband_blend(mat, ma->ramp_col, fac, ma->rampfac_col, ma->rampblend_col, *diff, diff);
+ }
+ }
+ }
+}
+
+static void add_to_diffuse(GPUMaterial *mat, Material *ma, GPUShadeInput *shi, GPUNodeLink *is, GPUNodeLink *rgb, GPUNodeLink **diff)
+{
+ GPUNodeLink *fac, *tmp, *addcol;
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS) &&
+ ma->ramp_col && (ma->mode & MA_RAMP_COL)) {
+ /* MA_RAMP_IN_RESULT is exceptional */
+ if(ma->rampin_col==MA_RAMP_IN_RESULT) {
+ addcol = shi->rgb;
+ }
+ else {
+ /* input */
+ switch(ma->rampin_col) {
+ case MA_RAMP_IN_ENERGY:
+ GPU_link(mat, "ramp_rgbtobw", rgb, &fac);
+ break;
+ case MA_RAMP_IN_SHADER:
+ fac= is;
+ break;
+ case MA_RAMP_IN_NOR:
+ GPU_link(mat, "vec_math_dot", shi->view, shi->vn, &tmp, &fac);
+ break;
+ default:
+ GPU_link(mat, "set_value_zero", &fac);
+ break;
+ }
+
+ /* colorband + blend */
+ do_colorband_blend(mat, ma->ramp_col, fac, ma->rampfac_col, ma->rampblend_col, shi->rgb, &addcol);
+ }
+ }
+ else
+ addcol = shi->rgb;
+
+ /* output to */
+ GPU_link(mat, "shade_madd", *diff, rgb, addcol, diff);
+}
+
+static void ramp_spec_result(GPUShadeInput *shi, GPUNodeLink **spec)
+{
+ Material *ma= shi->mat;
+ GPUMaterial *mat= shi->gpumat;
+ GPUNodeLink *fac;
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS) &&
+ ma->ramp_spec && ma->rampin_spec==MA_RAMP_IN_RESULT) {
+ GPU_link(mat, "ramp_rgbtobw", *spec, &fac);
+
+ /* colorband + blend */
+ do_colorband_blend(mat, ma->ramp_spec, fac, ma->rampfac_spec, ma->rampblend_spec, *spec, spec);
+ }
+}
+
+static void do_specular_ramp(GPUShadeInput *shi, GPUNodeLink *is, GPUNodeLink *t, GPUNodeLink **spec)
+{
+ Material *ma= shi->mat;
+ GPUMaterial *mat= shi->gpumat;
+ GPUNodeLink *fac, *tmp;
+
+ *spec = shi->specrgb;
+
+ /* MA_RAMP_IN_RESULT is exception */
+ if(ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) {
+
+ /* input */
+ switch(ma->rampin_spec) {
+ case MA_RAMP_IN_ENERGY:
+ fac = t;
+ break;
+ case MA_RAMP_IN_SHADER:
+ fac = is;
+ break;
+ case MA_RAMP_IN_NOR:
+ GPU_link(mat, "vec_math_dot", shi->view, shi->vn, &tmp, &fac);
+ break;
+ default:
+ GPU_link(mat, "set_value_zero", &fac);
+ break;
+ }
+
+ /* colorband + blend */
+ do_colorband_blend(mat, ma->ramp_spec, fac, ma->rampfac_spec, ma->rampblend_spec, *spec, spec);
+ }
+}
+
+void add_user_list(ListBase *list, void *data)
+{
+ LinkData *link = MEM_callocN(sizeof(LinkData), "GPULinkData");
+ link->data = data;
+ BLI_addtail(list, link);
+}
+
+static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *lamp)
+{
+ Material *ma= shi->mat;
+ GPUMaterial *mat= shi->gpumat;
+ GPUNodeLink *lv, *dist, *visifac, *is, *inp, *i, *vn, *view;
+ GPUNodeLink *outcol, *specfac, *t, *shadfac;
+ float one = 1.0f;
+
+ if((lamp->mode & LA_ONLYSHADOW) && !(ma->mode & MA_SHADOW))
+ return;
+
+ vn= shi->vn;
+ view= shi->view;
+
+ visifac= lamp_get_visibility(mat, lamp, &lv, &dist);
+
+ /*if(ma->mode & MA_TANGENT_V)
+ GPU_link(mat, "shade_tangent_v", lv, GPU_attribute(CD_TANGENT, ""), &vn);*/
+
+ GPU_link(mat, "shade_inp", vn, lv, &inp);
+
+ if(lamp->mode & LA_NO_DIFF) {
+ GPU_link(mat, "shade_is_no_diffuse", &is);
+ }
+ else if(lamp->type == LA_HEMI) {
+ GPU_link(mat, "shade_is_hemi", inp, &is);
+ }
+ else {
+ if(lamp->type == LA_AREA) {
+ float area[4][4], areasize;
+
+ memset(&area, 0, sizeof(area));
+ memset(&areasize, 0, sizeof(areasize));
+ mat->dynproperty |= DYN_LAMP_VEC|DYN_LAMP_CO;
+ GPU_link(mat, "shade_inp_area", GPU_builtin(GPU_VIEW_POSITION), GPU_dynamic_uniform(lamp->dynco), GPU_dynamic_uniform(lamp->dynvec), vn, GPU_uniform((float*)area),
+ GPU_uniform(&areasize), GPU_uniform(&lamp->k), &inp);
+ }
+
+ is= inp; /* Lambert */
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_SHADERS)) {
+ if(ma->diff_shader==MA_DIFF_ORENNAYAR)
+ GPU_link(mat, "shade_diffuse_oren_nayer", inp, vn, lv, view, GPU_uniform(&ma->roughness), &is);
+ else if(ma->diff_shader==MA_DIFF_TOON)
+ GPU_link(mat, "shade_diffuse_toon", vn, lv, view, GPU_uniform(&ma->param[0]), GPU_uniform(&ma->param[1]), &is);
+ else if(ma->diff_shader==MA_DIFF_MINNAERT)
+ GPU_link(mat, "shade_diffuse_minnaert", inp, vn, view, GPU_uniform(&ma->darkness), &is);
+ else if(ma->diff_shader==MA_DIFF_FRESNEL)
+ GPU_link(mat, "shade_diffuse_fresnel", vn, lv, view, GPU_uniform(&ma->param[0]), GPU_uniform(&ma->param[1]), &is);
+ }
+ }
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_SHADERS))
+ if(ma->shade_flag & MA_CUBIC)
+ GPU_link(mat, "shade_cubic", is, &is);
+
+ i = is;
+ GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
+
+ vn = shi->vn;
+ /*if(ma->mode & MA_TANGENT_VN)
+ GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/
+
+ /* this replaces if(i > 0.0) conditional until that is supported */
+ // done in shade_visifac now, GPU_link(mat, "mtex_value_clamp_positive", i, &i);
+
+ if((ma->mode & MA_SHADOW) && GPU_lamp_has_shadow_buffer(lamp)) {
+ if(!(G.fileflags & G_FILE_GLSL_NO_SHADOWS)) {
+ mat->dynproperty |= DYN_LAMP_PERSMAT;
+
+ GPU_link(mat, "test_shadowbuf",
+ GPU_builtin(GPU_VIEW_POSITION),
+ GPU_dynamic_texture(lamp->tex),
+ GPU_dynamic_uniform((float*)lamp->dynpersmat),
+ GPU_uniform(&lamp->bias), inp, &shadfac);
+
+ if(lamp->mode & LA_ONLYSHADOW) {
+ GPU_link(mat, "shade_only_shadow", i, shadfac,
+ GPU_dynamic_uniform(&lamp->dynenergy), &shadfac);
+
+ if(!(lamp->mode & LA_NO_DIFF))
+ GPU_link(mat, "shade_only_shadow_diffuse", shadfac, shi->rgb,
+ shr->diff, &shr->diff);
+
+ if(!(lamp->mode & LA_NO_SPEC))
+ GPU_link(mat, "shade_only_shadow_specular", shadfac, shi->specrgb,
+ shr->spec, &shr->spec);
+
+ add_user_list(&mat->lamps, lamp);
+ add_user_list(&lamp->materials, ma);
+ return;
+ }
+
+ GPU_link(mat, "math_multiply", i, shadfac, &i);
+ }
+ }
+ else if((G.fileflags & G_FILE_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) {
+ add_user_list(&mat->lamps, lamp);
+ add_user_list(&lamp->materials, ma);
+ return;
+ }
+ else
+ GPU_link(mat, "set_value", GPU_uniform(&one), &shadfac);
+
+ if(GPU_link_changed(shi->refl) || ma->ref != 0.0f) {
+ if(!(lamp->mode & LA_NO_DIFF)) {
+ GPUNodeLink *rgb;
+ GPU_link(mat, "shade_mul_value", i, GPU_dynamic_uniform(lamp->dyncol), &rgb);
+ add_to_diffuse(mat, ma, shi, is, rgb, &shr->diff);
+ }
+ }
+
+ if(G.fileflags & G_FILE_GLSL_NO_SHADERS);
+ else if(!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
+ (GPU_link_changed(shi->spec) || ma->spec != 0.0f)) {
+ if(lamp->type == LA_HEMI) {
+ GPU_link(mat, "shade_hemi_spec", vn, lv, view, GPU_uniform(&ma->spec), shi->har, visifac, &t);
+ GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol), shi->specrgb, &outcol);
+ GPU_link(mat, "shade_add", shr->spec, outcol, &shr->spec);
+ }
+ else {
+ if(ma->spec_shader==MA_SPEC_PHONG)
+ GPU_link(mat, "shade_phong_spec", vn, lv, view, shi->har, &specfac);
+ else if(ma->spec_shader==MA_SPEC_COOKTORR)
+ GPU_link(mat, "shade_cooktorr_spec", vn, lv, view, shi->har, &specfac);
+ else if(ma->spec_shader==MA_SPEC_BLINN)
+ GPU_link(mat, "shade_blinn_spec", vn, lv, view, GPU_uniform(&ma->refrac), shi->har, &specfac);
+ else if(ma->spec_shader==MA_SPEC_WARDISO)
+ GPU_link(mat, "shade_wardiso_spec", vn, lv, view, GPU_uniform(&ma->rms), &specfac);
+ else
+ GPU_link(mat, "shade_toon_spec", vn, lv, view, GPU_uniform(&ma->param[2]), GPU_uniform(&ma->param[3]), &specfac);
+
+ if(lamp->type==LA_AREA)
+ GPU_link(mat, "shade_spec_area_inp", specfac, inp, &specfac);
+
+ GPU_link(mat, "shade_spec_t", shadfac, shi->spec, visifac, specfac, &t);
+
+ if(ma->mode & MA_RAMP_SPEC) {
+ GPUNodeLink *spec;
+ do_specular_ramp(shi, specfac, t, &spec);
+ GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol), spec, &outcol);
+ GPU_link(mat, "shade_add", shr->spec, outcol, &shr->spec);
+ }
+ else {
+ GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol), shi->specrgb, &outcol);
+ GPU_link(mat, "shade_add", shr->spec, outcol, &shr->spec);
+ }
+ }
+ }
+
+ add_user_list(&mat->lamps, lamp);
+ add_user_list(&lamp->materials, ma);
+}
+
+static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr)
+{
+ Base *base;
+ Object *ob;
+ Scene *sce;
+ GPULamp *lamp;
+
+ for(SETLOOPER(shi->gpumat->scene, base)) {
+ ob= base->object;
+
+ if(ob->type==OB_LAMP) {
+ lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob, NULL);
+ if(lamp)
+ shade_one_light(shi, shr, lamp);
+ }
+
+ if (ob->transflag & OB_DUPLI) {
+ DupliObject *dob;
+ ListBase *lb = object_duplilist(shi->gpumat->scene, ob);
+
+ for(dob=lb->first; dob; dob=dob->next) {
+ Object *ob = dob->ob;
+
+ if(ob->type==OB_LAMP) {
+ Mat4CpyMat4(ob->obmat, dob->mat);
+
+ lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob, base->object);
+ if(lamp)
+ shade_one_light(shi, shr, lamp);
+ }
+ }
+
+ free_object_duplilist(lb);
+ }
+ }
+}
+
+static void texture_rgb_blend(GPUMaterial *mat, GPUNodeLink *tex, GPUNodeLink *out, GPUNodeLink *fact, GPUNodeLink *facg, int blendtype, GPUNodeLink **in)
+{
+ switch(blendtype) {
+ case MTEX_BLEND:
+ GPU_link(mat, "mtex_rgb_blend", out, tex, fact, facg, in);
+ break;
+ case MTEX_MUL:
+ GPU_link(mat, "mtex_rgb_mul", out, tex, fact, facg, in);
+ break;
+ case MTEX_SCREEN:
+ GPU_link(mat, "mtex_rgb_screen", out, tex, fact, facg, in);
+ break;
+ case MTEX_OVERLAY:
+ GPU_link(mat, "mtex_rgb_overlay", out, tex, fact, facg, in);
+ break;
+ case MTEX_SUB:
+ GPU_link(mat, "mtex_rgb_sub", out, tex, fact, facg, in);
+ break;
+ case MTEX_ADD:
+ GPU_link(mat, "mtex_rgb_add", out, tex, fact, facg, in);
+ break;
+ case MTEX_DIV:
+ GPU_link(mat, "mtex_rgb_div", out, tex, fact, facg, in);
+ break;
+ case MTEX_DIFF:
+ GPU_link(mat, "mtex_rgb_diff", out, tex, fact, facg, in);
+ break;
+ case MTEX_DARK:
+ GPU_link(mat, "mtex_rgb_dark", out, tex, fact, facg, in);
+ break;
+ case MTEX_LIGHT:
+ GPU_link(mat, "mtex_rgb_light", out, tex, fact, facg, in);
+ break;
+ case MTEX_BLEND_HUE:
+ GPU_link(mat, "mtex_rgb_hue", out, tex, fact, facg, in);
+ break;
+ case MTEX_BLEND_SAT:
+ GPU_link(mat, "mtex_rgb_sat", out, tex, fact, facg, in);
+ break;
+ case MTEX_BLEND_VAL:
+ GPU_link(mat, "mtex_rgb_val", out, tex, fact, facg, in);
+ break;
+ case MTEX_BLEND_COLOR:
+ GPU_link(mat, "mtex_rgb_color", out, tex, fact, facg, in);
+ break;
+ default:
+ GPU_link(mat, "set_rgb_zero", &in);
+ break;
+ }
+}
+
+static void texture_value_blend(GPUMaterial *mat, GPUNodeLink *tex, GPUNodeLink *out, GPUNodeLink *fact, GPUNodeLink *facg, int blendtype, int flip, GPUNodeLink **in)
+{
+ float flipf = (flip)? 1.0f: 0.0;
+
+ switch(blendtype) {
+ case MTEX_BLEND:
+ GPU_link(mat, "mtex_value_blend", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_MUL:
+ GPU_link(mat, "mtex_value_mul", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_SCREEN:
+ GPU_link(mat, "mtex_value_screen", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_SUB:
+ GPU_link(mat, "mtex_value_sub", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_ADD:
+ GPU_link(mat, "mtex_value_add", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_DIV:
+ GPU_link(mat, "mtex_value_div", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_DIFF:
+ GPU_link(mat, "mtex_value_diff", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_DARK:
+ GPU_link(mat, "mtex_value_dark", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ case MTEX_LIGHT:
+ GPU_link(mat, "mtex_value_light", out, tex, fact, facg, GPU_uniform(&flipf), in);
+ break;
+ default:
+ GPU_link(mat, "set_value_zero", &in);
+ break;
+ }
+}
+
+static void do_material_tex(GPUShadeInput *shi)
+{
+ Material *ma= shi->mat;
+ GPUMaterial *mat= shi->gpumat;
+ MTex *mtex;
+ Tex *tex;
+ GPUNodeLink *texco, *tin, *trgb, *tnor, *tcol, *stencil, *tnorfac;
+ GPUNodeLink *texco_norm, *texco_orco, *texco_object, *texco_tangent;
+ GPUNodeLink *texco_global, *texco_uv = NULL;
+ GPUNodeLink *colfac, *newnor, *varfac, *orn;
+ char *lastuvname = NULL;
+ float one = 1.0f, norfac, ofs[3];
+ int tex_nr, rgbnor, talpha;
+
+ GPU_link(mat, "set_value", GPU_uniform(&one), &stencil);
+
+ GPU_link(mat, "texco_norm", GPU_builtin(GPU_VIEW_NORMAL), &texco_norm);
+ GPU_link(mat, "texco_orco", GPU_attribute(CD_ORCO, ""), &texco_orco);
+ GPU_link(mat, "texco_object", GPU_builtin(GPU_INVERSE_VIEW_MATRIX),
+ GPU_builtin(GPU_INVERSE_OBJECT_MATRIX),
+ GPU_builtin(GPU_VIEW_POSITION), &texco_object);
+ GPU_link(mat, "texco_tangent", GPU_attribute(CD_TANGENT, ""), &texco_tangent);
+ GPU_link(mat, "texco_global", GPU_builtin(GPU_INVERSE_VIEW_MATRIX),
+ GPU_builtin(GPU_VIEW_POSITION), &texco_global);
+
+ orn= texco_norm;
+
+ /* go over texture slots */
+ for(tex_nr=0; tex_nr<MAX_MTEX; tex_nr++) {
+ /* separate tex switching */
+ if(ma->septex & (1<<tex_nr)) continue;
+
+ if(ma->mtex[tex_nr]) {
+ mtex= ma->mtex[tex_nr];
+
+ tex= mtex->tex;
+ if(tex==0) continue;
+
+ /* which coords */
+ if(mtex->texco==TEXCO_ORCO)
+ texco= texco_orco;
+ else if(mtex->texco==TEXCO_OBJECT)
+ texco= texco_object;
+ else if(mtex->texco==TEXCO_NORM)
+ texco= texco_norm;
+ else if(mtex->texco==TEXCO_TANGENT)
+ texco= texco_object;
+ else if(mtex->texco==TEXCO_GLOB)
+ texco= texco_global;
+ else if(mtex->texco==TEXCO_REFL)
+ texco= shi->ref;
+ else if(mtex->texco==TEXCO_UV) {
+ if(1) { //!(texco_uv && strcmp(mtex->uvname, lastuvname) == 0)) {
+ GPU_link(mat, "texco_uv", GPU_attribute(CD_MTFACE, mtex->uvname), &texco_uv);
+ lastuvname = mtex->uvname;
+ }
+ texco= texco_uv;
+ }
+ else
+ continue;
+
+ /* in case of uv, this would just undo a multiplication in texco_uv */
+ if(mtex->texco != TEXCO_UV)
+ GPU_link(mat, "mtex_2d_mapping", texco, &texco);
+
+ if(mtex->size[0] != 1.0f || mtex->size[1] != 1.0f || mtex->size[2] != 1.0f)
+ GPU_link(mat, "mtex_mapping_size", texco, GPU_uniform(mtex->size), &texco);
+
+ ofs[0] = mtex->ofs[0] + 0.5f - 0.5f*mtex->size[0];
+ ofs[1] = mtex->ofs[1] + 0.5f - 0.5f*mtex->size[1];
+ ofs[2] = 0.0f;
+ if(ofs[0] != 0.0f || ofs[1] != 0.0f || ofs[2] != 0.0f)
+ GPU_link(mat, "mtex_mapping_ofs", texco, GPU_uniform(ofs), &texco);
+
+ talpha = 0;
+ rgbnor = 0;
+
+ if(tex && tex->type == TEX_IMAGE && tex->ima) {
+ GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, NULL), &tin, &trgb, &tnor);
+ rgbnor= TEX_RGB;
+
+ if(tex->imaflag & TEX_USEALPHA)
+ talpha= 1;
+ }
+ else continue;
+
+ /* texture output */
+ if((rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) {
+ GPU_link(mat, "mtex_rgbtoint", trgb, &tin);
+ rgbnor -= TEX_RGB;
+ }
+
+ if(mtex->texflag & MTEX_NEGATIVE) {
+ if(rgbnor & TEX_RGB)
+ GPU_link(mat, "mtex_rgb_invert", trgb, &trgb);
+ else
+ GPU_link(mat, "mtex_value_invert", tin, &tin);
+ }
+
+ if(mtex->texflag & MTEX_STENCIL) {
+ if(rgbnor & TEX_RGB)
+ GPU_link(mat, "mtex_rgb_stencil", stencil, trgb, &stencil, &trgb);
+ else
+ GPU_link(mat, "mtex_value_stencil", stencil, tin, &stencil, &tin);
+ }
+
+ /* mapping */
+ if(mtex->mapto & (MAP_COL+MAP_COLSPEC)) {
+ /* stencil maps on the texture control slider, not texture intensity value */
+ if(mtex->colfac == 1.0f)
+ colfac = stencil;
+ else
+ GPU_link(mat, "math_multiply", GPU_uniform(&mtex->colfac), stencil, &colfac);
+
+ if((rgbnor & TEX_RGB)==0) {
+ GPU_link(mat, "set_rgb", GPU_uniform(&mtex->r), &tcol);
+ }
+ else {
+ GPU_link(mat, "set_rgba", trgb, &tcol);
+
+ if(mtex->mapto & MAP_ALPHA)
+ GPU_link(mat, "set_value", stencil, &tin);
+ else if(talpha)
+ GPU_link(mat, "mtex_alpha_from_col", trgb, &tin);
+ else
+ GPU_link(mat, "set_value_one", &tin);
+ }
+
+ if(mtex->mapto & MAP_COL)
+ texture_rgb_blend(mat, tcol, shi->rgb, tin, colfac, mtex->blendtype, &shi->rgb);
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC))
+ texture_rgb_blend(mat, tcol, shi->specrgb, tin, colfac, mtex->blendtype, &shi->specrgb);
+ }
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) {
+ if(mtex->maptoneg & MAP_NORM) tex->norfac= -mtex->norfac;
+ else tex->norfac= mtex->norfac;
+
+ if((tex->type==TEX_IMAGE) && (tex->imaflag & TEX_NORMALMAP)) {
+ tex->norfac = mtex->norfac;
+
+ if(mtex->maptoneg & MAP_NORM)
+ GPU_link(mat, "mtex_negate_texnormal", tnor, &tnor);
+
+ if(mtex->normapspace == MTEX_NSPACE_TANGENT)
+ GPU_link(mat, "mtex_nspace_tangent", GPU_attribute(CD_TANGENT, ""), shi->vn, tnor, &newnor);
+ else
+ newnor = tnor;
+
+ norfac = MIN2(mtex->norfac, 1.0);
+ if(norfac == 1.0f && !GPU_link_changed(stencil)) {
+ shi->vn = newnor;
+ }
+ else {
+ tnorfac = GPU_uniform(&norfac);
+
+ if(GPU_link_changed(stencil))
+ GPU_link(mat, "math_multiply", tnorfac, stencil, &tnorfac);
+
+ GPU_link(mat, "mtex_blend_normal", tnorfac, shi->vn, newnor, &shi->vn);
+ }
+ }
+
+ GPU_link(mat, "vec_math_negate", shi->vn, &orn);
+ GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref);
+ }
+
+ if((mtex->mapto & MAP_VARS)) {
+ if(mtex->varfac == 1.0f)
+ varfac = stencil;
+ else
+ GPU_link(mat, "math_multiply", GPU_uniform(&mtex->varfac), stencil, &varfac);
+
+ if(rgbnor & TEX_RGB) {
+ if(talpha)
+ GPU_link(mat, "mtex_alpha_from_col", trgb, &tin);
+ else
+ GPU_link(mat, "mtex_rgbtoint", trgb, &tin);
+ }
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) {
+ int flip= mtex->maptoneg & MAP_REF;
+ texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->refl, tin, varfac, mtex->blendtype, flip, &shi->refl);
+ GPU_link(mat, "mtex_value_clamp_positive", shi->refl, &shi->refl);
+ }
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) {
+ int flip= mtex->maptoneg & MAP_SPEC;
+ texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->spec, tin, varfac, mtex->blendtype, flip, &shi->spec);
+ GPU_link(mat, "mtex_value_clamp_positive", shi->spec, &shi->spec);
+ }
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) {
+ int flip= mtex->maptoneg & MAP_EMIT;
+ texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->emit, tin, varfac, mtex->blendtype, flip, &shi->emit);
+ GPU_link(mat, "mtex_value_clamp_positive", shi->emit, &shi->emit);
+ }
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) {
+ int flip= mtex->maptoneg & MAP_HAR;
+ GPU_link(mat, "mtex_har_divide", shi->har, &shi->har);
+ texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->har, tin, varfac, mtex->blendtype, flip, &shi->har);
+ GPU_link(mat, "mtex_har_multiply_clamp", shi->har, &shi->har);
+ }
+ if(mtex->mapto & MAP_ALPHA) {
+ int flip= mtex->maptoneg & MAP_ALPHA;
+ texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->alpha, tin, varfac, mtex->blendtype, flip, &shi->alpha);
+ GPU_link(mat, "mtex_value_clamp", shi->alpha, &shi->alpha);
+ }
+ if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) {
+ int flip= mtex->maptoneg & MAP_AMB;
+ texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->amb, tin, varfac, mtex->blendtype, flip, &shi->amb);
+ GPU_link(mat, "mtex_value_clamp", shi->amb, &shi->amb);
+ }
+ }
+ }
+ }
+}
+
+void GPU_shadeinput_set(GPUMaterial *mat, Material *ma, GPUShadeInput *shi)
+{
+ float hard = ma->har;
+
+ memset(shi, 0, sizeof(*shi));
+
+ shi->gpumat = mat;
+ shi->mat = ma;
+
+ GPU_link(mat, "set_rgb", GPU_uniform(&ma->r), &shi->rgb);
+ GPU_link(mat, "set_rgb", GPU_uniform(&ma->specr), &shi->specrgb);
+ GPU_link(mat, "shade_norm", GPU_builtin(GPU_VIEW_NORMAL), &shi->vn);
+ GPU_link(mat, "set_value", GPU_uniform(&ma->alpha), &shi->alpha);
+ GPU_link(mat, "set_value", GPU_uniform(&ma->ref), &shi->refl);
+ GPU_link(mat, "set_value", GPU_uniform(&ma->spec), &shi->spec);
+ GPU_link(mat, "set_value", GPU_uniform(&ma->emit), &shi->emit);
+ GPU_link(mat, "set_value", GPU_uniform(&hard), &shi->har);
+ GPU_link(mat, "set_value", GPU_uniform(&ma->amb), &shi->amb);
+ GPU_link(mat, "shade_view", GPU_builtin(GPU_VIEW_POSITION), &shi->view);
+ GPU_link(mat, "vcol_attribute", GPU_attribute(CD_MCOL, ""), &shi->vcol);
+ GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref);
+}
+
+void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
+{
+ GPUMaterial *mat= shi->gpumat;
+ GPUNodeLink *emit, *ulinfac, *ulogfac, *mistfac;
+ Material *ma= shi->mat;
+ World *world= mat->scene->world;
+ float linfac, logfac, misttype;
+
+ memset(shr, 0, sizeof(*shr));
+
+ if(ma->mode & MA_VERTEXCOLP)
+ shi->rgb = shi->vcol;
+
+ do_material_tex(shi);
+
+ if(ma->mode & MA_ZTRA)
+ GPU_material_enable_alpha(mat);
+
+ if((G.fileflags & G_FILE_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) {
+ shr->combined = shi->rgb;
+ shr->alpha = shi->alpha;
+ }
+ else {
+ if(GPU_link_changed(shi->emit) || ma->emit != 0.0f) {
+ if((ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))== MA_VERTEXCOL) {
+ GPU_link(mat, "shade_add", shi->emit, shi->vcol, &emit);
+ GPU_link(mat, "shade_mul", emit, shi->rgb, &shr->diff);
+ }
+ else
+ GPU_link(mat, "shade_mul_value", shi->emit, shi->rgb, &shr->diff);
+ }
+ else
+ GPU_link(mat, "set_rgb_zero", &shr->diff);
+
+ GPU_link(mat, "set_rgb_zero", &shr->spec);
+
+ material_lights(shi, shr);
+
+ shr->combined = shr->diff;
+ shr->alpha = shi->alpha;
+
+ if(world) {
+ /* exposure correction */
+ if(world->exp!=0.0f || world->range!=1.0f) {
+ linfac= 1.0 + pow((2.0*world->exp + 0.5), -10);
+ logfac= log((linfac-1.0)/linfac)/world->range;
+
+ GPU_link(mat, "set_value", GPU_uniform(&linfac), &ulinfac);
+ GPU_link(mat, "set_value", GPU_uniform(&logfac), &ulogfac);
+
+ GPU_link(mat, "shade_exposure_correct", shr->combined,
+ ulinfac, ulogfac, &shr->combined);
+ GPU_link(mat, "shade_exposure_correct", shr->spec,
+ ulinfac, ulogfac, &shr->spec);
+ }
+
+ /* ambient color */
+ if(world->ambr!=0.0f || world->ambg!=0.0f || world->ambb!=0.0f) {
+ if(GPU_link_changed(shi->amb) || ma->amb != 0.0f)
+ GPU_link(mat, "shade_maddf", shr->combined, GPU_uniform(&ma->amb),
+ GPU_uniform(&world->ambr), &shr->combined);
+ }
+ }
+
+ if(ma->mode & MA_RAMP_COL) ramp_diffuse_result(shi, &shr->combined);
+ if(ma->mode & MA_RAMP_SPEC) ramp_spec_result(shi, &shr->spec);
+
+ if(GPU_link_changed(shi->spec) || ma->spec != 0.0f)
+ GPU_link(mat, "shade_add", shr->combined, shr->spec, &shr->combined);
+ }
+
+ GPU_link(mat, "mtex_alpha_to_col", shr->combined, shr->alpha, &shr->combined);
+
+ if(ma->shade_flag & MA_OBCOLOR)
+ GPU_link(mat, "shade_obcolor", shr->combined, GPU_builtin(GPU_OBCOLOR), &shr->combined);
+
+ if(world && (world->mode & WO_MIST) && !(ma->mode & MA_NOMIST)) {
+ misttype = world->mistype;
+
+ GPU_link(mat, "shade_mist_factor", GPU_builtin(GPU_VIEW_POSITION),
+ GPU_uniform(&world->miststa), GPU_uniform(&world->mistdist),
+ GPU_uniform(&misttype), GPU_uniform(&world->misi), &mistfac);
+
+ GPU_link(mat, "mix_blend", mistfac, shr->combined,
+ GPU_uniform(&world->horr), &shr->combined);
+ }
+
+ if(!(ma->mode & MA_ZTRA)) {
+ if(world && (GPU_link_changed(shr->alpha) || ma->alpha != 1.0f))
+ GPU_link(mat, "shade_world_mix", GPU_uniform(&world->horr),
+ shr->combined, &shr->combined);
+
+ GPU_link(mat, "shade_alpha_opaque", shr->combined, &shr->combined);
+ }
+
+ if(ma->shade_flag & MA_OBCOLOR) {
+ mat->obcolalpha = 1;
+ GPU_link(mat, "shade_alpha_obcolor", shr->combined, GPU_builtin(GPU_OBCOLOR), &shr->combined);
+ }
+}
+
+GPUNodeLink *GPU_blender_material(GPUMaterial *mat, Material *ma)
+{
+ GPUShadeInput shi;
+ GPUShadeResult shr;
+
+ GPU_shadeinput_set(mat, ma, &shi);
+ GPU_shaderesult_set(&shi, &shr);
+
+ return shr.combined;
+}
+
+GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
+{
+ GPUMaterial *mat;
+ GPUNodeLink *outlink;
+ LinkData *link;
+
+ for(link=ma->gpumaterial.first; link; link=link->next)
+ if(((GPUMaterial*)link->data)->scene == scene)
+ return link->data;
+
+ mat = GPU_material_construct_begin(ma);
+ mat->scene = scene;
+
+ if(!(G.fileflags & G_FILE_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) {
+ ntreeGPUMaterialNodes(ma->nodetree, mat);
+ }
+ else {
+ outlink = GPU_blender_material(mat, ma);
+ GPU_material_output_link(mat, outlink);
+ }
+
+ /*if(!GPU_material_construct_end(mat)) {
+ GPU_material_free(mat);
+ mat= NULL;
+ return 0;
+ }*/
+
+ GPU_material_construct_end(mat);
+
+ link = MEM_callocN(sizeof(LinkData), "GPUMaterialLink");
+ link->data = mat;
+ BLI_addtail(&ma->gpumaterial, link);
+
+ return mat;
+}
+
+void GPU_materials_free()
+{
+ Object *ob;
+ Material *ma;
+ extern Material defmaterial;
+
+ for(ma=G.main->mat.first; ma; ma=ma->id.next)
+ GPU_material_free(ma);
+
+ GPU_material_free(&defmaterial);
+
+ for(ob=G.main->object.first; ma; ma=ma->id.next)
+ GPU_lamp_free(ob);
+}
+
+/* Lamps and shadow buffers */
+
+void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4])
+{
+ float mat[4][4];
+
+ lamp->lay = lay;
+
+ Mat4CpyMat4(mat, obmat);
+ Mat4Ortho(mat);
+
+ VECCOPY(lamp->vec, mat[2]);
+ VECCOPY(lamp->co, mat[3]);
+ Mat4CpyMat4(lamp->obmat, mat);
+ Mat4Invert(lamp->imat, mat);
+}
+
+static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *la, GPULamp *lamp)
+{
+ float temp, angle, pixsize, wsize;
+
+ lamp->scene = scene;
+ lamp->ob = ob;
+ lamp->par = par;
+ lamp->la = la;
+
+ /* add_render_lamp */
+ lamp->mode = la->mode;
+ lamp->type = la->type;
+
+ lamp->energy = la->energy;
+ if(lamp->mode & LA_NEG) lamp->energy= -lamp->energy;
+
+ lamp->col[0]= la->r*lamp->energy;
+ lamp->col[1]= la->g*lamp->energy;
+ lamp->col[2]= la->b*lamp->energy;
+
+ GPU_lamp_update(lamp, ob->lay, ob->obmat);
+
+ lamp->spotsi= la->spotsize;
+ if(lamp->mode & LA_HALO)
+ if(lamp->spotsi > 170.0)
+ lamp->spotsi = 170.0;
+ lamp->spotsi= cos(M_PI*lamp->spotsi/360.0);
+ lamp->spotbl= (1.0 - lamp->spotsi)*la->spotblend;
+ lamp->k= la->k;
+
+ lamp->dist= la->dist;
+ lamp->falloff_type= la->falloff_type;
+ lamp->att1= la->att1;
+ lamp->att2= la->att2;
+ lamp->curfalloff= la->curfalloff;
+
+ /* initshadowbuf */
+ lamp->bias = 0.02f*la->bias;
+ lamp->size = la->bufsize;
+ lamp->d= la->clipsta;
+ lamp->clipend= la->clipend;
+
+ /* arbitrary correction for the fact we do no soft transition */
+ lamp->bias *= 0.25f;
+
+ /* makeshadowbuf */
+ angle= saacos(lamp->spotsi);
+ temp= 0.5f*lamp->size*cos(angle)/sin(angle);
+ pixsize= (lamp->d)/temp;
+ wsize= pixsize*0.5f*lamp->size;
+
+ i_window(-wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend, lamp->winmat);
+}
+
+static void gpu_lamp_shadow_free(GPULamp *lamp)
+{
+ if(lamp->tex)
+ GPU_texture_free(lamp->tex);
+ if(lamp->fb)
+ GPU_framebuffer_free(lamp->fb);
+}
+
+GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
+{
+ Lamp *la;
+ GPULamp *lamp;
+ LinkData *link;
+
+ for(link=ob->gpulamp.first; link; link=link->next) {
+ lamp = (GPULamp*)link->data;
+
+ if(lamp->par == par && lamp->scene == scene)
+ return link->data;
+ }
+
+ lamp = MEM_callocN(sizeof(GPULamp), "GPULamp");
+
+ link = MEM_callocN(sizeof(LinkData), "GPULampLink");
+ link->data = lamp;
+ BLI_addtail(&ob->gpulamp, link);
+
+ la = ob->data;
+ gpu_lamp_from_blender(scene, ob, par, la, lamp);
+
+ if(la->type==LA_SPOT && (la->mode & LA_SHAD_BUF)) {
+ /* opengl */
+ lamp->fb = GPU_framebuffer_create();
+ if(!lamp->fb) {
+ gpu_lamp_shadow_free(lamp);
+ return lamp;
+ }
+
+ lamp->tex = GPU_texture_create_depth(lamp->size, lamp->size);
+ if(!lamp->tex) {
+ gpu_lamp_shadow_free(lamp);
+ return lamp;
+ }
+
+ if(!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex)) {
+ gpu_lamp_shadow_free(lamp);
+ return lamp;
+ }
+
+ GPU_framebuffer_restore();
+ }
+
+ return lamp;
+}
+
+void GPU_lamp_free(Object *ob)
+{
+ GPULamp *lamp;
+ LinkData *link;
+ LinkData *nlink;
+ Material *ma;
+
+ for(link=ob->gpulamp.first; link; link=link->next) {
+ lamp = link->data;
+
+ while(lamp->materials.first) {
+ nlink = lamp->materials.first;
+ ma = nlink->data;
+ BLI_freelinkN(&lamp->materials, nlink);
+
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+ }
+
+ gpu_lamp_shadow_free(lamp);
+
+ MEM_freeN(lamp);
+ }
+
+ BLI_freelistN(&ob->gpulamp);
+}
+
+int GPU_lamp_has_shadow_buffer(GPULamp *lamp)
+{
+ return (!(G.fileflags & G_FILE_GLSL_NO_SHADOWS) &&
+ !(G.fileflags & G_FILE_GLSL_NO_LIGHTS) &&
+ lamp->tex && lamp->fb);
+}
+
+void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize, float winmat[][4])
+{
+ float rangemat[4][4], persmat[4][4];
+
+ /* initshadowbuf */
+ Mat4Invert(lamp->viewmat, lamp->obmat);
+ Normalize(lamp->viewmat[0]);
+ Normalize(lamp->viewmat[1]);
+ Normalize(lamp->viewmat[2]);
+
+ /* makeshadowbuf */
+ Mat4MulMat4(persmat, lamp->viewmat, lamp->winmat);
+
+ /* opengl depth buffer is range 0.0..1.0 instead of -1.0..1.0 in blender */
+ Mat4One(rangemat);
+ rangemat[0][0] = 0.5f;
+ rangemat[1][1] = 0.5f;
+ rangemat[2][2] = 0.5f;
+ rangemat[3][0] = 0.5f;
+ rangemat[3][1] = 0.5f;
+ rangemat[3][2] = 0.5f;
+
+ Mat4MulMat4(lamp->persmat, persmat, rangemat);
+
+ /* opengl */
+ GPU_framebuffer_texture_bind(lamp->fb, lamp->tex);
+
+ /* set matrices */
+ Mat4CpyMat4(viewmat, lamp->viewmat);
+ Mat4CpyMat4(winmat, lamp->winmat);
+ *winsize = lamp->size;
+}
+
+void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp)
+{
+ GPU_framebuffer_texture_unbind(lamp->fb, lamp->tex);
+ GPU_framebuffer_restore();
+}
+
+int GPU_lamp_shadow_layer(GPULamp *lamp)
+{
+ if(lamp->fb && lamp->tex && (lamp->mode & (LA_LAYER|LA_LAYER_SHADOW)))
+ return lamp->lay;
+ else
+ return -1;
+}
+
diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl b/source/blender/gpu/intern/gpu_shader_material.glsl
new file mode 100644
index 00000000000..16ed38cb47d
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_shader_material.glsl
@@ -0,0 +1,1555 @@
+
+float exp_blender(float f)
+{
+ return pow(2.71828182846, f);
+}
+
+void rgb_to_hsv(vec4 rgb, out vec4 outcol)
+{
+ float cmax, cmin, h, s, v, cdelta;
+ vec3 c;
+
+ cmax = max(rgb[0], max(rgb[1], rgb[2]));
+ cmin = min(rgb[0], min(rgb[1], rgb[2]));
+ cdelta = cmax-cmin;
+
+ v = cmax;
+ if (cmax!=0.0)
+ s = cdelta/cmax;
+ else {
+ s = 0.0;
+ h = 0.0;
+ }
+
+ if (s == 0.0) {
+ h = 0.0;
+ }
+ else {
+ c = (vec3(cmax, cmax, cmax) - rgb.xyz)/cdelta;
+
+ if (rgb.x==cmax) h = c[2] - c[1];
+ else if (rgb.y==cmax) h = 2.0 + c[0] - c[2];
+ else h = 4.0 + c[1] - c[0];
+
+ h /= 6.0;
+
+ if (h<0.0)
+ h += 1.0;
+ }
+
+ outcol = vec4(h, s, v, rgb.w);
+}
+
+void hsv_to_rgb(vec4 hsv, out vec4 outcol)
+{
+ float i, f, p, q, t, h, s, v;
+ vec3 rgb;
+
+ h = hsv[0];
+ s = hsv[1];
+ v = hsv[2];
+
+ if(s==0.0) {
+ rgb = vec3(v, v, v);
+ }
+ else {
+ if(h==1.0)
+ h = 0.0;
+
+ h *= 6.0;
+ i = floor(h);
+ f = h - i;
+ rgb = vec3(f, f, f);
+ p = v*(1.0-s);
+ q = v*(1.0-(s*f));
+ t = v*(1.0-(s*(1.0-f)));
+
+ if (i == 0.0) rgb = vec3(v, t, p);
+ else if (i == 1.0) rgb = vec3(q, v, p);
+ else if (i == 2.0) rgb = vec3(p, v, t);
+ else if (i == 3.0) rgb = vec3(p, q, v);
+ else if (i == 4.0) rgb = vec3(t, p, v);
+ else rgb = vec3(v, p, q);
+ }
+
+ outcol = vec4(rgb, hsv.w);
+}
+
+#define M_PI 3.14159265358979323846
+
+/*********** SHADER NODES ***************/
+
+void vcol_attribute(vec4 attvcol, out vec4 vcol)
+{
+ vcol = vec4(attvcol.x/255.0, attvcol.y/255.0, attvcol.z/255.0, 1.0);
+}
+
+void uv_attribute(vec2 attuv, out vec3 uv)
+{
+ uv = vec3(attuv*2.0 - vec2(1.0, 1.0), 0.0);
+}
+
+void geom(vec3 co, vec3 nor, mat4 viewinvmat, vec3 attorco, vec2 attuv, vec4 attvcol, out vec3 global, out vec3 local, out vec3 view, out vec3 orco, out vec3 uv, out vec3 normal, out vec4 vcol, out float frontback)
+{
+ local = co;
+ view = normalize(local);
+ global = (viewinvmat*vec4(local, 1.0)).xyz;
+ orco = attorco;
+ uv_attribute(attuv, uv);
+ normal = -normalize(nor); /* blender render normal is negated */
+ vcol_attribute(attvcol, vcol);
+ frontback = 1.0;
+}
+
+void mapping(vec3 vec, mat4 mat, vec3 minvec, vec3 maxvec, float domin, float domax, out vec3 outvec)
+{
+ outvec = (mat * vec4(vec, 1.0)).xyz;
+ if(domin == 1.0)
+ outvec = max(outvec, minvec);
+ if(domax == 1.0)
+ outvec = min(outvec, maxvec);
+}
+
+void camera(vec3 co, out vec3 outview, out float outdepth, out float outdist)
+{
+ outdepth = abs(co.z);
+ outdist = length(co);
+ outview = normalize(co);
+}
+
+void math_add(float val1, float val2, out float outval)
+{
+ outval = val1 + val2;
+}
+
+void math_subtract(float val1, float val2, out float outval)
+{
+ outval = val1 - val2;
+}
+
+void math_multiply(float val1, float val2, out float outval)
+{
+ outval = val1 * val2;
+}
+
+void math_divide(float val1, float val2, out float outval)
+{
+ if (val2 == 0.0)
+ outval = 0.0;
+ else
+ outval = val1 / val2;
+}
+
+void math_sine(float val, out float outval)
+{
+ outval = sin(val);
+}
+
+void math_cosine(float val, out float outval)
+{
+ outval = cos(val);
+}
+
+void math_tangent(float val, out float outval)
+{
+ outval = tan(val);
+}
+
+void math_asin(float val, out float outval)
+{
+ if (val <= 1.0 && val >= -1.0)
+ outval = asin(val);
+ else
+ outval = 0.0;
+}
+
+void math_acos(float val, out float outval)
+{
+ if (val <= 1.0 && val >= -1.0)
+ outval = acos(val);
+ else
+ outval = 0.0;
+}
+
+void math_atan(float val, out float outval)
+{
+ outval = atan(val);
+}
+
+void math_pow(float val1, float val2, out float outval)
+{
+ if (val1 >= 0.0)
+ outval = pow(val1, val2);
+ else
+ outval = 0.0;
+}
+
+void math_log(float val1, float val2, out float outval)
+{
+ if(val1 > 0.0 && val2 > 0.0)
+ outval= log2(val1) / log2(val2);
+ else
+ outval= 0.0;
+}
+
+void math_max(float val1, float val2, out float outval)
+{
+ outval = max(val1, val2);
+}
+
+void math_min(float val1, float val2, out float outval)
+{
+ outval = min(val1, val2);
+}
+
+void math_round(float val, out float outval)
+{
+ outval= floor(val + 0.5);
+}
+
+void math_less_than(float val1, float val2, out float outval)
+{
+ if(val1 < val2)
+ outval = 1.0;
+ else
+ outval = 0.0;
+}
+
+void math_greater_than(float val1, float val2, out float outval)
+{
+ if(val1 > val2)
+ outval = 1.0;
+ else
+ outval = 0.0;
+}
+
+void squeeze(float val, float width, float center, out float outval)
+{
+ outval = 1.0/(1.0 + pow(2.71828183, -((val-center)*width)));
+}
+
+void vec_math_add(vec3 v1, vec3 v2, out vec3 outvec, out float outval)
+{
+ outvec = v1 + v2;
+ outval = (abs(outvec[0]) + abs(outvec[1]) + abs(outvec[2]))/3.0;
+}
+
+void vec_math_sub(vec3 v1, vec3 v2, out vec3 outvec, out float outval)
+{
+ outvec = v1 - v2;
+ outval = (abs(outvec[0]) + abs(outvec[1]) + abs(outvec[2]))/3.0;
+}
+
+void vec_math_average(vec3 v1, vec3 v2, out vec3 outvec, out float outval)
+{
+ outvec = v1 + v2;
+ outval = length(outvec);
+ outvec = normalize(outvec);
+}
+
+void vec_math_dot(vec3 v1, vec3 v2, out vec3 outvec, out float outval)
+{
+ outvec = vec3(0, 0, 0);
+ outval = dot(v1, v2);
+}
+
+void vec_math_cross(vec3 v1, vec3 v2, out vec3 outvec, out float outval)
+{
+ outvec = cross(v1, v2);
+ outval = length(outvec);
+}
+
+void vec_math_normalize(vec3 v, out vec3 outvec, out float outval)
+{
+ outval = length(v);
+ outvec = normalize(v);
+}
+
+void vec_math_negate(vec3 v, out vec3 outv)
+{
+ outv = -v;
+}
+
+void normal(vec3 dir, vec3 nor, out vec3 outnor, out float outdot)
+{
+ outnor = dir;
+ outdot = -dot(dir, nor);
+}
+
+void curves_vec(vec3 vec, sampler1D curvemap, out vec3 outvec)
+{
+ outvec.x = texture1D(curvemap, (vec.x + 1.0)*0.5).x;
+ outvec.y = texture1D(curvemap, (vec.y + 1.0)*0.5).y;
+ outvec.z = texture1D(curvemap, (vec.z + 1.0)*0.5).z;
+}
+
+void curves_rgb(vec4 col, sampler1D curvemap, out vec4 outcol)
+{
+ outcol.r = texture1D(curvemap, texture1D(curvemap, col.r).a).r;
+ outcol.g = texture1D(curvemap, texture1D(curvemap, col.g).a).g;
+ outcol.b = texture1D(curvemap, texture1D(curvemap, col.b).a).b;
+ outcol.a = col.a;
+}
+
+void set_value(float val, out float outval)
+{
+ outval = val;
+}
+
+void set_rgb(vec3 col, out vec3 outcol)
+{
+ outcol = col;
+}
+
+void set_rgba(vec4 col, out vec4 outcol)
+{
+ outcol = col;
+}
+
+void set_value_zero(out float outval)
+{
+ outval = 0.0;
+}
+
+void set_value_one(out float outval)
+{
+ outval = 1.0;
+}
+
+void set_rgb_zero(out vec3 outval)
+{
+ outval = vec3(0.0);
+}
+
+void set_rgba_zero(out vec4 outval)
+{
+ outval = vec4(0.0);
+}
+
+void mix_blend(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol = mix(col1, col2, fac);
+ outcol.a = col1.a;
+}
+
+void mix_add(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol = mix(col1, col1 + col2, fac);
+ outcol.a = col1.a;
+}
+
+void mix_mult(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol = mix(col1, col1 * col2, fac);
+ outcol.a = col1.a;
+}
+
+void mix_screen(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ outcol = vec4(1.0) - (vec4(facm) + fac*(vec4(1.0) - col2))*(vec4(1.0) - col1);
+ outcol.a = col1.a;
+}
+
+void mix_overlay(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ outcol = col1;
+
+ if(outcol.r < 0.5)
+ outcol.r *= facm + 2.0*fac*col2.r;
+ else
+ outcol.r = 1.0 - (facm + 2.0*fac*(1.0 - col2.r))*(1.0 - outcol.r);
+
+ if(outcol.g < 0.5)
+ outcol.g *= facm + 2.0*fac*col2.g;
+ else
+ outcol.g = 1.0 - (facm + 2.0*fac*(1.0 - col2.g))*(1.0 - outcol.g);
+
+ if(outcol.b < 0.5)
+ outcol.b *= facm + 2.0*fac*col2.b;
+ else
+ outcol.b = 1.0 - (facm + 2.0*fac*(1.0 - col2.b))*(1.0 - outcol.b);
+}
+
+void mix_sub(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol = mix(col1, col1 - col2, fac);
+ outcol.a = col1.a;
+}
+
+void mix_div(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ outcol = col1;
+
+ if(col2.r != 0.0) outcol.r = facm*outcol.r + fac*outcol.r/col2.r;
+ if(col2.g != 0.0) outcol.g = facm*outcol.g + fac*outcol.g/col2.g;
+ if(col2.b != 0.0) outcol.b = facm*outcol.b + fac*outcol.b/col2.b;
+}
+
+void mix_diff(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol = mix(col1, abs(col1 - col2), fac);
+ outcol.a = col1.a;
+}
+
+void mix_dark(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol.rgb = min(col1.rgb, col2.rgb*fac);
+ outcol.a = col1.a;
+}
+
+void mix_light(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol.rgb = max(col1.rgb, col2.rgb*fac);
+ outcol.a = col1.a;
+}
+
+void mix_dodge(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ outcol = col1;
+
+ if(outcol.r != 0.0) {
+ float tmp = 1.0 - fac*col2.r;
+ if(tmp <= 0.0)
+ outcol.r = 1.0;
+ else if((tmp = outcol.r/tmp) > 1.0)
+ outcol.r = 1.0;
+ else
+ outcol.r = tmp;
+ }
+ if(outcol.g != 0.0) {
+ float tmp = 1.0 - fac*col2.g;
+ if(tmp <= 0.0)
+ outcol.g = 1.0;
+ else if((tmp = outcol.g/tmp) > 1.0)
+ outcol.g = 1.0;
+ else
+ outcol.g = tmp;
+ }
+ if(outcol.b != 0.0) {
+ float tmp = 1.0 - fac*col2.b;
+ if(tmp <= 0.0)
+ outcol.b = 1.0;
+ else if((tmp = outcol.b/tmp) > 1.0)
+ outcol.b = 1.0;
+ else
+ outcol.b = tmp;
+ }
+}
+
+void mix_burn(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float tmp, facm = 1.0 - fac;
+
+ outcol = col1;
+
+ tmp = facm + fac*col2.r;
+ if(tmp <= 0.0)
+ outcol.r = 0.0;
+ else if((tmp = (1.0 - (1.0 - outcol.r)/tmp)) < 0.0)
+ outcol.r = 0.0;
+ else if(tmp > 1.0)
+ outcol.r = 1.0;
+ else
+ outcol.r = tmp;
+
+ tmp = facm + fac*col2.g;
+ if(tmp <= 0.0)
+ outcol.g = 0.0;
+ else if((tmp = (1.0 - (1.0 - outcol.g)/tmp)) < 0.0)
+ outcol.g = 0.0;
+ else if(tmp > 1.0)
+ outcol.g = 1.0;
+ else
+ outcol.g = tmp;
+
+ tmp = facm + fac*col2.b;
+ if(tmp <= 0.0)
+ outcol.b = 0.0;
+ else if((tmp = (1.0 - (1.0 - outcol.b)/tmp)) < 0.0)
+ outcol.b = 0.0;
+ else if(tmp > 1.0)
+ outcol.b = 1.0;
+ else
+ outcol.b = tmp;
+}
+
+void mix_hue(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ outcol = col1;
+
+ vec4 hsv, hsv2, tmp;
+ rgb_to_hsv(col2, hsv2);
+
+ if(hsv2.y != 0.0) {
+ rgb_to_hsv(outcol, hsv);
+ hsv.x = hsv2.x;
+ hsv_to_rgb(hsv, tmp);
+
+ outcol = mix(outcol, tmp, fac);
+ outcol.a = col1.a;
+ }
+}
+
+void mix_sat(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ outcol = col1;
+
+ vec4 hsv, hsv2;
+ rgb_to_hsv(outcol, hsv);
+
+ if(hsv.y != 0.0) {
+ rgb_to_hsv(col2, hsv2);
+
+ hsv.y = facm*hsv.y + fac*hsv2.y;
+ hsv_to_rgb(hsv, outcol);
+ }
+}
+
+void mix_val(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ vec4 hsv, hsv2;
+ rgb_to_hsv(col1, hsv);
+ rgb_to_hsv(col2, hsv2);
+
+ hsv.z = facm*hsv.z + fac*hsv2.z;
+ hsv_to_rgb(hsv, outcol);
+}
+
+void mix_color(float fac, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ fac = clamp(fac, 0.0, 1.0);
+ float facm = 1.0 - fac;
+
+ outcol = col1;
+
+ vec4 hsv, hsv2, tmp;
+ rgb_to_hsv(col2, hsv2);
+
+ if(hsv2.y != 0.0) {
+ rgb_to_hsv(outcol, hsv);
+ hsv.x = hsv2.x;
+ hsv.y = hsv2.y;
+ hsv_to_rgb(hsv, tmp);
+
+ outcol = mix(outcol, tmp, fac);
+ outcol.a = col1.a;
+ }
+}
+
+void valtorgb(float fac, sampler1D colormap, out vec4 outcol, out float outalpha)
+{
+ outcol = texture1D(colormap, fac);
+ outalpha = outcol.a;
+}
+
+void rgbtobw(vec4 color, out float outval)
+{
+ outval = color.r*0.35 + color.g*0.45 + color.b*0.2;
+}
+
+void invert(float fac, vec4 col, out vec4 outcol)
+{
+ outcol.xyz = mix(col.xyz, vec3(1.0, 1.0, 1.0) - col.xyz, fac);
+ outcol.w = col.w;
+}
+
+void hue_sat(float hue, float sat, float value, float fac, vec4 col, out vec4 outcol)
+{
+ vec4 hsv;
+
+ rgb_to_hsv(col, hsv);
+
+ hsv[0] += (hue - 0.5);
+ if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
+ hsv[1] *= sat;
+ if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
+ hsv[2] *= value;
+ if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
+
+ hsv_to_rgb(hsv, outcol);
+
+ outcol = mix(col, outcol, fac);
+}
+
+void separate_rgb(vec4 col, out float r, out float g, out float b)
+{
+ r = col.r;
+ g = col.g;
+ b = col.b;
+}
+
+void combine_rgb(float r, float g, float b, out vec4 col)
+{
+ col = vec4(r, g, b, 1.0);
+}
+
+void output_node(vec4 rgb, float alpha, out vec4 outrgb)
+{
+ outrgb = vec4(rgb.rgb, alpha);
+}
+
+/*********** TEXTURES ***************/
+
+void texture_flip_blend(vec3 vec, out vec3 outvec)
+{
+ outvec = vec.yxz;
+}
+
+void texture_blend_lin(vec3 vec, out float outval)
+{
+ outval = (1.0+vec.x)/2.0;
+}
+
+void texture_blend_quad(vec3 vec, out float outval)
+{
+ outval = max((1.0+vec.x)/2.0, 0.0);
+ outval *= outval;
+}
+
+void texture_wood_sin(vec3 vec, out float value, out vec4 color, out vec3 normal)
+{
+ float a = sqrt(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z)*20.0;
+ float wi = 0.5 + 0.5*sin(a);
+
+ value = wi;
+ color = vec4(wi, wi, wi, 1.0);
+ normal = vec3(0.0, 0.0, 0.0);
+}
+
+void texture_image(vec3 vec, sampler2D ima, out float value, out vec4 color, out vec3 normal)
+{
+ color = texture2D(ima, (vec.xy + vec2(1.0, 1.0))*0.5);
+ value = 1.0;
+
+ normal.x = 2.0*(color.r - 0.5);
+ normal.y = 2.0*(0.5 - color.g);
+ normal.z = 2.0*(color.b - 0.5);
+}
+
+/************* MTEX *****************/
+
+void texco_orco(vec3 attorco, out vec3 orco)
+{
+ orco = attorco;
+}
+
+void texco_uv(vec2 attuv, out vec3 uv)
+{
+ /* disabled for now, works together with leaving out mtex_2d_mapping
+ uv = vec3(attuv*2.0 - vec2(1.0, 1.0), 0.0); */
+ uv = vec3(attuv, 0.0);
+}
+
+void texco_norm(vec3 normal, out vec3 outnormal)
+{
+ /* corresponds to shi->orn, which is negated so cancels
+ out blender normal negation */
+ outnormal = normalize(normal);
+}
+
+void texco_tangent(vec3 tangent, out vec3 outtangent)
+{
+ outtangent = normalize(tangent);
+}
+
+void texco_global(mat4 viewinvmat, vec3 co, out vec3 global)
+{
+ global = (viewinvmat*vec4(co, 1.0)).xyz;
+}
+
+void texco_object(mat4 viewinvmat, mat4 obinvmat, vec3 co, out vec3 object)
+{
+ object = (obinvmat*(viewinvmat*vec4(co, 1.0))).xyz;
+}
+
+void texco_refl(vec3 vn, vec3 view, out vec3 ref)
+{
+ ref = view - 2.0*dot(vn, view)*vn;
+}
+
+void shade_norm(vec3 normal, out vec3 outnormal)
+{
+ /* blender render normal is negated */
+ outnormal = -normalize(normal);
+}
+
+void mtex_rgb_blend(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-fact;
+
+ incol = fact*texcol + facm*outcol;
+}
+
+void mtex_rgb_mul(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-facg;
+
+ incol = (facm + fact*texcol)*outcol;
+}
+
+void mtex_rgb_screen(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-facg;
+
+ incol = vec3(1.0) - (vec3(facm) + fact*(vec3(1.0) - texcol))*(vec3(1.0) - outcol);
+}
+
+void mtex_rgb_overlay(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-facg;
+
+ if(outcol.r < 0.5)
+ incol.r = outcol.r*(facm + 2.0*fact*texcol.r);
+ else
+ incol.r = 1.0 - (facm + 2.0*fact*(1.0 - texcol.r))*(1.0 - outcol.r);
+
+ if(outcol.g < 0.5)
+ incol.g = outcol.g*(facm + 2.0*fact*texcol.g);
+ else
+ incol.g = 1.0 - (facm + 2.0*fact*(1.0 - texcol.g))*(1.0 - outcol.g);
+
+ if(outcol.b < 0.5)
+ incol.b = outcol.b*(facm + 2.0*fact*texcol.b);
+ else
+ incol.b = 1.0 - (facm + 2.0*fact*(1.0 - texcol.b))*(1.0 - outcol.b);
+}
+
+void mtex_rgb_sub(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ incol = -fact*facg*texcol + outcol;
+}
+
+void mtex_rgb_add(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ incol = fact*facg*texcol + outcol;
+}
+
+void mtex_rgb_div(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-fact;
+
+ if(texcol.r != 0.0) incol.r = facm*outcol.r + fact*outcol.r/texcol.r;
+ if(texcol.g != 0.0) incol.g = facm*outcol.g + fact*outcol.g/texcol.g;
+ if(texcol.b != 0.0) incol.b = facm*outcol.b + fact*outcol.b/texcol.b;
+}
+
+void mtex_rgb_diff(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm;
+
+ fact *= facg;
+ facm = 1.0-fact;
+
+ incol = facm*outcol + fact*abs(texcol - outcol);
+}
+
+void mtex_rgb_dark(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm, col;
+
+ fact *= facg;
+ facm = 1.0-fact;
+
+ col = fact*texcol.r;
+ if(col < outcol.r) incol.r = col; else incol.r = outcol.r;
+ col = fact*texcol.g;
+ if(col < outcol.g) incol.g = col; else incol.g = outcol.g;
+ col = fact*texcol.b;
+ if(col < outcol.b) incol.b = col; else incol.b = outcol.b;
+}
+
+void mtex_rgb_light(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ float facm, col;
+
+ fact *= facg;
+ facm = 1.0-fact;
+
+ col = fact*texcol.r;
+ if(col > outcol.r) incol.r = col; else incol.r = outcol.r;
+ col = fact*texcol.g;
+ if(col > outcol.g) incol.g = col; else incol.g = outcol.g;
+ col = fact*texcol.b;
+ if(col > outcol.b) incol.b = col; else incol.b = outcol.b;
+}
+
+void mtex_rgb_hue(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ vec4 col;
+
+ mix_hue(fact*facg, vec4(outcol, 1.0), vec4(texcol, 1.0), col);
+ incol.rgb = col.rgb;
+}
+
+void mtex_rgb_sat(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ vec4 col;
+
+ mix_sat(fact*facg, vec4(outcol, 1.0), vec4(texcol, 1.0), col);
+ incol.rgb = col.rgb;
+}
+
+void mtex_rgb_val(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ vec4 col;
+
+ mix_val(fact*facg, vec4(outcol, 1.0), vec4(texcol, 1.0), col);
+ incol.rgb = col.rgb;
+}
+
+void mtex_rgb_color(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol)
+{
+ vec4 col;
+
+ mix_color(fact*facg, vec4(outcol, 1.0), vec4(texcol, 1.0), col);
+ incol.rgb = col.rgb;
+}
+
+void mtex_value_vars(inout float fact, float facg, out float facm, float flip)
+{
+ fact *= facg;
+ facm = 1.0-fact;
+
+ if(flip != 0.0) {
+ float tmp = fact;
+ fact = facm;
+ facm = tmp;
+ }
+}
+
+void mtex_value_blend(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ incol = fact*texcol + facm*outcol;
+}
+
+void mtex_value_mul(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ facm = 1.0 - facg;
+ incol = (facm + fact*texcol)*outcol;
+}
+
+void mtex_value_screen(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ facm = 1.0 - facg;
+ incol = 1.0 - (facm + fact*(1.0 - texcol))*(1.0 - outcol);
+}
+
+void mtex_value_sub(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ fact = -fact;
+ incol = fact*texcol + outcol;
+}
+
+void mtex_value_add(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ fact = fact;
+ incol = fact*texcol + outcol;
+}
+
+void mtex_value_div(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ if(texcol != 0.0)
+ incol = facm*outcol + fact*outcol/texcol;
+ else
+ incol = 0.0;
+}
+
+void mtex_value_diff(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ incol = facm*outcol + fact*abs(texcol - outcol);
+}
+
+void mtex_value_dark(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ float col = fact*texcol;
+ if(col < outcol) incol = col; else incol = outcol;
+}
+
+void mtex_value_light(float outcol, float texcol, float fact, float facg, float flip, out float incol)
+{
+ float facm;
+ mtex_value_vars(fact, facg, facm, flip);
+
+ float col = fact*texcol;
+ if(col > outcol) incol = col; else incol = outcol;
+}
+
+void mtex_value_clamp_positive(float fac, out float outfac)
+{
+ outfac = max(fac, 0.0);
+}
+
+void mtex_value_clamp(float fac, out float outfac)
+{
+ outfac = clamp(fac, 0.0, 1.0);
+}
+
+void mtex_har_divide(float har, out float outhar)
+{
+ outhar = har/128.0;
+}
+
+void mtex_har_multiply_clamp(float har, out float outhar)
+{
+ har *= 128.0;
+
+ if(har < 1.0) outhar = 1.0;
+ else if(har > 511.0) outhar = 511.0;
+ else outhar = har;
+}
+
+void mtex_alpha_from_col(vec4 col, out float alpha)
+{
+ alpha = col.a;
+}
+
+void mtex_alpha_to_col(vec4 col, float alpha, out vec4 outcol)
+{
+ outcol = vec4(col.rgb, alpha);
+}
+
+void mtex_rgbtoint(vec4 rgb, out float intensity)
+{
+ intensity = dot(vec3(0.35, 0.45, 0.2), rgb.rgb);
+}
+
+void mtex_value_invert(float invalue, out float outvalue)
+{
+ outvalue = 1.0 - invalue;
+}
+
+void mtex_rgb_invert(vec4 inrgb, out vec4 outrgb)
+{
+ outrgb = vec4(vec3(1.0) - inrgb.rgb, inrgb.a);
+}
+
+void mtex_value_stencil(float stencil, float intensity, out float outstencil, out float outintensity)
+{
+ float fact = intensity;
+ outintensity = intensity*stencil;
+ outstencil = stencil*fact;
+}
+
+void mtex_rgb_stencil(float stencil, vec4 rgb, out float outstencil, out vec4 outrgb)
+{
+ float fact = rgb.a;
+ outrgb = vec4(rgb.rgb, rgb.a*stencil);
+ outstencil = stencil*fact;
+}
+
+void mtex_mapping_ofs(vec3 texco, vec3 ofs, out vec3 outtexco)
+{
+ outtexco = texco + ofs;
+}
+
+void mtex_mapping_size(vec3 texco, vec3 size, out vec3 outtexco)
+{
+ outtexco = size*texco;
+}
+
+void mtex_2d_mapping(vec3 vec, out vec3 outvec)
+{
+ outvec = vec3(vec.xy*0.5 + vec2(0.5, 0.5), vec.z);
+}
+
+void mtex_image(vec3 vec, sampler2D ima, out float value, out vec4 color, out vec3 normal)
+{
+ color = texture2D(ima, vec.xy);
+ value = 1.0;
+
+ normal = 2.0*(vec3(color.r, -color.g, color.b) - vec3(0.5, -0.5, 0.5));
+}
+
+void mtex_negate_texnormal(vec3 normal, out vec3 outnormal)
+{
+ outnormal = vec3(-normal.x, -normal.y, normal.z);
+}
+
+void mtex_nspace_tangent(vec3 tangent, vec3 normal, vec3 texnormal, out vec3 outnormal)
+{
+ tangent = normalize(tangent);
+ vec3 B = cross(normal, tangent);
+
+ outnormal = texnormal.x*tangent + texnormal.y*B + texnormal.z*normal;
+ outnormal = normalize(outnormal);
+}
+
+void mtex_blend_normal(float norfac, vec3 normal, vec3 newnormal, out vec3 outnormal)
+{
+ outnormal = (1.0 - norfac)*normal + norfac*newnormal;
+ outnormal = normalize(outnormal);
+}
+
+/******* MATERIAL *********/
+
+void lamp_visibility_sun_hemi(vec3 lampvec, out vec3 lv, out float dist, out float visifac)
+{
+ lv = lampvec;
+ dist = 1.0;
+ visifac = 1.0;
+}
+
+void lamp_visibility_other(vec3 co, vec3 lampco, out vec3 lv, out float dist, out float visifac)
+{
+ lv = co - lampco;
+ dist = length(lv);
+ lv = normalize(lv);
+ visifac = 1.0;
+}
+
+void lamp_falloff_invlinear(float lampdist, float dist, out float visifac)
+{
+ visifac = lampdist/(lampdist + dist);
+}
+
+void lamp_falloff_invsquare(float lampdist, float dist, out float visifac)
+{
+ visifac = lampdist/(lampdist + dist*dist);
+}
+
+void lamp_falloff_sliders(float lampdist, float ld1, float ld2, float dist, out float visifac)
+{
+ float lampdistkw = lampdist*lampdist;
+
+ visifac = lampdist/(lampdist + ld1*dist);
+ visifac *= lampdistkw/(lampdistkw + ld2*dist*dist);
+}
+
+void lamp_falloff_curve(float lampdist, sampler1D curvemap, float dist, out float visifac)
+{
+ visifac = texture1D(curvemap, dist/lampdist).x;
+}
+
+void lamp_visibility_sphere(float lampdist, float dist, float visifac, out float outvisifac)
+{
+ float t= lampdist - dist;
+
+ outvisifac= visifac*max(t, 0.0)/lampdist;
+}
+
+void lamp_visibility_spot_square(vec3 lampvec, mat4 lampimat, vec3 lv, out float inpr)
+{
+ if(dot(lv, lampvec) > 0.0) {
+ vec3 lvrot = (lampimat*vec4(lv, 0.0)).xyz;
+ float x = max(abs(lvrot.x/lvrot.z), abs(lvrot.y/lvrot.z));
+
+ inpr = 1.0/sqrt(1.0 + x*x);
+ }
+ else
+ inpr = 0.0;
+}
+
+void lamp_visibility_spot_circle(vec3 lampvec, vec3 lv, out float inpr)
+{
+ inpr = dot(lv, lampvec);
+}
+
+void lamp_visibility_spot(float spotsi, float spotbl, float inpr, float visifac, out float outvisifac)
+{
+ float t = spotsi;
+
+ if(inpr <= t) {
+ outvisifac = 0.0;
+ }
+ else {
+ t = inpr - t;
+
+ /* soft area */
+ if(spotbl != 0.0)
+ inpr *= smoothstep(0.0, 1.0, t/spotbl);
+
+ outvisifac = visifac*inpr;
+ }
+}
+
+void lamp_visibility_clamp(float visifac, out float outvisifac)
+{
+ outvisifac = (visifac < 0.001)? 0.0: visifac;
+}
+
+void shade_view(vec3 co, out vec3 view)
+{
+ /* handle perspective/orthographic */
+ view = (gl_ProjectionMatrix[3][3] == 0.0)? normalize(co): vec3(0.0, 0.0, -1.0);
+}
+
+void shade_tangent_v(vec3 lv, vec3 tang, out vec3 vn)
+{
+ vec3 c = cross(lv, tang);
+ vec3 vnor = cross(c, tang);
+
+ vn = -normalize(vnor);
+}
+
+void shade_inp(vec3 vn, vec3 lv, out float inp)
+{
+ inp = dot(vn, lv);
+}
+
+void shade_is_no_diffuse(out float is)
+{
+ is = 0.0;
+}
+
+void shade_is_hemi(float inp, out float is)
+{
+ is = 0.5*inp + 0.5;
+}
+
+float area_lamp_energy(mat4 area, vec3 co, vec3 vn)
+{
+ vec3 vec[4], c[4];
+ float rad[4], fac;
+
+ vec[0] = normalize(co - area[0].xyz);
+ vec[1] = normalize(co - area[1].xyz);
+ vec[2] = normalize(co - area[2].xyz);
+ vec[3] = normalize(co - area[3].xyz);
+
+ c[0] = normalize(cross(vec[0], vec[1]));
+ c[1] = normalize(cross(vec[1], vec[2]));
+ c[2] = normalize(cross(vec[2], vec[3]));
+ c[3] = normalize(cross(vec[3], vec[0]));
+
+ rad[0] = acos(dot(vec[0], vec[1]));
+ rad[1] = acos(dot(vec[1], vec[2]));
+ rad[2] = acos(dot(vec[2], vec[3]));
+ rad[3] = acos(dot(vec[3], vec[0]));
+
+ fac= rad[0]*dot(vn, c[0]);
+ fac+= rad[1]*dot(vn, c[1]);
+ fac+= rad[2]*dot(vn, c[2]);
+ fac+= rad[3]*dot(vn, c[3]);
+
+ return max(fac, 0.0);
+}
+
+void shade_inp_area(vec3 position, vec3 lampco, vec3 lampvec, vec3 vn, mat4 area, float areasize, float k, out float inp)
+{
+ vec3 co = position;
+ vec3 vec = co - lampco;
+
+ if(dot(vec, lampvec) < 0.0) {
+ inp = 0.0;
+ }
+ else {
+ float intens = area_lamp_energy(area, co, vn);
+
+ inp = pow(intens*areasize, k);
+ }
+}
+
+void shade_diffuse_oren_nayer(float nl, vec3 n, vec3 l, vec3 v, float rough, out float is)
+{
+ vec3 h = normalize(v + l);
+ float nh = max(dot(n, h), 0.0);
+ float nv = max(dot(n, v), 0.0);
+ float realnl = dot(n, l);
+
+ if(realnl < 0.0) {
+ is = 0.0;
+ }
+ else if(nl < 0.0) {
+ is = 0.0;
+ }
+ else {
+ float vh = max(dot(v, h), 0.0);
+ float Lit_A = acos(realnl);
+ float View_A = acos(nv);
+
+ vec3 Lit_B = normalize(l - realnl*n);
+ vec3 View_B = normalize(v - nv*n);
+
+ float t = max(dot(Lit_B, View_B), 0.0);
+
+ float a, b;
+
+ if(Lit_A > View_A) {
+ a = Lit_A;
+ b = View_A;
+ }
+ else {
+ a = View_A;
+ b = Lit_A;
+ }
+
+ float A = 1.0 - (0.5*((rough*rough)/((rough*rough) + 0.33)));
+ float B = 0.45*((rough*rough)/((rough*rough) + 0.09));
+
+ b *= 0.95;
+ is = nl*(A + (B * t * sin(a) * tan(b)));
+ }
+}
+
+void shade_diffuse_toon(vec3 n, vec3 l, vec3 v, float size, float tsmooth, out float is)
+{
+ float rslt = dot(n, l);
+ float ang = acos(rslt);
+
+ if(ang < size) is = 1.0;
+ else if(ang > (size + tsmooth) || tsmooth == 0.0) is = 0.0;
+ else is = 1.0 - ((ang - size)/tsmooth);
+}
+
+void shade_diffuse_minnaert(float nl, vec3 n, vec3 v, float darkness, out float is)
+{
+ if(nl <= 0.0) {
+ is = 0.0;
+ }
+ else {
+ float nv = max(dot(n, v), 0.0);
+
+ if(darkness <= 1.0)
+ is = nl*pow(max(nv*nl, 0.1), darkness - 1.0);
+ else
+ is = nl*pow(1.0001 - nv, darkness - 1.0);
+ }
+}
+
+float fresnel_fac(vec3 view, vec3 vn, float grad, float fac)
+{
+ float t1, t2;
+ float ffac;
+
+ if(fac==0.0) {
+ ffac = 1.0;
+ }
+ else {
+ t1= dot(view, vn);
+ if(t1>0.0) t2= 1.0+t1;
+ else t2= 1.0-t1;
+
+ t2= grad + (1.0-grad)*pow(t2, fac);
+
+ if(t2<0.0) ffac = 0.0;
+ else if(t2>1.0) ffac = 1.0;
+ else ffac = t2;
+ }
+
+ return ffac;
+}
+
+void shade_diffuse_fresnel(vec3 vn, vec3 lv, vec3 view, float fac_i, float fac, out float is)
+{
+ is = fresnel_fac(lv, vn, fac_i, fac);
+}
+
+void shade_cubic(float is, out float outis)
+{
+ if(is>0.0 && is<1.0)
+ outis= smoothstep(0.0, 1.0, is);
+ else
+ outis= is;
+}
+
+void shade_visifac(float i, float visifac, float refl, out float outi)
+{
+ /*if(i > 0.0)*/
+ outi = max(i*visifac*refl, 0.0);
+ /*else
+ outi = i;*/
+}
+
+void shade_tangent_v_spec(vec3 tang, out vec3 vn)
+{
+ vn = tang;
+}
+
+void shade_add_to_diffuse(float i, vec3 lampcol, vec3 col, out vec3 outcol)
+{
+ if(i > 0.0)
+ outcol = i*lampcol*col;
+ else
+ outcol = vec3(0.0, 0.0, 0.0);
+}
+
+void shade_hemi_spec(vec3 vn, vec3 lv, vec3 view, float spec, float hard, float visifac, out float t)
+{
+ lv += view;
+ lv = normalize(lv);
+
+ t = dot(vn, lv);
+ t = 0.5*t + 0.5;
+
+ t = visifac*spec*pow(t, hard);
+}
+
+void shade_phong_spec(vec3 n, vec3 l, vec3 v, float hard, out float specfac)
+{
+ vec3 h = normalize(l + v);
+ float rslt = max(dot(h, n), 0.0);
+
+ specfac = pow(rslt, hard);
+}
+
+void shade_cooktorr_spec(vec3 n, vec3 l, vec3 v, float hard, out float specfac)
+{
+ vec3 h = normalize(v + l);
+ float nh = dot(n, h);
+
+ if(nh < 0.0) {
+ specfac = 0.0;
+ }
+ else {
+ float nv = max(dot(n, v), 0.0);
+ float i = pow(nh, hard);
+
+ i = i/(0.1+nv);
+ specfac = i;
+ }
+}
+
+void shade_blinn_spec(vec3 n, vec3 l, vec3 v, float refrac, float spec_power, out float specfac)
+{
+ if(refrac < 1.0) {
+ specfac = 0.0;
+ }
+ else if(spec_power == 0.0) {
+ specfac = 0.0;
+ }
+ else {
+ if(spec_power<100.0)
+ spec_power= sqrt(1.0/spec_power);
+ else
+ spec_power= 10.0/spec_power;
+
+ vec3 h = normalize(v + l);
+ float nh = dot(n, h);
+ if(nh < 0.0) {
+ specfac = 0.0;
+ }
+ else {
+ float nv = max(dot(n, v), 0.01);
+ float nl = dot(n, l);
+ if(nl <= 0.01) {
+ specfac = 0.0;
+ }
+ else {
+ float vh = max(dot(v, h), 0.01);
+
+ float a = 1.0;
+ float b = (2.0*nh*nv)/vh;
+ float c = (2.0*nh*nl)/vh;
+
+ float g = 0.0;
+
+ if(a < b && a < c) g = a;
+ else if(b < a && b < c) g = b;
+ else if(c < a && c < b) g = c;
+
+ float p = sqrt(((refrac * refrac)+(vh*vh)-1.0));
+ float f = (((p-vh)*(p-vh))/((p+vh)*(p+vh)))*(1.0+((((vh*(p+vh))-1.0)*((vh*(p+vh))-1.0))/(((vh*(p-vh))+1.0)*((vh*(p-vh))+1.0))));
+ float ang = acos(nh);
+
+ specfac = max(f*g*exp_blender((-(ang*ang)/(2.0*spec_power*spec_power))), 0.0);
+ }
+ }
+ }
+}
+
+void shade_wardiso_spec(vec3 n, vec3 l, vec3 v, float rms, out float specfac)
+{
+ vec3 h = normalize(l + v);
+ float nh = max(dot(n, h), 0.001);
+ float nv = max(dot(n, v), 0.001);
+ float nl = max(dot(n, l), 0.001);
+ float angle = tan(acos(nh));
+ float alpha = max(rms, 0.001);
+
+ specfac= nl * (1.0/(4.0*M_PI*alpha*alpha))*(exp_blender(-(angle*angle)/(alpha*alpha))/(sqrt(nv*nl)));
+}
+
+void shade_toon_spec(vec3 n, vec3 l, vec3 v, float size, float tsmooth, out float specfac)
+{
+ vec3 h = normalize(l + v);
+ float rslt = dot(h, n);
+ float ang = acos(rslt);
+
+ if(ang < size) rslt = 1.0;
+ else if(ang >= (size + tsmooth) || tsmooth == 0.0) rslt = 0.0;
+ else rslt = 1.0 - ((ang - size)/tsmooth);
+
+ specfac = rslt;
+}
+
+void shade_spec_area_inp(float specfac, float inp, out float outspecfac)
+{
+ outspecfac = specfac*inp;
+}
+
+void shade_spec_t(float shadfac, float spec, float visifac, float specfac, out float t)
+{
+ t = shadfac*spec*visifac*specfac;
+}
+
+void shade_add_spec(float t, vec3 lampcol, vec3 speccol, out vec3 outcol)
+{
+ outcol = t*lampcol*speccol;
+}
+
+void shade_add(vec4 col1, vec4 col2, out vec4 outcol)
+{
+ outcol = col1 + col2;
+}
+
+void shade_madd(vec4 col, vec4 col1, vec4 col2, out vec4 outcol)
+{
+ outcol = col + col1*col2;
+}
+
+void shade_maddf(vec4 col, float f, vec4 col1, out vec4 outcol)
+{
+ outcol = col + f*col1;
+}
+
+void shade_mul(vec4 col1, vec4 col2, out vec4 outcol)
+{
+ outcol = col1*col2;
+}
+
+void shade_mul_value(float fac, vec4 col, out vec4 outcol)
+{
+ outcol = col*fac;
+}
+
+void shade_obcolor(vec4 col, vec4 obcol, out vec4 outcol)
+{
+ outcol = vec4(col.rgb*obcol.rgb, col.a);
+}
+
+void ramp_rgbtobw(vec3 color, out float outval)
+{
+ outval = color.r*0.3 + color.g*0.58 + color.b*0.12;
+}
+
+void shade_only_shadow(float i, float shadfac, float energy, out float outshadfac)
+{
+ outshadfac = i*energy*(1.0 - shadfac);
+}
+
+void shade_only_shadow_diffuse(float shadfac, vec3 rgb, vec4 diff, out vec4 outdiff)
+{
+ outdiff = diff - vec4(rgb*shadfac, 0.0);
+}
+
+void shade_only_shadow_specular(float shadfac, vec3 specrgb, vec4 spec, out vec4 outspec)
+{
+ outspec = spec - vec4(specrgb*shadfac, 0.0);
+}
+
+void test_shadowbuf(vec3 rco, sampler2DShadow shadowmap, mat4 shadowpersmat, float shadowbias, float inp, out float result)
+{
+ if(inp <= 0.0) {
+ result = 0.0;
+ }
+ else {
+ vec4 co = shadowpersmat*vec4(rco, 1.0);
+
+ //float bias = (1.5 - inp*inp)*shadowbias;
+ co.z -= shadowbias*co.w;
+
+ result = shadow2DProj(shadowmap, co).x;
+ }
+}
+
+void shade_exposure_correct(vec3 col, float linfac, float logfac, out vec3 outcol)
+{
+ outcol = linfac*(1.0 - exp(col*logfac));
+}
+
+void shade_mist_factor(vec3 co, float miststa, float mistdist, float misttype, float misi, out float outfac)
+{
+ float fac, zcor;
+
+ zcor = (gl_ProjectionMatrix[3][3] == 0.0)? length(co): -co[2];
+
+ fac = clamp((zcor-miststa)/mistdist, 0.0, 1.0);
+ if(misttype == 0.0) fac *= fac;
+ else if(misttype == 1.0);
+ else fac = sqrt(fac);
+
+ outfac = 1.0 - (1.0-fac)*(1.0-misi);
+}
+
+void shade_world_mix(vec3 hor, vec4 col, out vec4 outcol)
+{
+ float fac = clamp(col.a, 0.0, 1.0);
+ outcol = vec4(mix(hor, col.rgb, fac), col.a);
+}
+
+void shade_alpha_opaque(vec4 col, out vec4 outcol)
+{
+ outcol = vec4(col.rgb, 1.0);
+}
+
+void shade_alpha_obcolor(vec4 col, vec4 obcol, out vec4 outcol)
+{
+ outcol = vec4(col.rgb, col.a*obcol.a);
+}
+
diff --git a/source/blender/gpu/intern/gpu_shader_material.glsl.c b/source/blender/gpu/intern/gpu_shader_material.glsl.c
new file mode 100644
index 00000000000..8287efe84ea
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_shader_material.glsl.c
@@ -0,0 +1,1032 @@
+/* DataToC output of file <gpu_shader_material_glsl> */
+
+int datatoc_gpu_shader_material_glsl_size= 32828;
+char datatoc_gpu_shader_material_glsl[]= {
+ 10,102,108,111, 97,116, 32,101,120,112, 95, 98,108,101,110,100,101,114, 40,102,108,111, 97,116, 32,102, 41, 10,
+123, 10, 9,114,101,116,117,114,110, 32,112,111,119, 40, 50, 46, 55, 49, 56, 50, 56, 49, 56, 50, 56, 52, 54, 44, 32,102, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,114,103, 98, 95,116,111, 95,104,115,118, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,111,117,
+116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32, 99,109, 97,120, 44, 32, 99,109,
+105,110, 44, 32,104, 44, 32,115, 44, 32,118, 44, 32, 99,100,101,108,116, 97, 59, 10, 9,118,101, 99, 51, 32, 99, 59, 10, 10, 9,
+ 99,109, 97,120, 32, 61, 32,109, 97,120, 40,114,103, 98, 91, 48, 93, 44, 32,109, 97,120, 40,114,103, 98, 91, 49, 93, 44, 32,114,
+103, 98, 91, 50, 93, 41, 41, 59, 10, 9, 99,109,105,110, 32, 61, 32,109,105,110, 40,114,103, 98, 91, 48, 93, 44, 32,109,105,110,
+ 40,114,103, 98, 91, 49, 93, 44, 32,114,103, 98, 91, 50, 93, 41, 41, 59, 10, 9, 99,100,101,108,116, 97, 32, 61, 32, 99,109, 97,
+120, 45, 99,109,105,110, 59, 10, 10, 9,118, 32, 61, 32, 99,109, 97,120, 59, 10, 9,105,102, 32, 40, 99,109, 97,120, 33, 61, 48,
+ 46, 48, 41, 10, 9, 9,115, 32, 61, 32, 99,100,101,108,116, 97, 47, 99,109, 97,120, 59, 10, 9,101,108,115,101, 32,123, 10, 9,
+ 9,115, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 10, 9,105,102, 32, 40,115, 32,
+ 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10,
+ 9, 9, 99, 32, 61, 32, 40,118,101, 99, 51, 40, 99,109, 97,120, 44, 32, 99,109, 97,120, 44, 32, 99,109, 97,120, 41, 32, 45, 32,
+114,103, 98, 46,120,121,122, 41, 47, 99,100,101,108,116, 97, 59, 10, 10, 9, 9,105,102, 32, 40,114,103, 98, 46,120, 61, 61, 99,
+109, 97,120, 41, 32,104, 32, 61, 32, 99, 91, 50, 93, 32, 45, 32, 99, 91, 49, 93, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32,
+ 40,114,103, 98, 46,121, 61, 61, 99,109, 97,120, 41, 32,104, 32, 61, 32, 50, 46, 48, 32, 43, 32, 99, 91, 48, 93, 32, 45, 32, 32,
+ 99, 91, 50, 93, 59, 10, 9, 9,101,108,115,101, 32,104, 32, 61, 32, 52, 46, 48, 32, 43, 32, 99, 91, 49, 93, 32, 45, 32, 99, 91,
+ 48, 93, 59, 10, 10, 9, 9,104, 32, 47, 61, 32, 54, 46, 48, 59, 10, 10, 9, 9,105,102, 32, 40,104, 60, 48, 46, 48, 41, 10, 9,
+ 9, 9,104, 32, 43, 61, 32, 49, 46, 48, 59, 10, 9,125, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,104,
+ 44, 32,115, 44, 32,118, 44, 32,114,103, 98, 46,119, 41, 59, 10,125, 10, 10,118,111,105,100, 32,104,115,118, 95,116,111, 95,114,
+103, 98, 40,118,101, 99, 52, 32,104,115,118, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10,
+ 9,102,108,111, 97,116, 32,105, 44, 32,102, 44, 32,112, 44, 32,113, 44, 32,116, 44, 32,104, 44, 32,115, 44, 32,118, 59, 10, 9,
+118,101, 99, 51, 32,114,103, 98, 59, 10, 10, 9,104, 32, 61, 32,104,115,118, 91, 48, 93, 59, 10, 9,115, 32, 61, 32,104,115,118,
+ 91, 49, 93, 59, 10, 9,118, 32, 61, 32,104,115,118, 91, 50, 93, 59, 10, 10, 9,105,102, 40,115, 61, 61, 48, 46, 48, 41, 32,123,
+ 10, 9, 9,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44, 32,118, 44, 32,118, 41, 59, 10, 9,125, 10, 9,101,108,115,101,
+ 32,123, 10, 9, 9,105,102, 40,104, 61, 61, 49, 46, 48, 41, 10, 9, 9, 9,104, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9, 10, 9,
+ 9,104, 32, 42, 61, 32, 54, 46, 48, 59, 10, 9, 9,105, 32, 61, 32,102,108,111,111,114, 40,104, 41, 59, 10, 9, 9,102, 32, 61,
+ 32,104, 32, 45, 32,105, 59, 10, 9, 9,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,102, 44, 32,102, 44, 32,102, 41, 59, 10, 9,
+ 9,112, 32, 61, 32,118, 42, 40, 49, 46, 48, 45,115, 41, 59, 10, 9, 9,113, 32, 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42,
+102, 41, 41, 59, 10, 9, 9,116, 32, 61, 32,118, 42, 40, 49, 46, 48, 45, 40,115, 42, 40, 49, 46, 48, 45,102, 41, 41, 41, 59, 10,
+ 9, 9, 10, 9, 9,105,102, 32, 40,105, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,118, 44,
+ 32,116, 44, 32,112, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 49, 46, 48, 41, 32,114,103, 98,
+ 32, 61, 32,118,101, 99, 51, 40,113, 44, 32,118, 44, 32,112, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61,
+ 61, 32, 50, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32,118, 44, 32,116, 41, 59, 10, 9, 9,101,108,
+115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 51, 46, 48, 41, 32,114,103, 98, 32, 61, 32,118,101, 99, 51, 40,112, 44, 32,113,
+ 44, 32,118, 41, 59, 10, 9, 9,101,108,115,101, 32,105,102, 32, 40,105, 32, 61, 61, 32, 52, 46, 48, 41, 32,114,103, 98, 32, 61,
+ 32,118,101, 99, 51, 40,116, 44, 32,112, 44, 32,118, 41, 59, 10, 9, 9,101,108,115,101, 32,114,103, 98, 32, 61, 32,118,101, 99,
+ 51, 40,118, 44, 32,112, 44, 32,113, 41, 59, 10, 9,125, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,114,
+103, 98, 44, 32,104,115,118, 46,119, 41, 59, 10,125, 10, 10, 35,100,101,102,105,110,101, 32, 77, 95, 80, 73, 32, 51, 46, 49, 52,
+ 49, 53, 57, 50, 54, 53, 51, 53, 56, 57, 55, 57, 51, 50, 51, 56, 52, 54, 10, 10, 47, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 32, 83, 72, 65, 68, 69, 82, 32, 78, 79, 68, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,
+118,111,105,100, 32,118, 99,111,108, 95, 97,116,116,114,105, 98,117,116,101, 40,118,101, 99, 52, 32, 97,116,116,118, 99,111,108,
+ 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 41, 10,123, 10, 9,118, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,
+ 97,116,116,118, 99,111,108, 46,120, 47, 50, 53, 53, 46, 48, 44, 32, 97,116,116,118, 99,111,108, 46,121, 47, 50, 53, 53, 46, 48,
+ 44, 32, 97,116,116,118, 99,111,108, 46,122, 47, 50, 53, 53, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100,
+ 32,117,118, 95, 97,116,116,114,105, 98,117,116,101, 40,118,101, 99, 50, 32, 97,116,116,117,118, 44, 32,111,117,116, 32,118,101,
+ 99, 51, 32,117,118, 41, 10,123, 10, 9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,
+118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,103,101,
+111,109, 40,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,109, 97,116, 52, 32,118,105,101,119,105,
+110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 97,116,116,111,114, 99,111, 44, 32,118,101, 99, 50, 32, 97,116,116,117,118, 44,
+ 32,118,101, 99, 52, 32, 97,116,116,118, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 44, 32,
+111,117,116, 32,118,101, 99, 51, 32,108,111, 99, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,111,
+117,116, 32,118,101, 99, 51, 32,111,114, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 44, 32,111,117,116, 32,118,
+101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,118, 99,111,108, 44, 32,111,117,116, 32,102,
+108,111, 97,116, 32,102,114,111,110,116, 98, 97, 99,107, 41, 10,123, 10, 9,108,111, 99, 97,108, 32, 61, 32, 99,111, 59, 10, 9,
+118,105,101,119, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,111, 99, 97,108, 41, 59, 10, 9,103,108,111, 98, 97,108,
+ 32, 61, 32, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40,108,111, 99, 97,108, 44, 32, 49, 46, 48, 41, 41,
+ 46,120,121,122, 59, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,111,114, 99,111, 59, 10, 9,117,118, 95, 97,116,116,114,105,
+ 98,117,116,101, 40, 97,116,116,117,118, 44, 32,117,118, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109,
+ 97,108,105,122,101, 40,110,111,114, 41, 59, 9, 47, 42, 32, 98,108,101,110,100,101,114, 32,114,101,110,100,101,114, 32,110,111,
+114,109, 97,108, 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,118, 99,111,108, 95, 97,116,116,114,105, 98,117,
+116,101, 40, 97,116,116,118, 99,111,108, 44, 32,118, 99,111,108, 41, 59, 10, 9,102,114,111,110,116, 98, 97, 99,107, 32, 61, 32,
+ 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,112,112,105,110,103, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,109,
+ 97,116, 52, 32,109, 97,116, 44, 32,118,101, 99, 51, 32,109,105,110,118,101, 99, 44, 32,118,101, 99, 51, 32,109, 97,120,118,101,
+ 99, 44, 32,102,108,111, 97,116, 32,100,111,109,105,110, 44, 32,102,108,111, 97,116, 32,100,111,109, 97,120, 44, 32,111,117,116,
+ 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32, 40,109, 97,116, 32, 42,
+ 32,118,101, 99, 52, 40,118,101, 99, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9,105,102, 40,100,111,109,105,110, 32,
+ 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,101, 99, 32, 61, 32,109, 97,120, 40,111,117,116,118,101, 99, 44, 32,109,
+105,110,118,101, 99, 41, 59, 10, 9,105,102, 40,100,111,109, 97,120, 32, 61, 61, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,118,
+101, 99, 32, 61, 32,109,105,110, 40,111,117,116,118,101, 99, 44, 32,109, 97,120,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,
+100, 32, 99, 97,109,101,114, 97, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,105,
+101,119, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,100,101,112,116,104, 44, 32,111,117,116, 32,102,108,111, 97,
+116, 32,111,117,116,100,105,115,116, 41, 10,123, 10, 9,111,117,116,100,101,112,116,104, 32, 61, 32, 97, 98,115, 40, 99,111, 46,
+122, 41, 59, 10, 9,111,117,116,100,105,115,116, 32, 61, 32,108,101,110,103,116,104, 40, 99,111, 41, 59, 10, 9,111,117,116,118,
+105,101,119, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,
+104, 95, 97,100,100, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49,
+ 32, 43, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,115,117, 98,116,114, 97, 99,116, 40,102,
+108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116,
+ 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 45, 32,118, 97,108, 50,
+ 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109,117,108,116,105,112,108,121, 40,102,108,111, 97,116, 32,118, 97,
+108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,
+ 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 42, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,
+105,100, 32,109, 97,116,104, 95,100,105,118,105,100,101, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116,
+ 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,
+118, 97,108, 50, 32, 61, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,
+115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 49, 32, 47, 32,118, 97,108, 50, 59, 10,125, 10, 10,118,111,
+105,100, 32,109, 97,116,104, 95,115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,
+116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,115,105,110, 40,118, 97,108, 41, 59, 10,
+125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 99,111,115,105,110,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,115,
+ 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,116, 97,110,103,101,110,116, 40,102,108,111, 97,
+116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,
+ 97,108, 32, 61, 32,116, 97,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,115,105,110,
+ 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10,
+ 9,105,102, 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, 46, 48, 41, 10,
+ 9, 9,111,117,116,118, 97,108, 32, 61, 32, 97,115,105,110, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,
+116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97, 99,111,115, 40,102,108,
+111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102,
+ 32, 40,118, 97,108, 32, 60, 61, 32, 49, 46, 48, 32, 38, 38, 32,118, 97,108, 32, 62, 61, 32, 45, 49, 46, 48, 41, 10, 9, 9,111,
+117,116,118, 97,108, 32, 61, 32, 97, 99,111,115, 40,118, 97,108, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,
+108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95, 97,116, 97,110, 40,102,108,111, 97,116,
+ 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,
+108, 32, 61, 32, 97,116, 97,110, 40,118, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,112,111,119, 40,
+102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,
+116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 32, 40,118, 97,108, 49, 32, 62, 61, 32, 48, 46, 48, 41, 10, 9, 9,
+111,117,116,118, 97,108, 32, 61, 32,112,111,119, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10,
+ 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,108,111,103,
+ 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32, 48, 46, 48, 32, 32, 38, 38, 32,
+118, 97,108, 50, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116,118, 97,108, 61, 32,108,111,103, 50, 40,118, 97,108, 49, 41,
+ 32, 47, 32,108,111,103, 50, 40,118, 97,108, 50, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 61, 32, 48,
+ 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,109, 97,120, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44,
+ 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123,
+ 10, 9,111,117,116,118, 97,108, 32, 61, 32,109, 97,120, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,
+111,105,100, 32,109, 97,116,104, 95,109,105,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44, 32,102,108,111, 97,116, 32,118,
+ 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108,
+ 32, 61, 32,109,105,110, 40,118, 97,108, 49, 44, 32,118, 97,108, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104,
+ 95,114,111,117,110,100, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,
+ 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 61, 32,102,108,111,111,114, 40,118, 97,108, 32, 43, 32, 48, 46, 53, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109, 97,116,104, 95,108,101,115,115, 95,116,104, 97,110, 40,102,108,111, 97,116, 32,118, 97,
+108, 49, 44, 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108,
+ 41, 10,123, 10, 9,105,102, 40,118, 97,108, 49, 32, 60, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32,
+ 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,
+105,100, 32,109, 97,116,104, 95,103,114,101, 97,116,101,114, 95,116,104, 97,110, 40,102,108,111, 97,116, 32,118, 97,108, 49, 44,
+ 32,102,108,111, 97,116, 32,118, 97,108, 50, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123,
+ 10, 9,105,102, 40,118, 97,108, 49, 32, 62, 32,118, 97,108, 50, 41, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48,
+ 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,
+115,113,117,101,101,122,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,102,108,111, 97,116, 32,119,105,100,116,104, 44, 32,
+102,108,111, 97,116, 32, 99,101,110,116,101,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,
+123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 49, 46, 48, 47, 40, 49, 46, 48, 32, 43, 32,112,111,119, 40, 50, 46, 55, 49, 56,
+ 50, 56, 49, 56, 51, 44, 32, 45, 40, 40,118, 97,108, 45, 99,101,110,116,101,114, 41, 42,119,105,100,116,104, 41, 41, 41, 59, 10,
+125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,100,100, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101,
+ 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,
+116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 43, 32,118, 50, 59, 10, 9,
+111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, 43, 32, 97, 98,115, 40,111,
+117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, 41, 41, 47, 51, 46, 48, 59,
+ 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,115,117, 98, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,
+101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 45, 32,118, 50, 59, 10,
+ 9,111,117,116,118, 97,108, 32, 61, 32, 40, 97, 98,115, 40,111,117,116,118,101, 99, 91, 48, 93, 41, 32, 43, 32, 97, 98,115, 40,
+111,117,116,118,101, 99, 91, 49, 93, 41, 32, 43, 32, 97, 98,115, 40,111,117,116,118,101, 99, 91, 50, 93, 41, 41, 47, 51, 46, 48,
+ 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95, 97,118,101,114, 97,103,101, 40,118,101, 99, 51, 32,
+118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118, 49, 32, 43,
+ 32,118, 50, 59, 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10, 9,
+111,117,116,118,101, 99, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,118,101, 99, 41, 59, 10,125, 10, 10,118,
+111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,100,111,116, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118,
+ 50, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,
+116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,118,101, 99, 51, 40, 48, 44, 32, 48, 44, 32, 48, 41, 59,
+ 10, 9,111,117,116,118, 97,108, 32, 61, 32,100,111,116, 40,118, 49, 44, 32,118, 50, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
+118,101, 99, 95,109, 97,116,104, 95, 99,114,111,115,115, 40,118,101, 99, 51, 32,118, 49, 44, 32,118,101, 99, 51, 32,118, 50, 44,
+ 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,
+ 97,108, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32, 99,114,111,115,115, 40,118, 49, 44, 32,118, 50, 41, 59, 10, 9,
+111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,111,117,116,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100,
+ 32,118,101, 99, 95,109, 97,116,104, 95,110,111,114,109, 97,108,105,122,101, 40,118,101, 99, 51, 32,118, 44, 32,111,117,116, 32,
+118,101, 99, 51, 32,111,117,116,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123,
+ 10, 9,111,117,116,118, 97,108, 32, 61, 32,108,101,110,103,116,104, 40,118, 41, 59, 10, 9,111,117,116,118,101, 99, 32, 61, 32,
+110,111,114,109, 97,108,105,122,101, 40,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,118,101, 99, 95,109, 97,116,104, 95,110,
+101,103, 97,116,101, 40,118,101, 99, 51, 32,118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118, 41, 10,123, 10, 9,
+111,117,116,118, 32, 61, 32, 45,118, 59, 10,125, 10, 10,118,111,105,100, 32,110,111,114,109, 97,108, 40,118,101, 99, 51, 32,100,
+105,114, 44, 32,118,101, 99, 51, 32,110,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114, 44, 32,111,
+117,116, 32,102,108,111, 97,116, 32,111,117,116,100,111,116, 41, 10,123, 10, 9,111,117,116,110,111,114, 32, 61, 32,100,105,114,
+ 59, 10, 9,111,117,116,100,111,116, 32, 61, 32, 45,100,111,116, 40,100,105,114, 44, 32,110,111,114, 41, 59, 10,125, 10, 10,118,
+111,105,100, 32, 99,117,114,118,101,115, 95,118,101, 99, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114,
+ 49, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10,
+ 9,111,117,116,118,101, 99, 46,120, 32, 61, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,
+ 40,118,101, 99, 46,120, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 41, 46,120, 59, 10, 9,111,117,116,118,101, 99, 46,121, 32,
+ 61, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32, 40,118,101, 99, 46,121, 32, 43, 32, 49,
+ 46, 48, 41, 42, 48, 46, 53, 41, 46,121, 59, 10, 9,111,117,116,118,101, 99, 46,122, 32, 61, 32,116,101,120,116,117,114,101, 49,
+ 68, 40, 99,117,114,118,101,109, 97,112, 44, 32, 40,118,101, 99, 46,122, 32, 43, 32, 49, 46, 48, 41, 42, 48, 46, 53, 41, 46,122,
+ 59, 10,125, 10, 10,118,111,105,100, 32, 99,117,114,118,101,115, 95,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,115,
+ 97,109,112,108,101,114, 49, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,
+111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,118,
+101,109, 97,112, 44, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32, 99,111,108, 46,114, 41,
+ 46, 97, 41, 46,114, 59, 10, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,
+118,101,109, 97,112, 44, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32, 99,111,108, 46,103,
+ 41, 46, 97, 41, 46,103, 59, 10, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,
+114,118,101,109, 97,112, 44, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32, 99,111,108, 46,
+ 98, 41, 46, 97, 41, 46, 98, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,
+111,105,100, 32,115,101,116, 95,118, 97,108,117,101, 40,102,108,111, 97,116, 32,118, 97,108, 44, 32,111,117,116, 32,102,108,111,
+ 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118, 97,108, 59, 10,125, 10, 10,118,
+111,105,100, 32,115,101,116, 95,114,103, 98, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,
+117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,
+115,101,116, 95,114,103, 98, 97, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,
+111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116,
+ 95,118, 97,108,117,101, 95,122,101,114,111, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10,
+ 9,111,117,116,118, 97,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,118, 97,108,117,101,
+ 95,111,110,101, 40,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108,
+ 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 95,122,101,114,111, 40,111,117,116,
+ 32,118,101, 99, 51, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48,
+ 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,116, 95,114,103, 98, 97, 95,122,101,114,111, 40,111,117,116, 32,118,
+101, 99, 52, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,118,101, 99, 52, 40, 48, 46, 48,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,
+118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,
+117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32,
+ 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 50, 44, 32,
+102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,
+100, 32,109,105,120, 95, 97,100,100, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,
+118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102,
+ 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,
+111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41,
+ 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,
+120, 95,109,117,108,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99,
+ 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32,
+ 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32,
+ 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 42, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,
+111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,
+ 99,114,101,101,110, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52,
+ 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61,
+ 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97,
+ 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,
+ 49, 46, 48, 41, 32, 45, 32, 40,118,101, 99, 52, 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99, 42, 40,118,101, 99, 52, 40, 49,
+ 46, 48, 41, 32, 45, 32, 99,111,108, 50, 41, 41, 42, 40,118,101, 99, 52, 40, 49, 46, 48, 41, 32, 45, 32, 99,111,108, 49, 41, 59,
+ 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120,
+ 95,111,118,101,114,108, 97,121, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,
+101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97,
+ 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116,
+ 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,
+108, 49, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,111,117,116, 99,111,
+108, 46,114, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,101,
+108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50,
+ 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,
+116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,
+111,117,116, 99,111,108, 46,103, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 99,111,108, 50, 46,
+103, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,
+109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46,103, 41, 41, 42, 40, 49, 46, 48,
+ 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46,
+ 53, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 42, 61, 32,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42,
+ 99,111,108, 50, 46, 98, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45,
+ 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99, 42, 40, 49, 46, 48, 32, 45, 32, 99,111,108, 50, 46, 98, 41, 41,
+ 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,115,
+117, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,
+108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108,
+ 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,
+120, 40, 99,111,108, 49, 44, 32, 99,111,108, 49, 32, 45, 32, 99,111,108, 50, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,
+111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,118, 40,102,
+108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,
+111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,
+102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46,
+ 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102, 40, 99,
+111,108, 50, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46,114, 32, 61, 32,102, 97, 99,109, 42,111,117,
+116, 99,111,108, 46,114, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108, 46,114, 47, 99,111,108, 50, 46,114, 59, 10, 9,105,
+102, 40, 99,111,108, 50, 46,103, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109,
+ 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108, 46,103, 47, 99,111,108, 50, 46,103, 59,
+ 10, 9,105,102, 40, 99,111,108, 50, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,111,117,116, 99,111,108, 46, 98, 32, 61, 32,102,
+ 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32, 43, 32,102, 97, 99, 42,111,117,116, 99,111,108, 46, 98, 47, 99,111,108, 50,
+ 46, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,105,102,102, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,
+118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,
+117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32,
+ 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,111,108, 49, 44, 32, 97, 98,115, 40, 99,111,
+108, 49, 32, 45, 32, 99,111,108, 50, 41, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,
+108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,102, 97, 99,
+ 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52,
+ 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48,
+ 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 46,114,103, 98, 32, 61, 32,109,105,110, 40, 99,111,108, 49, 46,114,
+103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,
+111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,108,105,103,104,116, 40,102,108,111, 97,116, 32,102,
+ 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48,
+ 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 46,114,103, 98, 32, 61, 32,109, 97,120, 40, 99,111,108, 49,
+ 46,114,103, 98, 44, 32, 99,111,108, 50, 46,114,103, 98, 42,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46, 97, 32, 61,
+ 32, 99,111,108, 49, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,100,111,100,103,101, 40,102,108,111, 97,116,
+ 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,
+118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44,
+ 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,105,102,
+ 40,111,117,116, 99,111,108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32,
+ 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32,
+ 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,
+102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46,114, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,
+ 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,
+108, 46,114, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46,
+ 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108,
+ 50, 46,103, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,
+103, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108,
+ 46,103, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48,
+ 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,116,109,112, 59, 10, 9,125, 10, 9,
+105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,116, 32,116,109,
+112, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10, 9, 9,105,102, 40,116,109,112, 32, 60,
+ 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101,
+ 32,105,102, 40, 40,116,109,112, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 47,116,109,112, 41, 32, 62, 32, 49, 46, 48, 41, 10,
+ 9, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,111,117,116,
+ 99,111,108, 46, 98, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95, 98,117,114,110,
+ 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50,
+ 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,
+112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,116,109,112, 44, 32,102, 97,
+ 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59,
+ 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,114, 59, 10, 9,105,102, 40,
+116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,
+108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,
+111,108, 46,114, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,
+ 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,
+108, 46,114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,114, 32, 61, 32,116,109,
+112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46,103, 59, 10, 9,105,
+102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32, 48, 46, 48, 59, 10,
+ 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,111,117,
+116, 99,111,108, 46,103, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32,
+ 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,117,116,
+ 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46,103, 32, 61, 32,
+116,109,112, 59, 10, 10, 9,116,109,112, 32, 61, 32,102, 97, 99,109, 32, 43, 32,102, 97, 99, 42, 99,111,108, 50, 46, 98, 59, 10,
+ 9,105,102, 40,116,109,112, 32, 60, 61, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32, 61, 32, 48, 46, 48,
+ 59, 10, 9,101,108,115,101, 32,105,102, 40, 40,116,109,112, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 32, 45, 32,
+111,117,116, 99,111,108, 46, 98, 41, 47,116,109,112, 41, 41, 32, 60, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 46,
+ 98, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101, 32,105,102, 40,116,109,112, 32, 62, 32, 49, 46, 48, 41, 10, 9, 9,111,
+117,116, 99,111,108, 46, 98, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 46, 98, 32,
+ 61, 32,116,109,112, 59, 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,104,117,101, 40,102,108,111, 97,116, 32,102, 97, 99,
+ 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52,
+ 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48,
+ 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59,
+ 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,
+118, 50, 44, 32,116,109,112, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41,
+ 59, 10, 10, 9,105,102, 40,104,115,118, 50, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111,
+ 95,104,115,118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118,
+ 50, 46,120, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,109,112, 41, 59, 32, 10, 10, 9,
+ 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,112, 44, 32,102, 97, 99, 41, 59,
+ 10, 9, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100,
+ 32,109,105,120, 95,115, 97,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,
+101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,102, 97,
+ 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,108,111, 97,116,
+ 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,
+108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,
+118, 40,111,117,116, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10, 9,105,102, 40,104,115,118, 46,121, 32, 33, 61, 32, 48, 46,
+ 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10,
+ 9, 9,104,115,118, 46,121, 32, 61, 32,102, 97, 99,109, 42,104,115,118, 46,121, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,
+121, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 9,125,
+ 10,125, 10, 10,118,111,105,100, 32,109,105,120, 95,118, 97,108, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52,
+ 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
+108, 41, 10,123, 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41,
+ 59, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,118,101, 99,
+ 52, 32,104,115,118, 44, 32,104,115,118, 50, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 49, 44, 32,104,
+115,118, 41, 59, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,
+104,115,118, 46,122, 32, 61, 32,102, 97, 99,109, 42,104,115,118, 46,122, 32, 43, 32,102, 97, 99, 42,104,115,118, 50, 46,122, 59,
+ 10, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,
+105,100, 32,109,105,120, 95, 99,111,108,111,114, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108,
+ 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123,
+ 10, 9,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,102,
+108,111, 97,116, 32,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 32, 45, 32,102, 97, 99, 59, 10, 10, 9,111,117,116, 99,111,108, 32,
+ 61, 32, 99,111,108, 49, 59, 10, 10, 9,118,101, 99, 52, 32,104,115,118, 44, 32,104,115,118, 50, 44, 32,116,109,112, 59, 10, 9,
+114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 50, 44, 32,104,115,118, 50, 41, 59, 10, 10, 9,105,102, 40,104,115,118,
+ 50, 46,121, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,103, 98, 95,116,111, 95,104,115,118, 40,111,117,116, 99,111,
+108, 44, 32,104,115,118, 41, 59, 10, 9, 9,104,115,118, 46,120, 32, 61, 32,104,115,118, 50, 46,120, 59, 10, 9, 9,104,115,118,
+ 46,121, 32, 61, 32,104,115,118, 50, 46,121, 59, 10, 9, 9,104,115,118, 95,116,111, 95,114,103, 98, 40,104,115,118, 44, 32,116,
+109,112, 41, 59, 32, 10, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40,111,117,116, 99,111,108, 44, 32,116,109,
+112, 44, 32,102, 97, 99, 41, 59, 10, 9, 9,111,117,116, 99,111,108, 46, 97, 32, 61, 32, 99,111,108, 49, 46, 97, 59, 10, 9,125,
+ 10,125, 10, 10,118,111,105,100, 32,118, 97,108,116,111,114,103, 98, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,115, 97,109,
+112,108,101,114, 49, 68, 32, 99,111,108,111,114,109, 97,112, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108,
+ 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116, 97,108,112,104, 97, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32,
+ 61, 32,116,101,120,116,117,114,101, 49, 68, 40, 99,111,108,111,114,109, 97,112, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116,
+ 97,108,112,104, 97, 32, 61, 32,111,117,116, 99,111,108, 46, 97, 59, 10,125, 10, 10,118,111,105,100, 32,114,103, 98,116,111, 98,
+119, 40,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,
+123, 10, 9,111,117,116,118, 97,108, 32, 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 53, 32, 43, 32, 99,111,108,111,114,
+ 46,103, 42, 48, 46, 52, 53, 32, 43, 32, 99,111,108,111,114, 46, 98, 42, 48, 46, 50, 59, 10,125, 10, 10,118,111,105,100, 32,105,
+110,118,101,114,116, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,
+101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 46,120,121,122, 32, 61, 32,109,105,120, 40,
+ 99,111,108, 46,120,121,122, 44, 32,118,101, 99, 51, 40, 49, 46, 48, 44, 32, 49, 46, 48, 44, 32, 49, 46, 48, 41, 32, 45, 32, 99,
+111,108, 46,120,121,122, 44, 32,102, 97, 99, 41, 59, 10, 9,111,117,116, 99,111,108, 46,119, 32, 61, 32, 99,111,108, 46,119, 59,
+ 10,125, 10, 10,118,111,105,100, 32,104,117,101, 95,115, 97,116, 40,102,108,111, 97,116, 32,104,117,101, 44, 32,102,108,111, 97,
+116, 32,115, 97,116, 44, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,
+101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,118,101, 99,
+ 52, 32,104,115,118, 59, 10, 10, 9,114,103, 98, 95,116,111, 95,104,115,118, 40, 99,111,108, 44, 32,104,115,118, 41, 59, 10, 10,
+ 9,104,115,118, 91, 48, 93, 32, 43, 61, 32, 40,104,117,101, 32, 45, 32, 48, 46, 53, 41, 59, 10, 9,105,102, 40,104,115,118, 91,
+ 48, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 48, 93, 45, 61, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118,
+ 91, 48, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 48, 93, 43, 61, 32, 49, 46, 48, 59, 10, 9,104,115,118, 91, 49, 93, 32, 42,
+ 61, 32,115, 97,116, 59, 10, 9,105,102, 40,104,115,118, 91, 49, 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32, 49,
+ 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91, 49, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 49, 93, 61, 32,
+ 48, 46, 48, 59, 10, 9,104,115,118, 91, 50, 93, 32, 42, 61, 32,118, 97,108,117,101, 59, 10, 9,105,102, 40,104,115,118, 91, 50,
+ 93, 62, 49, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 49, 46, 48, 59, 32,101,108,115,101, 32,105,102, 40,104,115,118, 91,
+ 50, 93, 60, 48, 46, 48, 41, 32,104,115,118, 91, 50, 93, 61, 32, 48, 46, 48, 59, 10, 10, 9,104,115,118, 95,116,111, 95,114,103,
+ 98, 40,104,115,118, 44, 32,111,117,116, 99,111,108, 41, 59, 10, 10, 9,111,117,116, 99,111,108, 32, 61, 32,109,105,120, 40, 99,
+111,108, 44, 32,111,117,116, 99,111,108, 44, 32,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,101,112, 97,114, 97,
+116,101, 95,114,103, 98, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32, 98, 41, 10,123, 10, 9,114, 32, 61, 32, 99,
+111,108, 46,114, 59, 10, 9,103, 32, 61, 32, 99,111,108, 46,103, 59, 10, 9, 98, 32, 61, 32, 99,111,108, 46, 98, 59, 10,125, 10,
+ 10,118,111,105,100, 32, 99,111,109, 98,105,110,101, 95,114,103, 98, 40,102,108,111, 97,116, 32,114, 44, 32,102,108,111, 97,116,
+ 32,103, 44, 32,102,108,111, 97,116, 32, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108, 41, 10,123, 10, 9, 99,111,
+108, 32, 61, 32,118,101, 99, 52, 40,114, 44, 32,103, 44, 32, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
+111,117,116,112,117,116, 95,110,111,100,101, 40,118,101, 99, 52, 32,114,103, 98, 44, 32,102,108,111, 97,116, 32, 97,108,112,104,
+ 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,111,117,116,114,103, 98, 32, 61, 32,
+118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32, 97,108,112,104, 97, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 32, 84, 69, 88, 84, 85, 82, 69, 83, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10,
+ 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,102,108,105,112, 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,118,101,
+ 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,
+118,101, 99, 46,121,120,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95, 98,108,101,110,100, 95,108,
+105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123,
+ 10, 9,111,117,116,118, 97,108, 32, 61, 32, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48, 59, 10,125, 10, 10,118,
+111,105,100, 32,116,101,120,116,117,114,101, 95, 98,108,101,110,100, 95,113,117, 97,100, 40,118,101, 99, 51, 32,118,101, 99, 44,
+ 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,117,116,118, 97,108, 32, 61, 32,109,
+ 97,120, 40, 40, 49, 46, 48, 43,118,101, 99, 46,120, 41, 47, 50, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10, 9,111,117,116,118, 97,
+108, 32, 42, 61, 32,111,117,116,118, 97,108, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,119,111,111,
+100, 95,115,105,110, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44,
+ 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108,
+ 41, 10,123, 10, 9,102,108,111, 97,116, 32, 97, 32, 61, 32,115,113,114,116, 40,118,101, 99, 46,120, 42,118,101, 99, 46,120, 32,
+ 43, 32,118,101, 99, 46,121, 42,118,101, 99, 46,121, 32, 43, 32,118,101, 99, 46,122, 42,118,101, 99, 46,122, 41, 42, 50, 48, 46,
+ 48, 59, 10, 9,102,108,111, 97,116, 32,119,105, 32, 61, 32, 48, 46, 53, 32, 43, 32, 48, 46, 53, 42,115,105,110, 40, 97, 41, 59,
+ 10, 10, 9,118, 97,108,117,101, 32, 61, 32,119,105, 59, 10, 9, 99,111,108,111,114, 32, 61, 32,118,101, 99, 52, 40,119,105, 44,
+ 32,119,105, 44, 32,119,105, 44, 32, 49, 46, 48, 41, 59, 10, 9,110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 48, 46,
+ 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,116,117,114,101, 95,105,109,
+ 97,103,101, 40,118,101, 99, 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,
+116, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,
+101, 50, 68, 40,105,109, 97, 44, 32, 40,118,101, 99, 46,120,121, 32, 43, 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48,
+ 41, 41, 42, 48, 46, 53, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10, 10, 9,110,111,114,109, 97,108, 46,
+120, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46,114, 32, 45, 32, 48, 46, 53, 41, 59, 10, 9,110,111,114,109, 97,108,
+ 46,121, 32, 61, 32, 50, 46, 48, 42, 40, 48, 46, 53, 32, 45, 32, 99,111,108,111,114, 46,103, 41, 59, 10, 9,110,111,114,109, 97,
+108, 46,122, 32, 61, 32, 50, 46, 48, 42, 40, 99,111,108,111,114, 46, 98, 32, 45, 32, 48, 46, 53, 41, 59, 10,125, 10, 10, 47, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 32, 77, 84, 69, 88, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 42, 42, 42, 47, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,111,114, 99,111, 40,118,101, 99, 51, 32, 97,116,116,111,114,
+ 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,114, 99,111, 41, 10,123, 10, 9,111,114, 99,111, 32, 61, 32, 97,116,116,
+111,114, 99,111, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,117,118, 40,118,101, 99, 50, 32, 97,116,116,117,
+118, 44, 32,111,117,116, 32,118,101, 99, 51, 32,117,118, 41, 10,123, 10, 9, 47, 42, 32,100,105,115, 97, 98,108,101,100, 32,102,
+111,114, 32,110,111,119, 44, 32,119,111,114,107,115, 32,116,111,103,101,116,104,101,114, 32,119,105,116,104, 32,108,101, 97,118,
+105,110,103, 32,111,117,116, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103, 10, 9, 32, 32, 32,117,118, 32, 61,
+ 32,118,101, 99, 51, 40, 97,116,116,117,118, 42, 50, 46, 48, 32, 45, 32,118,101, 99, 50, 40, 49, 46, 48, 44, 32, 49, 46, 48, 41,
+ 44, 32, 48, 46, 48, 41, 59, 32, 42, 47, 10, 9,117,118, 32, 61, 32,118,101, 99, 51, 40, 97,116,116,117,118, 44, 32, 48, 46, 48,
+ 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,110,111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,
+108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 99,111,114,
+114,101,115,112,111,110,100,115, 32,116,111, 32,115,104,105, 45, 62,111,114,110, 44, 32,119,104,105, 99,104, 32,105,115, 32,110,
+101,103, 97,116,101,100, 32,115,111, 32, 99, 97,110, 99,101,108,115, 10, 9, 32, 32, 32,111,117,116, 32, 98,108,101,110,100,101,
+114, 32,110,111,114,109, 97,108, 32,110,101,103, 97,116,105,111,110, 32, 42, 47, 10, 9,111,117,116,110,111,114,109, 97,108, 32,
+ 61, 32,110,111,114,109, 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120,
+ 99,111, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 51, 32,116, 97,110,103,101,110,116, 44, 32,111,117,116, 32,118,101, 99,
+ 51, 32,111,117,116,116, 97,110,103,101,110,116, 41, 10,123, 10, 9,111,117,116,116, 97,110,103,101,110,116, 32, 61, 32,110,111,
+114,109, 97,108,105,122,101, 40,116, 97,110,103,101,110,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,
+103,108,111, 98, 97,108, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44,
+ 32,111,117,116, 32,118,101, 99, 51, 32,103,108,111, 98, 97,108, 41, 10,123, 10, 9,103,108,111, 98, 97,108, 32, 61, 32, 40,118,
+105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 46,120,121,122, 59, 10,125, 10,
+ 10,118,111,105,100, 32,116,101,120, 99,111, 95,111, 98,106,101, 99,116, 40,109, 97,116, 52, 32,118,105,101,119,105,110,118,109,
+ 97,116, 44, 32,109, 97,116, 52, 32,111, 98,105,110,118,109, 97,116, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,
+118,101, 99, 51, 32,111, 98,106,101, 99,116, 41, 10,123, 10, 9,111, 98,106,101, 99,116, 32, 61, 32, 40,111, 98,105,110,118,109,
+ 97,116, 42, 40,118,105,101,119,105,110,118,109, 97,116, 42,118,101, 99, 52, 40, 99,111, 44, 32, 49, 46, 48, 41, 41, 41, 46,120,
+121,122, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,120, 99,111, 95,114,101,102,108, 40,118,101, 99, 51, 32,118,110, 44, 32,
+118,101, 99, 51, 32,118,105,101,119, 44, 32,111,117,116, 32,118,101, 99, 51, 32,114,101,102, 41, 10,123, 10, 9,114,101,102, 32,
+ 61, 32,118,105,101,119, 32, 45, 32, 50, 46, 48, 42,100,111,116, 40,118,110, 44, 32,118,105,101,119, 41, 42,118,110, 59, 10,125,
+ 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,110,111,114,109, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,
+117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9, 47, 42, 32, 98,108,101,110,100,101,114,
+ 32,114,101,110,100,101,114, 32,110,111,114,109, 97,108, 32,105,115, 32,110,101,103, 97,116,101,100, 32, 42, 47, 10, 9,111,117,
+116,110,111,114,109, 97,108, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,110,111,114,109, 97,108, 41, 59, 10,125, 10,
+ 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 98,108,101,110,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108,
+ 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116,
+ 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,
+102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46,
+ 48, 45,102, 97, 99,116, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,
+102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,109,117,
+108, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,
+116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,
+111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,
+103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,
+102, 97, 99,109, 32, 43, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115, 99,114,101,101,110, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44,
+ 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102,
+ 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48,
+ 45,102, 97, 99,103, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32, 40,118,101,
+ 99, 51, 40,102, 97, 99,109, 41, 32, 43, 32,102, 97, 99,116, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,116,101,120,
+ 99,111,108, 41, 41, 42, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,111,118,101,114,108, 97,121, 40,118,101, 99, 51, 32,111,117,116, 99,111,108,
+ 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116,
+ 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,
+102, 97, 99,109, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46,
+ 48, 45,102, 97, 99,103, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46,114, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,
+110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97,
+ 99,116, 42,116,101,120, 99,111,108, 46,114, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,114, 32, 61, 32,
+ 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,
+120, 99,111,108, 46,114, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46,114, 41, 59, 10, 10, 9,105,102, 40,
+111,117,116, 99,111,108, 46,103, 32, 60, 32, 48, 46, 53, 41, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32,111,117,116, 99,
+111,108, 46,103, 42, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 41, 59,
+ 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 46,103, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43,
+ 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 46,103, 41, 41, 42, 40, 49, 46, 48,
+ 32, 45, 32,111,117,116, 99,111,108, 46,103, 41, 59, 10, 10, 9,105,102, 40,111,117,116, 99,111,108, 46, 98, 32, 60, 32, 48, 46,
+ 53, 41, 10, 9, 9,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 42, 40,102, 97, 99,109, 32, 43, 32,
+ 50, 46, 48, 42,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,
+108, 46, 98, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32, 43, 32, 50, 46, 48, 42,102, 97, 99,116, 42, 40, 49, 46,
+ 48, 32, 45, 32,116,101,120, 99,111,108, 46, 98, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,116, 99,111,108, 46, 98, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115,117, 98, 40,118,101, 99, 51, 32,111,117,116, 99,111,
+108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,
+116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108,
+ 32, 61, 32, 45,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125,
+ 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95, 97,100,100, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44,
+ 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,105,110, 99,111,108, 32, 61,
+ 32,102, 97, 99,116, 42,102, 97, 99,103, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,118, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101,
+ 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,
+103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109,
+ 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97,
+ 99,116, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 46,114, 32, 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46,
+114, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,114, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46,
+114, 47,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40,116,101,120, 99,111,108, 46,103, 32, 33, 61, 32, 48, 46, 48, 41,
+ 32,105,110, 99,111,108, 46,103, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46,103, 32, 43, 32,102, 97, 99,116, 42,
+111,117,116, 99,111,108, 46,103, 47,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40,116,101,120, 99,111,108, 46, 98, 32,
+ 33, 61, 32, 48, 46, 48, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 46, 98, 32,
+ 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 46, 98, 47,116,101,120, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,105,
+100, 32,109,116,101,120, 95,114,103, 98, 95,100,105,102,102, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99,
+ 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103,
+ 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59,
+ 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97, 99,
+116, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42,
+ 97, 98,115, 40,116,101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
+101,120, 95,114,103, 98, 95,100, 97,114,107, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,
+120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,
+116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32, 99,111,108,
+ 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,102, 97,
+ 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59, 10, 9,105,102, 40, 99,
+111,108, 32, 60, 32,111,117,116, 99,111,108, 46,114, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,111,108, 59, 32,101,108,
+115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97,
+ 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46,103, 41,
+ 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,103, 32, 61, 32,111,
+117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46, 98, 59, 10, 9,
+105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98, 32, 61, 32, 99,111,108,
+ 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59, 10,125, 10, 10,118,111,
+105,100, 32,109,116,101,120, 95,114,103, 98, 95,108,105,103,104,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,
+101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97,
+ 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,
+109, 44, 32, 99,111,108, 59, 10, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32,
+ 49, 46, 48, 45,102, 97, 99,116, 59, 10, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,114, 59,
+ 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46,114, 41, 32,105,110, 99,111,108, 46,114, 32, 61, 32, 99,
+111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46,114, 32, 61, 32,111,117,116, 99,111,108, 46,114, 59, 10, 9, 99,111,
+108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 46,103, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116,
+ 99,111,108, 46,103, 41, 32,105,110, 99,111,108, 46,103, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108,
+ 46,103, 32, 61, 32,111,117,116, 99,111,108, 46,103, 59, 10, 9, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,
+108, 46, 98, 59, 10, 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 46, 98, 41, 32,105,110, 99,111,108, 46, 98,
+ 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 46, 98, 32, 61, 32,111,117,116, 99,111,108, 46, 98, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,104,117,101, 40,118,101, 99, 51, 32,111,117,116, 99,111,
+108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,
+116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32,
+ 99,111,108, 59, 10, 10, 9,109,105,120, 95,104,117,101, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,
+117,116, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32,
+ 99,111,108, 41, 59, 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,115, 97,116, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101,
+ 99, 51, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,
+103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10,
+ 10, 9,109,105,120, 95,115, 97,116, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108,
+ 44, 32, 49, 46, 48, 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59,
+ 10, 9,105,110, 99,111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,
+116,101,120, 95,114,103, 98, 95,118, 97,108, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,
+120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,
+116, 32,118,101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120,
+ 95,118, 97,108, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48,
+ 41, 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,
+111,108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,
+103, 98, 95, 99,111,108,111,114, 40,118,101, 99, 51, 32,111,117,116, 99,111,108, 44, 32,118,101, 99, 51, 32,116,101,120, 99,111,
+108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,111,117,116, 32,118,
+101, 99, 51, 32,105,110, 99,111,108, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111,108, 59, 10, 10, 9,109,105,120, 95, 99,111,
+108,111,114, 40,102, 97, 99,116, 42,102, 97, 99,103, 44, 32,118,101, 99, 52, 40,111,117,116, 99,111,108, 44, 32, 49, 46, 48, 41,
+ 44, 32,118,101, 99, 52, 40,116,101,120, 99,111,108, 44, 32, 49, 46, 48, 41, 44, 32, 99,111,108, 41, 59, 10, 9,105,110, 99,111,
+108, 46,114,103, 98, 32, 61, 32, 99,111,108, 46,114,103, 98, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,
+108,117,101, 95,118, 97,114,115, 40,105,110,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116,
+ 32,102, 97, 99,103, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,102, 97, 99,109, 44, 32,102,108,111, 97,116, 32,102,108,105,
+112, 41, 10,123, 10, 9,102, 97, 99,116, 32, 42, 61, 32,102, 97, 99,103, 59, 10, 9,102, 97, 99,109, 32, 61, 32, 49, 46, 48, 45,
+102, 97, 99,116, 59, 10, 10, 9,105,102, 40,102,108,105,112, 32, 33, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,102,108,111, 97,
+116, 32,116,109,112, 32, 61, 32,102, 97, 99,116, 59, 10, 9, 9,102, 97, 99,116, 32, 61, 32,102, 97, 99,109, 59, 10, 9, 9,102,
+ 97, 99,109, 32, 61, 32,116,109,112, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101,
+ 95, 98,108,101,110,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,
+108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,102,108,111, 97,116,
+ 32,102,108,105,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116,
+ 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97,
+ 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,105,112, 41, 59, 10, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,
+116,101,120, 99,111,108, 32, 43, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,
+101,120, 95,118, 97,108,117,101, 95,109,117,108, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116,
+ 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44,
+ 32,102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10,
+ 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97,
+ 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,105,112, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32,
+ 49, 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, 40,102, 97, 99,109, 32, 43, 32,102, 97, 99,
+116, 42,116,101,120, 99,111,108, 41, 42,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118,
+ 97,108,117,101, 95,115, 99,114,101,101,110, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,
+116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,
+102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,
+102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,
+116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,105,112, 41, 59, 10, 10, 9,102, 97, 99,109, 32, 61, 32, 49,
+ 46, 48, 32, 45, 32,102, 97, 99,103, 59, 10, 9,105,110, 99,111,108, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40,102, 97, 99,109, 32,
+ 43, 32,102, 97, 99,116, 42, 40, 49, 46, 48, 32, 45, 32,116,101,120, 99,111,108, 41, 41, 42, 40, 49, 46, 48, 32, 45, 32,111,117,
+116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,115,117, 98, 40,102,108,
+111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,
+102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,
+116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44,
+ 32,102,108,105,112, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61, 32, 45,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61,
+ 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,
+116,101,120, 95,118, 97,108,117,101, 95, 97,100,100, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,
+116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103,
+ 44, 32,102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123,
+ 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102,
+ 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,105,112, 41, 59, 10, 10, 9,102, 97, 99,116, 32, 61,
+ 32,102, 97, 99,116, 59, 10, 9,105,110, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 32, 43, 32,111,117,
+116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100,105,118, 40,102,108,111,
+ 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102,
+ 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,
+101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,
+102,108,105,112, 41, 59, 10, 10, 9,105,102, 40,116,101,120, 99,111,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9,105,110, 99,
+111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42,111,117,116, 99,111,108, 47,116,
+101,120, 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,105,110, 99,111,108, 32, 61, 32, 48, 46, 48, 59, 10,125, 10, 10,118,
+111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,100,105,102,102, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108,
+ 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,
+116, 32,102, 97, 99,103, 44, 32,102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,
+ 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,
+118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,105,112, 41, 59, 10, 10, 9,
+105,110, 99,111,108, 32, 61, 32,102, 97, 99,109, 42,111,117,116, 99,111,108, 32, 43, 32,102, 97, 99,116, 42, 97, 98,115, 40,116,
+101,120, 99,111,108, 32, 45, 32,111,117,116, 99,111,108, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,
+108,117,101, 95,100, 97,114,107, 40,102,108,111, 97,116, 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120,
+ 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,102,108,111,
+ 97,116, 32,102,108,105,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111,
+ 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120, 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,
+102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,105,112, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61,
+ 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 59, 10, 9,105,102, 40, 99,111,108, 32, 60, 32,111,117,116, 99,111,108, 41, 32,
+105,110, 99,111,108, 32, 61, 32, 99,111,108, 59, 32,101,108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108,
+ 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101, 95,108,105,103,104,116, 40,102,108,111, 97,116,
+ 32,111,117,116, 99,111,108, 44, 32,102,108,111, 97,116, 32,116,101,120, 99,111,108, 44, 32,102,108,111, 97,116, 32,102, 97, 99,
+116, 44, 32,102,108,111, 97,116, 32,102, 97, 99,103, 44, 32,102,108,111, 97,116, 32,102,108,105,112, 44, 32,111,117,116, 32,102,
+108,111, 97,116, 32,105,110, 99,111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,109, 59, 10, 9,109,116,101,120,
+ 95,118, 97,108,117,101, 95,118, 97,114,115, 40,102, 97, 99,116, 44, 32,102, 97, 99,103, 44, 32,102, 97, 99,109, 44, 32,102,108,
+105,112, 41, 59, 10, 10, 9,102,108,111, 97,116, 32, 99,111,108, 32, 61, 32,102, 97, 99,116, 42,116,101,120, 99,111,108, 59, 10,
+ 9,105,102, 40, 99,111,108, 32, 62, 32,111,117,116, 99,111,108, 41, 32,105,110, 99,111,108, 32, 61, 32, 99,111,108, 59, 32,101,
+108,115,101, 32,105,110, 99,111,108, 32, 61, 32,111,117,116, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120,
+ 95,118, 97,108,117,101, 95, 99,108, 97,109,112, 95,112,111,115,105,116,105,118,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44,
+ 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102, 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32, 61, 32,109,
+ 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101,
+ 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,102,
+ 97, 99, 41, 10,123, 10, 9,111,117,116,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40,102, 97, 99, 44, 32, 48, 46, 48, 44, 32,
+ 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,104, 97,114, 95,100,105,118,105,100,101, 40,102,108,
+111, 97,116, 32,104, 97,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10, 9,111,117,
+116,104, 97,114, 32, 61, 32,104, 97,114, 47, 49, 50, 56, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,104,
+ 97,114, 95,109,117,108,116,105,112,108,121, 95, 99,108, 97,109,112, 40,102,108,111, 97,116, 32,104, 97,114, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,111,117,116,104, 97,114, 41, 10,123, 10, 9,104, 97,114, 32, 42, 61, 32, 49, 50, 56, 46, 48, 59, 10,
+ 10, 9,105,102, 40,104, 97,114, 32, 60, 32, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,
+108,115,101, 32,105,102, 40,104, 97,114, 32, 62, 32, 53, 49, 49, 46, 48, 41, 32,111,117,116,104, 97,114, 32, 61, 32, 53, 49, 49,
+ 46, 48, 59, 10, 9,101,108,115,101, 32,111,117,116,104, 97,114, 32, 61, 32,104, 97,114, 59, 10,125, 10, 10,118,111,105,100, 32,
+109,116,101,120, 95, 97,108,112,104, 97, 95,102,114,111,109, 95, 99,111,108, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,
+116, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 41, 10,123, 10, 9, 97,108,112,104, 97, 32, 61, 32, 99,111,108, 46, 97, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 97,108,112,104, 97, 95,116,111, 95, 99,111,108, 40,118,101, 99, 52, 32,
+ 99,111,108, 44, 32,102,108,111, 97,116, 32, 97,108,112,104, 97, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
+108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 44, 32, 97,108,112,
+104, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98,116,111,105,110,116, 40,118,101, 99, 52, 32,
+114,103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,116,101,110,115,105,116,121, 41, 10,123, 10, 9,105,110,116,
+101,110,115,105,116,121, 32, 61, 32,100,111,116, 40,118,101, 99, 51, 40, 48, 46, 51, 53, 44, 32, 48, 46, 52, 53, 44, 32, 48, 46,
+ 50, 41, 44, 32,114,103, 98, 46,114,103, 98, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,101,
+ 95,105,110,118,101,114,116, 40,102,108,111, 97,116, 32,105,110,118, 97,108,117,101, 44, 32,111,117,116, 32,102,108,111, 97,116,
+ 32,111,117,116,118, 97,108,117,101, 41, 10,123, 10, 9,111,117,116,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 32, 45, 32,105,
+110,118, 97,108,117,101, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,103, 98, 95,105,110,118,101,114,116, 40,
+118,101, 99, 52, 32,105,110,114,103, 98, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,
+111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,118,101, 99, 51, 40, 49, 46, 48, 41, 32, 45, 32,105,110,114,103, 98, 46,
+114,103, 98, 44, 32,105,110,114,103, 98, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,118, 97,108,117,
+101, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, 44, 32,102,108,111, 97,116, 32,105,
+110,116,101,110,115,105,116,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,108, 44, 32,
+111,117,116, 32,102,108,111, 97,116, 32,111,117,116,105,110,116,101,110,115,105,116,121, 41, 10,123, 10, 9,102,108,111, 97,116,
+ 32,102, 97, 99,116, 32, 61, 32,105,110,116,101,110,115,105,116,121, 59, 10, 9,111,117,116,105,110,116,101,110,115,105,116,121,
+ 32, 61, 32,105,110,116,101,110,115,105,116,121, 42,115,116,101,110, 99,105,108, 59, 10, 9,111,117,116,115,116,101,110, 99,105,
+108, 32, 61, 32,115,116,101,110, 99,105,108, 42,102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,114,
+103, 98, 95,115,116,101,110, 99,105,108, 40,102,108,111, 97,116, 32,115,116,101,110, 99,105,108, 44, 32,118,101, 99, 52, 32,114,
+103, 98, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,116,101,110, 99,105,108, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116,114,103, 98, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99,116, 32, 61, 32,114,103, 98, 46, 97,
+ 59, 10, 9,111,117,116,114,103, 98, 32, 61, 32,118,101, 99, 52, 40,114,103, 98, 46,114,103, 98, 44, 32,114,103, 98, 46, 97, 42,
+115,116,101,110, 99,105,108, 41, 59, 10, 9,111,117,116,115,116,101,110, 99,105,108, 32, 61, 32,115,116,101,110, 99,105,108, 42,
+102, 97, 99,116, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95,111,102,115, 40,118,
+101, 99, 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,111,102,115, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,
+116,116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,116,101,120, 99,111, 32, 43, 32,111,102,
+115, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,109, 97,112,112,105,110,103, 95,115,105,122,101, 40,118,101, 99,
+ 51, 32,116,101,120, 99,111, 44, 32,118,101, 99, 51, 32,115,105,122,101, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,
+116,101,120, 99,111, 41, 10,123, 10, 9,111,117,116,116,101,120, 99,111, 32, 61, 32,115,105,122,101, 42,116,101,120, 99,111, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 50,100, 95,109, 97,112,112,105,110,103, 40,118,101, 99, 51, 32,118,101,
+ 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,118,101, 99, 41, 10,123, 10, 9,111,117,116,118,101, 99, 32, 61, 32,
+118,101, 99, 51, 40,118,101, 99, 46,120,121, 42, 48, 46, 53, 32, 43, 32,118,101, 99, 50, 40, 48, 46, 53, 44, 32, 48, 46, 53, 41,
+ 44, 32,118,101, 99, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,105,109, 97,103,101, 40,118,101, 99,
+ 51, 32,118,101, 99, 44, 32,115, 97,109,112,108,101,114, 50, 68, 32,105,109, 97, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
+118, 97,108,117,101, 44, 32,111,117,116, 32,118,101, 99, 52, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,118,101, 99, 51, 32,
+110,111,114,109, 97,108, 41, 10,123, 10, 9, 99,111,108,111,114, 32, 61, 32,116,101,120,116,117,114,101, 50, 68, 40,105,109, 97,
+ 44, 32,118,101, 99, 46,120,121, 41, 59, 10, 9,118, 97,108,117,101, 32, 61, 32, 49, 46, 48, 59, 10, 9, 10, 9,110,111,114,109,
+ 97,108, 32, 61, 32, 50, 46, 48, 42, 40,118,101, 99, 51, 40, 99,111,108,111,114, 46,114, 44, 32, 45, 99,111,108,111,114, 46,103,
+ 44, 32, 99,111,108,111,114, 46, 98, 41, 32, 45, 32,118,101, 99, 51, 40, 48, 46, 53, 44, 32, 45, 48, 46, 53, 44, 32, 48, 46, 53,
+ 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95,110,101,103, 97,116,101, 95,116,101,120,110,111,114,109, 97,
+108, 40,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,
+108, 41, 10,123, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,118,101, 99, 51, 40, 45,110,111,114,109, 97,108, 46,120,
+ 44, 32, 45,110,111,114,109, 97,108, 46,121, 44, 32,110,111,114,109, 97,108, 46,122, 41, 59, 10,125, 10, 10,118,111,105,100, 32,
+109,116,101,120, 95,110,115,112, 97, 99,101, 95,116, 97,110,103,101,110,116, 40,118,101, 99, 51, 32,116, 97,110,103,101,110,116,
+ 44, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,116,101,120,110,111,114,109, 97,108, 44, 32,111,
+117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,116, 97,110,103,101,110,116, 32, 61, 32,
+110,111,114,109, 97,108,105,122,101, 40,116, 97,110,103,101,110,116, 41, 59, 10, 9,118,101, 99, 51, 32, 66, 32, 61, 32, 99,114,
+111,115,115, 40,110,111,114,109, 97,108, 44, 32,116, 97,110,103,101,110,116, 41, 59, 10, 10, 9,111,117,116,110,111,114,109, 97,
+108, 32, 61, 32,116,101,120,110,111,114,109, 97,108, 46,120, 42,116, 97,110,103,101,110,116, 32, 43, 32,116,101,120,110,111,114,
+109, 97,108, 46,121, 42, 66, 32, 43, 32,116,101,120,110,111,114,109, 97,108, 46,122, 42,110,111,114,109, 97,108, 59, 10, 9,111,
+117,116,110,111,114,109, 97,108, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41, 59,
+ 10,125, 10, 10,118,111,105,100, 32,109,116,101,120, 95, 98,108,101,110,100, 95,110,111,114,109, 97,108, 40,102,108,111, 97,116,
+ 32,110,111,114,102, 97, 99, 44, 32,118,101, 99, 51, 32,110,111,114,109, 97,108, 44, 32,118,101, 99, 51, 32,110,101,119,110,111,
+114,109, 97,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116,110,111,114,109, 97,108, 41, 10,123, 10, 9,111,117,116,
+110,111,114,109, 97,108, 32, 61, 32, 40, 49, 46, 48, 32, 45, 32,110,111,114,102, 97, 99, 41, 42,110,111,114,109, 97,108, 32, 43,
+ 32,110,111,114,102, 97, 99, 42,110,101,119,110,111,114,109, 97,108, 59, 10, 9,111,117,116,110,111,114,109, 97,108, 32, 61, 32,
+110,111,114,109, 97,108,105,122,101, 40,111,117,116,110,111,114,109, 97,108, 41, 59, 10,125, 10, 10, 47, 42, 42, 42, 42, 42, 42,
+ 42, 32, 77, 65, 84, 69, 82, 73, 65, 76, 32, 42, 42, 42, 42, 42, 42, 42, 42, 42, 47, 10, 10,118,111,105,100, 32,108, 97,109,112,
+ 95,118,105,115,105, 98,105,108,105,116,121, 95,115,117,110, 95,104,101,109,105, 40,118,101, 99, 51, 32,108, 97,109,112,118,101,
+ 99, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,
+111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32,108, 97,109,112,118,
+101, 99, 59, 10, 9,100,105,115,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59,
+ 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,111,116,104,101,114, 40,118,
+101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,108,118,
+ 44, 32,111,117,116, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,
+102, 97, 99, 41, 10,123, 10, 9,108,118, 32, 61, 32, 99,111, 32, 45, 32,108, 97,109,112, 99,111, 59, 10, 9,100,105,115,116, 32,
+ 61, 32,108,101,110,103,116,104, 40,108,118, 41, 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118,
+ 41, 59, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,
+102, 97,108,108,111,102,102, 95,105,110,118,108,105,110,101, 97,114, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116,
+ 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41,
+ 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116,
+ 32, 43, 32,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,105,
+110,118,115,113,117, 97,114,101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,
+105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102,
+ 97, 99, 32, 61, 32,108, 97,109,112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,100,105,115,116, 42,100,
+105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102, 97,108,108,111,102,102, 95,115,108,105,100,101,
+114,115, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,108,100, 49, 44, 32,102,108,
+111, 97,116, 32,108,100, 50, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,118,
+105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116,107,119, 32, 61, 32,108, 97,
+109,112,100,105,115,116, 42,108, 97,109,112,100,105,115,116, 59, 10, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,108, 97,109,
+112,100,105,115,116, 47, 40,108, 97,109,112,100,105,115,116, 32, 43, 32,108,100, 49, 42,100,105,115,116, 41, 59, 10, 9,118,105,
+115,105,102, 97, 99, 32, 42, 61, 32,108, 97,109,112,100,105,115,116,107,119, 47, 40,108, 97,109,112,100,105,115,116,107,119, 32,
+ 43, 32,108,100, 50, 42,100,105,115,116, 42,100,105,115,116, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,102,
+ 97,108,108,111,102,102, 95, 99,117,114,118,101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,115, 97,109,
+112,108,101,114, 49, 68, 32, 99,117,114,118,101,109, 97,112, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,118,105,115,105,102, 97, 99, 32, 61, 32,116,101,120,
+116,117,114,101, 49, 68, 40, 99,117,114,118,101,109, 97,112, 44, 32,100,105,115,116, 47,108, 97,109,112,100,105,115,116, 41, 46,
+120, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,104,101,114,
+101, 40,102,108,111, 97,116, 32,108, 97,109,112,100,105,115,116, 44, 32,102,108,111, 97,116, 32,100,105,115,116, 44, 32,102,108,
+111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97,
+ 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 61, 32,108, 97,109,112,100,105,115,116, 32, 45, 32,100,105,115,116, 59, 10,
+ 10, 9,111,117,116,118,105,115,105,102, 97, 99, 61, 32,118,105,115,105,102, 97, 99, 42,109, 97,120, 40,116, 44, 32, 48, 46, 48,
+ 41, 47,108, 97,109,112,100,105,115,116, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,
+105,116,121, 95,115,112,111,116, 95,115,113,117, 97,114,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,109, 97,
+116, 52, 32,108, 97,109,112,105,109, 97,116, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
+105,110,112,114, 41, 10,123, 10, 9,105,102, 40,100,111,116, 40,108,118, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 62, 32, 48,
+ 46, 48, 41, 32,123, 10, 9, 9,118,101, 99, 51, 32,108,118,114,111,116, 32, 61, 32, 40,108, 97,109,112,105,109, 97,116, 42,118,
+101, 99, 52, 40,108,118, 44, 32, 48, 46, 48, 41, 41, 46,120,121,122, 59, 10, 9, 9,102,108,111, 97,116, 32,120, 32, 61, 32,109,
+ 97,120, 40, 97, 98,115, 40,108,118,114,111,116, 46,120, 47,108,118,114,111,116, 46,122, 41, 44, 32, 97, 98,115, 40,108,118,114,
+111,116, 46,121, 47,108,118,114,111,116, 46,122, 41, 41, 59, 10, 10, 9, 9,105,110,112,114, 32, 61, 32, 49, 46, 48, 47,115,113,
+114,116, 40, 49, 46, 48, 32, 43, 32,120, 42,120, 41, 59, 10, 9,125, 10, 9,101,108,115,101, 10, 9, 9,105,110,112,114, 32, 61,
+ 32, 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95,115,112,
+111,116, 95, 99,105,114, 99,108,101, 40,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,108,118, 44,
+ 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112,114, 41, 10,123, 10, 9,105,110,112,114, 32, 61, 32,100,111,116, 40,108,
+118, 44, 32,108, 97,109,112,118,101, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,
+108,105,116,121, 95,115,112,111,116, 40,102,108,111, 97,116, 32,115,112,111,116,115,105, 44, 32,102,108,111, 97,116, 32,115,112,
+111,116, 98,108, 44, 32,102,108,111, 97,116, 32,105,110,112,114, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44,
+ 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,
+116, 32, 61, 32,115,112,111,116,115,105, 59, 10, 10, 9,105,102, 40,105,110,112,114, 32, 60, 61, 32,116, 41, 32,123, 10, 9, 9,
+111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116,
+ 32, 61, 32,105,110,112,114, 32, 45, 32,116, 59, 10, 10, 9, 9, 47, 42, 32,115,111,102,116, 32, 97,114,101, 97, 32, 42, 47, 10,
+ 9, 9,105,102, 40,115,112,111,116, 98,108, 32, 33, 61, 32, 48, 46, 48, 41, 10, 9, 9, 9,105,110,112,114, 32, 42, 61, 32,115,
+109,111,111,116,104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49, 46, 48, 44, 32,116, 47,115,112,111,116, 98,108, 41, 59, 10, 10,
+ 9, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32,118,105,115,105,102, 97, 99, 42,105,110,112,114, 59, 10, 9,125, 10,
+125, 10, 10,118,111,105,100, 32,108, 97,109,112, 95,118,105,115,105, 98,105,108,105,116,121, 95, 99,108, 97,109,112, 40,102,108,
+111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118,105,115,105,102, 97,
+ 99, 41, 10,123, 10, 9,111,117,116,118,105,115,105,102, 97, 99, 32, 61, 32, 40,118,105,115,105,102, 97, 99, 32, 60, 32, 48, 46,
+ 48, 48, 49, 41, 63, 32, 48, 46, 48, 58, 32,118,105,115,105,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,
+101, 95,118,105,101,119, 40,118,101, 99, 51, 32, 99,111, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,105,101,119, 41, 10,123,
+ 10, 9, 47, 42, 32,104, 97,110,100,108,101, 32,112,101,114,115,112,101, 99,116,105,118,101, 47,111,114,116,104,111,103,114, 97,
+112,104,105, 99, 32, 42, 47, 10, 9,118,105,101,119, 32, 61, 32, 40,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,
+116,114,105,120, 91, 51, 93, 91, 51, 93, 32, 61, 61, 32, 48, 46, 48, 41, 63, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111,
+ 41, 58, 32,118,101, 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 45, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100,
+ 32,115,104, 97,100,101, 95,116, 97,110,103,101,110,116, 95,118, 40,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99, 51, 32,116,
+ 97,110,103, 44, 32,111,117,116, 32,118,101, 99, 51, 32,118,110, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99, 32, 61, 32, 99,114,
+111,115,115, 40,108,118, 44, 32,116, 97,110,103, 41, 59, 10, 9,118,101, 99, 51, 32,118,110,111,114, 32, 61, 32, 99,114,111,115,
+115, 40, 99, 44, 32,116, 97,110,103, 41, 59, 10, 10, 9,118,110, 32, 61, 32, 45,110,111,114,109, 97,108,105,122,101, 40,118,110,
+111,114, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,110,112, 40,118,101, 99, 51, 32,118,110, 44, 32,
+118,101, 99, 51, 32,108,118, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,105,110,112, 32, 61,
+ 32,100,111,116, 40,118,110, 44, 32,108,118, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,110,
+111, 95,100,105,102,102,117,115,101, 40,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32,
+ 48, 46, 48, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,105,115, 95,104,101,109,105, 40,102,108,111, 97,116,
+ 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32, 48, 46, 53, 42,
+105,110,112, 32, 43, 32, 48, 46, 53, 59, 10,125, 10, 10,102,108,111, 97,116, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,
+101,114,103,121, 40,109, 97,116, 52, 32, 97,114,101, 97, 44, 32,118,101, 99, 51, 32, 99,111, 44, 32,118,101, 99, 51, 32,118,110,
+ 41, 10,123, 10, 9,118,101, 99, 51, 32,118,101, 99, 91, 52, 93, 44, 32, 99, 91, 52, 93, 59, 10, 9,102,108,111, 97,116, 32,114,
+ 97,100, 91, 52, 93, 44, 32,102, 97, 99, 59, 10, 9, 10, 9,118,101, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,
+101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 48, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99, 91, 49, 93, 32, 61, 32,110,
+111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 49, 93, 46,120,121,122, 41, 59, 10, 9,118,101, 99,
+ 91, 50, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97, 91, 50, 93, 46,120,121,122,
+ 41, 59, 10, 9,118,101, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,111, 32, 45, 32, 97,114,101, 97,
+ 91, 51, 93, 46,120,121,122, 41, 59, 10, 10, 9, 99, 91, 48, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,
+115,115, 40,118,101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9, 99, 91, 49, 93, 32, 61, 32,110,111,114,
+109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9,
+ 99, 91, 50, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115, 40,118,101, 99, 91, 50, 93, 44, 32,118,
+101, 99, 91, 51, 93, 41, 41, 59, 10, 9, 99, 91, 51, 93, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40, 99,114,111,115,115,
+ 40,118,101, 99, 91, 51, 93, 44, 32,118,101, 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,114, 97,100, 91, 48, 93, 32, 61, 32, 97, 99,
+111,115, 40,100,111,116, 40,118,101, 99, 91, 48, 93, 44, 32,118,101, 99, 91, 49, 93, 41, 41, 59, 10, 9,114, 97,100, 91, 49, 93,
+ 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 49, 93, 44, 32,118,101, 99, 91, 50, 93, 41, 41, 59, 10, 9,114,
+ 97,100, 91, 50, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 50, 93, 44, 32,118,101, 99, 91, 51, 93, 41,
+ 41, 59, 10, 9,114, 97,100, 91, 51, 93, 32, 61, 32, 97, 99,111,115, 40,100,111,116, 40,118,101, 99, 91, 51, 93, 44, 32,118,101,
+ 99, 91, 48, 93, 41, 41, 59, 10, 10, 9,102, 97, 99, 61, 32, 32,114, 97,100, 91, 48, 93, 42,100,111,116, 40,118,110, 44, 32, 99,
+ 91, 48, 93, 41, 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 49, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 49, 93,
+ 41, 59, 10, 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 50, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 50, 93, 41, 59, 10,
+ 9,102, 97, 99, 43, 61, 32,114, 97,100, 91, 51, 93, 42,100,111,116, 40,118,110, 44, 32, 99, 91, 51, 93, 41, 59, 10, 10, 9,114,
+101,116,117,114,110, 32,109, 97,120, 40,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95,105,110,112, 95, 97,114,101, 97, 40,118,101, 99, 51, 32,112,111,115,105,116,105,111,110, 44, 32,118,101, 99, 51, 32,
+108, 97,109,112, 99,111, 44, 32,118,101, 99, 51, 32,108, 97,109,112,118,101, 99, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,109,
+ 97,116, 52, 32, 97,114,101, 97, 44, 32,102,108,111, 97,116, 32, 97,114,101, 97,115,105,122,101, 44, 32,102,108,111, 97,116, 32,
+107, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,110,112, 41, 10,123, 10, 9,118,101, 99, 51, 32, 99,111, 32, 61, 32,112,
+111,115,105,116,105,111,110, 59, 10, 9,118,101, 99, 51, 32,118,101, 99, 32, 61, 32, 99,111, 32, 45, 32,108, 97,109,112, 99,111,
+ 59, 10, 10, 9,105,102, 40,100,111,116, 40,118,101, 99, 44, 32,108, 97,109,112,118,101, 99, 41, 32, 60, 32, 48, 46, 48, 41, 32,
+123, 10, 9, 9,105,110,112, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,
+116, 32,105,110,116,101,110,115, 32, 61, 32, 97,114,101, 97, 95,108, 97,109,112, 95,101,110,101,114,103,121, 40, 97,114,101, 97,
+ 44, 32, 99,111, 44, 32,118,110, 41, 59, 10, 10, 9, 9,105,110,112, 32, 61, 32,112,111,119, 40,105,110,116,101,110,115, 42, 97,
+114,101, 97,115,105,122,101, 44, 32,107, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,
+102,102,117,115,101, 95,111,114,101,110, 95,110, 97,121,101,114, 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,
+110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,111,117,103,104, 44, 32,
+111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,
+105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,
+110, 44, 32,104, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116,
+ 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9,102,108,111, 97,116, 32,114,101, 97,108,110,108, 32, 61, 32,100,111,
+116, 40,110, 44, 32,108, 41, 59, 10, 10, 9,105,102, 40,114,101, 97,108,110,108, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,
+105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,102, 40,110,108, 32, 60, 32, 48, 46, 48, 41, 32,
+123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116,
+ 32,118,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111,
+ 97,116, 32, 76,105,116, 95, 65, 32, 61, 32, 97, 99,111,115, 40,114,101, 97,108,110,108, 41, 59, 10, 9, 9,102,108,111, 97,116,
+ 32, 86,105,101,119, 95, 65, 32, 61, 32, 97, 99,111,115, 40,110,118, 41, 59, 10, 10, 9, 9,118,101, 99, 51, 32, 76,105,116, 95,
+ 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 45, 32,114,101, 97,108,110,108, 42,110, 41, 59, 10, 9, 9,118,
+101, 99, 51, 32, 86,105,101,119, 95, 66, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 45, 32,110,118, 42,110, 41,
+ 59, 10, 10, 9, 9,102,108,111, 97,116, 32,116, 32, 61, 32,109, 97,120, 40,100,111,116, 40, 76,105,116, 95, 66, 44, 32, 86,105,
+101,119, 95, 66, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9, 9,102,108,111, 97,116, 32, 97, 44, 32, 98, 59, 10, 10, 9, 9,105,
+102, 40, 76,105,116, 95, 65, 32, 62, 32, 86,105,101,119, 95, 65, 41, 32,123, 10, 9, 9, 9, 97, 32, 61, 32, 76,105,116, 95, 65,
+ 59, 10, 9, 9, 9, 98, 32, 61, 32, 86,105,101,119, 95, 65, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9,
+ 9, 97, 32, 61, 32, 86,105,101,119, 95, 65, 59, 10, 9, 9, 9, 98, 32, 61, 32, 76,105,116, 95, 65, 59, 10, 9, 9,125, 10, 10,
+ 9, 9,102,108,111, 97,116, 32, 65, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 48, 46, 53, 42, 40, 40,114,111,117,103,104, 42,114,
+111,117,103,104, 41, 47, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 51, 51, 41, 41, 41, 59, 10,
+ 9, 9,102,108,111, 97,116, 32, 66, 32, 61, 32, 48, 46, 52, 53, 42, 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 47,
+ 40, 40,114,111,117,103,104, 42,114,111,117,103,104, 41, 32, 43, 32, 48, 46, 48, 57, 41, 41, 59, 10, 10, 9, 9, 98, 32, 42, 61,
+ 32, 48, 46, 57, 53, 59, 10, 9, 9,105,115, 32, 61, 32,110,108, 42, 40, 65, 32, 43, 32, 40, 66, 32, 42, 32,116, 32, 42, 32,115,
+105,110, 40, 97, 41, 32, 42, 32,116, 97,110, 40, 98, 41, 41, 41, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95,100,105,102,102,117,115,101, 95,116,111,111,110, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,
+118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,
+104, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61,
+ 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,
+108,116, 41, 59, 10, 10, 9,105,102, 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,105,115, 32, 61, 32, 49, 46, 48, 59, 10,
+ 9,101,108,115,101, 32,105,102, 40, 97,110,103, 32, 62, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,
+124,124, 32,116,115,109,111,111,116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,
+115,101, 32,105,115, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,
+111,116,104, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,100,105,102,102,117,115,101, 95,109,105,110,110,
+ 97,101,114,116, 40,102,108,111, 97,116, 32,110,108, 44, 32,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,
+108,111, 97,116, 32,100, 97,114,107,110,101,115,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,
+105,102, 40,110,108, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,105,115, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,
+101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118,
+ 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9, 9,105,102, 40,100, 97,114,107,110,101,115,115, 32, 60, 61, 32, 49, 46, 48, 41, 10,
+ 9, 9, 9,105,115, 32, 61, 32,110,108, 42,112,111,119, 40,109, 97,120, 40,110,118, 42,110,108, 44, 32, 48, 46, 49, 41, 44, 32,
+100, 97,114,107,110,101,115,115, 32, 45, 32, 49, 46, 48, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,105,115, 32, 61, 32,
+110,108, 42,112,111,119, 40, 49, 46, 48, 48, 48, 49, 32, 45, 32,110,118, 44, 32,100, 97,114,107,110,101,115,115, 32, 45, 32, 49,
+ 46, 48, 41, 59, 10, 9,125, 10,125, 10, 10,102,108,111, 97,116, 32,102,114,101,115,110,101,108, 95,102, 97, 99, 40,118,101, 99,
+ 51, 32,118,105,101,119, 44, 32,118,101, 99, 51, 32,118,110, 44, 32,102,108,111, 97,116, 32,103,114, 97,100, 44, 32,102,108,111,
+ 97,116, 32,102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,116, 49, 44, 32,116, 50, 59, 10, 9,102,108,111, 97,116, 32,
+102,102, 97, 99, 59, 10, 10, 9,105,102, 40,102, 97, 99, 61, 61, 48, 46, 48, 41, 32,123, 10, 9, 9,102,102, 97, 99, 32, 61, 32,
+ 49, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,116, 49, 61, 32,100,111,116, 40,118,105,101,119, 44, 32,
+118,110, 41, 59, 10, 9, 9,105,102, 40,116, 49, 62, 48, 46, 48, 41, 32, 32,116, 50, 61, 32, 49, 46, 48, 43,116, 49, 59, 10, 9,
+ 9,101,108,115,101, 32,116, 50, 61, 32, 49, 46, 48, 45,116, 49, 59, 10, 10, 9, 9,116, 50, 61, 32,103,114, 97,100, 32, 43, 32,
+ 40, 49, 46, 48, 45,103,114, 97,100, 41, 42,112,111,119, 40,116, 50, 44, 32,102, 97, 99, 41, 59, 10, 10, 9, 9,105,102, 40,116,
+ 50, 60, 48, 46, 48, 41, 32,102,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,105,102, 40,116, 50, 62,
+ 49, 46, 48, 41, 32,102,102, 97, 99, 32, 61, 32, 49, 46, 48, 59, 10, 9, 9,101,108,115,101, 32,102,102, 97, 99, 32, 61, 32,116,
+ 50, 59, 10, 9,125, 10, 10, 9,114,101,116,117,114,110, 32,102,102, 97, 99, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95,100,105,102,102,117,115,101, 95,102,114,101,115,110,101,108, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51,
+ 32,108,118, 44, 32,118,101, 99, 51, 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,102, 97, 99, 95,105, 44, 32,102,108,111,
+ 97,116, 32,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,105,115, 41, 10,123, 10, 9,105,115, 32, 61, 32,102,114,
+101,115,110,101,108, 95,102, 97, 99, 40,108,118, 44, 32,118,110, 44, 32,102, 97, 99, 95,105, 44, 32,102, 97, 99, 41, 59, 10,125,
+ 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 99,117, 98,105, 99, 40,102,108,111, 97,116, 32,105,115, 44, 32,111,117,116,
+ 32,102,108,111, 97,116, 32,111,117,116,105,115, 41, 10,123, 10, 9,105,102, 40,105,115, 62, 48, 46, 48, 32, 38, 38, 32,105,115,
+ 60, 49, 46, 48, 41, 10, 9, 9,111,117,116,105,115, 61, 32,115,109,111,111,116,104,115,116,101,112, 40, 48, 46, 48, 44, 32, 49,
+ 46, 48, 44, 32,105,115, 41, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116,105,115, 61, 32,105,115, 59, 10,125, 10, 10,118,
+111,105,100, 32,115,104, 97,100,101, 95,118,105,115,105,102, 97, 99, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116,
+ 32,118,105,115,105,102, 97, 99, 44, 32,102,108,111, 97,116, 32,114,101,102,108, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,
+111,117,116,105, 41, 10,123, 10, 9, 47, 42,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 42, 47, 10, 9, 9,111,117,116,105, 32,
+ 61, 32,109, 97,120, 40,105, 42,118,105,115,105,102, 97, 99, 42,114,101,102,108, 44, 32, 48, 46, 48, 41, 59, 10, 9, 47, 42,101,
+108,115,101, 10, 9, 9,111,117,116,105, 32, 61, 32,105, 59, 42, 47, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,
+116, 97,110,103,101,110,116, 95,118, 95,115,112,101, 99, 40,118,101, 99, 51, 32,116, 97,110,103, 44, 32,111,117,116, 32,118,101,
+ 99, 51, 32,118,110, 41, 10,123, 10, 9,118,110, 32, 61, 32,116, 97,110,103, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95, 97,100,100, 95,116,111, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,105, 44, 32,118,101, 99, 51, 32,
+108, 97,109,112, 99,111,108, 44, 32,118,101, 99, 51, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 51, 32,111,117,116, 99,
+111,108, 41, 10,123, 10, 9,105,102, 40,105, 32, 62, 32, 48, 46, 48, 41, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,105, 42,
+108, 97,109,112, 99,111,108, 42, 99,111,108, 59, 10, 9,101,108,115,101, 10, 9, 9,111,117,116, 99,111,108, 32, 61, 32,118,101,
+ 99, 51, 40, 48, 46, 48, 44, 32, 48, 46, 48, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101,
+ 95,104,101,109,105, 95,115,112,101, 99, 40,118,101, 99, 51, 32,118,110, 44, 32,118,101, 99, 51, 32,108,118, 44, 32,118,101, 99,
+ 51, 32,118,105,101,119, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,
+102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,108,
+118, 32, 43, 61, 32,118,105,101,119, 59, 10, 9,108,118, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108,118, 41, 59, 10,
+ 10, 9,116, 32, 61, 32,100,111,116, 40,118,110, 44, 32,108,118, 41, 59, 10, 9,116, 32, 61, 32, 48, 46, 53, 42,116, 32, 43, 32,
+ 48, 46, 53, 59, 10, 10, 9,116, 32, 61, 32,118,105,115,105,102, 97, 99, 42,115,112,101, 99, 42,112,111,119, 40,116, 44, 32,104,
+ 97,114,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,112,104,111,110,103, 95,115,112,101, 99, 40,118,
+101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,
+100, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32,
+ 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32,
+ 61, 32,109, 97,120, 40,100,111,116, 40,104, 44, 32,110, 41, 44, 32, 48, 46, 48, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99,
+ 32, 61, 32,112,111,119, 40,114,115,108,116, 44, 32,104, 97,114,100, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,
+101, 95, 99,111,111,107,116,111,114,114, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,
+118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,116, 32,104, 97,114,100, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,
+101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43,
+ 32,108, 41, 59, 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,100,111,116, 40,110, 44, 32,104, 41, 59, 10, 10, 9,105,102,
+ 40,110,104, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125,
+ 10, 9,101,108,115,101, 32,123, 10, 9, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44,
+ 32,118, 41, 44, 32, 48, 46, 48, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,105, 32, 61, 32,112,111,119, 40,110,104, 44, 32,104,
+ 97,114,100, 41, 59, 10, 10, 9, 9,105, 32, 61, 32,105, 47, 40, 48, 46, 49, 43,110,118, 41, 59, 10, 9, 9,115,112,101, 99,102,
+ 97, 99, 32, 61, 32,105, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 98,108,105,110,110, 95,115,
+112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,102,108,111, 97,
+116, 32,114,101,102,114, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 95,112,111,119,101,114, 44, 32,111,117,116, 32,
+102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,105,102, 40,114,101,102,114, 97, 99, 32, 60, 32, 49, 46,
+ 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,105,
+102, 40,115,112,101, 99, 95,112,111,119,101,114, 32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,115,112,101, 99,102, 97, 99,
+ 32, 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,105,102, 40,115,112,101, 99, 95,112,111,119,
+101,114, 60, 49, 48, 48, 46, 48, 41, 10, 9, 9, 9,115,112,101, 99, 95,112,111,119,101,114, 61, 32,115,113,114,116, 40, 49, 46,
+ 48, 47,115,112,101, 99, 95,112,111,119,101,114, 41, 59, 10, 9, 9,101,108,115,101, 10, 9, 9, 9,115,112,101, 99, 95,112,111,
+119,101,114, 61, 32, 49, 48, 46, 48, 47,115,112,101, 99, 95,112,111,119,101,114, 59, 10, 10, 9, 9,118,101, 99, 51, 32,104, 32,
+ 61, 32,110,111,114,109, 97,108,105,122,101, 40,118, 32, 43, 32,108, 41, 59, 10, 9, 9,102,108,111, 97,116, 32,110,104, 32, 61,
+ 32,100,111,116, 40,110, 44, 32,104, 41, 59, 10, 9, 9,105,102, 40,110,104, 32, 60, 32, 48, 46, 48, 41, 32,123, 10, 9, 9, 9,
+115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10, 9, 9,125, 10, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9,102,
+108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10,
+ 9, 9, 9,102,108,111, 97,116, 32,110,108, 32, 61, 32,100,111,116, 40,110, 44, 32,108, 41, 59, 10, 9, 9, 9,105,102, 40,110,
+108, 32, 60, 61, 32, 48, 46, 48, 49, 41, 32,123, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61, 32, 48, 46, 48, 59, 10,
+ 9, 9, 9,125, 10, 9, 9, 9,101,108,115,101, 32,123, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,118,104, 32, 61, 32,109, 97,
+120, 40,100,111,116, 40,118, 44, 32,104, 41, 44, 32, 48, 46, 48, 49, 41, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 97,
+ 32, 61, 32, 49, 46, 48, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 98, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,118,
+ 41, 47,118,104, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32, 99, 32, 61, 32, 40, 50, 46, 48, 42,110,104, 42,110,108, 41, 47,
+118,104, 59, 10, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,103, 32, 61, 32, 48, 46, 48, 59, 10, 10, 9, 9, 9, 9,105,102, 40,
+ 97, 32, 60, 32, 98, 32, 38, 38, 32, 97, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 97, 59, 10, 9, 9, 9, 9,101,108,115,101, 32,
+105,102, 40, 98, 32, 60, 32, 97, 32, 38, 38, 32, 98, 32, 60, 32, 99, 41, 32,103, 32, 61, 32, 98, 59, 10, 9, 9, 9, 9,101,108,
+115,101, 32,105,102, 40, 99, 32, 60, 32, 97, 32, 38, 38, 32, 99, 32, 60, 32, 98, 41, 32,103, 32, 61, 32, 99, 59, 10, 10, 9, 9,
+ 9, 9,102,108,111, 97,116, 32,112, 32, 61, 32,115,113,114,116, 40, 40, 40,114,101,102,114, 97, 99, 32, 42, 32,114,101,102,114,
+ 97, 99, 41, 43, 40,118,104, 42,118,104, 41, 45, 49, 46, 48, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,116, 32,102, 32, 61,
+ 32, 40, 40, 40,112, 45,118,104, 41, 42, 40,112, 45,118,104, 41, 41, 47, 40, 40,112, 43,118,104, 41, 42, 40,112, 43,118,104, 41,
+ 41, 41, 42, 40, 49, 46, 48, 43, 40, 40, 40, 40,118,104, 42, 40,112, 43,118,104, 41, 41, 45, 49, 46, 48, 41, 42, 40, 40,118,104,
+ 42, 40,112, 43,118,104, 41, 41, 45, 49, 46, 48, 41, 41, 47, 40, 40, 40,118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48,
+ 41, 42, 40, 40,118,104, 42, 40,112, 45,118,104, 41, 41, 43, 49, 46, 48, 41, 41, 41, 41, 59, 10, 9, 9, 9, 9,102,108,111, 97,
+116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,110,104, 41, 59, 10, 10, 9, 9, 9, 9,115,112,101, 99,102, 97, 99, 32, 61,
+ 32,109, 97,120, 40,102, 42,103, 42,101,120,112, 95, 98,108,101,110,100,101,114, 40, 40, 45, 40, 97,110,103, 42, 97,110,103, 41,
+ 47, 40, 50, 46, 48, 42,115,112,101, 99, 95,112,111,119,101,114, 42,115,112,101, 99, 95,112,111,119,101,114, 41, 41, 41, 44, 32,
+ 48, 46, 48, 41, 59, 10, 9, 9, 9,125, 10, 9, 9,125, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,
+119, 97,114,100,105,115,111, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99,
+ 51, 32,118, 44, 32,102,108,111, 97,116, 32,114,109,115, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,115,112,101, 99,102, 97,
+ 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,105,122,101, 40,108, 32, 43, 32,118, 41, 59,
+ 10, 9,102,108,111, 97,116, 32,110,104, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,104, 41, 44, 32, 48, 46, 48, 48,
+ 49, 41, 59, 10, 9,102,108,111, 97,116, 32,110,118, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,118, 41, 44, 32, 48,
+ 46, 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32,110,108, 32, 61, 32,109, 97,120, 40,100,111,116, 40,110, 44, 32,108, 41,
+ 44, 32, 48, 46, 48, 48, 49, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103,108,101, 32, 61, 32,116, 97,110, 40, 97, 99,111,
+115, 40,110,104, 41, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,108,112,104, 97, 32, 61, 32,109, 97,120, 40,114,109,115, 44, 32,
+ 48, 46, 48, 48, 49, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 61, 32,110,108, 32, 42, 32, 40, 49, 46, 48, 47, 40, 52, 46,
+ 48, 42, 77, 95, 80, 73, 42, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 42, 40,101,120,112, 95, 98,108,101,110,100,101,
+114, 40, 45, 40, 97,110,103,108,101, 42, 97,110,103,108,101, 41, 47, 40, 97,108,112,104, 97, 42, 97,108,112,104, 97, 41, 41, 47,
+ 40,115,113,114,116, 40,110,118, 42,110,108, 41, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,116,111,
+111,110, 95,115,112,101, 99, 40,118,101, 99, 51, 32,110, 44, 32,118,101, 99, 51, 32,108, 44, 32,118,101, 99, 51, 32,118, 44, 32,
+102,108,111, 97,116, 32,115,105,122,101, 44, 32,102,108,111, 97,116, 32,116,115,109,111,111,116,104, 44, 32,111,117,116, 32,102,
+108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 41, 10,123, 10, 9,118,101, 99, 51, 32,104, 32, 61, 32,110,111,114,109, 97,108,
+105,122,101, 40,108, 32, 43, 32,118, 41, 59, 10, 9,102,108,111, 97,116, 32,114,115,108,116, 32, 61, 32,100,111,116, 40,104, 44,
+ 32,110, 41, 59, 10, 9,102,108,111, 97,116, 32, 97,110,103, 32, 61, 32, 97, 99,111,115, 40,114,115,108,116, 41, 59, 10, 10, 9,
+105,102, 40, 97,110,103, 32, 60, 32,115,105,122,101, 41, 32,114,115,108,116, 32, 61, 32, 49, 46, 48, 59, 10, 9,101,108,115,101,
+ 32,105,102, 40, 97,110,103, 32, 62, 61, 32, 40,115,105,122,101, 32, 43, 32,116,115,109,111,111,116,104, 41, 32,124,124, 32,116,
+115,109,111,111,116,104, 32, 61, 61, 32, 48, 46, 48, 41, 32,114,115,108,116, 32, 61, 32, 48, 46, 48, 59, 10, 9,101,108,115,101,
+ 32,114,115,108,116, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 40, 97,110,103, 32, 45, 32,115,105,122,101, 41, 47,116,115,109,111,
+111,116,104, 41, 59, 10, 10, 9,115,112,101, 99,102, 97, 99, 32, 61, 32,114,115,108,116, 59, 10,125, 10, 10,118,111,105,100, 32,
+115,104, 97,100,101, 95,115,112,101, 99, 95, 97,114,101, 97, 95,105,110,112, 40,102,108,111, 97,116, 32,115,112,101, 99,102, 97,
+ 99, 44, 32,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,115,112,101, 99,102,
+ 97, 99, 41, 10,123, 10, 9,111,117,116,115,112,101, 99,102, 97, 99, 32, 61, 32,115,112,101, 99,102, 97, 99, 42,105,110,112, 59,
+ 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,115,112,101, 99, 95,116, 40,102,108,111, 97,116, 32,115,104, 97,100,
+102, 97, 99, 44, 32,102,108,111, 97,116, 32,115,112,101, 99, 44, 32,102,108,111, 97,116, 32,118,105,115,105,102, 97, 99, 44, 32,
+102,108,111, 97,116, 32,115,112,101, 99,102, 97, 99, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,116, 41, 10,123, 10, 9,116,
+ 32, 61, 32,115,104, 97,100,102, 97, 99, 42,115,112,101, 99, 42,118,105,115,105,102, 97, 99, 42,115,112,101, 99,102, 97, 99, 59,
+ 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 95,115,112,101, 99, 40,102,108,111, 97,116, 32,116, 44,
+ 32,118,101, 99, 51, 32,108, 97,109,112, 99,111,108, 44, 32,118,101, 99, 51, 32,115,112,101, 99, 99,111,108, 44, 32,111,117,116,
+ 32,118,101, 99, 51, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,116, 42,108, 97,109,112,
+ 99,111,108, 42,115,112,101, 99, 99,111,108, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,100,100, 40,118,
+101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,
+116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 49, 32, 43, 32, 99,111,108, 50, 59, 10,125,
+ 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52,
+ 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
+108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32, 99,111,108, 49, 42, 99,111,108, 50, 59, 10,
+125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109, 97,100,100,102, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,102,108,
+111, 97,116, 32,102, 44, 32,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
+108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 32, 43, 32,102, 42, 99,111,108, 49, 59, 10,125, 10, 10,
+118,111,105,100, 32,115,104, 97,100,101, 95,109,117,108, 40,118,101, 99, 52, 32, 99,111,108, 49, 44, 32,118,101, 99, 52, 32, 99,
+111,108, 50, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32,
+ 61, 32, 99,111,108, 49, 42, 99,111,108, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,109,117,108, 95,118,
+ 97,108,117,101, 40,102,108,111, 97,116, 32,102, 97, 99, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101,
+ 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32, 99,111,108, 42,102, 97, 99, 59, 10,
+125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,
+118,101, 99, 52, 32,111, 98, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,
+111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40, 99,111,108, 46,114,103, 98, 42,111, 98, 99,111,108, 46,114,103, 98, 44,
+ 32, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,100, 32,114, 97,109,112, 95,114,103, 98,116,111, 98,119, 40,118,101,
+ 99, 51, 32, 99,111,108,111,114, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,118, 97,108, 41, 10,123, 10, 9,111,
+117,116,118, 97,108, 32, 61, 32, 99,111,108,111,114, 46,114, 42, 48, 46, 51, 32, 43, 32, 99,111,108,111,114, 46,103, 42, 48, 46,
+ 53, 56, 32, 43, 32, 99,111,108,111,114, 46, 98, 42, 48, 46, 49, 50, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101,
+ 95,111,110,108,121, 95,115,104, 97,100,111,119, 40,102,108,111, 97,116, 32,105, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,
+102, 97, 99, 44, 32,102,108,111, 97,116, 32,101,110,101,114,103,121, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,
+115,104, 97,100,102, 97, 99, 41, 10,123, 10, 9,111,117,116,115,104, 97,100,102, 97, 99, 32, 61, 32,105, 42,101,110,101,114,103,
+121, 42, 40, 49, 46, 48, 32, 45, 32,115,104, 97,100,102, 97, 99, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101,
+ 95,111,110,108,121, 95,115,104, 97,100,111,119, 95,100,105,102,102,117,115,101, 40,102,108,111, 97,116, 32,115,104, 97,100,102,
+ 97, 99, 44, 32,118,101, 99, 51, 32,114,103, 98, 44, 32,118,101, 99, 52, 32,100,105,102,102, 44, 32,111,117,116, 32,118,101, 99,
+ 52, 32,111,117,116,100,105,102,102, 41, 10,123, 10, 9,111,117,116,100,105,102,102, 32, 61, 32,100,105,102,102, 32, 45, 32,118,
+101, 99, 52, 40,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,
+104, 97,100,101, 95,111,110,108,121, 95,115,104, 97,100,111,119, 95,115,112,101, 99,117,108, 97,114, 40,102,108,111, 97,116, 32,
+115,104, 97,100,102, 97, 99, 44, 32,118,101, 99, 51, 32,115,112,101, 99,114,103, 98, 44, 32,118,101, 99, 52, 32,115,112,101, 99,
+ 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116,115,112,101, 99, 41, 10,123, 10, 9,111,117,116,115,112,101, 99, 32, 61,
+ 32,115,112,101, 99, 32, 45, 32,118,101, 99, 52, 40,115,112,101, 99,114,103, 98, 42,115,104, 97,100,102, 97, 99, 44, 32, 48, 46,
+ 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,116,101,115,116, 95,115,104, 97,100,111,119, 98,117,102, 40,118,101, 99, 51, 32,
+114, 99,111, 44, 32,115, 97,109,112,108,101,114, 50, 68, 83,104, 97,100,111,119, 32,115,104, 97,100,111,119,109, 97,112, 44, 32,
+109, 97,116, 52, 32,115,104, 97,100,111,119,112,101,114,115,109, 97,116, 44, 32,102,108,111, 97,116, 32,115,104, 97,100,111,119,
+ 98,105, 97,115, 44, 32,102,108,111, 97,116, 32,105,110,112, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,114,101,115,117,108,
+116, 41, 10,123, 10, 9,105,102, 40,105,110,112, 32, 60, 61, 32, 48, 46, 48, 41, 32,123, 10, 9, 9,114,101,115,117,108,116, 32,
+ 61, 32, 48, 46, 48, 59, 10, 9,125, 10, 9,101,108,115,101, 32,123, 10, 9, 9,118,101, 99, 52, 32, 99,111, 32, 61, 32,115,104,
+ 97,100,111,119,112,101,114,115,109, 97,116, 42,118,101, 99, 52, 40,114, 99,111, 44, 32, 49, 46, 48, 41, 59, 10, 10, 9, 9, 47,
+ 47,102,108,111, 97,116, 32, 98,105, 97,115, 32, 61, 32, 40, 49, 46, 53, 32, 45, 32,105,110,112, 42,105,110,112, 41, 42,115,104,
+ 97,100,111,119, 98,105, 97,115, 59, 10, 9, 9, 99,111, 46,122, 32, 45, 61, 32,115,104, 97,100,111,119, 98,105, 97,115, 42, 99,
+111, 46,119, 59, 10, 10, 9, 9,114,101,115,117,108,116, 32, 61, 32,115,104, 97,100,111,119, 50, 68, 80,114,111,106, 40,115,104,
+ 97,100,111,119,109, 97,112, 44, 32, 99,111, 41, 46,120, 59, 10, 9,125, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101,
+ 95,101,120,112,111,115,117,114,101, 95, 99,111,114,114,101, 99,116, 40,118,101, 99, 51, 32, 99,111,108, 44, 32,102,108,111, 97,
+116, 32,108,105,110,102, 97, 99, 44, 32,102,108,111, 97,116, 32,108,111,103,102, 97, 99, 44, 32,111,117,116, 32,118,101, 99, 51,
+ 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,108,105,110,102, 97, 99, 42, 40, 49, 46, 48,
+ 32, 45, 32,101,120,112, 40, 99,111,108, 42,108,111,103,102, 97, 99, 41, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,
+100,101, 95,109,105,115,116, 95,102, 97, 99,116,111,114, 40,118,101, 99, 51, 32, 99,111, 44, 32,102,108,111, 97,116, 32,109,105,
+115,116,115,116, 97, 44, 32,102,108,111, 97,116, 32,109,105,115,116,100,105,115,116, 44, 32,102,108,111, 97,116, 32,109,105,115,
+116,116,121,112,101, 44, 32,102,108,111, 97,116, 32,109,105,115,105, 44, 32,111,117,116, 32,102,108,111, 97,116, 32,111,117,116,
+102, 97, 99, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 44, 32,122, 99,111,114, 59, 10, 10, 9,122, 99,111,114, 32,
+ 61, 32, 40,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 91, 51, 93, 91, 51, 93, 32, 61, 61, 32,
+ 48, 46, 48, 41, 63, 32,108,101,110,103,116,104, 40, 99,111, 41, 58, 32, 45, 99,111, 91, 50, 93, 59, 10, 9, 10, 9,102, 97, 99,
+ 32, 61, 32, 99,108, 97,109,112, 40, 40,122, 99,111,114, 45,109,105,115,116,115,116, 97, 41, 47,109,105,115,116,100,105,115,116,
+ 44, 32, 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,105,102, 40,109,105,115,116,116,121,112,101, 32, 61, 61, 32, 48, 46, 48,
+ 41, 32,102, 97, 99, 32, 42, 61, 32,102, 97, 99, 59, 10, 9,101,108,115,101, 32,105,102, 40,109,105,115,116,116,121,112,101, 32,
+ 61, 61, 32, 49, 46, 48, 41, 59, 10, 9,101,108,115,101, 32,102, 97, 99, 32, 61, 32,115,113,114,116, 40,102, 97, 99, 41, 59, 10,
+ 10, 9,111,117,116,102, 97, 99, 32, 61, 32, 49, 46, 48, 32, 45, 32, 40, 49, 46, 48, 45,102, 97, 99, 41, 42, 40, 49, 46, 48, 45,
+109,105,115,105, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95,119,111,114,108,100, 95,109,105,120, 40,118,
+101, 99, 51, 32,104,111,114, 44, 32,118,101, 99, 52, 32, 99,111,108, 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,
+111,108, 41, 10,123, 10, 9,102,108,111, 97,116, 32,102, 97, 99, 32, 61, 32, 99,108, 97,109,112, 40, 99,111,108, 46, 97, 44, 32,
+ 48, 46, 48, 44, 32, 49, 46, 48, 41, 59, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 40,109,105,120, 40,104,111,
+114, 44, 32, 99,111,108, 46,114,103, 98, 44, 32,102, 97, 99, 41, 44, 32, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,118,111,105,
+100, 32,115,104, 97,100,101, 95, 97,108,112,104, 97, 95,111,112, 97,113,117,101, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,111,
+117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52,
+ 40, 99,111,108, 46,114,103, 98, 44, 32, 49, 46, 48, 41, 59, 10,125, 10, 10,118,111,105,100, 32,115,104, 97,100,101, 95, 97,108,
+112,104, 97, 95,111, 98, 99,111,108,111,114, 40,118,101, 99, 52, 32, 99,111,108, 44, 32,118,101, 99, 52, 32,111, 98, 99,111,108,
+ 44, 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 10, 9,111,117,116, 99,111,108, 32, 61, 32,118,
+101, 99, 52, 40, 99,111,108, 46,114,103, 98, 44, 32, 99,111,108, 46, 97, 42,111, 98, 99,111,108, 46, 97, 41, 59, 10,125, 10, 10,
+ 0};
+
diff --git a/source/blender/gpu/intern/gpu_shader_vertex.glsl b/source/blender/gpu/intern/gpu_shader_vertex.glsl
new file mode 100644
index 00000000000..ba9ef7dead6
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_shader_vertex.glsl
@@ -0,0 +1,12 @@
+
+varying vec3 varposition;
+varying vec3 varnormal;
+
+void main()
+{
+ vec4 co = gl_ModelViewMatrix * gl_Vertex;
+
+ varposition = co.xyz;
+ varnormal = gl_NormalMatrix * gl_Normal;
+ gl_Position = gl_ProjectionMatrix * co;
+
diff --git a/source/blender/gpu/intern/gpu_shader_vertex.glsl.c b/source/blender/gpu/intern/gpu_shader_vertex.glsl.c
new file mode 100644
index 00000000000..a89de776864
--- /dev/null
+++ b/source/blender/gpu/intern/gpu_shader_vertex.glsl.c
@@ -0,0 +1,13 @@
+/* DataToC output of file <gpu_shader_vertex_glsl> */
+
+int datatoc_gpu_shader_vertex_glsl_size= 217;
+char datatoc_gpu_shader_vertex_glsl[]= {
+ 10,118, 97,114,121,105,110,103, 32,118,101, 99, 51, 32,118, 97,114,112,111,115,105,116,105,111,110,
+ 59, 10,118, 97,114,121,105,110,103, 32,118,101, 99, 51, 32,118, 97,114,110,111,114,109, 97,108, 59, 10, 10,118,111,105,100, 32,
+109, 97,105,110, 40, 41, 10,123, 10, 9,118,101, 99, 52, 32, 99,111, 32, 61, 32,103,108, 95, 77,111,100,101,108, 86,105,101,119,
+ 77, 97,116,114,105,120, 32, 42, 32,103,108, 95, 86,101,114,116,101,120, 59, 10, 10, 9,118, 97,114,112,111,115,105,116,105,111,
+110, 32, 61, 32, 99,111, 46,120,121,122, 59, 10, 9,118, 97,114,110,111,114,109, 97,108, 32, 61, 32,103,108, 95, 78,111,114,109,
+ 97,108, 77, 97,116,114,105,120, 32, 42, 32,103,108, 95, 78,111,114,109, 97,108, 59, 10, 9,103,108, 95, 80,111,115,105,116,105,
+111,110, 32, 61, 32,103,108, 95, 80,114,111,106,101, 99,116,105,111,110, 77, 97,116,114,105,120, 32, 42, 32, 99,111, 59, 10, 10,
+};
+
diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c
index 720f5b0f7c8..c0e84b73e47 100644
--- a/source/blender/imbuf/intern/anim.c
+++ b/source/blender/imbuf/intern/anim.c
@@ -612,6 +612,7 @@ static int startffmpeg(struct anim * anim) {
av_free(anim->pFrameRGB);
av_free(anim->pFrameDeinterlaced);
av_free(anim->pFrame);
+ anim->pCodecCtx = NULL;
return -1;
}
@@ -639,7 +640,19 @@ static int startffmpeg(struct anim * anim) {
PIX_FMT_BGR32,
SWS_FAST_BILINEAR | SWS_PRINT_INFO,
NULL, NULL, NULL);
-
+
+ if (!anim->img_convert_ctx) {
+ fprintf (stderr,
+ "Can't transform color space??? Bailing out...\n");
+ avcodec_close(anim->pCodecCtx);
+ av_close_input_file(anim->pFormatCtx);
+ av_free(anim->pFrameRGB);
+ av_free(anim->pFrameDeinterlaced);
+ av_free(anim->pFrame);
+ anim->pCodecCtx = NULL;
+ return -1;
+ }
+
return (0);
}
diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c
index 3b45a9de822..ecee3c7d6c0 100644
--- a/source/blender/imbuf/intern/cineon/cineonlib.c
+++ b/source/blender/imbuf/intern/cineon/cineonlib.c
@@ -67,12 +67,12 @@ fillCineonFileInfo(CineonFile* cineon, CineonFileInformation* fileInfo, const ch
static void
dumpCineonFileInfo(CineonFileInformation* fileInfo) {
d_printf("\n--File Information--\n");
- d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num));
- d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->image_offset));
- d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size));
- d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size));
- d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size));
- d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size));
+ d_printf("Magic: %8.8lX\n", (uintptr_t)ntohl(fileInfo->magic_num));
+ d_printf("Image Offset %ld\n", (intptr_t)ntohl(fileInfo->image_offset));
+ d_printf("Generic Header size %ld\n", (intptr_t)ntohl(fileInfo->gen_hdr_size));
+ d_printf("Industry Header size %ld\n", (intptr_t)ntohl(fileInfo->ind_hdr_size));
+ d_printf("User Data size %ld\n", (intptr_t)ntohl(fileInfo->user_data_size));
+ d_printf("File size %ld\n", (intptr_t)ntohl(fileInfo->file_size));
d_printf("Version \"%s\"\n", fileInfo->vers);
d_printf("File name \"%s\"\n", fileInfo->file_name);
d_printf("Creation date \"%s\"\n", fileInfo->create_date);
@@ -112,11 +112,11 @@ dumpCineonChannelInfo(CineonChannelInformation* chan) {
default: d_printf(" (unknown)\n"); break;
}
d_printf(" Bits per pixel %d\n", chan->bits_per_pixel);
- d_printf(" Pixels per line %ld\n", (long)ntohl(chan->pixels_per_line));
- d_printf(" Lines per image %ld\n", (long)ntohl(chan->lines_per_image));
- d_printf(" Ref low data %ld\n", (long)ntohl(chan->ref_low_data));
+ d_printf(" Pixels per line %ld\n", (intptr_t)ntohl(chan->pixels_per_line));
+ d_printf(" Lines per image %ld\n", (intptr_t)ntohl(chan->lines_per_image));
+ d_printf(" Ref low data %ld\n", (intptr_t)ntohl(chan->ref_low_data));
d_printf(" Ref low quantity %f\n", ntohf(chan->ref_low_quantity));
- d_printf(" Ref high data %ld\n", (long)ntohl(chan->ref_high_data));
+ d_printf(" Ref high data %ld\n", (intptr_t)ntohl(chan->ref_high_data));
d_printf(" Ref high quantity %f\n", ntohf(chan->ref_high_quantity));
}
@@ -231,8 +231,8 @@ dumpCineonFormatInfo(CineonFormatInformation* formatInfo) {
} else {
d_printf(" positive\n");
}
- d_printf("End of line padding %ld\n", (long)ntohl(formatInfo->line_padding));
- d_printf("End of channel padding %ld\n", (long)ntohl(formatInfo->channel_padding));
+ d_printf("End of line padding %ld\n", (intptr_t)ntohl(formatInfo->line_padding));
+ d_printf("End of channel padding %ld\n", (intptr_t)ntohl(formatInfo->channel_padding));
}
static void
@@ -256,8 +256,8 @@ fillCineonOriginationInfo(CineonFile* cineon,
static void
dumpCineonOriginationInfo(CineonOriginationInformation* originInfo) {
d_printf("\n--Origination Information--\n");
- d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset));
- d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset));
+ d_printf("X offset %ld\n", (intptr_t)ntohl(originInfo->x_offset));
+ d_printf("Y offset %ld\n", (intptr_t)ntohl(originInfo->y_offset));
d_printf("File name \"%s\"\n", originInfo->file_name);
d_printf("Creation date \"%s\"\n", originInfo->create_date);
d_printf("Creation time \"%s\"\n", originInfo->create_time);
@@ -529,7 +529,7 @@ cineonOpen(const char* filename) {
/* let's assume cineon files are always network order */
if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) {
if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n",
- (unsigned long)ntohl(header.fileInfo.magic_num), filename);
+ (uintptr_t)ntohl(header.fileInfo.magic_num), filename);
cineonClose(cineon);
return 0;
}
@@ -628,7 +628,7 @@ cineonOpenFromMem(unsigned char *mem, unsigned int size) {
/* let's assume cineon files are always network order */
if (header.fileInfo.magic_num != ntohl(CINEON_FILE_MAGIC)) {
- if (verbose) d_printf("Bad magic number %8.8lX in\n", (unsigned long)ntohl(header.fileInfo.magic_num));
+ if (verbose) d_printf("Bad magic number %8.8lX in\n", (uintptr_t)ntohl(header.fileInfo.magic_num));
cineonClose(cineon);
return 0;
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c
index 500c09ba265..1710cdde501 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.c
+++ b/source/blender/imbuf/intern/cineon/dpxlib.c
@@ -58,15 +58,15 @@ fillDpxChannelInfo(DpxFile* dpx, DpxChannelInformation* chan, int des) {
static void
dumpDpxChannelInfo(DpxChannelInformation* chan) {
- d_printf(" Signage %ld", (long)ntohl(chan->signage));
- d_printf(" Ref low data %ld\n", (long)ntohl(chan->ref_low_data));
+ d_printf(" Signage %ld", (intptr_t)ntohl(chan->signage));
+ d_printf(" Ref low data %ld\n", (intptr_t)ntohl(chan->ref_low_data));
d_printf(" Ref low quantity %f\n", ntohf(chan->ref_low_quantity));
- d_printf(" Ref high data %ld\n", (long)ntohl(chan->ref_high_data));
+ d_printf(" Ref high data %ld\n", (intptr_t)ntohl(chan->ref_high_data));
d_printf(" Ref high quantity %f\n", ntohf(chan->ref_high_quantity));
d_printf(" Designator1: %d,", chan->designator1);
d_printf(" Bits per pixel %d\n", chan->bits_per_pixel);
d_printf(" Packing: %d,", ntohs(chan->packing));
- d_printf(" Data Offset: %ld,", (long)ntohl(chan->data_offset));
+ d_printf(" Data Offset: %ld,", (intptr_t)ntohl(chan->data_offset));
}
static void
@@ -110,19 +110,19 @@ static void
dumpDpxFileInfo(DpxFileInformation* fileInfo) {
d_printf("\n--File Information--\n");
d_printf("Magic: %8.8lX\n", (unsigned long)ntohl(fileInfo->magic_num));
- d_printf("Image Offset %ld\n", (long)ntohl(fileInfo->offset));
+ d_printf("Image Offset %ld\n", (intptr_t)ntohl(fileInfo->offset));
d_printf("Version \"%s\"\n", fileInfo->vers);
- d_printf("File size %ld\n", (long)ntohl(fileInfo->file_size));
- d_printf("Ditto key %ld\n", (long)ntohl(fileInfo->ditto_key));
- d_printf("Generic Header size %ld\n", (long)ntohl(fileInfo->gen_hdr_size));
- d_printf("Industry Header size %ld\n", (long)ntohl(fileInfo->ind_hdr_size));
- d_printf("User Data size %ld\n", (long)ntohl(fileInfo->user_data_size));
+ d_printf("File size %ld\n", (intptr_t)ntohl(fileInfo->file_size));
+ d_printf("Ditto key %ld\n", (intptr_t)ntohl(fileInfo->ditto_key));
+ d_printf("Generic Header size %ld\n", (intptr_t)ntohl(fileInfo->gen_hdr_size));
+ d_printf("Industry Header size %ld\n", (intptr_t)ntohl(fileInfo->ind_hdr_size));
+ d_printf("User Data size %ld\n", (intptr_t)ntohl(fileInfo->user_data_size));
d_printf("File name \"%s\"\n", fileInfo->file_name);
d_printf("Creation date \"%s\"\n", fileInfo->create_date);
d_printf("Creator \"%s\"\n", fileInfo->creator);
d_printf("Project \"%s\"\n", fileInfo->project);
d_printf("Copyright \"%s\"\n", fileInfo->copyright);
- d_printf("Key %ld\n", (long)ntohl(fileInfo->key));
+ d_printf("Key %ld\n", (intptr_t)ntohl(fileInfo->key));
}
static void
@@ -150,8 +150,8 @@ dumpDpxImageInfo(DpxImageInformation* imageInfo) {
d_printf("Image orientation %d,", ntohs(imageInfo->orientation));
n = ntohs(imageInfo->channels_per_image);
d_printf("Channels %d\n", n);
- d_printf("Pixels per line %ld\n", (long)ntohl(imageInfo->pixels_per_line));
- d_printf("Lines per image %ld\n", (long)ntohl(imageInfo->lines_per_image));
+ d_printf("Pixels per line %ld\n", (intptr_t)ntohl(imageInfo->pixels_per_line));
+ d_printf("Lines per image %ld\n", (intptr_t)ntohl(imageInfo->lines_per_image));
for (i = 0; i < n; ++i) {
d_printf(" --Channel %d--\n", i);
dumpDpxChannelInfo(&imageInfo->channel[i]);
@@ -166,12 +166,12 @@ fillDpxOriginationInfo(
static void
dumpDpxOriginationInfo(DpxOriginationInformation* originInfo) {
d_printf("\n--Origination Information--\n");
- d_printf("X offset %ld\n", (long)ntohl(originInfo->x_offset));
- d_printf("Y offset %ld\n", (long)ntohl(originInfo->y_offset));
+ d_printf("X offset %ld\n", (intptr_t)ntohl(originInfo->x_offset));
+ d_printf("Y offset %ld\n", (intptr_t)ntohl(originInfo->y_offset));
d_printf("X centre %f\n", ntohf(originInfo->x_centre));
d_printf("Y centre %f\n", ntohf(originInfo->y_centre));
- d_printf("Original X %ld\n", (long)ntohl(originInfo->x_original_size));
- d_printf("Original Y %ld\n", (long)ntohl(originInfo->y_original_size));
+ d_printf("Original X %ld\n", (intptr_t)ntohl(originInfo->x_original_size));
+ d_printf("Original Y %ld\n", (intptr_t)ntohl(originInfo->y_original_size));
d_printf("File name \"%s\"\n", originInfo->file_name);
d_printf("Creation time \"%s\"\n", originInfo->creation_time);
d_printf("Input device \"%s\"\n", originInfo->input_device);
@@ -417,7 +417,7 @@ intern_dpxOpen(int mode, const char* bytestuff, int bufsize) {
/* let's assume dpx files are always network order */
if (header.fileInfo.magic_num != ntohl(DPX_FILE_MAGIC)) {
if (verbose) d_printf("Bad magic number %8.8lX in \"%s\".\n",
- (unsigned long)ntohl(header.fileInfo.magic_num), filename);
+ (uintptr_t)ntohl(header.fileInfo.magic_num), filename);
dpxClose(dpx);
return 0;
}
diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h
index 01eff8d570d..2646e8b3c12 100644
--- a/source/blender/imbuf/intern/cineon/logImageCore.h
+++ b/source/blender/imbuf/intern/cineon/logImageCore.h
@@ -34,7 +34,9 @@
extern "C" {
#endif
-
+#include "BLO_sys_types.h" // for intptr_t support
+#undef ntohl
+#undef htonl
typedef int (GetRowFn)(LogImageFile* logImage, unsigned short* row, int lineNum);
typedef int (SetRowFn)(LogImageFile* logImage, const unsigned short* row, int lineNum);
typedef void (CloseFn)(LogImageFile* logImage);
@@ -80,7 +82,7 @@ struct _Log_Image_File_t_
CloseFn* close;
unsigned char *membuffer;
- unsigned long membuffersize;
+ uintptr_t membuffersize;
unsigned char *memcursor;
};
diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c
index 20359335933..160e8453713 100644
--- a/source/blender/imbuf/intern/cineon/logmemfile.c
+++ b/source/blender/imbuf/intern/cineon/logmemfile.c
@@ -24,10 +24,10 @@
#include "logImageCore.h"
-int logimage_fseek(void* logfile, long offsett, int origin)
+int logimage_fseek(void* logfile, intptr_t offsett, int origin)
{
struct _Log_Image_File_t_ *file = (struct _Log_Image_File_t_*) logfile;
- long offset = offsett;
+ intptr_t offset = offsett;
if (file->file) fseek(file->file, offset, origin);
else { /*we're seeking in memory*/
@@ -38,7 +38,7 @@ int logimage_fseek(void* logfile, long offsett, int origin)
if (offset > file->membuffersize) return 1;
file->memcursor = (file->membuffer + file->membuffersize) - offset;
} else if (origin==SEEK_CUR) {
- unsigned long pos = (unsigned long)file->membuffer - (unsigned long)file->memcursor;
+ uintptr_t pos = (uintptr_t)file->membuffer - (uintptr_t)file->memcursor;
if (pos + offset > file->membuffersize) return 1;
if (pos < 0) return 1;
file->memcursor += offset;
diff --git a/source/blender/imbuf/intern/cineon/logmemfile.h b/source/blender/imbuf/intern/cineon/logmemfile.h
index 6e82cf2b145..39e2f36dad9 100644
--- a/source/blender/imbuf/intern/cineon/logmemfile.h
+++ b/source/blender/imbuf/intern/cineon/logmemfile.h
@@ -22,7 +22,7 @@
#ifndef _LOGMEMFILE_H
#define _LOGMEMFILE_H
-int logimage_fseek(void* logfile, long offsett, int origin);
+int logimage_fseek(void* logfile, intptr_t offsett, int origin);
int logimage_fwrite(void *buffer, unsigned int size, unsigned int count, void *logfile);
int logimage_fread(void *buffer, unsigned int size, unsigned int count, void *logfile);
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index 40c1f83c98c..8257eb4643e 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -39,6 +39,8 @@
#include "IMB_allocimbuf.h"
#include "IMB_filter.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/************************************************************************/
/* SCALING */
/************************************************************************/
@@ -490,8 +492,8 @@ static void enlarge_picture_byte(
/ (double) (src_width - 1.001);
double ratioy = (double) (dst_height - 1.0)
/ (double) (src_height - 1.001);
- unsigned long x_src, dx_src, x_dst;
- unsigned long y_src, dy_src, y_dst;
+ uintptr_t x_src, dx_src, x_dst;
+ uintptr_t y_src, dy_src, y_dst;
dx_src = 65536.0 / ratiox;
dy_src = 65536.0 / ratioy;
@@ -500,8 +502,8 @@ static void enlarge_picture_byte(
for (y_dst = 0; y_dst < dst_height; y_dst++) {
unsigned char* line1 = src + (y_src >> 16) * 4 * src_width;
unsigned char* line2 = line1 + 4 * src_width;
- unsigned long weight1y = 65536 - (y_src & 0xffff);
- unsigned long weight2y = 65536 - weight1y;
+ uintptr_t weight1y = 65536 - (y_src & 0xffff);
+ uintptr_t weight2y = 65536 - weight1y;
if ((y_src >> 16) == src_height - 1) {
line2 = line1;
@@ -509,8 +511,8 @@ static void enlarge_picture_byte(
x_src = 0;
for (x_dst = 0; x_dst < dst_width; x_dst++) {
- unsigned long weight1x = 65536 - (x_src & 0xffff);
- unsigned long weight2x = 65536 - weight1x;
+ uintptr_t weight1x = 65536 - (x_src & 0xffff);
+ uintptr_t weight2x = 65536 - weight1x;
unsigned long x = (x_src >> 16) * 4;
@@ -557,12 +559,12 @@ static void enlarge_picture_byte(
}
struct scale_outpix_byte {
- unsigned long r;
- unsigned long g;
- unsigned long b;
- unsigned long a;
+ uintptr_t r;
+ uintptr_t g;
+ uintptr_t b;
+ uintptr_t a;
- unsigned long weight;
+ uintptr_t weight;
};
static void shrink_picture_byte(
@@ -571,9 +573,9 @@ static void shrink_picture_byte(
{
double ratiox = (double) (dst_width) / (double) (src_width);
double ratioy = (double) (dst_height) / (double) (src_height);
- unsigned long x_src, dx_dst, x_dst;
- unsigned long y_src, dy_dst, y_dst;
- long y_counter;
+ uintptr_t x_src, dx_dst, x_dst;
+ uintptr_t y_src, dy_dst, y_dst;
+ intptr_t y_counter;
unsigned char * dst_begin = dst;
struct scale_outpix_byte * dst_line1 = NULL;
@@ -593,16 +595,16 @@ static void shrink_picture_byte(
y_counter = 65536;
for (y_src = 0; y_src < src_height; y_src++) {
unsigned char* line = src + y_src * 4 * src_width;
- unsigned long weight1y = 65536 - (y_dst & 0xffff);
- unsigned long weight2y = 65536 - weight1y;
+ uintptr_t weight1y = 65536 - (y_dst & 0xffff);
+ uintptr_t weight2y = 65536 - weight1y;
x_dst = 0;
for (x_src = 0; x_src < src_width; x_src++) {
- unsigned long weight1x = 65536 - (x_dst & 0xffff);
- unsigned long weight2x = 65536 - weight1x;
+ uintptr_t weight1x = 65536 - (x_dst & 0xffff);
+ uintptr_t weight2x = 65536 - weight1x;
- unsigned long x = x_dst >> 16;
+ uintptr_t x = x_dst >> 16;
- unsigned long w;
+ uintptr_t w;
w = (weight1y * weight1x) >> 16;
@@ -643,13 +645,13 @@ static void shrink_picture_byte(
y_dst += dy_dst;
y_counter -= dy_dst;
if (y_counter < 0) {
- unsigned long x;
+ uintptr_t x;
struct scale_outpix_byte * temp;
y_counter += 65536;
for (x=0; x < dst_width; x++) {
- unsigned long f = 0x80000000UL
+ uintptr_t f = 0x80000000UL
/ dst_line1[x].weight;
*dst++ = (dst_line1[x].r * f) >> 15;
*dst++ = (dst_line1[x].g * f) >> 15;
@@ -664,9 +666,9 @@ static void shrink_picture_byte(
}
}
if (dst - dst_begin < dst_width * dst_height * 4) {
- unsigned long x;
+ uintptr_t x;
for (x = 0; x < dst_width; x++) {
- unsigned long f = 0x80000000UL / dst_line1[x].weight;
+ uintptr_t f = 0x80000000UL / dst_line1[x].weight;
*dst++ = (dst_line1[x].r * f) >> 15;
*dst++ = (dst_line1[x].g * f) >> 15;
*dst++ = (dst_line1[x].b * f) >> 15;
@@ -698,8 +700,8 @@ static void enlarge_picture_float(
/ (double) (src_width - 1.001);
double ratioy = (double) (dst_height - 1.0)
/ (double) (src_height - 1.001);
- unsigned long x_dst;
- unsigned long y_dst;
+ uintptr_t x_dst;
+ uintptr_t y_dst;
double x_src, dx_src;
double y_src, dy_src;
@@ -727,7 +729,7 @@ static void enlarge_picture_float(
float w12 = weight1y * weight2x;
float w22 = weight2y * weight2x;
- unsigned long x = ((int) x_src) * 4;
+ uintptr_t x = ((int) x_src) * 4;
*dst++ = line1[x] * w11
+ line2[x] * w21
@@ -770,8 +772,8 @@ static void shrink_picture_float(
{
double ratiox = (double) (dst_width) / (double) (src_width);
double ratioy = (double) (dst_height) / (double) (src_height);
- unsigned long x_src;
- unsigned long y_src;
+ uintptr_t x_src;
+ uintptr_t y_src;
float dx_dst, x_dst;
float dy_dst, y_dst;
float y_counter;
@@ -794,14 +796,14 @@ static void shrink_picture_float(
y_counter = 1.0;
for (y_src = 0; y_src < src_height; y_src++) {
float* line = src + y_src * 4 * src_width;
- unsigned long weight1y = 1.0 - (y_dst - (int) y_dst);
- unsigned long weight2y = 1.0 - weight1y;
+ uintptr_t weight1y = 1.0 - (y_dst - (int) y_dst);
+ uintptr_t weight2y = 1.0 - weight1y;
x_dst = 0;
for (x_src = 0; x_src < src_width; x_src++) {
- unsigned long weight1x = 1.0 - (x_dst - (int) x_dst);
- unsigned long weight2x = 1.0 - weight1x;
+ uintptr_t weight1x = 1.0 - (x_dst - (int) x_dst);
+ uintptr_t weight2x = 1.0 - weight1x;
- unsigned long x = (int) x_dst;
+ uintptr_t x = (int) x_dst;
float w;
@@ -844,7 +846,7 @@ static void shrink_picture_float(
y_dst += dy_dst;
y_counter -= dy_dst;
if (y_counter < 0) {
- unsigned long x;
+ uintptr_t x;
struct scale_outpix_float * temp;
y_counter += 1.0;
@@ -864,7 +866,7 @@ static void shrink_picture_float(
}
}
if (dst - dst_begin < dst_width * dst_height * 4) {
- unsigned long x;
+ uintptr_t x;
for (x = 0; x < dst_width; x++) {
float f = 1.0 / dst_line1[x].weight;
*dst++ = dst_line1[x].r * f;
diff --git a/source/blender/include/BDR_drawmesh.h b/source/blender/include/BDR_drawmesh.h
index 93e08ab452d..34351549345 100644
--- a/source/blender/include/BDR_drawmesh.h
+++ b/source/blender/include/BDR_drawmesh.h
@@ -30,52 +30,11 @@
#ifndef BDR_DRAWMESH_H
#define BDR_DRAWMESH_H
-struct Image;
-struct MTFace;
struct Object;
struct DerivedMesh;
-struct Mesh;
-struct EdgeHash;
-
-/**
- * Enables or disable mipmapping for realtime images (textures).
- * Note that this will will destroy all texture bindings in OpenGL.
- * @see free_realtime_image()
- * @param mipmap Turn mipmapping on (mipmap!=0) or off (mipmap==0).
- */
-void set_mipmap(int mipmap);
-
-/**
- * Enables or disable linear mipmap setting for realtime images (textures).
- * Note that this will will destroy all texture bindings in OpenGL.
- * @see free_realtime_image()
- * @param mipmap Turn linear mipmapping on (linear!=0) or off (linear==0).
- */
-void set_linear_mipmap(int linear);
-
-/**
- * Returns the current setting for linear mipmapping.
- */
-int get_linear_mipmap(void);
-
-/**
- * Resets the realtime image cache variables.
- */
-void clear_realtime_image_cache(void);
-
-
-void update_realtime_image(struct Image *ima, int x, int y, int w, int h);
-void free_realtime_image(struct Image *ima);
-void free_all_realtime_images(void);
-void make_repbind(struct Image *ima);
-int set_tpage(struct MTFace *tface);
-
-void texpaint_enable_mipmap(void);
-void texpaint_disable_mipmap(void);
void draw_mesh_textured(struct Object *ob, struct DerivedMesh *dm, int facesel);
-struct EdgeHash *get_tface_mesh_marked_edge_info(struct Mesh *me);
-void init_realtime_GL(void);
+void draw_mesh_text(struct Object *ob, int glsl);
#endif /* BDR_DRAWMESH_H */
diff --git a/source/blender/include/BDR_drawobject.h b/source/blender/include/BDR_drawobject.h
index de28db64c3b..635b73af80c 100644
--- a/source/blender/include/BDR_drawobject.h
+++ b/source/blender/include/BDR_drawobject.h
@@ -47,8 +47,7 @@ struct EditVert;
struct EditFace;
struct EditEdge;
-int set_gl_material(int nr);
-int init_gl_materials(struct Object *ob, int check_alpha);
+int draw_glsl_material(struct Object *ob, int dt);
void mesh_foreachScreenVert(void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
void mesh_foreachScreenEdge(void (*func)(void *userData, struct EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts);
diff --git a/source/blender/include/BDR_gpencil.h b/source/blender/include/BDR_gpencil.h
index d0ebd096ecb..9b9294b0343 100644
--- a/source/blender/include/BDR_gpencil.h
+++ b/source/blender/include/BDR_gpencil.h
@@ -38,6 +38,14 @@ struct bGPdata;
struct bGPDlayer;
struct bGPDframe;
+/* ------------- Grease-Pencil Helpers -------------- */
+
+/* Temporary 'Stroke Point' data */
+typedef struct tGPspoint {
+ short x, y; /* x and y coordinates of cursor (in relative to area) */
+ float pressure; /* pressure of tablet at this point */
+} tGPspoint;
+
/* ------------ Grease-Pencil API ------------------ */
void free_gpencil_strokes(struct bGPDframe *gpf);
@@ -53,8 +61,6 @@ struct bGPdata *gpencil_data_duplicate(struct bGPdata *gpd);
struct bGPdata *gpencil_data_getactive(struct ScrArea *sa);
short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd);
-struct bGPdata *gpencil_data_getetime(struct bScreen *sc);
-void gpencil_data_setetime(struct bScreen *sc, struct bGPdata *gpd);
void gpencil_frame_delete_laststroke(struct bGPDframe *gpf);
@@ -70,7 +76,10 @@ void gpencil_delete_laststroke(struct bGPdata *gpd);
void gpencil_delete_operation(short mode);
void gpencil_delete_menu(void);
+void gpencil_convert_operation(short mode);
+void gpencil_convert_menu(void);
+
//short gpencil_paint(short mousebutton);
-short gpencil_do_paint(struct ScrArea *sa);
+short gpencil_do_paint(struct ScrArea *sa, short mousebutton);
#endif /* BDR_GPENCIL_H */
diff --git a/source/blender/include/BDR_imagepaint.h b/source/blender/include/BDR_imagepaint.h
index 26f2375e60a..bd1ac301416 100644
--- a/source/blender/include/BDR_imagepaint.h
+++ b/source/blender/include/BDR_imagepaint.h
@@ -34,8 +34,8 @@ void imagepaint_redraw_tool(void);
void imagepaint_pick(short mousebutton);
void imagepaint_paint(short mousebutton, short texturepaint);
-void imagepaint_undo();
-void free_imagepaint();
+void undo_imagepaint_step(int step);
+void undo_imagepaint_clear(void);
#endif /* BDR_IMAGEPAINT_H */
diff --git a/source/blender/include/BIF_drawgpencil.h b/source/blender/include/BIF_drawgpencil.h
index 418446313df..eacafce058d 100644
--- a/source/blender/include/BIF_drawgpencil.h
+++ b/source/blender/include/BIF_drawgpencil.h
@@ -28,15 +28,18 @@
#ifndef BIF_DRAWGPENCIL_H
#define BIF_DRAWGPENCIL_H
+
+struct bGPdata;
struct ScrArea;
struct View3D;
struct SpaceNode;
struct SpaceSeq;
-struct bGPdata;
struct uiBlock;
+struct ImBuf;
short draw_gpencil_panel(struct uiBlock *block, struct bGPdata *gpd, struct ScrArea *sa);
+void draw_gpencil_2dimage(struct ScrArea *sa, struct ImBuf *ibuf);
void draw_gpencil_2dview(struct ScrArea *sa, short onlyv2d);
void draw_gpencil_3dview(struct ScrArea *sa, short only3d);
void draw_gpencil_oglrender(struct View3D *v3d, int winx, int winy);
diff --git a/source/blender/include/BIF_drawseq.h b/source/blender/include/BIF_drawseq.h
index 462075cdf3d..85a6c7a9e2d 100644
--- a/source/blender/include/BIF_drawseq.h
+++ b/source/blender/include/BIF_drawseq.h
@@ -33,6 +33,8 @@
struct ScrArea;
struct Sequence;
+#define SEQ_ZOOM_FAC(szoom) (szoom > 0)? (szoom) : (szoom == 0)? (1.0) : (-1.0/szoom)
+
void drawprefetchseqspace(struct ScrArea *sa, void *spacedata);
void drawseqspace(struct ScrArea *sa, void *spacedata);
void set_special_seq_update(int val);
diff --git a/source/blender/include/BIF_drawtext.h b/source/blender/include/BIF_drawtext.h
index a75e0f1bd86..51000f8c81a 100644
--- a/source/blender/include/BIF_drawtext.h
+++ b/source/blender/include/BIF_drawtext.h
@@ -33,19 +33,21 @@
struct ScrArea;
struct SpaceText;
struct Text;
+struct TextLine;
void unlink_text(struct Text *text);
void free_textspace(struct SpaceText *st);
+int txt_file_modified(struct Text *text);
void txt_write_file(struct Text *text);
void add_text_fs(char *file);
void free_txt_data(void);
void pop_space_text(struct SpaceText *st);
-void get_format_string(struct SpaceText *st);
-void do_brackets(void);
+void txt_format_text(struct SpaceText *st);
+void txt_format_line(struct SpaceText *st, struct TextLine *line, int do_next);
#endif
diff --git a/source/blender/include/BIF_editaction.h b/source/blender/include/BIF_editaction.h
index 9f6751daeff..77c2f19bb9b 100644
--- a/source/blender/include/BIF_editaction.h
+++ b/source/blender/include/BIF_editaction.h
@@ -49,7 +49,9 @@ enum {
ACTTYPE_FILLCON,
ACTTYPE_IPO,
ACTTYPE_SHAPEKEY,
- ACTTYPE_GPLAYER
+ ACTTYPE_GPDATABLOCK,
+ ACTTYPE_GPLAYER,
+ ACTTYPE_SPECIALDATA
};
/* Macros for easier/more consistant state testing */
@@ -70,6 +72,8 @@ enum {
#define EDITABLE_ICU(icu) ((icu->flag & IPO_PROTECT)==0)
#define SEL_ICU(icu) (icu->flag & IPO_SELECT)
+#define EXPANDED_GPD(gpd) (gpd->flag & GP_DATA_EXPAND)
+
#define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED)==0)
#define SEL_GPL(gpl) ((gpl->flag & GP_LAYER_ACTIVE) || (gpl->flag & GP_LAYER_SELECT))
@@ -185,7 +189,7 @@ void action_remove_localmarkers(struct bAction *act);
/* Grease-Pencil Data */
void gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel);
-void deselect_gpencil_layers(struct bGPdata *gpd, short select_mode);
+void deselect_gpencil_layers(void *data, short select_mode);
short is_gplayer_frame_selected(struct bGPDlayer *gpl);
void set_gplayer_frame_selection(struct bGPDlayer *gpl, short mode);
@@ -204,7 +208,7 @@ void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode);
struct Key *get_action_mesh_key(void);
int get_nearest_key_num(struct Key *key, short *mval, float *x);
-void *get_nearest_act_channel(short mval[], short *ret_type);
+void *get_nearest_act_channel(short mval[], short *ret_type, void **owner);
/* Action */
struct bActionChannel *get_hilighted_action_channel(struct bAction* action);
diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h
index 24112c7f11a..fdd00a67465 100644
--- a/source/blender/include/BIF_editarmature.h
+++ b/source/blender/include/BIF_editarmature.h
@@ -91,6 +91,7 @@ void free_editArmature(void);
int join_armature(void);
void separate_armature(void);
+void apply_armature_pose2bones(void);
void load_editArmature(void);
void make_bone_parent(void);
@@ -99,20 +100,23 @@ struct Bone *get_indexed_bone (struct Object *ob, int index);
void make_editArmature(void);
void make_trans_bones (char mode);
+void remake_editArmature(void);
+void editbones_to_armature(struct ListBase *list, struct Object *ob);
int do_pose_selectbuffer(struct Base *base, unsigned int *buffer, short hits);
void generateSkeleton(void);
void mouse_armature(void);
-void remake_editArmature(void);
void selectconnected_armature(void);
void selectconnected_posearmature(void);
-void select_bone_parent(void);
+void armature_select_hierarchy(short direction, short add_to_sel);
+
void setflag_armature(short mode);
void unique_editbone_name (struct ListBase *ebones, char *name);
void auto_align_armature(short mode);
+void switch_direction_armature(void);
void create_vgroups_from_armature(struct Object *ob, struct Object *par);
void add_verts_to_dgroups(struct Object *ob, struct Object *par, int heat, int mirror);
@@ -142,6 +146,14 @@ void show_all_armature_bones(void);
#define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */
+/* useful macros */
+#define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
+#define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
+
+/* used in bone_select_hierachy() */
+#define BONE_SELECT_PARENT 0
+#define BONE_SELECT_CHILD 1
+
#endif
diff --git a/source/blender/include/BIF_editmesh.h b/source/blender/include/BIF_editmesh.h
index ca9f3d6a378..9354a577ac1 100644
--- a/source/blender/include/BIF_editmesh.h
+++ b/source/blender/include/BIF_editmesh.h
@@ -132,7 +132,7 @@ extern int EM_check_backbuf(unsigned int index);
extern void EM_free_backbuf(void);
extern void EM_selectmode_menu(void);
-
+extern void EM_mesh_copy_face(short type);
extern void vertexnoise(void);
extern void vertexsmooth(void);
diff --git a/source/blender/include/BIF_editview.h b/source/blender/include/BIF_editview.h
index 4ed3d0df367..204733a19d6 100644
--- a/source/blender/include/BIF_editview.h
+++ b/source/blender/include/BIF_editview.h
@@ -34,9 +34,13 @@ struct Base;
struct Object;
struct Camera;
struct View3D;
+struct rcti;
void arrows_move_cursor(unsigned short event);
+void lasso_select_boundbox(struct rcti *rect, short mcords[][2], short moves);
int lasso_inside(short mcords[][2], short moves, short sx, short sy);
+int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1);
+int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2);
void borderselect(void);
void circle_select(void);
void deselectall(void);
diff --git a/source/blender/include/BIF_gl.h b/source/blender/include/BIF_gl.h
index 2468abdff60..c1b3b056d62 100644
--- a/source/blender/include/BIF_gl.h
+++ b/source/blender/include/BIF_gl.h
@@ -49,20 +49,7 @@
#endif
#endif
-#ifdef __APPLE__
- #include <OpenGL/gl.h>
- #include <OpenGL/glu.h>
-#else
-/* #if defined (__sun) || defined (__sun__)
- #include <GL/gl.h>
- #include <mesa/glu.h>
- #else
-*/
- #include <GL/gl.h>
- #include <GL/glu.h>
-/* #endif */
-#endif
-
+#include "GL/glew.h"
/*
* these should be phased out. cpack should be replaced in
diff --git a/source/blender/include/BIF_keyval.h b/source/blender/include/BIF_keyval.h
index 70d248ded91..9693684e425 100644
--- a/source/blender/include/BIF_keyval.h
+++ b/source/blender/include/BIF_keyval.h
@@ -31,6 +31,9 @@
#define BIF_KEYVAL_H
char *key_event_to_string(unsigned short event);
+int decode_key_string(char *str, unsigned short *key, unsigned short *qual);
#endif
+
+
diff --git a/source/blender/include/BIF_meshtools.h b/source/blender/include/BIF_meshtools.h
index b08c66fd16e..a894d66cb10 100644
--- a/source/blender/include/BIF_meshtools.h
+++ b/source/blender/include/BIF_meshtools.h
@@ -30,6 +30,8 @@
#ifndef BIF_MESHTOOLS_H
#define BIF_MESHTOOLS_H
+#include "BLO_sys_types.h"
+
struct Object;
struct EditVert;
@@ -40,7 +42,7 @@ extern void objects_bake_render_menu(void);
extern void objects_bake_render_ui(short event);
extern void objects_bake_render(short event, char **error_msg);
-extern long mesh_octree_table(struct Object *ob, float *co, char mode);
+extern intptr_t mesh_octree_table(struct Object *ob, float *co, char mode);
extern int mesh_get_x_mirror_vert(struct Object *ob, int index);
extern struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, float *co);
extern int *mesh_get_x_mirror_faces(struct Object *ob);
diff --git a/source/blender/include/BIF_poseobject.h b/source/blender/include/BIF_poseobject.h
index 58c67ff102a..ab96f7ec03e 100644
--- a/source/blender/include/BIF_poseobject.h
+++ b/source/blender/include/BIF_poseobject.h
@@ -65,6 +65,8 @@ void pose_assign_to_posegroup(short active);
void pose_remove_from_posegroups(void);
void pgroup_operation_with_menu(void);
+void pose_select_hierarchy(short direction, short add_to_sel);
+
void pose_select_grouped(short nr);
void pose_select_grouped_menu(void);
diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h
index df514190270..b6a9882309d 100644
--- a/source/blender/include/BIF_resources.h
+++ b/source/blender/include/BIF_resources.h
@@ -57,8 +57,8 @@ typedef enum {
ICON_TRIA_UP,
ICON_FONTPREVIEW,
ICON_BLANK4,
- ICON_BLANK5,
- ICON_BLANK6,
+ ICON_WORDWRAP,
+ ICON_WORDWRAP_OFF,
ICON_ORTHO,
ICON_PERSP,
@@ -108,7 +108,7 @@ typedef enum {
ICON_FF,
ICON_REW,
ICON_PYTHON,
- ICON_BLANK11,
+ ICON_PYTHON_ON,
ICON_BLANK12,
ICON_BLANK13,
ICON_BLANK14,
@@ -266,8 +266,8 @@ typedef enum {
ICON_WINDOW_WINDOW,
ICON_PANEL_CLOSE,
ICON_PHYSICS,
- ICON_BLANK36,
- ICON_BLANK37,
+ ICON_LAYER_USED,
+ ICON_LAYER_ACTIVE,
ICON_BLANK38,
ICON_BLENDER,
@@ -524,6 +524,10 @@ enum {
TH_EDGE_SHARP,
TH_EDITMESH_ACTIVE,
+
+ TH_HANDLE_VERTEX,
+ TH_HANDLE_VERTEX_SELECT,
+ TH_HANDLE_VERTEX_SIZE,
};
/* XXX WARNING: previous is saved in file, so do not change order! */
diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h
index 4b2b8e14bb6..c7d0f4a1ada 100644
--- a/source/blender/include/BIF_space.h
+++ b/source/blender/include/BIF_space.h
@@ -65,6 +65,7 @@ struct SpaceOops;
#define IMAGE_HANDLER_PREVIEW 33
#define IMAGE_HANDLER_GAME_PROPERTIES 34
#define IMAGE_HANDLER_VIEW_PROPERTIES 35
+#define IMAGE_HANDLER_GREASEPENCIL 36
/*#define IMAGE_HANDLER_TRANSFORM_PROPERTIES 36*/
/* action handler codes */
@@ -83,6 +84,9 @@ struct SpaceOops;
/* nodes handler codes */
#define NODES_HANDLER_GREASEPENCIL 80
+/* text handler codes */
+#define TEXT_HANDLER_FIND 90
+
/* theme codes */
#define B_ADD_THEME 3301
#define B_DEL_THEME 3302
diff --git a/source/blender/include/BSE_drawipo.h b/source/blender/include/BSE_drawipo.h
index 932f103a579..b8388b2172a 100644
--- a/source/blender/include/BSE_drawipo.h
+++ b/source/blender/include/BSE_drawipo.h
@@ -42,6 +42,7 @@ struct ScrArea;
struct EditIpo;
struct View2D;
struct rctf;
+struct SpaceLink;
void calc_ipogrid(void);
void draw_ipogrid(void);
@@ -50,6 +51,8 @@ void areamouseco_to_ipoco (struct View2D *v2d, short *mval, float *x, float *y);
void ipoco_to_areaco (struct View2D *v2d, float *vec, short *mval);
void ipoco_to_areaco_noclip (struct View2D *v2d, float *vec, short *mval);
+struct View2D *spacelink_get_view2d(struct SpaceLink *sl);
+
void view2d_do_locks (struct ScrArea *cursa, int flag);
void view2d_zoom (struct View2D *v2d, float factor, int winx, int winy);
void view2d_getscale (struct View2D *v2d, float *x, float *y);
diff --git a/source/blender/include/BSE_drawview.h b/source/blender/include/BSE_drawview.h
index 83031ff3bad..1b2834b2e3b 100644
--- a/source/blender/include/BSE_drawview.h
+++ b/source/blender/include/BSE_drawview.h
@@ -36,8 +36,6 @@ struct rctf;
struct ScrArea;
struct ImBuf;
-void default_gl_light(void);
-void init_gl_stuff(void);
void circf(float x, float y, float rad);
void circ(float x, float y, float rad);
@@ -55,8 +53,8 @@ struct ImBuf *read_backbuf(short xmin, short ymin, short xmax, short ymax);
unsigned int sample_backbuf_rect(short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, unsigned int (*indextest)(unsigned int index));
void drawview3dspace(struct ScrArea *sa, void *spacedata);
-void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4]);
-void draw_depth(struct ScrArea *sa, void *spacedata);
+void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int winy, float winmat[][4], int shadow);
+void draw_depth(struct ScrArea *sa, void *spacedata, int (*func)(void *) );
void view3d_update_depths(struct View3D *v3d);
int update_time(int cfra);
@@ -76,6 +74,7 @@ void inner_play_anim_loop(int init, int mode);
int play_anim(int mode);
void make_axis_color(char *col, char *col2, char axis);
+char *view3d_get_name(struct View3D *v3d);
/* SMOOTHVIEW */
void smooth_view(struct View3D *v3d, float *ofs, float *quat, float *dist, float *lens);
diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h
index 6f8b94d7cd1..a7f7bc2e4b8 100644
--- a/source/blender/include/blendef.h
+++ b/source/blender/include/blendef.h
@@ -241,6 +241,7 @@
#define B_SEL_END 168
#define B_MAN_MODE 169
#define B_NDOF 170
+#define B_VIEW_BUTSEDIT 171
/* IPO: 200 */
#define B_IPOHOME 201
@@ -377,6 +378,13 @@
#define B_TEXTLINENUM 507
#define B_TAB_NUMBERS 508
#define B_SYNTAX 509
+#define B_WORDWRAP 510
+#define B_TEXTPLUGINS 511
+#define B_PASTEFIND 512
+#define B_PASTEREPLACE 513
+#define B_TEXTREPLACE 514
+#define B_TEXTFIND 515
+#define B_TEXTMARKALL 516
/* SCRIPT: 525 */
#define B_SCRIPTBROWSE 526
diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h
index 68bc1fff774..91a80c1c009 100644
--- a/source/blender/include/butspace.h
+++ b/source/blender/include/butspace.h
@@ -596,7 +596,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
#define B_VPCOLSLI 2801
#define B_VPGAMMA 2802
-
+#define B_COPY_TF_TRANSP 2803
#define B_COPY_TF_MODE 2804
#define B_COPY_TF_UV 2805
#define B_COPY_TF_COL 2806
diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h
index 720b856a149..51fa39ff9d6 100644
--- a/source/blender/include/transform.h
+++ b/source/blender/include/transform.h
@@ -466,7 +466,6 @@ int validSnappingNormal(TransInfo *t);
/*********************** Generics ********************************/
void initTrans(TransInfo *t);
-void initTransModeFlags(TransInfo *t, int mode);
void postTrans (TransInfo *t);
void drawLine(float *center, float *dir, char axis, short options);
@@ -498,6 +497,7 @@ TransInfo * BIF_GetTransInfo(void);
/*********************** NumInput ********************************/
+void initNumInput(NumInput *n);
void outputNumInput(NumInput *n, char *str);
short hasNumInput(NumInput *n);
void applyNumInput(NumInput *n, float *vec);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 60050ea010e..3054e038ba2 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -46,7 +46,7 @@ struct ID;
typedef struct IDPropertyData {
void *pointer;
ListBase group;
- int val, pad;
+ int val, val2; /*note, we actually fit a double into these two ints*/
} IDPropertyData;
typedef struct IDProperty {
@@ -77,6 +77,7 @@ typedef struct IDProperty {
/*the ID link property type hasn't been implemented yet, this will require
some cleanup of blenkernel, most likely.*/
#define IDP_ID 7
+#define IDP_DOUBLE 8
/*add any future new id property types here.*/
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index d7969a7379b..2e8d95335cc 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -184,7 +184,6 @@ typedef struct SpaceAction {
View2D v2d;
bAction *action; /* the currently active action */
- bGPdata *gpd; /* the currently active gpencil block (for editing) */
char mode, autosnap; /* mode: editing context; autosnap: automatic keyframe snapping mode */
short flag, actnr; /* flag: bitmapped settings; */
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index ac9761f165d..ca0ad06eac3 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -81,7 +81,9 @@ typedef struct bEditObjectActuator {
struct Mesh *me;
char name[32];
float linVelocity[3]; /* initial lin. velocity on creation */
- short localflag; /* flag for the lin. vel: apply locally */
+ float angVelocity[3]; /* initial ang. velocity on creation */
+ float pad;
+ short localflag; /* flag for the lin & ang. vel: apply locally */
short dyn_operation;
} bEditObjectActuator;
@@ -191,7 +193,8 @@ typedef struct bGameActuator {
} bGameActuator;
typedef struct bVisibilityActuator {
- /** bit 0: Is this object visible? */
+ /** bit 0: Is this object visible?
+ ** bit 1: Apply recursively */
int flag;
} bVisibilityActuator;
@@ -298,6 +301,7 @@ typedef struct FreeCamera {
#define ACT_NEW 4
#define ACT_LINKED 8
#define ACT_VISIBLE 16
+#define ACT_PIN 32
/* link codes */
#define LINK_SENSOR 0
@@ -368,9 +372,9 @@ typedef struct FreeCamera {
#define ACT_CONST_DIRPX 1
#define ACT_CONST_DIRPY 2
#define ACT_CONST_DIRPZ 4
-#define ACT_CONST_DIRMX 8
-#define ACT_CONST_DIRMY 16
-#define ACT_CONST_DIRMZ 32
+#define ACT_CONST_DIRNX 8
+#define ACT_CONST_DIRNY 16
+#define ACT_CONST_DIRNZ 32
/* constraint type */
#define ACT_CONST_TYPE_LOC 0
@@ -384,6 +388,9 @@ typedef struct FreeCamera {
#define ACT_EDOB_TRACK_TO 3
#define ACT_EDOB_DYNAMICS 4
+/* editObjectActuator->localflag */
+#define ACT_EDOB_LOCAL_LINV 2
+#define ACT_EDOB_LOCAL_ANGV 4
/* editObjectActuator->flag */
@@ -442,6 +449,7 @@ typedef struct FreeCamera {
/* visibilityact->flag */
/* Set means the object will become invisible */
#define ACT_VISIBILITY_INVISIBLE (1 << 0)
+#define ACT_VISIBILITY_RECURSIVE (1 << 1)
/* twodfilter->type */
#define ACT_2DFILTER_ENABLED -2
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 673855a6932..0648c535353 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -154,7 +154,8 @@ typedef enum eBone_Flag {
BONE_NO_SCALE = (1<<15), /* No parent scale */
BONE_HIDDEN_PG = (1<<16), /* hidden bone when drawing PoseChannels (for ghost drawing) */
BONE_DRAWWIRE = (1<<17), /* bone should be drawn as OB_WIRE, regardless of draw-types of view+armature */
- BONE_NO_CYCLICOFFSET = (1<<18) /* when no parent, bone will not get cyclic offset */
+ BONE_NO_CYCLICOFFSET = (1<<18), /* when no parent, bone will not get cyclic offset */
+ BONE_EDITMODE_LOCKED = (1<<19), /* bone transforms are locked in EditMode */
} eBone_Flag;
#endif
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 1c272105067..c7196763358 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -33,7 +33,7 @@
#include "DNA_ID.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
struct MTex;
@@ -58,7 +58,7 @@ typedef struct Brush {
float alpha; /* opacity */
short texact, pad;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
struct BrushClone clone;
} Brush;
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 0fe0dace016..fa5b5a75941 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -375,11 +375,13 @@ typedef enum B_CONSTRAINT_SPACETYPES {
/* for objects (relative to parent/without parent influence),
* for bones (along normals of bone, without parent/restpositions)
*/
- CONSTRAINT_SPACE_LOCAL,
+ CONSTRAINT_SPACE_LOCAL, /* = 1 */
/* for posechannels - pose space */
- CONSTRAINT_SPACE_POSE,
- /* for posechannels - local with parent */
- CONSTRAINT_SPACE_PARLOCAL,
+ CONSTRAINT_SPACE_POSE, /* = 2 */
+ /* for posechannels - local with parent */
+ CONSTRAINT_SPACE_PARLOCAL, /* = 3 */
+ /* for files from between 2.43-2.46 (should have been parlocal) */
+ CONSTRAINT_SPACE_INVALID, /* = 4. do not exchange for anything! */
} B_CONSTRAINT_SPACETYPES;
/* bConstraintChannel.flag */
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 72557145270..6c098e220bb 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -71,7 +71,8 @@ typedef struct CustomData {
#define CD_MTEXPOLY 15
#define CD_MLOOPUV 16
#define CD_MLOOPCOL 17
-#define CD_NUMTYPES 18
+#define CD_TANGENT 18
+#define CD_NUMTYPES 19
/* Bits for CustomDataMask */
#define CD_MASK_MVERT (1 << CD_MVERT)
@@ -92,6 +93,7 @@ typedef struct CustomData {
#define CD_MASK_MTEXPOLY (1 << CD_MTEXPOLY)
#define CD_MASK_MLOOPUV (1 << CD_MLOOPUV)
#define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL)
+#define CD_MASK_TANGENT (1 << CD_TANGENT)
/* CustomData.flag */
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index eafd886981b..cc0c9912057 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -59,6 +59,10 @@ typedef struct bGPDstroke {
#define GP_STROKE_3DSPACE (1<<0)
/* stroke is in 2d-space */
#define GP_STROKE_2DSPACE (1<<1)
+ /* stroke is in 2d-space (but with special 'image' scaling) */
+#define GP_STROKE_2DIMAGE (1<<2)
+ /* only for use with stroke-buffer (while drawing eraser) */
+#define GP_STROKE_ERASER (1<<15)
/* Grease-Pencil Annotations - 'Frame'
@@ -123,16 +127,16 @@ typedef struct bGPdata {
*/
short sbuffer_size; /* number of elements currently in cache */
short sbuffer_sflag; /* flags for stroke that cache represents */
- bGPDspoint *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */
+ void *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */
} bGPdata;
/* bGPdata->flag */
- /* draw this datablock's data (not used) */
-#define GP_DATA_DISP (1<<0)
+ /* don't allow painting to occur at all */
+#define GP_DATA_LMBPLOCK (1<<0)
/* show debugging info in viewport (i.e. status print) */
#define GP_DATA_DISPINFO (1<<1)
- /* is the block being shown in Action Editor */
-#define GP_DATA_EDITTIME (1<<2)
+ /* in Action Editor, show as expanded channel */
+#define GP_DATA_EXPAND (1<<2)
/* is the block overriding all clicks? */
#define GP_DATA_EDITPAINT (1<<3)
/* new strokes are added in viewport space */
diff --git a/source/blender/makesdna/DNA_group_types.h b/source/blender/makesdna/DNA_group_types.h
index 1bb18ca2ca2..0987050261d 100644
--- a/source/blender/makesdna/DNA_group_types.h
+++ b/source/blender/makesdna/DNA_group_types.h
@@ -54,7 +54,7 @@ typedef struct Group {
* the objects that show in the group can change depending
* on the last used scene */
unsigned int layer;
- int pad;
+ float dupli_ofs[3];
} Group;
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 42b651a7555..e1d79f0f875 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -37,6 +37,7 @@ struct PackedFile;
struct anim;
struct ImBuf;
struct RenderResult;
+struct GPUTexture;
/* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
@@ -62,7 +63,8 @@ typedef struct Image {
char name[240]; /* file path */
- ListBase ibufs; /* not written in file */
+ ListBase ibufs; /* not written in file */
+ struct GPUTexture *gputexture; /* not written in file */
/* sources from: */
struct anim *anim;
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index 3954a500dc7..2659de2f067 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -142,16 +142,24 @@ typedef short IPO_Channel;
#define MA_FRESTRAI 25
#define MA_ADD 26
-#define MA_MAP1 0x20
-#define MA_MAP2 0x40
-#define MA_MAP3 0x80
-#define MA_MAP4 0x100
-#define MA_MAP5 0x200
-#define MA_MAP6 0x400
-#define MA_MAP7 0x800
-#define MA_MAP8 0x1000
-#define MA_MAP9 0x2000
-#define MA_MAP10 0x4000
+#define MA_MAP1 (1<<5)
+#define MA_MAP2 (1<<6)
+#define MA_MAP3 (1<<7)
+#define MA_MAP4 (1<<8)
+#define MA_MAP5 (1<<9)
+#define MA_MAP6 (1<<10)
+#define MA_MAP7 (1<<11)
+#define MA_MAP8 (1<<12)
+#define MA_MAP9 (1<<13)
+#define MA_MAP10 (1<<14)
+#define MA_MAP11 (1<<15)
+#define MA_MAP12 (1<<16)
+#define MA_MAP13 (1<<17)
+#define MA_MAP14 (1<<18)
+#define MA_MAP15 (1<<19)
+#define MA_MAP16 (1<<20)
+#define MA_MAP17 (1<<21)
+#define MA_MAP18 (1<<22)
#define TEX_TOTNAM 14
@@ -354,8 +362,8 @@ typedef short IPO_Channel;
/* ******************** */
/* particle ipos */
-#define PART_TOTIPO 19
-#define PART_TOTNAM 19
+#define PART_TOTIPO 25
+#define PART_TOTNAM 25
#define PART_EMIT_FREQ 1
#define PART_EMIT_LIFE 2
@@ -381,6 +389,14 @@ typedef short IPO_Channel;
#define PART_BB_TILT 19
+#define PART_PD_FSTR 20
+#define PART_PD_FFALL 21
+#define PART_PD_FMAXD 22
+
+#define PART_PD2_FSTR 23
+#define PART_PD2_FFALL 24
+#define PART_PD2_FMAXD 25
+
/* these are IpoCurve specific */
/* **************** IPO ********************* */
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index c00dae08eb4..2a39580bb5c 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -35,7 +35,7 @@
#include "DNA_scriptlink_types.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
struct MTex;
@@ -45,7 +45,8 @@ struct CurveMapping;
typedef struct Lamp {
ID id;
- short type, mode;
+ short type, pad3;
+ int mode;
short colormodel, totex;
float r, g, b, k;
@@ -55,10 +56,9 @@ typedef struct Lamp {
float att1, att2; /* Quad1 and Quad2 attenuation */
- int pad2;
struct CurveMapping *curfalloff;
short falloff_type;
- short pad3;
+ short pad2;
float clipsta, clipend, shadspotsize;
float bias, soft;
@@ -99,7 +99,7 @@ typedef struct Lamp {
float YF_glowint, YF_glowofs;
short YF_glowtype, YF_pad2;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
struct Ipo *ipo;
/* preview */
@@ -137,6 +137,12 @@ typedef struct Lamp {
/* yafray: lamp shadowbuffer flag, softlight */
/* Since it is used with LOCAL lamp, can't use LA_SHAD */
#define LA_YF_SOFT 16384
+#define LA_LAYER_SHADOW 32768
+
+/* layer_shadow */
+#define LA_LAYER_SHADOW_BOTH 0
+#define LA_LAYER_SHADOW_CAST 1
+#define LA_LAYER_SHADOW_RECEIVE 2
/* sun effect type*/
#define LA_SUN_EFFECT_SKY 1
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 9412a09d0f4..c92a33bbcbb 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -36,7 +36,7 @@
#include "DNA_listBase.h"
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
struct MTex;
@@ -88,11 +88,11 @@ typedef struct Material {
float sbias; /* shadow bias to prevent terminator prob */
float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
float shad_alpha; /* in use for irregular shadowbuffer */
- float padf; /* free padding, take me! */
+ int septex;
/* for buttons and render*/
char rgbsel, texact, pr_type, use_nodes;
- short pr_back, pr_lamp, septex, ml_flag; /* ml_flag is for disable base material */
+ short pr_back, pr_lamp, pad4, ml_flag; /* ml_flag is for disable base material */
/* shaders */
short diff_shader, spec_shader;
@@ -110,7 +110,7 @@ typedef struct Material {
short ramp_show, pad3;
float rampfac_col, rampfac_spec;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
struct bNodeTree *nodetree;
struct Ipo *ipo;
struct Group *group; /* light group */
@@ -133,6 +133,8 @@ typedef struct Material {
int YF_dsmp, YF_preset, YF_djit;
ScriptLink scriptlink;
+
+ ListBase gpumaterial; /* runtime */
} Material;
/* **************** MATERIAL ********************* */
@@ -203,6 +205,7 @@ typedef struct Material {
/* shade_flag */
#define MA_CUBIC 1
+#define MA_OBCOLOR 2
/* diff_shader */
#define MA_DIFF_LAMBERT 0
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 6d025839ac8..fc686a4cc10 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -82,6 +82,7 @@ typedef struct MLoopUV{
typedef struct MLoopCol{
char a, r, g, b;
+ int pad; /*waste!*/
}MLoopCol;
typedef struct MSticky {
@@ -228,7 +229,7 @@ typedef struct PartialVisibility {
/* mtface->mode */
#define TF_DYNAMIC 1
-#define TF_DEPRECATED 2
+#define TF_ALPHASORT 2
#define TF_TEX 4
#define TF_SHAREDVERT 8
#define TF_LIGHT 16
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a44d9793062..9599cc1d247 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -35,6 +35,7 @@ typedef enum ModifierType {
eModifierType_Cloth,
eModifierType_Collision,
eModifierType_Bevel,
+ eModifierType_Shrinkwrap,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -390,7 +391,8 @@ typedef struct CollisionModifierData {
unsigned int numverts;
unsigned int numfaces;
- int pad;
+ short absorption; /* used for forces, in % */
+ short pad;
float time; /* cfra time of modifier */
struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
} CollisionModifierData;
@@ -490,4 +492,45 @@ typedef struct ExplodeModifierData {
float protect;
} ExplodeModifierData;
+typedef struct ShrinkwrapModifierData {
+ ModifierData modifier;
+
+ struct Object *target; /* shrink target */
+ struct Object *auxTarget; /* additional shrink target */
+ char vgroup_name[32]; /* optional vertexgroup name */
+ float keepDist; /* distance offset to keep from mesh/projection point */
+ short shrinkType; /* shrink type projection */
+ short shrinkOpts; /* shrink options */
+ char projAxis; /* axis to project over */
+
+ /*
+ * if using projection over vertex normal this controls the
+ * the level of subsurface that must be done before getting the
+ * vertex coordinates and normal
+ */
+ char subsurfLevels;
+
+ char pad[6];
+
+} ShrinkwrapModifierData;
+
+/* Shrinkwrap->shrinkType */
+#define MOD_SHRINKWRAP_NEAREST_SURFACE 0
+#define MOD_SHRINKWRAP_PROJECT 1
+#define MOD_SHRINKWRAP_NEAREST_VERTEX 2
+
+/* Shrinkwrap->shrinkOpts */
+#define MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR (1<<0) /* allow shrinkwrap to move the vertex in the positive direction of axis */
+#define MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR (1<<1) /* allow shrinkwrap to move the vertex in the negative direction of axis */
+
+#define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */
+#define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */
+
+#define MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */
+
+#define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0)
+#define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1)
+#define MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS (1<<2)
+#define MOD_SHRINKWRAP_PROJECT_OVER_NORMAL 0 /* projection over normal is used if no axis is selected */
+
#endif
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index dc6c2bcbcc0..5900e16d5e8 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -67,6 +67,9 @@ typedef struct PartDeflect {
float tex_nabla;
short tex_mode, kink, kink_axis, rt2;
struct Tex *tex; /* Texture of the texture effector */
+ struct RNG *rng; /* random noise generator for e.g. wind */
+ float f_noise; /* noise of force (currently used for wind) */
+ int pad;
} PartDeflect;
typedef struct PointCache {
@@ -153,8 +156,8 @@ typedef struct SoftBody {
#define PFIELD_GUIDE 5
#define PFIELD_TEXTURE 6
#define PFIELD_HARMONIC 7
-#define PFIELD_NUCLEAR 8
-#define PFIELD_MDIPOLE 9
+#define PFIELD_CHARGE 8
+#define PFIELD_LENNARDJ 9
/* pd->flag: various settings */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index c4e8cb4925b..d258cf77ef5 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -223,6 +223,8 @@ typedef struct Object {
/*#ifdef WITH_VERSE*/
void *vnode; /* pointer at object VerseNode */
/*#endif*/
+
+ ListBase gpulamp; /* runtime, for lamps only */
} Object;
/* Warning, this is not used anymore because hooks are now modifiers */
@@ -466,9 +468,11 @@ extern Object workob;
#define OB_LOCK_ROTX 8
#define OB_LOCK_ROTY 16
#define OB_LOCK_ROTZ 32
+#define OB_LOCK_ROT 56
#define OB_LOCK_SCALEX 64
#define OB_LOCK_SCALEY 128
#define OB_LOCK_SCALEZ 256
+#define OB_LOCK_SCALE 448
/* ob->softflag in DNA_object_force.h */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 4f62cd084cc..363f0075e23 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -166,6 +166,7 @@ typedef struct ParticleSettings {
struct Object *bb_ob;
struct Ipo *ipo;
struct PartDeflect *pd;
+ struct PartDeflect *pd2;
} ParticleSettings;
typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in copy_particlesystem */
@@ -264,6 +265,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
#define PART_CHILD_RENDER (1<<29)
#define PART_CHILD_GUIDE (1<<30)
+#define PART_SELF_EFFECT (1<<22)
+
/* part->rotfrom */
#define PART_ROT_KEYS 0 /* interpolate directly from keys */
#define PART_ROT_ZINCR 1 /* same as zdir but done incrementally from previous position */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 4818e693657..02650487b93 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -465,7 +465,7 @@ typedef struct SculptData
struct SculptSession *session;
/* Pointers to all of sculptmodes's textures */
- struct MTex *mtex[10];
+ struct MTex *mtex[18];
/* Editable brush shape */
struct CurveMapping *cumap;
@@ -793,6 +793,7 @@ typedef struct Scene {
/* toolsettings->uvcalc_flag */
#define UVCALC_FILLHOLES 1
#define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
+#define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
/* toolsettings->edge_mode */
#define EDGE_MODE_SELECT 0
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index c0306f43730..1fd97fe0158 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -88,6 +88,13 @@ typedef struct bActuatorSensor {
char name[32];
} bActuatorSensor;
+typedef struct bDelaySensor {
+ short delay;
+ short duration;
+ short flag;
+ short pad;
+} bDelaySensor;
+
typedef struct bCollisionSensor {
char name[32]; /* property name */
char materialName[32]; /* material */
@@ -157,7 +164,7 @@ typedef struct bSensor {
typedef struct bJoystickSensor {
char name[32];
short type;
- short pad;
+ short joyindex;
int axis;
int axisf;
int button;
@@ -204,12 +211,14 @@ typedef struct bJoystickSensor {
#define SENS_MESSAGE 10
#define SENS_JOYSTICK 11
#define SENS_ACTUATOR 12
+#define SENS_DELAY 13
/* sensor->flag */
#define SENS_SHOW 1
#define SENS_DEL 2
#define SENS_NEW 4
#define SENS_NOT 8
#define SENS_VISIBLE 16
+#define SENS_PIN 32
/* sensor->pulse */
#define SENS_PULSE_CONT 0
@@ -229,6 +238,9 @@ typedef struct bJoystickSensor {
* */
/* #define SENS_COLLISION_PROPERTY 0 */
#define SENS_COLLISION_MATERIAL 1
+/* ray specific mode */
+/* X-Ray means that the ray will traverse objects that don't have the property/material */
+#define SENS_RAY_XRAY 2
/* Some stuff for the mouse sensor Type: */
#define BL_SENS_MOUSE_LEFT_BUTTON 1
@@ -254,5 +266,8 @@ typedef struct bJoystickSensor {
#define SENS_JOY_HAT 2
#define SENS_JOY_HAT_DIR 0
+#define SENS_DELAY_REPEAT 1
+// should match JOYINDEX_MAX in SCA_JoystickDefines.h */
+#define SENS_JOY_MAXINDEX 8
#endif
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index c0b9a6b9590..7bad8ec3b44 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -257,6 +257,7 @@ typedef struct SpeedControlVars {
#define SEQ_USE_CROP 131072
#define SEQ_USE_COLOR_BALANCE 262144
#define SEQ_USE_PROXY_CUSTOM_DIR 524288
+#define SEQ_ACTIVE 1048576
#define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
#define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index a8694dfb7f5..c59cafc1ef0 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -247,6 +247,7 @@ typedef struct SpaceImage {
float xof, yof; /* user defined offset, image is centered */
float centx, centy; /* storage for offset while render drawing */
+ struct bGPdata *gpd; /* grease pencil data */
} SpaceImage;
typedef struct SpaceNla {
@@ -275,22 +276,23 @@ typedef struct SpaceText {
struct Text *text;
int top, viewlines;
- short flags, menunr;
-
- int font_id;
+ short flags, menunr;
+ int font_id;
+
int lheight;
int left;
int showlinenrs;
-
int tabnumber;
+
int currtab_set;
int showsyntax;
- int unused_padd;
-
+ int overwrite;
float pix_per_line;
struct rcti txtscroll, txtbar;
+ int wordwrap, doplugins;
+
} SpaceText;
typedef struct Script {
@@ -536,6 +538,7 @@ typedef struct SpaceImaSel {
#define SI_DRAW_TILE 1<<19
#define SI_SMOOTH_UV 1<<20
#define SI_DRAW_STRETCH 1<<21
+#define SI_DISPGP 1<<22
/* SpaceIpo->flag */
#define SIPO_LOCK_VIEW 1<<0
diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h
index d1859d22115..48ecccd517a 100644
--- a/source/blender/makesdna/DNA_text_types.h
+++ b/source/blender/makesdna/DNA_text_types.h
@@ -38,25 +38,36 @@ typedef struct TextLine {
struct TextLine *next, *prev;
char *line;
- char *format;
- int len, blen;
+ char *format; /* may be NULL if syntax is off or not yet formatted */
+ int len, blen; /* blen unused */
} TextLine;
+typedef struct TextMarker {
+ struct TextMarker *next, *prev;
+
+ int lineno, start, end, pad1; /* line number and start/end character indices */
+
+ int group, flags; /* see BKE_text.h for flag defines */
+ char color[4], pad[4]; /* draw color of the marker */
+} TextMarker;
+
typedef struct Text {
ID id;
char *name;
-
+
int flags, nlines;
ListBase lines;
TextLine *curl, *sell;
int curc, selc;
+ ListBase markers;
char *undo_buf;
int undo_pos, undo_len;
void *compiled;
+ double mtime;
} Text;
@@ -74,4 +85,12 @@ typedef struct Text {
#define TXT_READONLY 0x0100
#define TXT_FOLLOW 0x0200 /* always follow cursor (console) */
+/* format continuation flags */
+#define TXT_NOCONT 0x00 /* no continuation */
+#define TXT_SNGQUOTSTR 0x01 /* single quotes */
+#define TXT_DBLQUOTSTR 0x02 /* double quotes */
+#define TXT_TRISTR 0x04 /* triplets of quotes: """ or ''' */
+#define TXT_SNGTRISTR 0x05 /*(TXT_TRISTR | TXT_SNGQUOTSTR)*/
+#define TXT_DBLTRISTR 0x06 /*(TXT_TRISTR | TXT_DBLQUOTSTR)*/
+
#endif
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 8a79ce845d7..111dc08ee02 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -367,6 +367,7 @@ typedef struct TexMapping {
#define MTEX_BLEND_SAT 11
#define MTEX_BLEND_VAL 12
#define MTEX_BLEND_COLOR 13
+#define MTEX_NUM_BLENDTYPES 14
/* **************** EnvMap ********************* */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index cd1c047dac9..981591dc810 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -101,6 +101,11 @@ typedef struct ThemeSpace {
char movie[4], image[4], scene[4], audio[4]; // for sequence editor
char effect[4], plugin[4], transition[4], meta[4];
char editmesh_active[4];
+
+ char handle_vertex[4];
+ char handle_vertex_select[4];
+ char handle_vertex_size;
+ char hpad[7];
} ThemeSpace;
@@ -183,6 +188,7 @@ typedef struct UserDef {
char fontname[256]; // FILE_MAXDIR+FILE length
struct ListBase themes;
short undosteps;
+ short undomemory, pad[3];
short curssize;
short tb_leftmouse, tb_rightmouse;
struct SolidLight light[3];
@@ -262,6 +268,7 @@ extern UserDef U; /* from usiblender.c !!!! */
#define USER_GLOBALUNDO (1 << 13)
#define USER_ORBIT_SELECTION (1 << 14)
// old flag for #define USER_KEYINSERTAVAI (1 << 15)
+#define USER_ORBIT_ZBUF (1 << 15)
#define USER_HIDE_DOT (1 << 16)
#define USER_SHOW_ROTVIEWICON (1 << 17)
#define USER_SHOW_VIEWPORTNAME (1 << 18)
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 135272b9ac2..b30a7162b93 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -86,7 +86,8 @@ typedef struct View3D {
float winmat1[4][4]; // persp(1) storage, for swap matrices
float viewmat1[4][4];
- float viewquat[4], dist, zfac, pad0; /* zfac is initgrabz() result */
+ float viewquat[4], dist, zfac; /* zfac is initgrabz() result */
+ int lay_used; /* used while drawing */
short persp;
short view;
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index 26b3f051944..ab7e25190ad 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -38,7 +38,7 @@ struct Ipo;
struct MTex;
#ifndef MAX_MTEX
-#define MAX_MTEX 10
+#define MAX_MTEX 18
#endif
@@ -108,7 +108,7 @@ typedef struct World {
struct Ipo *ipo;
- struct MTex *mtex[10];
+ struct MTex *mtex[18]; /* MAX_MTEX */
/* previews */
struct PreviewImage *preview;
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 3818d66b39c..b4deb1f2b60 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -55,6 +55,8 @@
#include "MEM_guardedalloc.h"
#include "DNA_sdna_types.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -955,7 +957,7 @@ int make_structDNA(char *baseDirectory, FILE *file)
/* calculate size of datablock with strings */
cp= names[nr_names-1];
cp+= strlen(names[nr_names-1]) + 1; /* +1: null-terminator */
- len= (long) (cp - (char*) names[0]);
+ len= (intptr_t) (cp - (char*) names[0]);
len= (len+3) & ~3;
dna_write(file, names[0], len);
@@ -968,7 +970,7 @@ int make_structDNA(char *baseDirectory, FILE *file)
/* calculate datablock size */
cp= types[nr_types-1];
cp+= strlen(types[nr_types-1]) + 1; /* +1: null-terminator */
- len= (long) (cp - (char*) types[0]);
+ len= (intptr_t) (cp - (char*) types[0]);
len= (len+3) & ~3;
dna_write(file, types[0], len);
@@ -990,7 +992,7 @@ int make_structDNA(char *baseDirectory, FILE *file)
/* calc datablock size */
sp= structs[nr_structs-1];
sp+= 2+ 2*( sp[1] );
- len= (long) ((char*) sp - (char*) structs[0]);
+ len= (intptr_t) ((char*) sp - (char*) structs[0]);
len= (len+3) & ~3;
dna_write(file, structs[0], len);
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 2cb855ed440..cf83804b999 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -30,7 +30,7 @@ SET(INC
../python ../render/extern/include ../../../intern/decimation/extern
../imbuf ../avi ../../../intern/elbeem/extern
../../../intern/iksolver/extern ../blenloader ../quicktime
- ../blenkernel
+ ../blenkernel ../../../extern/glew/include ../gpu
${SDL_INC}
${ZLIB_INC}
${PYTHON_INC}
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index 8682f626b80..8af7b67520e 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -11,6 +11,7 @@ incs += ' ../python ../render/extern/include '
incs += ' ../imbuf ../avi '
incs += ' ../blenloader ../quicktime'
incs += ' ../blenkernel ../renderconverter '
+incs += ' ../gpu #/extern/glew/include '
incs += ' ' + env['BF_PYTHON_INC']
diff --git a/source/blender/nodes/intern/CMP_nodes/Makefile b/source/blender/nodes/intern/CMP_nodes/Makefile
index 61b03f237db..8a8d323ac5b 100644
--- a/source/blender/nodes/intern/CMP_nodes/Makefile
+++ b/source/blender/nodes/intern/CMP_nodes/Makefile
@@ -42,4 +42,5 @@ CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../include
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
diff --git a/source/blender/nodes/intern/Makefile b/source/blender/nodes/intern/Makefile
index 7cf2411ed84..6167cf6bc72 100644
--- a/source/blender/nodes/intern/Makefile
+++ b/source/blender/nodes/intern/Makefile
@@ -42,4 +42,6 @@ CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../include
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../render/extern/include
+CPPFLAGS += -I../../gpu
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
diff --git a/source/blender/nodes/intern/SHD_nodes/Makefile b/source/blender/nodes/intern/SHD_nodes/Makefile
index 1917e9ba15c..ae3cae029d2 100644
--- a/source/blender/nodes/intern/SHD_nodes/Makefile
+++ b/source/blender/nodes/intern/SHD_nodes/Makefile
@@ -44,4 +44,6 @@ CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../include
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include
+CPPFLAGS += -I../../../gpu
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_camera.c b/source/blender/nodes/intern/SHD_nodes/SHD_camera.c
index 63260ff91ed..20136d75540 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_camera.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_camera.c
@@ -46,8 +46,13 @@ static void node_shader_exec_camera(void *data, bNode *node, bNodeStack **in, bN
VECCOPY(out[0]->vec, shi->co); /* get view vector */
out[1]->vec[0]= fabs(shi->co[2]); /* get view z-depth */
out[2]->vec[0]= Normalize(out[0]->vec); /* get view distance */
- }
}
+}
+
+static int gpu_shader_camera(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "camera", in, out, GPU_builtin(GPU_VIEW_POSITION));
+}
bNodeType sh_node_camera= {
/* *next,*prev */ NULL, NULL,
@@ -63,6 +68,7 @@ bNodeType sh_node_camera= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_camera
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c
index b6f1f8d52cd..d277547b636 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c
@@ -56,6 +56,15 @@ static void node_shader_init_curve_vec(bNode* node)
node->storage= curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
}
+static int gpu_shader_curve_vec(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ float *array;
+ int size;
+
+ curvemapping_table_RGBA(node->storage, &array, &size);
+ return GPU_stack_link(mat, "curves_vec", in, out, GPU_texture(size, array));
+}
+
bNodeType sh_node_curve_vec= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_CURVE_VEC,
@@ -70,7 +79,8 @@ bNodeType sh_node_curve_vec= {
/* initfunc */ node_shader_init_curve_vec,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_curve_vec
};
@@ -100,6 +110,15 @@ static void node_shader_init_curve_rgb(bNode *node)
node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
}
+static int gpu_shader_curve_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ float *array;
+ int size;
+
+ curvemapping_table_RGBA(node->storage, &array, &size);
+ return GPU_stack_link(mat, "curves_rgb", in, out, GPU_texture(size, array));
+}
+
bNodeType sh_node_curve_rgb= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_CURVE_RGB,
@@ -114,6 +133,7 @@ bNodeType sh_node_curve_rgb= {
/* initfunc */ node_shader_init_curve_rgb,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_curve_rgb
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c
index 24395059c60..bc345759b98 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c
@@ -29,6 +29,7 @@
#include "../SHD_util.h"
+#include "DNA_customdata_types.h"
/* **************** GEOMETRY ******************** */
@@ -124,6 +125,18 @@ static void node_shader_init_geometry(bNode *node)
node->storage= MEM_callocN(sizeof(NodeGeometry), "NodeGeometry");
}
+static int gpu_shader_geom(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ NodeGeometry *ngeo= (NodeGeometry*)node->storage;
+ GPUNodeLink *orco = GPU_attribute(CD_ORCO, "");
+ GPUNodeLink *mtface = GPU_attribute(CD_MTFACE, ngeo->uvname);
+ GPUNodeLink *mcol = GPU_attribute(CD_MCOL, ngeo->colname);
+
+ return GPU_stack_link(mat, "geom", in, out,
+ GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL),
+ GPU_builtin(GPU_INVERSE_VIEW_MATRIX), orco, mtface, mcol);
+}
+
/* node type definition */
bNodeType sh_node_geom= {
/* *next,*prev */ NULL, NULL,
@@ -139,6 +152,7 @@ bNodeType sh_node_geom= {
/* initfunc */ node_shader_init_geometry,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_geom
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
index 67dfc619080..1b7b2dfb8e7 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
@@ -71,6 +71,12 @@ static void node_shader_exec_hue_sat(void *data, bNode *node, bNodeStack **in, b
do_hue_sat_fac(node, out[0]->vec, in[0]->vec, in[1]->vec, in[2]->vec, in[4]->vec, in[3]->vec);
}
+
+static int gpu_shader_hue_sat(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "hue_sat", in, out);
+}
+
bNodeType sh_node_hue_sat= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_HUE_SAT,
@@ -85,7 +91,8 @@ bNodeType sh_node_hue_sat= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_hue_sat
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
index 4d1ce282fce..72ee1483ecf 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
@@ -64,6 +64,11 @@ bNodeStack **out)
VECCOPY(out[0]->vec, col);
}
+static int gpu_shader_invert(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "invert", in, out);
+}
+
bNodeType sh_node_invert= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_INVERT,
@@ -78,6 +83,7 @@ bNodeType sh_node_invert= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_invert
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c
index 589954c8f7b..c081929a2fc 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c
@@ -69,6 +69,20 @@ static void node_shader_init_mapping(bNode *node)
node->storage= add_mapping();
}
+static int gpu_shader_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ TexMapping *texmap= node->storage;
+ float domin= (texmap->flag & TEXMAP_CLIP_MIN) != 0;
+ float domax= (texmap->flag & TEXMAP_CLIP_MAX) != 0;
+ GPUNodeLink *tmat = GPU_uniform((float*)texmap->mat);
+ GPUNodeLink *tmin = GPU_uniform(texmap->min);
+ GPUNodeLink *tmax = GPU_uniform(texmap->max);
+ GPUNodeLink *tdomin = GPU_uniform(&domin);
+ GPUNodeLink *tdomax = GPU_uniform(&domax);
+
+ return GPU_stack_link(mat, "mapping", in, out, tmat, tmin, tmax, tdomin, tdomax);
+}
+
bNodeType sh_node_mapping= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_MAPPING,
@@ -83,7 +97,8 @@ bNodeType sh_node_mapping= {
/* initfunc */ node_shader_init_mapping,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_mapping
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_material.c b/source/blender/nodes/intern/SHD_nodes/SHD_material.c
index bdceb134c0d..c0a2534ac4a 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_material.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_material.c
@@ -54,7 +54,6 @@ static bNodeSocketType sh_node_material_ext_in[]= {
{ SOCK_VALUE, 1, "Refl", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
{ SOCK_VECTOR, 1, "Normal", 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f},
{ SOCK_RGBA, 1, "Mirror", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
- { SOCK_RGBA, 1, "AmbCol", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 1, "Ambient", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 1, "Emit", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 1, "SpecTra", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
@@ -117,8 +116,6 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
if (node->type == SH_NODE_MATERIAL_EXT) {
if(in[MAT_IN_MIR]->hasinput)
nodestack_get_vec(&shi->mirr, SOCK_VECTOR, in[MAT_IN_MIR]);
- if(in[MAT_IN_AMBCOL]->hasinput)
- nodestack_get_vec(&shi->ambr, SOCK_VECTOR, in[MAT_IN_AMBCOL]);
if(in[MAT_IN_AMB]->hasinput)
nodestack_get_vec(&shi->amb, SOCK_VALUE, in[MAT_IN_AMB]);
if(in[MAT_IN_EMIT]->hasinput)
@@ -185,6 +182,77 @@ static void node_shader_init_material(bNode* node)
node->custom1= SH_NODE_MAT_DIFF|SH_NODE_MAT_SPEC;
}
+static int gpu_shader_material(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ if(node->id) {
+ GPUShadeInput shi;
+ GPUShadeResult shr;
+
+ GPU_shadeinput_set(mat, (Material*)node->id, &shi);
+
+ /* write values */
+ if(in[MAT_IN_COLOR].hasinput)
+ shi.rgb = in[MAT_IN_COLOR].link;
+
+ if(in[MAT_IN_SPEC].hasinput)
+ shi.specrgb = in[MAT_IN_SPEC].link;
+
+ if(in[MAT_IN_REFL].hasinput)
+ shi.refl = in[MAT_IN_REFL].link;
+
+ /* retrieve normal */
+ if(in[MAT_IN_NORMAL].hasinput) {
+ GPUNodeLink *tmp;
+ shi.vn = in[MAT_IN_NORMAL].link;
+ GPU_link(mat, "vec_math_normalize", shi.vn, &shi.vn, &tmp);
+ }
+
+ /* custom option to flip normal */
+ if(node->custom1 & SH_NODE_MAT_NEG)
+ GPU_link(mat, "vec_math_negate", shi.vn, &shi.vn);
+
+ if (node->type == SH_NODE_MATERIAL_EXT) {
+ if(in[MAT_IN_AMB].hasinput)
+ shi.amb= in[MAT_IN_AMB].link;
+ if(in[MAT_IN_EMIT].hasinput)
+ shi.emit= in[MAT_IN_EMIT].link;
+ if(in[MAT_IN_ALPHA].hasinput)
+ shi.alpha= in[MAT_IN_ALPHA].link;
+ }
+
+ GPU_shaderesult_set(&shi, &shr); /* clears shr */
+
+ /* write to outputs */
+ if(node->custom1 & SH_NODE_MAT_DIFF) {
+ if(node->custom1 & SH_NODE_MAT_SPEC)
+ out[MAT_OUT_COLOR].link= shr.combined;
+ else
+ out[MAT_OUT_COLOR].link= shr.diff;
+ }
+ else if(node->custom1 & SH_NODE_MAT_SPEC) {
+ out[MAT_OUT_COLOR].link= shr.spec;
+ }
+ else
+ GPU_link(mat, "set_rgb_zero", &out[MAT_OUT_COLOR].link);
+
+ GPU_link(mat, "mtex_alpha_to_col", out[MAT_OUT_COLOR].link, shr.alpha, &out[MAT_OUT_COLOR].link);
+
+ out[MAT_OUT_ALPHA].link = shr.alpha; //
+
+ if(node->custom1 & SH_NODE_MAT_NEG)
+ GPU_link(mat, "vec_math_negate", shi.vn, &shi.vn);
+ out[MAT_OUT_NORMAL].link = shi.vn;
+
+ if (node->type == SH_NODE_MATERIAL_EXT) {
+ out[MAT_OUT_DIFFUSE].link = shr.diff;
+ out[MAT_OUT_SPEC].link = shr.spec;
+ }
+
+ return 1;
+ }
+
+ return 0;
+}
bNodeType sh_node_material= {
/* *next,*prev */ NULL, NULL,
@@ -200,8 +268,8 @@ bNodeType sh_node_material= {
/* initfunc */ node_shader_init_material,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
-
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_material
};
bNodeType sh_node_material_ext= {
@@ -218,7 +286,7 @@ bNodeType sh_node_material_ext= {
/* initfunc */ node_shader_init_material,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
-
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_material
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_math.c b/source/blender/nodes/intern/SHD_nodes/SHD_math.c
index 2e156cf12bf..050c2cdcc95 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_math.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_math.c
@@ -194,6 +194,46 @@ bNodeStack **out)
}
}
+static int gpu_shader_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ static char *names[] = {"math_add", "math_subtract", "math_multiply",
+ "math_divide", "math_sine", "math_cosine", "math_tangnet", "math_asin",
+ "math_acos", "math_atan", "math_pow", "math_log", "math_min", "math_max",
+ "math_round", "math_less_than", "math_greater_than"};
+
+ switch (node->custom1) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 15:
+ case 16:
+ GPU_stack_link(mat, names[node->custom1], NULL, out,
+ GPU_socket(&in[0]), GPU_socket(&in[1]));
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 14:
+ if(in[0].hasinput || !in[1].hasinput)
+ GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[0]));
+ else
+ GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[1]));
+ break;
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
bNodeType sh_node_math= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_MATH,
@@ -208,6 +248,7 @@ bNodeType sh_node_math= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_math
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c
index dba70253fda..2da1dee5623 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c
@@ -60,6 +60,17 @@ static void node_shader_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, b
VECCOPY(out[0]->vec, col);
}
+static int gpu_shader_mix_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ static char *names[] = {"mix_blend", "mix_add", "mix_mult", "mix_sub",
+ "mix_screen", "mix_div", "mix_diff", "mix_dark", "mix_light",
+ "mix_overlay", "mix_dodge", "mix_burn", "mix_hue", "mix_sat",
+ "mix_val", "mix_color"};
+
+ return GPU_stack_link(mat, names[node->custom1], in, out);
+}
+
+
bNodeType sh_node_mix_rgb= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_MIX_RGB,
@@ -74,6 +85,7 @@ bNodeType sh_node_mix_rgb= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_mix_rgb
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
index f1ffd3446af..9d4ea1ccf67 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c
@@ -57,6 +57,14 @@ static void node_shader_exec_normal(void *data, bNode *node, bNodeStack **in, bN
out[1]->vec[0]= -INPR(out[0]->vec, vec);
}
+static int gpu_shader_normal(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ bNodeSocket *sock= node->outputs.first;
+ GPUNodeLink *vec = GPU_uniform(sock->ns.vec);
+
+ return GPU_stack_link(mat, "normal", in, out, vec);
+}
+
bNodeType sh_node_normal= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_NORMAL,
@@ -71,6 +79,7 @@ bNodeType sh_node_normal= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_normal
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_output.c b/source/blender/nodes/intern/SHD_nodes/SHD_output.c
index 0a9a30c452b..76856cfd2e8 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_output.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_output.c
@@ -62,6 +62,19 @@ static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bN
}
}
+static int gpu_shader_output(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ GPUNodeLink *outlink;
+
+ /*if(in[1].hasinput)
+ GPU_material_enable_alpha(mat);*/
+
+ GPU_stack_link(mat, "output_node", in, out, &outlink);
+ GPU_material_output_link(mat, outlink);
+
+ return 1;
+}
+
bNodeType sh_node_output= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_OUTPUT,
@@ -76,7 +89,8 @@ bNodeType sh_node_output= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_output
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c
index 4e56e26d3ad..1aa1a2ffc33 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c
@@ -42,6 +42,14 @@ static void node_shader_exec_rgb(void *data, bNode *node, bNodeStack **in, bNode
VECCOPY(out[0]->vec, sock->ns.vec);
}
+static int gpu_shader_rgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ bNodeSocket *sock= node->outputs.first;
+ GPUNodeLink *vec = GPU_uniform(sock->ns.vec);
+
+ return GPU_stack_link(mat, "set_rgba", in, out, vec);
+}
+
bNodeType sh_node_rgb= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_RGB,
@@ -56,6 +64,7 @@ bNodeType sh_node_rgb= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_rgb
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c b/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c
index 2b52a8e2229..6d5df2a1321 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c
@@ -48,6 +48,11 @@ static void node_shader_exec_seprgb(void *data, bNode *node, bNodeStack **in, bN
out[2]->vec[0] = in[0]->vec[2];
}
+static int gpu_shader_seprgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "separate_rgb", in, out);
+}
+
bNodeType sh_node_seprgb= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_SEPRGB,
@@ -62,7 +67,8 @@ bNodeType sh_node_seprgb= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_seprgb
};
@@ -86,6 +92,11 @@ static void node_shader_exec_combrgb(void *data, bNode *node, bNodeStack **in, b
out[0]->vec[2] = in[2]->vec[0];
}
+static int gpu_shader_combrgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "combine_rgb", in, out);
+}
+
bNodeType sh_node_combrgb= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_COMBRGB,
@@ -100,6 +111,7 @@ bNodeType sh_node_combrgb= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_combrgb
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
index 30abad666c4..d3480a6ae9d 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
@@ -54,6 +54,11 @@ bNodeStack **out)
out[0]->vec[0] = 1.0f / (1.0f + pow(2.71828183,-((vec[0]-vec[2])*vec[1]))) ;
}
+static int gpu_shader_squeeze(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "squeeze", in, out);
+}
+
bNodeType sh_node_squeeze= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_SQUEEZE,
@@ -68,6 +73,7 @@ bNodeType sh_node_squeeze= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_squeeze
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_texture.c b/source/blender/nodes/intern/SHD_nodes/SHD_texture.c
index ace11a20d42..31dbde940fd 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_texture.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_texture.c
@@ -27,6 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include "DNA_texture_types.h"
+
#include "../SHD_util.h"
/* **************** TEXTURE ******************** */
@@ -110,6 +112,18 @@ static void node_shader_exec_texture(void *data, bNode *node, bNodeStack **in, b
}
}
+static int gpu_shader_texture(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ Tex *tex = (Tex*)node->id;
+
+ if(tex && tex->type == TEX_IMAGE && tex->ima) {
+ GPUNodeLink *texlink = GPU_image(tex->ima, NULL);
+ return GPU_stack_link(mat, "texture_image", in, out, texlink);
+ }
+ else
+ return 0;
+}
+
bNodeType sh_node_texture= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_TEXTURE,
@@ -124,7 +138,8 @@ bNodeType sh_node_texture= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_texture
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c
index cf7e33d9dca..301c0cb7031 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c
@@ -59,6 +59,15 @@ static void node_shader_init_valtorgb(bNode *node)
node->storage= add_colorband(1);
}
+static int gpu_shader_valtorgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ float *array;
+ int size;
+
+ colorband_table_RGBA(node->storage, &array, &size);
+ return GPU_stack_link(mat, "valtorgb", in, out, GPU_texture(size, array));
+}
+
bNodeType sh_node_valtorgb= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_VALTORGB,
@@ -73,7 +82,8 @@ bNodeType sh_node_valtorgb= {
/* initfunc */ node_shader_init_valtorgb,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_valtorgb
};
@@ -96,6 +106,11 @@ static void node_shader_exec_rgbtobw(void *data, bNode *node, bNodeStack **in, b
out[0]->vec[0]= in[0]->vec[0]*0.35f + in[0]->vec[1]*0.45f + in[0]->vec[2]*0.2f;
}
+static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ return GPU_stack_link(mat, "rgbtobw", in, out);
+}
+
bNodeType sh_node_rgbtobw= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_RGBTOBW,
@@ -110,7 +125,8 @@ bNodeType sh_node_rgbtobw= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_rgbtobw
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_value.c b/source/blender/nodes/intern/SHD_nodes/SHD_value.c
index 57ef7226066..768ef3cda3d 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_value.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_value.c
@@ -42,7 +42,13 @@ static void node_shader_exec_value(void *data, bNode *node, bNodeStack **in, bNo
out[0]->vec[0]= sock->ns.vec[0];
}
+static int gpu_shader_value(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ bNodeSocket *sock= node->outputs.first;
+ GPUNodeLink *vec = GPU_uniform(sock->ns.vec);
+ return GPU_stack_link(mat, "set_value", in, out, vec);
+}
bNodeType sh_node_value= {
/* *next,*prev */ NULL, NULL,
@@ -58,7 +64,8 @@ bNodeType sh_node_value= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_value
};
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
index 8d0a4b3abe3..96db8db18a6 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
@@ -99,6 +99,34 @@ static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in,
}
+static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out)
+{
+ static char *names[] = {"vec_math_add", "vec_math_subtract",
+ "vec_math_average", "vec_math_dot", "vec_math_cross",
+ "vec_math_normalize"};
+
+ switch (node->custom1) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ GPU_stack_link(mat, names[node->custom1], NULL, out,
+ GPU_socket(&in[0]), GPU_socket(&in[1]));
+ break;
+ case 5:
+ if(in[0].hasinput || !in[1].hasinput)
+ GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[0]));
+ else
+ GPU_stack_link(mat, names[node->custom1], NULL, out, GPU_socket(&in[1]));
+ break;
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
bNodeType sh_node_vect_math= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_VECT_MATH,
@@ -113,6 +141,7 @@ bNodeType sh_node_vect_math= {
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
- /* id */ NULL
+ /* id */ NULL, NULL, NULL,
+ /* gpufunc */ gpu_shader_vect_math
};
diff --git a/source/blender/nodes/intern/SHD_util.c b/source/blender/nodes/intern/SHD_util.c
index c9f58fbce49..f673834d2b7 100644
--- a/source/blender/nodes/intern/SHD_util.c
+++ b/source/blender/nodes/intern/SHD_util.c
@@ -164,7 +164,7 @@ void nodeShaderSynchronizeID(bNode *node, int copyto)
case MAT_IN_MIR:
VECCOPY(&ma->mirr, sock->ns.vec); break;
case MAT_IN_AMB:
- VECCOPY(&ma->ambr, sock->ns.vec); break;
+ ma->amb= sock->ns.vec[0]; break;
case MAT_IN_EMIT:
ma->emit= sock->ns.vec[0]; break;
case MAT_IN_SPECTRA:
@@ -188,7 +188,7 @@ void nodeShaderSynchronizeID(bNode *node, int copyto)
case MAT_IN_MIR:
VECCOPY(sock->ns.vec, &ma->mirr); break;
case MAT_IN_AMB:
- VECCOPY(sock->ns.vec, &ma->ambr); break;
+ sock->ns.vec[0]= ma->amb; break;
case MAT_IN_EMIT:
sock->ns.vec[0]= ma->emit; break;
case MAT_IN_SPECTRA:
diff --git a/source/blender/nodes/intern/SHD_util.h b/source/blender/nodes/intern/SHD_util.h
index f75802b7c15..eda985529c1 100644
--- a/source/blender/nodes/intern/SHD_util.h
+++ b/source/blender/nodes/intern/SHD_util.h
@@ -88,6 +88,8 @@
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
+#include "GPU_material.h"
+
#include "butspace.h"
#include "blendef.h"
#include "mydevice.h"
@@ -117,13 +119,12 @@ typedef struct ShaderCallData {
#define MAT_IN_REFL 2
#define MAT_IN_NORMAL 3
#define MAT_IN_MIR 4
-#define MAT_IN_AMBCOL 5
-#define MAT_IN_AMB 6
-#define MAT_IN_EMIT 7
-#define MAT_IN_SPECTRA 8
-#define MAT_IN_RAY_MIRROR 9
-#define MAT_IN_ALPHA 10
-#define MAT_IN_TRANSLUCENCY 11
+#define MAT_IN_AMB 5
+#define MAT_IN_EMIT 6
+#define MAT_IN_SPECTRA 7
+#define MAT_IN_RAY_MIRROR 8
+#define MAT_IN_ALPHA 9
+#define MAT_IN_TRANSLUCENCY 10
/* output socket defines */
#define MAT_OUT_COLOR 0
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index f6a27b80733..3d9b45051fb 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -48,6 +48,7 @@ struct bPythonConstraint; /* DNA_constraint_types.h */
struct bConstraintOb; /* DNA_constraint_types.h */
struct bConstraintTarget; /* DNA_constraint_types.h*/
struct Script; /* DNA_screen_types.h */
+struct BPyMenu;
#ifdef __cplusplus
extern "C" {
#endif
@@ -91,6 +92,8 @@ extern "C" {
int BPY_txt_do_python_Text( struct Text *text );
int BPY_menu_do_python( short menutype, int event );
+ int BPY_menu_do_shortcut( short menutype, unsigned short key, unsigned short modifiers );
+ int BPY_menu_invoke( struct BPyMenu *pym, short menutype );
void BPY_run_python_script( char *filename );
int BPY_run_script(struct Script *script);
void BPY_free_compiled_text( struct Text *text );
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
index 226657655fa..05254bca8c0 100644
--- a/source/blender/python/BPY_interface.c
+++ b/source/blender/python/BPY_interface.c
@@ -160,11 +160,10 @@ ScriptError g_script_error;
* Function prototypes
***************************************************************************/
PyObject *RunPython( Text * text, PyObject * globaldict );
-char *GetName( Text * text );
PyObject *CreateGlobalDictionary( void );
void ReleaseGlobalDictionary( PyObject * dict );
void DoAllScriptsFromList( ListBase * list, short event );
-PyObject *importText( char *name );
+static PyObject *importText( char *name );
void init_ourImport( void );
void init_ourReload( void );
PyObject *blender_import( PyObject * self, PyObject * args );
@@ -293,7 +292,7 @@ void syspath_append( char *dirname )
short ok=1;
PyErr_Clear( );
- dir = Py_BuildValue( "s", dirname );
+ dir = PyString_FromString( dirname );
mod_sys = PyImport_ImportModule( "sys" ); /* new ref */
@@ -309,32 +308,29 @@ void syspath_append( char *dirname )
}
if (PySequence_Contains(path, dir)==0) { /* Only add if we need to */
- if (ok && PyList_Append( path, dir ) != 0)
+ if (ok && PyList_Append( path, dir ) != 0) /* decref below */
ok = 0; /* append failed */
if( (ok==0) || PyErr_Occurred( ) )
Py_FatalError( "could import or build sys.path, can't continue" );
}
+ Py_DECREF( dir );
Py_XDECREF( mod_sys );
}
void init_syspath( int first_time )
{
- PyObject *path;
PyObject *mod, *d;
char *progname;
char execdir[FILE_MAXDIR]; /*defines from DNA_space_types.h */
int n;
-
-
- path = Py_BuildValue( "s", bprogname );
mod = PyImport_ImportModule( "Blender.sys" );
if( mod ) {
d = PyModule_GetDict( mod );
- EXPP_dict_set_item_str( d, "progname", path );
+ EXPP_dict_set_item_str( d, "progname", PyString_FromString( bprogname ) );
Py_DECREF( mod );
} else
printf( "Warning: could not set Blender.sys.progname\n" );
@@ -410,12 +406,14 @@ void BPY_rebuild_syspath( void )
mod = PyImport_ImportModule( "sys" );
if (!mod) {
printf("error: could not import python sys module. some modules may not import.\n");
+ PyGILState_Release(gilstate);
return;
}
if (!bpy_orig_syspath_List) { /* should never happen */
printf("error refershing python path\n");
Py_DECREF(mod);
+ PyGILState_Release(gilstate);
return;
}
@@ -555,6 +553,7 @@ void BPY_Err_Handle( char *script_name )
if( exception
&& PyErr_GivenExceptionMatches( exception, PyExc_SyntaxError ) ) {
/* no traceback available when SyntaxError */
+ PyErr_NormalizeException( &exception, &err, &tb );
PyErr_Restore( exception, err, tb ); /* takes away reference! */
PyErr_Print( );
v = PyObject_GetAttrString( err, "lineno" );
@@ -649,7 +648,7 @@ int BPY_txt_do_python_Text( struct Text *text )
}
/* Create a new script structure and initialize it: */
- script = alloc_libblock( &G.main->script, ID_SCRIPT, GetName( text ) );
+ script = alloc_libblock( &G.main->script, ID_SCRIPT, text->id.name+2 );
if( !script ) {
printf( "couldn't allocate memory for Script struct!" );
@@ -660,8 +659,7 @@ int BPY_txt_do_python_Text( struct Text *text )
* an error after it will call BPY_Err_Handle below, but the text struct
* will have been deallocated already, so we need to copy its name here.
*/
- BLI_strncpy( textname, GetName( text ),
- strlen( GetName( text ) ) + 1 );
+ BLI_strncpy( textname, text->id.name+2, 21 );
script->id.us = 1;
script->flags = SCRIPT_RUNNING;
@@ -965,8 +963,38 @@ int BPY_run_script(Script *script)
*****************************************************************************/
int BPY_menu_do_python( short menutype, int event )
{
- char *argstr = NULL;
BPyMenu *pym;
+ pym = BPyMenu_GetEntry( menutype, ( short ) event );
+ return BPY_menu_invoke( pym, menutype );
+}
+
+/****************************************************************************
+* Description: This function executes the script by its shortcut.
+* Notes: It is called by the ui code in src/???.c when a user presses an
+* unassigned key combination. Scripts are searched in the BPyMenuTable,
+* using the given menutype and event values to know which one to invoke.
+*****************************************************************************/
+int BPY_menu_do_shortcut( short menutype, unsigned short key, unsigned short qual )
+{
+ BPyMenu *pym;
+ pym = BPyMenu_GetEntry( menutype, 0 );
+
+ while ( pym ) {
+ if ( pym->key && pym->key == key && pym->qual == qual ) {
+ return BPY_menu_invoke( pym, menutype );
+ }
+ pym = pym->next;
+ }
+
+ return 0;
+}
+
+/****************************************************************************
+* Description: This function executes the script described by a menu item.
+*****************************************************************************/
+int BPY_menu_invoke( BPyMenu *pym, short menutype )
+{
+ char *argstr = NULL;
BPySubMenu *pysm;
char scriptname[21];
Script *script = NULL;
@@ -974,8 +1002,6 @@ int BPY_menu_do_python( short menutype, int event )
PyGILState_STATE gilstate;
char filestr[FILE_MAX];
- pym = BPyMenu_GetEntry( menutype, ( short ) event );
-
if( !pym )
return 0;
@@ -1059,6 +1085,7 @@ int BPY_menu_do_python( short menutype, int event )
case PYMENU_RENDER:
case PYMENU_WIZARDS:
case PYMENU_SCRIPTTEMPLATE:
+ case PYMENU_TEXTPLUGIN:
case PYMENU_MESHFACEKEY:
break;
@@ -1104,12 +1131,10 @@ int BPY_menu_do_python( short menutype, int event )
*****************************************************************************/
void BPY_free_compiled_text( struct Text *text )
{
- if( !text->compiled )
- return;
- Py_DECREF( ( PyObject * ) text->compiled );
- text->compiled = NULL;
-
- return;
+ if( text->compiled ) {
+ Py_DECREF( ( PyObject * ) text->compiled );
+ text->compiled = NULL;
+ }
}
/*****************************************************************************
@@ -2722,8 +2747,7 @@ PyObject *RunPython( Text * text, PyObject * globaldict )
buf = txt_to_buf( text );
text->compiled =
- Py_CompileString( buf, GetName( text ),
- Py_file_input );
+ Py_CompileString( buf, text->id.name+2, Py_file_input );
MEM_freeN( buf );
@@ -2738,15 +2762,6 @@ PyObject *RunPython( Text * text, PyObject * globaldict )
}
/*****************************************************************************
-* Description: This function returns the value of the name field of the
-* given Text struct.
-*****************************************************************************/
-char *GetName( Text * text )
-{
- return ( text->id.name + 2 );
-}
-
-/*****************************************************************************
* Description: This function creates a new Python dictionary object.
*****************************************************************************/
PyObject *CreateGlobalDictionary( void )
@@ -2790,49 +2805,38 @@ void DoAllScriptsFromList( ListBase * list, short event )
return;
}
-PyObject *importText( char *name )
+static PyObject *importText( char *name )
{
Text *text;
- char *txtname;
+ char txtname[22]; /* 21+NULL */
char *buf = NULL;
int namelen = strlen( name );
-
- txtname = malloc( namelen + 3 + 1 );
- if( !txtname )
- return NULL;
-
+
+ if (namelen>21-3) return NULL; /* we know this cant be importable, the name is too long for blender! */
+
memcpy( txtname, name, namelen );
memcpy( &txtname[namelen], ".py", 4 );
- text = ( Text * ) & ( G.main->text.first );
-
- while( text ) {
- if( !strcmp( txtname, GetName( text ) ) )
+ for(text = G.main->text.first; text; text = text->id.next) {
+ if( !strcmp( txtname, text->id.name+2 ) )
break;
- text = text->id.next;
}
- if( !text ) {
- free( txtname );
+ if( !text )
return NULL;
- }
if( !text->compiled ) {
buf = txt_to_buf( text );
- text->compiled =
- Py_CompileString( buf, GetName( text ),
- Py_file_input );
+ text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input );
MEM_freeN( buf );
if( PyErr_Occurred( ) ) {
PyErr_Print( );
BPY_free_compiled_text( text );
- free( txtname );
return NULL;
}
}
- free( txtname );
return PyImport_ExecCodeModule( name, text->compiled );
}
@@ -2903,7 +2907,7 @@ static PyObject *reimportText( PyObject *module )
/* look up the text object */
text = ( Text * ) & ( G.main->text.first );
while( text ) {
- if( !strcmp( txtname, GetName( text ) ) )
+ if( !strcmp( txtname, text->id.name+2 ) )
break;
text = text->id.next;
}
@@ -2920,8 +2924,7 @@ static PyObject *reimportText( PyObject *module )
/* compile the buffer */
buf = txt_to_buf( text );
- text->compiled = Py_CompileString( buf, GetName( text ),
- Py_file_input );
+ text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input );
MEM_freeN( buf );
/* if compile failed.... return this error */
diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c
index 82da9edbee6..69b50e5c47a 100644
--- a/source/blender/python/BPY_menus.c
+++ b/source/blender/python/BPY_menus.c
@@ -42,6 +42,7 @@
#endif
#include "BKE_global.h"
#include "BKE_utildefines.h"
+#include "BIF_keyval.h"
#include "BLI_blenlib.h"
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h" /* for U.pythondir */
@@ -106,6 +107,8 @@ static int bpymenu_group_atoi( char *str )
return PYMENU_ARMATURE;
else if( !strcmp( str, "ScriptTemplate" ) )
return PYMENU_SCRIPTTEMPLATE;
+ else if( !strcmp( str, "TextPlugin" ) )
+ return PYMENU_TEXTPLUGIN;
else if( !strcmp( str, "MeshFaceKey" ) )
return PYMENU_MESHFACEKEY;
else if( !strcmp( str, "AddMesh" ) )
@@ -184,6 +187,9 @@ char *BPyMenu_group_itoa( short menugroup )
case PYMENU_SCRIPTTEMPLATE:
return "ScriptTemplate";
break;
+ case PYMENU_TEXTPLUGIN:
+ return "TextPlugin";
+ break;
case PYMENU_MESHFACEKEY:
return "MeshFaceKey";
break;
@@ -328,6 +334,23 @@ static void bpymenu_set_tooltip( BPyMenu * pymenu, char *tip )
return;
}
+static void bpymenu_set_shortcut( BPyMenu * pymenu, char *combi )
+{
+ unsigned short key, qual;
+
+ if( !pymenu )
+ return;
+
+ if (!decode_key_string(combi, &key, &qual)) {
+ return; /* TODO: Print some error */
+ }
+
+ pymenu->key = key;
+ pymenu->qual = qual;
+
+ return;
+}
+
/* bpymenu_AddEntry:
* try to find an existing pymenu entry with the given type and name;
* if found, update it with new info, otherwise create a new one and fill it.
@@ -688,6 +711,7 @@ void BPyMenu_PrintAllEntries( void )
* # Blender: <code>short int</code> (minimal Blender version)
* # Group: 'group name' (defines menu)
* # Submenu: 'submenu name' related_1word_arg
+ * # Shortcut: Modifier+Key (optional shortcut combination for supported groups)
* # Tooltip: 'tooltip for the menu'
* # \"\"\"
*
@@ -796,13 +820,19 @@ static int bpymenu_ParseFile(FILE *file, char *fname, int is_userdir)
if ((matches == 3) && (strstr(head, "Submenu:") != NULL)) {
bpymenu_AddSubEntry(scriptMenu, middle, tail);
} else {
- /* Tooltip: 'tooltip for the menu */
+ /* Shortcut: 'key+combination' */
matches = sscanf(line, "%[^']'%[^']'%c", head, middle, tail);
- if ((matches == 3) && ((strstr(head, "Tooltip:") != NULL) ||
- (strstr(head, "Tip:") != NULL))) {
- bpymenu_set_tooltip(scriptMenu, middle);
+ if ((matches == 3) && (strstr(head, "Shortcut:") != NULL)) {
+ bpymenu_set_shortcut(scriptMenu, middle);
+ } else {
+ /* Tooltip: 'tooltip for the menu */
+ matches = sscanf(line, "%[^']'%[^']'%c", head, middle, tail);
+ if ((matches == 3) && ((strstr(head, "Tooltip:") != NULL) ||
+ (strstr(head, "Tip:") != NULL))) {
+ bpymenu_set_tooltip(scriptMenu, middle);
+ }
+ parser_state = 0;
}
- parser_state = 0;
}
break;
diff --git a/source/blender/python/BPY_menus.h b/source/blender/python/BPY_menus.h
index 1b557f79286..576d7b8dcd6 100644
--- a/source/blender/python/BPY_menus.h
+++ b/source/blender/python/BPY_menus.h
@@ -59,6 +59,7 @@ typedef struct BPyMenu {
char *name;
char *filename;
char *tooltip;
+ unsigned short key, qual; /* Registered shortcut key */
short version; /* Blender version */
int dir; /* 0: default, 1: U.pythondir */
struct BPySubMenu *submenus;
@@ -99,6 +100,7 @@ typedef enum {
PYMENU_UVCALCULATION,
PYMENU_ARMATURE,
PYMENU_SCRIPTTEMPLATE,
+ PYMENU_TEXTPLUGIN,
PYMENU_HELP,/*Main Help menu items - prob best to leave for 'official' ones*/
PYMENU_HELPSYSTEM,/* Resources, troubleshooting, system tools */
PYMENU_HELPWEBSITES,/* Help -> Websites submenu */
diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt
index 0106ab77843..63a1e67236e 100644
--- a/source/blender/python/CMakeLists.txt
+++ b/source/blender/python/CMakeLists.txt
@@ -34,7 +34,7 @@ SET(INC
api2_2x ../blenkernel ../blenlib ../blenloader
../render/extern/include ../radiosity/extern/include
../makesdna ../../../intern/guardedalloc ../../../intern/bmfont ../imbuf ../include
- ${PYTHON_INC}
+ ${PYTHON_INC} ../../../extern/glew/include ../gpu
)
IF(WITH_QUICKTIME)
@@ -50,5 +50,9 @@ IF(WITH_FFMPEG)
ADD_DEFINITIONS(-DWITH_FFMPEG)
ENDIF(WITH_FFMPEG)
+IF(BF_BUILDINFO)
+ ADD_DEFINITIONS(-DNAN_BUILDINFO)
+ENDIF(BF_BUILDINFO)
+
BLENDERLIB_NOLIST(blender_python "${SRC}" "${INC}")
#env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] )
diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript
index 8612a9d6ca9..cb33f8437f1 100644
--- a/source/blender/python/SConscript
+++ b/source/blender/python/SConscript
@@ -6,6 +6,7 @@ sources = Split('BPY_interface.c BPY_menus.c') + env.Glob('api2_2x/*.c')
incs = 'api2_2x ../blenkernel ../nodes ../blenlib ../blenloader'
incs += ' ../render/extern/include ../radiosity/extern/include ../freestyle/intern/python'
incs += ' ../makesdna #intern/guardedalloc #intern/bmfont ../imbuf ../include'
+incs += ' #extern/glew/include ../gpu'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_OPENGL_INC']
@@ -23,4 +24,7 @@ if env['WITH_BF_OPENEXR'] == 1:
if env['WITH_BF_FFMPEG'] == 1:
defs.append('WITH_FFMPEG')
+if env['BF_BUILDINFO'] == 1:
+ defs.append('NAN_BUILDINFO')
+
env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] )
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index e9dff098773..0db87c00dd2 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -1469,6 +1469,8 @@ PyObject *Armature_Init(void)
PyConstant_NewInt("BONE_SELECTED", BONE_SELECTED));
PyModule_AddObject(module, "TIP_SELECTED",
PyConstant_NewInt("TIP_SELECTED", BONE_TIPSEL));
+ PyModule_AddObject(module, "LOCKED_EDIT",
+ PyConstant_NewInt("LOCKED_EDIT", BONE_EDITMODE_LOCKED));
PyModule_AddObject(module, "OCTAHEDRON",
PyConstant_NewInt("OCTAHEDRON", ARM_OCTA));
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c
index 9d3d89a660b..9527ac30b52 100644
--- a/source/blender/python/api2_2x/Blender.c
+++ b/source/blender/python/api2_2x/Blender.c
@@ -34,7 +34,7 @@ struct ID; /*keep me up here */
/* for open, close in Blender_Load */
#include <fcntl.h>
#include "BDR_editobject.h" /* exit_editmode() */
-#include "BDR_drawmesh.h" /* set_mipmap() */
+#include "GPU_draw.h" /* GPU_set_mipmap() */
#include "BIF_usiblender.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
@@ -316,8 +316,8 @@ static PyObject *Blender_Set( PyObject * self, PyObject * args )
else
U.gameflags |= USER_DISABLE_MIPMAP;
- set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
- }else
+ GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
+ } else
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
"value given is not a blender setting" ) );
Py_RETURN_NONE;
@@ -545,7 +545,21 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
} /* End 'quick hack' part. */
else if(StringEqual( str, "version" ))
ret = PyInt_FromLong( G.version );
-
+ else if(StringEqual( str, "buildinfo" )) {
+#ifdef NAN_BUILDINFO
+ char buffer[1024];
+ extern char * build_date;
+ extern char * build_time;
+ extern char * build_rev;
+ extern char * build_platform;
+ extern char * build_type;
+
+ sprintf(buffer, "Built on %s %s, Rev-%s Version %s %s", build_date, build_time, build_rev, build_platform, build_type);
+ ret = PyString_FromString( buffer );
+#else
+ ret = PyString_FromString( "No Build Info" );
+#endif
+ }
else if(StringEqual( str, "compressfile" ))
ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15 );
else if(StringEqual( str, "mipmap" ))
@@ -1076,7 +1090,7 @@ void M_Blender_Init(void)
PyDict_SetItemString(dict, "Material", Material_Init());
PyDict_SetItemString(dict, "Mesh", Mesh_Init());
PyDict_SetItemString(dict, "Metaball", Metaball_Init());
- PyDict_SetItemString(dict, "Mathutils", Mathutils_Init());
+ PyDict_SetItemString(dict, "Mathutils", Mathutils_Init("Blender.Mathutils"));
PyDict_SetItemString(dict, "Geometry", Geometry_Init());
PyDict_SetItemString(dict, "Modifier", Modifier_Init());
PyDict_SetItemString(dict, "NMesh", NMesh_Init());
diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c
index 84faf416c5f..948eb007803 100644
--- a/source/blender/python/api2_2x/Bone.c
+++ b/source/blender/python/api2_2x/Bone.c
@@ -368,6 +368,10 @@ static PyObject *EditBone_getOptions(BPy_EditBone *self, void *closure)
if (PyList_Append(list,
EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1)
goto RuntimeError;
+ if(self->editbone->flag & BONE_EDITMODE_LOCKED)
+ if (PyList_Append(list,
+ EXPP_GetModuleConstant("Blender.Armature", "LOCKED_EDIT")) == -1)
+ goto RuntimeError;
}else{
if(self->flag & BONE_CONNECTED)
if (PyList_Append(list,
@@ -401,6 +405,10 @@ static PyObject *EditBone_getOptions(BPy_EditBone *self, void *closure)
if (PyList_Append(list,
EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1)
goto RuntimeError;
+ if(self->flag & BONE_EDITMODE_LOCKED)
+ if (PyList_Append(list,
+ EXPP_GetModuleConstant("Blender.Armature", "LOCKED_EDIT")) == -1)
+ goto RuntimeError;
}
return list;
@@ -422,7 +430,7 @@ static int EditBone_CheckValidConstant(PyObject *constant)
return 0;
if (!STREQ3(PyString_AsString(name), "CONNECTED", "HINGE", "NO_DEFORM") &&
!STREQ3(PyString_AsString(name), "ROOT_SELECTED", "BONE_SELECTED", "TIP_SELECTED") &&
- !STREQ2(PyString_AsString(name), "MULTIPLY", "HIDDEN_EDIT"))
+ !STREQ3(PyString_AsString(name), "MULTIPLY", "HIDDEN_EDIT", "LOCKED_EDIT"))
return 0;
else
return 1;
diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c
index 8db6a49465e..a62a5ee7ed8 100644
--- a/source/blender/python/api2_2x/Constraint.c
+++ b/source/blender/python/api2_2x/Constraint.c
@@ -29,6 +29,7 @@
#include "Constraint.h" /*This must come first*/
+#include "DNA_armature_types.h"
#include "DNA_object_types.h"
#include "DNA_effect_types.h"
#include "DNA_vec_types.h"
@@ -43,6 +44,7 @@
#include "BKE_constraint.h"
#include "BLI_blenlib.h"
#include "BIF_editconstraint.h"
+#include "BIF_poseobject.h"
#include "BSE_editipo.h"
#include "MEM_guardedalloc.h"
#include "butspace.h"
@@ -2286,19 +2288,32 @@ static PyObject *ConstraintSeq_moveDown( BPy_ConstraintSeq *self, BPy_Constraint
static PyObject *ConstraintSeq_remove( BPy_ConstraintSeq *self, BPy_Constraint *value )
{
- bConstraint *con = locate_constr( self, value );
+ bConstraint *con = locate_constr(self, value);
+ bPoseChannel *active= NULL;
/* if we can't locate the constraint, return (exception already set) */
- if( !con )
+ if (!con)
return (PyObject *)NULL;
- /* do the actual removal */
- if( self->pchan )
- BLI_remlink( &self->pchan->constraints, con );
- else
- BLI_remlink( &self->obj->constraints, con);
+ /* check if we need to set temporary 'active' flag for pchan */
+ if (self->pchan) {
+ active= get_active_posechannel(self->obj);
+
+ if (active != self->pchan) {
+ if (active) active->bone->flag &= ~BONE_ACTIVE;
+ self->pchan->bone->flag |= BONE_ACTIVE;
+ }
+ }
+
+ /* del_constr_func() frees constraint + its data */
del_constr_func( self->obj, con );
+ /* reset active pchan (if applicable) */
+ if (self->pchan && self->pchan!=active) {
+ if (active) active->bone->flag |= BONE_ACTIVE;
+ self->pchan->bone->flag &= ~BONE_ACTIVE;
+ }
+
/* erase the link to the constraint */
value->con = NULL;
diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c
index 047a035fb8b..bd19a6a6a3e 100644
--- a/source/blender/python/api2_2x/Draw.c
+++ b/source/blender/python/api2_2x/Draw.c
@@ -1554,6 +1554,12 @@ static PyObject *Method_Number( PyObject * self, PyObject * args )
UI_METHOD_ERRORCHECK;
+ if ( !PyNumber_Check(inio) || !PyNumber_Check(mino) ||
+ !PyNumber_Check(maxo) ) {
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected ints or floats for the initial, min and max values" );
+ }
+
but = newbutton( );
if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
block = Get_uiBlock( );
diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c
index 3e7f02c3797..3152d3a973f 100644
--- a/source/blender/python/api2_2x/Group.c
+++ b/source/blender/python/api2_2x/Group.c
@@ -46,6 +46,8 @@
#include "gen_utils.h"
#include "gen_library.h"
+#include "vector.h"
+
/* checks for the group being removed */
#define GROUP_DEL_CHECK_PY(bpy_group) if (!(bpy_group->group)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Group has been removed" ) )
#define GROUP_DEL_CHECK_INT(bpy_group) if (!(bpy_group->group)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Group has been removed" ) )
@@ -200,6 +202,31 @@ static int Group_setObjects( BPy_Group * self, PyObject * args )
return 0;
}
+static PyObject *Group_getDupliOfs( BPy_Group * self )
+{
+ GROUP_DEL_CHECK_PY(self);
+ return newVectorObject( self->group->dupli_ofs, 3, Py_WRAP );
+}
+
+static int Group_setDupliOfs( BPy_Group * self, PyObject * value )
+{
+ VectorObject *bpy_vec;
+ GROUP_DEL_CHECK_INT(self);
+ if (!VectorObject_Check(value))
+ return ( EXPP_ReturnIntError( PyExc_TypeError,
+ "expected a vector" ) );
+
+ bpy_vec = (VectorObject *)value;
+
+ if (bpy_vec->size != 3)
+ return ( EXPP_ReturnIntError( PyExc_ValueError,
+ "can only assign a 3D vector" ) );
+
+ self->group->dupli_ofs[0] = bpy_vec->vec[0];
+ self->group->dupli_ofs[1] = bpy_vec->vec[1];
+ self->group->dupli_ofs[2] = bpy_vec->vec[2];
+ return 0;
+}
/*****************************************************************************/
@@ -251,6 +278,10 @@ static PyGetSetDef BPy_Group_getseters[] = {
(getter)Group_getObjects, (setter)Group_setObjects,
"objects in this group",
NULL},
+ {"dupliOffset",
+ (getter)Group_getDupliOfs, (setter)Group_setDupliOfs,
+ "offset to use when instancing this group as a DupliGroup",
+ NULL},
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
};
diff --git a/source/blender/python/api2_2x/IDProp.c b/source/blender/python/api2_2x/IDProp.c
index f60ebf8dee1..4a51619aec4 100644
--- a/source/blender/python/api2_2x/IDProp.c
+++ b/source/blender/python/api2_2x/IDProp.c
@@ -60,6 +60,8 @@ PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
return PyInt_FromLong( (long)prop->data.val );
case IDP_FLOAT:
return PyFloat_FromDouble( (double)(*(float*)(&prop->data.val)) );
+ case IDP_DOUBLE:
+ return PyFloat_FromDouble( (*(double*)(&prop->data.val)) );
case IDP_GROUP:
/*blegh*/
{
@@ -128,7 +130,19 @@ int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
Py_XDECREF(value);
break;
}
-
+ case IDP_DOUBLE:
+ {
+ double dvalue;
+ if (!PyNumber_Check(value))
+ return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!");
+ value = PyNumber_Float(value);
+ if (!value)
+ return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!");
+ dvalue = (float) PyFloat_AsDouble(value);
+ *(double*)&self->prop->data.val = dvalue;
+ Py_XDECREF(value);
+ break;
+ }
default:
return EXPP_ReturnIntError(PyExc_AttributeError, "attempt to set read-only attribute!");
}
@@ -204,8 +218,8 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje
IDPropertyTemplate val = {0};
if (PyFloat_Check(ob)) {
- val.f = (float) PyFloat_AsDouble(ob);
- prop = IDP_New(IDP_FLOAT, val, name);
+ val.d = PyFloat_AsDouble(ob);
+ prop = IDP_New(IDP_DOUBLE, val, name);
} else if (PyInt_Check(ob)) {
val.i = (int) PyInt_AsLong(ob);
prop = IDP_New(IDP_INT, val, name);
@@ -223,7 +237,7 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje
val.array.len = PySequence_Length(ob);
for (i=0; i<val.array.len; i++) {
item = PySequence_GetItem(ob, i);
- if (PyFloat_Check(item)) val.array.type = IDP_FLOAT;
+ if (PyFloat_Check(item)) val.array.type = IDP_DOUBLE;
else if (!PyInt_Check(item)) return "only floats and ints are allowed in ID property arrays";
Py_XDECREF(item);
}
@@ -236,7 +250,7 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje
((int*)prop->data.pointer)[i] = (int)PyInt_AsLong(item);
} else {
item = PyNumber_Float(item);
- ((float*)prop->data.pointer)[i] = (float)PyFloat_AsDouble(item);
+ ((double*)prop->data.pointer)[i] = (float)PyFloat_AsDouble(item);
}
Py_XDECREF(item);
}
@@ -334,6 +348,9 @@ PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
case IDP_FLOAT:
return PyFloat_FromDouble(*((float*)&prop->data.val));
break;
+ case IDP_DOUBLE:
+ return PyFloat_FromDouble(*((double*)&prop->data.val));
+ break;
case IDP_INT:
return PyInt_FromLong( (long)prop->data.val );
break;
@@ -347,12 +364,15 @@ PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
"PyList_New() failed" );
for (i=0; i<prop->len; i++) {
- if (prop->subtype == IDP_FLOAT)
+ if (prop->subtype == IDP_FLOAT) {
PyList_SetItem(seq, i,
PyFloat_FromDouble(((float*)prop->data.pointer)[i]));
-
- else PyList_SetItem(seq, i,
- PyInt_FromLong(((int*)prop->data.pointer)[i]));
+ } else if (prop->subtype == IDP_DOUBLE) {
+ PyList_SetItem(seq, i,
+ PyFloat_FromDouble(((double*)prop->data.pointer)[i]));
+ } else { PyList_SetItem(seq, i,
+ PyInt_FromLong(((int*)prop->data.pointer)[i]));
+ }
}
return seq;
}
@@ -451,7 +471,7 @@ PyObject *BPy_IDGroup_GetKeys(BPy_IDProperty *self)
/*set correct group length*/
self->prop->len = i;
- /*free the old list*/
+ /*free the list*/
Py_DECREF(seq);
/*call self again*/
@@ -688,6 +708,9 @@ PyObject *BPy_IDArray_GetItem(BPy_IDArray *self, int index)
case IDP_FLOAT:
return PyFloat_FromDouble( (double)(((float*)self->prop->data.pointer)[index]));
break;
+ case IDP_DOUBLE:
+ return PyFloat_FromDouble( (((double*)self->prop->data.pointer)[index]));
+ break;
case IDP_INT:
return PyInt_FromLong( (long)((int*)self->prop->data.pointer)[index] );
break;
@@ -700,7 +723,8 @@ int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *val)
{
int i;
float f;
-
+ double d;
+
if (index < 0 || index >= self->prop->len)
return EXPP_ReturnIntError( PyExc_RuntimeError,
"index out of range!");
@@ -717,6 +741,17 @@ int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *val)
((float*)self->prop->data.pointer)[index] = f;
Py_XDECREF(val);
break;
+ case IDP_DOUBLE:
+ if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected a float");
+ val = PyNumber_Float(val);
+ if (!val) return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected a float");
+
+ d = (double) PyFloat_AsDouble(val);
+ ((double*)self->prop->data.pointer)[index] = d;
+ Py_XDECREF(val);
+ break;
case IDP_INT:
if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError,
"expected an int");
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c
index 94da5a77170..5ef2cbadbdc 100644
--- a/source/blender/python/api2_2x/Image.c
+++ b/source/blender/python/api2_2x/Image.c
@@ -29,7 +29,6 @@
*/
#include "Image.h" /*This must come first */
-#include "BDR_drawmesh.h" /* free_realtime_image */
#include "BKE_main.h"
#include "BKE_global.h"
#include "BKE_library.h"
@@ -48,6 +47,7 @@
#include "BKE_icons.h"
#include "IMB_imbuf.h"
#include "IDProp.h"
+#include "GPU_draw.h"
/* used so we can get G.scene->r.cfra for getting the
current image frame, some images change frame if they are a sequence */
@@ -1003,7 +1003,7 @@ static PyObject *Image_glFree( BPy_Image * self )
{
Image *image = self->image;
- free_realtime_image( image );
+ GPU_free_image( image );
/* remove the nocollect flag, image is available for garbage collection again */
image->flag &= ~IMA_NOCOLLECT;
Py_RETURN_NONE;
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c
index 53d25a6429d..2e58cb71b90 100644
--- a/source/blender/python/api2_2x/Lamp.c
+++ b/source/blender/python/api2_2x/Lamp.c
@@ -84,6 +84,8 @@
#define EXPP_LAMP_MODE_NODIFFUSE 2048
#define EXPP_LAMP_MODE_NOSPECULAR 4096
#define EXPP_LAMP_MODE_SHAD_RAY 8192
+#define EXPP_LAMP_MODE_LAYER_SHADOW 32768
+
/* Lamp MIN, MAX values */
#define EXPP_LAMP_SAMPLES_MIN 1
@@ -780,6 +782,8 @@ static PyObject *Lamp_ModesDict( void )
PyInt_FromLong( EXPP_LAMP_MODE_NOSPECULAR ) );
PyConstant_Insert( c, "RayShadow",
PyInt_FromLong( EXPP_LAMP_MODE_SHAD_RAY ) );
+ PyConstant_Insert( c, "LayerShadow",
+ PyInt_FromLong( EXPP_LAMP_MODE_LAYER_SHADOW ) );
}
return Modes;
@@ -1011,8 +1015,8 @@ static int Lamp_setType( BPy_Lamp * self, PyObject * value )
static int Lamp_setMode( BPy_Lamp * self, PyObject * value )
{
- short param;
- static short bitmask = EXPP_LAMP_MODE_SHADOWS
+ int param;
+ static int bitmask = EXPP_LAMP_MODE_SHADOWS
| EXPP_LAMP_MODE_HALO
| EXPP_LAMP_MODE_LAYER
| EXPP_LAMP_MODE_QUAD
@@ -1022,14 +1026,15 @@ static int Lamp_setMode( BPy_Lamp * self, PyObject * value )
| EXPP_LAMP_MODE_SQUARE
| EXPP_LAMP_MODE_NODIFFUSE
| EXPP_LAMP_MODE_NOSPECULAR
- | EXPP_LAMP_MODE_SHAD_RAY;
+ | EXPP_LAMP_MODE_SHAD_RAY
+ | EXPP_LAMP_MODE_LAYER_SHADOW;
if( !PyInt_Check ( value ) ) {
char errstr[128];
sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
return EXPP_ReturnIntError( PyExc_TypeError, errstr );
}
- param = (short)PyInt_AS_LONG ( value );
+ param = PyInt_AS_LONG ( value );
if ( ( param & bitmask ) != param )
return EXPP_ReturnIntError( PyExc_ValueError,
@@ -1373,7 +1378,8 @@ static PyObject *Lamp_getModesConst( void )
EXPP_LAMP_MODE_SQUARE, "NoDiffuse",
EXPP_LAMP_MODE_NODIFFUSE, "NoSpecular",
EXPP_LAMP_MODE_NOSPECULAR, "RayShadow",
- EXPP_LAMP_MODE_SHAD_RAY);
+ EXPP_LAMP_MODE_SHAD_RAY, "LayerShadow",
+ EXPP_LAMP_MODE_LAYER_SHADOW);
}
static PyObject *Lamp_getTypesConst( void )
@@ -1597,6 +1603,8 @@ static PyObject *Lamp_oldsetMode( BPy_Lamp * self, PyObject * args )
flag |= ( short ) EXPP_LAMP_MODE_NOSPECULAR;
else if( !strcmp( name, "RayShadow" ) )
flag |= ( short ) EXPP_LAMP_MODE_SHAD_RAY;
+ else if( !strcmp( name, "LayerShadow" ) )
+ flag |= ( short ) EXPP_LAMP_MODE_LAYER_SHADOW;
else
return EXPP_ReturnPyObjError( PyExc_AttributeError,
"unknown lamp flag argument" );
diff --git a/source/blender/python/api2_2x/MTex.c b/source/blender/python/api2_2x/MTex.c
index b9a8f7fff65..a95836f0596 100644
--- a/source/blender/python/api2_2x/MTex.c
+++ b/source/blender/python/api2_2x/MTex.c
@@ -677,7 +677,7 @@ static int MTex_setMapping( BPy_MTex *self, PyObject *value, void *closure)
static PyObject *MTex_getFlag( BPy_MTex *self, void *closure )
{
- return PyBool_FromLong( self->mtex->texflag & ((int) closure) );
+ return PyBool_FromLong( self->mtex->texflag & (GET_INT_FROM_POINTER(closure)) );
}
static int MTex_setFlag( BPy_MTex *self, PyObject *value, void *closure)
@@ -687,9 +687,9 @@ static int MTex_setFlag( BPy_MTex *self, PyObject *value, void *closure)
"expected a bool");
if ( value == Py_True )
- self->mtex->texflag |= (int)closure;
+ self->mtex->texflag |= GET_INT_FROM_POINTER(closure);
else
- self->mtex->texflag &= ~((int) closure);
+ self->mtex->texflag &= ~(GET_INT_FROM_POINTER(closure));
return 0;
}
@@ -774,7 +774,7 @@ static int MTex_setProjZ( BPy_MTex *self, PyObject *value, void *closure)
static PyObject *MTex_getMapToFlag( BPy_MTex *self, void *closure )
{
- int flag = (int) closure;
+ int flag = GET_INT_FROM_POINTER(closure);
if ( self->mtex->mapto & flag )
{
@@ -786,7 +786,7 @@ static PyObject *MTex_getMapToFlag( BPy_MTex *self, void *closure )
static int MTex_setMapToFlag( BPy_MTex *self, PyObject *value, void *closure)
{
- int flag = (int) closure;
+ int flag = GET_INT_FROM_POINTER(closure);
int intVal;
if ( !PyInt_Check( value ) )
diff --git a/source/blender/python/api2_2x/Makefile b/source/blender/python/api2_2x/Makefile
index 7c831952042..a2b77bf8c98 100644
--- a/source/blender/python/api2_2x/Makefile
+++ b/source/blender/python/api2_2x/Makefile
@@ -37,6 +37,10 @@ include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
+ifdef NAN_BUILDINFO
+ CPPFLAGS += -DNAN_BUILDINFO
+endif
+
ifeq ($(WITH_FFMPEG), true)
CPPFLAGS += -DWITH_FFMPEG
endif
@@ -45,6 +49,7 @@ ifeq ($(WITH_OPENEXR),true)
CPPFLAGS += -DWITH_OPENEXR
endif
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../makesdna
@@ -52,6 +57,7 @@ CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../include
+CPPFLAGS += -I../../gpu
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../radiosity/extern/include
CPPFLAGS += -I$(NAN_BMFONT)/include
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c
index c36213950b0..54c2d9b20bd 100644
--- a/source/blender/python/api2_2x/Material.c
+++ b/source/blender/python/api2_2x/Material.c
@@ -131,11 +131,11 @@
#define EXPP_MAT_RAYMIRRGLOSS_MIN 0.0
#define EXPP_MAT_RAYMIRRGLOSS_MAX 1.0
#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MIN 0
-#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX 255
+#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX 1024
#define EXPP_MAT_RAYTRANSPGLOSS_MIN 0.0
#define EXPP_MAT_RAYTRANSPGLOSS_MAX 1.0
#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN 0
-#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 255
+#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 1024
#define EXPP_MAT_FILTER_MIN 0.0
#define EXPP_MAT_FILTER_MAX 1.0
#define EXPP_MAT_TRANSLUCENCY_MIN 0.0
@@ -554,6 +554,7 @@ static int Material_setSssTexScatter( BPy_Material * self, PyObject * value );
static int Material_setSssFront( BPy_Material * self, PyObject * value );
static int Material_setSssBack( BPy_Material * self, PyObject * value );
static int Material_setSssBack( BPy_Material * self, PyObject * value );
+static int Material_setTexChannel( BPy_Material * self, PyObject * value );
static PyObject *Material_getColorComponent( BPy_Material * self,
void * closure );
@@ -633,6 +634,7 @@ static PyObject *Material_getSssBack( BPy_Material * self );
static PyObject *Material_getFilter( BPy_Material * self );
static PyObject *Material_getTranslucency( BPy_Material * self );
static PyObject *Material_getTextures( BPy_Material * self );
+static PyObject *Material_getTexChannel( BPy_Material * self );
static PyObject *Material_clearIpo( BPy_Material * self );
static PyObject *Material_setTexture( BPy_Material * self, PyObject * args );
@@ -738,8 +740,10 @@ static PyMethodDef BPy_Material_methods[] = {
"() - Return fresnel power for refractions factor"},
{"getRayTransGloss", ( PyCFunction ) Material_getGlossTrans, METH_NOARGS,
"() - Return amount refraction glossiness"},
+ {"getRayTransGlossSamples", ( PyCFunction ) Material_getGlossTransSamples, METH_NOARGS,
+ "() - Return number of sampels for transparent glossiness"},
{"getRayMirrGlossSamples", ( PyCFunction ) Material_getGlossMirrSamples, METH_NOARGS,
- "() - Return amount mirror glossiness"},
+ "() - Return number of sampels for mirror glossiness"},
{"getFilter", ( PyCFunction ) Material_getFilter, METH_NOARGS,
"() - Return the amount of filtering when transparent raytrace is enabled"},
{"getTranslucency", ( PyCFunction ) Material_getTranslucency, METH_NOARGS,
@@ -847,8 +851,10 @@ static PyMethodDef BPy_Material_methods[] = {
"(f) - Set blend fac for mirror fresnel - [1.0, 5.0]"},
{"setRayTransGloss", ( PyCFunction ) Material_setGlossTrans, METH_VARARGS,
"(f) - Set amount refraction glossiness - [0.0, 1.0]"},
+ {"setRayTransGlossSamples", ( PyCFunction ) Material_setGlossTransSamples, METH_VARARGS,
+ "(i) - Set number transparent gloss samples - [1, 1024]"},
{"setRayMirrGlossSamples", ( PyCFunction ) Material_setGlossMirrSamples, METH_VARARGS,
- "(f) - Set amount mirror glossiness - [0.0, 1.0]"},
+ "(i) - Set number mirror gloss samples - [1, 1024]"},
{"setFilter", ( PyCFunction ) Matr_oldsetFilter, METH_VARARGS,
"(f) - Set the amount of filtering when transparent raytrace is enabled"},
{"setTranslucency", ( PyCFunction ) Matr_oldsetTranslucency, METH_VARARGS,
@@ -1136,7 +1142,11 @@ static PyGetSetDef BPy_Material_getseters[] = {
NULL},
{"lightGroup",
(getter)Material_getLightGroup, (setter)Material_setLightGroup,
- "Set the light group for this material",
+ "The light group for this material",
+ NULL},
+ {"enabledTextures",
+ (getter)Material_getTexChannel, (setter)Material_setTexChannel,
+ "Enabled texture channels for this material",
NULL},
{"R",
(getter)Material_getColorComponent, (setter)Material_setColorComponent,
@@ -1513,6 +1523,36 @@ static PyObject *Material_getLightGroup( BPy_Material * self )
return Group_CreatePyObject( self->material->group );
}
+static PyObject *Material_getTexChannel( BPy_Material * self )
+{
+ int i;
+ short mask = 1;
+ PyObject *list = PyList_New(0);
+ if( !list )
+ return EXPP_ReturnPyObjError( PyExc_MemoryError,
+ "PyList_New() failed" );
+
+ for( i = 0, mask = 1; i < MAX_MTEX ; ++i, mask <<= 1 ) {
+ if( self->material->mtex[i] && (mask & self->material->septex) == 0 ) {
+ PyObject * val = PyInt_FromLong(i);
+ if( !val ) {
+ Py_DECREF( list );
+ return EXPP_ReturnPyObjError( PyExc_MemoryError,
+ "PyInt_FromLong() failed" );
+ }
+ if( PyList_Append( list, val ) < 0 ) {
+ Py_DECREF( val );
+ Py_DECREF( list );
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "PyList_Append() failed" );
+ }
+ Py_DECREF( val );
+ }
+ }
+
+ return list;
+}
+
static PyObject *Material_getHaloSize( BPy_Material * self )
{
return PyFloat_FromDouble( ( double ) self->material->hasize );
@@ -1714,8 +1754,7 @@ static PyObject *Material_getTextures( BPy_Material * self )
}
/* turn the array into a tuple */
- tuple = Py_BuildValue( "NNNNNNNNNN", t[0], t[1], t[2], t[3],
- t[4], t[5], t[6], t[7], t[8], t[9] );
+ tuple = Py_BuildValue( "NNNNNNNNNNNNNNNNNN", t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15], t[16], t[17] );
if( !tuple )
return EXPP_ReturnPyObjError( PyExc_MemoryError,
"Material_getTextures: couldn't create PyTuple" );
@@ -1978,6 +2017,57 @@ static int Material_setLightGroup( BPy_Material * self, PyObject * value )
return GenericLib_assignData(value, (void **) &self->material->group, NULL, 1, ID_GR, 0);
}
+static int Material_setTexChannel( BPy_Material * self, PyObject * value )
+{
+ int i, mask;
+ short septex = 0;
+ int result = 1;
+
+ /* fail if input is not a standard sequence */
+ if( !PyList_Check( value ) && !PyTuple_Check( value ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected tuple or list of integers" );
+
+ /* get a fast sequence; in Python 2.5, this just return the original
+ * list or tuple and INCREFs it, so we must DECREF */
+ value = PySequence_Fast( value, "" );
+
+ /* set the disable bit for each existing texture */
+ for( i= 0, mask= 1; i < MAX_MTEX; ++i, mask <<= 1 )
+ if( self->material->mtex[i] != NULL )
+ septex |= mask;
+
+ /* check the list, and build new septex value */
+ for( i= PySequence_Size(value)-1; i >= 0; --i ) {
+ long ival;
+ PyObject *item = PySequence_Fast_GET_ITEM( value, i );
+ if( !PyInt_Check( item ) ) {
+ PyErr_SetString ( PyExc_TypeError,
+ "expected tuple or list of integers" );
+ goto exit;
+ }
+ ival= PyInt_AsLong( item );
+ if(ival < 0 || ival > MAX_MTEX) {
+ PyErr_SetString( PyExc_ValueError,
+ "channel value out of range" );
+ goto exit;
+ }
+ ival&= (1<<MAX_MTEX)-1;
+ if( self->material->mtex[(int)ival] == NULL ) {
+ PyErr_SetString( PyExc_ValueError,
+ "channels must have a texture assigned" );
+ goto exit;
+ }
+ septex&= ~(1<<ival);
+ }
+ self->material->septex= septex;
+ result = 0;
+
+exit:
+ Py_DECREF(value);
+ return result;
+}
+
static int Material_setAdd( BPy_Material * self, PyObject * value )
{
return EXPP_setFloatClamped ( value, &self->material->add,
@@ -2309,9 +2399,6 @@ static int Material_setSssBack( BPy_Material * self, PyObject * value )
EXPP_MAT_SSS_BACK_MAX);
}
-
-
-
static PyObject *Material_setTexture( BPy_Material * self, PyObject * args )
{
int texnum;
diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c
index 85c56a61628..f0b51285376 100644
--- a/source/blender/python/api2_2x/Mathutils.c
+++ b/source/blender/python/api2_2x/Mathutils.c
@@ -106,8 +106,9 @@ struct PyMethodDef M_Mathutils_methods[] = {
{"Point", (PyCFunction) M_Mathutils_Point, METH_VARARGS, M_Mathutils_Point_doc},
{NULL, NULL, 0, NULL}
};
-//----------------------------MODULE INIT-------------------------
-PyObject *Mathutils_Init(void)
+/*----------------------------MODULE INIT-------------------------*/
+/* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */
+PyObject *Mathutils_Init(const char *from)
{
PyObject *submodule;
@@ -125,8 +126,7 @@ PyObject *Mathutils_Init(void)
if( PyType_Ready( &quaternion_Type ) < 0 )
return NULL;
- submodule = Py_InitModule3("Blender.Mathutils",
- M_Mathutils_methods, M_Mathutils_doc);
+ submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc);
return (submodule);
}
//-----------------------------METHODS----------------------------
diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h
index dd9aae2abed..0db83216178 100644
--- a/source/blender/python/api2_2x/Mathutils.h
+++ b/source/blender/python/api2_2x/Mathutils.h
@@ -38,7 +38,7 @@
#include "euler.h"
#include "point.h"
-PyObject *Mathutils_Init( void );
+PyObject *Mathutils_Init( const char * from );
PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat);
PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec);
PyObject *row_point_multiplication(PointObject* pt, MatrixObject * mat);
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c
index 9f68287d658..6471fb16e92 100644
--- a/source/blender/python/api2_2x/Mesh.c
+++ b/source/blender/python/api2_2x/Mesh.c
@@ -4163,6 +4163,7 @@ static int MFace_setMode( BPy_MFace *self, PyObject *value )
{
int param;
static short bitmask = TF_DYNAMIC
+ | TF_ALPHASORT
| TF_TEX
| TF_SHAREDVERT
| TF_LIGHT
@@ -5381,11 +5382,11 @@ static PyObject *MFaceSeq_delete( BPy_MFaceSeq * self, PyObject *args )
if( PySequence_Size( args ) != 2 ||
!PyArg_ParseTuple( args, "iO", &edge_also, &args ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected and int and a sequence of ints or MFaces" );
+ "expected an int and a sequence of ints or MFaces" );
if( !PyList_Check( args ) && !PyTuple_Check( args ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected and int and a sequence of ints or MFaces" );
+ "expected an int and a sequence of ints or MFaces" );
/* see how many args we need to parse */
len = PySequence_Size( args );
@@ -8696,11 +8697,11 @@ static PyObject *M_Mesh_FaceModesDict( void )
if( FM ) {
BPy_constant *d = ( BPy_constant * ) FM;
- PyConstant_Insert( d, "BILLBOARD",
- PyInt_FromLong( TF_BILLBOARD2 ) );
+ PyConstant_Insert( d, "BILLBOARD", PyInt_FromLong( TF_BILLBOARD2 ) );
PyConstant_Insert( d, "ALL", PyInt_FromLong( 0xffff ) );
PyConstant_Insert( d, "HALO", PyInt_FromLong( TF_BILLBOARD ) );
PyConstant_Insert( d, "DYNAMIC", PyInt_FromLong( TF_DYNAMIC ) );
+ PyConstant_Insert( d, "ALPHASORT", PyInt_FromLong( TF_ALPHASORT ) );
PyConstant_Insert( d, "INVISIBLE", PyInt_FromLong( TF_INVISIBLE ) );
PyConstant_Insert( d, "LIGHT", PyInt_FromLong( TF_LIGHT ) );
PyConstant_Insert( d, "OBCOL", PyInt_FromLong( TF_OBCOL ) );
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index 45cce46d389..dc70921492c 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -204,6 +204,7 @@ enum obj_consts {
EXPP_OBJ_ATTR_SB_INSPRING,
EXPP_OBJ_ATTR_SB_INFRICT,
+ EXPP_OBJ_ATTR_EMPTY_DRAWTYPE
};
#define EXPP_OBJECT_DRAWSIZEMIN 0.01f
@@ -2431,6 +2432,12 @@ static int Object_setDrawType( BPy_Object * self, PyObject * value )
OB_BOUNDBOX, OB_TEXTURE, 'b' );
}
+static int Object_setEmptyShape( BPy_Object * self, PyObject * value )
+{
+ return EXPP_setIValueRange( value, &self->object->empty_drawtype,
+ OB_ARROWS, OB_EMPTY_CONE, 'b' );
+}
+
static int Object_setEuler( BPy_Object * self, PyObject * args )
{
float rot1, rot2, rot3;
@@ -3758,6 +3765,9 @@ static PyObject *getIntAttr( BPy_Object *self, void *type )
case EXPP_OBJ_ATTR_DRAWTYPE:
param = object->dt;
break;
+ case EXPP_OBJ_ATTR_EMPTY_DRAWTYPE:
+ param = object->empty_drawtype;
+ break;
case EXPP_OBJ_ATTR_PARENT_TYPE:
param = object->partype;
break;
@@ -4938,6 +4948,10 @@ static PyGetSetDef BPy_Object_getseters[] = {
(getter)getIntAttr, (setter)Object_setDrawType,
"The object's drawing type",
(void *)EXPP_OBJ_ATTR_DRAWTYPE},
+ {"emptyShape",
+ (getter)getIntAttr, (setter)Object_setEmptyShape,
+ "The empty's drawing shape",
+ (void *)EXPP_OBJ_ATTR_EMPTY_DRAWTYPE},
{"parentType",
(getter)getIntAttr, (setter)NULL,
"The object's parent type",
@@ -5538,6 +5552,24 @@ static PyObject *M_Object_IpoKeyTypesDict( void )
return M;
}
+static PyObject *M_Object_EmptyShapesDict( void )
+{
+ PyObject *M = PyConstant_New( );
+
+ if( M ) {
+ BPy_constant *d = ( BPy_constant * ) M;
+ PyConstant_Insert( d, "ARROWS", PyInt_FromLong( OB_ARROWS ) );
+ PyConstant_Insert( d, "AXES", PyInt_FromLong( OB_PLAINAXES ) );
+ PyConstant_Insert( d, "CIRCLE", PyInt_FromLong( OB_CIRCLE ) );
+ PyConstant_Insert( d, "ARROW", PyInt_FromLong( OB_SINGLE_ARROW ) );
+ PyConstant_Insert( d, "CUBE", PyInt_FromLong( OB_CUBE ) );
+ PyConstant_Insert( d, "SPHERE", PyInt_FromLong( OB_EMPTY_SPHERE ) );
+ PyConstant_Insert( d, "CONE", PyInt_FromLong( OB_EMPTY_CONE ) );
+ }
+ return M;
+}
+
+
/*****************************************************************************/
/* Function: initObject */
/*****************************************************************************/
@@ -5552,6 +5584,7 @@ PyObject *Object_Init( void )
PyObject *RBFlagsDict = M_Object_RBFlagsDict( );
PyObject *RBShapesDict = M_Object_RBShapeBoundDict( );
PyObject *IpoKeyTypesDict = M_Object_IpoKeyTypesDict( );
+ PyObject *EmptyShapesDict = M_Object_EmptyShapesDict( );
PyType_Ready( &Object_Type ) ;
@@ -5596,7 +5629,9 @@ PyObject *Object_Init( void )
if( RBShapesDict )
PyModule_AddObject( module, "RBShapes", RBShapesDict );
if( IpoKeyTypesDict )
- PyModule_AddObject( module, "IpoKeyTypes", IpoKeyTypesDict );
+ PyModule_AddObject( module, "IpoKeyTypes", IpoKeyTypesDict );
+ if( EmptyShapesDict )
+ PyModule_AddObject( module, "EmptyShapes", EmptyShapesDict );
/*Add SUBMODULES to the module*/
dict = PyModule_GetDict( module ); /*borrowed*/
diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c
index 2c2e724129e..bc65426e16c 100644
--- a/source/blender/python/api2_2x/Particle.c
+++ b/source/blender/python/api2_2x/Particle.c
@@ -804,7 +804,7 @@ static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args )
{
ParticleSystem *psys = 0L;
Object *ob = 0L;
- PyObject *partlist,*seglist;
+ PyObject *partlist,*seglist=0L;
ParticleCacheKey **cache,*path;
PyObject* loc = 0L;
ParticleKey state;
@@ -1107,7 +1107,7 @@ static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args )
ParticleSystem *psys = 0L;
ParticleData *data;
Object *ob = 0L;
- PyObject *partlist,*tuple;
+ PyObject *partlist,*tuple=0L;
DerivedMesh* dm;
float vm[4][4],wm[4][4];
float size;
@@ -1217,7 +1217,7 @@ static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args )
ParticleSystem *psys = 0L;
ParticleData *data;
Object *ob = 0L;
- PyObject *partlist,*tuple;
+ PyObject *partlist,*tuple=0L;
DerivedMesh* dm;
float vm[4][4],wm[4][4];
float life;
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c
index 308ad094c7b..9719daaa3d4 100644
--- a/source/blender/python/api2_2x/Text.c
+++ b/source/blender/python/api2_2x/Text.c
@@ -34,9 +34,13 @@
#include "BKE_global.h"
#include "BKE_main.h"
#include "BIF_drawtext.h"
+#include "BIF_screen.h"
#include "BKE_text.h"
+#include "BKE_suggestions.h"
#include "BLI_blenlib.h"
+#include "DNA_screen_types.h"
#include "DNA_space_types.h"
+#include "MEM_guardedalloc.h"
#include "gen_utils.h"
#include "gen_library.h"
#include "../BPY_extern.h"
@@ -90,9 +94,20 @@ struct PyMethodDef M_Text_methods[] = {
static PyObject *Text_getFilename( BPy_Text * self );
static PyObject *Text_getNLines( BPy_Text * self );
static PyObject *Text_clear( BPy_Text * self );
+static PyObject *Text_reset( BPy_Text * self );
+static PyObject *Text_readline( BPy_Text * self );
static PyObject *Text_write( BPy_Text * self, PyObject * value );
+static PyObject *Text_insert( BPy_Text * self, PyObject * value );
+static PyObject *Text_delete( BPy_Text * self, PyObject * value );
static PyObject *Text_set( BPy_Text * self, PyObject * args );
-static PyObject *Text_asLines( BPy_Text * self );
+static PyObject *Text_asLines( BPy_Text * self, PyObject * args );
+static PyObject *Text_getCursorPos( BPy_Text * self );
+static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args );
+static PyObject *Text_getSelectPos( BPy_Text * self );
+static PyObject *Text_setSelectPos( BPy_Text * self, PyObject * args );
+static PyObject *Text_markSelection( BPy_Text * self, PyObject * args );
+static PyObject *Text_suggest( BPy_Text * self, PyObject * args );
+static PyObject *Text_showDocs( BPy_Text * self, PyObject * args );
/*****************************************************************************/
/* Python BPy_Text methods table: */
@@ -109,12 +124,34 @@ static PyMethodDef BPy_Text_methods[] = {
"(str) - Change Text Object name"},
{"clear", ( PyCFunction ) Text_clear, METH_NOARGS,
"() - Clear Text buffer"},
+ {"reset", ( PyCFunction ) Text_reset, METH_NOARGS,
+ "() - Moves the IO pointer back to the start of the Text buffer for reading"},
+ {"readline", ( PyCFunction ) Text_readline, METH_NOARGS,
+ "() - Reads a line of text from the buffer and returns it incrementing the internal IO pointer."},
{"write", ( PyCFunction ) Text_write, METH_O,
"(line) - Append string 'str' to Text buffer"},
+ {"insert", ( PyCFunction ) Text_insert, METH_O,
+ "(line) - Insert string 'str' to Text buffer at cursor location"},
+ {"delete", ( PyCFunction ) Text_delete, METH_O,
+ "(chars) - Deletes a number of characters to the left (chars<0) or right (chars>0)"},
{"set", ( PyCFunction ) Text_set, METH_VARARGS,
"(name, val) - Set attribute 'name' to value 'val'"},
- {"asLines", ( PyCFunction ) Text_asLines, METH_NOARGS,
- "() - Return text buffer as a list of lines"},
+ {"asLines", ( PyCFunction ) Text_asLines, METH_VARARGS,
+ "(start=0, end=nlines) - Return text buffer as a list of lines between start and end"},
+ {"getCursorPos", ( PyCFunction ) Text_getCursorPos, METH_NOARGS,
+ "() - Return cursor position as (row, col) tuple"},
+ {"setCursorPos", ( PyCFunction ) Text_setCursorPos, METH_VARARGS,
+ "(row, col) - Set the cursor position to (row, col)"},
+ {"getSelectPos", ( PyCFunction ) Text_getSelectPos, METH_NOARGS,
+ "() - Return the selection cursor position as (row, col) tuple"},
+ {"setSelectPos", ( PyCFunction ) Text_setSelectPos, METH_VARARGS,
+ "(row, col) - Set the selection cursor position to (row, col)"},
+ {"markSelection", ( PyCFunction ) Text_markSelection, METH_VARARGS,
+ "(group, (r, g, b), flags) - Places a marker over the current selection. Group: number > 0, flags: TMARK_TEMP, TMARK_EDITALL, etc."},
+ {"suggest", ( PyCFunction ) Text_suggest, METH_VARARGS,
+ "(list, prefix='') - Presents a list of suggestions. List is of strings, or tuples. Tuples must be of the form (name, type) where type is one of 'm', 'v', 'f', 'k' for module, variable, function and keyword respectively or '?' for other types"},
+ {"showDocs", ( PyCFunction ) Text_showDocs, METH_VARARGS,
+ "(docs) - Documentation string"},
{NULL, NULL, 0, NULL}
};
@@ -302,7 +339,7 @@ static PyObject *M_Text_unlink( PyObject * self, PyObject * args )
/*****************************************************************************/
PyObject *Text_Init( void )
{
- PyObject *submodule;
+ PyObject *submodule, *dict;
if( PyType_Ready( &Text_Type ) < 0 )
return NULL;
@@ -310,6 +347,19 @@ PyObject *Text_Init( void )
submodule =
Py_InitModule3( "Blender.Text", M_Text_methods, M_Text_doc );
+ dict = PyModule_GetDict( submodule );
+
+#define EXPP_ADDCONST(x) \
+ EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(x))
+
+ /* So, for example:
+ * EXPP_ADDCONST(LEFTMOUSE) becomes
+ * EXPP_dict_set_item_str(dict, "LEFTMOUSE", PyInt_FromLong(LEFTMOUSE))
+ */
+
+ EXPP_ADDCONST( TMARK_TEMP );
+ EXPP_ADDCONST( TMARK_EDITALL );
+
return ( submodule );
}
@@ -327,6 +377,8 @@ PyObject *Text_CreatePyObject( Text * txt )
"couldn't create BPy_Text PyObject" );
pytxt->text = txt;
+ pytxt->iol = NULL;
+ pytxt->ioc = -1;
return ( PyObject * ) pytxt;
}
@@ -376,23 +428,47 @@ static PyObject *Text_clear( BPy_Text * self)
Py_RETURN_NONE;
}
-static PyObject *Text_set( BPy_Text * self, PyObject * args )
+static PyObject *Text_reset( BPy_Text * self )
{
- int ival;
- char *attr;
+ self->iol = NULL;
+ self->ioc = -1;
- if( !PyArg_ParseTuple( args, "si", &attr, &ival ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string and an int as arguments" );
+ Py_RETURN_NONE;
+}
- if( strcmp( "follow_cursor", attr ) == 0 ) {
- if( ival )
- self->text->flags |= EXPP_TEXT_MODE_FOLLOW;
- else
- self->text->flags &= EXPP_TEXT_MODE_FOLLOW;
+static PyObject *Text_readline( BPy_Text * self )
+{
+ PyObject *tmpstr;
+
+ if( !self->text )
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object" );
+
+ /* Reset */
+ if (!self->iol && self->ioc == -1) {
+ self->iol = self->text->lines.first;
+ self->ioc = 0;
}
- Py_RETURN_NONE;
+ if (!self->iol) {
+ PyErr_SetString( PyExc_StopIteration, "End of buffer reached" );
+ return PyString_FromString( "" );
+ }
+
+ if (self->ioc > self->iol->len) {
+ self->iol = NULL;
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "Line length exceeded, text may have changed while reading" );
+ }
+
+ tmpstr = PyString_FromString( self->iol->line + self->ioc );
+ if (self->iol->next)
+ PyString_ConcatAndDel( &tmpstr, PyString_FromString("\n") );
+
+ self->iol = self->iol->next;
+ self->ioc = 0;
+
+ return tmpstr;
}
static PyObject *Text_write( BPy_Text * self, PyObject * value )
@@ -413,35 +489,324 @@ static PyObject *Text_write( BPy_Text * self, PyObject * value )
txt_move_eof( self->text, 0 );
txt_set_undostate( oldstate );
+ Text_reset( self );
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_insert( BPy_Text * self, PyObject * value )
+{
+ char *str = PyString_AsString(value);
+ int oldstate;
+
+ if( !self->text )
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object" );
+
+ if( !str )
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected string argument" );
+
+ oldstate = txt_get_undostate( );
+ txt_insert_buf( self->text, str );
+ txt_set_undostate( oldstate );
+
+ Text_reset( self );
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_delete( BPy_Text * self, PyObject * value )
+{
+ int num = PyInt_AsLong(value);
+ int oldstate;
+
+ if( !self->text )
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object" );
+
+ if( !num )
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected non-zero int argument" );
+
+ oldstate = txt_get_undostate( );
+ while (num<0) {
+ txt_backspace_char(self->text);
+ num++;
+ }
+ while (num>0) {
+ txt_delete_char(self->text);
+ num--;
+ }
+ txt_set_undostate( oldstate );
+
+ Text_reset( self );
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_set( BPy_Text * self, PyObject * args )
+{
+ int ival;
+ char *attr;
+
+ if( !PyArg_ParseTuple( args, "si", &attr, &ival ) )
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected a string and an int as arguments" );
+
+ if( strcmp( "follow_cursor", attr ) == 0 ) {
+ if( ival )
+ self->text->flags |= EXPP_TEXT_MODE_FOLLOW;
+ else
+ self->text->flags &= EXPP_TEXT_MODE_FOLLOW;
+ }
+
Py_RETURN_NONE;
}
-static PyObject *Text_asLines( BPy_Text * self )
+static PyObject *Text_asLines( BPy_Text * self, PyObject * args )
{
TextLine *line;
PyObject *list, *tmpstr;
+ int start=0, end=-1, i;
if( !self->text )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"This object isn't linked to a Blender Text Object" );
+ if( !PyArg_ParseTuple( args, "|ii", &start, &end ) )
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected upto two optional ints as arguments" );
+
+ if (start<0)
+ start=0;
+
line = self->text->lines.first;
+ for (i = 0; i < start && line->next; i++)
+ line= line->next;
+
list = PyList_New( 0 );
if( !list )
return EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't create PyList" );
- while( line ) {
+ while( line && (i < end || end == -1) ) {
tmpstr = PyString_FromString( line->line );
PyList_Append( list, tmpstr );
Py_DECREF(tmpstr);
line = line->next;
+ i++;
}
return list;
}
+static PyObject *Text_getCursorPos( BPy_Text * self )
+{
+ Text *text;
+ TextLine *linep;
+ int row, col;
+
+ text = self->text;
+ if( !text )
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object" );
+
+ for (row=0,linep=text->lines.first; linep!=text->curl; linep=linep->next)
+ row++;
+ col= text->curc;
+
+ return Py_BuildValue( "ii", row, col );
+}
+
+static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args )
+{
+ int row, col;
+ SpaceText *st;
+
+ if (!self->text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object");
+
+ if (!PyArg_ParseTuple(args, "ii", &row, &col))
+ return EXPP_ReturnPyObjError(PyExc_TypeError,
+ "expected two ints as arguments.");
+ if (row<0) row=0;
+ if (col<0) col=0;
+
+ txt_move_to(self->text, row, col, 0);
+
+ if (curarea->spacetype == SPACE_TEXT && (st=curarea->spacedata.first))
+ pop_space_text(st);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_getSelectPos( BPy_Text * self )
+{
+ Text *text;
+ TextLine *linep;
+ int row, col;
+
+ text = self->text;
+ if( !text )
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object" );
+
+ for (row=0,linep=text->lines.first; linep!=text->sell; linep=linep->next)
+ row++;
+ col= text->selc;
+
+ return Py_BuildValue( "ii", row, col );
+}
+
+static PyObject *Text_setSelectPos( BPy_Text * self, PyObject * args )
+{
+ int row, col;
+ SpaceText *st;
+
+ if (!self->text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object");
+
+ if (!PyArg_ParseTuple(args, "ii", &row, &col))
+ return EXPP_ReturnPyObjError(PyExc_TypeError,
+ "expected two ints as arguments.");
+ if (row<0) row=0;
+ if (col<0) col=0;
+
+ txt_move_to(self->text, row, col, 1);
+
+ if (curarea->spacetype == SPACE_TEXT && (st=curarea->spacedata.first))
+ pop_space_text(st);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_markSelection( BPy_Text * self, PyObject * args )
+{
+ int group = 0, flags = 0,r, g, b;
+ Text *text;
+ char color[4];
+
+ text = self->text;
+ if (!text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object");
+
+ if (!PyArg_ParseTuple(args, "i(iii)i", &group, &r, &g, &b, &flags))
+ return EXPP_ReturnPyObjError(PyExc_TypeError,
+ "expected int, 3-tuple of ints and int as arguments.");
+
+ if (text->curl != text->sell)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "Cannot mark multi-line selection.");
+
+ color[0] = (char) (r&0xFF);
+ color[1] = (char) (g&0xFF);
+ color[2] = (char) (b&0xFF);
+ color[3] = 255;
+
+ group &= 0xFFFF;
+
+ txt_add_marker(text, text->curl, text->curc, text->selc, color, group, flags);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_suggest( BPy_Text * self, PyObject * args )
+{
+ PyObject *item = NULL, *tup1 = NULL, *tup2 = NULL;
+ PyObject *list = NULL;
+ int list_len, i;
+ char *prefix = NULL, *name, type;
+ SpaceText *st;
+
+ if (!self->text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object");
+
+ /* Parse args for a list of strings/tuples */
+ if (!PyArg_ParseTuple(args, "O!|s", &PyList_Type, &list, &prefix))
+ return EXPP_ReturnPyObjError(PyExc_TypeError,
+ "expected list of strings or tuples followed by an optional string");
+
+ if (curarea->spacetype != SPACE_TEXT)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "Active space type is not text");
+
+ st = curarea->spacedata.first;
+ if (!st || !st->text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "Active text area has no Text object");
+
+ texttool_suggest_clear();
+ texttool_text_set_active(st->text);
+ list_len = PyList_Size(list);
+
+ for (i = 0; i < list_len; i++) {
+ item = PyList_GetItem(list, i);
+
+ if (PyString_Check(item)) {
+ name = PyString_AsString(item);
+ type = '?';
+ } else if (PyTuple_Check(item) && PyTuple_GET_SIZE(item) == 2) {
+ tup1 = PyTuple_GetItem(item, 0);
+ tup2 = PyTuple_GetItem(item, 1);
+ if (PyString_Check(tup1) && PyString_Check(tup2)) {
+ name = PyString_AsString(tup1);
+ type = PyString_AsString(tup2)[0];
+ } else
+ return EXPP_ReturnPyObjError(PyExc_AttributeError,
+ "list must contain tuples of two strings only: (name, type)" );
+ } else
+ return EXPP_ReturnPyObjError(PyExc_AttributeError,
+ "list must contain only individual strings or tuples of size 2" );
+
+ if (!strlen(name) || (type!='m' && type!='v' && type!='f' && type!='k' && type!='?'))
+ return EXPP_ReturnPyObjError(PyExc_AttributeError,
+ "names must be non-empty and types in ['m', 'v', 'f', 'k', '?']" );
+
+ texttool_suggest_add(name, type);
+ }
+ if (!prefix)
+ prefix = "";
+ texttool_suggest_prefix(prefix);
+ scrarea_queue_redraw(curarea);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *Text_showDocs( BPy_Text * self, PyObject * args )
+{
+ char *docs;
+ SpaceText *st;
+
+ if (!self->text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "This object isn't linked to a Blender Text Object");
+
+ if (!PyArg_ParseTuple(args, "s", &docs))
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected a string as argument" );
+
+ if (curarea->spacetype != SPACE_TEXT)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "Active space type is not text");
+
+ st = curarea->spacedata.first;
+ if (!st || !st->text)
+ return EXPP_ReturnPyObjError(PyExc_RuntimeError,
+ "Active text area has no Text object");
+
+ texttool_text_set_active(st->text);
+ texttool_docs_show(docs);
+ scrarea_queue_redraw(curarea);
+
+ Py_RETURN_NONE;
+}
+
/*****************************************************************************/
/* Function: Text_compare */
/* Description: This is a callback function for the BPy_Text type. It */
diff --git a/source/blender/python/api2_2x/Text.h b/source/blender/python/api2_2x/Text.h
index 0c5e2607f03..73943ddb9cd 100644
--- a/source/blender/python/api2_2x/Text.h
+++ b/source/blender/python/api2_2x/Text.h
@@ -41,6 +41,8 @@ extern PyTypeObject Text_Type;
typedef struct {
PyObject_HEAD
Text * text; /* libdata must be second */
+ TextLine * iol; /* current line being read or NULL if reset */
+ int ioc; /* character offset in line being read */
} BPy_Text;
PyObject *Text_Init( void );
diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c
index 5137e989b8d..202195cdcb4 100644
--- a/source/blender/python/api2_2x/Text3d.c
+++ b/source/blender/python/api2_2x/Text3d.c
@@ -132,9 +132,12 @@ static PyObject *Text3d_getAlignment( BPy_Text3d * self );
static PyObject *Text3d_setAlignment( BPy_Text3d * self, PyObject * args );
static PyObject *Text3d_getFont( BPy_Text3d * self );
static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args );
+static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value );
+static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args );
static PyObject *Text3d_addFrame( BPy_Text3d * self );
static PyObject *Text3d_removeFrame( BPy_Text3d * self, PyObject * args );
+
/*****************************************************************************/
/* Python BPy_Text3d methods table: */
/*****************************************************************************/
@@ -210,6 +213,10 @@ static PyMethodDef BPy_Text3d_methods[] = {
METH_NOARGS, "() - Gets font list for Text3d"},
{"setFont", ( PyCFunction ) Text3d_setFont,
METH_VARARGS, "() - Sets font for Text3d"},
+ {"getMaterial", ( PyCFunction ) Text3d_getMaterial,
+ METH_O, "() - Gets font list for Text3d"},
+ {"setMaterial", ( PyCFunction ) Text3d_setMaterial,
+ METH_VARARGS, "() - Sets font for Text3d"},
{"addFrame", ( PyCFunction ) Text3d_addFrame,
METH_NOARGS, "() - adds a new text frame"},
{"removeFrame", ( PyCFunction ) Text3d_removeFrame,
@@ -1132,6 +1139,45 @@ static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args )
Py_RETURN_NONE;
}
+/* todo, add style access, will be almost exact copy of these 2 */
+static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value )
+{
+ int index = PyInt_AsLong( value );
+ if (index == -1 && PyErr_Occurred())
+ return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a character index" );
+
+ if (index < 0)
+ index = self->curve->len + index;
+
+ if ( index < 0 || index >= self->curve->len )
+ return EXPP_ReturnPyObjError( PyExc_IndexError, "character index out of range" );
+
+ return PyInt_FromLong( self->curve->strinfo[index].mat_nr );
+}
+
+static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args )
+{
+ int index, mat_nr;
+ if( !PyArg_ParseTuple( args, "ii",&index, &mat_nr) )
+ return NULL; /* Python error is ok */
+
+ if (index < 0)
+ index = self->curve->len + index;
+
+ if ( index < 0 || index >= self->curve->len )
+ return EXPP_ReturnPyObjError( PyExc_IndexError, "character index out of range" );
+
+ if (mat_nr < 0)
+ mat_nr = self->curve->totcol + mat_nr;
+
+ if ( mat_nr < 0 || mat_nr >= self->curve->totcol )
+ return EXPP_ReturnPyObjError( PyExc_IndexError, "material index out of range" );
+
+ self->curve->strinfo[index].mat_nr = mat_nr;
+
+ Py_RETURN_NONE;
+}
+
static PyObject *Text3d_addFrame( BPy_Text3d * self )
{
Curve *cu = self->curve;
diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c
index 696c78f2bac..cc394801d88 100644
--- a/source/blender/python/api2_2x/Texture.c
+++ b/source/blender/python/api2_2x/Texture.c
@@ -105,6 +105,10 @@
#define EXPP_TEX_LACUNARITY_MAX 6.0f
#define EXPP_TEX_OCTS_MIN 0.0f
#define EXPP_TEX_OCTS_MAX 8.0f
+#define EXPP_TEX_OFST_MIN 0.0f
+#define EXPP_TEX_OFST_MAX 6.0f
+#define EXPP_TEX_GAIN_MIN 0.0f
+#define EXPP_TEX_GAIN_MAX 6.0f
#define EXPP_TEX_ISCALE_MIN 0.0f
#define EXPP_TEX_ISCALE_MAX 10.0f
#define EXPP_TEX_EXP_MIN 0.010f
@@ -430,6 +434,8 @@ GETFUNC( getNoiseDepth );
GETFUNC( getNoiseSize );
GETFUNC( getNoiseType );
GETFUNC( getOcts );
+GETFUNC( getOffset );
+GETFUNC( getGain );
GETFUNC( getRepeat );
GETFUNC( getRGBCol );
GETFUNC( getSType );
@@ -478,6 +484,8 @@ SETFUNC( setNoiseDepth );
SETFUNC( setNoiseSize );
SETFUNC( setNoiseType );
SETFUNC( setOcts );
+SETFUNC( setOffset );
+SETFUNC( setGain );
SETFUNC( setRepeat );
SETFUNC( setRGBCol );
SETFUNC( setSType );
@@ -646,6 +654,14 @@ static PyGetSetDef BPy_Texture_getseters[] = {
(getter)Texture_getLacunarity, (setter)Texture_setLacunarity,
"Gap between succesive frequencies (for Musgrave textures)",
NULL},
+ {"offset",
+ (getter)Texture_getOffset, (setter)Texture_setOffset,
+ "Fractal offset (for Musgrave textures)",
+ NULL},
+ {"gain",
+ (getter)Texture_getGain, (setter)Texture_setGain,
+ "Gain multiplier (for Musgrave textures)",
+ NULL},
{"noiseBasis",
(getter)Texture_getNoiseBasis, (setter)Texture_setNoiseBasis,
"Noise basis type (wood, stucci, marble, clouds, Musgrave, distorted noise)",
@@ -1179,6 +1195,7 @@ static PyObject *M_Texture_ExtendModesDict( void )
PyConstant_Insert(d, "CLIP", PyInt_FromLong(TEX_CLIP));
PyConstant_Insert(d, "CLIPCUBE", PyInt_FromLong(TEX_CLIPCUBE));
PyConstant_Insert(d, "REPEAT", PyInt_FromLong(TEX_REPEAT));
+ PyConstant_Insert(d, "CHECKER", PyInt_FromLong(TEX_CHECKER));
}
return ExtendModes;
}
@@ -1837,6 +1854,20 @@ static int Texture_setLacunarity( BPy_Texture * self, PyObject * value )
EXPP_TEX_LACUNARITY_MAX );
}
+static int Texture_setOffset( BPy_Texture * self, PyObject * value )
+{
+ return EXPP_setFloatClamped ( value, &self->texture->mg_offset,
+ EXPP_TEX_OFST_MIN,
+ EXPP_TEX_OFST_MAX );
+}
+
+static int Texture_setGain( BPy_Texture * self, PyObject * value )
+{
+ return EXPP_setFloatClamped ( value, &self->texture->mg_gain,
+ EXPP_TEX_GAIN_MIN,
+ EXPP_TEX_GAIN_MAX );
+}
+
static int Texture_setOcts( BPy_Texture * self, PyObject * value )
{
return EXPP_setFloatClamped ( value, &self->texture->mg_octaves,
@@ -2168,6 +2199,16 @@ static PyObject *Texture_getOcts( BPy_Texture *self )
return PyFloat_FromDouble( self->texture->mg_octaves );
}
+static PyObject *Texture_getOffset( BPy_Texture *self )
+{
+ return PyFloat_FromDouble( self->texture->mg_offset );
+}
+
+static PyObject *Texture_getGain( BPy_Texture *self )
+{
+ return PyFloat_FromDouble( self->texture->mg_gain );
+}
+
static PyObject *Texture_getRepeat( BPy_Texture *self )
{
return Py_BuildValue( "(i,i)", self->texture->xrepeat,
diff --git a/source/blender/python/api2_2x/doc/Armature.py b/source/blender/python/api2_2x/doc/Armature.py
index 68916af6166..9aceb0105e3 100644
--- a/source/blender/python/api2_2x/doc/Armature.py
+++ b/source/blender/python/api2_2x/doc/Armature.py
@@ -89,6 +89,8 @@ Example::
@type BONE_SELECTED: Constant
@var TIP_SELECTED: Tip of the Bone is selected
@type TIP_SELECTED: Constant
+@var LOCKED_EDIT: Prevents the bone from being transformed in editmode
+@type LOCKED_EDIT: Constant
@var OCTAHEDRON: Bones drawn as octahedrons
@type OCTAHEDRON: Constant
@var STICK: Bones drawn as a line
@@ -286,6 +288,7 @@ class Bone:
- Armature.ROOT_SELECTED: Selection of root ball of bone
- Armature.BONE_SELECTED: Selection of bone
- Armature.TIP_SELECTED: Selection of tip ball of bone
+ - Armature.LOCKED_EDIT: Prevents the bone from being transformed in editmode
@type options: List of Constants
@ivar subdivision: The number of bone subdivisions.
@type subdivision: Int
diff --git a/source/blender/python/api2_2x/doc/Draw.py b/source/blender/python/api2_2x/doc/Draw.py
index 18234754315..97e22797902 100644
--- a/source/blender/python/api2_2x/doc/Draw.py
+++ b/source/blender/python/api2_2x/doc/Draw.py
@@ -357,12 +357,14 @@ def PupTreeMenu( menu ):
"""
Create a popup menu tree.
- Each item in the list is a menu item - (str, event), separator - None or submenu - (str, [...]).
+ Each item in the list is: a menu item - (str, event); a separator - None;
+ or submenu - (str, [...]).
- Submenus list uses the same syntax as the menu list.
+ Submenus list uses the same syntax as the menu list. To add a title to the
+ main menu, end the first entry str with '%t' - the event is ignored.
Example::
- result = Draw.PupTreeMenu( [ ("Menu Item 1", 10), ("Menu Item 2", 12), ("SubMenu", [("Menu Item 3", 100), ("MenuItem4", 101) ] ) ] )
+ result = Draw.PupTreeMenu( [ ("Title%t", 0), ("Menu Item 1", 10), ("Menu Item 2", 12), ("SubMenu", [("Menu Item 3", 100), ("MenuItem4", 101) ] ) ] )
@type menu: string
@param menu: A menu list
diff --git a/source/blender/python/api2_2x/doc/Group.py b/source/blender/python/api2_2x/doc/Group.py
index 6bd6e105ec3..1266d2efb6e 100644
--- a/source/blender/python/api2_2x/doc/Group.py
+++ b/source/blender/python/api2_2x/doc/Group.py
@@ -105,6 +105,8 @@ class Group:
This object gives access to Groups in Blender.
@ivar layers: Layer bitmask for this group.
@type layers: int
+ @ivar dupliOffset: Object offset when instanced as a dupligroup
+ @type dupliOffset: vector
@ivar objects: Objects that this group uses.
This is a sequence with-list like access so use list(grp.objects) if you need to use a list (where grp is a group).
The groups objects can be set by assigning a list or iterator of objects to the groups objects.
diff --git a/source/blender/python/api2_2x/doc/IDProp.py b/source/blender/python/api2_2x/doc/IDProp.py
index 0a0df335fa3..01d5136cd70 100644
--- a/source/blender/python/api2_2x/doc/IDProp.py
+++ b/source/blender/python/api2_2x/doc/IDProp.py
@@ -18,7 +18,9 @@ class IDGroup:
Note that for arrays, the array type defaults to int unless a float is found
while scanning the template list; if any floats are found, then the whole
- array is float.
+ array is float. Note that double-precision floating point numbers are used for
+ python-created float ID properties and arrays (though the internal C api does
+ support single-precision floats, and the python code will read them).
You can also delete properties with the del operator. For example:
diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py
index a3496164cd1..02f7edd77f5 100644
--- a/source/blender/python/api2_2x/doc/Material.py
+++ b/source/blender/python/api2_2x/doc/Material.py
@@ -323,6 +323,21 @@ class Material:
each color a list of 5 floats [0 - 1], [r,g,b,a,pos].
The colorband can have between 1 and 31 colors.
@type colorbandSpecular: list
+ @type enabledTextures: list of integers
+ @ivar enabledTextures: The texture channels enabled in this material.
+ The attribute returns is list of integers in the range [0, 9], each
+ number representing the respective enabled MTex entry (see
+ L{getTextures()<getTextures>}). Enabling is done by assigning
+ a list of ints or an empty list. Attempting to enable a channel
+ which does not have a texture assigned to it will result in a
+ ValueError exception.
+ Example::
+ mat.enabledTextures = [] # no texture channels are enabled
+ mat.enabledTextures = [0, 6] # texture channels 0 and 6 are enabled
+ ch = mat.enabledTextures
+ ch.append(4)
+ mat.enabledTextures = ch
+ print mat.enabledTextures # will print: [0, 4, 6]
@ivar enableSSS: If True, subsurface scattering will be rendered on this material.
@type enableSSS: bool
@@ -1010,7 +1025,7 @@ class Material:
def setTexture(index, texture, texco, mapto):
"""
- Assign a Blender Texture object to slot number 'number'.
+ Assign a Blender Texture object to channel number 'number'.
@type index: int
@param index: material's texture index in [0, 9].
@type texture: Blender Texture
@@ -1033,7 +1048,7 @@ class Material:
Get this Material's Texture list.
@rtype: list of MTex
@return: a list of Blender MTex objects. None is returned for each empty
- texture slot.
+ texture channel.
"""
def getScriptLinks (event):
diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py
index 8b0c41b9a69..524d1fb6d4c 100644
--- a/source/blender/python/api2_2x/doc/Mathutils.py
+++ b/source/blender/python/api2_2x/doc/Mathutils.py
@@ -521,6 +521,15 @@ class Vector:
@return: Return a quaternion rotation from the vector and the track and up axis.
"""
+ def reflect(mirror):
+ """
+ Return the reflection vector from the mirror vector argument.
+ @type mirror: Vector object
+ @param mirror: This vector could be a normal from the reflecting surface.
+ @rtype: Vector object matching the size of this vector.
+ @return: The reflected vector.
+ """
+
class Euler:
"""
The Euler object
diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py
index 4a53f869283..d463376efbe 100644
--- a/source/blender/python/api2_2x/doc/Mesh.py
+++ b/source/blender/python/api2_2x/doc/Mesh.py
@@ -69,6 +69,7 @@ done once.
- BILLBOARD - always orient after camera.
- HALO - halo face, always point to camera.
- DYNAMIC - respond to collisions.
+ - ALPHASORT - game engine sorts these faces only.
- INVISIBLE - invisible face.
- LIGHT - dynamic lighting.
- OBCOL - use object color instead of vertex colors.
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index 2e4850aeb14..07942d58093 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -117,6 +117,10 @@ Example::
attribute. Only one type can be selected at a time. Values are
BOX, SPHERE, CYLINDER, CONE, and POLYHEDERON
+@type EmptyShapes: readonly dictionary
+@var EmptyShapes: Constant dict used for with L{Object.emptyShape} attribute.
+ Only one type can be selected at a time. Values are
+ ARROW, ARROWS, AXES, CIRCLE, CONE, CUBE AND SPHERE
"""
def New (type, name='type'):
@@ -347,7 +351,7 @@ class Object:
ob.layers = [] # object won't be visible
ob.layers = [1, 4] # object visible only in layers 1 and 4
ls = o.layers
- ls.append([10])
+ ls.append(10)
o.layers = ls
print ob.layers # will print: [1, 4, 10]
B{Note}: changes will only be visible after the screen (at least
@@ -525,6 +529,8 @@ class Object:
@ivar drawType: The object's drawing type.
See L{DrawTypes} constant dict for values.
@type drawType: int
+ @ivar emptyShape: The empty drawing shape.
+ See L{EmptyShapes} constant dict for values.
@ivar parentType: The object's parent type. Read-only.
See L{ParentTypes} constant dict for values.
@type parentType: int
diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py
index d4dc83e84a0..5300fdab808 100644
--- a/source/blender/python/api2_2x/doc/Render.py
+++ b/source/blender/python/api2_2x/doc/Render.py
@@ -170,17 +170,6 @@ def SetRenderWinPos(locationList):
the location of the Render window on the screen.
"""
-def EnableEdgeShift():
- """
- Globally with the unified renderer enabled the outlines of the render
- are shifted a bit.
- """
-
-def EnableEdgeAll():
- """
- Globally consider transparent faces for edge-rendering with the unified renderer.
- """
-
class RenderData:
"""
The RenderData object
@@ -772,7 +761,7 @@ class RenderData:
"""
Get/set the starting frame for sequence rendering.
@type frame: int (optional)
- @param frame: must be between 1 - 18000
+ @param frame: must be a valid Blender frame number.
@rtype: int (if prototype is empty)
@return: Current starting frame for the scene.
"""
@@ -781,7 +770,7 @@ class RenderData:
"""
Get/set the ending frame for sequence rendering.
@type frame: int (optional)
- @param frame: must be between 1 - 18000
+ @param frame: must be a valid Blender frame number.
@rtype: int (if prototype is empty)
@return: Current ending frame for the scene.
"""
diff --git a/source/blender/python/api2_2x/doc/Text.py b/source/blender/python/api2_2x/doc/Text.py
index 98ecb664b71..022205573aa 100644
--- a/source/blender/python/api2_2x/doc/Text.py
+++ b/source/blender/python/api2_2x/doc/Text.py
@@ -100,6 +100,19 @@ class Text:
Clear this Text object: its buffer becomes empty.
"""
+ def reset():
+ """
+ Reset the read IO pointer to the start of the buffer.
+ """
+
+ def readline():
+ """
+ Reads a line of text from the buffer from the current IO pointer
+ position to the end of the line. If the text has changed since the last
+ read, reset() *must* be called.
+ @rtype: string
+ """
+
def set(attribute, value):
"""
Set this Text's attributes.
@@ -118,12 +131,94 @@ class Text:
@param data: The string to append to the text buffer.
"""
- def asLines():
+ def insert(data):
"""
- Retrieve the contents of this Text buffer as a list of strings.
+ Inserts a string into this Text buffer at the cursor.
+ @type data: string
+ @param data: The string to insert into the text buffer.
+ """
+
+ def asLines(start=0, end=-1):
+ """
+ Retrieve the contents of this Text buffer as a list of strings between
+ the start and end lines specified. If end < 0 all lines from start will
+ be included.
+ @type start int
+ @param start: Optional index of first line of the span to return
+ @type end int
+ @param end: Optional index of the line to which the span is taken or
+ -1 to include all lines from start
@rtype: list of strings
- @return: A list of strings, one for each line in the buffer
+ @return: A list of strings, one for each line in the buffer between
+ start and end.
+ """
+
+ def getCursorPos():
+ """
+ Retrieve the position of the cursor in this Text buffer.
+ @rtype: (int, int)
+ @return: A pair (row, col) indexing the line and character of the
+ cursor.
+ """
+
+ def setCursorPos(row, col):
+ """
+ Set the position of the cursor in this Text buffer. Any selection will
+ be cleared. Use setSelectPos to extend a selection from the point
+ specified here.
+ @type row: int
+ @param row: The index of the line in which to position the cursor.
+ @type col: int
+ @param col: The index of the character within the line to position the
+ cursor.
+ """
+
+ def getSelectPos():
+ """
+ Retrieve the position of the selection cursor in this Text buffer.
+ @rtype: (int, int)
+ @return: A pair (row, col) indexing the line and character of the
+ selection cursor.
+ """
+
+ def setSelectPos(row, col):
+ """
+ Set the position of the selection cursor in this Text buffer. This
+ method should be called after setCursorPos to extend the selection to
+ the specified point.
+ @type row: int
+ @param row: The index of the line in which to position the cursor.
+ @type col: int
+ @param col: The index of the character within the line to position the
+ cursor.
+ """
+
+ def suggest(list, prefix=''):
+ """
+ Suggest a list of names. If list is a list of tuples (name, type) the
+ list will be formatted to syntax-highlight each entry type. Types must
+ be strings in the list ['m', 'f', 'v', 'k', '?']. It is recommended that
+ the list be sorted, case-insensitively by name.
+
+ @type list: list of tuples or strings
+ @param list: List of pair-tuples of the form (name, type) where name is
+ the suggested name and type is one of 'm' (module or class), 'f'
+ (function or method), 'v' (variable), 'k' (keyword), '?' (other).
+ Lists of plain strings are also accepted where the type is always
+ '?'.
+ @type prefix: string
+ @param prefix: The optional prefix used to limit what is suggested from
+ the list. This is usually whatever precedes the cursor so that
+ backspace will update it.
+ """
+
+ def showDocs(docs):
+ """
+ Displays a word-wrapped message box containing the specified
+ documentation when this Text object is visible.
+ @type docs: string
+ @param docs: The documentation string to display.
"""
import id_generics
-Text.__doc__ += id_generics.attributes \ No newline at end of file
+Text.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Text3d.py b/source/blender/python/api2_2x/doc/Text3d.py
index a7d8c585078..4bd989014f4 100644
--- a/source/blender/python/api2_2x/doc/Text3d.py
+++ b/source/blender/python/api2_2x/doc/Text3d.py
@@ -287,6 +287,26 @@ class Text3d:
@param align: The new text3d's Alignment value.
"""
+ def getMaterial(index):
+ """
+ get the material index of a character.
+ @rtype: int
+ @return: the material index if the character
+ @type index: int
+ @param index: the index of the character in a string
+ """
+
+ def setMaterial(index, material_index):
+ """
+ Set a characters material.
+ @note: after changing this youll need to update the object with object.makeDisplayList() to see the changes.
+ @rtype: None
+ @type index: int
+ @param index: the index of the character in a string
+ @type material_index: int
+ @param material_index: the material index set set the character.
+ """
+
def addFrame():
"""
Adds a text frame. maximum number of frames is 255.
diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py
index 7f42d06240b..cebb7de7011 100644
--- a/source/blender/python/api2_2x/doc/Texture.py
+++ b/source/blender/python/api2_2x/doc/Texture.py
@@ -344,6 +344,12 @@ class Texture:
@ivar octs: Number of frequencies (for Musgrave textures).
Value is clamped to the range [0.0,8.0].
@type octs: float
+ @ivar offset: Fractal offset (for hetero terrain and multifractal Musgrave textures).
+ Value is clamped to the range [0.0,6.0].
+ @type offset: float
+ @ivar gain: Gain multiplier (for multifractal Musgrave textures).
+ Value is clamped to the range [0.0,6.0].
+ @type gain: float
@ivar repeat: Repetition multiplier (for image textures).
@type repeat: tuple of 2 ints
@ivar rgbCol: RGB color tuple.
diff --git a/source/blender/python/api2_2x/gen_utils.h b/source/blender/python/api2_2x/gen_utils.h
index 1f2fd55cf1b..f33dc69d703 100644
--- a/source/blender/python/api2_2x/gen_utils.h
+++ b/source/blender/python/api2_2x/gen_utils.h
@@ -45,6 +45,7 @@
Py_RETURN_NONE
Python 2.4 macro.
defined here until we switch to 2.4
+ also in PyObjectPlus.h for gameengine
*/
#ifndef Py_RETURN_NONE
#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c
index 6fc3a2b18d1..30ac1a1ab13 100644
--- a/source/blender/python/api2_2x/sceneRender.c
+++ b/source/blender/python/api2_2x/sceneRender.c
@@ -56,6 +56,7 @@ struct View3D; /* keep me up here */
#include "gen_utils.h"
#include "gen_library.h"
+#include "../BPY_extern.h" /* for BPY_do_all_scripts() */
#include "Scene.h"
#include "Group.h"
@@ -469,19 +470,20 @@ PyObject *M_Render_EnableDispWin( PyObject * self )
PyObject *RenderData_Render( BPy_RenderData * self )
{
Scene *oldsce;
+ /* unlock to prevent a deadlock when there are pynodes: */
+ PyThreadState *tstate = NULL;
if (!G.background) {
oldsce = G.scene;
set_scene( self->scene );
+ tstate = PyEval_SaveThread();
BIF_do_render( 0 );
set_scene( oldsce );
}
-
else { /* background mode (blender -b file.blend -P script) */
+ int slink_flag = 0;
Render *re= RE_NewRender(G.scene->id.name);
-
-
int end_frame = G.scene->r.efra;
if (G.scene != self->scene)
@@ -490,11 +492,25 @@ PyObject *RenderData_Render( BPy_RenderData * self )
G.scene->r.efra = G.scene->r.sfra;
+ if (G.f & G_DOSCRIPTLINKS) {
+ BPY_do_all_scripts(SCRIPT_RENDER);
+ G.f &= ~G_DOSCRIPTLINKS; /* avoid FRAMECHANGED events*/
+ slink_flag = 1;
+ }
+
+ tstate = PyEval_SaveThread();
+
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+ if (slink_flag) {
+ G.f |= G_DOSCRIPTLINKS;
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
+ }
+
G.scene->r.efra = end_frame;
}
+ PyEval_RestoreThread(tstate);
Py_RETURN_NONE;
}
@@ -565,10 +581,13 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args )
PyObject *RenderData_RenderAnim( BPy_RenderData * self )
{
Scene *oldsce;
-
+ /* unlock to prevent a deadlock when there are pynodes: */
+ PyThreadState *tstate = NULL;
+
if (!G.background) {
oldsce = G.scene;
set_scene( self->scene );
+ tstate = PyEval_SaveThread();
BIF_do_render( 1 );
set_scene( oldsce );
}
@@ -582,9 +601,18 @@ PyObject *RenderData_RenderAnim( BPy_RenderData * self )
if (G.scene->r.sfra > G.scene->r.efra)
return EXPP_ReturnPyObjError (PyExc_RuntimeError,
"start frame must be less or equal to end frame");
-
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_RENDER);
+
+ tstate = PyEval_SaveThread();
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
}
+
+ PyEval_RestoreThread(tstate);
Py_RETURN_NONE;
}
diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c
index 0d3ad3fcb44..ddc4eb6aea8 100644
--- a/source/blender/python/api2_2x/sceneSequence.c
+++ b/source/blender/python/api2_2x/sceneSequence.c
@@ -33,12 +33,14 @@
#include "DNA_scene_types.h" /* for Base */
#include "BKE_mesh.h"
+#include "BKE_image.h" // RFS: openanim
#include "BKE_library.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_scene.h"
#include "BIF_editseq.h" /* get_last_seq */
+#include "BIF_editsound.h" // RFS: sound_open_hdaudio
#include "BLI_blenlib.h"
#include "BSE_sequence.h"
#include "Ipo.h"
@@ -48,6 +50,9 @@
#include "Sound.h"
#include "gen_utils.h"
+#include "IMB_imbuf_types.h" // RFS: IB_rect
+#include "IMB_imbuf.h" // RFS: IMB_anim_get_duration
+
enum seq_consts {
EXPP_SEQ_ATTR_TYPE = 0,
EXPP_SEQ_ATTR_CHAN,
@@ -145,7 +150,6 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce)
seq->len = PyList_Size( list );
-
/* strip and stripdata */
seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
strip->len= seq->len;
@@ -185,12 +189,103 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce)
strip->us= 1;
strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+ } else if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 4) {
+ // MOVIE or AUDIO_HD
+ char *filename;
+ char *dir;
+ char *fullpath;
+ char *type;
+ int totframe;
+
+ if (!PyArg_ParseTuple( py_data, "ssss", &filename, &dir, &fullpath, &type )) {
+ BLI_remlink(seqbase, seq);
+ MEM_freeN(seq);
+
+ return EXPP_ReturnPyObjError( PyExc_ValueError,
+ "movie/audio hd data needs to be a tuple of a string and a list of images - (filename, dir, fullpath, type)" );
+ }
+
+ // RFS - Attempting to support Movie and Audio (HD) strips
+#define RFS
+#ifdef RFS
+ // Movie strips
+ if( strcmp( type, "movie" ) == 0 )
+ {
+ /* open it as an animation */
+ struct anim * an = openanim(fullpath, IB_rect);
+ if(an==0) {
+ BLI_remlink(seqbase, seq);
+ MEM_freeN(seq);
+
+ return EXPP_ReturnPyObjError( PyExc_ValueError,
+ "invalid movie strip" );
+ }
+
+ /* get the length in frames */
+ totframe = IMB_anim_get_duration( an );
+
+ /* set up sequence */
+ seq->type= SEQ_MOVIE;
+ seq->len= totframe;
+ seq->anim= an;
+ seq->anim_preseek = IMB_anim_get_preseek(an);
+
+ calc_sequence(seq);
+
+ /* strip and stripdata */
+ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+ strip->len= totframe;
+ strip->us= 1;
+ strncpy(strip->dir, dir, FILE_MAXDIR-1); // ????
+ strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
+
+ /* name movie in first strip */
+ strncpy(se->name, filename, FILE_MAXFILE-1); // ????
+ }
+
+ // Audio (HD) strips
+ if( strcmp( type, "audio_hd" ) == 0 )
+ {
+ struct hdaudio *hdaudio;
+
+ totframe= 0;
+
+ /* is it a sound file? */
+ hdaudio = sound_open_hdaudio( fullpath );
+ if(hdaudio==0) {
+ BLI_remlink(seqbase, seq);
+ MEM_freeN(seq);
+
+ return EXPP_ReturnPyObjError( PyExc_ValueError,
+ fullpath );
+ }
+
+ totframe= sound_hdaudio_get_duration(hdaudio, FPS);
+
+ /* set up sequence */
+ seq->type= SEQ_HD_SOUND;
+ seq->len= totframe;
+ seq->hdaudio= hdaudio;
+
+ calc_sequence(seq);
+
+ /* strip and stripdata - same as for MOVIE */
+ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+ strip->len= totframe;
+ strip->us= 1;
+ strncpy(strip->dir, dir, FILE_MAXDIR-1); // ????
+ strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
+
+ /* name movie in first strip */
+ strncpy(se->name, filename, FILE_MAXFILE-1); // ????
+ }
+#endif
+
} else if (BPy_Sound_Check(py_data)) {
- /* sound */
+ /* RAM sound */
int totframe;
bSound *sound = (( BPy_Sound * )py_data)->sound;
-
seq->type= SEQ_RAM_SOUND;
seq->sound = sound;
@@ -198,7 +293,6 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce)
sound->flags |= SOUND_FLAGS_SEQUENCE;
-
/* strip and stripdata */
seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
strip->len= totframe;
@@ -225,18 +319,7 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce)
strip->len= seq->len;
strip->us= 1;
} else {
- /* movie, pydata is a path to a movie file */
- char *name = PyString_AsString ( py_data );
- if (!name) {
- /* only free these 2 because other stuff isnt set */
- BLI_remlink(seqbase, seq);
- MEM_freeN(seq);
-
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expects a string for chan/bone name and an int for the frame where to put the new key" );
- }
-
- seq->type= SEQ_MOVIE;
+ // RFS: REMOVED MOVIE FROM HERE
}
strncpy(seq->name+2, "Untitled", 21);
intern_pos_update(seq);
diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c
index 33ca993fb49..fe28f0fac42 100644
--- a/source/blender/python/api2_2x/vector.c
+++ b/source/blender/python/api2_2x/vector.c
@@ -42,6 +42,7 @@ char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]";
char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]";
char Vector_toPoint_doc[] = "() - create a new Point Object from this vector";
char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis";
+char Vector_reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal";
char Vector_copy_doc[] = "() - return a copy of the vector";
/*-----------------------METHOD DEFINITIONS ----------------------*/
struct PyMethodDef Vector_methods[] = {
@@ -53,6 +54,7 @@ struct PyMethodDef Vector_methods[] = {
{"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc},
{"toPoint", (PyCFunction) Vector_toPoint, METH_NOARGS, Vector_toPoint_doc},
{"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc},
+ {"reflect", ( PyCFunction ) Vector_reflect, METH_O, Vector_reflect_doc},
{"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
{"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
{NULL, NULL, 0, NULL}
@@ -273,7 +275,55 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args )
return newQuaternionObject(quat, Py_NEW);
}
-
+/*----------------------------Vector.reflect(mirror) ----------------------
+ return a reflected vector on the mirror normal
+ ((2 * DotVecs(vec, mirror)) * mirror) - vec
+ using arithb.c would be nice here */
+PyObject *Vector_reflect( VectorObject * self, PyObject * value )
+{
+ VectorObject *mirrvec;
+ float mirror[3];
+ float vec[3];
+ float reflect[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+ float dot2;
+
+ /* for normalizing */
+ int i;
+ float norm = 0.0f;
+
+ if (!VectorObject_Check(value))
+ return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a vector argument" );
+
+ mirrvec = (VectorObject *)value;
+
+ mirror[0] = mirrvec->vec[0];
+ mirror[1] = mirrvec->vec[1];
+ if (mirrvec->size > 2) mirror[2] = mirrvec->vec[2];
+ else mirror[2] = 0.0;
+
+ /* normalize, whos idea was it not to use arithb.c? :-/ */
+ for(i = 0; i < 3; i++) {
+ norm += mirror[i] * mirror[i];
+ }
+ norm = (float) sqrt(norm);
+ for(i = 0; i < 3; i++) {
+ mirror[i] /= norm;
+ }
+ /* done */
+
+ vec[0] = self->vec[0];
+ vec[1] = self->vec[1];
+ if (self->size > 2) vec[2] = self->vec[2];
+ else vec[2] = 0.0;
+
+ dot2 = 2 * vec[0]*mirror[0]+vec[1]*mirror[1]+vec[2]*mirror[2];
+
+ reflect[0] = (dot2 * mirror[0]) - vec[0];
+ reflect[1] = (dot2 * mirror[1]) - vec[1];
+ reflect[2] = (dot2 * mirror[2]) - vec[2];
+
+ return newVectorObject(reflect, self->size, Py_NEW);
+}
/*----------------------------Vector.copy() --------------------------------------
return a copy of the vector */
diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h
index a86f2ddfe42..61b50d5f458 100644
--- a/source/blender/python/api2_2x/vector.h
+++ b/source/blender/python/api2_2x/vector.h
@@ -52,6 +52,7 @@ PyObject *Vector_Resize3D( VectorObject * self );
PyObject *Vector_Resize4D( VectorObject * self );
PyObject *Vector_toPoint( VectorObject * self );
PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args );
+PyObject *Vector_reflect( VectorObject * self, PyObject * value );
PyObject *Vector_copy( VectorObject * self );
PyObject *newVectorObject(float *vec, int size, int type);
diff --git a/source/blender/radiosity/CMakeLists.txt b/source/blender/radiosity/CMakeLists.txt
index 36e9ad19770..502acf1e211 100644
--- a/source/blender/radiosity/CMakeLists.txt
+++ b/source/blender/radiosity/CMakeLists.txt
@@ -29,7 +29,7 @@ FILE(GLOB SRC intern/source/*.c)
SET(INC
extern/include ../blenlib ../blenkernel ../makesdna ../include
../../../intern/guardedalloc ../render/extern/include
- ../render/intern/include
+ ../render/intern/include ../blenloader ../../../extern/glew/include
)
BLENDERLIB_NOLIST(blender_radiosity "${SRC}" "${INC}")
diff --git a/source/blender/radiosity/SConscript b/source/blender/radiosity/SConscript
index 102f79683f9..82d84f5ef16 100644
--- a/source/blender/radiosity/SConscript
+++ b/source/blender/radiosity/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('intern/source/*.c')
incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../include'
incs += ' #/intern/guardedalloc ../render/extern/include'
-incs += ' ../render/intern/include'
+incs += ' ../render/intern/include ../blenloader #/extern/glew/include'
incs += ' ' + env['BF_OPENGL_INC']
diff --git a/source/blender/radiosity/intern/source/Makefile b/source/blender/radiosity/intern/source/Makefile
index 19768c959c7..5912cdba590 100644
--- a/source/blender/radiosity/intern/source/Makefile
+++ b/source/blender/radiosity/intern/source/Makefile
@@ -36,6 +36,7 @@ include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# not very neat....
@@ -44,6 +45,7 @@ CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../
+CPPFLAGS += -I../../../blenloader
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# first /include is my own includes, second are the external includes
diff --git a/source/blender/radiosity/intern/source/radnode.c b/source/blender/radiosity/intern/source/radnode.c
index 5517a22eb93..042fe6840fc 100644
--- a/source/blender/radiosity/intern/source/radnode.c
+++ b/source/blender/radiosity/intern/source/radnode.c
@@ -50,6 +50,8 @@
#include "radio.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -167,14 +169,14 @@ void *calloc_fast(int size)
void free_fast(void *poin, int size)
{
MallocGroup *mg;
- long val;
+ intptr_t val;
mg= MallocBase.last;
while(mg) {
if(mg->size==size) {
- if( ((long)poin) >= ((long)mg->data) ) {
- if( ((long)poin) < ((long)(mg->data+MAL_GROUPSIZE*size)) ) {
- val= ((long)poin) - ((long)mg->data);
+ if( ((intptr_t)poin) >= ((intptr_t)mg->data) ) {
+ if( ((intptr_t)poin) < ((intptr_t)(mg->data+MAL_GROUPSIZE*size)) ) {
+ val= ((intptr_t)poin) - ((intptr_t)mg->data);
val/= size;
mg->curfree= val;
mg->flags[val]= 0;
diff --git a/source/blender/radiosity/intern/source/radpreprocess.c b/source/blender/radiosity/intern/source/radpreprocess.c
index 5f8a39786c1..07b933b6db9 100644
--- a/source/blender/radiosity/intern/source/radpreprocess.c
+++ b/source/blender/radiosity/intern/source/radpreprocess.c
@@ -68,6 +68,8 @@
#include "radio.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -179,7 +181,7 @@ int vergedge(const void *v1,const void *v2)
void addedge(float *v1, float *v2, EdSort *es)
{
- if( ((long)v1)<((long)v2) ) {
+ if( ((intptr_t)v1)<((intptr_t)v2) ) {
es->v1= v1;
es->v2= v2;
}
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index b543dff49ff..0b659554d1a 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -29,7 +29,7 @@ FILE(GLOB SRC intern/source/*.c)
SET(INC
intern/include ../../../intern/guardedalloc ../blenlib ../makesdna
extern/include ../blenkernel ../radiosity/extern/include ../imbuf
- ../quicktime ../include ../../kernel/gen_messaging ../yafray
+ ../quicktime ../include ../../kernel/gen_messaging ../yafray ../blenloader
)
IF(WITH_OPENEXR)
diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript
index 52f5042cd50..96075ba6ef4 100644
--- a/source/blender/render/SConscript
+++ b/source/blender/render/SConscript
@@ -6,7 +6,7 @@ sources = env.Glob('intern/source/*.c')
incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna'
incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
-incs += ' ../quicktime ../include ../../kernel/gen_messaging'
+incs += ' ../quicktime ../include ../../kernel/gen_messaging ../blenloader'
incs += ' ../freestyle'
defs = []
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 2f97b19f75c..7e2194549cc 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -44,6 +44,8 @@
#include "RE_shader_ext.h" /* TexResult, ShadeResult, ShadeInput */
#include "sunsky.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
struct Object;
struct MemArena;
struct VertTableNode;
@@ -89,11 +91,11 @@ typedef struct RenderPart
int *rectp; /* polygon index table */
int *rectz; /* zbuffer */
int *rectmask; /* negative zmask */
- long *rectdaps; /* delta acum buffer for pixel structs */
+ intptr_t *rectdaps; /* delta acum buffer for pixel structs */
int *rectbacko; /* object table for backside sss */
int *rectbackp; /* polygon index table for backside sss */
int *rectbackz; /* zbuffer for backside sss */
- long *rectall; /* buffer for all faces for sss */
+ intptr_t *rectall; /* buffer for all faces for sss */
rcti disprect; /* part coordinates within total picture */
int rectx, recty; /* the size */
@@ -226,7 +228,7 @@ struct ISBData;
typedef struct ShadSampleBuf {
struct ShadSampleBuf *next, *prev;
- long *zbuf;
+ intptr_t *zbuf;
char *cbuf;
} ShadSampleBuf;
@@ -416,7 +418,8 @@ typedef struct LampRen {
float xs, ys, dist;
float co[3];
- short type, mode;
+ short type;
+ int mode;
float r, g, b, k;
float energy, haint;
int lay;
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index faa7a68f754..9ee6f873f3f 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -1565,7 +1565,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
float hasize, pa_size, pa_time, r_tilt, cfra=bsystem_time(ob,(float)CFRA,0.0);
float adapt_angle=0.0, adapt_pix=0.0, random, simplify[2];
int i, a, k, max_k=0, totpart, totuv=0, totcol=0, override_uv=-1, dosimplify = 0, dosurfacecache = 0;
- int path_possible=0, keys_possible=0, baked_keys=0, totchild=psys->totchild;
+ int path_possible=0, keys_possible=0, baked_keys=0, totchild=0;
int seed, path_nbr=0, path=0, orco1=0, adapt=0, uv[3]={0,0,0}, num;
int totface, *origindex = 0;
char **uv_name=0;
@@ -1573,6 +1573,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
/* 1. check that everything is ok & updated */
if(psys==NULL)
return 0;
+
+ totchild=psys->totchild;
part=psys->part;
pars=psys->particles;
@@ -1764,7 +1766,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
psys->lattice=psys_get_lattice(ob,psys);
/* 3. start creating renderable things */
- for(a=0,pa=pars; a<totpart+totchild; a++, pa++) {
+ for(a=0,pa=pars; a<totpart+totchild; a++, pa++, seed++) {
random = rng_getFloat(rng);
if(a<totpart){
@@ -1865,9 +1867,17 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
num= cpa->num;
/* get orco */
- psys_particle_on_emitter(ob, psmd,
- (part->childtype == PART_CHILD_FACES)? PART_FROM_FACE: PART_FROM_PARTICLE,
- cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,nor,0,0,orco,0);
+ if(part->childtype == PART_CHILD_FACES) {
+ psys_particle_on_emitter(ob, psmd,
+ PART_FROM_FACE, cpa->num,DMCACHE_ISCHILD,
+ cpa->fuv,cpa->foffset,co,nor,0,0,orco,0);
+ }
+ else {
+ ParticleData *par = psys->particles + cpa->parent;
+ psys_particle_on_emitter(ob, psmd, part->from,
+ par->num,DMCACHE_ISCHILD,par->fuv,
+ par->foffset,co,nor,0,0,orco,0);
+ }
if(uvco){
if(part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES){
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index d70c51b83bc..15c57eb9362 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -1670,7 +1670,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp)
OcclusionCacheSample *sample;
OccFace exclude;
ShadeInput *shi;
- long *rd=NULL;
+ intptr_t *rd=NULL;
int *ro=NULL, *rp=NULL, *rz=NULL, onlyshadow;
int x, y, step = CACHE_STEP;
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 457f4e992c5..74cd6e84044 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -141,7 +141,7 @@ static void print_error(char *str) {printf("ERROR: %s\n", str);}
static void stats_background(RenderStats *rs)
{
- extern unsigned long mem_in_use;
+ uintptr_t mem_in_use= MEM_get_memory_in_use();
float megs_used_memory= mem_in_use/(1024.0*1024.0);
char str[400], *spos= str;
@@ -2389,6 +2389,12 @@ static int is_rendering_allowed(Render *re)
if(re->osa==0)
re->r.scemode &= ~R_FULL_SAMPLE;
+ /* no fullsample and edge */
+ if((re->r.scemode & R_FULL_SAMPLE) && (re->r.mode & R_EDGE)) {
+ re->error("Full Sample doesn't support Edge Enhance");
+ return 0;
+ }
+
}
else
re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 1155d2ea817..0fd9365477c 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -263,7 +263,12 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
shade_input_set_shade_texco(shi);
if(is->mode==RE_RAY_SHADOW_TRA)
- shade_color(shi, shr);
+ if(shi->mat->nodetree && shi->mat->use_nodes) {
+ ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
+ shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
+ }
+ else
+ shade_color(shi, shr);
else {
if(shi->mat->nodetree && shi->mat->use_nodes) {
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
@@ -2051,7 +2056,10 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac)
if(shi->mat->mode & MA_SHADOW_TRA) isec.mode= RE_RAY_SHADOW_TRA;
else isec.mode= RE_RAY_SHADOW;
- if(lar->mode & LA_LAYER) isec.lay= lar->lay; else isec.lay= -1;
+ if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW))
+ isec.lay= lar->lay;
+ else
+ isec.lay= -1;
/* only when not mir tracing, first hit optimm */
if(shi->depth==0) {
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 4520e4c10bb..5b8cedfce78 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -243,7 +243,7 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl)
rcti disprect= pa->disprect, testrect= pa->disprect;
float dist, xsq, ysq, xn, yn;
float col[4];
- long *rd= NULL;
+ intptr_t *rd= NULL;
int a, *rz, zz, y, sample, totsample, od;
short minx, maxx, miny, maxy, x;
unsigned int lay= rl->lay;
@@ -324,7 +324,7 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
ShadeInput shi;
float *pass;
float fac, col[4];
- long *rd= pa->rectdaps;
+ intptr_t *rd= pa->rectdaps;
int *rz= pa->rectz;
int x, y, sample, totsample, fullsample, od;
@@ -767,7 +767,7 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl)
{
RenderResult *rr= pa->result;
ShadeSample ssamp;
- long *rd, *rectdaps= pa->rectdaps;
+ intptr_t *rd, *rectdaps= pa->rectdaps;
int samp;
int x, y, seed, crop=0, offs=0, od;
@@ -874,7 +874,7 @@ static void freeps(ListBase *lb)
lb->first= lb->last= NULL;
}
-static void addps(ListBase *lb, long *rd, int obi, int facenr, int z, int maskz, unsigned short mask)
+static void addps(ListBase *lb, intptr_t *rd, int obi, int facenr, int z, int maskz, unsigned short mask)
{
PixStrMain *psm;
PixStr *ps, *last= NULL;
@@ -901,7 +901,7 @@ static void addps(ListBase *lb, long *rd, int obi, int facenr, int z, int maskz,
ps= psm->ps + psm->counter++;
if(last) last->next= ps;
- else *rd= (long)ps;
+ else *rd= (intptr_t)ps;
ps->next= NULL;
ps->obi= obi;
@@ -931,17 +931,23 @@ static void edge_enhance_add(RenderPart *pa, float *rectf, float *arect)
}
}
-
-static void convert_to_key_alpha(RenderPart *pa, float *rectf)
+static void convert_to_key_alpha(RenderPart *pa, RenderLayer *rl)
{
- int y;
-
- for(y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
- if(rectf[3] >= 1.0f);
- else if(rectf[3] > 0.0f) {
- rectf[0] /= rectf[3];
- rectf[1] /= rectf[3];
- rectf[2] /= rectf[3];
+ RenderLayer *rlpp[RE_MAX_OSA];
+ int y, sample, totsample;
+
+ totsample= get_sample_layers(pa, rl, rlpp);
+
+ for(sample= 0; sample<totsample; sample++) {
+ float *rectf= rlpp[sample]->rectf;
+
+ for(y= pa->rectx*pa->recty; y>0; y--, rectf+=4) {
+ if(rectf[3] >= 1.0f);
+ else if(rectf[3] > 0.0f) {
+ rectf[0] /= rectf[3];
+ rectf[1] /= rectf[3];
+ rectf[2] /= rectf[3];
+ }
}
}
}
@@ -1027,7 +1033,7 @@ static void reset_sky_speed(RenderPart *pa, RenderLayer *rl)
static unsigned short *make_solid_mask(RenderPart *pa)
{
- long *rd= pa->rectdaps;
+ intptr_t *rd= pa->rectdaps;
unsigned short *solidmask, *sp;
int x;
@@ -1092,7 +1098,7 @@ void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data)
{
ZbufSolidData *sdata= (ZbufSolidData*)data;
ListBase *lb= sdata->psmlist;
- long *rd= pa->rectdaps;
+ intptr_t *rd= pa->rectdaps;
int *ro= zspan->recto;
int *rp= zspan->rectp;
int *rz= zspan->rectz;
@@ -1133,7 +1139,7 @@ void zbufshadeDA_tile(RenderPart *pa)
/* initialize pixelstructs and edge buffer */
addpsmain(&psmlist);
- pa->rectdaps= MEM_callocN(sizeof(long)*pa->rectx*pa->recty+4, "zbufDArectd");
+ pa->rectdaps= MEM_callocN(sizeof(intptr_t)*pa->rectx*pa->recty+4, "zbufDArectd");
if(rl->layflag & SCE_LAY_EDGE)
if(R.r.mode & R_EDGE)
@@ -1229,7 +1235,7 @@ void zbufshadeDA_tile(RenderPart *pa)
/* de-premul alpha */
if(R.r.alphamode & R_ALPHAKEY)
- convert_to_key_alpha(pa, rl->rectf);
+ convert_to_key_alpha(pa, rl);
/* free stuff within loop! */
MEM_freeN(pa->rectdaps); pa->rectdaps= NULL;
@@ -1393,7 +1399,7 @@ void zbufshade_tile(RenderPart *pa)
/* de-premul alpha */
if(R.r.alphamode & R_ALPHAKEY)
- convert_to_key_alpha(pa, rl->rectf);
+ convert_to_key_alpha(pa, rl);
if(edgerect) MEM_freeN(edgerect);
edgerect= NULL;
@@ -1433,7 +1439,7 @@ static void addps_sss(void *cb_handle, int obi, int facenr, int x, int y, int z)
return;
if(pa->rectall) {
- long *rs= pa->rectall + pa->rectx*y + x;
+ intptr_t *rs= pa->rectall + pa->rectx*y + x;
addps(&handle->psmlist, rs, obi, facenr, z, 0, 0);
handle->totps++;
@@ -1569,7 +1575,7 @@ void zbufshade_sss_tile(RenderPart *pa)
int *ro, *rz, *rp, *rbo, *rbz, *rbp, lay;
#if 0
PixStr *ps;
- long *rs;
+ intptr_t *rs;
int z;
#endif
@@ -1581,7 +1587,7 @@ void zbufshade_sss_tile(RenderPart *pa)
handle.psmlist.first= handle.psmlist.last= NULL;
addpsmain(&handle.psmlist);
- pa->rectall= MEM_callocN(sizeof(long)*pa->rectx*pa->recty+4, "rectall");
+ pa->rectall= MEM_callocN(sizeof(intptr_t)*pa->rectx*pa->recty+4, "rectall");
#else
pa->recto= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "recto");
pa->rectp= MEM_mallocN(sizeof(int)*pa->rectx*pa->recty, "rectp");
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index f3258b601de..c53a2b68c9c 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -171,7 +171,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
{
ShadSampleBuf *shsample;
float dist;
- unsigned long *ztile;
+ uintptr_t *ztile;
int *rz, *rz1, verg, verg1, size= shb->size;
int a, x, y, minx, miny, byt1, byt2;
char *rc, *rcline, *ctile, *zt;
@@ -179,10 +179,10 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
shsample= MEM_mallocN( sizeof(ShadSampleBuf), "shad sample buf");
BLI_addtail(&shb->buffers, shsample);
- shsample->zbuf= MEM_mallocN( sizeof(unsigned long)*(size*size)/256, "initshadbuf2");
+ shsample->zbuf= MEM_mallocN( sizeof(uintptr_t)*(size*size)/256, "initshadbuf2");
shsample->cbuf= MEM_callocN( (size*size)/256, "initshadbuf3");
- ztile= (unsigned long *)shsample->zbuf;
+ ztile= (uintptr_t *)shsample->zbuf;
ctile= shsample->cbuf;
/* help buffer */
@@ -237,7 +237,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
}
if(byt1 && byt2) { /* only store byte */
*ctile= 1;
- *ztile= (unsigned long)MEM_mallocN(256+4, "tile1");
+ *ztile= (uintptr_t)MEM_mallocN(256+4, "tile1");
rz= (int *)*ztile;
*rz= *rz1;
@@ -247,7 +247,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
}
else if(byt1) { /* only store short */
*ctile= 2;
- *ztile= (unsigned long)MEM_mallocN(2*256+4,"Tile2");
+ *ztile= (uintptr_t)MEM_mallocN(2*256+4,"Tile2");
rz= (int *)*ztile;
*rz= *rz1;
@@ -260,7 +260,7 @@ static void compress_shadowbuf(ShadBuf *shb, int *rectz, int square)
}
else { /* store triple */
*ctile= 3;
- *ztile= (unsigned long)MEM_mallocN(3*256,"Tile3");
+ *ztile= (uintptr_t)MEM_mallocN(3*256,"Tile3");
zt= (char *)*ztile;
rc= rcline;
@@ -296,7 +296,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
minz= 1.0e30f; maxz= -1.0e30f;
Mat4CpyMat4(viewmat, lar->shb->viewmat);
- if(lar->mode & LA_LAYER) lay= lar->lay;
+ if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
maxtotvert= 0;
for(obr=re->objecttable.first; obr; obr=obr->next)
@@ -542,7 +542,7 @@ void freeshadowbuf(LampRen *lar)
v= (shb->size*shb->size)/256;
for(shsample= shb->buffers.first; shsample; shsample= shsample->next) {
- long *ztile= shsample->zbuf;
+ intptr_t *ztile= shsample->zbuf;
char *ctile= shsample->cbuf;
for(b=0; b<v; b++, ztile++, ctile++)
@@ -1520,7 +1520,7 @@ static void isb_bsp_fillfaces(Render *re, LampRen *lar, ISBBranch *root)
minmaxf[2]= (2.0f*root->box.ymin - size-2.0f)/size;
minmaxf[3]= (2.0f*root->box.ymax - size+2.0f)/size;
- if(lar->mode & LA_LAYER) lay= lar->lay;
+ if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
/* (ab)use zspan, since we use zbuffer clipping code */
zbuf_alloc_span(&zspan, size, size, re->clipcrop);
@@ -1752,7 +1752,7 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar)
ISBSample *samp, *samplebuf[16]; /* should be RE_MAX_OSA */
ISBBranch root;
MemArena *memarena;
- long *rd;
+ intptr_t *rd;
int *recto, *rectp, x, y, sindex, sample, bsp_err=0;
/* storage for shadow, per thread */
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 5b69323667e..5a80173d1f1 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1761,7 +1761,21 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
if(shi->combinedflag & SCE_PASS_SPEC)
VECADD(shr->combined, shr->combined, shr->spec);
+ /* modulate by the object color */
+ if((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) {
+ if(!(ma->sss_flag & MA_DIFF_SSS) || !has_sss_tree(&R, ma)) {
+ float obcol[4];
+
+ QUATCOPY(obcol, shi->obr->ob->col);
+ CLAMP(obcol[3], 0.0f, 1.0f);
+
+ shr->combined[0] *= obcol[0];
+ shr->combined[1] *= obcol[1];
+ shr->combined[2] *= obcol[2];
+ shr->alpha *= obcol[3];
+ }
+ }
+
shr->combined[3]= shr->alpha;
}
-
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index 591d51a969d..05e36160f0e 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -416,7 +416,7 @@ typedef struct StrandPart {
int *totapixbuf;
int *rectz;
int *rectmask;
- long *rectdaps;
+ intptr_t *rectdaps;
int rectx, recty;
int sample;
@@ -510,7 +510,7 @@ static void do_strand_fillac(void *handle, int x, int y, float u, float v, float
if(spart->rectdaps) {
/* find the z of the sample */
PixStr *ps;
- long *rd= spart->rectdaps + offset;
+ intptr_t *rd= spart->rectdaps + offset;
bufferz= 0x7FFFFFFF;
if(spart->rectmask) maskz= 0x7FFFFFFF;
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index c91c9e2f799..be555443605 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -2278,7 +2278,7 @@ static int hashlist_projectvert(float *v1, float winmat[][4], float *hoco)
return 0;
}
- buck= &bucket[ (((long)v1)/16) & 255 ];
+ buck= &bucket[ (((intptr_t)v1)/16) & 255 ];
if(buck->vert==v1) {
QUATCOPY(hoco, buck->hoco);
return buck->clip;
@@ -2410,7 +2410,7 @@ void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int
float obwinmat[4][4], ho1[4], ho2[4], ho3[4], ho4[4];
int a, b, c, i, c1, c2, c3, c4, ok=1, lay= -1;
- if(lar->mode & LA_LAYER) lay= lar->lay;
+ if(lar->mode & (LA_LAYER|LA_LAYER_SHADOW)) lay= lar->lay;
/* 1.0f for clipping in clippyra()... bad stuff actually */
zbuf_alloc_span(&zspan, size, size, 1.0f);
@@ -3263,7 +3263,7 @@ static void copyto_abufz(RenderPart *pa, int *arectz, int *rectmask, int sample)
{
PixStr *ps;
int x, y, *rza, *rma;
- long *rd;
+ intptr_t *rd;
if(R.osa==0) {
memcpy(arectz, pa->rectz, sizeof(int)*pa->rectx*pa->recty);
@@ -3484,7 +3484,7 @@ static int zbuffer_abuf(RenderPart *pa, APixstr *APixbuf, ListBase *apsmbase, Re
/* speed pointer NULL = sky, we clear */
/* else if either alpha is full or no solid was filled in: copy speed */
/* else fill in minimum speed */
-void add_transp_speed(RenderLayer *rl, int offset, float *speed, float alpha, long *rdrect)
+void add_transp_speed(RenderLayer *rl, int offset, float *speed, float alpha, intptr_t *rdrect)
{
RenderPass *rpass;
@@ -3958,7 +3958,7 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
ZTranspRow zrow[MAX_ZROW];
StrandShadeCache *sscache= NULL;
float sampalpha, alpha, *passrect= pass;
- long *rdrect;
+ intptr_t *rdrect;
int x, y, crop=0, a, b, totface, totsample, doztra;
int addpassflag, offs= 0, od, addzbuf, osa = (R.osa? R.osa: 1);
unsigned short *ztramask= NULL, filled;
diff --git a/source/blender/src/CMakeLists.txt b/source/blender/src/CMakeLists.txt
index 342579fb3b0..d95551940f8 100644
--- a/source/blender/src/CMakeLists.txt
+++ b/source/blender/src/CMakeLists.txt
@@ -35,7 +35,7 @@ SET(INC
../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue
../quicktime ../../../intern/elbeem/extern
../../../intern/ghost ../../../intern/opennl/extern
- ../nodes ../../../extern/glew/include
+ ../nodes ../../../extern/glew/include ../gpu
${PYTHON_INC}
${SDL_INC}
)
diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile
index 001efc58b5d..46e916b0437 100644
--- a/source/blender/src/Makefile
+++ b/source/blender/src/Makefile
@@ -68,6 +68,7 @@ CPPFLAGS += -I..
CPPFLAGS += -I../../kernel/gen_system
CPPFLAGS += -I../../gameengine/SoundSystem
CPPFLAGS += -I../ftfont
+CPPFLAGS += -I../gpu
# Only used by py_demo.c !!!
CPPFLAGS += -I../radiosity/extern/include
diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript
index a7a960beac9..5ee1a6d7b93 100644
--- a/source/blender/src/SConscript
+++ b/source/blender/src/SConscript
@@ -26,7 +26,8 @@ incs += ' #/intern/bsp/extern ../radiosity/extern/include'
incs += ' #/intern/decimation/extern ../blenloader ../python'
incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue ../nodes'
incs += ' ../quicktime #/intern/elbeem/extern'
-incs += ' #/intern/ghost #/intern/opennl/extern #/extern/glew/include'
+incs += ' #/intern/ghost #/intern/opennl/extern'
+incs += ' ../gpu #extern/glew/include'
incs += ' ../freestyle'
incs += ' ' + env['BF_PYTHON_INC']
diff --git a/source/blender/src/blenderbuttons.c b/source/blender/src/blenderbuttons.c
index e15ef3fd898..f29397b2156 100644
--- a/source/blender/src/blenderbuttons.c
+++ b/source/blender/src/blenderbuttons.c
@@ -1,2181 +1,2139 @@
/* DataToC output of file <blenderbuttons> */
-int datatoc_blenderbuttons_size= 69599;
+int datatoc_blenderbuttons_size= 68242;
char datatoc_blenderbuttons[]= {
-137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 0, 0, 0, 1, 0, 8, 6, 0, 0, 0,197,144,
-206,103, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,
-147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,216,
- 5, 19, 11, 8, 1, 11,126, 22,156, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236,125,121, 92, 84,229,254,255,251, 57,179,179,239,
-168,184,128,138,251,130,224, 26,106, 80,168,201,215, 52, 21, 48,179,237,214,189, 78,150,173,150,102,117,111,245,203, 43,106,218,
-170,233,216,162, 89,106, 9,106,120,115, 5, 29,212,144,220, 21, 75, 19, 5, 17, 65,144,109, 96,134,217,207,156,231,247,199,204,
-208,128,192, 44,160, 81,205,251,197,188,152,115,230,204,123,158,115,158,229,253,249,124,158,141, 68, 69, 69, 81,184,225,134, 27,
-110,184,225,134, 27,127, 43, 48,238, 71,224,134, 27,110,184,225,134, 27,127, 31,156, 57,155, 5, 0, 32,238, 8,128, 27,110,184,
-225,134, 27,110,184, 35, 0,110,184,225,134, 27,110,184,225,134,219, 0,112,195, 13, 55,220,112,195, 13, 55,220, 6,128, 27,110,
-184,225,134, 27,110,184,241,151, 0,223,246, 96,222,188,121,196, 85,162,181,107,215,222, 54,150,192,205,231,230,107, 5,116,237,
-218,181,127, 88,250,178,179,179,105, 92, 92, 28,113,231,199,159,151,239,220,185,115, 46, 23,190,168,168, 40,184,243,195,205,247,
- 87,230,115,218, 0,248, 59, 67, 42,149, 54,122,128, 50,153,140,116,228,116,174, 91,183, 14,132, 16,226,206, 57,215,242,120,246,
-236,217, 72, 79, 79,111, 56, 78, 74, 74,250, 75, 60,203, 61,123,207,180,218, 16, 36, 78,142,254, 75,151, 25,137,255, 78,136,117,
-189, 17, 1, 3,234,177, 23,249,218,183, 58,108, 89,236,168,109,140, 27,127,211, 8,192,221, 40,172,123,246,236,137,203,200,200,
-144, 91,143,167, 77,155, 22,159,152,152,152,221, 17, 30, 6,165,230,182,179,163,234,170, 84, 42,165, 69, 69, 69, 0,128,240,240,
-112, 0,248, 83, 52, 34, 77,141, 43,139,129,213,162,103,238, 40,239,214,173, 91, 29, 54,212,164, 82, 41,221,182,109, 91,195,241,
-206,157, 59, 49, 97,194,132,134,227,244,244,116,250, 71, 25, 1, 49, 49, 49, 20, 0, 78,159, 62, 77,218,227,186,140, 31,100,173,
- 24, 0,178, 54,231, 95, 88, 68, 55, 0,192, 45,157, 14,172, 86,111, 62, 89,171, 4, 0, 36, 39, 39, 35, 33, 33,161,197,244,173,
- 79, 88, 79, 35,203, 34,157,250,253,248, 95,227, 29,200, 23, 9,252,159,189, 0, 93,198, 78, 40, 20,211,161, 0, 16, 45,121, 31,
-111, 73, 78,163,155, 24,168,212, 21,224, 45,109,138, 83,191,155,149,149, 21,151,150,150, 38,183, 61,151,156,156, 28,159,144,144,
-144,221,145,234, 86,123,181, 1,127,134,251,189, 19,120,231,141, 23,136,151,192,151,232,197, 66,170,175,213, 50,245, 90, 37,247,
-193, 39,171,255, 22,179,227,236, 26, 0,123,246,236,137,179,254,111,171, 80, 91, 27,146,119,183, 45,129, 87, 55, 95,212,223,168,
-195,219, 41,111,201, 51, 50, 50,224,182,134,237, 67, 38,147,145,240,240,112, 90, 84, 84,132,162,162, 34,236,219,183,175,195,122,
- 18,214,188,150,201,100, 68, 38,147, 9,164, 82,169,113,197,138, 21, 39, 1, 96,225,194,133, 35, 90,251,238,244,233,211, 27,222,
-179,172, 9, 6,163, 30, 6,189, 1, 6,131,249,197,178, 44, 22, 46, 92,232, 84, 90,108,197,191, 57, 76,152, 48,225, 15, 53, 2,
- 28, 49,126, 98, 98, 98,236,114, 36, 78,142, 38,174,136,188,195,240,243, 65, 94,225,119,144,160, 43, 76,200, 65,197, 23,103,112,
-190,160, 26, 51,150,109,112,232,235,145,101,145, 14, 10,186, 25,242,129,114,187, 13,177, 36,241, 45, 4, 76,123, 26,165, 47, 69,
- 3, 90, 69,195,249, 51,218,215,112, 6, 0,180,192,120, 73, 50, 14,250,159,134, 31,128, 24, 69,140,195,229,183, 41,210,210,210,
-228,105,105,105, 29,162,189,178,166,177, 61,218,128, 63,195,253,182, 55, 54,173, 89, 75, 30, 13,139,224,191,144,244, 56, 47,164,
-127, 24,195, 39, 33, 68, 83, 87,199,137, 17,106, 98,186,116, 53,233,110, 94, 51, 57,248,236,110, 58,209,134,119,113,128,111,129,
- 19,124,171,238,168, 1,144,145,145, 33,223,246,239, 55,144,242,222, 82,121, 98, 98, 34,105, 75, 1,179, 10, 63, 0, 84,105,170,
-129, 64, 96,241,193,119,160, 44, 84, 64,250,175,142, 37,100, 45, 85,136, 63, 58,141,182, 70,192, 3, 15, 60,128,162,162, 34,132,
-135,135,119,184,103, 39,151,155, 29,137,248,248,120, 42,147,201, 24,153, 76, 22, 38,149, 74, 75, 87,172, 88,113,218, 81, 30,150,
-101, 97, 48, 24, 27,132,223, 86,252, 79,157, 58,133,225,195,135, 59,149,174,148,148,223, 61,192,217,179,103, 35, 51, 51,179,145,
- 1,208, 30,101,197,149,124, 56,125,250, 52,201,206,206,166, 19, 39, 78,188,237,179, 3, 7, 14, 96,235,214,173, 13,199,173,141,
- 91,184,205,120,111,199,238,128,176,136,110, 40, 85,212, 97,199, 51, 51, 17, 72, 98, 81,240,249,171,232, 57,189, 39, 50,157, 16,
-127, 43,230,206,157, 75, 1, 96,253,250,245,109, 46,179, 97,219,114,160,185, 94,143, 82,105, 68,171,215, 93, 16,103,225,221,193,
-183,144,122,225,205, 54,229,103,123,136,110,123,114,180, 71, 36,224, 78,223,111,123, 33, 39, 39,199, 3,192, 61, 0,188,108, 78,
-215, 2,200,139,141,141,173,113,148, 71,203,105, 25, 67,149, 94, 48,121,234,116,177, 2, 70,177, 64,192,231, 43,117, 98, 70, 40,
-212,114, 60, 31, 79,214, 32, 49, 26,249,229, 55,245, 98,158, 72,167, 51,233, 77, 82,169,148, 52, 55,102,196, 22,181,181,181,255,
-181,190,207,207,207,175,242,244,244,100,212,106, 53,103,123,205,200,145, 35, 63,116, 52,141,148, 82,187,194, 78, 8, 89,208,214,
-103,202,183,231,253,247,233,211, 7,145, 94, 62,104, 75, 20,192, 86,252,171, 52,213, 72,189,255,157,134,207,254,145,241, 44, 16,
- 2, 76, 95,145,226, 84, 33,107, 73,160,219, 75,164,111,220,184, 1, 0,232,214,173, 91,163,247,214,223,181, 87, 32,238,100,136,
-207,214, 8, 48, 26, 89,172, 91,183,238,142,121, 1,206,114, 54, 17,127,219,239,223,148,201,100,254, 82,169, 84,225,176,248, 27,
-141, 48, 24,244,208, 27, 12, 48, 54, 17,127,202, 57, 23,161, 75, 73, 73,193,169, 83,167, 26,142, 87,173, 90,133,164,164,164,134,
-227,244,244,244, 54, 27, 59, 54, 6, 79,155,203,159,173,240,207,158, 61, 27,195,134, 13,115,137,167,189,186, 3, 74, 10,139,161,
-222,249, 31,120, 61,245, 49,194, 34,186, 33, 52, 80,130,194,157,133,102,241,247,243, 49,119, 1, 8,120, 14,113,181,135,240, 3,
- 64,159,139, 87,113,227,237, 37,208,166,109,108, 61, 66, 32,145, 64,167,211,161,160,160, 0, 21,186,203,232,131,176, 22,175,205,
-202,202,138,107,173,236,203,100, 50, 98,173, 39, 89, 89, 89,113,206,132,199,109,163, 98,214,250,106,123,206, 89, 71,160, 37,225,
-118,166, 45,104,238,126, 51, 51, 51, 41, 33, 4, 9, 9, 9,164, 45,247,107,197,211, 79, 63, 77,191,252,242,203, 54,229,121, 78,
- 78,142, 47,128,233, 7, 15, 30,252, 15,199,113,122, 27, 17,228,243,120, 60, 79, 0,255,140,141,141,221, 99,143, 39,191, 48,159,
- 47, 17,138,197, 2,129,200,147,225, 19, 31,202, 19,121,112, 60, 30,159, 35, 12, 56,194, 55, 81, 30, 79,207,227,136, 78,205, 51,
-105, 60,133, 2,194,235,213, 77, 39,158, 26,194,161,216,126, 26, 21, 10,133, 82,163,209,176, 0,160, 86,171,185, 55,222,120,163,
- 65,240,151, 46, 93,250,114, 91,203,251,132, 9, 19,158,177,190,207,204,204, 92,215, 30,117,136,177,231,253, 47,153,149, 4, 93,
-101, 37, 94, 29,216, 15,182,125,247, 14,123, 33,150, 46, 4, 91,241,159, 54,109, 90,188, 76, 38, 35,211,166, 77,139,223, 48,237,
- 51,115,100,177,111, 80,163,235, 29,193,194, 53,249, 88,184, 38, 31,207,173,188,132, 39,222,251, 5, 51, 22,159,107,243, 3, 41,
- 41, 41,113,200, 48,184, 91,226, 95, 84, 84,212,162, 48,135,135,135,195,104, 48, 96,212,200,145,109,254, 29,107,152,124,219,182,
-109,144,203,229, 13,175,214, 12,173,150,196, 48, 62, 62,190,169,248, 55, 24,202,142, 52, 76, 44,107, 50,123,254,122,115,232,191,
-169,248,155, 76, 38,168,181,106,167,238,209, 26, 49,104, 26, 53, 72, 79, 79, 71,122,122,122, 35, 99,192,169,251,205,110,220, 30,
-202,179,179,157,122,102,173,137,255,236,217,179,177, 98,197,138, 6,241, 23,240, 5, 78,241, 36, 78,142, 38,150, 46,152,102, 95,
-206,112,105, 81,140,250,233,163, 64,211, 94, 69, 73, 97, 49,232,244,254,191,123, 43,105,175,130,223, 57, 24,240,243,187,171, 30,
-161,186,170, 0,218,180,141,160,148,226,194,133, 11, 24, 63,126, 60, 36, 18, 73, 35,225,247,247,247,135, 86,171,133, 86,171, 69,
-105,105, 41, 30,209,190,128, 47,252, 95,106,145,211,218, 7,222,218,243,177,126,214,180,191,220, 81,225,110, 47,103,197,250,221,
-166,226,111,207, 65,106,237,126, 51, 51, 51,105,122,122, 58,210,210,210,144,149,149, 69,219,122,191, 79, 63,253, 52,229,243,249,
-120,250,233,167, 93,174, 19, 57, 57, 57, 98, 0,255,202,202,202,122,227,189,247,222, 59, 78, 8, 9,183,190, 0,116, 13, 12, 12,
-244, 56,116,232,208,218,156,156,156,241,173,241,152, 40,199,227, 17,129,200,192, 82, 31,189,222, 24, 98,226,184,174, 38,142,139,
- 48, 17,210, 29, 60, 94, 32, 33,196, 15,132,231,195, 81, 4, 80, 3,231,167,212, 26, 61, 67,124, 88, 30, 51, 82,229, 80, 30,105,
- 52, 26,182,169,215,223,209,193, 56,226,253,107,202,203, 48,121, 88,180,211, 2,109, 53, 34,222,221,182, 4, 0, 26,196,223, 26,
- 69, 72, 76, 76,204,182, 26, 1, 37,202,155,136, 94, 56,218, 41, 35, 67,173, 53, 65,173, 53,161,172, 90,143,210, 74, 29,110,220,
-210,185, 36,124,214,202, 98, 79,252,255, 40,180,100, 4, 0,128,206,160,135, 78,167,115,153,219, 42,218,214, 62,242,224,224, 96,
- 91,111, 22,142, 54, 38, 77, 61,225,150, 66,137,142, 52,122, 6,163,222,236,249,235, 13, 48, 24, 27,139,191,209,104,132, 90,173,
-134, 74,169,250, 67,243,196,108, 48,165,217, 6,228,172,127,216,182, 45,205,101, 35,192, 86,252,173,194,207, 48, 12,196, 98, 49,
- 60,189, 60,218,148,230, 61,123,207,208,150, 94,246,190,187,111,241, 59, 8, 68, 44,216,132,231, 1, 0, 94,185, 87,113,190,160,
-218,108,176, 37, 60, 15,227,133,119,129,170,106,167,210, 51,119,238, 92,106,237, 14,112, 5,158,168, 2, 0,108,220,184, 17, 25,
- 25, 25,120,255,253,247,113,226,196, 9,232,245,122, 84, 84, 84, 88,189,178,134,235,195,194,194,160, 5,192,195,181, 63,164,188,
-180, 84,238,155,122,243,174, 26, 20,205,117, 11, 56,203,103, 27, 9, 75, 75, 75,107,211, 61, 91,197, 31, 0, 92, 53, 2,114,114,
-114, 58, 89,196,127,238,215, 95,127,125,241,173,183,222,122,104,203,150, 45,232,211,167, 15, 0,160, 71,143, 30,168,171,171, 19,
-189,251,238,187,167, 15, 29, 58,244,109, 78, 78, 78,120,179, 68, 4, 0, 71, 9, 56, 86,108, 50,177, 1, 38,214,212,213,104, 50,
-246,230, 49,164,139,144,207, 8,196, 2,158,150,239, 33,172,245,244,230, 41,121, 98,202,138,121, 60, 79, 62,107,240,185,118,230,
-172,232,177,224,143,236,166, 59, 63, 63,191, 74,173, 86,115,205,133,249,135, 14, 29,122,217, 96, 48,180, 91, 89, 26, 58,116,104,
-187,113,241, 91, 19,238,207,231, 62,253,187,216,150,220,192,171, 3,251, 97,101, 70,134,211, 99, 1,172,222,191, 85,244, 27,121,
- 41,137,137,217, 25, 25, 25, 0,128,192,193,157,156, 74,124,189,214, 4,149,134,133, 82,205,162,174,158, 69,173,138,117,250, 1,
- 52, 55,242,223,214,203,183,125, 95, 88, 88,136,218,218,218,187,214,104,172, 91,183, 14,225,225,225,176, 14,250,179,237,235,151,
- 74,165,116,221,186,117,208,105,181, 46, 27, 0, 82,169,148,110,216,176, 1, 37,165,165, 16,240,120, 8,237,212,169,145,248,223,
-127,255,253, 72, 73, 73,113,168,113,146,201,100, 36, 62, 62,190,145, 17,208, 52,146,225,232, 88, 5,131,222, 0,131, 94, 15,163,
-209, 0,150, 53, 53,136,191, 94,175,135, 70,163, 65,125,125, 61, 84, 42,231, 13, 0,219, 46, 0, 43, 92,245,252,183,165,109, 3,
- 40, 80,101, 17, 26,106, 46, 68, 32,148,154,141,128,180, 52,164, 36, 39, 59,221, 29,208, 84,252, 5, 2, 1, 68, 34, 17,196, 98,
- 49,196, 98,177, 75,247,221,168, 94,183,208, 37, 96,175, 75,107,198,186,237,160, 83, 35,112,107, 76, 52, 2, 17, 11,201,204, 79,
-193,150, 85, 2,126, 62,224, 87,111,197,143, 31,157, 6,120, 60,167,210,210,214,174, 0, 53,207,220,166,164,166,166,162,178,178,
- 18,107,215,174,197,208,161, 67,241,222,123,239, 33, 58, 58, 26, 90,173,182,169,135,102, 53,169,239,170,240, 59, 42,208,174,118,
- 7,180,100, 72,184,194,147,156,156,220, 32,252,174,212,141,230,196,191, 65,108,248,124,176, 44,235,108,119,128,119, 94, 94,222,
- 39,243,230,205, 59, 50,120,240, 96, 31, 0,120,231,157,119,144,159,159, 15, 0, 24, 61,122, 52,118,236,216,129,177, 99,199,122,
- 62,242,200, 35, 5,217,217,217, 89, 60, 30,239,145,219, 27,122, 32, 32, 48,128, 43, 44, 44, 96,179,229, 7,247,246,238, 29,153,
- 29,209, 35,252, 34,207, 91, 82,193, 35, 66, 53, 35, 18,104, 24,177,135,202,192,231, 25, 64,141, 60, 78,108,244, 86,149, 86,123,
-157, 56,116,110,100,144,127,232, 14,187,198,168, 77,159,255,206,157, 59,159,152, 62,125,250,215,214,176,191, 82,169,100,132, 66,
- 97,155,203, 82,123,133,253,237, 70, 0,172, 94,254,240, 94,145,208, 85, 86, 66, 93, 98, 22,193,241, 22,239,208,217, 40, 64,225,
- 47, 87,111,227,110,238,184,250, 66,185, 83,137,111,171,248,219, 10, 63,165, 20,221,186,117,107,244,153,209,104,108,120,213,214,
-214, 66,173, 86,163,166,166,230,174, 53, 30,214,121,254,251,246,237,107, 20, 9,176,138,255,144, 33, 67,160,211,105, 27, 26, 58,
-106,181,102, 28,108,152,214,124,182, 6, 70,163, 17, 93,195,194, 96, 52,153,154, 21,127,103, 26, 18,139, 17,112,155, 87, 98,157,
-186,216, 90, 36,227, 54, 3,192, 96,108, 16,255,147, 39, 78, 66,163,213, 66,165, 82,161,174,174, 14,181,181,181,141, 60, 59,103,
- 97,237, 6,112,181,223, 31, 0,170,171,170, 81, 93, 93,133,170,234, 26, 84, 85, 87,163,186,186, 26,213, 85,102,143,180, 95,255,
-254,168,177,188,119,214,251, 7,128, 97,195,134,253,238,245,123,122,194,203,203, 27,222, 94,222, 80,169, 84,241,109, 41, 79,173,
-117, 9,216,251,110,193,251,115, 33,152,249, 41, 2, 17, 11,126,238,167, 48,110,127, 30,240,243,193,174,103,147,112,125,215, 53,
- 60,184, 98, 19,192,191,203,203,138,232,174, 67, 18, 38,129, 90,173,134, 78,167,131, 70,163, 65,110,110, 46,150, 45, 91,214,236,
-229, 30, 30,214, 8,202, 85,167,197,219, 85,175,218,246,249, 54,125,222, 45, 29,183,197,200,104,174, 91,192, 25,158,132,132, 4,
-146,156,156,140,164,164, 36, 76,152, 48,193,229,200,196,151, 95,126, 73, 88,182,113,155,204,178, 44,156, 29, 11, 16, 27, 27,123,
- 37, 57, 57,121,232,150, 45, 91,198, 31, 61,122,212, 59, 33, 33,225,132, 85,252, 45,142, 42, 68, 34, 17,189,126,253,186, 96,239,
-222,189,125,253,253,253, 79,198,198,198, 22, 52,199, 85, 87, 91,199, 69, 70,244, 81,141, 30, 61, 58,233,226,197, 95,239, 83,170,
- 85,157, 40,107,100,193,192,200,234, 25,189, 94,175,215, 42, 81,174,228,244, 58, 85,105,113, 57,251,227,238, 61,203,131, 2,131,
- 43, 12, 6,141, 93,247,189, 57,239, 95,161, 80,240, 1,192,199,199,167,195,118, 11, 48, 45,121,255,219,254,253,134,217,106, 46,
- 47,107,244,153,179, 99, 1,166, 77,155, 22,191,230, 95, 31, 3, 48, 15,248,203,200,200,144,219, 78, 45,204,200,200,144, 79,248,
-230, 33, 0,192,153, 21, 63, 99,218,180,105,241,119,235,230,109, 43, 73, 73, 73, 73,131,183,111, 21,125,155,204,133, 74,165,130,
- 78,167,179,105, 68,238, 94, 26,159,121,198, 60,246,195,200,178,184,120,241, 34,206,158, 57,131,161, 67,134, 66,167,211, 65,171,
-213, 65,167,213,226,219,111,190,129,245, 58, 71, 42,250,170, 85,171, 48,160,255, 0, 24,141, 70, 92,185,114, 5,172,209,128,210,
-146,210,118,125,166,214, 99,203,154, 5, 8, 15, 15,119,168, 97, 50, 24,245, 96, 77,230,176,255,241,227, 63, 67,173, 85,163, 94,
-165, 68, 93, 93, 29, 20,181,181, 80, 40,106,218,100,136, 89, 35, 1,109,241,112,142, 28, 57, 2,149, 74, 5,149, 74,105,249,175,
- 66, 80, 96, 32,250,245,239,143,223, 46, 93,194,225, 35, 71,156,230,180,122,255,124,190, 0, 30, 30, 30,240,242,242,130,183,151,
- 23,188,188, 60, 80,163,168,137, 7,144,125,167, 67,253, 45,225,124, 65, 53,140, 23,222, 69, 53,114, 64, 18, 87,130,196,254, 7,
- 5,239,207,197,212, 21, 95, 67, 44, 96, 0, 1,223,252,114, 1,174,118, 5,148, 78,249, 12, 1, 91,167, 64,163,209, 32, 32, 32,
- 0, 10,133, 2, 10,133, 2,199,142, 29, 67, 89, 89, 89, 67,152,184,225,250,210, 82, 60,235, 47, 65,144, 71,101,107, 30,112,188,
-173,168,218, 14,146,179,190,183,126,102,189,214, 21,239,220,209,238, 1, 71,197,223, 85,207,191,185,251, 77, 72, 72, 32, 19, 38,
- 76, 32,109,185,223,166, 70,128, 43,226,111, 69, 80, 80, 80,222, 67, 15, 61,244, 72,106,106,106,223,243,231,207,199, 74, 36, 18,
-222,212,169, 83,137, 72, 36, 2,199,113, 36, 49, 49, 49,239,197, 23, 95, 28, 50,104,208,160, 93,255,252,231, 63,159, 48,153, 76,
-213,173,196,188,185, 95, 47, 93, 57, 57,104,240,144, 71, 79,158, 56, 49, 99,215,238,255, 45, 61,117,226, 68,167,139,249,191,137,
-175,148, 22,208,111, 63,254, 94,146,186,234,253, 1, 89,187,119,175,234,221,171,247,143, 94,161,158, 71, 98, 99, 99, 77,112, 48,
-229, 9, 9, 9, 56,121,242,100,212,186,117,235,222,213,233,116,130,247,222,123,239,131, 93,187,118,205, 46, 45, 45,189,187,194,
-209,214, 46,128,192,107, 69,168,177,132,254,109, 49, 62, 56, 24, 43,241,155,227, 94,135, 37,196,255,219,233,139,240,235, 27,132,
- 9,223, 60,132,140,199,126,144, 91,195,254, 86,241,183,122,255,206,204, 50,216,145,218, 62, 35,241, 9, 33,184,116,233, 18,172,
-133,181,105,152, 85, 32, 16, 64, 32, 16,160,178,178, 18,137,137,137,119, 61,147,172,163,254,215,173, 91,135,145, 35, 71, 66,167,
-215, 67,171,211, 66,103, 25,220,164,213,153,187, 1, 86,175, 94,109,183, 49,145, 74,165,116,197,138, 21, 48,153, 76, 56,125,250,
- 12, 4,124,115,216, 54, 50, 50, 18,215,138,138, 80, 90, 90,138,173, 91,191,195,236,217, 15,227,224,193,131,212, 54, 18,208, 90,
- 3, 36,147,201,132, 0, 88,169, 84,202, 53,231, 1, 57, 51, 85,209,234,249,231,230,230, 66, 93,175,105, 48,192,148, 42, 37,148,
-202, 58, 40,149,245, 46,135,194,173,222,191,101, 37, 64,151, 12,129,217,179,103, 55, 58,142, 8, 15, 71,191,254,230, 65,113,191,
- 93,186,132,107,150,136, 71,211,235, 28,193,152,123,198, 64, 36, 20, 65, 34,145, 64, 44, 22, 67, 36, 18,161,188,188,220, 97,241,
-183, 23,234,119,117,141,128, 25,203, 54, 96, 7,128, 7, 82,255, 15, 52,237, 85,144,148, 85, 56, 95, 80, 13, 18,224,143,171, 37,
- 74,179,247,239,100, 23, 64,211,174, 0,167,167, 7,106,181, 0,175,160, 73,120,223, 44,244, 70,163, 17, 95,124,241, 5,198,143,
-255,125, 92,216,193, 39,195,128, 10, 13,250,238, 81, 32, 42,184, 71, 75, 13,120,118,147,190,111, 57,208,208,252,203,155, 94,235,
-138, 96,183,214,111,239,170,231,239,170, 33,113,167,239,215, 98, 4,180,121, 22, 64,120,120,248,214,177, 99,199, 6,159,203,203,
- 75,209,106,181, 67,228,242, 67, 18,145, 88,196,103, 8,131, 67,135, 14,121, 15, 24, 48, 96, 83,114,114,242,127, 42, 43, 43,237,
-122,235,179,103,205,228,126,220,251,227,225,161, 67,135, 45, 52,176,250, 7,174,230, 95, 89,202, 21, 21,176, 0,168, 24,140,113,
-112,239,190,105, 33, 33,193,123,120,124,225,183,255,125,107,185,225,219,141, 27, 44,125,124, 45, 99,228,200,145, 31, 38, 36, 36,
- 0, 0, 42, 43, 43,145,149,149,229,243,213, 87, 95, 45, 5,128,147, 39, 79,142, 28, 56,112,224,190, 63,133, 1, 96,245,206,239,
-255,118, 75,235, 94,134, 19, 83, 2,173,214,111,244,194,209, 8, 28,220,169, 65,244,109, 67,255,103, 86,252,236,148,229,218, 94,
-115, 82,173,105,235,223,191, 63, 46, 92,184,208, 72, 88,106,107,107, 11, 0,244,106,238, 59,174,174,189,220,214,116, 54, 61,255,
-237, 55,223, 66,167,211, 65,111,208,195, 96, 48, 96,197,138, 21,176, 39,254, 86,112,156, 9, 98,137, 23,180, 90, 29, 46, 93,188,
- 8,190, 64, 0,163,193, 0, 15, 79, 15,108,221,186, 21, 60, 30,207, 58,119,190,213,123, 93,177, 98,197, 62,169, 84,106,144,201,
-100, 33,214,116, 54, 89, 7,192,169,208,230,194,133, 11,145,147,147,131,250,250,122,212,171,213, 80, 41,149, 22,241, 87, 66,165,
- 84,161, 94, 85, 15,181, 77,131,239,200,179, 27, 62,124, 56, 61,117,234, 84,131,247,223,220, 52, 64, 71, 23, 1,138,139,139,187,
- 45, 47,172,162,127,246,236,217, 6,111,222,209,123,142,137,137,161,214, 69,126,188, 60,188, 32,150,136,161, 82,169,226,109,250,
-176,157,106,120,239,212, 98, 64, 86, 35, 96,122,234, 87,160,219,129,160, 39,101,200,126, 41, 9, 99,151,111, 6, 4, 2,120,138,
-219,214,207,217,212, 16, 0, 0,121,142,189, 96,227, 45, 12,222,231,129,242,255,105,160, 88,242,251, 89,163,209,136,113,227,198,
- 1, 0,194,252, 37,248, 73,214, 13,239, 47,187,129,207,206,104, 91,101,179,245,248, 1,243, 64, 56,107,195,222,116, 80,156,179,
-211,226,108,199,239,180,213,243,111,174, 77,112,133,235, 78,222,175,173, 17,208, 30,229,111,224,192,129,159,168,148,170,189, 35,
- 98,134,143, 84, 41,149, 1,172,137,213,135,134,134, 86,134,133,133,149, 43,149,202,243,149,149,149, 14, 55, 10, 83, 38, 79,225,
- 0,108, 61,122,228, 68,110,236,216,177, 63, 72, 36, 18, 95, 2,202, 17, 66,192,113,180, 78,171, 86,200, 47,231, 21,171,190,221,
-184,193,161,118,222,250,204, 0,243, 64,234,166, 3,245,150, 45, 91,246,159, 63,133, 1,144,152,152,152,221,150, 5,127, 28, 41,
-172, 86, 67,192, 42,252,237, 41,232,109, 73,219,224,193,131,113,242,228, 73, 84, 86, 54,132, 8,123, 1, 64,117,181, 57,162,244,
-216, 99,143,253,161,153,213,244, 25, 81, 74,233,163,143, 61,138,213,171,215, 88,250,204, 89,248,250,250, 18, 71,191,111,133, 68,
- 34,182,242,153,189, 41,181,198,246, 59, 0,236,110, 54,209,127,197,138, 21, 87,164, 82,105,133, 76, 38,227,217, 14, 8,180, 76,
- 11,116,184,161,179,206,125,143,141,141,109,247,103, 55,124,248,240,166,123, 1, 52,124,238,236, 10,128, 50,153,140,100,103,103,
-211,173, 91,183, 54, 90,168,199,202,237, 74,121,142,139,139, 35, 70,214, 8,163,202,216,174,247,222, 90,232,223,217,189, 1,102,
- 44,219, 0,216, 44,252,115,239, 27,191,143, 75, 82,183, 83,122, 27, 69, 0, 6,182,110,124,150,198,150,162, 20, 64,244,251,254,
- 88,114,186, 15,130, 1, 84, 22,168,209,187,119,111, 0,192, 39, 75,252, 49,105, 68, 48, 34, 38,229, 59,244,219,206, 76,117, 75,
- 75, 75,147,183,182,236,177,189,246,166, 61,218,188,182,114,221,141,251,109, 79,140, 30, 51,250, 10,128, 43,183, 69,172, 3, 3,
- 93,226, 27, 55,126,100, 17,154, 29, 21, 26,134,222,125, 6, 57, 99, 72,181,235,125,182,199, 34, 63, 46, 25, 0,119, 90,192,246,
-236,217, 19,151,177,162,227,237, 5, 96,173, 72, 35, 70,140,192,158, 61,123,116, 22,209,231, 0,120,220,137,200, 67, 59, 21, 18,
- 34,147,201, 26, 60,251,214,196,255, 78, 98,225,194,133,182,241,212,134, 6,219, 58,141,208, 25,111,231, 78, 62, 95, 91,238,236,
-236,236, 54, 47,251, 27, 23, 23, 71,226,226,226,218,156, 46,123,107,251,183, 7,218,210, 37,176,104,209, 34, 20, 22, 22,182, 91,
- 90, 28, 89,222,215, 89,156,121, 77,129, 51, 48, 15, 12, 29,159, 44,193,254,227,125, 16,234,225,133, 95, 79,221, 66, 95, 7,197,
-223, 94,249,235,168,203,225,182,199, 90, 2,127,166,251,237,128,207,191, 75, 59,243,173,186, 91,105,191,235,187, 1,222,169, 8,
- 67,123, 26, 1,137,137,137,226, 63, 89, 1, 36,127,240,111, 91, 87,168, 97,173, 6,128,187,241,232, 56,104,107,151, 64,207,158,
- 61, 73,207,158, 61,219,165,189,113,102, 31, 0, 87,113, 36, 77,139, 35,105,249,238, 58,235,134, 27,246,156,200,168,168, 40,234,
-126, 12,110,184,225,134, 27,110,184,241,247, 2,227,126, 4,110,184,225,134, 27,110,184,225, 54, 0,220,112,195, 13, 55,220,112,
-195, 13,183, 1,224,134, 27,110,184,225,134, 27,110,184, 13, 0, 55,220,112,195, 13, 55,220,112,227, 47,129, 70,179, 0,230,205,
-155,231,242,200,212,230,230,137,187,249, 58, 30,223,220,185,115, 93,226, 27, 54,108,216,109,124,103,207,158,117, 57,125,205,241,
-253, 89,242,195,217,103,184,126,253,250,187,146,190,246,206,143,187,153,191,246,166,137, 58,251,252,218,155,207,221,190,184,249,
-154,225,235, 10, 64, 1, 64, 8,160,182,163,165,207,105, 3,192,141,191, 62,214,175, 95,239,126, 8,127, 51,248,249,249, 49, 48,
- 79,207,228,215,213,213,113,148, 82, 83, 71, 74,159,117,223,249,172,172, 44,218, 30, 11,205,180,215, 74,123,110,220, 57,236,218,
-181, 43,110,234,212,169,217,127,242,219,176,174,125, 37,113,214, 0,232,144, 17, 0, 55,254,122,160,148, 54,218,234,216,213, 8,
-192,218,181,107,237, 94, 51,113,226,196,184,204,204,204, 70, 43,139, 77,152, 48, 33,254,192,129, 3, 46, 85,244,244,244,244,102,
-249,146,146,146, 58, 4, 95, 71, 6, 33,132,244, 8, 13, 69, 81,121, 57,173,173,173,181,238,207,224,212, 18,131,182,198,226,169,
- 29,171, 75, 8,193,115,178,189,121, 25,210,201, 67,190,161, 20,202,245,251,242,158, 91, 52, 99, 36, 1, 67,249, 10,149,142, 14,
-159,249,188,211, 91,114,102,101,101,197, 89,151,156,181,252,119,105,185,217,166,226,111, 45,247,109,221,104,167,185,239,186,202,
-217, 30,124,109,221, 50,216,149,104,201,157, 16,255, 61,123,246,200,167, 78,157,250,103, 55,206,172,251,176,223,209,174,244,119,
-222,120,129,241, 18,248, 50,122,177,144,211,215,106,249,245, 90, 37,251,193, 39,171,219,101,135,193,219, 12,128,246, 20, 8, 87,
-185,156,229, 35,132, 48, 22, 43, 76, 75, 41,229, 58, 90,250,218, 75, 96,219,195, 0,176, 54,234,182,105, 37,132,232, 41,165,162,
-182, 68, 10, 8, 33, 20, 0, 86,173, 90,213,104,199,176, 5, 11, 22,200, 9, 33,160,148, 18,103, 27, 37, 0,224,190,247,111,116,
-158,153,149, 41,207,204,204,116,186, 1,108, 79,190, 63, 67, 20,133, 82, 74,227,123, 69,208,248, 94, 17, 0,128,114, 3, 59,167,
-147,144,191,217,250,249,111,202,122, 81,153, 3, 27,167, 0,192,201,237,159,230,115, 28,194,238, 25, 19,228,243,193, 75, 99, 15,
- 12, 25,226,119,253,185,229, 35,255, 11, 0,183,234, 52,255, 39,224,147,255, 1,228,226,220,185,115, 7, 58,251,108,154, 46, 69,
-219,150,229,102,109,197,191, 61,140,128,150,190,227,170, 88,182, 7, 95,114,114, 50,210,210,210, 28,186, 39,103, 34, 42,173,241,
-181, 87,100,198, 86,252, 57,142,195,250,245,235,177,121,243,102, 58,103,206, 28,226,100, 30, 11,101, 50, 89,187,172,151,189,120,
-241,226,185,169,169,169,174, 86,104, 31,139,231,175,190, 19,117,120,211,154,181,204,163, 97, 17,226, 23,146, 30, 23,134,244, 15,
-227,243, 73, 8,163,169,171, 99,197, 8, 53, 48, 93,186, 26,116, 55,175, 25,218,250, 27,124, 71, 26, 55,169, 84, 26, 12, 96, 56,
-128, 83, 50,153,172,178,131,121, 58, 62, 0, 18, 0, 76, 7,176,147, 16,146, 69, 41, 85,182, 3,239,119,148,210,135, 93, 21,216,
-142, 2,134, 97, 90, 53, 82, 8, 33, 35, 1, 8, 9, 33, 33,148,210,138,150,174,107,205, 64, 33,132,208, 23, 95,124, 17,221,187,
-119,191,109,187,208, 85,171, 86,197, 23, 23, 23,203, 9, 33,212, 81, 35, 64, 42,149,210,141,207,123,226,241,177,183,111, 46,195,
-125,239,143, 77, 63, 25,240,164,147, 94, 83,123,242,213,213,213,197,189,254,250,235,242,148,148, 20,196,199,155, 87,182, 59,119,
-238, 92,220,218,181,107,229,221,187,119, 7,199,113,208,106,181,136,139,139,195,196,137, 19,237,114, 10,235,212,113,125, 95,223,
- 38,207,140,238, 26,223,233, 95, 19,178, 1,128, 45,103,227, 46,191,205,202, 77,221,125,160,228, 60,161,208,250,160,194,247,100,
-252,211,139, 66,236,122,199,189,186,117,234,212, 93, 40, 41,123,254,185,199,244,161, 18,161, 80, 89,163, 37, 43,190,218,178,249,
-141,103, 30,133,191, 68, 66,117, 70, 19,253,247,234,175,244, 0, 72,231,206, 65,252,242,242,106, 38, 42,170,249,157, 53, 71,132,
- 28,136,188, 25,230,225, 23,123, 79,240,170, 97, 49, 1,130,141, 27,175,134, 7, 7, 73,170, 62,124,233,248,170,162,235,195, 76,
-147, 39,117,206,205,191,162, 42,126,242,241, 94,137,214,114,227, 76, 29,176,221, 32,167, 45, 94,104, 83,241,111, 90, 63, 93,225,
-239,136, 17, 0,139, 16, 83,171, 17,144,156,156,108,123,190,145,104,219,110,236,227,170, 81, 97,229, 73, 75, 75,107,115,148,192,
- 86,252, 23, 44, 88,128, 83,167, 78,209,159,126,250, 9,115,230,204,113,150,202, 32,149, 74, 5, 50,153,140,109,135, 38,178,124,
-241,226,197,211, 83, 83, 83,119,186,240,221, 48, 0, 53, 0,194, 1,156,203,201,201,233, 1,224, 51, 0, 1,182,252, 0, 62,137,
-141,141,117,120,207, 5, 45,167,229, 27,170,244, 30,147,167, 78,247, 85,192,232, 43, 16,240, 69, 74,157,152, 47, 20,106, 89,158,
-143,167,222, 32, 49,106,249,229, 55, 85, 98,158,168, 86,103,210, 27,164, 82,105,139,245,183,205, 17, 0, 66, 72, 55, 0,159, 3,
- 40, 5,240,162, 84, 42,253, 23,165,244,198,221,242, 96,237,136,116, 32,128, 77, 0,110, 2, 56, 6,224, 1, 0, 79, 19, 66, 30,
-167,148, 86,183,145,126, 22, 33,100,142,189,254,210,187, 25, 98,191, 67, 24, 13,224, 50,128, 8, 0, 21,196,162,212,142, 26, 52,
- 19, 39, 78,140, 3,208, 72,252, 23, 44, 88, 32,183,141, 6, 88, 62,147, 79,156, 56, 49,206, 94,119, 64,122,122,122, 28,128, 70,
- 98,205,204, 82,192,214,123,127,124,172, 16, 79,126,170, 70,122,122,122,156,189,240,125,123,243, 1,192,241,227,199,229, 98,177,
- 24,185,185,185,141,246, 59, 96, 24, 6,111,190,249, 38,177, 54,118,187,119,239,150, 79,156, 56,209,110, 6,116, 58,126, 81, 78,
-197, 2, 12,169, 20,202, 43,126,223,138, 21,132,161, 24,242,166,129, 0, 6, 92, 56,114, 61,238,230,246, 41,114,224, 68,171,141,
-112,124,175, 8,218, 93, 40,193, 43,207,206,209,135,122, 9,133, 85, 23,114,136, 39,195,199, 11,227, 34,209,197, 79,130,235,185,
- 71,137,214, 64,201,130,185,143, 25,226,123, 69,208,126, 30,222, 40,163, 85,100,216,176, 97,205,242, 5, 5, 9,239, 21, 10, 25,
-241,177, 99,101, 47,178, 38,221, 71,161, 93,123, 26,253,130, 4, 68,169,188,234,209, 51,194, 35, 40, 32, 64, 84,201, 81,165,254,
-199, 19, 21,234,121,227,254,152, 2,220, 52,236,111, 91, 55,157, 53, 2,172,215,216,142, 35,176,119,157,189,237,183,219,147,207,
-214, 8,144,201, 20, 0, 20,144, 74,253,209,156,104, 59,138,150,140, 10, 75, 68,166, 77, 81, 15, 91,241,223,189,123,183,156, 97,
- 24, 48, 12,131,113,227,198,225,232,209,163,141,242,203, 81,152, 76,166, 60, 30,143,103,148, 74,165,124,153, 76,214,214,241, 44,
-146,234,234,234,239, 3, 3, 3,103,166,166,166,110,119,242,187, 90,152,247,139, 81,229,228,228, 12, 2,176,253,224,193,131,125,
- 56,142,179,213, 40,240,120,188,135, 0,100,199,198,198,198,219, 35,204, 47,204, 23, 75,132, 98, 95,129, 64, 20,204,240, 73,103,
-202, 19,249,113, 60,158,136, 35, 12, 56,194, 55, 82, 30,175,158,199, 17,149,154,103,170,241, 20, 10, 8,175, 87,183, 58,241,212,
- 16, 22,197,119, 46, 2,240, 17,128,131, 22,203,230, 89, 0, 31,173, 95,191,126,166,139,130,237, 15,224, 69, 0, 35, 0, 36, 2,
-216, 3,224, 36,128,143, 41,165, 10, 23, 40,143, 88,210,181,150, 82,202, 17, 66, 60, 1, 60, 97, 57, 63,176, 13,134,133,175,229,
-173, 39, 0,165, 51, 30,118, 11, 17, 20, 33,128, 55, 0, 44,149,201,100, 6,116, 44,140, 0,144, 3,160, 19, 33,100,171, 37, 79,
-190,105,106,208,180,100,160,100,102,102,202,109,195,254, 11, 22, 44,104, 56,182,125,191,106,213,170,120,139, 97,208,106,141,207,
-204,204,148,219,134,233,153, 89, 10, 92,217, 99,222,133,145, 73,252,166, 65,180,185,239,253,193,204,202,148,219,219,208,167, 57,
- 62,107, 99,198,204,146, 82,103,249, 40,165,113,199,142, 29,195,156, 57,115,240,197, 23, 95,224,204,153, 51,113,209,209,209,217,
- 77,175, 17,139,197,242,206,157, 59, 59, 18,171,143,235,124,236, 23, 92,158, 19, 7,175, 47, 46,128,148,105,226,104,103, 15, 11,
- 31,177, 92,130, 56,129,174,187, 60,160,115,235, 91,217,198,247,138,160,115,255, 57,203, 16,234, 41, 20, 24,175,158, 18,250, 7,
-123, 19,121,153, 18, 51,163,186,161, 95,152, 31,132,181,151, 33, 87,105,209, 77, 32,130, 31,225, 9, 22, 63, 61,135,214, 11, 69,
-249,241,189, 34, 40,124,252,154,229, 84,212,170, 2, 70,142,244, 90,165,100, 71, 45,242,246,175, 20,233, 24, 79, 78,226,101,208,
- 7, 4, 5, 50, 30,126, 98,190,162,166, 76,164,172, 99, 33,168,211, 19,219, 50,211,154, 65,107,233,247,151,219, 19,206,228,228,
-228,120,123,227, 1,154,243,252,155, 26, 2,206, 24, 1,214,207, 90, 19, 99,219,243,246,132,177, 41, 31,221,230,127,123,123,147,
-162,128,163,124,173,133,251,219, 34,218, 77,141, 10, 0, 8, 8,200,106, 23,241,159, 55,111,158,185,251,141,227,240,234,171,175,
-226,163,143, 62,106, 16,255,181,107,215, 58,205,205, 48, 12, 12, 6,195, 89,161, 80,200,182, 67, 36,160, 6, 0,170,171,171,183,
- 7, 6, 6,198,167,166,166,202,157,248, 46, 31, 0,158,124,242, 73, 81, 78, 78, 78,102, 86, 86, 86,167, 37, 75,150,176,111,189,
-245, 86, 35, 93, 13, 12, 12,196,161, 67,135,226, 0,164,197,198,198, 38,183, 70,200, 35, 2, 31, 3, 75,187,112,156, 49, 66,200,
-227,245,160,132,132, 16, 62,159,240,121,188, 58, 66,136, 22,132,167,228, 40,252,169,129,243, 80,154,140,232,229,195,106,153,145,
- 42,174,221, 12,128, 38,125,195, 97, 0,186, 81, 74,173,130,255, 62, 33,228,132, 84, 42, 13,163,148,150, 58,227,193, 18, 66, 30,
-179,136,245, 7, 0, 22, 1,120,212, 18, 66, 73, 6, 80, 76, 8,121,150, 82,250,141, 19, 34,253, 31, 0, 87, 41,165,107, 8, 33,
- 34, 75,133,103, 41,165,159, 17, 66, 38, 17, 66,254, 67, 41,253,127, 46, 22,138,241, 0, 42, 1,220, 11,224,127,206,124,177,185,
- 8,128, 84, 42,125, 10,192,219, 0,202,231,206,157,187,174,131, 69, 0, 6, 90,210, 54, 1,192,100, 0,215,237, 25, 52, 45,193,
- 86,240,109, 69,191,233,184, 0,135, 43,186,141,248, 3,192,149, 61,143, 53, 50, 2, 92,225,179,109,204,100, 50, 25,177, 53, 2,
- 28,193,225,195,135, 97, 48, 24, 16, 19, 19, 19,255,211, 79, 63,201,139,138,138,228,209,209,230, 45,117, 57,142, 67,106,106, 42,
-173,175,175,135, 64, 32,192,140, 25, 51,236,222,183, 46,247, 36, 24, 3,139,218,152,240,120,193, 79, 55,229, 87, 55, 28, 70,175,
- 55, 38,155, 69,139,163,200, 75, 21,210,154,122,111,104, 5, 94,152, 48,239,138,253,231,200,240,234, 43, 47,228,250,234,244, 38,
-198, 87, 34,162, 73, 81,221,225, 35, 17,144,146,234,122,120, 50,124,164, 12,235, 78,143,255, 90,129,159,255,183, 15, 61, 60,189,
-232,121,149,242, 58,128,190, 45,209,229,158,237,242,220,232, 97, 85,135,189,248, 17,172,144,189,213,107,252,152, 20, 47,157,193,
-115, 10,207,235, 36,163,172,173,241, 40,186,116, 50,194,104,184, 84, 89, 88,160,246,177,212, 25,187, 66,229,168,119,106, 29, 31,
-208, 82,255,115, 75,222,180, 61,175, 82, 42,149, 82, 87, 67,166, 29, 9, 77, 61,127,179,120, 3,105,105,237, 55, 72,176, 61, 60,
-127, 74, 41, 88,246,119,141, 30, 59,118, 44,142, 30, 61,234,146,248, 91, 96, 20, 8, 4, 38,142,227,142, 49, 12, 99,108,163, 17,
- 16, 98,125, 83, 93, 93, 45, 15, 12, 12,148,166,166,166, 58,186,115, 86, 81, 74, 74,138,207,225,195,135, 83,179,178,178, 58,125,
-253,245,215,220, 19, 79, 60,193,223,178,101, 11,222,121,231, 29,228,231,231,163, 71,143, 30, 40, 47, 47,199,187,239,190,107,122,
-251,237,183,147, 0, 60, 27, 27, 27,251, 89,139,140, 28,235,107, 2,211,131,112, 24,104, 4, 23,233, 33, 16, 9,133,124,166, 76,
- 44,224, 41,121, 18, 97,149, 72,196,171,215,155, 56, 15,190,145, 31, 96, 96,245,166,107,103,206, 42, 30, 11,254, 72,115, 28,174,
-233,135,189, 8,192, 36, 0, 57, 77, 6,142,229, 0,152,180,126,253,250,175,156, 16,235, 71, 0,188, 4, 32,188, 73,104, 94, 1,
-224, 23, 66,200, 39, 0, 14, 16, 66, 76,148,210, 45, 14,240,121, 0, 19, 92,166, 19, 0, 0, 32, 0, 73, 68, 65, 84,152,107,245,
-242, 41,165,250, 38,151, 60, 14,224, 87, 66,200, 74, 74,169,198,149,240, 63,128,175, 44,255,157, 50, 0,154, 10,166, 84, 42,253,
- 7,128,231, 44,207,114, 21, 33, 68, 47,147,201, 54,116,132, 6,132, 16,210,219, 18,194,250, 17, 64, 6, 0,107, 62,193,209, 8,
-192,223, 13,165,165,165,242, 81,163, 70,129, 16,146, 61,106,212, 40,252,240,195, 15,120,232,161,135,226, 58,117,234, 36,103, 24,
- 6,139, 23, 47, 38,150,198, 36,110,235,214,173,114,189, 94,143, 17, 35, 70,180,216,208,141,185,118, 83, 94, 62,170, 63, 64, 72,
-246,175,161,166,248,129,231, 2,228, 58, 14,241,230, 46, 0, 96,200, 98, 3, 1,170,161,174,174,139, 59,180,181,183, 92,237,125,
- 34,254,225, 39,124,154,245,138, 75, 12,236,202,245,235,183,188, 26, 28, 36, 41,170, 83, 27,124,195,253, 61, 5,201, 67,123,122,
- 12, 11, 23, 17,157,198, 4,141,150,195, 85,162, 53,101, 20,149,106, 10,202,235, 77,157,132,226,178,114,131,110,226, 13,189,241,
- 3,111,224,149,230, 56,125,252,195,186,106,235,175,116, 25,144,112, 31,115,241,120,217,248,210,223,126,184,209,123,248,220, 16,
- 94,255,168,146,179, 71,191,175, 35, 60,159, 17, 28,199,213,220,186,165,181,107, 69, 53, 21,108,123,199, 86,111, 54, 45, 45,173,
- 69,193,182, 13,175, 55,141, 4, 56,114,253,159, 21, 9, 9, 9,196,214,235,183,133,109, 8,191, 45,104, 15,158,250,250,122, 57,
- 0,240,249,124,188,252,242,203, 56,117,234, 20,126,250,233,167,182,210,234, 1,152,244,122, 61, 91, 90, 90,154, 25, 22, 22,102,
-180, 23, 89,108, 5, 42,219,131,234,234,106, 89, 96, 96,224,131,169,169,169,142,180,251,190, 58,157,174,207,194,133, 11,167,206,
-155, 55,143, 14, 30, 60,152, 0,104, 16,127, 0, 24, 61,122, 52,118,236,216,129,177, 99,199, 50,143, 60,242, 8,205,206,206, 94,
-195,227,241,180, 30, 30, 30,208,104,110,151, 38,142,163,186,108,249,193,244,222,189, 35,139, 35,122,132, 95,225,121, 75,202,120,
- 68, 88,199,136, 4,117,140,216,163,194,192,231,105, 64,141, 2, 78,108, 12, 81,149, 86, 7,157, 56,116,238,205, 32,255,208,183,
- 92,125,144,173, 70, 0,164, 82,233, 68, 0,155,155,120,181,135, 0,204,153, 59,119,238, 87,142,120,176,132, 16,158, 37,252, 61,
-173,165,126,121, 74,105, 53, 33, 36, 5, 64, 6, 33,228,123, 7,230, 41, 63, 2,224, 0,165,180,174, 5,190, 58, 66,200, 1,203,
-117, 95, 56, 41,138,247, 1, 8, 4, 48, 31,192, 86, 66,200,125,148,210, 67,174, 68, 0, 8, 33, 73, 0,222, 7,208,131, 82,170,
- 38,132,140, 6,112, 93, 42,149,170, 40,165,233,142, 70, 0,164,102, 83,223,145, 70,139,200,172,110,128, 99, 24, 3,224, 4,165,
-148, 18,179,219,116, 29,128,154, 16,210,205, 58,206,195,153, 8, 64, 83,143,191, 45,222,127, 67, 88, 62,241,155,134, 40, 64,100,
- 27,188,255,223,195,252,191,135,111,165, 82,231,188,127,163,209, 72, 79,157, 58, 5,111,111,111,228,229,229, 81,147,201, 4,165,
- 82,137, 75,151, 46,201, 3, 3, 3,209, 36,236,151, 61, 96,192,128,248,109,219,182,201, 71,140, 24,209,124,184,207,104,164,221,
- 78, 93,128,208, 59, 12,130,188,106, 26,106,242,134, 74,201,192,116,169, 30, 8,108,188, 35,181,103, 32,155,221,125,248,233,248,
-125,219,103,201,129,189,205, 54,118, 87,110,220,120, 45,178, 91, 55,160, 74,251, 42, 0,228,107,149,216, 45, 42,173, 28,112,239,
-248,224, 1,134, 60,252,114, 93,129,221,231,110,241, 11, 42,235,125, 0,160,220,160,243,191,161, 55, 38, 23,148,150,238,136, 10,
- 14,110,214, 0,184,119, 74, 10,227, 33,156, 56,152, 85,255, 82,220,189,127, 66,159,186, 27,219, 13, 87,127,201,172, 53,114, 94,
-183, 42,138,127,174, 80,214,120,142, 0,195,144, 26,149,206, 87, 58, 43,186,155,236,251, 51, 55, 90, 42, 51, 50,153,140,216, 70,
- 0,108,189,203,166,225,118,171, 72, 39, 39, 39, 35, 33, 33,129, 52,183,208, 73, 91, 70,227,187,186,112, 74, 71,131,181,186, 75,
-165,254,183, 69, 4, 92,141, 42,164,165,165,181,139,248,111,222,188,153, 30, 57,114, 4,116,155, 63, 72,138, 2, 31,126,248, 33,
- 40,165, 96, 24, 6,235,214,173,115, 57,178,160, 80, 40,244, 1, 1, 1,241, 71,142, 28,217, 59,126,252,248,201,205,149, 31, 39,
-224,103,169,175,115,171,171,171,215, 7, 6, 6, 62, 6,160,102,241,226,197,255, 72, 77, 77,181,231,168,213,237,218,181,171,116,
-223,190,125, 95,197,199,199, 63,213,175, 95, 63, 36, 36, 36,208,172,172,172,134,116,100,100,100, 64, 36, 18,225,250,245,235,216,
-187,119, 47,233,210,165, 11, 27, 27, 27,251,211,165, 75,151,154, 37,140,140,232, 83,166,213,234,230, 30, 57,114,100,125, 96, 80,
-160,210,215,199,167, 24, 66,161,158,213, 51,245, 44, 79, 95,171,227, 43,171, 60,245,158,226,155, 21,149,190,135,246,237, 93, 63,
- 96,224,160,247, 13, 58, 77,125,187, 24, 0, 82,169,148, 72,165, 82,107,226, 59, 89, 94,135, 45,211,236, 26,162,160, 0, 22, 16,
- 66,186,192, 60,194, 17, 0,154,181,208, 45,162,242, 2,204, 3,244,174, 53,225,105,138,107,150,235, 94, 32,132,124,212, 10, 31,
- 1, 48, 3,192,114, 59,124, 95, 3, 88, 68, 8,249,202, 78,250,108, 11, 77, 56,204,227, 29, 98, 96,238,251,127, 19,192,105, 66,
- 72, 47, 0, 69,182, 54,134, 3,124, 15, 3,120,218, 34,178, 90, 75, 90,181,150,227,117,132, 16, 33,128,239, 90,227,179,228,197,
- 99, 0,230, 57,106, 0, 72,165,210,181, 0,190,105,137,207,194,185, 18,128, 55, 0, 95, 0,187, 44,105, 19,195, 60, 79,252, 23,
- 0,163, 8, 33,243, 1,252, 4, 96,119, 75,233, 3,204,243,232, 91,232,235, 71,211,177, 1, 19, 38, 76,176,107, 12, 76,152, 48,
- 33,158,153,245,123,191,189,213, 8,176,190,183, 13,231,187,204, 55,235,246, 41,129,142,240,157, 59,119, 14,221,187,119,199,203,
- 47,191,220, 80,102, 54,109,218, 68,115,115,115, 49,101,202,148,219,174,247,240,240,144,139,197,226, 22,249,194,207,157, 67,109,
-247,206, 56,254,242, 83, 13,124,151, 95,219, 17, 23,145, 91, 39,103,166,136,111, 75, 75,113,190, 1, 34,113,235,179,159,174,150,
-148, 44, 68,215,174, 63, 3, 24, 77, 65,121,184, 86,249,178,134,101,193,234,204, 65,178,139,149,149,184,166, 51,108,226, 19,162,
- 2, 33,198,171, 37, 37,233, 0,208,210, 32,192, 46,225,253, 22, 2, 88,145,127,244,197, 34,113,232, 12, 69,105,185,184,107,121,
-201, 73, 49, 4, 1,189,139,174,155,194,170,203,111, 64, 40, 20,132, 12, 12,245,124,164, 86,101,252, 22,192, 13,123,158, 43,128,
-184,166,211,255, 90,240, 64,227, 93, 89, 19,160,185,254,255,191, 3,218, 58, 85,207,250,253,180,180, 52,218, 86,190, 45, 91, 54,
-211,236,236,108,144,116,179, 97,124,224, 45,111, 76, 92,162,194,248,241,227,225,204,180,191,230, 16, 16, 16, 16, 15, 0,247,220,
-115,143,166, 29,186, 41, 20,129,129,129,115, 0, 88,157, 83,125,106,106,234,110, 7,191,203, 2,168,200,200,200,144, 63,244,208,
- 67,195, 83, 83, 83,135,152, 76, 38, 34,145, 72, 48, 97,194, 4,236,223,191, 31, 28,199, 33, 49, 49,145,190,248,226,139, 36, 42,
- 42, 74, 63, 99,198,140, 30, 53, 53, 53,183,116, 58, 93, 75,138,204,254,122,233,202,166, 65,131,135,248,158, 60,113,226,253,179,
-124,254,160,158, 61,122,126,233, 19, 24, 92, 34, 8, 22,211,195,123, 15,249,215, 40,170,199,133, 5, 4,191,221,167, 79,159,195,
- 94,161,158,107,251,119,141, 49,228,229,229,181, 75, 4,128, 7,243,116,191, 88, 0,239, 1,120,222, 34, 60,158,182,245, 9,230,
- 65, 98, 87, 1,252,219,210, 37,112,170, 5,126, 6,230, 65,102, 7, 0,120, 56,144,158, 99, 0, 38,162,229,133, 21, 24, 0,193,
- 0,122, 0, 56,109,135,243,180,229,186, 16,180,220, 55,201,192,188,140,163,191,165,219,224, 33,139,112,231, 91,184,243, 45,199,
- 91, 0,252, 0,243,140, 3, 5, 0,131, 29,190, 89,150,200, 67, 63,139,145,100,155,206, 50, 0, 82, 0,191, 89,174,253,222, 14,
-223, 75, 48,207,110,112,164, 43,195, 3,192, 62, 0,155,237,228,199, 76, 0,255,181,252, 63,107,147, 62,129, 37, 47,211, 0,124,
- 10, 96,137,229,243,178,150,126,240,192,129, 3,217,132, 16, 20, 23, 23,203,173, 51, 1,154,122,253,197,197,197,114,235,181,246,
-110, 32, 41, 41, 41, 59, 51, 51, 19,155,126, 50, 52,140,220,111,234,165,111,250,201,208,112,237,221,228,203,205,205,197,184,113,
-141,135,186,135,135,135,199,111,219,182, 77,222,179,103,207,120,142,227,228, 75,151, 46,165,214,105,128,132, 16, 12, 31, 62,188,
- 69,163,162,111,110, 46,190, 11, 12,137,247,177, 57,215,127,254, 68,168,223,191, 1,220, 31, 2,202, 1,121, 75, 5,180,158,243,
- 66,141,214, 7, 10, 50, 12, 67,199,237,138,111,173,216, 91,102,112,108, 7,176,189,119,143,176,190, 0, 94,214,155, 56,164,231,
- 21, 97, 92,168,185,187,147, 80,170, 82,177,236,123,183,110,221,186,229, 64,153,122, 31,128,103,254,111, 53,143,214,158,222, 22,
- 84, 81, 86,131,138, 91, 42,240,249,213,158,245, 10,138, 90,165,137,134, 4, 11,253,248, 28,166,107,245,166,239,150,188, 28,235,
- 23,210,255,137, 90, 59, 66,147,109, 79, 92,218,220,135,157,176,205,252, 63, 43,197, 73, 15,248,206,206, 2, 32, 41, 10,180,133,
-175, 37,143, 61, 38, 38,166,195, 24, 34, 13,131, 29,173,226,159,199, 98,131,220, 92,199,218, 42,254,214,178,241,236,179,207, 6,
-243,249,252,138, 99,199,142,125,121,207, 61,247,180,101,138, 98,247,212,212,212, 53,150, 40,192, 44,203,140,128, 89,169,169,169,
-223, 59, 18, 84, 4, 80, 15,160, 42, 60, 60,124,232,216,177, 99, 75,207,229,229,117,214,106,181, 68, 46, 63, 4,145, 88, 4,134,
- 48, 56,116,232, 16, 25, 48, 96,128, 38, 57, 57,121, 84,101,101,165,221, 58, 55,123,214, 76,246,199,189, 63,126, 58,116,232,176,
-158, 6, 86, 63,249,106,254,149,167,185,162,130,167, 0, 64, 12,134, 14,238,221,247,100, 72, 72,112, 54,143, 47,124,237,191,111,
- 45,175,255,118,163,235, 61,202,205, 25, 0, 47, 91,172,161, 41, 0, 46, 1,240,106,230,123,123, 44, 30,123, 18,128,145, 22,241,
-108, 54,202, 9, 32, 18,192, 86, 7, 13,128,106,203,245,188, 86,248,226, 0, 92,113,144,239,138,229,250, 29,173,240,205, 5,240,
- 36,128, 11, 48,207, 80,184,214,132, 91,110,241,254,159,179,120,195, 27,129, 22, 71, 92,240, 44, 30,251,227, 0,162, 44, 81,132,
-230,210,169,180,124,190,206, 98, 4,108,108,133,239,107,139,209,229,200,253, 82,203,245,173, 61,191, 15, 44,145,141, 3, 22,163,
- 6, 77,184,247, 3, 24, 96,201,139,124,139, 33,213,173,213, 31, 53,247, 32, 80, 0,242,230, 22, 2,178, 94,227, 76, 5,127, 82,
- 42,165, 79,126,170,110,102,225, 30,133,211, 2,209, 94,124, 47,188,240,194,109,215,140, 31, 63, 62,123,252,248,241, 4, 0,238,
-187,239, 62,167, 26,161, 61, 47,188, 64,124,154,182, 40, 61,188,178, 37,171,251, 19, 0, 24, 40, 19, 16,115, 80,198, 58, 50,251,
-186,131,197,192,146, 47, 38, 90, 4, 62,192,171, 71,131,248, 91, 92,228, 91, 98,177,216,209,217, 40, 4,192, 59, 71,179,206,122,
-132,118,237,241, 32, 7,143,200,146,226,114,158, 81, 87, 75, 59,133,120, 17, 47, 79, 1, 97,141, 28, 20,181, 6,150, 72,136,164,
- 78,197,246, 14,105,217, 33,104, 86, 44,154,190,255, 35,151,239,189,211,179, 0,218,202,215,146,199,222,179,103,207, 14, 35,254,
-220,247,254, 56,144,103, 30,147,183, 81,110,192,119,199, 12,160,148,182, 75,190, 90, 57, 76, 38, 83, 53, 0, 68, 71, 71,183,105,
- 65, 32,171,248, 91, 80,101,249,239,104,221, 16, 90, 28,179, 51, 0, 48,112,224,192, 48,149, 82,181,104, 68,204,240,199, 84, 74,
-165, 47,107, 98,141,161,161,161,183,194,194,194,174, 40,149,202, 37,149,149,149,249,142,166,107,202,228, 41, 44,128,231,143, 30,
- 57, 49, 54,118,236,216, 41, 18,137, 36,136,128,154, 8, 33,224, 56, 90,173, 85, 43,214, 92,206, 43, 46,251,118,227,134, 54,173,
- 8,216,212, 0, 48, 1,248, 71, 43, 2, 98,139,147,150,151,201,242,106, 14, 38,152, 71,212,243, 28, 76,143, 28, 64,150, 29,190,
- 12,152, 7,173, 57,130, 71, 29, 72,223,122, 0, 95,218,225,249, 21,230, 41,144,112,128,239, 27, 75,196,192, 30,138, 44,158,189,
- 35,233,227, 57,145,167,235,237,240,221,239, 0,159, 53,218,176,209,242,108,236,206,181,165,148,146,137, 19, 39,198, 89, 5,223,
- 54, 4,239,202, 82,192, 50,153,140,164,167,167,199, 49,179,218,103,233,222,246,230,251, 51,160,160,228,166, 62,178, 91,183,141,
-243,222, 95,247,164,245,156, 65,192,108,214,105,184,125,229,197,197, 42,135, 10,211,250,245,180,234,244, 6,178,252,251, 95, 22,
-238, 94,125,223,206,227, 39,202,158, 9,246,229,166, 50, 1, 62,126,148, 2,132, 80,189,158,229,202, 57,160,202,160,231,252, 74,
-203,180,134, 72, 39,210,152,156,156, 28,111,219, 29,144,156,156, 28,223, 81,158, 95, 71, 92, 9,240,207,130, 73, 75, 84,119,244,
- 30,101, 50, 25, 39,149, 74, 59,139,197,226,178,232,232,232,251,219,131, 51, 53, 53,245, 96, 96, 96,224,147,169,169,169, 27,157,
- 48, 0, 88, 75,228, 20, 0, 48,122,204,232,229, 0,150, 55,189,176,233, 24, 33, 71, 49,110,252,200,159, 96,238,138,109,130, 48,
-244,238, 51,168,205,247,220,156, 1,160,115,129,135,182, 18, 34,209,187,249,254,178,124,141, 96, 17,250,118,171,232, 73, 73, 73,
-217,246,230,229,255,145,124,127, 6,212,104, 52, 79, 1, 30, 70, 0,193, 28,104,169, 78,103,216, 82, 94, 94,121,158, 82,234,240,
-180,169,160,152,127,208,140, 15, 39,147, 91,158, 15,231,118, 29,139,220,172,175, 62,120, 57, 32, 64,180,136,207, 35,180,172, 90,
-119,185,204,192,110,146, 8, 24,177,132,207,227, 25, 89, 78,236, 76,250,172,125,252,214,129,103,174,238, 3,112,219,212, 63,155,
-208,191, 43,139,205, 52,245,204, 29, 57,127,183,249,238,182,225,227, 40,152, 89, 10, 16, 66, 48,117,218,239, 3,162,247,236, 61,
-211,208,134, 36, 78,142,110,175, 41,138,229,237,217,222, 88,140,128,141, 78, 92,238,111, 49, 0,212,127,214,246,129,223,228,129,
- 82, 71, 27,251,166,104,110, 20,187,155,239,175,205,231, 70,199, 71,117,117, 53,133,185,155,171, 77,184,229, 57,157, 2,192,209,
-205, 31,147,132,167, 94,249,240,241,185,121,159, 62, 63,251,216, 0,131,154, 68, 4, 8,248, 65, 32, 68,227, 37,225, 87, 14,234,
-231,147,239, 44,119, 66, 66, 2, 73, 75, 75,115,121,189,249, 59, 37,158,127,150, 8, 64,199, 51, 30,204,177,161,191, 65,245, 10,
-179, 56,204,222,248,147,238, 6, 72,162,162,162,254, 30, 67,100,221,112,195, 13,240,121,128,135,136,128,227,204,109,116,189,214,
- 93,253,221,112,227,111,219, 30,184, 31,129, 27,110,252,125,192,154, 0,165,198, 42,250,110,241,119,195,141,191, 51, 24,247, 35,
-112,195, 13, 55,220,112,195, 13,183, 1,224,134, 27,110,184,225,134, 27,110,184, 13, 0, 55,220,112,195, 13, 55,220,112,227,175,
-136, 70, 99, 0,230,205,155,231,242,200,205,230,214,214,110,142,239,127,223,127, 30, 55,104, 72,111,121,231,174, 97,241, 42,173,
- 90,126, 88,158, 27,159, 52,235,217,108, 87,249, 86,127,181, 61, 46,106,200, 40,249,173,210, 82,120, 74, 60,113,163,164, 32,254,
- 95, 79, 77,115,153,175,189,239,247,194,225,121,113,163, 71,245,148, 75, 60,121,224,243, 24, 16, 49, 65,153,242, 69,226, 42,223,
-153, 91, 67,226, 70,140, 26, 33,247,245,226, 1,124,160,230,220,122,226,104,250, 34, 39, 69,186,124,191, 87,246, 95,185,141,111,
-228,200,145, 46,243,157, 56,113,226,118,190, 72,215,211,119,226,202,237,233, 27,213,167,143,203,124,199,243,243,255,116,124,147,
- 90,201,223,229,203,211,232,162, 69,201, 45,126,190,191,153,252,141,124, 96,146,235,229,101,223,254,219,203,243, 36,215,203,203,
-242,204,106,234,195, 21, 52, 58, 23, 20,249,176,203,124, 85, 87,190,187, 45,125,103,223,184,238,114, 67, 58,108,105,143,219,206,
-125, 24, 84,234, 50,223,203, 85, 97,248, 35,218,171,191, 59,159, 84, 42,229, 55,183,179,160, 35,124,251,247,239, 7, 0, 40, 20,
-138, 8,157, 78,167,120,242,201, 39,107,255,200,251,117,218, 0,104, 9,186,173,210, 72, 0, 61, 97, 94, 39,160, 64, 60, 91,118,
-205,209, 31,216,254,205,242, 56, 2, 14,193,126, 1,200, 61,124, 70,254,245,215, 31, 35, 54, 33, 22,172, 90, 35, 31,208,111, 60,
- 56, 14,242, 95, 35,190,142, 31, 54,108, 8,174, 94,189,142,186, 90, 53, 6,143,153,147,221, 18,223,250,111,229,113, 20, 4, 61,
-122,247,148, 75, 95, 89,130,234, 79,182,227,155,207, 63, 3, 32,198,158,243, 37, 96, 24,200, 63,126,231, 45,228,231, 95, 70,120,
-120, 15,136, 36,124,220, 44,201,111,113,113,145,194, 29,159, 81,161, 80, 8,137, 68,130,130,130, 2,116, 9,241, 65, 16,223, 11,
- 93,186,251,193, 95,226, 11, 79, 98, 2,195, 48,160,156, 9, 26, 17, 31,117,183,234, 80, 49,220,254, 92,242,186,130, 53,212, 91,
- 82,135, 49, 35,122,193,203,147, 15,161,132, 1,159, 7, 48, 66, 62,250,134,125, 78,141,148,135,194,155, 79, 57,156,225,171,247,
-234,226,194,194,194, 16,123, 79, 87,185, 86,167, 7, 35,146, 0, 70, 32,175, 62, 58, 78,171, 81, 99, 84,200,229,236, 63,202,138,
- 92,191,126, 61,157, 59,119,238,223,106,126,125, 71,133, 61,161,111,227,245,158, 0, 70,116,146,120,252,183,180,180,180,159, 64,
- 44, 2,231,225,177, 12,230,149, 49,235, 59,202, 51, 40,248,117,111,220,181,139,135,111,219,107, 32, 33,121,217, 95,165,140,146,
-111, 54,109,250, 77, 36, 20, 74, 56,142,243,245,244,242,242,122,112,234, 84, 15,152, 87,176,235,168, 35, 59,173,209,102,174,173,
- 68, 82,169,212,199,215,215,119, 65,223,190,125,103,136, 68,162,174, 37, 37, 37, 37,165,165,165, 39, 12, 6,195, 82,153, 76, 86,
-224, 2,159,159,191,191,255,146,251,238,187,111,242,179,207, 62, 27,254,197, 23, 95,220,186,112,225,194, 49,157, 78,247,174, 76,
- 38,187,224, 8,199,254,253,251,241,227,200, 29, 24,179,247,222, 21,225,225,225,175,121,122,122, 98,251,246,237,167,103,206,156,
- 57,252, 79, 19, 1,104, 65,252,121,158, 34,254,136,199,198,246, 90,201, 81,170, 59,122,249,214, 39,151,182, 74, 15,136,103,203,
- 46,218,251,110,242,212,222,116,234,125,203, 97,172,175, 5,223,196,224,151,139,151,241,196, 19, 47,254, 94, 34, 24,224,231,220,
-141, 8,234, 30, 38,231,234,149, 48,112, 4,135, 14,229,198,151,104, 91,202,168,165, 20, 66, 95, 16, 15, 31,156,185, 88,140,243,
- 23,255,129,175,190,219,223,240, 57,199, 1, 15,140, 25, 3,212,151, 3,240, 70,193,133, 75, 16, 4,249, 33,118,244, 32,121,173,
-166, 21,155,133, 48, 0, 97, 16, 53, 36, 26,157, 60,133,232, 18, 36,134, 79, 96, 0,252, 69,222,240, 23,243, 32,224,241, 96, 52,
-153, 80,203,114, 56, 89,117,218,238, 67, 45, 63,191,132, 6,248, 2, 62, 30, 30, 8, 14, 10,132,143,143, 7, 40, 99, 2,203,213,
-195, 4, 19,188,188, 60, 16,212,169, 43,122, 70,254, 68,179, 14,143,109,181, 81, 90,151,105,160,190,222,158,232, 25, 17,130,224,
-160, 64,168,213,106, 8, 69, 98, 8,116,230,197,249, 34,194,123,200,107, 20,181,248, 62,183, 40,190,184,228, 38, 20,229,215,177,
-244,217,232, 86,141,129,180,229,105, 14, 55, 18, 9, 79, 38,196,251,135,250,103,183, 38,254,119,195, 8,120,227,253,247, 41, 0,
- 44,125,237,181,118,249,141,197, 43, 86, 80, 0, 72, 93,184,208,101,190, 31,115,114,158, 48, 24, 12, 27, 1, 96, 70,124, 60,227,
- 74,227, 43,219,182,205,188, 70,188,205,180,105, 74, 41, 8, 33, 13,255,173,231,172,215,205, 77,110, 89,176, 23, 45, 74, 38,142,
-138,186,147,226, 63,192,211,200,110,247,246,243,237, 7, 0, 66,137, 24, 6,173, 14,156, 90,179,226,216,145,195,239,220, 59,115,
-102,127, 0,197,246, 72,244, 60, 33,133,121,241, 20,214, 34, 10,156,165, 29,106,182, 45, 26,122,239,100,252,118, 40,195,169, 60,
-186,118,241,176,188,247,160,184,248,240,254, 15, 56,111, 20, 39,215, 56,117,121, 74, 74, 10,182, 37,103,181,122, 77,124, 86,227,
-173, 72, 6,248,153,111,181, 66,199, 65,203,154,243, 85,109,249, 47, 27,229,135, 62,222,130, 86,249, 86,174, 92,153,253,198, 75,
-175,134, 76,155, 49,221, 75,167,211,226,227, 15, 63, 96, 86,175, 94,173,155, 63,127,126, 24,128,155,237, 93,247,246,237,219,151,
-176,115,231,206, 76,192,185, 53, 7,114,115,115,105, 81, 81, 17,170,171,171,161, 82,169,224,237,237,141,192,192, 64,132,135,135,
- 99,204,152, 49, 46,213, 59,169, 84, 58, 62, 58, 58,122,211, 43,175,188,114,181,111,223,190, 27,135, 13, 27,118,233,214,173, 91,
- 93,115,115,115,163,159,122,234,169,221, 82,169,116,133, 76, 38,251,202, 9,190,248, 25, 51,102,164, 45, 95,190, 60,208,104, 52,
- 66, 34,145,192,211,211,179,179, 90,173,158, 57,109,218,180, 7,165, 82,233,124,153, 76,246,121,107, 28,207, 43,164,192, 72, 96,
-202,137, 25,240,236,238,217,101,209,162, 69, 56,117,234, 20, 85,169, 84,126, 54,191, 3, 0,188,153, 51,103,154, 38, 78,156,120,
- 87,196,253,220,185,115,141,142,155,219,208,141,223,130,232,119, 3,208, 11,230, 37, 99, 77,106, 61,123, 35,247, 74,197, 71, 99,
- 34, 67, 94,188,111, 64,231,119, 58,249, 74,186,200,183, 74,183, 2,184, 44,158, 45,107,113,147, 26,125,125, 13, 58,245,190, 31,
- 75, 94,155,129,141,178,223,235,226,225, 99,235,160,214,232,145,152,240, 34,238,137,125, 18, 15,167,220, 7,137, 68, 4,131,137,
-133, 74, 99,144,247, 25,221,187,133,194,113, 29, 48, 0, 51,230,172,197,191, 94,121,166,225,236, 3,247,196, 65, 44, 22,225,135,
- 67,251,177, 39, 39, 23,155, 54,124, 6,157, 86, 15, 33,143, 15, 47, 15, 33,212,213, 37,241,181, 37,104,118,247, 49, 74, 41, 64,
- 57,243,139,225, 64, 41,133,222, 32, 50, 55, 79, 34,128, 26, 76, 48,241, 0, 19, 76, 48, 25, 56,176,166,214, 13,216,130, 19,169,
-180,107, 48,133,143,183, 39,194,186, 70,160,223,224,222,240,246,146,160,174,190, 18,229,149,229, 80,212,221,130, 81, 71,224,225,
-225,129,224,224, 88,204,156,126,129,110,223,217,183,249, 48,254,230, 27,212,228,237, 13, 45, 31, 16,138,133,208,106,132, 48,104,
-132,208,137, 69,224, 19, 22, 20, 60,232,180,245,208,106, 84,232,218,181,139, 92,200,227,163, 6, 74,124,244,209, 17,136, 68,173,
- 23,142,247, 55,189,111,183, 0,189,246,248,107,173,126,174, 80, 40,104,147,227,152,128,128,128,124, 66,136,142, 82,202,247,247,
-247,247, 40, 40, 40, 8, 76, 75, 75,203,158, 59,119,110, 23, 87, 11,178, 48, 52,116,118,195,111, 0,113,254, 64,187, 69, 59,214,
-167,165,209,231,158,123, 46,222, 88, 81,225, 20,231,143, 57, 57,210,145, 35, 71, 46, 29, 27, 21, 5,163, 72,132, 85,171, 86,113,
- 51,239,187,111, 2,165, 52,203, 41, 87,142, 16,172,124,231,157,134,227, 5,111,191,141, 85,239,190,219,234,177, 61, 52, 53, 2,
-150, 47, 79,163, 49, 49, 49,200,202, 42,164, 9, 9, 61, 7, 2, 40, 92,190, 60, 77,235,164,248,231, 14, 30, 56,208,199, 90,103,
- 60,197, 18,148, 85, 86, 64,169,168, 69,244,200, 81, 30, 63,126,181, 33,107,202, 83,255, 24, 8,243,230, 5,173,129,125, 97,233,
-106,254,163, 51, 31,228, 71,134,135,115, 86,207,240,237, 85,159, 54,186,232,221, 5,207,155, 13,191,151,230,199, 63, 62,117,130,
-211,249,234,146,248, 55, 88,200, 1, 78, 92,156,224, 20,181, 39,159,224,252,187, 79,131,248, 4,193, 84,120, 30,250,194, 95,145,
- 95,163,198,240,189, 21, 14,125,127,157, 76,118,244, 21,233,115, 61, 30,255,231, 83,126,105,155,191,227,194,195,195,153, 37,203,
- 87,192,251,157, 37,248,225,135, 31, 74, 31,122,232, 33,151, 12,209, 22,132,127,194,206,157, 59, 15, 88,143,167, 79,159,238,144,
-114,169, 84,170,184, 3, 7, 14,200,141, 70, 35,122,245,234,133,113,227,198,193,215,215, 23,181,181,181,184,121,243, 38,174, 93,
-187,134,155, 55,111,210,137, 19, 39,198,123,123,123, 59,156, 79, 82,169,116,250,125,247,221,247,241,202,149, 43,183, 14, 27, 54,
-236, 99,171,177,211,165, 75, 23,204,156, 57,147, 36, 37, 37,121, 1,200,149, 74,165,185, 45,237, 94,218,148,111,254,252,249,233,
-207, 61,247, 28,115,250,244,105, 16, 66, 16, 24, 24,216,240,218,187,119,175,112,244,232,209,159, 73,165,210,227, 45,241, 61,175,
-144, 98,202,137, 25, 0, 64,182,167,236,160,247,126, 54,190,123,126,126, 62, 10, 11, 11, 73, 93, 93, 93, 47,169, 84,202,159, 54,
-109,154, 9, 0,157, 54,109,154,137,101, 89,220, 13, 52, 21,127,235,185,166,247,193,111, 70,252, 3,135, 71, 4, 62, 30,213, 35,
- 96, 14, 33, 68, 64, 41, 53,114,230,151,193,100,212,105,133, 12,215,101,112, 39,241,107, 65, 62,189,122,239, 60,121,237, 59,221,
- 86,233, 81,241,108, 89, 89, 43,205, 55, 6,244,239, 11,134,201, 70,126,109, 53,128, 75,168, 43,189, 2,129, 88,132,140,221,159,
- 64, 83,101,194,156,127,188, 12,142, 3,166, 62, 56, 6, 38,190,151,221,155,203,207,191, 4,142, 3, 18,135, 18, 0, 93, 0,244,
-128, 78,111, 64,210, 3, 19, 33,246, 99,176,105,203, 62, 48, 12,144,254,221, 70,148, 22,254, 26,255, 80, 92,100,246,229,179,205,
-115,113, 20,224, 56, 14, 28,199,193,100, 50, 65, 47,160, 48, 18, 35, 12, 6, 3, 52, 30, 58,128, 19,131,161, 38,152,132, 20,245,
- 6, 29,212,202,186, 86,211, 22,236,165, 7,159, 47, 65, 96, 96, 32,122,247,238,141,208, 78,163, 0, 30, 3,147,233, 52, 24, 90,
- 11,157,154,133,137, 83,163,252,102, 13,130, 3,171, 16,232, 23, 11,133,106,113, 92,115,155,188, 72,116, 44,168,190, 10,208,137,
- 96, 96,140, 80, 11,249,168,151, 8,192, 23, 8, 1,206, 19,132, 71, 80,175,214, 64, 81,126, 29, 5,167,115, 80, 83, 92, 12,142,
-227,192, 80,158, 75,133,230,171,181,191, 27,206, 79,205,123,202,126, 59,105,217,215,221, 90,116,210,210,210, 22,189,242,202, 43,
-207, 20, 23, 23, 51,132,144, 96,153, 76,246, 29,204,155, 59,121,180,161, 44, 11,214,172, 89,179,229,214,173, 91, 72, 79, 79,199,
-240,190,125,121,254,131, 7,183,185,130,164, 46, 92, 72, 20, 64, 28,165, 84,190,122,245,106, 57, 0, 72, 83, 82, 28,246, 74, 12,
- 6,195,186,177,150,202, 36, 20, 10,209,167, 79, 31,108, 63,116, 40,211, 18, 13,112,152,231, 78,109, 85,187,104, 81, 50,201,202,
- 42,164,167, 79,155, 35, 86, 54,255,127,189,247,222,123, 75, 23, 45, 74,246,117, 84,179, 60,141,236,246,193, 3, 7,250,240, 24,
- 6,207, 62, 58, 7, 90,157, 30,171,190,252, 18, 30, 18, 9,116, 58, 29,116, 90, 45,134, 14,139,138,220,191,121,243,115,147,230,
-204,249,200, 94,212,241,221, 5,207,115, 0,152, 43, 69, 69, 76, 83,193,111, 90, 61, 93,185,247,110,253,198,199,103,165,189, 78,
- 39, 76,125, 58,158,138, 34, 93, 50, 4,108,119,237,163,219,252,237,158,183,107, 65,249,241,113,189,222,132,195, 19,130, 33,120,
- 81, 6,229,156, 8,240,253, 67,156, 18,255,131, 7, 15,150,135,119,238,114,243,159,207, 62,211,237,245,151, 23, 98,245,134,117,
- 23, 71, 70, 71,247, 92,247,233, 58,143,151, 22,190,138,205, 99, 70, 97,203,150, 45,143, 61,242,200, 35,155,218, 40,252,113, 59,
-119,238,108,112,152, 44, 97,245, 23, 96,222, 42,221, 46, 14, 28, 56, 32, 15, 14, 14,198,176, 97,195, 88,134, 97,248,230,232, 44,
- 7,129, 64,128,128,128, 0,116,234,212, 9,215,174, 93,195,129, 3, 7,228, 51,103,206,116,168,174, 72,165,210,228, 41, 83,166,
-124,176,114,229,202, 79,251,246,237,187,150, 16,194, 1,248, 12,192, 36, 0, 71, 0,188, 75, 41, 45, 34,132,188, 10,224, 93, 71,
-248, 86,206,159,255,253,216,228,100,178,107,215, 46,240,249,124,200,229,114,156, 63,127, 30,189,123,247,198,123,239,189,135, 65,
-131, 6,225,153,103,158,225,191,249,230,155, 43, 91,244,252, 45,216,158,178,131, 2,128,135,135, 71,153,159,159, 31,196, 98, 49,
-132, 66, 97,189,112, 25, 88,122,140,146,105,211,166, 97,217,178,101, 56,127,254, 60,182,110,221,122, 87,196,127,238,162,101,191,
- 59, 58,203, 95,111,214, 8,104, 46, 2,192,240,121, 12,159,229,168,138,229, 76, 58,137,128,223,213, 75,200,244, 7,199, 2,145,
-247, 2,157,122, 3,183,174,160,243,229,156,233,143,197, 70,132,103,156, 43, 19,215,108,149,102,152, 55,183,107,190, 14,243,120,
- 86, 65,242, 1,208, 21,190, 97,125,113,253,114, 58,214,202, 54,128,209,123, 96, 98,124, 44,246, 29,204,129, 70, 3,120, 4,180,
-220, 46, 73, 60,250, 66,171,185, 12,147,201,118,111,154,114, 0, 55,193,240,226,240,248, 19, 79,131, 19,169,241,227,238,175, 48,
-245,193,167,224,225, 9,168,235,203, 44, 26,212, 60,140,224, 65, 96, 17,127, 35,107,130, 94,105,132,198,168, 65,173,132, 15,163,
- 70, 0, 61,223, 8,158,145,128, 53,113, 80,106, 89,212,212,179, 45,170,217,121,249,114,218,179, 19, 1,143, 71, 64, 24, 17, 76,
- 38, 10, 86, 83, 12,189,201,136,210,242, 58,212, 40,234, 81,167, 50,129,209,233,192,162, 28, 60,193, 57,116,233,174,196,168,232,
- 24,249,119,223, 94,106,150,147, 7,128,170,116,208,170,110,194,116,171, 14,188, 94, 93,193, 48, 12, 76,172, 30,181,229, 69,184,
-124, 34, 23,149,215,139, 45, 66,194, 7,195, 7,192,187, 59,221,128,214,144,255,250,245,235,245, 73, 73, 73,253,163,162,162, 88,
-145, 72,164,254,224,131, 15, 70,194,188, 41, 81, 31,180,113,166,137, 48, 52,116, 1, 0,140, 30, 52, 8,161,161,161, 21,171, 87,
-175,206, 2, 16, 63,108,240,224, 54, 71, 1,252,129,108,105, 74, 10, 17,132,132,196,173, 94,189, 90, 46, 8, 9,137,115, 38, 18,
- 96, 20,137, 32,208,235,177,125,251,118,132,132,132, 96,198,196,137,214,104, 0,117,198, 8,184, 83,176,138,190, 76, 38,179,109,
-248,112,248,240,225,176,209,163,147, 31, 68,203,219, 70,219, 98,132,159,191,127, 63, 30,195,224, 31, 73, 73,168,173, 83,162,178,
-166, 26, 2, 1, 31,124,190,249, 37, 16, 8, 32,146,120,160, 87,120,248,135, 87, 79,157, 62,223,123,120,140,220, 30,233,149,162,
- 34,124,187,253,127,183,121,252,214, 72,192,168,232, 33, 72,140,191,215,201, 59, 86,197, 1,222,217,125, 7, 39,102,247,237, 19,
- 25,159,185,235, 75, 57,208, 49,250,254,243,190,254, 8,250,125, 27, 16,242,249, 25, 12,240,227,131,231, 19, 0, 86, 81,129,225,
-123, 43,224,201, 39, 80,179, 20, 60, 59, 53,229,218,213,171,213,123,118,237,238,251,245,231, 95,227,147, 47, 63,187,190,238,131,
-143,222, 14, 8, 12,168, 93,178,116,201,193, 77, 91, 54, 99,220,232, 88,124,155,182,245,235,110, 61,186,125, 61, 46,118,156, 75,
-247,220, 84,252,119,237,218,133,174, 93,187,246, 58,121,242,228, 28,152,183, 26,183, 27,246, 55, 26,141,136,142,142,230, 88,150,
-229,171, 84, 42,136,197, 98,112, 28,135,223,126,251, 13,249,249,249,240,242,242, 66, 76, 76, 12,202,203,203,145,155,155, 75,237,
-117, 7, 72,165,210,217, 41, 41, 41, 43, 31,120,224, 1,175,181,107,215,250,124,252,241,199, 66,152,119, 45,205, 4, 16, 13,243,
- 6,103, 31,193,188,157,251, 65,152,119, 60,109,149,111,231, 43,175,108, 30,208,191, 63, 89,157,148, 4,114,255,253,216,126,244,
- 40, 87, 90, 90,186, 4,192,234, 27, 55,110, 76, 91,180,104,209,231, 63,252,240, 3, 98, 99, 99,225,233,233, 57,166, 37,174, 41,
- 39,102, 96,199,142, 29, 88, 63,201, 92,199,252,252,228, 85,157, 58,117,130,151,151, 23,245,244,244,188, 97,120, 29, 32,211, 8,
- 93,182,108, 25,172,134, 70, 99,253,186, 59,152,187,104, 89,131, 17,208, 72,236,155,158, 16,207,150, 85,254,124,181,114,221,198,
- 35, 87, 95,254,173,180,238, 0, 3,202, 7, 40, 48,229, 61,252, 28,243, 1,254,171, 72,194,161,129, 43,128, 73,139,225, 45,224,
-134, 61, 16, 21, 62,199,210, 93,112, 27,118, 29,170, 33,128, 18,211,158,120, 17, 28, 7, 0, 53, 48, 47,155,108, 68,143,190,209,
- 16,139,248, 48,177,122, 80,131, 57, 44,226,237,237,141,234, 26, 69,139, 55,241,209,135,175, 16, 0,184,248,243,151, 96,152,198,
- 78, 2,167,253, 21, 58,189, 17, 60,129, 24, 68,104,238, 67, 83, 41,149, 24, 51,102, 76,235,238, 8,103, 0,199,113, 96, 89, 22,
-122,189, 30,245, 28,139, 58,131, 17,202, 50, 37,234,110,214, 65, 89, 94,131, 26,101, 45,202,117, 26, 40,213,181,168,213,183, 60,
-214,201,219, 75, 13,150,229,160, 55,152, 80, 91,167, 68,254,213, 98,156, 56,157,135,159, 79,228,225,210,111, 5, 40,185, 81,133,
-122,181, 1,170,122, 61,202, 74,235,112,225,215,107,200,205, 61,139,146,178,242, 22, 57,109,139, 10, 91,167, 70,201,185, 75,248,
-101,239, 33,100,110,248, 16,135,182,110, 64, 73,193, 85,112,212, 8,142,144, 6,225,119,166,230,219, 11,243,219, 3,159,207, 7,
-128, 91, 0,110,249,251,251,151,120,123,123,235, 23, 45, 90,116, 18,230, 1, 99, 12,204,107,101,231,187,202,191,102,205,154,212,
-164,164, 36, 0, 64, 68,112,112,136,165, 79,156,215,158,149,195, 42,250,214, 72,128, 3,225,255, 4, 0, 88,181,106, 21,174,148,
-149, 97,198,196,137,176, 70, 3,242,242,242, 0, 0, 59,228,114,234,104, 86, 44,120,251,109,188,250,206, 59, 13,225,125,235,123,
-235,177,245,189, 35,225,127, 43,178,178, 10,105, 83,241,183, 61,206,202, 42,252,214, 17, 30, 63, 62,255,191, 58,131, 30, 60, 30,
- 15,191, 21, 22,160,176,228, 6,142,159, 59, 15,131,193, 8, 6, 4,124, 62, 31,132, 16,112, 38, 19,180,106, 13,242, 14,103, 31,
-114,128,150,177, 21,255, 71,103, 62,120,155,199,127,252, 76, 30,108, 35, 4,142,193, 38,156, 44,138,204,182, 10,127, 86,218,235,
- 84,192, 94,137,251, 67, 45,128,154, 50, 8,187,247, 65,197,115,247, 32,239,235,143,192, 15,234,220,240, 81,197,115,247, 32, 72,
-204,192,135,223,122,113,233, 27,217,183,139,135,135,167,199, 39, 95,172,209,197,223,123,175,112,212,152,209,155,175, 93,189,198,
-253,118, 53, 31,224, 40,196, 34, 17, 98, 99, 98,177,123,215,110,236,220,185,211, 41, 47, 96,223,190,125,113, 82,169,148, 90,197,
-255,192,129, 3, 88,183,110,157, 1, 0, 78,156, 56, 97,144, 74,165,143, 56,210,181, 80, 84, 84, 4,203,214,196, 76, 81, 81, 17,
- 50, 51, 51,145,151,151, 7,181, 90, 13,133, 66,129, 83,167, 78,161,184,184, 24, 55,110,220, 64,143, 30, 61, 80, 84, 84,212, 42,
-223,188,121,243, 30,127,248,225,135,223,143,139,139,243, 58,121,242,164,143, 70,163,249,167, 68, 34,201, 6,240,169, 76, 38, 91,
- 44,147,201,234, 0,252, 15,192, 8, 66,136,144, 82,106,108,205,233,152, 63,127,254,227, 63, 44, 88,176, 57, 54, 36,132,176, 11,
- 23, 98,140,193,128,147,187,118,209,210,210,210,167,101, 50,217,219, 50,153,172, 18,192,198,139, 23, 47,178, 44,203,194,203,203,
- 11, 97, 97, 97, 94, 70,163,177, 89,241,159, 52,105, 18,100, 50, 25,164, 82, 41,164, 82,169, 71,105,105,105,223, 27, 55,110, 64,
-173, 86, 19,133, 66,209,159,207,231, 79,176, 21,127,185, 92,142, 7, 31,124, 16, 29, 5,205,117, 1,132, 2,232, 53,125,120,247,
-103,187, 5,122,206,129, 81, 11,244,157,128, 51,193,211,113,223,252,175,160,173,170, 5,207,199, 27,242,143, 31,199,184, 1, 63,
- 35, 32, 47,115, 60,128,238, 45,253, 64,111,159,174,248, 37,111,135,141,189,161,182,116, 19, 26, 1,163, 30,124,142, 7,198, 82,
-239,119,254, 96,238,110,138,157,156,210,114, 65,189, 64,241,192, 48,219,109, 16,137,229, 54, 4,128, 64, 12,150,152,192, 89,218,
-221, 89,115, 94, 0, 0,249,245, 99,235, 91,172, 89, 38,142,130,229, 24, 48, 44, 11,198,160,135,198, 98, 89,104,121, 60,120,178,
- 90, 40,181, 20, 68, 64, 96, 50,153,160, 49, 1, 21,106, 3, 90,234,204,102, 13, 28,116, 2, 30, 56, 13, 11,150,171,131,170,222,
- 8, 30, 17, 64,207, 26, 97,160, 6,176, 70, 3, 32,228,192, 16,128,136, 56,212,105, 77, 40,175,212, 64,173,103,155, 13,198, 48,
-196,212, 96, 0, 16,242,187,158, 24,117, 90,212,213,212,128, 33, 60,240,249, 20,160,124,240,136,235, 29,127,151,175, 95, 54,244,
-237,209, 87,232, 72,216,191, 81,152,148, 16, 72, 36, 18, 0,208, 2, 48,240,249,124, 20, 22, 22, 98,249,242,229, 15, 2,184,177,
-104,209,162, 97,190,190,190,126,117,117,117,215,107,107,107,157, 14,119, 11, 67, 67,159, 2,128, 78,157, 58,217, 86,224,218, 79,
- 63,253, 52, 11, 64,194,176,193,131, 15,182, 87, 69,152, 63,127,126,188, 35, 6,192,143, 57, 57,113, 35, 71,142, 12,150, 42,201,
-129, 0, 0, 32, 0, 73, 68, 65, 84, 27, 27, 21, 5,226,237,141,229,203,151, 99,225,194,133, 16, 8, 4, 48, 42, 20,240,245,245,
-197,235,243,231, 55,140, 11,112,100,112, 96,211, 62,126,123, 99, 2, 90,194,114, 39, 6,119,158, 62,125, 26,167, 79,159,110,184,
-190,165, 62, 78, 69, 77, 77, 63, 47,111,111, 84, 41, 20,144, 31, 63, 14, 62,195,131,222,104,132, 70,171, 5,199,113, 13,131, 21,
- 89,163, 1, 6,189,222,145, 60,230, 0, 48,150,110, 0,206,166,224,235, 44,231,241,246,170, 79,133, 0, 16, 25, 30, 94,113,237,
-226, 47,109,202,215,132,228,101,228,183, 51,233,113,123,119,126, 41,111,143, 72,128, 51, 97,255, 70, 97,217,109,159, 35,234,137,
-151, 33,138, 24, 98,110, 43,170,202,144, 95, 99,222, 68, 78, 52,102, 10,138, 77, 44, 60, 86, 31,111,149, 67,169, 84,250,137, 36,
- 98,244,142,136, 16, 95, 43,185,209,185,186,178, 26,179, 30,157, 35,223,115, 48, 19, 31, 47, 91,149,190,115,207,174,164,200,136,
- 72, 60, 62,243, 49,228,158,201,193,206,237,219,233,116, 7, 66,236,182, 94,255,129, 3, 7, 48, 97,194, 4,171,177, 40,188,121,
-243, 38,158,121,230, 25,161,245,246,237,113, 85, 87, 87, 99,220,184,113, 48,153, 76, 40, 42, 42, 66, 78, 78, 14, 6, 12, 24, 0,
- 95, 95, 95,116,235,214, 13, 81, 81, 81, 96, 24, 6, 12,195,160,115,231,206, 13, 81,170, 22, 60,245, 1, 67,134, 12,249,104,204,
-152, 49,188,188,188, 60, 31,147,201, 84,190,125,251,118,165, 86,171, 93, 46,147,201,108, 13,216,103, 39, 79,158, 92,188,103,207,
-158, 8, 66, 72, 25, 90,216,209, 86, 42,149, 14,155, 31, 31,191,113, 20,159, 79, 42,151, 46, 5, 53, 26, 33,231,241,184, 92,141,
-230, 73,153, 76,246,141,173,221,241,214, 91,111,241, 25,134, 65, 77, 77, 13, 10, 11, 11, 43, 6, 13, 26, 20,210,148,111,210,164,
- 73,183,253, 70, 88, 88, 88,128,137, 82,104, 53, 26, 92,188,120, 17, 44,203,146,142, 42,254,183, 25, 0,186,173,210,200, 80, 95,
-201,216,201, 67,195,158,241,145, 8, 70,178, 38, 78,193,167, 38, 31,248,117,230,149,213,234,160,173,170, 3,132,124,152,106, 85,
- 40, 81, 24,128,192,238, 96, 56,131, 24,173,204, 38,184,170, 84,162,143,159, 15, 88, 61,112, 53,251, 91,244,142,155,212,224,192,
- 25, 13, 70, 8,192,160, 94,103,222,161,246,129,184,104, 72, 2,195, 90, 77,240, 3,131, 9,246,156,167, 16,136, 1, 97,247, 73,
- 48, 20, 31,109,112, 28, 4, 66, 17,140,208,193, 75, 98,222,145,116,215,158,173,248,229, 68,118,252,156,137, 49, 45,183, 70, 28,
- 7,161, 65, 11, 35,132, 96, 24, 22,208,153, 27, 54,163,209, 8,189, 78, 0, 30, 95, 0,232, 0,202,153,187, 8,122,132, 71,180,
-200,165,209,113,224,241, 8,140,172, 17, 58, 61, 7,165,202, 92, 14,141, 28,133, 65,207, 1,124,128, 39,224,129, 47, 6,136,214,
- 4,142,176,224,160,133, 74,107, 9, 72,219,129, 9, 0,195, 1,148, 0, 12,195,129, 16, 30, 56, 74,192, 48,150,177, 84, 28, 3,
-142, 97, 64, 56,199, 28,100, 27,239, 95,232,106, 1,242,240,240,128,197,219, 15, 46, 44, 44,172, 88,190,124,121, 60,128,135, 22,
- 45, 90, 52,177,103,207,158,106,149, 74, 85,205,178,108,131, 80, 56,163,255,107,214,172,249, 50, 41, 41, 9,225, 65, 65, 13, 39,
-195,131,130,252, 44, 81,128,224, 63,162,194, 24, 12, 6,185,213,219,167, 42, 21,254,253,239,127, 67, 95, 93,221, 48,242,173,183,
-197, 88, 17,232,245,120,240,193, 7, 43, 74, 43, 42, 30, 9,243,240,216,124, 55,210,102, 59,168,207,182,255,191, 57,196,196,196,
- 32, 33,161,103,195,245,205,173, 3, 0, 0,172,222,128, 90, 67, 13,116, 58, 29,252,124,125, 33, 22,138, 96, 52,177,160,148,194,
-100, 50,193, 96, 48,192,104, 52,130, 99, 77,142,230, 47,119,165,168,136,137, 12, 15,183,122, 4,220,149,162, 34,230,219,237,255,
- 19,219, 70, 4, 34,195,195,107,209, 78,131,217,250, 69, 39,101,151, 20,156,106,151,103,236,234, 24,128,123, 51, 43, 81, 17,158,
- 14, 97,247, 62, 32, 17, 67,208, 99,195, 89, 84,233, 56,120,242, 9, 12, 63,253,128,203,133,215,236,238,159,167,101, 13, 56,157,
-123, 2, 31,173,252, 16,247,196,141,197, 91,255,239, 29,236,223,187, 31,155, 55,125,131, 49,227,199, 38,117, 11,239, 14,190,135,
- 0, 7,143, 30,196,150,175,191,193,142, 31,182, 99,247,238,221,244,255,254,239,255, 72, 43, 34, 75,155, 10,191, 21,181,181,206,
-111,112,167, 82,169,224,235,235,123, 28,192,168,240,240,112,196,196,196,128,199,227,129,227, 56,244,232,209, 3, 34,145, 8,117,
-117,117, 8, 15, 15,135,183,183,247,117,149, 74,213,163, 37, 46,153, 76,118, 81, 42,149,166,238,216,177, 35, 49, 50, 50,178,223,
-246,237,219,235, 21, 10,197,187, 50,153,108,139, 77,250,167,223,123,239,189,175,108,216,176, 97, 27,128, 10, 0,201, 0,126, 6,
- 48,180, 25,190,179, 82,169, 52,213,239,212,169, 55, 30,102, 89,124, 8,112, 95,214,215, 63,214,132,239,161, 23, 94,120,225,195,
-185,115,231,226,218,181,107,216,189,123, 55, 88,150, 61, 4,224,225,214,238,219, 18, 5, 96,252,120,188,106, 47,131, 1,234,179,
-103,105, 48,199,169,174, 2,170,187, 45,254, 81, 81, 81, 56,119,238, 92,179, 33,127,123, 93, 0, 61,167, 15,239,190,196, 71, 34,
- 24, 89,169,212,237, 63,118,165,114, 57,120, 34,224,242, 81,220, 31, 78,177,248,249, 7, 17, 51, 48, 28, 47, 72, 39, 99,106, 47,
- 3,112,225, 0,168, 64,194,162,213,193, 58,181,200,175, 45, 6, 95, 4, 60, 48,245,101,108,249,100, 25, 0, 3,160,209,195,164,
- 5,126,144,159, 67,214, 73,243,140,194,174,221, 35,192,240,237,139, 87,226, 80, 2,163, 14,216,181,123, 31,134, 79,124,222,236,
-253, 67, 0,158, 4, 72,153,146,140,196,241,211, 0, 0, 37,215, 11,192,234, 12,173, 91,244,148,130, 37,102,129,215, 27,204,131,
-255,244, 58, 45, 52, 26, 13,234,235,235,161, 82,214, 65,165, 82, 65,169,170,135,174,190, 30, 90,173,182,229,194, 95, 79,160,213,
-153,160,213,153,160,214, 24,161,170,215, 67,161,210,163, 86,105, 64,157,202,136,218, 90,243,255,154,106, 22, 53, 10, 22, 53,117,
- 44,170,106, 12,184, 85,213,114, 26, 25, 74, 97, 2, 64, 76, 4,132,225, 64, 9, 5, 40, 5,165, 60,152,184,223,179,143,179,180,
- 30,206,198,198,251,143,233,143,156, 61, 57,216,127,104,127,131, 81,112,249,250,101,135,190,203,227,241,192, 55,231, 87, 24,128,
- 94, 43, 86,172, 56, 15, 96,245,235,175,191,254, 82,207,158, 61, 89,115,144,192,156, 48, 39,197,159, 8, 67, 67,119, 2, 64,104,
-104,232,109, 31, 62,247,220,115,236,169,203,151,183,158,189,112,161,221,194,186,171, 87,175,150, 59,186,111,188,209,102,138,197,
-247,223,127,143,171,229,230, 46,156, 31,179,179, 27,125,118,249,242,229,144,224,224, 96,197, 31, 97,168, 36, 36,244,100, 44, 13,
- 90,211, 6,191,209,231,118, 13, 60, 31,239,223, 56,147, 9,202, 26, 5,170,170,170, 80, 93,171,128, 90,163,129, 90,163,129,170,
-190, 30,234, 58, 37, 84,181,255,159,189, 43,143,111,162,218,254,223, 59, 89,154,182, 64, 23,118,202, 90,164,236,178, 20,161, 5,
-129, 4, 82,168, 34, 42, 74, 1,225,137,125, 5,155,226, 6, 34, 62, 84, 84,220, 80,121, 63, 11,184,210,212, 39,130,239,129, 64,
-139, 11,155, 44,129,164,178,180,212,130, 11,139, 64,161,208, 66, 89, 10, 77,186, 37,105,182,185,191, 63,146, 9,105, 73,147, 73,
- 90, 4, 53,223,207,167,144, 89,114, 50,115,231,206,253,158,115,238,185,231, 84,160,214,104,128,185,182, 22,172,213,235,252, 38,
-211,163,107, 87,110,204, 96, 1,152, 93,167, 3, 0,224,127,155,182, 96,113,250,199,225, 0,218,250,122,223,191, 31,201,150,170,
-178, 94,170,211,217,206, 30,255,225,246,186,255, 1, 92,158,218, 21, 93,190,252, 25,164,219,221, 48,229,100,163,248,159,131, 16,
- 42, 36,216,151,208, 26,214,202,107, 24,178,163, 12, 94,102, 0, 48,121,242,100,242,228,220, 57, 56,115,234, 20,114, 53,251, 16,
-214, 60, 12,143, 77,125, 12,225, 45, 35,113, 36,191, 0,205,196, 18,132,134,134,162,125,215, 14,248,122,253,215,120,105,209, 43,
-168,169,240,191, 74,237,224,193,131,125,254, 78,243,230,205, 81, 89, 89, 57,140, 97, 24,115,167, 78,157, 48,116,232, 80,244,237,
-219, 23,173, 90,181,130, 68, 34, 65,215,174, 93, 49, 96,192, 0,132,135,135,163,186,186,186, 75,243,230,205,225,133, 88,255, 47,
- 39, 39,103,247, 87, 95,125, 37,210,233,116,175,214, 35,235,164,145, 35, 71,174,248,242,203, 47, 87,181,109,219,246, 93, 66, 72,
- 51, 0, 47, 1, 88,236, 65,222,162,119,170,171,255,111,150,213,106,251,194,104,156, 94, 79,222,228,105,138,215,191,121,118,222,
- 11,130, 83,167, 78,225,208,161, 67,248,242,203, 47,107, 0,188,204,243,246,153, 16,147, 73, 66,127,255, 29,157, 84, 42, 18, 85,
- 90, 42, 0, 64,151, 45, 91,134,173, 91,183,254,161,253,173,190, 71,175, 33, 15, 95,253, 65, 32, 72,192,144,230, 37,229,250,181,
- 95,231,158,123,249,151, 98,109,190,209, 70,206,224,250, 57, 72,190,121, 10,239,142,168, 70,193,155, 67,241,161,172, 6,161,223,
- 61, 13,104, 47,162,134, 74,142, 58, 52,175, 6,112, 35,170,255,215,223,182,224,245,215,191,194, 93, 45,250,227,248,193, 95,177,
- 75,253, 59,100,241,125,145, 48,210,222,209,168, 64, 8,179, 15,241, 17,137,131,122,225,157,255,123, 31, 59,142, 86,161, 89,215,
- 62,120,224,129,137,216,185,247, 91,108,219,105,143,178,100,108, 22, 4,137, 60,143,115,148,181,193,198,218,173, 25, 56,172, 25,
-179,217,140,218,218, 90, 24,141, 70,232, 13, 70, 24, 13,122, 24, 13,122, 24, 76,181, 48,155,106, 27,118,127, 25,155,163,178,198,
-134, 42, 35,139, 42, 35,107,255, 92,205,162, 70,111, 69,141,193, 10,157,214,134,114,173, 5,229, 58, 11,202,203, 45,184,126,221,
-140,171,215, 45, 30, 21,128, 27,238,127,151,107,230,220, 55, 2, 10, 1, 33,160,245,162,254, 41,241, 78,182, 47,206,124, 17,189,
-227,123, 59,183, 85,171, 85, 78,143,192,129,237, 7,112,170,248, 20,175,100, 79, 44,107,255,173,236,236,236,253,148,210,126,147,
- 39, 79,158,217,173, 91,183,214, 0, 24,150,101,131, 44, 22, 75,132,213,106,109,225, 70, 1, 96, 61,184,254, 23,127,250,233,167,
-247, 79,158, 60, 25,221, 90,183,230, 53,117,213, 24,136,218,180,145, 2,192,144, 94,189,100,222,206,237,209,174,157, 44, 61, 61,
- 29,199,139,139,171,190,217,181, 11, 39, 79,158,116, 90,253, 61,123,246,132,227,152,249,155, 93,187, 80, 92, 92,140, 83, 5, 5,
- 70,111, 50,111, 69, 12, 0, 0, 58,122,244,232,167, 92, 73,159,251, 63, 54, 54,150,151, 59, 23, 0, 10, 79,158, 45,176, 90,173,
- 48,155, 77,208, 94, 45,195,181,203, 87,112,253,202, 85, 92,191,114, 21,218,178,107,168, 40, 47,135, 73,175,183,199,207, 84, 84,
- 96,144, 92,238,173, 13,173,139,211, 63, 22, 46, 78,255, 88, 8,160, 10, 0, 59,108,240,221, 55,157,228, 18, 23,192, 27, 39,142,
-100, 75, 75,207, 22,168, 7, 12,189,113, 13,231,206, 28,148, 86, 92, 43, 82, 55,166,127,144, 41,186, 58,150,191, 63, 56,173,213,
-163,100,246, 61,160,231,126, 67,155,207,143, 32,116,229, 97, 92,158,218, 21,177, 59,202, 64, 68, 65, 16, 18, 64,200,120, 87, 64,
-159,126,230, 25,242,218,251,239,224,185, 5,243, 97, 97,109, 56,121,190, 16, 51, 30,155, 14,177, 68,130,239,191,219, 12, 88,108,
- 48,213,154,176,175,224, 32,140,198, 26,164, 38, 39,231, 20, 20, 20, 80, 15,132, 72, 38, 77,154, 36, 27, 55,110, 28, 8, 33,216,
-189,123,247, 77, 46,253, 23, 95,228, 31, 39,212,178,101, 75, 92,186,116, 9, 0,132, 25, 25, 25,184,118,237, 26,250,247,239,143,
-240,240,112, 48, 12,131,252,252,124, 48, 12, 3, 66, 8, 46, 93,186,132,150, 45, 91,122,149,169, 84, 42,223, 53,155,205,163,148,
- 74,229, 6, 23,178,126,108,228,200,145,233,179,103,207,142,200,200,200,144, 16, 66, 24, 0,223, 2, 88,160, 84, 42,175,122,145,
-247,175, 67, 22,203,144,250,242,166, 45,252,102,227,163,211,159, 38,247,207,201,128,230,208, 9,164,167,167,179, 85, 85, 85, 41,
- 74,165,242, 60,143, 41, 68, 0, 96,239,106,222, 60,188,211,149, 43,184,215, 96, 64,123,145, 40, 52, 84, 32, 96, 74, 75, 75,111,
-138,197,249,163,148, 0,238,143,215, 20, 0,128,179, 95, 31, 60,247,140, 86,111, 58, 12,123,224, 86,251,220,194,107,153,163,122,
-181, 93, 36, 60,119, 40, 18, 95, 62, 14, 4,133, 2, 38, 61, 64, 41, 44, 2,201,213,125,199, 47,127, 1,160,193,236, 75,235,214,
-126, 38,155, 62, 99,166, 26, 0,244,172, 5,103, 42, 74, 0,216,112, 87,139,110,144,201,238, 70,219, 86,237, 80, 94, 89,101,247,
- 21,152,173,184, 92,161, 71,111, 15, 55,213,177,115, 60, 46,150,228, 58,222, 76, 33, 18, 7,216, 99, 0,118, 28,181, 96,231,214,
-108, 92,189,126, 9, 45,195,237, 43, 9,194,197, 34,220, 61,196,243,122, 80, 51,132, 16,179, 86,216, 32, 0, 75, 8, 24, 27, 11,
- 88,172,176,137,132, 0, 97,192,189,147, 44,133, 61, 87,128, 7, 60, 60,237, 37,242,221,127, 23,208, 16, 49,133, 80,228,226, 97,
-176, 0, 86, 10,212,154, 1,155,201, 6, 66, 8,136,152,192,106, 3,244, 38, 96, 86,242,191,137,187, 84,142, 54, 23, 13,141,101,
- 88, 16,135,251,223,174, 20, 16,216, 88, 6,140,192,110,245, 51, 0,168,128, 2,148,159, 23,192,149,252,221,109, 31,216,126,160,
-155,215, 41, 9,155, 13, 38,147, 9,147, 39, 79,238,155,157,157,189, 28,192,192,236,236,236, 29,217,217,217,251, 38, 79,158,252,
- 76,247,238,221, 45,132,144,150, 31,126,248,225,174,151, 94,122,105,134, 86,171,205,241,160,124, 58,251,228,130, 5, 11, 22, 47,
- 88,176, 0, 59,118,236,128,254,234,205,239,114,183,214,173,113,238,220, 57, 0, 80,243, 73, 12,212, 80,210, 31, 81,155, 54,210,
- 79, 63,253, 84, 77, 41,197,144,158, 61,101,131,121,172, 44,232,223,187,183,134, 48,204,248,147, 63,253,212, 21, 64, 16,128,143,
-184,213, 0, 61,218,183,199,252,249,243,113,224,192,129,165, 49, 49, 49, 57,253,162,162,188,198, 40,184,203, 3,224,111, 12,128,
- 43,184, 60, 0,113,113, 73, 63,229,229,149, 29, 80, 40, 20, 98,199, 52,193,112, 0,185,124,147, 0,117, 29,208,231, 21,227,229,
- 43,227, 88,171,173,151,190,178, 18,149,215,175,129, 16, 6,148,178,168,173,173, 5,165, 20,148, 82,156, 59,241, 59, 44,102, 19,
-238, 26, 18,235,173, 13, 93,199,156,112, 0,204,253,178,209,236,253,178,209,117,130,254, 28, 83, 4,188,113,242,151,111,164,151,
-206, 22,168, 1,160,107,151, 46,248,190,158, 23,160,117,231,193, 50,220, 70, 12,249,161, 12, 5,247, 1, 3, 99,229, 40,123,122,
- 56,218,125,118, 16,167,181,122, 68,136, 9,202,181, 58, 8, 9,241,234, 1,224, 48,115,230,204, 58,103,110,217,178,133,222, 63,
-225, 62,108,221,188, 21, 27, 55,110,196, 27,139, 94,195, 46,205, 30, 8,132, 2, 68,117,140, 26, 93, 89,233,121,233,114, 98, 98,
-162, 38, 49, 49,145,236,216,177, 67, 58,110,220,184, 58,177, 0,187,119,239,198,153, 51,103,106,149, 74,101,123, 62,215,214,181,
-107, 87, 20, 21, 21,161, 79,159, 62,214,121,243,230,137,215,175, 95,143,176,176, 48,156, 60,121,242, 38,207,107, 81, 81, 17,186,
-242,124,206, 74,229,141,196,115, 10,133,226,241,123,238,185,231,173,199, 30,123, 44,172,160,160,160,121,109,109,237, 63,131,131,
-131, 31, 48, 26,141, 31, 40,149,202,239,121,202,251,197, 85,222, 3,207,174, 95,115,239,216, 73,228,223, 42,128,116,120, 16,239,
-174,120,133,106, 11, 79,166, 40,149,202, 44,111,178, 92,188,108,164,218, 98,169, 16, 7, 5,161,133, 88,140, 96,155,205,164,183,
-217,108,183,131,252,249,162,142, 2, 32,121, 76,121, 92,251,181,226,180,228, 49, 37, 55,165, 89,114,236,107,197, 15,213,181, 86,
-253,176,187, 90,221, 31, 25, 34,184, 71, 96,170, 13,181, 82,166,186,188,218,156,151,123,230,202,206, 82,173, 33, 71,242,152,242,
- 50, 86,174,116,251, 3, 53,250,214,154,180,167,231,200, 0,168, 89, 1, 55,205, 39,192,153,170,203,120,253,153, 20, 24, 12, 38,
- 84, 25,237, 49, 0,102, 38, 8, 99, 18, 61,167,217,125,109, 81, 50,217,177,109,136,253,229,182,113,150,179, 21,137,253, 9,166,
- 61,181, 12, 33, 33, 65,104, 17, 44,145, 1, 80, 23, 30, 59, 34,139,239,231, 57, 33,136,144, 90, 97, 38,118, 37, 0,132,192, 70,
-169, 93, 17,224, 18, 54, 16, 6, 66,150,133,149, 91,118,224, 69, 9,168, 48,134,195,104, 42,135, 88,200, 56,211,156, 89, 89,192,
- 98,161,176, 88, 41,106,140, 44,136,128,192, 6, 2, 11,123,195,117,239,150, 96, 89, 6, 12,177,129,216, 8, 40, 67,157,238,127,
-210,128,241,204, 73,122,238,121, 25, 89,185,242,164, 71, 11,239,247,220,223, 27,219,119,204,148, 82, 24,141, 70,244,239,223,255,
-114,116,116,244,164,243,231,207,247,216,184,113, 99, 62,128,135,178,179,179, 31,114, 61,249,253,247,223,215,188,244,210, 75, 50,
-173, 86,235,141, 32,156, 13,146,150,150,214,224, 73,143, 62,241, 4, 0,223, 18, 3,113, 89,247,234, 99,104,239,222, 62, 45, 43,
-236,215,179,231, 46, 87, 79, 70,122,122,250, 39, 19, 39, 78,180,158, 58,117, 74, 88, 92, 92,140,174, 45, 91,230, 70,133,132,240,
- 10, 80,188, 21,121, 0,234,145,251,213,156,156, 28,215, 24,143,163, 14, 69,128,111,198, 64,125,112,251,118,143,158,220,179, 55,
- 55, 60, 52,180, 69,149,174, 2, 86,171, 21,212,241, 30,232,174,150,161, 74,167, 3,165,148,143,245,111,127, 89,111,196,156, 48,
-142,229,128,140, 99,217,159, 51, 49, 80,225,249,243,252,149, 0,195,175,210,139,133,249, 78, 43,255,251, 44,251,242,191,214,209,
- 35,100, 3, 98, 39,106,110,223,240, 74,111, 86, 2,240, 57, 6,166,189,142, 43, 44,139, 1,171,243,145,159,216, 22,125,183, 94,
-133,144, 0,205, 69,254,173,152,157, 56,113, 34,217,171,217, 75,199, 36,140,197,230, 77,223,225,237,165,239, 99, 97,101, 37, 40,
-203, 98,195,134, 77, 40, 45, 45,125, 0,128, 87, 31,180, 59, 69, 0, 0, 38, 77,154,244, 11,128,106, 62,215, 18, 31, 31, 79, 46,
- 93,186, 68,143, 28, 57, 34, 30, 60,120, 48,198,142, 29, 11,181, 90,141,206,157, 59,195,100, 50, 97,244,232,209,160,148,178, 71,
-142, 28, 97, 68, 34,145,207, 25, 1, 21, 10, 69,159,176,176,176,229, 83,167, 78, 21,157, 56,113,162,133,201,100,106, 40, 48,144,
-175,188, 65, 81, 3,167,172, 25, 56,106, 42,249, 34, 7,168, 50, 2,230,115, 59, 88,109,161,186,126, 96,160, 39,101,130, 83, 2,
-132,218,202, 74,171,216, 98,129, 65, 44,134,208,158,245,135,253,163,123, 29,151, 7,192,213,242,119,183,207,173, 43,213,133,252,
-185,237,223,139,191, 86,148, 20, 95,175,201, 5,208,222,241,242,154, 0,148, 2, 40,146, 60,166,244,234,226, 28, 60,224, 65,205,
-241,223, 74,100, 54,218, 76,237,250,114,212,232,171, 32, 16,134, 1, 76, 8,254,245, 1,255, 20,147,137, 19,250,145,119,230, 60,
- 32, 5, 99, 80,187, 54,111,179,102, 97,176, 89,116, 0,213,163,248, 96, 38,153, 57, 45,209,171, 44, 11, 4, 0,165,118,162,134,
- 0, 98,234, 80, 4, 28,228,111,207, 1, 8,128,231,218,205,228,212, 87, 73,230,199,111, 80,171, 69, 11,161, 99, 97, 47,165, 20,
- 54, 43, 69,173, 5,168,170,182,194, 2, 10, 43,101, 32, 20, 17, 44,121,235,147, 6,239,123,246,108,123,144,214,154,213,103, 40,
-177,216,173,127, 10,128, 82, 2, 80,135,197, 64, 5, 32, 2, 22, 44, 43,196, 11, 11,198,241,106,195,217,111,207,150,157, 63,123,
-222, 19, 1,139, 96, 95,170,225,137,157, 88, 0, 48,153, 76,208,233,116,186,176,176, 48,196,198,198,254, 58,116,232,208,160,107,
-215,174,225,236,217,179,246,229, 97, 44, 43,221,180,105,147,218,161, 4,168,121, 40, 1,150,164,196,196,164,174,253,251,219,238,
-233,213, 75,239,232,163, 38,212, 93, 17,137,164, 68,251,179,237,202, 35, 41,208,139, 47,190, 40, 3,128, 33, 61,123,222,116, 44,
-118,192,128, 70, 17, 68,255,222,189, 63, 99, 24,198,118,242,167,159, 66,219,182,109,123,189,223,240,225,107,110,167, 70,239,134,
-212,245,177,177,177,174,209,214,206,117,172, 62, 40, 1, 39, 6,141, 29, 51,108,243,127,190,216, 20,221,173,107, 31,147,169, 22,
- 54,139, 21, 44,203,162,121, 68, 4, 42,181, 90, 12,146,203,101, 60,172,127, 0,168,120,243,133,103,219, 0, 48, 23,158, 63, 47,
-230,230,255, 15, 29,249, 13,247,203, 70,179,139,211, 63,246,150, 28,200,137,152,246, 58,122,242,212, 73,217,222,157,223,215,113,
-241,143, 25,255,144,140,105, 17,223,168,231,218, 80,128,159,251,253,252, 57,108,200, 15,101,192, 15,207, 56,183,239,250,254,198,
- 18,224, 74,139,255,235,195,199, 72,199,144,175, 74,190,186,111,220,132,196,237, 79, 62, 62,107,255,221, 3,250,223,187,249,251,
- 45,200,253,229, 48, 82, 83, 83,183,173,108,192, 64,243,162, 8,204,250,246,219,111,255,243,237,183,223,198, 37, 38, 38,242,190,
-184,113,227,198,141,217,181,107,215,222,173, 91,183, 34, 58, 58, 26, 9, 9, 9, 8, 11, 11, 59, 93, 89, 89, 25,115,252,248,113,
- 20, 21, 21, 49, 34,145, 8,227,198,141,147,251,122,159,142,192,192,165, 91,182,108,105, 48, 48,208, 71,121, 63, 43, 20,138,247,
-190,203,126,240, 21, 99,212, 12, 24,127,122,149,189,180,111,201,227,190,202,115, 40, 1,181,197,101,101,162, 23, 78,159,190,104,
- 51, 24,152, 95, 25, 70,212, 78, 32,184,162, 80, 40,110,203, 20,128,187,108,128,222,166, 0,220, 66,242,152, 82, 15,224, 55,199,
-159, 95,120,252,241,103, 52,105,105, 47,201, 50,148,111,171,163,186,244, 0, 96,130, 40, 72,130,139,151,171, 48,122,226, 76,226,
-187,188, 7, 53,119,245,138,193,234, 85,223, 0,108, 49, 0, 33,172,181, 70, 68,181, 15,147,117,110, 97,229,255,242,219, 88, 8,
- 25, 22, 22, 34,132,136, 90,111, 40, 2,176, 2,212, 6,190,129, 97,174, 72,125,246, 13, 2, 0,139, 95,158, 67, 69, 66,187,181,
-111,101,237, 46,243,138,106, 10,155, 21, 16, 8, 89,124,246, 41, 63,165,231,137,100,123,106,228, 85, 95,156,162,224,114,194, 51,
- 0, 75,236,238,254,249, 11, 30,240,233, 34, 43,107, 42, 53, 17,109, 35, 26,219,191, 24,192,190,138,194,104, 52,194,102,179,161,
-170,170, 10, 2,129, 0, 54,155, 13,237,218,181,131,197, 98,129, 82,169, 84,215,243, 4,168,189,213, 12, 24,212,191,127, 54, 0,
- 52, 69,198, 63, 0,136, 36, 68, 3, 0,145, 3, 6,220, 18, 51,175,111,207,158, 25,141, 17,240,194,226,197,117, 86, 73, 44,120,
-227,141, 58,158, 1, 95,230,254,221,144,185,222,211,106, 0, 31,210, 1,159,124,112,246,172,126, 0, 4, 39,115,114, 44,181, 6,
- 35, 88,155, 13,189, 99, 99,101,237, 99,250,160,235,128, 62,252,222, 57, 74,166,238,252, 97,155,115,115,120,159,104,231,231,157,
- 63,108,187,105,219, 83,104,252,233,203, 17,132,105, 17,143,177,227,137,236,196,201,179,184, 92,124, 84, 13, 0,123,119,126,175,
-110,219,249,172,172,255,176,127,248,172, 4, 76,153, 50, 5,190,166,247,181, 17,207,121,183, 75, 38,181,195, 15,151,106,111,249,
-128, 63,115,230,204, 31, 0, 48, 5, 5, 5,236,158,188, 28,180,108,213, 18,141,169,207,145,152,152,248, 69, 98, 98,226, 87,240,
-158,222,185, 14,154, 55,111,174,126,244,209, 71, 73,110,110, 46, 61,123,246, 44,242,243,243, 81, 93, 93, 29,211, 20,181, 0, 28,
-100,251,127, 10,133, 66,148,155,155,219,223,108, 54,191,234, 58,151,239,167,188, 69, 10,197, 63, 68, 97,221,191,154, 95,121,118,
-215,140, 70,200,179,174, 63,116,232, 1, 0, 9, 0,126, 6,203, 86, 3,184, 58,109,225, 55, 72, 13,123, 4,153,149,127,140, 18,
-192,173, 2,112,183,223, 47, 5,192,215,169,132, 6, 93, 85,143, 60,161,217,182,243, 12,121,120, 66, 8,109, 19,213, 9,218,106,
- 43, 70, 79,120,220,239,142, 16,127, 79, 47, 18,127,207, 43, 80, 40, 94,167,192, 85, 68, 52, 23,162,115, 36,235,211, 75, 63,228,
-159, 11,110, 89,150,176, 55,223, 91, 73, 0, 96,238,188,103,168,217,104, 1, 11,251,178,185,229,159, 46,247,235, 55, 83,102,217,
-107, 6,172,250,207, 73,202, 82, 1, 94,126,233,161,219,153,225, 76,236,234,198, 54,153, 76, 48,155,205, 78, 34,227, 8, 44, 80,
- 37,208,139, 11,210,135,244,195,126,194,188,112, 97, 82,144,195,131,210,216, 20,100, 20,128,181,215,232,209,117,174,185,107,251,
-118,188, 5, 4,177, 38,205, 19, 19,125, 54,252, 80,191, 20,112, 29,251,187, 69,156,166,239,208, 56,244, 29,138, 70,183,165,183,
-194, 62,245,117, 96, 43, 9,130,145,241,188, 34,245,108,181, 21, 49,205,249, 12,145, 77,210, 21,232,144, 33, 67,154,178, 79, 89,
-252,253, 98,124,124, 60,241,150,136,173, 17,164,253,174, 66,161,248,206, 53, 54,160,145,242,254,165, 80, 40,214,185,198, 6,248,
- 33,195, 2,160, 2, 64,189,184,129,107,127, 24,249,123, 34,123,183, 61,110,224,192,129,119,106,249,200, 0,254, 68,232,209,163,
- 7, 10, 11, 11, 3, 13, 17, 64, 0, 1, 4,240, 39, 1, 19,104,130, 0,154, 2, 1,242, 15, 32,128, 0, 2, 8, 40, 0, 1, 4,
- 16, 64, 0, 1, 4, 16, 64, 64, 1, 8, 32,128, 0, 2, 8, 32,128, 0, 2, 10, 64, 0, 1, 4, 16, 64, 0, 1, 4,112,219, 81,
- 39, 52,117,206,156, 57,126, 71,143,186,203,100, 23,144, 23,144, 23,144,119,103,200, 83, 40, 20, 84,169,108,120,217,105,160,253,
- 2,242, 2,242,254, 90,242,124, 86, 0,184,129,194, 87, 33,158, 6,150,166,150, 23,192,157, 9,111, 4, 19,192,157,249, 28,124,
- 60, 63, 20,192, 61,251,247,239, 95, 34, 16, 8,134, 7, 5, 5,193, 96, 48, 28,188,247,222,123, 23, 1,200, 7, 96,184, 19,218,
- 64,165, 82, 73,179,178,178,212,127,197,113,229,216,177, 99,200,207,207,247,122, 94, 94, 94, 30, 61,118,236, 24, 50, 51, 51, 73,
-191,126,253, 26, 45,143,195,208,161, 67,225, 73, 94, 0,127, 98, 15, 0, 7, 95,210,147,242, 73,148,227, 78, 94, 67,229, 97,253,
- 73,188,243, 87, 31,208,249,158, 59,126,252,120,217, 35,143, 60,162,225, 43, 51, 42,234,230,210,203,165,165,165,117,182,147,146,
-146, 32,151,203, 9, 31,121,183, 82, 9, 24, 63,126, 60, 5,128,157, 59,119,146, 59, 65,158, 94,175, 31,187,105,211, 38,213,233,
-211,167, 1, 0,209,209,209, 15,166,164,164,108,241,247,249,186,246,123, 74,169,243,253,224,246,115,239, 10, 33, 4, 25, 25, 25,
-196,147,242,204,247, 57,248,248,188,250, 28, 59,118,108, 83, 85, 85, 85,175, 46, 93,186,224,250,245,235,168,173,173, 5,128,225,
-155, 54,109, 82,135,134,134,158, 76, 76, 76,124, 24,128,199, 82,146, 35, 70,140,240,201, 32, 56,112,224,128, 12, 60, 83, 61,115,
-200,202,202, 82, 39, 37, 37,201,228,114,185,198,215,231,145,154,154,234,211,245, 77,153, 50,133,247,251,193,161, 75, 23,123, 5,
-220,234,234,106,152, 76, 38,174, 63,241,122,223,242,243,243,241,223,255,122,206, 80,107, 50,153,232,240,225,195,209,187,119,111,
-172, 93,187,182,204,100, 50,117,110,104, 93,120,126,126, 62,102,204,152,193,235, 94,175, 94,189,138, 37, 75,150,224, 78,206,109,
- 31,192, 13,212, 79, 6,116, 43, 19, 1, 5,172,216, 91,136,239, 51,188,167, 52,126,120,206, 14,159,100,170,213, 55, 12,164,211,
-167, 79, 35, 52, 52,212, 57, 8,185,180, 7, 31,107,139,214,223,174, 63,128,169, 84, 42,154,149,149,229,183, 5,182,110,221, 58,
-233,248,241,227, 27,148,223, 24,164,165,165,209, 81,163, 70,201,166, 79,159,238, 19, 89,108,218,180, 73,213,166, 77, 27,204,156,
- 57, 19, 58,157,142, 77, 79, 79,223,172,211,233,166, 69, 68, 68,248,148, 69,140, 16,130, 31,126,248,193,185,157,152,152,136, 29,
- 59,118,120,220,246,134,250, 74,128, 66,161,160,177,177,177,200,204,204,164, 92, 98, 38, 95,201,191,178,178, 50,183,123,247,238,
- 45, 0, 64, 34,145, 32, 56, 56, 24,101,101,101,168,168,168, 64, 88, 88, 24,202,202,202,122,237,216,177, 35, 63, 49, 49,177, 39,
-128, 43,158,132,245,235,215, 15, 73, 73, 73,136,142,190,145,245,111,233,210,165,117,206, 89,184,112, 33,103,201,170,167, 79,159,
-238,243,243,246,135,252, 57,172, 88,177,162,161, 67,206, 90, 5,254, 34, 52, 52, 20, 39, 78,156,128, 72, 36,130,217,108,198,142,
- 29, 59, 80, 88, 88,136,151, 95,126,217, 39, 57, 87,235, 21,201,122,240,193, 7, 5, 0,228, 63,254,248,227,142,209,163, 71, 95,
-125,248,225,135,219,170, 84, 42, 8, 4,130,214,225,225,225, 2, 95,100, 53,132,243,231,207, 7, 72,226, 79, 74,254,220, 62,175,
-181, 0,254,172, 88,181,106,149, 52, 37, 37, 69,211, 88, 57,127, 22, 87,118,212,144,119,110, 88,237, 5,175,250, 37, 67,167,211,
-193, 96, 48, 56, 45,144,204,204, 76, 87, 75,136,175,181,117,211,182, 92, 46,199,238,221,187, 41, 33,228,166,227,254,224,199, 31,
-127, 84,191,248,226,139,200,206,206,198,228,201,147,155,164,253,118,238,220, 73,246,236,217, 67, 41,165,200,201,201, 81,231,228,
-228,248,164,160,156, 62,125, 26, 51,103,206,100, 1, 48, 98,177,152,137,137,137, 65,122,122,250,122, 0,235,163,163,163, 39,164,
-164,164,108,231, 35,231, 86, 20, 3,226,148,128,204,204, 76,202,165, 1,230,254, 87, 40, 20, 52, 41, 41,201,151,123, 13,213,233,
-116,155, 36, 18, 73, 11, 0,120,250,233,167, 81, 91, 91,139,140,140, 12, 4, 7, 7, 59,203,102, 11, 4, 2, 84, 86, 86,182, 0,
-144, 14,224, 31,158, 4,114,228, 94, 84, 84,116,211,190,166, 64, 82, 82,146,204,113,159, 50,127, 21,129,231,159,127,222,249,121,
-249,242,229,220, 71,166,222,126,222, 10, 1,231, 53,121,245,213, 87, 17, 26, 26,138,236,236,108,140, 30, 61,218, 47,242,175,143,
-145, 35, 71, 2,246, 44,141,255,124,252,241,199,209,163, 71,143,182, 59,118,236, 64,121,121, 57, 87,114,215,236,229, 93,104,234,
-238, 39,157, 48, 97,130,122,219,182,109,238,188, 55,210, 49, 99,198,168, 9, 33,216,179,103, 79,192,221,123,139,201, 63,117,225,
-251, 0,128,204,165, 47,185, 85, 2,254, 16, 5, 32, 51, 51,211,221,131,166, 13,237,247,231, 55, 14, 29, 58,164, 6, 32,107,172,
- 18, 48, 99,198,140,191,205,124,182,193, 96,184,201,234,247,135,104, 56, 98,153, 60,121, 50, 18, 18, 18, 8, 0,100,103,103, 55,
-201, 53,174, 91,183, 78,234,176,232, 72, 89, 89,153, 52, 43, 43, 75, 93, 86, 86, 38,245,213, 98,119,135,177, 99,199,146,177, 99,
-199, 98,221,186,117,210,156,156, 28,245,186,117,235,124,146,171,211,233,172, 17, 17, 17,226, 77,155, 54,193,225, 13,168,213,233,
-116, 76,122,122,250, 54,157, 78, 55, 46, 34, 34, 98,247,237,124,190, 28,233,187,246,101,133, 66, 65, 57, 37,141, 39,238, 41, 44,
- 44,236,213,191,127,127,204,154, 53, 11,149,149,149, 40, 47, 47,135, 72, 36,130, 80, 40,132, 80, 40,132, 72, 36, 66,112,112, 48,
-180, 90, 45, 84, 42,213,116,185, 92,254,172, 55,161, 69, 69, 69,117,148, 67, 78, 1,224, 60, 1,177,177,177,190, 92,163, 59,235,
- 95,150,149,149,165,110,140,231,201, 5,214, 6,198, 74,222,222,128,243,231,207, 35, 39, 39, 7, 19, 38, 76, 64,151, 46, 93,208,
-170, 85, 43,228,228,228,224,229,151, 95,118,122,223, 4, 2,129,207, 23, 54,114,228, 72, 44, 90,180, 8, 75,150, 44,105,159,146,
-146, 50,245,177,199, 30, 67, 66, 66, 2, 0, 64, 32, 16,204,108,217,178,229, 22,165, 82,105,241, 84, 12,104,221,186,117,188,188,
- 0,165,165,165,152, 54,109, 26, 63, 3, 37, 42, 10,169,169,169,234,162,162, 34,168, 84, 42,174,253,165,169,169,169,106, 78,129,
- 14,224,214,130, 35,127,238, 51,167, 4,252,225, 30,128,134,230,177,253, 9, 16,188,213, 74,192,253,247,223,223,104, 79,128, 47,
-247,229,203,111, 60,250,204, 78,108,250,100,124,147,180, 21,247, 2, 54, 84,169,234,224,193,131,141, 86, 12,154,226,249,254,248,
-227,143,106,206,234,159, 62,125,186,230,199, 31,127, 68,155, 54,109,212,104,162,196,233,156,220,156,156, 28,228,228,228,120,117,
- 55,235,245,250,251, 55,109,218,180, 13, 0,210,211,211,197,209,209,209, 72, 73, 73,225, 14, 75,126,251,205, 94, 47, 43, 61, 61,
-125, 87,116,116,244,195, 41, 41, 41, 94,235,147, 39, 38, 38,214,137,137,185,239,190,251,234,120, 6,248,184,253,221, 40,221,212,
- 93,255,226,158,139,235,116,128, 39,236,216,177, 99, 73, 76, 76, 12, 0,224,204,153, 51,160,148,226,212,169, 83,206,186, 15, 66,
-161, 16,132, 16,216,108, 54, 24, 12, 6,124,251,237,183,144,203,229, 94,171, 46,185,146,127, 82, 82,146, 91,229,197,117,138,192,
- 31, 37, 64, 46,151, 19,133, 66, 65, 27,235, 13,104,138,113,210, 98,177, 96,240,224,193,208,104, 52, 24, 50,100, 8,244,122,189,
-115,106, 71,163,209, 96,252,248,241,176,114, 37,200,125,179,252,177,100,201,146, 14, 41, 41, 41, 23,191,248,226, 11,231,177, 14,
- 29, 58, 96,217,178,101,255,229, 75,216, 77, 12,205,225,195,135, 17, 27, 27,139,232,232,104, 12, 30, 60,152, 30, 57,114, 68,198,
-145,127, 81, 81, 17, 52, 26, 13,159, 24,149,161, 0,158, 1,240, 79,165, 82,105,243,112,222, 4, 0, 81, 0,190, 85, 42,149,215,
- 2,212,255, 7,118,108, 62,248, 35,131, 0,155, 66, 9,232,218,181,107,163, 60, 1,220, 32,187,118,237, 90,183,199,183,111,223,
-142,181,107,215,250,101,153,228,157,235,131,184,110, 39,252,118,251,115,112,157,243, 87,169, 84,144,203,229, 78,183,255,193,131,
- 7,209,169, 83,167, 38, 81,250, 26, 99,125,113,214,255,245,235,215,157,117,230,165, 82,169,172, 41,189, 0, 28, 70,143, 30, 45,
-203,201,201, 81,123, 59,111,211,166, 77,219,184,185,127,189, 94,143,165, 75,151,162,166,166, 6, 34,145, 8, 65, 65, 65, 56,119,
-238, 28,222,121,231, 29,232,116, 58,164,167,167,127,167,211,233,198, 68, 68, 68,168,189,144,108, 29,178,247, 22, 19,208, 20,138,
-231,225,195,135,235,156,223, 80,144, 88,100,100,228,112,147,201, 4,171,213,138,131, 7, 15, 66, 32, 16,192,108, 54,195,104, 52,
-130,101, 89,231,123,108,177, 88, 96, 50,153,184,119,218,107,152,120, 67, 46,255,133, 11, 23, 58,189, 0,209,209,209, 40, 43, 43,
-107,180, 34,202,173, 10,240, 33,118, 68, 11, 32,210,221, 1,151,233, 0,159,144,158,158,142, 23, 95,124, 17,131, 6, 13,114,122,
- 64,184,244,217,131, 6, 13,194,169, 83,167,208,166, 77, 27,159,100,238,219,183, 15, 35, 71,142,236,146,146,146,114,158, 35,127,
-199,248, 25,181, 97,195,134, 75,245, 3,122,249, 42, 20, 13,253,150,143,222, 39,114,248,240, 97,105,106,106,170,122,200,144, 33,
- 24, 50,100,136, 26, 0, 78,157, 58,133,156,156, 28,190,207,225, 23, 0,193, 0,214, 43, 20,138,105,238,148, 0,133, 66,241, 12,
-128,143, 29,155,139, 20, 10, 69, 47,165,210,123,137,250,191, 50,184,106,128,153, 75, 95,186,105, 10,224, 47, 27, 3,112, 39, 42,
- 1, 51,102,204,160,139, 22, 45,186,201, 21,232, 15,249, 63,250, 76,211,206,211,233,245,250,155,130,252, 56,171, 95, 36, 18,225,
-202,149, 43,183,149,252, 93,173,127, 87,203,109,218,180,105, 26,141, 70,211,228, 94, 0, 95, 60, 39, 51,103,206, 52, 0, 8, 9,
- 13, 13,197,107,175,189, 6,145, 72,228, 60,158,156,156, 12, 0,136,136,136,192,196,137, 19,177,127,255,254,189, 19, 39, 78,252,
- 67,174,211,181,189, 93,231,255,221, 33, 54, 54,182, 78,165,198,134,214, 17,155,205,102,104,181, 90,212,214,214, 34, 44, 44, 12,
- 65, 65, 65,176, 90,173,160,148,194,102,179,193,108, 54,195, 98,177,192,102,179,185, 42,244,215, 61, 93,103, 81, 81, 81, 29,235,
-190,254,116, 64,253, 0,193,198, 66, 46,151,107,124,140, 69,145, 52,116,160,129,216, 0,175,120,231,157,119, 48, 97,194, 4,116,
-237,218, 21, 33, 33, 33,144, 74,165,208,106,181, 8, 13, 13,133, 78,167,195,234,213,171,193, 48,190,197, 23,142, 28, 57,178, 99,
- 74, 74,202,249,121,243,230, 97,243,230,205,120,232,161,135, 0,160,221,190,125,251,174,250,211, 78, 14,133, 2,220,152,197,141,
- 85,190,146,191,171, 39, 96,195,134, 13,178,169, 83,167,170, 1, 96,195,134, 13,178,202,202, 74,141, 15,253,217,172, 80, 40,102,
- 0, 88,235, 65, 9, 72,112,249,220, 25, 64,127,216,151,164, 6,224, 66,252, 13,225, 47,153, 9,112,216,176, 97,178,166, 8, 8,
-244,215, 74,119, 29,144,151, 44, 89,210,104,242,231, 48,120,208, 64,236,217,171,198,186,189, 33, 78,165, 32,239, 92,159, 70,221,
- 99,108,108, 44,138,138,138,144,157,157,141, 78,157, 58, 97,205,154, 53,126, 88, 93, 84,202,125, 74, 75, 75,107, 18,242,231,172,
-255,178,178, 50, 89,253, 99,163, 70, 43, 88,140, 99, 0, 0, 32, 0, 73, 68, 65, 84,141,146,101,103,103, 59,207,105, 10,228,228,
-228,168,249,122,159,116, 58,221,239,176,207, 11,179, 27, 54,108,192,234,213,171, 1, 0,235,215,175,135, 78,167,227, 78,179,158,
- 58,117, 10,173, 91,183,190, 45,239,128,107,180,191, 59,229,140,111,153,230,162,162,162,131, 54,155, 13, 58,157, 14,215,175, 95,
-119, 6,142, 26, 12, 6,212,212,212,160,170,170, 10,149,149,149, 48, 26,141, 48,153, 76,176,217,108, 0,144,235, 73,102,125,114,
-119, 23, 72, 90,127, 85, 0, 95,168, 84, 42,105,253,123, 86,169, 84,190,246,147,144,166,126, 30,107,214,172,129, 84, 42, 69, 72,
- 72, 8, 78,156, 56, 1,141, 70,131,208,208, 80,188,254,250,235,216,191,127, 63, 94,126,249,101,159, 20,128,145, 35, 71,182, 75,
- 73, 73,185, 48,109,218, 52,124,243,205, 55, 28,249,119, 0,112,213,147, 37,207, 71, 9, 88,178,100, 73, 83,144, 63, 0, 72, 57,
-242, 7,128,169, 83,167,170, 71,143, 30, 77,125, 28, 67,205, 0,184,117,138,235, 21, 10, 69,253, 64,137, 51, 46,159, 75, 0, 28,
- 13,208,190,203, 56,176,240,253, 58,177, 0,245,241,151, 9, 2,108,106,242,119,172,119,109,180,229,198, 77, 7,204,152, 49,195,
-111,242,127,244,153,157, 24, 60,232,134,235,102,211, 55,223, 98,211, 55,246,207,123,246,170,129, 49, 50, 0,190, 45, 3, 84, 40,
- 20,136,141,141, 5, 96, 15, 6, 60,124,248, 48,118,239,182,199,172, 29, 61,122, 20,163, 71,143,246, 65, 26,209, 0, 55, 2,255,
- 26, 27,169,191,110,221, 58,169, 59,235,191, 62,154,202, 11,192, 41, 18, 82,169, 84,230,237,220,232,232,232,113,233,233,233,187,
- 38, 78,156,136, 83,167, 78,225,244,233,211,120,231,157,119,172, 0,132, 6,131, 1,233,233,233,112, 28, 19, 22, 23, 23,227,241,
-199, 31,247, 42,243, 86,196, 0,112,150,116, 86, 86,150,211,139,197, 17, 35,247,220,249, 32, 38, 38,166,192, 96, 48, 12, 55,155,
-205,184,118,237, 26,130,130,130, 32, 20, 10,157, 30, 0,189, 94, 15,131,193, 0,147,201,132,202,202, 74,110, 62,255,162, 39,153,
- 28,185,115,211, 0,177,177,177,168,239,173,112, 23, 23,192,135,252,185, 28, 0,245,247, 53,166,127,112, 86,191, 27,139,223,202,
-119, 12, 45, 44, 44,196,169, 83,167, 96, 48, 24, 16, 31, 31, 15,131,193,128,172,172, 44, 76,157, 58, 21,155, 55,111,134, 64, 32,
-224,173, 0,196,196,196,116,228,200, 63, 63, 63, 31,111,188,241, 6, 0,116,158, 49, 99,198,229,181,107,215,146,125,251,246, 53,
-106, 12,229, 60, 1,141, 33,255,216,216, 88,202,245,179, 35, 71,142,160,160,160, 64,150,154,154,170,238,217,179, 39, 68, 34, 17,
-117, 9, 12,244,219, 19,160, 80, 40,230, 2,152, 0, 96, 50,128, 54,176,199, 0,252,173,221,255,192,141, 85, 0,238,130, 0,111,
-203, 42,128, 63, 42, 8,240, 78, 35,255,250, 74, 64, 99, 44,127, 79,219,123,246,170,253,121, 65,111,152, 59, 33, 33,232,221,187,
-119,157,227,135, 14, 29,242, 73,222,228,201,147,157, 10, 64,118,118, 54,178,179,179,235,172, 10,240,229,254,215,172, 89,163, 6,
-128, 29, 59,118,184, 37,207,233,211,167,107,214,172, 89, 3,128,223, 18,166,134,146,254,112,138, 6,165, 20,163, 71,143,150, 77,
-155, 54,205,107,223, 73, 73, 73,217,173,213,106,199, 30, 56,112, 96, 79, 76, 76, 12, 78,159, 62, 13,157, 78, 39,140,136,136, 64,
- 74, 74, 10,180, 90,109,241,129, 3, 7,186,196,196,196, 96,230,204,153, 94,239,215, 93, 30, 0,127, 99, 0,234,191, 91, 74,165,
-146,200,229,114,168, 84, 42, 90,127, 90,134,239,243,136,139,139,123, 69,163,209, 60,103,179,217, 80, 85, 85, 5,139,197,226, 84,
- 86,106,107,107, 65, 41,173, 19, 24, 40,151,203, 31,115, 16, 35,111,200,229,114,200,229,242, 58,203, 2,125,157, 2,112, 37,122,
-185, 92,174,169, 63,182,184, 42, 5, 77, 8,222,227, 39,183,212,239,133, 23, 94,128, 70,163,129, 76, 38, 67, 97, 97, 33,154, 53,
-107,134,146,146, 18,222, 10,192,161, 67,135, 72, 74, 74,202,133,199, 31,127, 28,251,246,237,195,235,175,191, 14, 0, 81, 51,102,
-204,184,212, 20,228,239,170, 4, 52,198,242,231,198,151,162,162, 34, 20, 20, 20, 16,135, 33, 40, 75, 77, 77, 85, 71, 71, 71, 67,
- 42,149, 82, 62,129,128,245,148,128,105, 0,214, 59,148,128,131, 0, 20, 0,164, 74,165,242, 10, 2,104,186, 14,220,212,217,248,
-220, 5,252, 44, 93,186,180,193,253,183,147,252,103,204,152,113, 75, 82,134, 54, 70,230,133,139,222,251,119,112,176,111, 94, 75,
- 79,243,195,254, 64, 46,151,203, 18, 18, 18, 52,123,246,236,161, 27, 55,110,172,163, 8,212, 39, 37,190, 50,211,210,210, 26,212,
-108,184,164, 36,190, 36, 6,106, 72,225,148,201,100,188,200,159, 67,100,100,164,115, 94,255,196,137, 19,255, 72, 79, 79,255, 47,
-231, 17, 40, 46, 46,238,242,234,171,175,202, 8, 33,188,228,221,138, 60, 0,245,219,217,221,252,183, 15, 74,169,126,244,232,209,
-139,183,111,223,254,166,213,106, 69, 69, 69,133, 51, 6, 0, 0,174, 93,187,134,138,138, 10, 80, 74, 57,171,221,167,201,118,110,
-254,191,254,178,191,250,113, 2,124,201,223,245, 57,223,105, 75,121, 57, 37,224,165,151, 94, 66, 78, 78, 14, 38, 78,156,136,247,
-222,123, 15, 11, 22, 44,128, 80, 40,132, 68, 34,241,246, 92, 9,165,148,157, 53,107, 22,254,251,223,255, 98,213,170, 85, 0,208,
-105,223,190,125,151, 28, 22,187, 95,157,201,101,218,170,201, 80, 90, 90, 10, 55,121, 0, 52,153,153,153,178, 49, 99,198,168,253,
- 89,242,232,176,250,167, 1,216, 10, 96, 46,128,184, 0,249, 55, 12,119, 65,128,188, 20, 0, 95,146,114,248, 75,216, 77,141,166,
- 32,255, 59,113,208,152, 59,119,174,236,228,201,147, 77, 42,211, 97, 13,169,155, 82, 38, 71,120,220,218,122, 0,206,100, 64, 44,
-203, 98,211,166, 77,188,149,128, 23, 95,124,145,187,206,155, 98, 0, 24,134, 1,203,178,248,215,191,254,165,230, 75,158,158,228,
- 53,118, 37, 65, 74, 74,202,255,180, 90,237,181, 3, 7, 14,236,224,107,245,223,106,111, 91,253,246,117,231, 98,247, 69, 9, 32,
-132,188, 53, 97,194,132,236,181,107,215, 30, 23,139,197,224, 86, 5,176, 44,139,240,240,112,232,116, 58, 46,133,109, 8, 0, 27,
- 95,131,192, 53,248,239,240,225,195,144,203,229,117,198, 19,111,227, 80, 81, 81, 17, 45, 42, 42,146,213,119,241, 55,114,201, 31,
-128, 6,221,253,214,229,203,151, 75, 0,152, 97,143,159,226,254,124, 82, 2, 92, 19,255, 60,245,212, 83,206,207, 85, 85, 85, 94,
- 95,179,184,184, 56,210,183,111, 95,250,213, 87, 95, 61,188,126,253,250,239, 57,178, 93,191,126, 61,124,141,250,231,112,233,210,
- 37,103, 74,226, 38,130,102,219,182,109, 13,245, 41,205,222,189,123,125,170, 85,225,225,240,101,119,217, 74,255,238, 53, 73,184,
- 85, 0,238,136,159,215, 42,128,166, 38,245,134,228,221, 41,202,195,157,220,113,250,244,233,163,233,211,167, 79,147,202,116, 12,
-142,183,252, 94, 93,221,255,245, 95,234,134,150,157, 57,174,143,207,181, 17, 31,238,247,150,222,107,100,100,228,206,198, 68,250,
- 55,101, 12,128,187, 62,236,201,219,227, 67,159, 63, 49, 99,198,140,102,187,118,237,122,183,164,164,228, 57,163,209, 8,155,205,
-134,129, 3, 7, 98,200,144, 33,233,114,185,124, 33, 31,242, 7,128,188,188, 60,231,103,215, 88,147,188,188,188,155,182, 61, 33,
- 58, 58,154, 56,188, 4, 50, 0,106, 78,153,112,153, 10,240,249,153, 76,153, 50,165,161, 67, 66,151,241, 82,124, 59,198, 21,165,
- 82,201, 30, 59,118, 12, 31,127,252, 49, 1,192, 43, 41,207,179,207,122,206,201, 52,116,232, 80, 76,154, 52,137,247, 53,120,147,
- 23,192,157,167, 4, 52, 68,254,110, 21,128,166, 38,193, 64,133,184, 0,220,245, 1,127,203, 87,254, 29,218,230, 14,254, 13,253,
-184,113,227,230,194,238,126,245, 11, 7, 14, 28, 32,211,167, 79,191, 37, 10,173,191,153, 3,255, 72,101,177,177,232,215,175, 95,
-147, 22,227,105,106,121,127, 7,163,236,207,164, 4,120,181,162, 6, 14, 28, 24, 24,136, 3, 8, 32,128, 0, 2, 8,224,111, 6,
- 38,208, 4, 1, 4, 16, 64, 0, 1, 4, 16, 80, 0, 2, 8, 32,128, 0, 2, 8, 32,128,128, 2, 16, 64, 0, 1, 4, 16,192,159,
- 16, 86, 0,108,160, 25, 2,240, 4, 97,160, 9, 2, 8, 32,128, 0, 2, 99,123, 0,127,243, 78, 50,103,206, 28,191, 35, 46,221,
- 69,117,123,146,231,109,253,177,175,242,154,250,250, 2,242, 2,242,254,238,242,126,126,165,216,239,129,101,208,187, 93,112,171,
-229, 29,126,217,127,121,177,239,221, 44, 47, 45, 45,141, 0, 0, 33, 68,106,177, 88,112,238,220, 57,181,217,108,134, 80, 40,196,
-197,139, 23,241, 88, 88, 87,236, 44, 40,128,241,238, 78,136,139,139,147, 9, 4, 2, 80, 74, 53, 0,144,145,145,113,203,159, 7,
-119,125,174, 32,132,244, 1,208,230,248,241,227,219, 58,116,232,192,104,181, 90, 73,135, 14, 29,222, 9, 14, 14, 94, 9,224,146,
- 99, 57, 41,147,145,145, 97,243, 32,175,185,195, 91, 96, 32,132, 80, 0,184,112,236,127,159, 43, 70,150,164,172, 43,136, 57, 39,
-108, 51, 46,174, 89,243, 22, 53, 0, 40,165, 84, 8, 32, 34, 35, 35,227, 66,224,125,187,179,229,221, 82, 45,145,111,182, 45, 95,
-179,191,249,147, 50,183, 98,245, 55, 82, 97,100,152,250,236,233, 51,178,187,130,154, 33,244,217, 25,154, 59, 73,203,106, 40, 31,
-121, 96,137,203,237,199,230,205,155,165,219,183,111, 87,167,191, 98,223,254,110,223, 72,204,152, 49,131,215,115,217,151,123, 80,
-202, 16,162, 62,117,242, 36,116, 58, 29,186,116,233,130,102,205,155, 35, 49, 97, 28,239,231,186,123,247,238, 58, 47,110,118,118,
-182,199, 90, 10,217,217,217,126,247, 27,174, 80, 83, 70, 70, 70,227,250, 93,146,214,241,129, 2, 32, 64, 86,164,255,178, 98,151,
- 3,209, 79,216, 63, 23,173, 6, 14,207,111,252, 67,157,124,189,238,245,101,183,226,245, 53, 66, 8,213,235,245,178, 93,187,118,
-169,139,138,138,144, 36,106,137,118,157, 90,163, 86,111, 68,176,193,138, 17, 11,158,196,168,137, 83,177,245,139, 12,108,217,179,
- 71, 61,110,220, 56,217, 29,208,133, 79,219,108,182,246, 69, 69, 69,236,128, 1, 3,196, 49, 49, 49, 56,114,228,200, 43,181,181,
-181, 19,122,244,232, 33, 39,132,104, 41,165,222,166, 2,170, 93, 55,172, 86, 43,243,107,193,207, 61, 58,206, 26,132,127, 13,237,
-219, 58,111,215, 7, 27, 55, 29,149,254,210,163,223,152,247, 28,242, 46, 58, 20, 6, 54,224,105,248,155,185,137,124,205,223,239,
- 75, 30,124, 95,201,223,182,110,155, 52,190,117, 71, 53,137,138, 70, 97, 77, 5,218,119,232,170,182,176, 54,156,252,100, 13,202,
-186,180,150, 13,157,120, 63, 47, 69,224,176, 90, 65,123,117,231,182, 4,248,118, 23,139,125, 63, 81,164, 78, 3,122,117, 7,230,
- 47,105, 28,113,115, 5, 74, 26,155,157,204,157, 50,209, 84,114, 27,131,212,212, 84,138,197, 4,228,173,134,207,161,148, 2,139,
- 9,166,252,158,116,199,172,181,190, 65,254,212, 65,254,163,176,127,255,126,204,152, 49,195,235,119,239, 30,176,139,246,233, 51,
- 4, 89, 89,151,113, 40,215,158,176,230,244,201, 83, 0,128,217,255,252,134,158, 58, 51, 89, 22, 42,225,247, 92, 18, 18, 18,216,
-221,187,119, 51,217,217,217,216,187,119,175,199, 66, 76,254,164, 80,245,244,222,166, 41, 20, 52,195, 15,133,130, 75, 23,222,232,
- 84,198,209, 79,212, 45,182,211, 20, 10,128, 75, 59, 57,170, 19,242,194,217,179,103,161,217,184, 81,253,150,124, 10, 6,206,120,
- 10,226,182, 17,128,208,145,236,143,165, 0, 43, 2,107,162,184,255,137, 84,148,124,244, 62, 14, 30, 60,168, 30, 62,124,184,140,
-243, 2,220, 38,216, 24,134,105,211,170, 85, 43,104, 52, 26,225,128, 1, 3, 48,116,232, 80,230,202,149, 43,131,126,253,245,215,
- 99,119,223,125,247, 96, 66,200, 21, 7, 89, 51, 60,219,174,217,216, 49, 9,209,239, 45,219,204, 44, 76, 62,218, 34, 46,113,142,
- 44,110,152,106,228,130,143, 47, 62, 16,115,207,204, 88, 66, 72, 53,236, 49, 6, 76, 67,253,204, 53,177,149,183,126,212,104,133,
- 52,128, 58,168,159, 0,168, 62,252, 42, 6,228, 58,128, 12,156,217, 31,115, 70, 60,195,128,103,229,190,250, 74,128, 66,161,160,
-177,177,177,200,204,204,164,174,101, 75,125, 34,214,156,195,210,233,131,226,213, 98, 27, 11, 27, 40,130, 43, 66,112,229,218, 53,
- 92,169,174, 68,183,160,102, 48, 21, 94, 82, 31,218,178, 93, 54,140,135, 18,208,171, 59,112,242, 44, 3, 74, 37,176,145, 32, 60,
-156, 96,193,164,113, 70,220,136,161,105,124,170,132,198,146, 52, 71,252, 11, 23, 46, 68, 65, 65, 1, 0, 96,219, 73, 17,106, 45,
- 22,181,226,159, 67,124, 82, 4,124, 81,226, 28, 41, 94, 61, 63,151,197,246,195,177,177,177, 13,231,111, 95,236,223, 59,190,245,
-179,203,210, 45,191,190,225, 84,120, 38,244, 95, 44,123,240,153, 14,141, 30,112, 55,111,222, 44,221,182,109,155,154, 97, 24,188,
-240, 46,156,213,207,248,212,193,136,136,248, 81, 26, 55, 44, 13,192, 22,140, 28,249, 81,157, 99,211,167, 3,247,223, 15,220,143,
-108,245,242,143,192, 75, 9,224,200, 95,163,177,159, 58,117,234, 84,103, 97, 37, 95, 8,204,147,229,207,165,100,118,189,191,180,
- 52,255,200,191,201, 16,187, 12, 0,176, 98,197,138, 27, 10,192,224,116,224,200, 11,183,229,114,246,238,221,139,149,147, 82,209,
-109, 76, 2, 32, 48,129,136, 24, 16, 33, 3, 34, 16,129, 82, 2, 86,111, 5,181,217, 64,205, 54, 60,249,196, 83,120,234,245,185,
- 56,219,182,173,186,123,247,238,183,211, 19, 64, 10, 10, 10,226, 59,117,234, 36, 46, 42, 42, 66, 78, 78, 14, 78,158, 60,137,132,
-132, 4,196,199,199,183, 95,181,106,213,219, 83,166, 76,121,210, 7, 5, 64,176,127,207,215, 95, 62, 50,208,208,246,112,181, 0,
-211, 23,215,224,222, 65, 31,226,153,121, 83,133, 31, 44,172,232,182,240,131,181,211,163, 7, 77, 87,162,129, 52,200,174,132,238,
- 58,166,167,165,165, 81,119,251,155,186, 32, 92, 0,183,192, 3,224,250,144,214,237, 88, 91,209,253,174,238,225,138,183,158,100,
-231,140,120,198,151,106, 78, 36, 51, 51,147,114,105, 73,185,255, 21, 10, 5, 77, 74, 74,242,205,170,222,113, 80, 58, 62,166,175,
- 90, 92,107, 69,240, 7, 47,194,106, 48, 67,242,194, 18,132,137, 37,168, 21, 25,161,175, 53, 34, 24, 4,166, 11,101,234,202,202,
- 74, 89, 88, 88,152,199, 65,248,228, 89, 32,115, 61, 11,192,224,248, 3, 70,222,195, 96,210, 56, 2,215, 64,218,212,105, 64,230,
-122, 63, 60,166, 73, 73, 50,199,125,250,101,173,115,228,207, 17, 63, 0, 40,247, 91, 96, 52,235, 1, 0, 99, 23,238, 70,214,210,
- 4, 53, 0,222,242,207,190,127, 22, 34, 82,120,163, 35,144, 82,144, 86,189, 92,182,203,208,250,159,252, 82,132,146,183,236,228,
-239,169,198, 60, 81,100, 81,251, 57,252,172,255, 35,219, 44,210,204,205,207,170, 41, 40,222,155,247, 29,134, 73, 99,176,238,179,
-125,248,207,174, 52,245, 54, 5,197,156,127,188, 33, 27, 56,178,189, 95,138, 64, 77,177,130,142, 25, 0,100,125,117, 28,148, 82,
- 52,111,115,183,147,252, 87,174, 92,233,241,250,244,181, 42,105,106, 82,123, 53,240, 41,128,239,112,232, 16, 48,108,216,141,227,
-111,191,125,227,243,243,207,101,171, 51,254,211, 83,198,176,157, 60, 94, 39, 71,254,163, 71,143, 6,203,178,248,228,147, 79,154,
-236, 5, 87, 40, 20, 78,242,175,171, 20, 40,104, 70,134,231,119,142,153,162,171,163,254, 18,199, 63,108,146,155,243,136,227, 68,
- 98,255, 48, 96,192,205,115,236,204, 84,157,211, 43, 15, 0, 44,155,140,121,243,230, 57,143,207,155, 55, 15, 43, 86,172, 0,211,
- 99,214,141, 95,117,156,239, 78,158,112,170,251,235,179, 90,221,156,199,227,250,106,107,107,209,174, 75, 87,128, 53,131, 9, 2,
-136, 80, 0,107,117, 37,106,139,206,225,218,197, 82,116, 28, 46, 5, 17,135,131, 88,204,128,128,193,210, 57, 11,144,144,249, 6,
-230,207,159,223,164,131,178,183, 84,217, 46,100, 75, 40,165,225, 70,163,113,120,100,100, 36, 78,157, 58, 5,150,101,113,238,220,
- 57,172, 94,189, 26,189,123,247, 70, 84, 84,212, 76, 0, 79,214, 35,107,182, 33,242,166,148,182,234,194, 28,146,182,239,156, 40,
-174,200, 57,138, 74, 93, 16,254,187,213,138,237,121,255,195,115, 73,193, 66,161,129,141, 5,166, 55, 88, 7,225, 86, 20,183, 10,
-192, 55, 52,212,119,220,121, 6,132,124,137,159, 82, 10,217, 43,163,145,153,163, 12, 79,133, 2,191,124,117, 20, 24,225,124,173,
-120,129, 35,125,131, 97, 45, 0,130,218,218, 85,136,140, 84, 33, 43, 43, 11,190,164,241, 28, 26,212, 66,221,166,214, 6,201,226,
-167, 96,187,174,133,245,210,117, 8,197, 34,132, 16, 1, 66,137, 0,161, 2, 33, 34, 69, 18,232,170, 43,112,121,239, 65,117,216,
-164,251, 60, 14,116,238, 72,125,223, 79,172, 67, 1, 0,150, 45, 34,160, 4,176,135,199,248,222,193, 29,164, 44,203,202,202, 82,
-103,101,101,249, 53,133,224, 74,254, 16, 10, 80,116,217, 62,248,149, 92,173, 69,231,182, 18,244, 72,222,130,172,213, 19,213,124,
-221,235, 34, 82, 8, 33, 41,133,128, 92,135,141,182, 66, 80, 27,130,208,105,151,192,178, 90,212,214,102,193, 86,240, 47,223, 60,
-185, 60, 42,183,249, 82,226, 85,185,249, 25,117,124,228,171,248,228,187, 89,104,198,116, 6, 0, 60,245,108, 79, 12, 24, 26,141,
-181,159,230, 96,229,255,222, 84, 43, 71,250,231, 58, 36, 4, 80, 60,127,204, 57,232,221,123,239,189,216,183,111,159, 87,242, 7,
-128, 25,211, 68,106, 96, 47,128, 99,168,184,218, 12, 61, 58, 3,159,127, 94, 3,181, 26,232,209, 3,136,142,182,139,168,184,218,
-204,254, 50,246,255, 93,253,219,175,157,136, 39,242,223,187,119, 47, 88,150,117,146,244,134, 13, 27, 26, 77, 32,174,219,245,201,
- 31, 0,188,145, 63, 0,100, 40,149,132, 2, 82, 2,104, 82, 83, 83, 27,236,248,172,203,160,175,204,204,148, 17, 2,172,252,108,
-229, 77, 49, 47, 43, 51,148,174,254, 21, 41,165, 84,253,225,135, 31, 58,119,124,248,225,135, 88,177, 98, 5, 50, 50, 50,234, 86,
-145, 35,144,186,147,151, 97, 79, 97, 43,163,148,106,158,124,242,201, 6,175,207,234,226, 69,201,252,252,115, 25, 33, 64,198,202,
- 12,181, 59,242, 18, 54,111, 14,136, 4,176, 25, 42,240,251,246, 61, 88,187, 49, 27,159, 93, 58, 7, 0,200,127,179, 5,122,140,
-186, 31,166,146, 11, 56,254,235, 97, 28, 61,119, 26,149, 87,174,224,216,177, 99, 77, 86, 88,107,245,234,213, 82,126,125,152,132,
- 81, 74,123, 21, 20, 20,124,240,218,107,175,245,253,224,131, 15,196,102,179, 25, 2,129, 0,205,155, 55,135, 94,175, 71,126,126,
- 62,162,163,163,185,186, 5,158,172,255, 80, 66, 8, 75, 41,141,172,184,120,224,167, 55,191, 44,137,252, 98, 94, 7,104,245, 98,
-136,133, 12, 58, 70, 72,112,229,186, 25,138,127, 91, 49, 96, 72,108,104,103, 47,158,132,180,180, 52,202, 41, 2,174,125,177,161,
-207, 1,220,122,112,228, 95, 95, 57, 96,188, 13, 34, 92,189,239, 58,110,206,196, 25, 62, 95, 64,102,102, 38,181,147,255, 58, 39,
-249, 75,126, 58, 15,195,206,187,234, 28,247,106,185, 42,215, 73,195,180,213, 96,197, 66,152, 15, 31,135,233,247, 34,212,238,218,
- 7, 24, 77, 16, 83,138, 16, 8, 32, 4,129,137,181, 66,107,170,197,103,187,183,122,149,185,108,145,221,186,119,133,125,155, 51,
- 87, 40, 78,157,161,152,191,196,255, 62, 43,151,203, 53,174,110, 47,149, 74,197,235, 69, 87,169, 84,206,218,218, 28, 30, 91,113,
- 17,123, 14,235, 80,114,181,214,169, 4, 20, 94, 52, 2,242,141, 80,169, 84,188,220,145, 66, 98,175, 28, 38,170, 62,138,208,208,
- 51, 8,146, 84,131,101,181,176, 88, 14, 67, 32,136,134, 89, 95,126,219, 58,235,158,111,143, 73, 1, 82,135,252, 47,159,162, 24,
- 60, 81,128,103,223, 73,192,189, 9,125, 1, 80,199,121,190, 97,221,186,117,244,133,119, 9,154,181,238, 15, 10, 32,113,210, 28,
-236,223,191,159,215,119, 89,230, 2,109,211,230, 55, 39,249, 87,151,219, 75, 48, 15, 24, 96, 39,127,174, 16,160,253, 88, 48,170,
-203,131, 17, 25,114,217,163,204,201,147, 39, 67, 38,147, 97,204,152, 49,152, 58,117, 42, 4, 2,193, 77,127,174,251,249,194,221,
-123,235,151,178,228, 66,196,132, 16,231, 95, 67,251, 8,160, 1,133,166, 1, 89, 55,222,175,212, 84,181, 59,203,121,222,188,121,
- 72, 77, 77,173, 75,168, 13,200,251, 78,169,196,177, 99,199,212,132, 16, 41,128, 58,109,230,244,103,215,219,231,233,250,196,148,
-130, 9, 9,130,229, 74, 49,148,175,190,138,213,250, 10,232, 70,199, 57,143,127,241,191,213,120, 99,193,108,196,204,127, 12,111,
- 29,221,139,141,186,115, 72,120,240, 65, 68, 71, 71,251, 60, 5,176,122,245,106,169, 66,161,160,171, 86,173,170,211,135,243,242,
-242,212,158,166,161, 8, 33, 34, 66,200,144,163, 71,143,150,228,228,228,104, 94,120,225,133,184, 79, 62,249, 68, 82, 83, 83,227,
- 44,211, 92, 91, 91,139,102,205,154, 21, 78,153, 50,165,231,136, 17, 35, 58,123, 81, 36, 24, 66, 72,151,163,185,155,202, 78,239,
-156,127,126,254,203,233,237,183, 44,238,128,223, 75,133,168,172, 17,128, 37, 64,121,141, 25,180,101,247,218,231, 95, 89,210,247,
-129,135,255,225,117, 58, 33, 35, 35,131,112, 99,157, 82,169,244,250, 57,128,219, 67,254,110, 61, 0,174,196,207,103,156,241,197,
- 18,185,225,106, 91,229,214, 59, 80, 39,206,160, 1, 55, 70,223, 86,109,213, 90,106,129,184, 92, 11,201,119,123, 65,132, 12, 80,
-107, 6,173,214,131, 88,173, 16, 1,176, 81, 22,181, 54, 43,170,173,102,128,245, 62,135,202, 5,249, 45, 91,212,240, 48,104, 15,
- 18,108,252,128,170, 84, 42, 9,231,210,231, 99,173,223,100,253, 3,248,250,153,246,117,182,135,188, 84, 4, 17,189, 14, 11,105,
-133,172,172,172,189,124,189, 0,146, 26, 53, 34,223,250, 31,174,189,144,134,235,218, 96,116,176, 28,135,205, 86, 4, 0, 40,254,
-165,221,109,235,176, 27,119,124,172,158, 61, 78, 89,135,252, 57,196, 69,188,138,225,125, 39, 35, 62,242, 56, 54,238,120, 71, 61,
-118, 18,255, 65,100,237,218,181,244,199, 31,127, 68,121,249, 88,180,108,185, 7,205, 90,245, 3,165, 20, 12,195,240, 10, 68, 42,
- 41, 1,138,138,142,113, 19, 9,128,164, 6, 90, 61, 48,116,168,125, 79, 97, 33,240,233,167, 64,117, 21,160,175, 1,106,244, 64,
-104, 68, 21,175,107,107,104,174,255,236,217,179, 0,128,119,223,125, 23, 0, 16, 19, 19,211,100,110,102,215, 62,201,231, 59,115,
-231,206,133,171,197, 94,159,184,125,128, 20,184, 49,247,239, 10,206, 11,224, 56, 71,227, 73,200,172,168, 24,156, 62,126, 2,165,
- 17, 17,106,134, 97,240,220,115,207,225,163,143, 62,242,251,250, 70,154,194, 65,217, 26,204,126,119, 17,250, 79,158, 12,229,187,
-239,130, 97,110,240,156,178,240,216, 13, 15,225,190,125,216,189,123, 55,206,157, 59,231,115, 16,224,234,213,171,165,185,185,185,
-106, 0,200,207,207, 87, 51, 12, 35, 75, 78, 78,214,172, 90,181, 74, 74, 41, 69,124,124,188,204,104, 52,170, 27, 80,236, 44,121,
-121,121,253,103,204,152,209,162, 91,183,110,216,190,125,187,161,178,178, 82,104, 52, 26,237,222, 14,199,252,199,248,241,227, 99,
- 8, 33,193,148, 82,163, 27, 49,140,139, 60,166,232,212, 47, 43,222,248, 87, 74,179,150, 61,178,240,115,214, 19,248,237, 2, 65,
-201, 85, 33, 64, 25,152,204, 22,104,105,203,210,167,103, 61, 21, 71, 8, 41,165, 77,160, 85,242,137,179, 9,224,143, 65,131, 83,
- 0, 57, 57, 57, 55,237,171, 40,213,249, 76,118,174, 30, 0,251, 20,128,189,255, 72,126, 58,143,160, 99,165,176,133,219,173,168,
-250,115,200, 13,173,107, 60,113,177, 4,134,160, 96, 68, 91,173,232, 24,220, 12, 33, 34, 49,136,197, 2,176, 20, 86,155, 13,213,
- 54, 51, 12, 54, 43, 76,212, 6, 27, 40,168, 15,157,109,254,146, 27, 74,128, 61, 46,224, 6,233, 47, 91, 36, 64,250, 34,130, 23,
-150, 88, 27,221,232,114,185, 92,195,149, 46,229,131,133, 89,246,118, 95,154, 20,225, 36,124,167, 43,159, 94,135, 8,128,144,234,
-240,213,236, 8,235, 99, 42,126,113, 29,162,171, 63,193, 6,187,155,250, 3, 97, 24, 30,187, 90,140,130,127,119, 68,104,187,222,
-168, 44, 45,197,149,243,151,110,107,199, 28, 48, 52, 26,122, 71,119, 51, 4,159, 64,136,177, 15,190,121,211,226, 60, 62, 66,222,
- 23,185, 27,125,179,252, 39,141,250, 17,223,125, 39, 71,120,174, 10,203, 23, 1,207, 47,161, 24, 53,106, 20,239,101,127, 93, 59,
-118, 34,221,187,215,213, 2,183,110,181, 7,254,173, 91, 7,244,232, 65,177, 98, 5,193, 91,111,213,216, 21, 4, 0, 61,122, 70,
-224,133,231,249, 93, 35,103,165, 78,158, 60, 25, 27, 54,108,168, 99,201, 38, 38, 38, 54, 72,110,254, 42,162, 62,122,240,100, 43,
- 86,172, 80, 55,164, 0, 44, 91,182, 12,153,153,153,188, 44,225, 39,159,124, 82,205, 69,254,187,195,243,207, 63,143,229,203,151,
-171, 51, 51, 51, 61, 94,227,143, 39, 74,240,202, 91, 11, 48,107,241,191,240,178,217,140, 15, 63,252,176,193, 54, 90,182,108, 25,
- 84, 42, 21, 8, 33,210,134, 8,123, 84,159,206, 88,245,197,167,136,157, 62, 29,111,190,249,166, 71,165, 97,222,188,121, 88,182,
-108, 25, 62,255,252,115,141,175,109,159,155,155,171,230,130,229, 20, 10, 5,205,203,203, 83, 39, 39, 39,147, 67,135, 14,169, 9,
- 33, 72, 78, 78,214,172, 92,185,178,193,239, 27, 12,134,240,173, 91,183, 98,236,216,177, 40, 44, 44, 12,209,235,245,176, 88, 44,
- 96, 24, 6,102,179, 25, 73, 73, 73,196, 65,238, 70, 62,142, 45,147,201, 36, 62,188,105, 58, 70, 61,242, 22,118,230,156,197,185,
-203, 2, 84,233, 25, 8,132, 64,169, 62, 24,207,189,180, 40, 30,192, 69,190,220,207,197,157, 0,252,166, 3, 2,184, 61,214, 63,
-220,185,113, 56,215,140, 84, 42,133, 84, 42,197,175,191,254,234,252, 43,250,169, 24,149,198, 74,180, 28,234,251,186, 95,142,220,
- 67, 66,102, 64,242,211,121,136,138,203, 65, 9,129,120, 86,121,157,227, 94,137, 75, 44,128,141, 2, 23,245, 21, 40,169,212,226,
- 90,149, 14,149,181,181,208,153,141,184,102, 50,226,114,173, 1,165,181, 53,208, 90, 76,208,177, 22,152, 89,239,217, 48, 71,222,
-227,102,192,115,137, 11,152, 61,181, 25, 40,196,160,190,149, 1,119,186,240,235,119,118,190,238,127,167,229,121,181, 22,123, 14,
-235,234, 16, 63, 71,254, 65,108, 49,130,216, 98,188, 49, 94,136,146,146, 18, 51, 95,153,155,206,177,104,157,158,225,220, 62,167,
-183,225,226,217, 82,156, 58,112, 28, 87,206, 87,220,246,142,187,238, 51,187, 2, 90, 85, 70, 17, 98,236, 3,233, 44, 33, 30, 89,
- 44,114,254,165,111,156, 14, 2,194,123, 64,122,232,222, 28, 60, 49, 95,142,136,188, 61, 32,132,224,251, 3,246, 71,192,151,252,
- 57,196,244,234, 89, 79,177, 0, 62,249, 4, 56,115,198,238, 9,120,243, 77,234,116,191, 83, 74, 17, 17, 17,225,125, 4,118,244,
- 81,155,205, 6,155,205,134,119,223,125, 23,103,207,158,197,233,211,167,113,250,244,105,168, 84, 42, 44, 88,176, 0, 37, 37, 37,
-183,243,145,104, 26,178,164,231,206,157,203, 89,117,188,200,144, 16,226,214,250,231,224,233,152, 43,246, 5, 85,128, 48,205,240,
-159, 87,150,160,217, 86, 21, 82, 83, 83,225, 90,106, 88,209,163, 31,230,198, 14, 71, 72, 72, 8, 70,141, 26,133,215, 94,123, 13,
- 42,149, 74,173,211,233,220,190,127, 95,148,158,198,229,190,125, 16, 21, 21, 37, 99, 89,182, 65,111, 7,231,169,240,215,243,226,
- 26, 41, 31, 31, 31, 47,227,136, 18, 0,226,226,226,100, 94,218,110,204,168, 81,163, 90,148,148,148, 96,223,190,125,184,235,174,
-187, 32, 20, 10,157,202, 98, 84, 84, 20,223,233, 8,214, 33,143,116,239, 53,104, 97,230,174,112,252,182,125, 49, 70,198,247, 70,
-168,132, 65,104,136, 13,193, 65, 38,220,247,208, 20, 22,128,182,190,174,234, 77,185,228,238,143,207,116, 64, 0,183, 15,140,167,
-135,168, 84, 42,155,207,157, 59, 23,115,231,206, 5, 0,243,219,105,111,195, 82,102, 69,112,176,196,175,100, 36, 73, 73,246,240,
-225,144,241,103, 64, 5, 12, 94,251,198,224,180,254,249, 34, 36, 42, 74,102,109, 22, 2, 29,181,225,132, 94,135, 99,149,229, 56,
- 94,117, 29,199,171,180, 56,161,215,226,140, 65,135,114, 83, 45,106,172, 86, 92, 50,232,157,191,233, 9,147,198, 17, 44, 91, 36,
-192,178, 69, 2, 80, 8, 64, 9,131,212,105, 4, 79, 78, 19, 99,214,212,214,232,222,189, 45, 88,136, 0,248,118,203,156,171, 63,
- 41, 41, 73, 86,127,159, 15,109, 38, 43,188,104, 87,228, 11,222,183, 7,209,237,124, 49,204,238,190,161, 58, 8,168, 30, 38,198,
- 30,209,172,213,106, 67,146,146,146,124, 42,138, 30, 27, 27, 11,149, 74,133,117, 53,122, 24,205, 12,158, 88,255, 31,148, 73,130,
- 97, 52,223,190, 50, 17, 19, 7,188, 33,203,213, 46,193,186,255,222, 48,241,191,121,211,130,184,136, 87,111, 40,148, 15,124, 42,
-203, 80,102,240,202, 45,177,252, 85, 32,121,254, 88,132,231,169, 32,251,247,104, 48, 19, 0,141, 70,227, 87, 31,238,210,165,110,
-244,248,152, 49, 64,120, 56, 16, 29, 13, 12, 27,208, 28, 18,177, 0, 2,230,134, 88, 73,112,176,215, 1,153, 97, 24,231, 92,255,
-217,179,103, 17, 19, 19, 83,231,239,173,183,222,194, 91,111,189,133, 75,151,248,123,101,220,205,215,187, 34, 45,205,119, 11, 44,
- 51, 51, 83,182,124,249,114,183,132,205,215,250,119,113, 61,223, 20,167,192,109,179, 44,191, 20,246,102, 66,192, 26, 76, 16,181,
-235, 2,197, 59,239, 32, 57, 52, 28,225,154, 92,231,241, 89,255, 72,198, 27, 31,252, 7,133,203,190,198,235,253,199, 96, 74, 68,
- 55,236,222,188, 25, 69, 69, 69,110,223,191,135,211, 20,232,219,175,159,140, 11,106,228, 20, 50,215,233, 25,119,251, 60, 88, 95,
- 52, 45, 45,141,114,129,125,220,124,191, 43,201, 39, 39, 39,107,226,226,226,100,156,235, 63, 57, 57, 89,227,165,221,114, 68, 34,
-209, 93, 15, 63,252,240,217,202,202, 74,232,116, 58, 4, 7, 7,163,117,235,214, 8, 15, 15, 71,120,120,184,183,198, 99,235,201,
-179, 5, 5, 5, 25, 30, 77,251, 72,182,250,167, 33, 56,127,161, 10,109,195, 4,136,239, 73,112,119, 55,138,208, 22, 45, 42, 0,
-216, 60,240, 70,160,222,192,159,212,250, 7,188, 47, 3,172, 81, 42,149, 65, 0, 66, 21, 10,133, 83, 11,236, 56,186,131, 95,154,
-175, 82,169, 36,114,185, 28, 42,149,138,138,103,101,213,113, 69,242,205, 3,208,242,193,177,154,242,172,237, 48, 88, 77,168,210,
- 27,112,214, 98,129,136,181, 59,234, 43, 45,181, 96, 41, 5, 5,176,253,234, 57,232,173, 22, 0,224, 49, 48, 17,204, 95, 82,183,
-143,219,167, 2, 88,216, 96,194,239,103,170,177,106, 67,149, 79,247,235, 74,244,114,185, 92, 83,223, 11,224,170, 20,120,130, 92,
- 46,215,100, 41,166, 64, 52,246, 51, 0,209, 40, 47,191, 17,156, 39,102, 47,195,204,180,199,211,253, 79,227,242,101,251, 64,172,
- 84, 42,247,240,145,155,246, 77,102, 29,197, 43, 43, 43, 11,220,164,196,250,163, 7,125, 90,149,209,212,120,224,169,246,154, 45,
- 10,138, 3,170,227, 0,128,225,125,237,153,241,254, 53,111, 49, 14, 30,239,139, 15, 54, 78,135,114,235, 83,106,229, 68,126, 4,
-254,196,124, 57, 34, 35, 85,174,134, 44,180, 90, 57, 40,205,114,184, 42, 41,178,178,146,120,201,154,252,200,163,100,247,206, 93,
- 20,176,187,254,101, 50,130,235, 23,194,160,215, 73, 96,172, 18, 99,253, 26,130,185,115, 41,138,203,170, 49, 44, 62, 14,211,167,
- 78,227,101, 21,219,108, 54,231,124,191, 74,101,191, 86, 87,194, 47, 43, 43, 67, 89, 89,153,207,238,125,133, 66, 65, 25,134,185,
-137, 84, 51, 50,148,196,143, 36, 64, 26, 74,105,157, 88, 0, 23,143, 0,111, 87,184,171,107,191,126,244,190, 55,183,127,125, 37,
-199, 90, 93, 13, 81,171, 72, 8, 66,154,161,239,163,147,241,214,184, 4,188,194, 45,219, 27, 52, 24, 54, 99, 45, 68, 45,219,162,
-127,156, 20, 93, 59,118,195, 71,191,231,162, 95,191,126,178,159,126,250,233, 38, 37, 32, 77,161, 0, 64,212, 0,240, 84, 90,154,
-115,233,160,181, 30,217, 11,133, 2,128,222, 88,168, 72, 0, 12,112, 51,200, 14, 28, 56,144, 80, 74,157, 46,254,252,252,124,167,
-139,223,245, 60,199,182, 87,242,119, 24,236,175,134,135,135,247,141,139,139,235,126,242,228, 73, 28, 57,114, 4, 54,155, 13,161,
-161,161, 48, 24, 12,101,145,145,145,231,125, 49,250, 8, 33, 76,219,182,109,119, 63,244,208, 67,109,243,246,231, 99, 69,214,110,
-180, 32, 98,244,108,107,194,153,235,161,184,183,167,229, 28, 0, 11,167,160, 57, 20, 74,155,167,103,226, 58,214, 5,166, 0,238,
-108,240,153, 47, 54, 3, 48,187, 18,245,197,156, 75,192,116,223,201,223,149,108,220, 13, 90,124,149,128, 42,173, 78,102, 9,145,
-168, 43, 25, 22, 87,106,107, 0,139, 5, 54, 74, 65, 0,252, 94, 83,129, 82, 67, 21, 40,165, 92, 18, 27, 30, 3, 19, 69,234, 52,
-130,204,245, 55,250,228,201,179, 64,175,238, 86, 8,160,111, 20,249,187,118,118,127, 93, 94, 73, 73, 73,178,172,172,167,212, 64,
- 1,180, 90,173,185,164,164, 68,184, 52, 1,204,194,221,163, 48,175,223, 65,167, 21,198, 87,169,112,231,117,169,191,205,145, 16,
- 95,107, 14,139, 9,134,100, 22, 81,192,253,114, 63,103, 38, 64, 21, 40,159, 32,197,180,137,159,201,148, 91,158, 86,231,110,164,
-136,143, 60,142, 17,242,190,216,191,251, 56,242,116,239,128,128, 64, 49,241, 83,222,247, 26, 25,169, 2, 33, 4,147, 38, 77,194,
-231,159, 87,129, 51,138,237,255, 83, 71, 27,103,213, 25,144, 60, 76,193, 98,244, 24,153, 44,103,175, 90, 61,102, 12, 96,190,210,
- 9, 23, 42,130,192, 58,102, 91,219,235,219,226,197,212,106,236,206,235,137,230, 29,123,242,186, 70,142,248, 47, 94,188, 8, 0,
-184,114,229,138,211, 51,112,245,234, 85,231,192,234, 15,148, 74, 37,225, 18, 1,213,159,195,205, 80, 42, 9,159,124, 0,174,248,
-252,243,207,235,196, 2, 44, 95,190,220,103,235,191, 62, 97,248, 11,137, 68,130, 43,197,231,209,173,123, 15,176, 86, 19,136,213,
- 6, 97,243, 22,104, 62,120, 8,154, 13,186, 7,172,222, 10,155,193, 4,106,181, 1, 54, 22, 11, 87,126,128,169,211,167, 66, 34,
-145,184,149,103, 93, 31,193,235,119,221,157, 23,251,158,251,115,227,227,227,101,121,121,121,106,110, 12, 24, 49, 98,132,219,182,
-226, 65,254, 32,132,176, 0,118,244,236,217,115,208,199, 31,127,108,190,118,237, 90,109, 66, 66,194, 67, 5, 5, 5,175, 27, 12,
-134,242, 86,173, 90, 41,250,244,233,163,245,161,237, 69, 0, 58,199, 13, 27,214, 58,109, 86, 26,206, 93, 60,167,125,124, 86,218,
-200, 67,187,215,164, 95,174,214, 14, 31, 50, 58,129,109,219, 49,230, 17, 55, 94, 3,214,211, 88,224,202, 21, 13, 37,255, 9, 36,
- 2,250,243, 40, 0, 13, 90, 23,254,144, 63, 71, 54, 92, 78, 0,127,148,128,110,138, 25, 26, 0,164, 84,185,154, 34, 88, 2, 29,
-181,194,108,181,130,165, 44, 90,134,133,225,162,190,146, 95, 6, 59, 7,220, 45,239,187, 17, 3,224, 91, 38, 54,119, 46,254,198,
-166,235,117,124,119,226,144, 33, 67,182, 44, 92,184, 80, 28, 25, 25,201, 94,190,124, 25,243,250, 93,174, 67,254,190,252,134,187,
-246,247, 27,142, 44,127,245,147, 60,185, 59,135, 47, 6, 61, 32,208,100, 60,144, 65, 54,127,114, 73,186,237,232,155,234,220,141,
- 0, 1,193,196, 1,111,200, 30,120,138,127, 2, 32,174, 47,217, 9,190,202, 49, 72, 1,238,120,103,117,186,221,121, 18,218, 57,
-131, 0, 13, 23,215,152, 62,117,154,102,250,212,105,164, 92,247,177,212, 86, 93,173, 38, 2,192, 80, 27, 12, 82,109,133,144, 17,
-194,192, 72,100,227,166,204,134,144, 18,175,215,153,144,144, 64,238,186,235, 46,122,171,222, 63,187,181,159, 65,210,210,210,168,
-107, 68,187,171, 39,192, 71,113, 26,206,242,119, 81, 40, 52,183, 99,240, 26, 51,102, 12,158,222,152,137,183,170, 43, 48,112,244,
-189, 96,218, 70,216,175,201, 66,237,169,123, 33, 2, 17, 8, 65,196, 2,124,158,177, 12, 45,198, 14, 65,247,238,221,255,208,212,
-189,156,117,159,155,155,171, 30, 54,108,152,108,230,204,153,141,250,237,179,103,207,202,247,236,217, 83, 44, 16, 8, 54,143, 28,
- 57,242,109,134, 97,174,197,197,197,229, 56, 45, 25, 23,143, 18, 33, 4,238,158,185,139, 39, 64,117,228,200,145,161, 95,173, 94,
-195,136, 5, 65, 23, 38, 63, 54,121, 0,195, 48,186,123,239,159, 61, 1, 64,152,131,248,171, 1, 80,171,213,234,148, 87, 79,105,
- 11,148,148,191, 3,193,199,253,239,151, 2,208, 20, 10,131, 39,242,241,101,128,147, 10,122,251,182, 0, 0, 32, 0, 73, 68, 65,
- 84, 41,146,137,106,183, 74,202,158, 42, 84,235, 77,102, 88,109, 54,116, 31, 58, 24, 49,214, 97, 62,145, 97, 83, 6,163,112, 73,
-127, 0,168, 57, 79,135,203, 84, 0,105,132,220,173,114,185, 92,168, 82,169,230, 47, 93,186,244,223, 46,202,197, 24,165, 82,233,
- 83, 34, 18,135,167,160,201,146,151, 76,249, 61,201,209,142, 13,223,223, 20,149,202, 47, 77,255,193,103, 58,104, 30, 68,227,159,
-143,157,220, 9,158,152, 63,198,153,167,156, 27,199, 86,167,239, 65,104,231, 12, 18,218, 57,201, 39,153,225, 45,158,213, 28, 40,
- 6, 97,153, 11, 82,163,193, 94, 7, 32, 84, 34,215,132, 69,193,167, 21,163, 46,253, 79,228,208, 56,155,124, 94,149, 83, 2,154,
- 66,150, 35, 22, 64,205,125,110,172, 60,127, 87,150,117,239,222, 29,237,158,123, 78,182, 98,215, 46,117,209,219,223, 33, 73,212,
- 18,225,142,226, 61, 70,131, 21,115, 23,188, 12, 65, 72, 36,182,175, 81,226,215, 86, 4,227, 26,145,183,223,102,179,194,215, 24,
-160,250, 74, 0, 31, 43,223, 75, 59,145,211,167, 79, 95,163,148,166,247,234,213,235,203,242,242,114,189, 80, 40,132,213,106,165,
- 45, 91,182,116,122, 84,244,122, 61,196, 98,177,211,139,228, 65,222,168,252,252,124,176, 86,130,225, 35, 6,188,113,241,226, 69,
-157, 86,171, 69,100,100, 36,219,177, 99, 71, 29,247,108, 42, 43, 43, 33,145, 72, 64, 8, 65, 80, 80, 16, 47,163,143, 83, 18,234,
-127,174,239, 21, 13,224, 79,230, 1,184, 85, 74,129,223,196,152, 32,215, 32, 65,126, 71, 69,147, 58,148, 0,114, 11,230,209,109,
-114,185,252,255,228,114,249,255, 53,197,245, 53,225,253,146,166, 56,231, 86,194,110,213, 3,142, 20,251,245,142, 37, 53, 74, 54,
-195,118,210,132, 74, 58, 53,197,101, 90,110,101, 27, 52, 97,209, 21,141, 47,115,245, 94,148, 9,191,229, 80, 74, 73, 72, 72, 8,
- 38, 77,154, 4, 71,249, 94,148,184,148,239, 61,176,103,183,179,124,239,216,184,177,112, 40,189, 13,254,222,231,186,247,200,147,
- 17, 47,223, 76, 76, 60,171, 9,242, 80, 2, 26,141,123,238,185,199,100,181, 90,115, 0,232, 89,150,165,102,179,125,225,207,181,
-107,215, 0, 0,205,154,217,151,246,114,251, 69, 34,145,199,246,123,224,129, 7, 56, 25,187, 88,150, 69,120,120, 56, 88,150,117,
-174, 56,113,172, 98, 33,181,181,181, 20, 0,196, 98, 49, 8, 33,204, 31, 49,182, 7,224, 63,248,164,146, 6, 0, 50,112,224,192,
-128, 38, 22, 64, 0, 1, 4,240,231,129, 21, 64, 45, 0, 73, 19, 27,113,222, 10, 6,241,174, 40, 24,192,159, 3,129,135, 25, 64,
- 0, 1, 4,240,231,130, 16, 64, 51, 30,228,111,128, 61,136,187,169,248,128, 69, 96,217,223, 95,174, 35, 5, 16, 64, 0, 1, 4,
-240,215, 67, 72,128, 47, 2, 8,120, 0, 2, 8, 32,128, 0, 2, 8, 32,128,128, 2, 16, 64, 0, 1, 4, 16, 64, 0,127,119,212,
-113,233,204,153, 51,199,239, 8, 78,119,197,123,238,116,121,209,131,131, 16, 28,116, 5, 34,113, 5, 88,214,190, 44, 76, 32, 96,
-192, 16,129,253,127,134,128, 16, 6,148, 8,237,107, 96, 97,197,150,109, 34, 80, 74, 17,201,180,132,143,215, 23, 4,160, 21,236,
- 1, 60,213,176, 47,247,178,192, 49,167,246,103,108,191,128,188,128,188,128,188,128,188,128,188, 59, 83,158,207, 10,192,223, 13,
- 63,238, 63,131,161, 67, 44,136, 8, 7,180, 58,130,159,127,149, 64,200, 8,113,255,120, 27,118,171, 91,131, 16, 6,132, 97, 32,
-105, 14,140, 25, 90, 1, 64,136,123,227, 41,242, 11,132,118, 26,231, 1,245,193,253, 20, 0, 68,212,130, 97, 35,199, 20,159,254,
-237, 39, 83, 89, 85,109,140,205, 80, 11,185, 92, 30, 14,160, 50,160,135,254,185,145,253,205,127,165, 61,186,119, 83, 95,187, 86,
-219,168,132, 79,127, 34, 72, 83, 83, 83, 93,243, 0, 52,234,158, 83, 83, 83,253, 78, 7, 28, 64, 0, 1, 52,145, 7,128,195,154,
-175,190,224,173, 77, 60, 49,115,150,215,151,181,169,229, 53, 37,242, 11, 68, 72, 76,176,225,215,223,130, 33, 22, 9, 33, 20, 8,
- 33, 18, 81, 4, 9, 44,128,176, 57,132, 48, 98,104, 95, 43, 36,226, 32, 80, 0,237,219, 2, 15,222,207, 98,207,102,126,228,127,
-230,247,211,184,171, 79,119,116,136, 10,199,197,226,147, 93,194,218,117, 67,171, 14, 54,252,240,253,247, 80,169, 84, 21,183,123,
-125,188, 74,165,186, 63, 43, 43,107, 27,183,157,148,148,244,128, 92, 46,223, 22,120, 53,188,227,183, 95, 85,212, 90,123, 92, 54,
-237,193,238,106,150, 45, 71,101, 7,163,250,228,177,141,168, 49,181,199,144,216,145,127, 89, 18, 75, 77, 77, 85,207,155, 55, 15,
-132, 16, 94,101,123,249,128, 75, 22,211, 4,229,230, 3,104,164, 2,230, 17,148, 34,243,243,207, 27,124,222, 92,130, 31,215,108,
-129, 92, 13, 1,151, 90, 2,206,231,236, 90, 25, 49,128,166, 5,151, 13,144,131,187,220, 0,119,148, 7,128,193, 31,219, 15,238,
- 31,103, 1,133, 0, 66,129, 8,195,135, 17,180,105,205, 64, 40,100, 16, 36, 18,160, 87, 12,131,226, 11, 86, 12,141,101,208, 50,
- 82,130, 31,246,182, 0, 0, 8,168, 17,246, 84,216, 54,175,228,255, 91, 65, 1,186,118,232,136,223,114,243,112,200,108,129,238,
-186, 14,226,160,230,232, 61,104, 4, 6,140, 24, 7,245,150, 44, 0,252,114,227,223, 2,226, 31,147,149,149,181,103,225,194,133,
- 40, 40, 40,224, 58, 76, 5,128,231,102,207,158,189, 53, 41, 41, 73, 46,151,203,247,252,229, 94,138,159, 85, 52, 72,168,133,144,
- 49,163,182,214,134, 74,125, 48,238, 29, 53,197,167,246,223,152,253,149,180, 69,176, 22,255,152, 58, 24, 93,187, 60,168,110,209,
- 34, 12, 22,171, 21,215,174, 93, 71,219,146, 11, 40, 60, 91,132,131, 7,180,116,248,136,135,252,122,174,153,153,153,212,101,112,
-190,211, 6, 71, 41,112,163, 28,174,163, 58,160, 20,183, 41, 29,240, 31,248,190,208, 77,155, 54,221, 92, 79,225,182,145, 23,149,
- 18, 16,208, 38,104,119, 90,242, 13,200,161,217,174, 28,239,200,146,233,168,134,228,130,217, 25,122, 12,157,250,177, 71, 69,238,
-135, 31,126,112,110, 39, 38, 38, 98,199,142, 29, 30,183, 3,184,245,228,239,186,207, 85, 17,240,168, 0, 28,216,127, 8, 35,238,
- 29,246,135, 93, 52,235, 67,254, 84,215, 84,146,254,102,159, 98,132, 2,232,180, 66,180,107, 35, 66,187, 54, 98,212,212,136, 32,
- 17, 9, 97, 19, 6, 97,112,127,130,129,119, 11,192, 16,145, 61, 5,166, 72, 12, 17, 99, 2,145,136, 97, 53, 0, 86,232, 61,146,
-255,254,189,123,208,173,125,107, 28,251,245, 24, 22,189,253, 70,157,235, 91,242,230,187,148, 17, 16, 12,142, 29,140, 31,118,236,
-241,169,242, 30,203,178,210,130,130, 2,245,153, 51,103, 16, 28, 28,140,224,224, 96, 89, 98, 98,162,198,199,193, 76,150,149,149,
-181,135, 35,126,151,206, 17, 14, 96,220,127,254,243,159,235,179,103,207, 86, 1, 72,144,203,229,170, 59,177,131,175, 90,181, 74,
-154,146,146,194,251,190,191,222,176, 70,218, 47,166,185,186, 75,251, 90,132,181, 8, 2,195,132,192,104,180,162, 92,107, 68,142,
-106, 5,149,180, 24,140, 97, 67, 71,241,234, 71, 34, 92,193,164, 7,238, 86,247,237,219, 27,151,175,232,112,248,231, 35,168,169,
-209, 35, 44,172, 57,162,163,187,128, 17,136, 96,179,149,224,231, 95,246,211, 65, 3,239,253, 75, 89, 55,169,169,169,234,231,159,
-127,222,185, 61,111,222, 60, 44, 95,190, 92,253,185, 7,171,208, 39, 50,186, 67, 61, 0, 14, 37,157,102,103,103,195, 93, 97,165,
- 63, 18,174, 86,182, 82,153, 33,163,180,113, 74, 0,211,229, 81, 39,121,231,191,215,204,173, 25,214, 46,156, 65, 84, 36,243,167,
-125,126,127, 87,184,146,189, 59,165,192,171, 7,224,192,254, 67, 0,208,104, 69, 96,255,115,133, 30,143,223,251, 81, 15,191, 7,
- 11, 66,136, 95,213,246, 84,154, 54, 16, 9, 69,232,212,161, 6,213,213, 34, 28, 62,214, 9, 2,129, 0, 2, 34,128, 88,100, 69,
-223, 30, 6,244,236, 33, 0, 1, 3,177, 40, 8, 98, 1, 65,236,221,102, 68, 70,176, 88,247,165,103,217,189,187,181, 69,241,217,
-178,155,200, 31, 0, 22, 45,126,133,188,251,246,191,105,251,248,187, 17, 17,222,156,247,245, 26,141, 70,233,242,229,203,213,197,
-197,197,117,244, 13,147,201,132,135, 30,226,111,109,102,101,101,237,117, 37,127, 55,104,149,158,158, 94,241,194, 11, 47,236,190,
-221, 83, 20, 13,145,255,161, 67,135,212, 41, 41, 41,188,175, 45, 38, 58, 82, 29,213,182, 10,173, 90,134,162, 99, 84, 59,132,132,
-134,160,184,184, 20, 54, 27,139,168, 14,205,113,252,247, 92,172, 62, 85, 40, 77,126,124,150,199,193,244,232,209,253,244,145,137,
-189,209,185,115, 71,156,248,189, 24,135, 15,255,142,107,215,171, 65, 41, 16, 17, 17, 12,131,161, 6,131, 6,245, 69, 69, 69, 37,
- 74, 15,255,140,175,254,119, 90, 58,243, 31,252, 21,149, 59, 28, 82,192, 94,124,138,195,135, 31,126,200,109,251,228, 5, 72, 77,
- 77,165,174, 46, 97, 87, 11,210,213, 37,221, 20,211, 11,111,191,253, 54,237,212,169, 83,163,115,241,203,229,114, 66, 8,161, 27,
- 55,110,244,152, 99,159, 67, 90, 90, 26,117,231, 33, 88,189,122,181,148, 43, 14,228, 78,137, 85, 40, 20,180,161, 84,174,174,245,
- 28, 40,165, 80, 40,210,212,141,241, 66,212,151, 55,244,229, 26,252,244, 94,179, 58,196, 31,192,159,211,250,175,223,135, 26, 53,
- 5,208, 88, 69,224,222,143,122, 52,168, 4,248, 67,254, 28,114,114,114, 80, 90, 90, 10, 0,136,138,138,162,190, 40, 1, 2,106,
-132,144,216, 32, 22,137,240,243,177,214, 16, 8,133,104, 46,210,219,227, 0,154, 49, 40, 45,109,142,187,251,178, 32,132, 32,233,
- 65, 43, 40,203, 0, 36,200,238,120, 67,117,131,114, 13, 21, 23,112, 69, 91,131, 23, 94,127,189,193,107,169,168,212, 66,119,237,
-138, 67, 22,111,226,174, 79,254, 0,128,237,219,183,195,102,179, 73, 31,121,228, 17,175, 3,156, 74,165, 26, 83,191,244, 47,215,
- 97, 42, 43,235,196, 35,134, 47, 94,188, 24, 42,149,106,236,157, 52, 21,192,145,191, 47,223,249,122,195, 26,233,221, 49, 38, 4,
- 7,135, 67, 18, 36, 70,183,110, 93,209,169,107, 87, 84, 85,105,160,213,214, 64, 44, 22, 32, 50, 66, 2, 97,112,184,199, 92,241,
- 0, 32,164,165,104,222,172, 37, 12, 70, 43,142, 29, 43,196,165, 43,149,184,124,165, 6, 70,147, 4,157,163,172,144, 4, 9, 80,
-120,186, 8,119,117,239,142, 75,151,171, 96,180,182,240, 42,211, 65,116,212,219,126, 95,167, 3, 26,146,233,143, 44,206,250,159,
- 55,111,222, 77,251,159,127,254,121,191, 98, 1,220,145,104,253,185,227,166,242, 42,228,230,230,170,209,200,130, 60,123,246,236,
-161, 89, 89, 89, 72, 74, 74,130,187,233, 0, 62,158, 42,142,252, 1, 32, 63, 63, 95,205, 48, 76,157,107, 90,189,122,181,148,143,
-209, 19, 31, 31, 47,227,228, 52,133,199,101,227,243,161,152,178, 92,239,150,248,163, 34, 25,199, 40,197,239,241, 38, 38, 38,214,
-241,146,220,119,223,125,117,218, 42,224,246,191,115,224,115, 12, 64, 83,121, 4,154, 18,133,133,118,197,162,180,180,212, 39, 37,
- 64, 40, 20, 66, 36, 16, 65, 36, 34, 24, 53, 2, 48,232, 77, 56,119, 86, 12,145, 80, 4,161, 77,136,184, 97, 20, 98,145, 8, 2,
- 1, 3, 80, 2,173, 14,248,233,136, 16, 44,203, 2,184,214,160,220, 35, 63,159, 69, 77, 77,195, 25, 56,223, 95,188,152, 6, 5,
- 73, 96, 52, 86,194,198, 90,121,223,231,145, 35, 71, 26, 86, 58, 12, 6, 94, 68, 83,223,245,239, 78, 51,220,178,101,139,235,249,
-170,219,225, 5,112,231,226,119, 37,255,248,248,120,222, 85,232, 58, 70,181, 85, 51,204, 5, 88,109, 44,204, 22, 43,174, 93,215,
- 66, 36,150,192,100,178,192, 98,181,193,106,101, 97,181, 81, 84,232,174,123,149, 37, 22,233, 33, 9,238,136,242,242, 74, 84, 85,
- 27,160,213, 25,209,162,229, 0, 12,191,251,110,228, 31,216,129, 14,102, 43, 42,171, 42,209,179,103,119, 4,137,133,208, 87,107,
-255, 42, 99,133,148, 82,234,156,251,119,197,138, 21, 43,252,138, 5,152, 55,111, 94, 29,111, 66,253, 99,124, 21, 0,123,169,103,
-206,162,141,196,216,177, 99,235,244, 87,206, 64, 40, 41, 41, 81,171, 84, 42,191, 10, 83,169, 84, 42, 39,249,115,211, 1,155, 54,
-109,242, 74,174,245, 61, 85,185,185,185,106, 46,240, 77,161, 80,208,188,188, 60,117,114,114,178,243,120, 94, 94,158,154, 16,207,
-151, 23, 31, 31, 47,115, 45, 51,156,150,150, 70, 61,181,149,183,241, 48, 41, 41, 9,147,227, 85,216, 0, 96,234,114, 61,238,121,
-185,198, 99,219, 15,157,234,185,173,234,207,241,123,139, 9, 8,224,214,123, 3, 26,242, 0,252,161,254, 29,119,150,126, 99,172,
-255,122, 22, 43, 10, 11, 11,177, 98,197, 10,222,165, 38, 5, 2, 33,226,134,178, 16, 48, 66,252, 84, 32,193,169, 66, 9, 38,140,
- 7, 30,184, 15,152,152, 72,208,190,173, 24, 18,113, 16, 36,226, 32, 4, 75,130, 16,213, 62, 8, 18,177, 4, 18,177,231,146,152,
-175, 45,122,149, 44,125,239, 45,210,208, 64,210,189, 91, 23,132,133,135, 66,194,154, 81, 99,176,252,225,157, 98,255,254,253,123,
-246,239,223, 95,135,240, 93,255, 0,160,188,188, 28, 19, 39, 78,188,109, 86,126,126,126,190,218,213, 26,226,246, 1,192,176, 97,
-195,124,178,228,108, 54, 64,111,176, 64,175, 55,163,170,202,132,171, 87,117,184,116,233, 58,170,171, 77,168,169,177,160,166,198,
- 12,189,222,130,202, 10,239, 43, 50, 77, 38, 43,106,107,109,176, 88,204,104,222, 92,140, 78, 81, 45, 16, 18, 26, 10, 0,136,238,
-222, 21, 29, 59,180, 64, 88, 11, 9, 40,181,193, 98,101, 97, 50,233,255, 18, 3, 73,106,106,170,122,254,252,249, 30,201,156, 91,
- 26,200,211, 59, 33,115, 40, 13,110,177,124,249,114,124,254,249,231, 62,151, 26,182,187,197, 21,212,245,143, 35,212,210,210, 82,
-100,101,101,249, 92,138,118,207,158, 61, 52, 59, 59,219,149,252, 33,151,203,201,228,201,147, 61,126,111,206,156, 57, 32,132, 56,
-173,250, 85,171, 86, 73, 1, 32, 46, 46, 78,230,170,196,186, 30,167,148, 58,143,243,184,219, 58, 86,188, 59,197,193,155, 50, 1,
- 0,173, 90,181, 2,113,177, 30, 26, 43, 47,128, 59,143,252,221,109,251,229, 1,184,147, 44,255, 27, 3,188, 13, 2,129,192,231,
-239,141, 24,202,162, 77,235, 32, 84, 85, 9, 17, 36,180, 34, 72, 44,128,230,144, 24, 19,100, 34,136, 69, 34, 84, 85,137,112,160,
- 32, 20, 45, 36, 4, 12,195, 32, 81,110,198, 67, 19, 40, 24,134,226,157, 95,124,191, 78,149, 74, 69, 5, 33, 18,104, 69,173, 16,
- 98,185,136, 51,165, 20, 99,164,163,120,127,127,208,160, 65, 56,120,240,160,219, 99, 33, 33, 33,188, 7, 75,157, 78, 55,214, 49,
-240, 32, 57, 57,217,185,191,188,188,220,249, 57, 57, 57, 25,101,101,101,183,229,121,166,164,164,104,242,243,243,145,155,155,171,
-102, 89, 86,198, 48, 12, 56,203,191,161,121, 83, 79, 40,185,112, 73,214,186,133, 65, 29, 36, 22,192,108, 97, 81,107,186,136, 11,
- 23,203,161,213, 85, 65,171, 53,160, 92,107, 68,185,214,136,240,200,174, 94,101, 93,189, 78,113,229,234,117,244,238,221, 29, 21,
- 58, 29, 68, 66, 6, 85,213, 23,161,175, 96,209,231, 46, 61,218,182,110,141,144,144, 16, 4, 5, 5,227,242,149,106, 16, 65, 4,
- 95,130, 37, 46,228,216, 36,171, 0,154,122, 5, 65, 67,214, 58, 80, 39, 22,128, 47, 52, 0, 48,119,238,220,155,188, 10, 46,211,
- 12, 26,127,174,115,202,148, 41,117, 44,216,172,172, 44, 39,121, 61,250,232,163, 72, 72, 72, 32,124, 19,167,184,177,252,157,168,
-239,105,168,143,129, 3, 7, 18, 74,169,211,202,207,207,207, 87, 19, 66,156,165,129,147,147,147, 53,185,185,185,200,205,205, 85,
- 39, 39, 39,147, 67,135, 14, 57,143,175, 92,185,178, 65,185,185,185,185,106,134, 33,178,188, 60,251, 59, 49,103,206, 28,252,242,
-203,207, 50,142,194,243,242,242,212,220,253,243, 81, 38, 86,174, 92,137, 79,101, 17,152,186,194, 0,192, 62, 29,224,138,169, 43,
- 12,206,246, 76,145,137, 2,204,250,103, 81,218, 23,190, 95, 87,233, 94,250, 18,126,249,229, 23,254,171, 0,110, 5,241,187,198,
- 2, 52,198,250,175,107,201,215, 37,255,196,196, 68, 40, 20, 10,175, 83, 1,173, 90, 9,192, 16, 1, 90,183, 18,160, 71,119,138,
- 75,151,132, 96, 4, 4, 34,161, 16, 34,161, 8,191, 29, 13, 69,100,168, 8, 2,129, 0, 35,134,217, 16, 28, 28, 4,150,165, 0,
-181,249, 69,254,205,218,118,194,213, 26, 10,253, 25, 13,132, 68,128, 23, 23, 47, 34, 62, 14,108,178, 11, 23, 46,168, 47, 92,184,
-112,211,253, 78,154, 52,137,215, 96,153,148,148,148, 80, 94, 94,190,155, 35,121, 0,152, 56,113, 34, 86,175, 94,237, 60,167,170,
-170, 10,101,101,101,216,186,117, 43,146,146,146,198,220,142,206, 27, 23, 23, 39,203,205,205, 85,231,231,231,171,185, 96,177,184,
-184, 56,191,230,112,103,254, 35,229,255,217,251,242,240,166,170,252,253,247,220,236, 93,105, 75, 41, 75,217,165,130,108, 5, 42,
- 32,107, 2, 5, 20,176, 34,180,200, 38, 95,100,102, 26, 24, 87, 96, 20, 69,231,231,204,168, 40, 46,128, 35, 35,180,140,138, 11,
- 21,105, 21, 44, 88, 4, 10, 9,139,136,149,138,128, 44,178,148,181,133,174,105,211, 52,123,238,249,253,145,222,152,134,180,185,
- 73,195, 58,247,125,158, 60, 77,238,189,249, 52,247,220,115,206,251,217,206,231,104, 55,124,153, 9, 90,172,135,209,100,131, 78,
-102, 6,133, 14,102,179, 29,122,189, 5,101, 21, 70,148, 92, 53, 96,184,170,163, 79, 89, 38,107, 75, 20,157, 47, 71,151,206, 29,
-208,185,115, 60, 42, 43, 43, 16,213,194,129,110,221, 34,209, 42,182, 11,228, 10, 5,170,171, 13, 40,252,229, 20,174, 20,235,209,
- 58,190,231, 29, 59,129, 80,128, 18, 2, 21,199,165,238,164,218,212,186,125, 90,159, 44,120,189,249,136, 6,171,202, 50, 51, 51,
- 85, 43, 87,174,212,120, 42, 0,203,151, 47,231, 10, 12, 53, 41,143, 82, 74, 9, 33, 68,173,142,114,251, 77,244, 58, 98,206,206,
-118,134, 8, 82, 83, 83,121,185,255, 27,134, 20,118,121, 37,127,190,120,224,129, 7, 84, 7, 15, 30,212,112, 94,135,161, 67,135,
-170,188,157,231,146,241,124, 17, 54, 23, 91,255,225,135, 3, 26, 66, 8, 8, 33, 72, 76,236,171, 74, 76, 76,212,186, 41, 8,245,
-215, 2,190,198, 11, 39,143,153,170, 3, 39, 47,109, 84,167, 6, 15,106,234,138, 19, 46,121,124, 32,228, 0,220, 57,240,169, 0,
-220,142, 22, 63,135,105,211,166, 53,235,251, 12,195, 64, 36,114,190,122, 36, 48,232,215,219, 1,153, 84,238, 84, 0, 36, 18, 12,
- 25, 4,200,100,128, 68, 36, 67,203,150,114,136, 68,117,112, 56, 88,176,172,255,110,123, 99,213, 53,200,227,187,227,124,254, 23,
-136, 21, 51,120,252,229, 37,126, 79, 40, 10,133, 66,187,100,201, 18, 85,115,150, 1, 38, 39, 39,231,171,213,106, 60,245,212, 83,
-174, 99,156,165,175,215,235, 97, 52, 26, 49,119,238, 92, 0,192,135, 31,126,136,140,140, 12,205,173,120,182,115,230,204,209,178,
- 44,171,226, 44,255,129, 3, 7, 54, 43,129, 43,190,227,189, 56,116,112, 59, 90,181, 12, 65, 72,136,179,219, 91, 44, 14,232,107,
-173,168,210,153,208,190,115, 79, 12, 27, 50,210,231, 51, 25, 63,126, 10,217,177,237, 19,122,176,224, 56,134, 15,237,139,142, 29,
- 59,194,102, 53,163, 95, 98, 31,132, 70, 70,226, 98,209, 37, 20,151, 84,227,135, 31, 79, 66, 87, 27,137, 71, 31, 24,121,199,250,
- 76,231,207, 83, 3,128, 6, 32,152,175, 86,187, 8,156,245, 32,125,134, 33, 78,109,161,158,151, 9,128,190, 94,226,141,243,212,
-106, 10, 10,183, 76, 21,130,244,244,244, 6, 94,128,103,159,125, 22,132, 16,204,155,167,214,112,236, 15, 2,244,237,155,232,141,
-188, 92,238,120, 95, 36,199,151,252, 61,145,154,154,138,209,163, 71,171,154,211,143, 81, 31,171, 31, 52,104,144,106,246,236,217,
-218,198,206,187,197,246, 27, 5,151, 59,192, 41, 95,206, 48, 2,209,122, 42, 21,124,127,159,167,188,141, 11,194,156,141, 46,143,
-115, 93,179,113,193, 37,151, 66,176,253, 72,211,115,159,183, 58, 0, 66, 14,192, 29,170, 0, 12, 25, 58,240,134,196,124,130,101,
-249,187,119,164, 64, 80,165, 35,104, 19,199,184, 74,254,238,216,229,140,239,203,100,114,200,164, 50, 60,252, 16,129, 92, 38,133,
- 66, 78, 80, 85, 41, 66, 65, 97, 56, 28,172, 3,237,227,253,139,235,230,231,231,211,106,163, 9,186, 67,121,232,214, 94,130,223,
-138, 3,143, 11, 51, 12,163, 29, 56,112, 32, 25, 56,112, 96,192, 50,210,210,210, 84,171, 86,173,210,112,110,254,202,202,202,199,
- 6, 13, 26,100,216,185,115,231,119,143, 60,242,200,216,202,202, 74,242,248,227,143,111, 79, 75, 75, 83,221,202,206, 89,239,234,
- 87,185,189, 15,188,207, 57,201,157,158, 62,117, 2, 37, 69, 23,193, 48, 4, 14, 7,133, 92, 17,141,132, 30,189,240,232,164, 52,
-222, 29,189,164,156, 85, 85, 85,150,104,204,102, 59,122,247,234,130,118,109, 91,226,210,229, 82,232,142,157,195,239,167, 47, 97,
-215,238,163,184, 88, 76,241,231,191, 60, 29,208,224,185, 93,138,255,176, 95, 69, 5,124, 93,191,165, 60,229,157,251, 4, 43, 87,
-174,116, 41, 0, 43, 87,174, 4,138,214, 93,119,173, 55,121,141,120, 5,174,155,179,154, 91,172,135, 16,210,172,190,199,145,124,
- 99,228,238,235,188, 55,175,130,199,119,189,201,227,255,156, 47,126,141,156,149,179,157,115,195,168, 14, 13,200, 31, 0,210,198,
-223,239,124,163,251,213,167, 2, 32,212, 1,184,125,144,185,236,197,235,194, 0,126, 41, 0,183,115,194, 71,160,197,127,220,113,
-232, 23, 25,228, 82, 41, 30, 30, 79,192, 16,130,129, 73,118, 28,251, 77, 1,134, 56, 99,254,213,213, 12,218,182, 22,129, 33, 82,
- 28, 57, 38,133, 92, 6, 88,109, 86, 92,188,164,240,139,252,207,157, 62,140, 65,163, 39, 66,220,114, 16,206,157, 46,128,248, 90,
- 14, 94,120,254, 37,250,246, 59,111,222,146, 6,174,175, 87,175, 74, 74, 74,210, 44, 94,188, 24,189,122,245, 42,211,233,116, 72,
- 74, 74, 82,233,116, 58, 60,243,204, 51,154,180,180,180,219,162,174,125,115,137,223, 83, 9, 24, 54,100, 36,214,125,254,145,178,
- 77,235, 54,154,208,208, 80, 94, 86,255,117, 19,236,236, 63,105, 1,144,245, 95,100,208, 19,191,255,132, 54,113, 97,144,203, 37,
- 48, 24,172, 40,190,170, 7, 17,183,199,159,255, 50, 91,200,150,226,131, 95, 22, 1, 93,159, 64,131,229,133,133, 11,155, 67,214,
-205,254, 73,243,230, 69,187, 41, 18,193, 33, 52, 95,164,236, 15,105, 55,183,158,129,183, 54, 75,123, 64,230,188, 87,211, 85,231,
- 75,192, 29,139,196,196, 68, 87,194, 95,230,178, 23,175, 59,231, 83, 1, 8,118, 61,254,155, 93,223,223,175,206, 15, 2,157,142,
- 32,164, 53, 65, 76, 52, 65, 82,127, 27,228, 82, 17,100, 82, 27, 98,162,229,245,147, 0,193,224, 36, 7, 10,126,145, 56,189, 5,
- 60, 39,153,252,252,124,218,243,222, 8, 44,122,246, 95, 48, 73,227,241, 77,126, 49,186, 38, 56, 45,247,176,159,183, 98,209,223,
- 94,162,239,189,123,235,148,128,228,228,100,146,159,159,175, 92,182,108,153,198,221, 59, 16, 12,229,234,118, 70,125,177,159,102,
-223,227,204, 89,106,178,255,192, 30, 90, 94, 89, 14,211, 53, 35,228,242, 24,196,119,238, 19,144, 82,113,167,193, 89, 14, 59, 72,
-183, 89,180, 14,174, 21, 1, 69,159,222,242,123,243,149,220,119,183, 97,236,196,199,252,178,220,125,249, 30,133, 28,128,219, 75,
- 9,104,140,252,125,122, 0,254, 23, 64,225,204,234, 39, 12, 5, 5, 69,116, 11,138, 61,251,197,144, 75, 37,144, 73,197, 72, 25,
- 79, 65, 41,139,168, 24, 59,236, 14, 2,150,117,212, 79,126,190,209,167,147, 1, 19,166,164,193, 32,238,134, 86, 97,161,152,241,
-104, 52,178, 54, 29,115, 41, 1, 54,199, 55,183,252,254, 57, 69, 64, 24, 50,129,123, 21,238,214,123,203,212,189, 69,210,163, 94,
-188,158, 25,178,163, 3,149,135,244,168, 23,175, 63, 81,184,176, 89, 86,191,128,230, 33,245,201, 85, 65,235,195,119,187,241,112,
-167, 41, 1, 62, 13,224,196,196, 68, 33,104, 35, 64,128, 0, 1, 2, 4,252,143, 65, 40,244, 44, 64,128, 0, 1, 2, 4, 8, 10,
-128, 0, 1, 2, 4, 8, 16, 32, 64, 80, 0, 4, 8, 16, 32, 64,128, 0, 1,130, 2, 32, 64,128, 0, 1, 2, 4, 8,184, 59,208,
- 96, 21,192,252,249,243, 3,206,224,244, 86, 91, 59,216,242,102,206,157,231,243,123,117, 85,215, 92,239, 67,163, 91,187,222,175,
-255,120,205,117,215,198,170,254,236, 83,222,206, 21,127, 84,204, 27,179, 96,149,235,125,185,230,191, 8,228,247, 53,134, 64,127,
- 95, 99,240,246,251, 38, 61,174,246,249,189, 67,154,239,208,169, 83, 39, 92,184,112, 1, 73,170, 9,174,227,155, 63,207,184,225,
-237,247,231,171, 87,155,236, 47, 22,177, 88,185,168,184,216,181,100,113, 85, 92,156,235,250,255,182,105,115,195,251,159,167,188,
-220,220, 92,101, 94, 94, 94,131, 74,137,227,199,143, 87,165,164,164,104,111,197,248, 56,124,248,112,192,242,250,245,235,119,163,
-127, 31,153, 63,127, 62,110,231,249,229, 86,200,203,202,202,154,222,187,119,239,172, 99,199,142, 77,153, 49, 99,198, 55,205,149,
-231,190,209,145,123, 70,254,221,218,126,130,188,198,229,249,173, 0,120,194,110,183, 43,205,102, 51,136, 72, 2, 66, 8, 28,118,
- 27,164, 18, 49,100, 50,153,182,185,154,135,221,110, 87, 2,128, 88, 44,110,150,172,186,170,107, 8,141,110,237, 34,254,214,237,
- 59, 1, 0,174, 93,190, 16,144,188,157, 43,158,194,152, 5,171, 92,196,245,159,220, 2, 0,192,147, 41, 3,113, 55,226,144,230,
- 59, 36,169, 38,224,144,230, 59, 0,192,132,212,153, 0,128, 11, 23,110,125,251,253,187,180, 84,121, 26,208, 36, 0,170,211,128,
-115, 15,245,197, 47, 0, 0, 6, 46,123,251,150,182,155, 86,171,165,121,121,121, 48,155,205, 13,142,203,229,114, 77, 68, 68, 4,
-148, 74,229,109,185, 28,138, 16, 50,236,222,206,237, 62,165, 14,135,241,244,165,107, 47, 81, 74,183, 10,118, 80, 19, 74,167,197,
- 50,234,240,225,195, 17, 37, 37, 37,173,163,163,163, 91, 12, 24, 48,160, 56, 60, 60,252,243, 64,229,101,101,101,141,158, 49, 99,
-198,158,172,172,172, 63, 3,136,156,246,196,188,185, 0,216, 99,199,142,205, 6,176, 25, 0,235,143, 60,110,207, 19,142,248,155,
- 51,222, 60,119, 73, 12,214,146,190,198,148, 18, 1,183,153, 7,192, 29,250, 90,131,178, 77,194,253,154,145,189,187, 35, 68, 38,
- 1,165, 20, 14, 7,197,111,103, 46,226,252,209,125, 42,133, 76, 2,145, 72, 20, 16,121,135,201, 47, 40,123,118, 43,210,252,118,
-186,139,170,206,210, 41, 96,226, 7, 0, 69,100, 12,234,170,174,185,136,191, 41,143, 0, 31, 75,117,224,204, 23,177,115,197, 83,
-174,129,212,216,117, 77,173,177,244,252,159, 82,169, 20,128,179, 76, 38,203, 58,199,183,195,225,112,253,126, 70, 36,225,109, 69,
- 3, 64,155, 86,206, 82,157, 86,125, 53, 44,118, 59, 0,192, 96,119,202,235, 60,246, 79,184,167,103, 63, 94,196, 15, 0,125,135,
-140,198, 33,205,119, 46,226,111,236,186,155,217,126, 0,240, 84,105, 41, 5,128,113,161,161,216, 94, 87,167,225,136, 31, 0,126,
-223,177,243,186,235, 18,219,180,225,245, 59,107, 66, 43,148,133, 21, 63,163,248,210, 17,116,235, 56, 24,131,229, 74,191,251,112,
-110,110,238, 35,219,182,109,227,200,223, 14,192, 12, 32, 4, 0,107, 54,155,197, 10,133, 2,122,189, 94,233,205, 19,112,139,201,
- 63,238,254,196,222,219,182,127,185, 38,172,174,248, 36,134,165,205,207, 34,132,204,166,148,110,190,221, 38,166,252,252,124,218,
-156,250, 20,124, 54, 3,107, 10, 54,155, 77, 89, 80, 80,160, 57,126,252,184,235, 88, 69, 69, 5, 78,159, 62,141, 54,109,218,124,
-166, 84, 42, 85,225,225,225,124,159, 47,147,149,149,245, 79, 0, 15, 12, 27, 55, 73,145,149,149, 21, 55,237,137,121,225, 0, 28,
- 0,184,142,123,111,253,117, 35,248,222, 31, 55,222,212,106, 53,109,108,188,113,215,249, 26,111,106,181,154,238,253,177, 0, 34,
-145, 24, 14,135, 29, 53,181, 6,204,152,242, 8,125,247,221,119,155, 69,216,158, 74, 69,115,159,139, 0,223,240,182,237, 47, 7,
- 94,149, 0,235, 76, 86,229,232,148, 25,154,246,173, 34, 17, 34, 23,131,101, 89, 56, 88, 64, 44, 34,136,142,236,142,158,221, 58,
-104,242,183,127,167,114,216,234,148,254, 42, 1, 86,171, 85,217,163,231,121, 77,223,238,231, 33, 98, 28, 26,237,161,118, 42,169,
- 68,226,151,140,186,170,107, 80, 68,198, 32, 50, 34, 28, 0, 92,127,189, 93,215,186,125, 39,159,222,128,157, 43,158,194,192,153,
- 47,226,255, 30,155, 12, 0,174,191,222,174,251, 79,110,129, 95,218,181, 72, 36, 66,124,124, 60, 68, 34, 17,172, 86, 43,234,234,
-234,224,112, 56,160,211,233, 2,122,184, 97, 98, 17, 62, 94,185, 9,178, 72,160,244, 2,240,179,161, 24,229,215,206,226,243, 21,
- 47,249,101,245,247, 29, 50, 26,241,109,157, 33,146,120, 47,228,223,169, 83, 39, 87, 56, 0, 0,174, 92,185, 18,148,246,227, 83,
- 92,245,169,210, 82, 58, 46, 52, 20,175, 61,245, 36, 0,224, 53, 55,226,255,226,244,233,134,228,239, 71,181,214, 61, 23,190, 80,
-118,124, 66,172,121,177,195, 44, 88,216,100,200, 88,138,147, 21,187,240,201, 59, 27, 85,169,125, 50,248,246, 65,113, 94, 94,222,
-102,147,201,132,117,235,214,153,231,204,153, 35, 7, 16, 6,128, 93,183,110,157,117,206,156, 57, 98,147,201, 4,185, 92,174, 73,
- 73, 73,105,214, 68,247,205, 55,223, 40,119,236,216,161,105,110, 45,123, 87,223,145, 50,255,239,131,215, 94, 80,180, 56,241, 37,
- 20,191,239,198, 63, 70, 69,133, 63,179,165,252, 95,245,150,231,109, 69,254, 27, 55,110,132, 78, 55,134,102,103,167,249,125,239,
- 31,127,252,177,178, 57,100, 83, 87, 87,167,204,205,205,213,212,214,214,122, 61,127,245,234, 85,228,228,228,104,122,244,232,161,
- 26, 60,120,176,175,126, 67,178,178,178, 62, 31, 54,110,210,212,211,135, 15,136,227,219,182,182, 79,123, 98, 94,131,121,119,247,
-119,223,160,119,239,222,221,179,178,178, 30,234,221,187,119, 46, 0,236,223,191,191, 73, 82,229, 51,222,212,106, 53, 5, 33,128,
-143, 42,127,107,214,172,161,215,202, 42,112,248,183, 19,174, 99,102,179, 5,111,127,144,105, 80,207,153, 46, 16,246, 93,140,235,
-146, 0,107,107,107,149,195,198, 62,170,233,222, 33, 6, 50, 9, 3,150,101,113,237,218, 53, 28, 59,114, 24, 86, 59, 11,150,165,
-136,137, 12,193,216,135, 38,106, 76, 22,187,223,255, 80, 38, 41, 67,215, 14,215, 0, 17,193,125,221, 46, 67, 38, 46,245,219,242,
-119, 39,255,235, 44, 60,125, 45,174, 93,190, 0, 69,100, 76,163, 94,129,166,200,203, 19,159,126,245, 13,158, 76, 25,136,129, 51,
- 95,108,212,170,245, 6,169, 84, 10,145, 72,132,136,136, 8, 20, 21, 21, 65,167,211, 57, 21,169, 0,201,191, 77,171, 56,132,137,
- 69,120,244,233,215,241,208,140, 33,216,250, 91, 49,174,153,208,108,242,247,196,149,146,107, 56,126,232, 7,196, 70, 69, 56,201,
- 95, 44, 10, 74,251, 61, 56,229,255, 0, 0, 81, 98,137, 95,228, 15, 0,127, 95,245, 31,252,125,213,127, 92,228,191,189,174, 14,
-207,143,157,232, 60, 25, 43,229,117,223,159, 94,124, 75,249,151, 69, 15,104,158,232,248, 87, 72,152, 48,132, 34, 4, 12, 68,104,
- 23, 55, 20, 79,189,182, 80, 83,212,118, 5, 47, 53, 66,171,213,218, 0,224,211, 79, 63, 53, 2,144,115,219, 40,175, 91,183,142,
- 5, 16,226,190,173,178, 86,171, 13, 40, 46,103, 52, 26,149,254, 28,231, 97,249, 15,187,191,127,162, 49,251,155, 77,234,126,189,
- 18, 68,117, 39,118,225, 66, 89, 45,174, 86, 27,193, 82, 26, 80, 34,112,122,122, 58, 77, 75,203,166,235,215,175, 15,106, 33, 49,
- 55,242, 71,116,116,126, 64, 50, 10, 10, 10, 52, 25, 25, 25,132, 16,226, 82, 6,252,252, 13,215,145,255,161, 67,135, 48, 99,198,
- 12,119, 15, 1, 78,157, 58,165, 49, 26,141, 77,110,152,149,149,149,245,212,176,113,147, 38,190,177,100,129, 56, 59, 59, 27,255,
-253,224, 93,113,189,199,200, 69,254,217,217,217, 88,181,106, 21,122,247,238,157,235,107,188,121,146,127, 99,227,237,161,161,245,
- 94,192,240, 80,159,242,222,251, 96,181,139,252,203, 42, 42, 81, 86, 81,137,154, 90, 3, 36, 18,113,216,234,117, 95,154, 61,173,
-120, 1,119, 6, 18, 19, 19,175,123, 53,169, 0, 56, 28, 14, 26,211,169, 15, 58,181,110, 1,179,205, 1, 66,128,237,219,191,199,
-103,159,174,195,209, 35, 71,240,252,194,231, 32, 18, 49, 96, 29, 44, 34, 66,100,232,212,103,152,198,100, 50,241, 30, 96, 54,155,
- 77,217,179,219, 69, 77, 68,152, 17, 31,127, 90, 6,134, 80, 12,236,253,187,198,102,179,249, 53, 72,189,145, 63, 71,252,166,154,
-202, 6, 10, 66,141,190,214,167, 60,111,131,137, 27, 72, 5,235,223,106, 64,112,159,126,197,175,124,111,215,174, 93, 17, 19, 19,
- 3,189, 94, 15,169, 84, 10,134, 97, 96, 50,153,160,211,233, 32, 18,137,184,137,153,247, 61,127,189,121, 19,158, 91,185, 3,155,
- 62,120, 5,109, 90,197, 33, 36, 52, 26,151, 29,197,248,124,197, 75, 8,171,159, 52, 68, 60,229,121, 35,127,142,248,107, 74,206,
-161,123,124, 43,212, 26,205,144,133,200, 0,135,195,103, 62,128,175,246,123,105,237, 86, 28,255,229, 71,244,234,114, 31,106, 28,
-190,149, 70,142,252,127,223,177, 19,127, 95,245, 31,215,241,237,117,117,216, 94, 87,135, 34,245, 63,177,227,196, 81,244, 28,216,
- 5,168,244,189, 53,115,214,153,101,202,249,207,140,214,196,134,246,128,137,214, 2,150, 50, 72, 45, 85,176, 56,106, 97,102, 77,
- 96,165, 97,104, 55, 60, 9, 57,191, 46,245, 53,209,145, 13, 27, 54,192,108, 54, 67,173, 86,135,168,213,106,192, 25, 2,128, 90,
-173, 70,253,231,122, 11,202,140, 13, 27, 54,248, 61,104, 79,157, 58,165, 92,184,112,161,230,253,247,223,167,132, 16, 13, 0,236,
-219,183,143, 46, 93,186,148,190,242,202, 43, 1,109,205, 28, 46, 99,214,253,231,197, 39, 20,227,218, 89, 68, 7, 78, 93,195,214,
- 11, 12, 94,220, 86,106,249,167,214, 80, 83,103,195,255, 5, 34, 83,167, 27,115, 35, 45,127, 68, 71,231, 99,230,204,153,126,239,
- 70,233, 78,248,107,214,172, 33,220,118,210,124,113,224,192, 1,101,105, 41, 63,163,196,106,181,226,216,177, 99,187,155,234, 47,
- 0,148,241,109, 91, 75,211,210,210, 0, 0,133,133,133,216,253,221, 55,242, 43, 37,215, 88,142,252, 1, 32, 45, 45,205, 53,222,
-142, 29, 59,182,162, 57,227,237,237, 57, 19,241,219,185,203,104,221,165, 13, 80,103,228,125,239,101, 21,149,176,217,236,245,115,
-181, 29, 54,155, 29,151, 47, 94,144, 55,231,153,122,122, 15, 4,111,194,237,133, 6,174, 40,139,197,130,126,221,187,107, 66, 20,
- 18,176, 44,133,131, 5,126,216,183, 31,255,124,237,117,176, 20, 56,115,246, 44,142, 30,249, 21,189,122,245,133, 72, 68,112,111,
-151,120, 20,253, 98,135,130,231,230,120, 82,113, 25, 18, 58,149, 0, 98,130,203, 87,109,128,152,160, 79,247,139, 40, 56, 86, 6,
-138,118, 1,221,128,187,123,223,155,103,192, 84, 83,217, 96, 53,128, 47,184,187,247,189,105,218, 5,235,223,194,152, 5,171,188,
-102,177,187,195,110,183, 35, 36, 36, 4, 12,195, 32, 42, 42, 10, 70,163, 17,117,117,206,109,128, 99, 99, 99, 81, 89, 89,233,215,
- 6, 28,102, 29, 48, 80,161,192,243, 31,236,195,152,190,192,197,195,192,207,245,231,158,255, 96, 31,254,189, 64, 5, 7,235,240,
-187,253,142, 31,250,193,245,126,244,128,238, 16,135, 51,216,174, 61,129,126,221,219, 35, 34, 76,134, 79,115,242,145,164,154,128,
- 43, 94, 86, 1,248,106,191,220, 19, 20,184, 10,164,140, 38, 88,187,181, 8, 49, 81,157, 49,121, 40,225,213,126,156,187,127,123,
-221, 31, 91, 39,211,127,172, 0,218,213,128,252,229, 85,208,127,190, 6, 48, 38,144,130,165, 88, 21, 23, 71,254,219, 68, 32,160,
-235,148, 48, 77,199, 22, 3,160,119, 24, 96,209,157,197,231,151,178,176, 63, 69,135,251,254,172,194,216,167,195,160,136,186, 23,
-114,113, 20,196, 41, 53,248,249,155,159,233,253, 73,247, 55, 54, 73,185,254, 7,195, 48,160,148, 90,235,149,104, 51,195, 48, 70,
- 74,105, 52,156, 73, 92, 1, 47,175,237,222,189,187,118,236,216,177,170,202,202, 74,205,246,237,219,157,138,207,246,237,232,209,
-163, 7,186,119,239, 30,208,246,204,181, 22,246,153,185,127,255,247,150,119, 38,180,102,168,185, 6,127, 89,127,218,102,183,217,
- 86, 89, 28, 88, 74, 41,173, 10, 68,230,164, 73,214, 27, 78,254, 35, 70,140,208,250, 43,167,160,160,160, 65,200,132,243, 2,240,
-221, 85,210,225,112,248,165, 48,156, 63,127, 30,131, 6, 13,106,172,191,200, 1,220, 7, 64, 60,106,194,228,234,162,162,162, 22,
-133,102, 28,210,109, 0, 0, 32, 0, 73, 68, 65, 84,133,133,200,206,206,198,128,162, 34,166,176,176, 16, 0, 48, 96,192, 0, 60,
- 56, 50, 9, 17, 97, 50,172,250,100, 83,217,140, 25, 51,150,172, 94,189,122,129,191,227,237,234,230,183, 16,222, 83,142,176,110,
-207, 97,227, 91,127, 70,223, 94,173,113,239,196,215,145,145,145, 65,154,202, 18,175,209,215, 66, 46,151, 1, 0, 36, 18, 49,140,
- 70,115, 80,159,173, 64,250,183, 6,126,111, 6,196,178, 44, 66,100, 82, 88,237, 20, 12, 1, 24, 2,188,250,175,215,225, 96,129,
-186, 58, 3,174, 93,187,138,184,184,214,160,148,133,221, 14,200, 37, 98,136, 36,252, 92,176,118,187, 93,121, 95,215, 43,154,150,
- 81,122,128, 16,167,110, 76, 0, 66, 40,250,247, 60,163,249,233,104,156,202,223, 21, 1,156,117,223, 88, 72,128,143,245,239,169,
- 69, 55, 70,252,254, 88,255,128, 51, 97,168, 85,171, 86,144,201,100, 46,151, 33,151,248, 23, 25, 25, 9,137, 68,130,203,151, 47,
- 67,194, 83,222, 39,249,123,240,231,137, 35,193,153, 55,167,237, 78,247, 63, 0, 40, 19,128,136,215, 53, 88,240,183, 33,136,242,
-227,126,175,148, 56,147, 21, 59,180,138,134,206, 98,129, 56, 66, 4,115,185, 17, 96, 24,180,233, 24,143, 29,187,127, 14,168,253,
-254,111,209, 27, 56,255,195, 46,136,175, 1,213,113, 64, 8,195, 96,112,167,206, 24, 53, 50,142,151, 28,207, 88,255, 23,143,253,
- 25, 95, 91,126, 7,238, 49, 3, 63,137,129, 48, 49,240,240, 0,196, 63,204,207,120,237,218, 46, 26, 86,107, 21, 36,118, 27, 62,
-191,148,133, 31,231, 68, 98,196,163,143,160,123,171, 30,170,223,118,104, 53,253,210,234, 32,177,214,193,222,157, 69,121, 41,191,
-164,209,122,229,205, 60,103,206,156, 48, 0, 58, 74,169, 4, 0,230,204,153,211,236,218, 26,147, 39, 79,214,238,223,191, 95,117,
-242,228, 73, 77, 72, 72, 8, 66, 66, 66, 48,115,230,204,128, 38, 81, 66, 72,235,137, 19, 39,174,253,219,223,254,198, 60,191,224,
- 25,182, 23,123,150,177, 88,109,117, 86, 7,253,155, 63,114,210,211,211,169, 78, 55, 6,147, 38, 89, 49,115,230, 76, 18,232,239,
-185,145,228,239,205,221,191,102,205, 26,162, 86,171,233,220,185,115,121,253, 94,131,193,208,192,237,239,142,133, 11, 23, 98,225,
- 66,231,166, 69, 73, 73, 73,238,215,203, 26, 17,215, 22, 64,167,122,165, 48,228,193, 41,179,204, 93,186,116,145,103,103,103,131,
- 35,255,180,180, 52,196,181,105,227, 62,222,182,194, 45, 68,192,103,188,165, 63, 60, 2, 7, 75,202, 16,222, 55, 28,197,219,207,
- 1,114, 25,166, 60, 61, 27,209,241, 19,121,206,205, 14, 20, 95, 45,181, 75, 36, 98, 49,231, 1, 0,128,203, 23, 47, 52,235,185,
- 54, 22, 58, 16, 20,130, 91,167, 16,120, 42, 1,140, 55, 19,135, 82, 10,150, 2, 14,214,169, 4, 16, 2,124,243,117, 14, 30,157,
-156,138,150,177,173, 92, 19, 32,245, 99,175,108, 17, 83,134,158,247, 92,118,125,238,211, 43,196,229, 36,235,127, 95, 17, 68, 76,
-153,223, 55,228,233,238,247,118,222, 31,235,223,211,221,239,237,188,251, 90,246,166,160,215,235, 81, 91, 91, 11,139,197, 2,150,
-101, 81, 94, 94,238,114,255, 27,141, 70, 24, 12, 6,191, 66, 0,155, 62,120, 5,218,223,128,154, 11,128,205, 4,252,123,177,202,
-229,254,255,229, 48,240,235,213, 31, 32,242,179,253,106, 74,206, 33, 58, 50, 20, 49,209,161,184, 55,161, 7,138,206,151,227,116,
-113, 37, 58,196, 68,194, 82, 90,134,179,103,206, 54,168, 5,192,167,253,134, 40, 31,193, 48,213,116,108,218,178, 17,154,189, 27,
-145,181,124, 17,166, 44, 90,138,163, 54,160,188,178,140, 87,251,185,199,250,159, 24, 50, 8, 51,239,235,136,141,155,118,227,232,
-209, 11, 88,126,172, 16, 27,198,204, 6, 62, 58,128,226,226,242, 6,181, 0, 26, 67,188, 89, 6,135,181, 2, 86,107, 13, 0, 32,
-174, 93,123,116,239,209, 67,165, 87, 56,115, 49, 76,172, 17,140,165, 14,138, 58, 17, 74,175, 94,243, 69,168, 78,143,140,217, 12,
-179,217, 44, 7, 96, 5, 16,110, 54,155, 35, 60,151, 4, 6, 10,163,209,168,220,187,119,175,166, 71,143, 30,152, 53,107,150,170,
-162,162, 2,219,183,111,231, 61,216, 8, 33,195,100, 50,153, 33, 60, 60,220, 62,102,204,152,171,139, 23, 47,110,187,100,201,146,
-162,159, 15, 31, 29,191,225,184,229,148,141,133,223,251,177,222, 8,151,127, 48,201,223,211,250,231,114, 20,220,189, 0,124,100,
- 72, 36,127,168,228,203,151, 47,119,189,188,125, 6, 92, 43,124, 26,123, 54,210,250, 23, 3, 64, 92, 83,114,206,171, 59,157, 27,
-111,135,127, 57,124,126,198,140, 25,233,254,140,183,225,247,223,139,228,161, 9,120,227, 95,239,226,189,149,121,248,127, 95,236,
-198,188, 81, 73,184,246,109, 30,106,116,122,159,100,155,145,145, 65,210, 82, 30,132,205,102, 63,108,179,217,237,238, 10, 0, 0,
- 44,125,245,165,128, 9, 91, 32,250, 91, 11,111,177,127, 79,175, 64, 3, 5,128, 97, 24,212, 24,140, 16, 49, 4,118,187, 3, 44,
-165,176,179,206, 36,210, 35,191, 30,198,168,209,227,156,110, 50, 74, 33, 98, 68,168, 53, 90, 97,183, 90,124,107,152, 14,135,178,
-115,187,171,154,216,232, 26,151,150, 49,100, 96,152,115,216, 16, 2, 66, 40,250,245, 56,171,177, 59, 28, 74,190, 55,199, 89,247,
- 77, 37, 3, 6,100,189, 54,145, 92,227, 15,162,162,162, 80, 94, 94, 14,153, 76,134,218,218, 90,196,198,198,186,146, 2,205,102,
- 51,170,171,171,253, 82, 0,210,223,216,128,127, 47, 86, 33,178, 19,160,253, 13,120,102,153, 6, 97, 98, 17, 38, 63,251, 38,174,
-176,215,176,126,249, 11, 16, 49,252,229,113,214,255,128, 1, 9,136,237,210, 9,173, 98, 91, 66,202, 16,216, 9, 69,121,157, 9,
-186, 90,115, 64,237,247,222, 91,155, 49,169, 71,103, 68, 68,196, 32, 36,182, 45,108, 85, 58, 28,222,250, 37,170,171, 46, 5,212,
-137, 63,126,235, 41, 96, 65, 50,196,118, 43, 58,213, 1,101, 34, 61,254,125,245,103, 64, 26,193, 91,198, 47, 91, 14,170, 42, 24,
- 19, 46, 73,141, 72,186, 71,133,251,102,135,161, 40, 74,171,137,141, 61,172,105, 63,184, 8, 53, 76, 45, 44,212, 4,227, 23, 44,
-228, 97,225,124, 44,127,247, 9,158, 91, 5, 32, 13,214,192,253,254,251,239, 1, 0, 51,103,206, 84,117,239,222, 93,251,232,163,
-143,186, 44, 70, 62,228, 31, 27, 27,187,109,237,218,181,161, 25, 25, 25,162, 5, 11, 22,224,185,231,158,163, 7, 14, 28, 24, 76,
- 41,221,110,180,209, 30,148,210,159,252,183,230,162, 26,117,251, 7,154, 16, 24, 76,242,247, 36,120,119,133,101,205,154, 53,164,
-160,160,128,151,107,255,202,149, 43, 7,184,247, 89, 89, 89,174,151,231, 49, 14,209,209,209, 0,208,216, 36,120, 5, 64, 53, 0,
-230, 74,201, 53,252,248,227,143,174,152,255,128, 1, 3, 0, 0,217,217,217,248, 42, 55, 15,186, 90,179, 17,192, 82, 56,151, 6,
-242, 30,111,223,110,250, 7,198, 45,126, 26,227,199,143, 70, 75,153, 8,181,132, 98,251,233,203,248,241,183, 98,191,136,122,254,
-156,233,247, 23,157, 61, 43,190,124,241, 2,184,215,210, 87, 95,106,210,146, 23,112,123, 19,191,231, 49,111,104, 16, 2,144,201,
-100, 56,115,226,168,170, 83,219,104,141, 66, 34,134,195,193,130, 16, 2, 66,128,116,245,147,160,148,133,163,190, 30,128,209,108,
-198,201,211, 69,144, 74,125, 59,177,237,182, 42,244,187,239,188,251, 44,138,191, 46, 56,143,175,191,232,230,210,157,147,122,157,
-195,193, 35, 61, 32, 22,197,250,101,253,123, 35,126, 83, 77, 37, 0, 4,100,253,123, 27,104, 5,235,223, 2, 0,222,214, 63,224,
- 92,231,223,186,117,107, 88, 44, 22,148,150,150,194,225,112,160,101,203,150,168,172,172, 68,203,150, 45,235,219,149, 63, 97,151,
- 95, 59,139, 87, 94,215,160,230, 2,240,206,162,225, 48,216, 29, 88,184, 44, 27,239, 47, 78,195,162,229, 91, 33, 38, 4,126,240,
- 63,106, 74,206,161, 77,203, 22,144, 64, 2, 7, 8,174,158, 63,142,139,101, 53,232, 26, 27,141,111,127, 57,128,147, 39,224,183,
-245, 63,101,238, 66, 72,162, 1, 70, 4,172,203, 59,143,175, 63,124, 30,115,223,202,192,194,135,251,226,201,209, 29,253,106,191,
-237,117,117,120, 47,101, 42, 80, 45, 7,136, 4,120,239, 93,164,254,188, 15, 59, 70,207, 7,121,243,105,144,131, 47,240,178,254,
- 1,224,215,171, 49, 24,100,170,129, 65, 33,130, 81, 46, 71,215, 41, 18, 88,168, 9, 53,140, 4,118, 36,128, 58,140,176, 85, 92,
-197, 15, 31,212, 96,230,140,174,183,100,208, 22, 22, 22,210,122, 98, 32,147, 39, 79,214, 58,125, 99, 78, 12, 31, 62,156, 12, 31,
- 62,156, 15,249, 15,109,219,182,237,247,111,190,249,102,232,153, 51,103, 32,145, 72, 16, 17, 17,129,163, 71,143,218, 40,165,229,
-205,249,125, 77,173,201, 15,196, 59, 16, 76,242,247,180,254,157,196,122,253,242, 65, 62,185, 0,105,105,105,103,190,250,234,171,
- 33,118, 59,191, 21, 78,114,185,124,110, 19,167,107, 1,156, 7, 48,224,244,225, 3,112,143,249,255,117,238, 84,124,223,165, 11,
-184,112,192,182, 46, 93, 66,102,204,152,241,137, 63,227,237,177,228, 65,136,100,163, 96,132, 4, 95,175,120, 26, 31,110,253, 21,
-207, 63, 56, 12,115,150,103, 33,117,233,231,126, 89,224,238,197,132,188, 29, 19,214,239,223,157,104,224, 1, 16,137, 68,164,250,
-234, 89,156,187, 92, 9,177, 68, 4,187,131,133,205,238,192, 47,191, 20,226,179,207, 62,129,213, 65, 97,115,176,144,138, 25,148,
-233, 12, 40, 62,249,163, 74,161, 80,104,125, 16,161,178, 71,215,139,127, 88,255,206,169, 10, 95,127,145,224,156,227, 24, 10, 48,
- 20, 12,195, 98,112,223,147, 26, 7, 15, 47,128, 55,235,223,125, 21, 64,104,116,107,191,200,223,155,245,239,158, 85, 59,102,193,
- 42,191,200,203, 57, 41,234, 96, 48, 24, 32,145, 72, 92,214, 63,203,178,174,191,254, 42, 0,159,175,120, 9,191, 20,239, 65, 88,
-107,103,210, 95,184, 88,132,242,107,103, 17, 33,147,160,186,234, 10, 68, 12,129,152,225, 23,126,230,172,255,246,209,225, 56, 81,
-116, 30,118,171, 21, 50,177, 20, 6,131, 25,223,106, 14, 32, 73, 53,193, 47,242,231,218,239,145,167, 94,195,250,127,191, 15, 35,
- 11,180,239, 26,143,223,142, 31,196,194,135,251, 6,212,126, 0,176,176,107, 18,182,156,217, 13,212,216, 1,121, 75,236, 44, 56,
- 1,242,230,211, 88, 21, 23, 71,248,146, 63, 0,204,232,182, 88,251,195,206, 2,192, 90, 11, 3,169,133,142, 49,160, 70,108,131,
-205,161,135,204,108,132,188,228, 60, 54, 44, 57,131, 78,137, 9,104, 34, 1,176, 1, 20,110,153,175,114,185, 28,114,185,220,235,
- 57,190, 88,187,118, 45,214,174, 93,219,172,193, 28, 30, 30,254,204,217,179,103, 67, 35, 34, 34,160, 80, 40, 16, 29, 29,141,242,
-242,114, 16, 66,140,193,156, 52, 56,139, 63, 63, 63,159, 2,206,132, 64,127,146, 2,131, 77,254, 31,127,252,177,146,250, 94,235,
-206,107, 69, 64,104,104,104,186, 88, 44, 62,231,121,124,249,242,229, 13, 44,127, 0,232,216,177, 35,146,147,147,215,249,178,127,
-174,148, 92,107,144,237,255,202,223, 23, 64, 38,150, 34, 46, 46, 14,220,234,128,250,243,161,254,140,183, 63, 43,251,224,185,119,
-223, 71,109,105, 25, 98, 35, 90,225,248,137, 75,152,179, 60, 11, 25, 25, 25, 36, 16,178,230,190,231,254,125,119, 57,130, 39,224,
-206,192,175,191,254,218,100, 49,160, 70, 61, 0,245,147,136,182, 80,187, 89, 69,105,138,166, 83,219, 24,132,135,200,112, 95,175,
- 68,220,215,179, 47,196, 12, 96, 48, 57,112,233,106, 21, 10,180,223,169,194, 66, 67,124,254,131, 58,163, 17, 9, 29,175,194,108,
-145,131,114, 70, 13, 5, 20,114, 51, 40, 5,170,170,101, 0, 1,194, 67,237,232,157,112, 1,251, 14,245, 67,120,120, 56,111,235,
-223,221,226, 87, 68,198, 64, 66,109,128,253,143,249,206, 33,246,253, 27,221,173,127,119,139,159, 59,118,246,248, 97,215,181,124,
-170,236,185, 43, 1, 0,208,186,181, 83, 25,169,170,170, 66, 68, 68,132,203,253,239,143, 2,192, 41, 1,192,155,152,159, 54, 18,
-248,247, 62,124,248,242, 4,164, 46,122, 31, 89,111, 61, 9, 49, 33,144,202,248,173,216,225,172,255, 19,151,202,112, 79,251,150,
-248,232,191, 27,208,169, 83, 39, 68,182,237,138,190,109,187,194,102,249,195,253, 47,225, 33,147,179,254, 95,159, 59, 26,207,188,
-186, 14,237,187,144,102,181, 31,103,253,143,221,244, 49,118,204,156, 14, 18, 63, 24,128,179, 42, 32,224, 44, 17,204, 93,251, 76,
- 92, 28, 47,226,232, 99,121,129,100,189,187, 76,217,117,114,173,166, 83,183, 94,208, 43,128,243,184,136,218, 11,229, 40, 95,234,
-128, 65, 23,143, 5,179, 23,241,126, 32,171, 87,175, 38, 10,133,130,154, 76, 38,184, 89,158, 84,161, 80, 96,245,234,213,126,148,
- 39, 10, 30,106,107,107,223,121,242,201, 39, 83,214,174, 93, 43,143,140,140,132, 70,163,193,202,149, 43,245, 86,171,245,193, 96,
-254, 31,206,226,231,150,203,249,155, 16,152,156,156, 76,116,186, 49, 52, 24,228, 15, 0, 28,177,243, 33, 40, 30, 21, 6,173,179,
-103,207, 30,188,113,227,198,163,117,117,117,109,108, 54,231, 50, 83, 79,242,191,239,190,251, 48,120,240,224,137, 60,158,179,184,
-166,228, 28,222,248,199, 43,248,102,203, 54,140, 27,214, 31,187,242, 15, 58, 13,152,182, 93, 17,217,182, 43, 6, 20, 21,225,193,
- 41,179, 42, 46, 85, 26,199,118,136, 9,201,225,107,253, 63,151,185, 5, 75,254, 52, 22,109, 91, 43, 93,202, 5,119,143,124, 60,
- 55,129,120, 7, 4, 79,192,157,171, 20,240, 82, 0, 0, 32, 34, 60, 76,251,139,118,179,234,124,252,189,232,210,173,135, 38, 34,
- 84, 1,150, 2, 38,139, 21, 69, 69, 69, 40, 47,250, 85, 21, 30, 22, 10,134, 97,124, 14, 92,133, 92,142,141,223,143, 84,113, 25,
-240, 77,186, 35, 24, 6,161,161,252,173, 39,110, 9, 96,104,116,107,176, 14,155,147,252,235, 97, 35, 18,159, 37,118, 61,193, 45,
-169, 25,179, 96, 85, 3,210, 10,132,252,221,149, 0,247,194, 63, 85, 85, 85,190, 31,128, 15, 37,224,115,183, 85,194,107,151,254,
-245,143, 15, 54, 3,194,120,202,105, 31, 29,142,141,135,126,197,111,167,126, 71,146,106, 66, 3,210,247,135,252, 57, 60,242,212,
-107,248,186,127, 40,158,122,180,123, 80,218,111, 97,215, 36, 44,202,221, 8,242,198,171,216, 22, 55, 8, 43, 13,191, 53, 56, 63,
- 57,178, 5,226,229,254,237, 73, 49,163,219, 98,237,182,220, 28, 92,209,157, 67,121,229, 85,148,158, 14,131,200, 17,129,161,125,
-134, 67, 53, 91,117, 75, 39,181, 96, 84,251,163,148, 30, 34,132,140, 33,132,236,124,255,253,247,229,147, 38, 77,210, 27,141,198,
-177,129,196,252,155, 66, 48,150, 0,170,213, 81, 65, 33,127, 79, 43, 53, 72,168,152, 58,117,106,215,218,218,218, 55, 10, 11, 11,
- 23, 20, 23, 23,163,174,174, 14, 82,169, 20,109,218,180, 65,108,108,236,164,254,253,251,127,203, 83,214, 73, 0, 3,218, 71,135,
-227,129, 7, 30,192,175,103,138,209,178,115,207, 6,227,237,193, 41,179,140, 0, 62,224, 67,254, 28,254,172,236,131, 49,249, 63,
- 97,230,171,159, 97,196,136, 17,136,139,139,243,170,104, 5,171, 65, 56, 37,192,159,182,110, 76, 33, 19,148,136, 91, 71,250,188,
- 74, 1, 3, 64, 68, 68,132,214, 82,117, 89,249,139,246,180, 10,112,102,210, 82, 74, 33,147,201, 16, 25,193,187, 6, 54, 36, 18,
-137, 54, 82, 34, 9,250,205,113,174,126,145,221, 8,216,141,174, 12,120,142,248,253, 93,139,197,185,250,207, 30, 63,140,179,199,
- 15, 35, 54, 54, 22,229,229,229, 1, 17,127,100,108, 91, 88,121, 36, 71,242,197,204,215, 62,199,129,125,218,160,201,187,112,225,
-130,107,183, 63,155,197,124, 29,249,251, 67,252, 28,102,247, 15, 13, 90,251, 1, 0, 89,241,130,139,248, 57,242, 63, 95, 87,167,
-154, 28,217, 2, 15,243,180,250,189,225,161,206,169, 4,157,235, 63, 4,144,216,190,102,205, 26,194, 85,251, 91,189,122, 53,113,
-175,252,183,110,221, 58,178,122,245,106,215,251, 53,107,214,220,244, 65, 79, 41,221, 79, 8, 25,145,147,147,179, 80,175,215,175,
-160,148, 22, 4,251,127, 4, 99, 9, 96, 48,201,233, 6,193, 20, 30, 30,190, 80,169, 84, 46,108,166,156,253,199,142, 29, 27, 10,
-160,115,203,206, 61,141, 54,139, 57,164,126,188,233, 1,212, 0, 56,217, 33, 38,228, 49, 56,147, 5,121, 99,204, 43,107,111, 10,
-241, 55, 71,209, 18, 72,254,214, 32, 49, 49,145, 23,249,251, 52, 64,197, 98,177,214,151, 59,254,102,131,139,237,115,196,143,102,
- 18, 63, 23,155,174, 41,187,130,154,178, 43,136,141,141,109,150,197, 15, 0,118, 7,235,183,247,161, 41,148, 85,213, 4,252, 91,
- 60,193,197,246,131, 69,252,193,110, 63, 46,182,191,197, 96,160,238, 86,127, 63,177,164, 89,196,255,191, 4, 74,233,207, 0,166,
- 11, 45,113,235, 49, 99,198,140, 12, 0,159, 93,170, 52, 26,109, 22,179,123, 60, 50,162, 67, 76, 72, 20,252,220,253,143, 35, 85,
-119, 55,255, 29,164, 84, 9,184,137, 74, 0, 47, 67, 43, 49, 49, 81, 72,236, 16, 32, 64,128, 0, 1, 2,254,199,192, 8, 77, 32,
- 64,128, 0, 1, 2, 4, 8, 10,128, 0, 1, 2, 4, 8, 16, 32, 64, 80, 0, 4, 8, 16, 32, 64,128, 0, 1,130, 2, 32, 64,128,
- 0, 1, 2, 4, 8,184, 43,208, 96, 21,192,252,249,243, 3,206, 34,245,182,221,228,237, 46,239,240,225,195, 1,203,235,215,175,
-223, 13,151, 23,236,251,109,217, 50, 49, 96,121, 21, 21,191,222,234,231, 75,234, 21, 86, 22, 94,138,175,220,137,253,239,102,201,
-171, 47, 76,196,212,183, 33, 5, 64,231,207,159,207, 10,237, 39,200,187,147,228,101,102,102,138,211,211,211,237, 0,240,209, 71,
- 31,209,110,221,186, 97,196,136, 17, 68,104, 63,239,242,252, 86, 0,238, 6, 52,183,200,196,212,169, 83,149, 0,220, 75,134,170,
- 54,110,220,168, 21,116,197, 91,131,154,154,154,199,143, 29, 59,214, 87, 36, 18, 45,146,201,100, 48, 26,141, 47, 12, 27, 54,236,
- 93, 4,161,210, 30,165,212,239,106,140,119, 34,230,207,159, 79,193,115,147, 25, 1,183, 14,185,185,185,202,148,148, 20,109,128,
-223, 85,229,229,229,237, 14, 70, 65,169,122,121,143,229,229,229,109, 88,179,102, 77, 52,156,123, 26, 56,112, 11,170, 91,186,131,
- 35,255,189,123,247,210,159,126,250, 9, 73, 73, 73, 24, 49, 98,132,208,113,130,229, 1,184,211,145,159,159,175,108,206,247,167,
- 78,157,170,220,184,113,163,102,234,212,169,238,135, 53, 83,167, 78, 13, 88, 9,224, 20,138,236,236,108,174, 84,167, 95,178,210,
-211,211,169,159,255,175,201,245,192, 59,119,126,226,175, 60,149, 78, 23,122, 43, 20, 32,242,219,111,191,189,163,215,235,255,212,
-177, 99,199, 22, 21, 21, 21,168,223,110,247,237,175,191,254,250,237,208,208,208, 81, 15, 62,248,160,166, 89,255, 32, 0,242, 87,
-171,231,251, 61, 9,102,100,172, 38, 55, 79, 94,211,229,112, 27,219,244,133,239,248,218,184,113,163, 6,175, 18,144,127,121, 87,
-168,240, 42,193,212,147,105,126,183,235,184,113,227, 40, 0,108,223,190, 61, 40, 4,198,109, 5,172, 86, 71, 5,125,125,124,110,
-110,174, 50, 47, 47, 79,227, 15,217,254,229, 47,233,148, 82,231,214,234,222,240,240,195, 19, 85,121,121,121,154,148,148, 20, 18,
- 64, 63, 30,181,109,219,182, 93, 35, 71,142,196,188,121,243,104, 86, 86,214, 24,189, 94,159,239,207,111,243,162, 52, 98,218, 16,
- 41,212,243,212, 85, 47,124,177,248,219,183,166,191,245, 8,119,110,237,218,204, 38,127,227,172, 89,179, 40, 0,132,134, 54,190,
-181, 65, 93, 93, 29, 0, 96,206,156, 57, 1, 61,159, 83,135, 84,200,207, 60,130,228,244, 76,154,158,158, 46,212, 63,224, 1,174,
- 56,144,123,141, 0,177,143, 1,239,181,110, 54,143,122,218,183, 10,205, 34, 4,119,242,223,184,113, 35,153, 58,117, 42,117,147,
-235,247,253,114, 10, 5, 71, 52,245, 27,126,248,175, 80,100, 71,251,241, 95,147,125, 94, 81,247,240, 95,249,139,243,115, 95,155,
-198, 8,200, 79,175, 12,169,169,169,249,170, 87,175, 94, 83, 0, 48,148, 82, 40, 20, 10,148,149,149,161,186,186, 26,145,145,145,
- 40, 43, 43,219,253,253,247,223,171, 30,124,240, 65,191,148,147,252,252,124,202,109,204, 66, 8,193,148, 41, 83,144,156,156,172,
- 34,132,240,150,147,155,187,217,245, 62, 37,101,146,207,207,190, 96, 58,240,212, 31,205, 61,100, 85,131,207,158,199, 20, 67,124,
-111,170,196,109, 39,236,142,189,123,247, 98,233,210,165,215, 61,139, 47,190,248,130,242,108, 55,101,118,118,182, 6,175,146,122,
-130, 77,187,126,226,126,149, 52,219, 66,188,141,231,150, 6,150,118, 70, 70,134,138, 82,138,245,235,215,211,253,251,247,163, 79,
-159, 62, 62,191,123,160,145,154,140,155,178, 23, 33, 47, 47, 79,195,178, 44, 50, 51, 51,225,107, 91,101, 66,136,146, 82,234,234,
-175,223,126,251,109, 8, 33, 4,211,167, 79, 47, 5, 16, 55, 99,198,140,157,107,214,172, 97,252,177,216,223,221,249,174,235,253,
-181,237, 87, 65, 8, 65,214,179, 33, 0, 8,222,153,245,246, 35, 45, 91,182, 4, 0,124,249,105, 22,230,141,156,199, 75,230,128,
- 1, 3,208,165, 75,151,160,180,123,102,102, 38,147,158,158,206,126,244,209, 71,244,167,159,126, 66,233,233, 78, 64, 69,148,192,
-234,126,146,191, 39,152,166, 38,242,236,236,108,100,102,102, 82,111, 19,104, 32, 59, 67, 53,215, 66,247, 37,207,205,202, 14,216,
- 40,220,184,113, 35,217,184,113, 35,225,148, 0, 0,170,230, 40, 20,132, 16,164,165,165,129, 82, 74,220,126,155,223,138, 10,153,
-170,115,189,248, 28,247,133,176,173,171, 93, 47, 62,199,253, 33,127, 74, 41,184,221,217,124,237,210,230,173, 79,234,116,186,207,
- 34, 35, 35,167, 0, 96,230,206,157,139,153, 51,103, 66, 42,149, 66,161, 80, 64, 46,151,131, 16, 2,145, 72,132,154,154, 26,222,
-237,152,147,147,163, 84,171,213, 52, 39, 39, 7,110,207, 4, 95,127,253, 53,230,205,155,167,201,201,201, 81,222,142, 3,215,155,
- 66,112, 43, 60,107,217,217,217,154,140,140, 12,242,216,169,169, 94, 45,124,181, 90, 77,167,158, 76, 83,121,243, 12,248,194,188,
-121,243,232,243,207, 63,143,206,157, 59, 7,229,247,206,155, 55,143,170,213, 81,136,137,217, 21,212,118,216,188,121,243,232,252,
-252,252,221,125,251,246, 37, 31,126,248,161,150, 35,255,230, 96, 83,246, 34,172, 88,177, 2, 44,203, 98,209,162, 69,224, 35,211,
-157,252, 1, 96,219,182,109, 91,234, 93,225, 81,211,167, 79,183,143, 28, 57, 18,106,181,154,229,107,180,120,142,209,149, 43, 87,
-226,177, 7,156,182, 97,214,179, 10, 76, 27, 34,197, 11,227,158,231,125, 79,161,161,161, 24, 49, 98, 4,210,211,211, 73,114,114,
-178,215, 23,119, 13, 95,101, 47, 61, 61,157, 5,156,219,172, 3, 64, 68, 72,133,192,234,205, 36,255, 38, 21, 0,142,172, 10, 11,
- 11, 93,101, 39,221,173, 39,127,137,214,101, 65, 4,121, 82,242,162, 12,168,130,217,120, 27, 55,110,212, 4, 65,134, 75,161, 72,
- 75, 75, 83,113,109,120, 55,193,157,252, 1,160,184,184,216,117,238,202,149, 43,188, 21,198,154,154,154, 55,141, 70,227, 44,134,
- 97,152, 25, 51,102,160,166,166, 6, 37, 37, 37,144, 72, 36, 16,139,197, 16,139,197,144, 72, 36, 80, 40, 20, 48,153, 76, 94, 75,
-162,122,153,224,148, 59,119,238,212, 16, 66,144,154,154,138, 53,107,214,144,228,228,100,146,145,145, 65, 82, 83, 83,185,254,163,
- 17,166,138,166,201,191,190, 45, 85,220, 36,238,254,236,211,210,210, 84,201,201,201, 90, 32,176,146,180,201,201,201,100,205,154,
- 53, 36, 59, 59, 27,148,210,160, 40, 99, 47,189,244, 18,178,179,179,121,245, 17, 95,248,230,155,111,198, 28, 58,116, 40,191, 83,
-167, 78, 48, 24, 12, 52, 52, 52,148,238,219,183, 15,128, 43,201, 50, 32,242, 95,190,124, 57, 8, 33, 96, 24, 6,135, 14, 29, 2,
- 39,211, 15,143,196, 35,132, 16, 76,155, 54,205, 94,127,200, 58,125,250,116,189, 82,169,196,188,121,243,216,111,191,253,214,231,
-189,187,135,194,174,109,191, 10, 16, 96,253, 51,127, 84, 45,206,122, 54, 4,211,135,202,176,248,193, 23,120,255, 46, 62,150, 63,
-159,107,246,238,221, 75, 51, 51, 51, 93,175, 67,135, 14,193,112,105, 0, 96, 53,129,132,217,145,255,250, 73,184,159,231, 94,194,
-200,109, 72,254,233,139,223,242,122, 94,220,212,128, 44, 42, 42,162,133,133,133,200,206,206, 6,247,158,115,237,248, 51,200,111,
- 52,249,187, 91,213,220, 36,116,187,194, 61, 36,112,183,129, 82,138,226,226, 98, 92,187,118,205,117,204,243,179, 15,136,126,252,
-241,199,241, 9, 9, 9, 16,137, 68, 56,123,246, 44, 40,165,248,253,247,223, 97,181, 90, 65, 8,129, 88, 44, 6, 33, 4, 14,135,
- 3, 70,163, 17,155, 54,109, 66,114,114,211, 97,143, 93,187,118,105, 0, 32, 53, 53,245,186,126, 91,255,153,114, 68,193,167, 95,
-123,186,245,125,125,230, 99,229,115,104, 44, 28,192,199,245,239,101,242,108,118,146,148, 43,230,239,166,192,113, 10, 44, 23,243,
-207,119, 35,255, 64,172,117, 78, 9,227,200,104,215,174, 93,154, 64,195, 0,156,188,110,221,186, 93, 71,110,129, 96,245,234,213,
- 56,121,242, 36,141,141,141, 69,187,118,237, 92,219, 62, 95,184,112, 1, 34,145, 8,255,249,207,127, 2,250, 7, 35,135, 58,183,
- 47, 99, 89, 22,127,251,219,223,176,114,229, 74,236,219,183, 15,132, 16, 60,156,242, 23, 92,188,192,111, 3,199,109,219,182,109,
-174,127,198,102, 56, 87,200,176, 0, 48,125,250,244,106, 0, 45,242,242,242, 64, 8,225,173, 80, 57,173,255,235,247, 49,113,134,
- 3,128, 47,179, 14, 35,183, 38,247,166,121,203, 78,157, 58,133, 67,135, 14, 53, 56,230,168, 62, 15,187,141, 5, 72, 45, 90, 60,
-104,195, 33,143,205,174,147,146,146, 4,230,231, 65,254, 77, 42, 0,245,110, 23,194, 89,253, 28,249,123,141,253,249, 65,214, 77,
- 89,130,124,226,196,190,228,121,158,191, 85, 59, 82, 77,157, 58,213, 61,214, 76,189,157,231, 60, 3,205, 34,221,141,193,141,131,
- 25, 38,206, 15,200,242,111,108,178,141,143,143,191,238,218, 38,158, 73,139,232,232,232, 94, 22,139, 5, 85, 85, 85, 56,112,224,
- 0, 68, 34, 17,172, 86, 43, 76, 38, 19, 88,150,117,237, 74,105,179,217, 96,177, 88,120,133, 24,184,231,208, 88,191, 77, 78, 78,
- 38, 57, 57, 57, 52, 59, 59,219,167, 50,225,180,186,110, 76, 14,128, 98,200,170,235,136,158,251, 28,136, 34, 48, 98,196,136,230,
- 43, 1, 30, 49,255,252,252,124,165,139,236,255,136,249, 7,148, 35,227,161,132, 1,112,238,182,168, 86,171, 41,159,231,192,215,
- 11, 80,159,251,224,119,110, 1,183,179, 99,187,118,237, 16, 17, 17, 65, 60,149,221, 94,189,122, 5,108,249, 83, 74, 97,183,219,
- 93,199,134, 13, 27,134,125,251,246, 97,207, 15, 14,188,187,140, 95,140, 61, 55, 55,119, 92,125,236,255, 4,128,150, 0,220, 55,
- 27, 42, 1,208, 2, 0,242,242,242, 52,125,251,246,245, 41,175, 97,236,223,139,167,160,254, 47, 95,121,193, 64,122,122, 58, 73,
- 74, 74,162,154,207, 98, 97,175,254, 21,132,173, 6, 28,206,157, 86, 25,145, 29,250,125, 12, 36, 82, 49, 44,142, 22, 56,120,161,
- 47, 94, 89,174,195,161, 67,135,136,183,101,213, 2,252, 84, 0, 60, 61, 1,254, 90,254, 69, 69, 69, 52,152,238,110, 95,242,234,
-195, 18, 65,243, 52,100,102,102,146,244,244,244,128,190,235,249, 59, 51, 50, 50, 12,106,181, 58,172,177,243,129,194, 61,246, 31,
- 12,101,192, 61,246,207, 87, 25,152, 57,115, 38, 66, 67, 67, 17, 22, 22,134,240,240,112, 68, 70, 70,178, 81, 81, 81, 76, 94, 94,
- 30, 30,127,252,113,215,117,114,185, 28, 99,199,142,133, 90,173,166,141,236, 86, 21, 99,181, 90, 81, 85, 85, 5,179,217,140,200,
-200, 72,200,100, 50,216,237,118, 80, 74,225,112, 56, 96,181, 90, 97,179,217,224,112, 56,252,202, 47,240, 21,178, 74, 77, 77,197,
-237, 16,154,241,149, 16,232, 47, 56, 37, 32,224,254,245,175,198,219,110,234,201,180,250,188,155,192,100,123, 90,255,238,138,100,
- 32,201,128,158,214,127, 83,138, 41, 95,242, 23,137, 68, 52, 34, 34, 2,112, 38,212, 17, 0,212,102,179,161,166,166, 6,173, 90,
-181, 10,232,190, 57, 99, 74, 44, 22, 99,193,130, 5, 56,116,232, 16,254,136,251,243,239,211,223,127,255,253,247,195,135, 15, 7,
-128,112, 56,195,185, 70, 0,216,176, 97, 67,171, 61,123,246, 68, 80, 74, 93,202, 54,159,117,226, 43,223, 95,137,105,131,175,183,
-254,103,254,219,136, 13, 7,108,160,148,162,223,140,126,152, 55,114, 30, 9,116,221,121,160, 74,128,106,118, 38,253,126,101, 71,
-136, 13,122,192,238,252,215, 44, 0,169, 24, 40,190,214, 2,187, 47, 13,112,100,126, 89, 46, 58,116,232, 16, 73, 74, 74,146,227,
-127, 28,124,172,127,128, 71, 37,192,252,252,124,151,235,223, 61, 31,128, 15,186,116,233, 66,210,210,210,130, 22,147,231, 33, 47,
-224,248,250,212,169, 83,169,231, 43, 63, 63,159,229, 86, 5,184,173, 8, 8,180, 19,135,221,205, 29, 46, 51, 51, 19,203,151, 47,
-111,208,175, 56,242, 79, 73, 73, 65, 74, 74, 10, 0, 96,207,158, 61, 77,137,137, 46, 42, 42, 50, 59, 28, 14,232,116, 58, 84, 84,
- 84, 64,167,211,193,104, 52,194,104, 52,194, 96, 48, 64,175,215,163,166,166, 6, 38,147, 9, 22,139,197,149, 20,212, 36,137, 17,
-130,156,156, 28,191, 20,182, 59, 25,123,247,238,109,240,114,199,169, 83,167,148,238,159,249,196,156, 61, 99,254,158,150,123,115,
-178,246,189,125,119,205,154, 53, 36, 39, 39, 39,168,185, 0, 57, 57, 57,188,231, 46,142,252, 25,134,161,245,253,203,229,250,103,
- 89, 22,165,165,165,232,214,173, 27,153, 63,127,190,223,191,229,229,197, 35,177,103,207, 30,176, 95,181, 0,165, 20, 43, 86,172,
-112, 61,163,189, 7,120,231,237, 33, 55, 55,119, 18, 0, 76,159, 62,189,184, 94, 1,176,124,249,229,250, 86,243,231,207,111,181,
-103,207, 30, 60,244,208, 67, 99,252, 89,166,120,109,251, 85, 16, 16,172,119,179,254,103,188,111,132,104, 90, 13,190, 60, 96,197,
-115,207, 61,135,101,223,191,125, 43,230, 21, 17,167, 4, 60,248,156, 29,212, 20, 9,232, 1,232, 1, 81, 45,160, 47, 5,182, 29,
-110,131,204, 47,203, 69,245,222, 2,113,122,122,186, 89, 32,127,223,228,239,211, 3,144,153,153,217, 32,238,239,158, 15,192,119,
-237,101,189,187, 80,197,185,229,155,235,146,247, 38,143,115,251, 39, 39, 39,107,131,181,132, 40, 57, 57,249,183,252,252,252, 94,
-183,227, 3,230,172,254, 96,185,255, 57,171,223, 95,247, 63,135,245,235,215,187,222,255,243,159,255,196, 39,159,124, 2, 0, 86,
- 0, 82,142,248, 1, 96,236,216,177,190, 20, 0, 83, 66, 66, 2,140, 70, 35,172, 86, 43,202,203,203, 33,147,201, 32, 22,139, 93,
- 30,128,186,186, 58, 24,141, 70, 88, 44, 22,212,212,212, 96,202,148, 41, 62, 21, 76,206,186,111,106, 89, 43,119, 29, 31,220,200,
- 28,128, 64,206,123,130, 91,238,231, 13, 43, 86,172,208, 44, 88,176, 64,213,189,123,119,237,173,236,195,141, 89,255,238,240, 39,
- 23,160, 49,235, 63, 80,203,159, 97, 24,202,178, 44, 1,240, 15,174,107, 59, 28,142, 87, 67, 67, 67, 17, 31, 31, 31,208, 28,243,
-202,139, 35,161,213,106, 65,114, 98, 0, 0, 59, 94, 9,199,216,215,107, 49, 98,196, 8,188,177,108,143, 95,133,169,182,109,219,
-182,105,228,200,145, 0, 80,190, 97, 67, 86,187, 61,123,246,181,160,132, 98,252, 67,227, 83, 82, 82, 82,182,248, 51,157, 0,206,
-216,255,180, 33,146,134, 22, 63, 40, 22, 60,183, 0,113, 99, 91,223,178,130, 89,233,233,233, 13, 52,124, 90, 11,200,172, 0, 75,
- 9,236, 14, 10, 25, 5,226, 20,140,251,245,118, 8,112,242,247,178, 23, 27, 85, 16, 56, 15,172,152,143,229, 63, 96,192,128,235,
-242, 1,252,113,209,121,146,118, 16,200,217, 83,158,230, 6,116,188, 94,249,249,249, 65,147,119,183, 38,254,113,133,101, 56, 55,
-113,118,118, 54,158,120,226, 9, 0,144,114,215,184,159,171,159,180, 26,195,241,193,131, 7, 63,174,213,106,179, 29, 14, 7,244,
-122, 61,108, 54,155, 43,238,111, 54,155, 93, 75, 12,185,196,192,177, 99,199,106,121,244, 23,146,157,157, 77,235,189, 0, 13,250,
-109,126,126, 62,119, 28,201,201,201,188,188, 85, 55, 59, 7,192, 51, 44,224,235,121, 52,117, 94,173, 86,211, 21, 43, 86,104, 30,
-123,236, 49,124,245,213, 87, 1, 61,115,207,229,183,220,231,141, 27, 55,106,210,139,213,152,234,195,210, 30, 55,110, 28, 61,127,
-254, 60,190,255,254,251, 70,219,251,252,249,243, 0,128,237,219,183,251,252, 61,105,105,217, 52, 45,109, 52,198,140, 41, 66, 81,
- 81,145,215,236,242,202,202,209, 0,116, 80,171, 27,159,183, 56,242,183, 90,173, 84, 42,149,114,215,252,163, 94, 33,120,245,226,
-197,139,232,216,177, 99, 64,150, 63,195, 16,167,194,206,145,255, 81, 59, 62,209, 88, 1, 0,111, 44,219,227,247, 28,193,141,137,
-249,243,231, 39, 82, 74, 49, 97,226,132, 41, 15, 79,124,248,155, 64,166,166, 73,143, 62,114,130, 16,114, 31,165,128,104, 90, 13,
- 40,165, 88,176,112, 1, 90,143,109,243, 71,224, 35,112,112,236, 76,209,140, 74,130,153,153,153,116,227,139,109, 17, 86,121, 30,
-231,244,241,232, 44, 43, 7, 66,227, 32,174, 43, 69, 68, 93, 37,128, 86, 46,143,129,167,210, 32, 32, 0, 15,128,251,114, 63, 15,
- 87, 31,205,206,206, 6,223,132, 41, 79,210, 14,214, 15,119,151, 23,132,245,255, 2,154, 9,119, 23,186, 59, 9,113,245, 36, 60,
-207, 53, 18, 67,180, 3,248,122,228,200,145, 79,231,229,229,125, 96,183,219, 81, 93, 93,237,202, 1, 0,128,242,242,114, 84, 87,
- 87,131, 82, 10,127,194, 75, 99,198,140, 81,237,220,185, 83,147,157,157,141,156,156, 28,234, 25,243, 31, 51,102,140, 95,197,128,
-110, 4, 76, 7,158,242,155,240,189, 17,124, 83, 74, 64, 70, 70, 6,153, 55,111, 30, 13,132,252, 27, 36, 0,186, 61,119,183,164,
- 64,127,189, 0,141, 42,238, 23, 46, 92,112, 41,104,124, 13, 13,247, 80,229,245,247,205,111,174,170,169,169,161,145,145,145,238,
-228,255,170,197, 98, 65, 73, 73, 9, 58,119,238, 28, 16,249,171,213,106,202,126, 21,133, 29, 71,157,198,233, 58,141, 21, 27, 14,
- 88, 65, 41,197,190, 31, 3,143, 44,238,221,187, 23, 15, 61,244,144, 42,208,242,193, 28, 65,179, 44, 43, 1,128,175,126,180,225,
-185,231,158, 67,235,113,109, 60,252, 3,254,129,171,242, 55, 98,196, 8, 10,120, 95,238,231, 86, 9,144,247,243,237,200,212, 1,
-177,137,120,124,109, 13,128, 56,103, 27, 60,217, 18, 29,196,151,241,122,114, 25, 62,213,104,132,170,128,104, 88,233,207,211,242,
-247, 60, 47,110,106,162,200,204,204,164,222,150, 77,249, 19, 2,240, 66,218, 65,131,135,188,160,174,255,247, 40, 7,236, 55,210,
-210,210,192, 35, 97,145, 55, 26,115,247, 7, 26, 6,104,204,221, 31, 72, 24,192,189,188,172, 39,249, 52,117,174,177, 91, 37,132,
-172,154, 48, 97,194,154,245,235,215,219,164, 82, 41, 44, 22, 11,236,118, 59, 88,150, 69,139, 22, 45,160,211,233,144,230,231,210,
-179,212,212, 84,109,106,106, 42,217,185,115, 39,205,201,201, 65,118,118, 54,184,186, 0,183,115,229,185, 96, 99,247,238,221,116,
-194,132, 9,216,186,117,107,179,201,223,147,228,242,157, 10,153, 79,111,220,243,207, 63,127,157,113,225,137, 23, 94,120,129,242,
- 77,242, 84,171,163,124,202, 83,171,249,197,255, 21, 10, 87,233, 75, 74, 41,133,209,104, 68, 73, 73, 73,192, 49,255, 6,158,143,
-215,107, 27,124,110, 14,249,127,248,225,135,193,234,179,108,238,183, 91,186,185, 87, 2, 12, 22,154, 82,200,214,173, 91,231,151,
-245,175, 78,237, 90,242,241,105,180,205,200, 57, 7,119,238, 25,241,159, 76,186,123,222,189, 56, 83,170,192,153, 51,103,160, 82,
-169, 32, 32, 8, 30, 0, 0,104,140,228,111, 71, 45,235,118, 91,255, 31,140, 37,126,127, 40, 34,201, 65,251, 93, 83,167, 78, 85,
-249, 91,222,215, 7, 49, 80,119,133,198, 91,162,149,231, 57,158,132,107,159, 57,115, 38,217,177, 99,135,242,210,165, 75, 26,147,
-201, 4,135,195,129,251,238,187, 79,149,148,148, 20,240,243, 30, 51,102, 12, 25, 51,102, 12, 55,195, 7, 20,154,185,209, 57, 0,
-190, 62,243,177, 56,235,179,195, 27, 18,142,159, 69,102,184, 54,194,171,132,230, 35,237, 58,123, 48, 61, 61,157,166, 23,171, 65,
- 26, 22, 2, 34, 0,112,230,204, 25,218,196, 88,245,217,232,163, 71,143, 38,126,140,125, 18,140,107, 0,160,170,170, 10, 10,133,
-130, 18, 66,208,177, 99, 71, 16, 66, 72,183,110,221,208, 92,242,103, 30,211,129, 16,130,148, 71,156,171,138, 8, 33,174,229,126,
-156, 59,255, 22,129, 29, 48,171,127, 80, 5,206,153, 51,135, 83,254,195,234,189,122,118, 56,221,255,172,219, 53,126,221,112, 70,
-206,185,182,238,220,195,185,250,211,211,211,137,122,195, 61,135,103, 0, 0, 32, 0, 73, 68, 65, 84,151,134,158, 57,115, 70, 96,
-243, 96, 43, 0,119, 10,130,177,214, 63, 88,132,125, 3, 20,155,160,254,174, 96,111,236,115,163,173,231,250, 24,191,215,255, 97,
-181, 90, 33, 18,137, 32, 18,137,110, 98, 95, 91, 77,110,111,121,141,143,133, 89,179,102,249, 47,240,213, 63,246,177,200,206,206,
-110, 48,105,167, 23,171,221, 45,111,237,221, 48,151,180,110,221,154,252, 49, 86,156,201,182,205, 37,127,231, 51,105,106, 43,160,
-235,177,122,245, 79, 55, 77, 35,152, 55,114, 30,185,217,115,130,159,243, 70, 40,156, 57, 69, 54, 55,229,211, 21,231, 87,169, 84,
- 68,176,252,125,195, 91,104,128, 36, 38, 38, 10, 5, 19, 4, 8, 16, 32, 64,128,128,255, 49, 48, 66, 19, 8, 16, 32, 64,128, 0,
- 1,130, 2, 32, 64,128, 0, 1, 2, 4, 8, 16, 20, 0, 1, 2, 4, 8, 16, 32, 64,128,160, 0, 8, 16, 32, 64,128, 0, 1, 2,
-238, 10, 52, 88, 5, 48,127,254,252,128,179, 65,189, 21,118, 17,228, 9,242, 4,121, 55, 79,222,146, 37, 75, 26,106,247, 12,227,
- 90,230,232,190,212,140,171,166,232,190,244,204, 91,249,224,176,176, 48,200,229,114,215,247, 25,134,113,173,184,112,151,199,109,
-204,196,178,206, 85, 94,220,102, 57,194,243,245, 71, 30, 81,138,196, 50, 80,214, 14,150,181,107, 3,145, 71, 41, 85, 29, 57,114,
- 68,156,152,152,152, 15,143,170,123, 1,202, 83, 30, 57,114, 4,137,137,137, 90, 97,188,221,121,242,252, 86, 0,254, 23,241,242,
-203, 5, 13, 26,238,141, 55, 6,146,219, 74, 94,193,203, 20, 0,222, 24,248, 6,113,127, 31,168, 60,174, 82,156, 90,173, 70, 70,
- 70, 70, 83,215, 53,121,222, 93, 30,220,150,233,113,223,113,255,190, 90,173,118,157,227, 43,247,127, 17,140,181, 78, 89,254,219,
- 1,140,136, 42,215,180,179, 95,198,105,218, 25,135,234,162, 85, 17, 9,131, 32, 13, 13,215,250,250,254,254,253,251, 49,108,216,
- 48, 23,241,115,132, 77, 8,185,142,176, 89,150,117,189, 46, 94,188,232, 85,222, 47,191,252,130, 1, 3, 6, 64,161, 80, 64, 44,
- 22, 67, 36, 18, 53,144,201,145,190,195,225,112,189, 44, 22, 11, 10, 11, 11,113,207, 61,247,220,141,143,136, 56,121,145, 42,127,
-255,253,119,156, 57,115, 70,211,162, 69, 11, 12, 31, 62,188, 89, 99,156, 16, 70, 41,147, 71,163, 69,212,189,154, 58, 67,177,202,
- 80,123, 89,233,175, 12,150,101,149, 57, 57, 57,187, 79,159, 62,141,173, 91,183, 66,161, 80, 96,209,162, 69, 34,184,173,189, 15,
- 64,158,166,232,220, 89,236,220,177, 29, 82,153, 12,207, 61,183, 96, 20,165, 84, 35,140,212,187,212, 3,112, 39, 33, 39, 39,199,
-167,198,147,154,154,234,115, 96,114, 4,237, 73,220,129, 34,216,242,130, 13,183,202,124,188, 38, 45, 62,165,101,249,202,171, 87,
- 4,154, 85, 93,156,171, 42,232,254,255,239,248, 81, 72,169,242,196,254, 29,136, 56,255,163,198,104,180,192, 54,136,129, 34,158,
-160,219,165,163,184, 63,156,106,116,229, 63,227,215,144,217,170, 10,210,174, 73, 37,224,196,137, 19, 16,137, 68, 24, 62,124, 56,
-196, 98,177,235,197, 41, 4,156,213,111,183,219,225,112, 56, 96,179,217,112,241,226, 69,236,222,189,219,171, 60,163,209,136,195,
-135, 15, 99,240,224,193,144, 74,165,144, 72, 36, 13,100,178, 44, 11,187,221, 14,187,221, 14,155,205, 6,147,201,132,195,135, 15,
-195, 96, 48,220, 22,250, 84,125, 63, 99,240, 71, 33,154,128, 57,122,201,146, 37,172,199,220,130,218,218, 90,196,196,196, 4,180,
- 0,125,201,146, 37, 13,126,207,231, 89,133, 80, 40, 90, 65, 36,146,106, 12,181,151,253,150, 89, 80, 80, 0,131,193,128,193,131,
- 7, 95, 76, 78, 78,110, 83, 89, 89,137, 29, 59,118, 56,162,163,163,145,148,148,212,228, 24,153, 51,110,244,117,109,115,236,212,
- 41,104,195, 67,176,112,197,191, 46,247,235,223,171,253,213, 43,101,216,145,167,221,221,169, 87,191,100,189,190,102,151, 64,157,
-183, 63,184,210,191,238,240,172, 5, 32,110,106,146,229, 38, 87, 95,159,111, 5,249,255,245,175,127,109,242, 26,157, 78,135, 47,
-191,252,146,242, 81, 2, 56,178,110,174,181,126, 35,228,185, 91,254,205,181,254,221, 72,152, 0,160,106,181,218,231,198, 49, 60,
-201,154,112,196,206, 89,251,238,150,191, 59,213,241,237, 51,110,158, 10,234, 94, 78, 24, 0,170,170,156,149, 17,163,163,243,239,
-138,129,122,225,167,124,220,115, 89,163,185,108,100, 49,249, 30, 17,238,141,181,131,141,166,144, 68,139, 80, 91, 41,133,162,214,
-132, 30, 71, 86,105, 10, 19,230,169,140, 33, 29,181,141, 91,146, 4, 39, 79,158,132, 84, 42,197,168, 81,163, 92,164, 45,145, 72,
-192, 48, 12, 40,165,176,217,108,176,219,237,176, 88, 44,184,124,249, 50, 52, 26, 77,163, 91, 42, 51, 12, 3,155,205,134, 35, 71,
-142, 96,248,240,225, 80, 40, 20,144,201,100, 46,121,156, 2, 96,177, 88, 96, 48, 24,112,236,216, 49,152,205,102,191, 10, 51,105,
-181, 90,165, 72, 36,210,212,214,214, 66, 42,149,162,172,172,236,169,201,147, 39,215,202,229,242,207, 3, 33,109,173, 86, 59, 85,
- 36, 18,125,229, 38,239,244,228,201,147,127,151,203,229,169,112,238, 80,233,183, 37,252,202, 43,175,104,150, 46, 93, 90,134,250,
- 29,103,150, 44, 89,130, 19, 39, 78,160, 85,171, 86,141,214, 93,247, 69,254, 31,207,157,139,241,253,250, 1, 0, 90, 63,253, 52,
- 20, 33,113, 48,232, 47, 65, 95,115, 78, 69,169, 67,235,175,204, 62,125,250,160,172,172, 12,251,247,239,239,200, 48, 12,142, 29,
- 59,134,232,232,104,236,221,187, 23, 86,171,213,103, 59, 86,190,185,176,193,231, 48,171, 13,109,237,102, 60,247,252,171,237, 87,
-188,251, 79,188,243,238,135,104,199, 56,240,225,187,203,243, 71, 77,155, 33,176,235, 29, 72,254,220,113, 94,123, 1, 0,215,215,
-255,246,245,249,102, 34,152, 59,245,221, 9,112, 87, 2,154,233, 1,224, 8,150, 0,160,159, 60,250,153, 87, 66,126, 98,211,108,
-222,100, 93,239,218, 39, 94, 38,108,247,239,187, 20, 4, 62, 33, 0,238,127,123,254,245,244, 0,220,233, 48, 87, 87, 40, 71, 88,
- 14,107,202, 68, 14,220, 19, 9,116,236, 64, 33,234, 35,133,184, 75, 23, 72, 45,102, 88,126,184, 12, 75,141, 24, 34, 86, 2,115,
-254,231, 26,102,252,179, 42, 86,236, 61, 28,192,185,231,207,158, 61,139,168,168, 40,168, 84, 42,200,229,114, 72,165, 82,136,197,
- 98,151,213,111, 54,155, 81, 82, 82,130, 61,123,246,128, 97, 24, 48, 12,131,166,228, 57, 28, 14, 28, 63,126, 28,195,134, 13, 67,
- 68, 68, 4,228,114, 57, 68, 34, 17,236,118, 59,172, 86, 43,244,122, 61,126,254,249,103, 88, 44, 22,136,197, 98, 87, 46,128, 47,
-124,241,197, 23, 74,131,193,160, 57,127,254, 60,244,122, 61,164, 82, 41, 90,183,110,189,106,223,190,125, 24, 50,100,136, 56, 52,
- 52,244, 19,127,148,128, 47,190,248,226, 81,131,193,240,149,135,188,132,125,251,246, 37, 12, 25, 50,228,203,208,208,208, 84,190,
-242, 88,150, 85, 90,173, 86, 84, 85, 85,105,220, 60, 10, 0,128,165, 75,151, 22, 47, 89,178,164, 93,106,106,234, 40,185, 92,238,
-215,252,199,136,164, 74,207, 99,215, 62,248, 0,173, 39,197,227,157,119,222, 87,217,108,117, 1,205,167,251,247,239,215,252,244,
-211, 79,120,241,197, 23,245, 34,145, 40, 66, 46,151, 99,200,144, 33,208,104, 52,200,203,203, 67,187,118,237,252,240,119, 16,124,
-113,246, 42,190, 62, 83,140,220,111, 63,133, 72, 68,176,240,233,199,217,190,173, 91, 50,153,207,189,138,181,254,202, 19,112, 75,
-200,223, 83, 57,245,166, 20, 4,188, 10,224, 86,111,111,219,165, 75, 23,149,175,215,205,182,214,111,132,188, 96, 88,253,141,225,
-147, 71, 63, 35, 79,108,154, 77,189,145, 63,248,135, 8, 26, 88,250, 85, 85,201, 46, 11, 29,127,108, 1,234,183,219,191, 41,162,
-143,142,206, 15,200,250,183,219,237,202,159,127,254,153, 54,118,204,243, 92, 99,112,191,222,110,183, 43, 61,207,121, 30,107, 10,
- 85,199,127,209,148, 20,235,209, 42, 92,140, 46,225, 20,226,150, 44,196, 15, 60,136,208,190,159, 67,209,255, 61,200, 34, 21,144,
- 26, 76, 48, 26, 29,232, 32, 50, 98,239,250,198,149, 39,134, 97, 32, 22,139, 33,145, 72,112,230,204, 25, 28, 59,118, 12, 17, 17,
- 17,136,137,137, 65, 76, 76, 12, 90,182,108,137, 22, 45, 90,160,166,166, 6,123,247,238,133, 72, 36,114,197,246,189,129, 59, 47,
-149, 74,225,112, 56,112,250,244,105,132,132,132,160,101,203,150,104,213,170, 21, 98, 99, 99, 17, 22, 22,134,211,167, 79,195,102,
-179,185, 66, 4,141, 41, 20,158,150,127,105,105,169,230,220,185,115,232,220,185, 51,198,141, 27,135,129, 3, 7,194,104, 52, 98,
-247,238,221, 56,114,228,200, 71,102,179,153,119,237, 98,173, 86,171, 42, 45, 43,255,166,232,106, 13,194,239, 25,140,132,113,127,
- 66,187,129, 41,208, 89, 24,236,204,223,133, 35, 71,142, 76, 54,155,205,127,225, 75,254,122,189, 30, 71,143, 30,213,236,223,191,
- 31,125,250,244,193,146, 37, 75, 90,162, 62,158,190,100,201,146,118, 0,224, 15,249, 51, 34,169, 50, 52,172,173, 50, 58,166,151,
-102,253,134,163,152,251,241,199,200, 59,124, 24,121,135, 15,163,245,211, 79, 3, 0,108,182,186, 61,129,140,227,188,188, 60,154,
-155,155,139, 41, 83,166, 92, 12, 15, 15,103, 66, 66, 66, 10, 11, 10, 10,176,127,255,126, 84, 84, 84, 32, 33, 33,193, 47,121,239,
- 31, 62,131,119, 15,254,134,181,239,190,116, 84, 44, 50,129,113,212,226,237,149, 31, 51, 95,237, 45, 68, 9, 35,198,189,247,222,
- 43,176,236, 93, 2, 38, 80,130,191,133,155, 87,220, 24, 11,251,229, 2, 26,204,184,125,176,229,221, 72, 69,224,137, 77,179,169,
-251,171, 49,175,128, 47,175,194,117,228,214, 80, 25,240,215, 83, 65, 26, 59,238,233, 21,224,131,218,218, 90,229,174, 93,187, 52,
- 5, 5, 5,141, 30,115, 63,215, 20,220,175,223,181,107,151,166,182,182, 86,233,126,206,243, 88, 83,136, 48, 87, 34,239,146, 25,
-219,206,179,184,172, 35, 40, 45, 7, 24,113, 36, 24, 18, 3, 98,150,161,174,148,224,232, 37, 22,199, 46,153, 81, 89,107, 67,239,
-104,153,134,143, 2, 32,147,201,112,238,220, 57,156, 58,117, 10,209,209,209,136,138,138, 66, 84, 84, 20,140, 70, 35,246,239,223,
- 15,137, 68, 2,169, 84,218,228, 94, 10,156,119,128, 83, 2, 40,165, 40, 42, 42, 66,116,116, 52,226,227,227, 17, 27, 27,139,162,
-162, 34, 56, 28, 14,200,100, 50, 72,165,210, 6, 43, 15,188, 77, 43,220,155,242,242,114,205,149, 43, 87,208,179,103, 79, 60,248,
-224,131,152, 56,113,162,106,226,196,137,170,225,195,135,195,225,112,224,199, 31,127, 68, 81, 81,209, 96, 0,188,226, 9,229,229,
-229,187, 75,171,106, 16,221,181, 47, 18,146,231,160,231,132,249,232, 49, 97, 30, 58, 62,240, 40,172, 84,196,201,227,245,124,235,
-115, 31, 52,103,206,156,225,238, 85, 85, 79,252,204,146, 37, 75,176,116,233, 82, 44, 93,186,244,148,103, 94, 64, 99, 16,137,229,
-202,168,232, 30,154,214,237,134,105,162, 98,122,128, 48, 98,124,244,137, 6,115, 63,254, 24,115, 63,254, 24, 75,151, 46, 69,121,
-121, 57,248,202,243,176,252,233,150, 45, 91, 48,100,200, 16,244,239,223,191, 35, 0,249,174, 93,187, 6, 92,184,112, 1,199,143,
- 31,135,201,100,194,132, 9, 19, 70,241,149,151,245,251,101,188,247,243, 41,172,121,227,249,170,248,123, 59,246, 49, 26,116,200,
-250,102, 23,142, 30,251, 29,123,191,219,137,154,107,165,152, 48, 97,124, 50, 4,220,182, 72, 76, 76,108,212,250,231,149, 3,144,
-145,145, 65,242,243,243,149,124, 63,223,201, 8,166,165,126, 35,228, 1,193,115,255, 55,106,133,186,197,212,253, 37,127,206, 11,
-224,110,157, 7, 3,190,146, 15,253,129, 86,171, 85,150,148,148,104,184,205, 93, 26, 59, 22, 8,206,158, 61,139,202,202, 74, 77,
-219,182,109, 85, 74,165, 82,219,216,177, 70,137,171,226, 50, 14, 92, 53, 97, 66, 72, 8,246, 93,102,209,182,191, 12,157, 45,133,
-208,157,248, 43, 54,189,125, 20,236,133, 26, 24,172, 20,197,181, 14, 40,196, 12,236, 53,215, 16,217,132,210,238,174, 4,200,229,
-114, 92,188,120, 17,167, 78,157, 66,207,158, 61,161,211,233,112,240,224, 65, 87, 44,223, 87,188,158, 16,226,242, 2,112,242, 40,
-165,184,124,249, 50,122,247,238,141,252,252,124,176, 44, 11,185, 92, 14,137, 68,226, 90, 37,192,199, 3,112,233,210, 37,152,205,
-102, 12, 24, 48, 0,241,241,241, 42,145, 72,132,136,136, 8, 12, 26, 52, 72,117,240,224, 65,205,165, 75,151,160,215,235,143,129,
-167,203,254,210,165, 75, 96, 25, 41,218, 37, 38,163, 69,124, 2, 24,145, 4,138,136, 88,116, 24, 52, 1, 23, 15,230,162, 94,222,
- 5, 95,114, 40,165,202,234,234,106, 77,113,113, 49, 58,116,232,128,161, 67,135,170, 68, 34,145,118,216,176, 97,100,201,146, 37,
-116,240,224,193,246,250,121, 51, 33, 50, 50, 18,245, 10,138,163, 41,153,114,121, 12, 98, 98,251,194,106,169, 65, 69,229, 97, 88,
- 44,186,209, 54,155, 97, 32,128, 55, 7, 15, 30, 12, 0, 40,189,118, 13,245,242, 36,112,219,244,166, 41,252,242,203, 47,169,235,
-215,175,199,204,153, 51, 49,108,216, 48, 0, 96,119,236,216, 33,206,203,203,195,220,185,115,199,246,233,211,103,167, 63,125,249,
-180,222,136,197,123,126,197, 91,127, 83, 99,248,196,228,232, 58, 67, 5, 54,126,179, 7, 25, 31,125,141,109, 11,231,160, 75,217,
- 21, 44,211, 95, 67,116,116,140,144, 4,120,135,192,221,237,239, 45, 95,165,209, 28, 0,207,216,190,175,207,119, 35,130,189, 4,
- 47, 80,188,126,255,235, 42, 66,200,109,217,222, 30, 75,253, 26,228, 1,120, 42, 3,193, 92,254,199, 87, 57,200,205,205, 85,150,
-150,150,106,172, 86,107,147,199,154, 3,157, 78,135,186,186, 58,141, 94,175, 87,121, 59,150,146,146,210,232,179, 59, 82,101, 66,
-141,149,197,145,114, 59, 74,170,237,136, 59, 40, 70,159,141,103,113,241,194,113,252,254,147, 21,118,177, 8, 86, 22, 48, 91, 41,
-116,148, 69,108, 20,109,146,176,221,151,255,113, 25,251,165,165,165,232,216,177, 35, 46, 92,184,224,114,249,139,197, 98,215,245,
-254,134,243,220,107, 8,112,127,111, 80, 72,176, 26,205,203,222,191,206, 24,247,117, 1,203,178,168,171,171,115, 78,142, 98,177,
- 74, 36, 18,105, 61, 60, 73,226,220,220, 92,164,164,164, 48,139, 23, 47, 46, 93,182,108,153,125,241,226,197, 77,222, 60, 33, 78,
-133,200,100, 44,133,161,246,178,202,225, 48,107, 1,236, 5,240,102,109,109, 45,114,115,115, 93,202,228, 61,247,220, 99,245, 37,
-175,190,127,165,228,228,228,100, 79,152, 48,193, 69,254, 63,252,240, 3,179,121,243,102, 40,149,202,137,254,146,255, 85,163, 5,
-143,231, 29,196,115, 83, 39, 32,245,241, 41, 48,154,245,216,148,171,197,202, 15,179,240,217,216,251,209,165,236,138,192,166,119,
-129, 50,224,169, 4,220,148, 74,128,106,181,154,186,199,116,125,125, 22,112,221,196,126, 67,201, 63,208,152, 58, 71,252,158,217,
-254, 30,174,127, 82,255,242,122,109, 99,253,197, 87,191,224,219, 95, 82, 82, 82,180,221,186,117, 83, 69, 69, 69, 53,121,172, 57,
-136,138,138, 66,183,110,221, 26, 16,189,183, 99,222, 96,114, 68,192, 70,128, 67, 21, 22,148, 57, 28,216, 85,100,198,198,108, 51,
-118, 95,137,197, 89,105, 36,174,212,216,112,185,150, 69,157, 29, 48,218, 41,100, 49,173,125, 18, 51,183,190,223,225,112,192,110,
-183, 35, 38, 38, 6, 97, 97, 97,232,216,177, 35,108, 54,155,235,184,183,130, 64,158,242,184,245,253,118,187, 29, 38,147, 9,148,
- 82,180,111,223, 30,197,197,197,104,211,166, 13,196, 98, 49, 44, 22, 11,172, 86,171,235,255,242, 9, 15,118,232,208, 1,114,185,
- 28,133,133,133,184,114,229,138,198,225,112, 64,175,215,147,159,126,250, 73, 99, 48, 24,208,161, 67, 7, 68, 68, 68, 60,200,119,
-142,234,208,161, 3, 24,214,138,226,195,249,168,190,114, 26,172,195, 6,147,190, 28,151,126,250, 14,214, 58, 29, 39,175, 19, 31,
-229,134, 67, 76, 76,140,134,101, 89,151,167,115,233,210,165,228,248,241,227,168, 39,109, 22, 64,156,183,130, 71,158,176,219, 77,
-176,219, 12, 80,132,182,134, 92, 17, 13,128, 40, 1,216,151, 46, 93, 26,227, 38, 15,107,215,174,229, 10, 40,121,189,231,202,202,
- 74,250,217,103,159,209,140,140, 12,250,175,127,253,235,219,148,148, 20, 76,156, 56,145,243, 6,232,183,108,217,130,212,212,212,
-148,169, 83,167,126,199,167,205, 42, 43, 43,233,231,159,127, 78,167,253,245, 41,140,202,217,131,191,205,158,140,103, 94,152, 15,
-179,213,128,243,231, 46, 35, 35, 99, 35, 54, 63, 60, 4,202,246,173, 2, 30, 27,155, 55,111, 22,230,245, 91, 8,207,112,128,103,
- 34,224, 77, 45, 5,236, 25, 54,240,245,249,166, 89,250,141,196,234, 61,173,125,190,214,127, 99,242, 10, 94,126,153, 22,188,252,
-135, 59,223,243,179, 47, 79, 68,176,228,185,131,115,249,127,242,232,103, 36, 16,247,127, 70, 70,134,203,178,111, 44,222,207, 29,
-119,191,214, 23,124,229, 15,248, 19, 30, 80, 42,149,218,135, 31,126, 88,229, 94,156,198,219,177, 64,112,207, 61,247,224,225,135,
- 31,110,224,234,247,118,172,209,239,119,187, 7,221, 66, 69, 8, 39,128,141, 82,156,212, 89,177,254,172, 5, 95, 30, 40,193,207,
-231,170, 80, 98, 2, 42,205, 14,156, 51, 80, 92,181, 80, 24,172, 54, 85, 83,228,197, 45,205,179, 90,173, 48,153, 76,104,211,166,
- 13,122,245,234, 85,175,232, 69, 99,224,192,129, 46,194,230, 72,187, 49,194,230, 8,221,102,179,193,106,181,130, 16,130,174, 93,
-187,162,186,186, 26,151, 47, 95, 70, 85, 85, 21, 58,117,234, 4,134, 97, 96,181, 90, 97,177, 88, 92,223,241,133,216,216, 88, 85,
-124,124, 60,142, 31, 63,142,239,191,255, 30, 91,183,110,213,108,221,186,117,247,190,125,251, 32, 18,137,240,192, 3, 15,160, 75,
-151, 46, 38,240, 44,100, 19, 27, 27,155, 18, 23, 29,137,202,162, 95,241,251,206, 79,112,252,187,213, 56,249, 93, 6, 46,254,184,
- 25, 50,134,229,228, 21,251,146, 35, 22,139,181,113,113,113,170,136,136, 8, 28, 57,114, 4, 87,174, 92,209, 24,141, 70,165,187,
- 34, 80,239, 9, 96,214,175, 95,143,158, 61,123,250,252,109, 86, 75, 13,106,170,207, 66, 34, 9, 69,139,232,238,154,208,176,118,
-144, 72, 66,149,132, 48,131,185,107,194,171,243,161,249,236, 25,140,233,110,224,148,230,235,240,221,119,223, 65,161, 80,160,103,
-207,158,232,212,169, 19,234,195, 7,118,157, 78,103,200,201,201,105,145,152,152,152, 50,106,212,168, 45,124,251,110, 94,222,119,
-136,136, 8,195,136,145,131,140,137,253,251,224,209,191,206,133,145,216, 81, 94, 86,133,121, 79,191,134,101, 73,247,160,127,171,
-192,149,228,205,155, 55,211,183,223,126, 91, 80, 2,110, 19, 69,192, 27,110,155,189, 0,110,245,170,130, 64, 8,216, 95, 12,124,
-195,169, 64,184, 19, 53,119,236,102,201,115,183,194,159,216, 52, 27, 79,108,154,221,224,189,251, 49,190, 22,187,187, 39,193,155,
- 71,161,185,121, 1,238,158, 0,207,191,124, 17, 30, 30,174, 29, 61,122,180,106,224,192,129,141, 30,115, 63,215,100,187,187, 93,
- 63,122,244,104, 85,120,248, 31,203,242,188, 29,107,210, 58,148,133,170,122,183,105,137,161, 49, 50,220, 31, 37, 69, 91, 57, 3,
- 25,165,144, 91,236,232, 16, 38,134,142, 82,252,102,176,227,116,157, 29,237, 90,197,160,211,253, 35, 27,149,197, 89,253,220, 82,
-191, 14, 29, 58,160,111,223,190,208,233,116,168,174,174, 70,117,117, 53,194,195,195, 49,120,240, 96, 88,173, 86, 87, 77,128,198,
- 8,155, 83, 38,108, 54, 27, 8, 33, 72, 72, 72,128,201,100, 66,121,121, 57,202,202,202, 80, 94, 94,142,186,186, 58, 36, 36, 36,
- 64, 44, 22,187,228, 53, 86, 87,192, 83, 41,139,139,139, 83,117,237,218, 21,231,207,159,199,246,237,219, 81, 80, 80,128,144,144,
- 16,140, 26, 53, 10,125,251,246,253, 78, 46,151, 47, 4,207, 16,128, 82,169,220, 18,215, 42,118, 86,215, 54, 45, 96, 56,247, 19,
- 78,111,255, 8,197, 5,223, 34, 74,230, 64,242,232, 81,232,219,183,239, 28,185, 92,158,203, 71, 86, 68, 68, 4,250,247,239, 15,
- 74, 41, 14, 28, 56,128,194,194, 66, 77,113,113,177,166,170,170, 74,185,100,201, 18, 21, 87, 57, 49, 41, 41, 9,123,247,238,245,
- 41,143,101,109,218, 26,221, 89, 85, 85,249, 49,200,228,209,104,221,246, 1, 77,108,235,129,154,240,136, 78,223,189,243,238,191,
- 31,230,228,125,249,108, 8, 54,252, 96, 65, 99, 74,207,233,211,167,209,178,101, 75, 12, 27, 54,140,189,255,254,251, 97, 52, 26,
- 81, 87, 87,135, 85,171, 86,133,117,239,222,125,210,180,105,211,182,248, 51, 38,126,255,253, 52, 58,118,136,199,180,105, 41, 33,
-175,188,252, 28, 42,107,107, 80, 81, 89,129,244,103, 94,195,107,143,142,198,232, 14,113,205, 34,255,149, 43, 87,162, 87,175, 94,
-248,224,131, 15, 4, 37,224, 38,226,215, 95,127,109,180, 14,192,117, 10,239,237, 66,240,254,172, 42, 72, 77, 77, 37,193,170, 4,
-232, 11,158,133,120,130,161, 4, 4,131,252, 3,149,215, 88,169, 94, 79,203,220,159,146,189, 30, 74,130,171, 40, 80,115,238,203,
- 93,105,112,183,246, 3, 89, 1,224,110,221,221,127,255,253,164,177, 99,158,231, 26, 67, 83,215,243,149,193,225, 1,229, 40,109,
-145,152,194, 94,144,135, 11, 53, 64, 24,145,160, 99, 24,131, 98, 7,129, 72, 38,198,222, 50, 7,204, 44, 16, 43, 19,161,107,210,
- 8,200,187, 37,105,155, 82, 0,108, 54, 27, 68, 34, 17, 58,119,238,140,254,253,251, 67,175,215,195,108, 54,187,214,231, 91,173,
- 86, 68, 71, 71, 99,216,176, 97,216,178,101,139, 43, 36,224, 13, 14,135,195,149,213,223,163, 71, 15,212,187,233, 97, 54,155, 93,
-227,153,243, 36,244,232,209, 3, 85, 85, 85, 48, 24, 12, 77,141,229, 6, 39,102,205,154,165,213,106,181,163,122,246,236,185,219,
-173,112, 79,245,240,225,195,119,203,229,242,153, 0,204,254,180,229,172, 89,179,214,107,181, 90,125,207,158, 61,115,221,228, 85,
- 12, 31, 62,124,149, 92, 46,255,148,175, 28,134, 97,180,109,219,182, 85,141, 27, 55, 14,231,207,159,215,156, 58,117, 10,151, 46,
- 93, 66,120,120,184,166, 69,139, 22, 24, 51,102, 12,254,251,223,255, 34, 41, 41,137,247,111,179,219,141,218,106,221,239, 42,179,
-185, 10, 45,162, 18, 52, 97,225,237, 17, 30,209, 1,117,181,197, 91,222, 90,246, 17,166, 79, 75,198,151,207,134,120,109, 39, 14,
-227,199,143, 71, 94, 94, 30,174, 92,185,194, 84, 85, 85,193,108, 54, 99,239,222,189,226,122,165, 83,239,239,120,152, 48, 97, 60,
- 54,109,218, 2,125,117, 37,174,148, 92,197,179, 79,206,182, 62,255,226, 82,233,163,163,134, 96,152, 69, 15, 72, 2,163,135,205,
-155, 55,211,127,252,227, 31,174,114,208, 93,187,118,197,219,111,191,141, 23, 94,120,129, 78,154, 52,233,206,175,220,121,135, 42,
- 5,183, 76, 1,184, 17,171, 10,130, 65,238, 28, 42, 42, 62,194,203, 5,223, 54, 89,109,207,159,228,191,138,138,143, 80,240,242,
- 31,242,220,137,217,211,101,207,135,180, 43, 62,170, 64,193,183, 47, 7, 77, 94, 48,193,199, 67,192,237, 1,224, 79,127,249, 95,
- 26,156,157,134,168, 84, 71, 45,118, 77,249,238, 93,144,216, 77, 56, 90, 75,145, 95,107,135,148, 16,196, 80, 10, 85,155, 22,136,
-106, 29,171,138, 31,164,244, 97,105, 58, 61, 0,157, 58,117,194,192,129, 3, 97, 50,153, 96,179,217, 32,149, 74, 93,132,205, 89,
-233,177,177,177, 24, 58,116, 40,182,111,223,222,164, 7, 64, 44, 22,163,111,223,190, 32,132,192,104, 52,186,188, 11,156,210,206,
- 85, 23,100, 89, 22,189,123,247,198,193,131, 7,225, 79,114,165, 82,169,212,224,143, 60,145, 48, 56,171,237, 93, 2,207, 76,120,
-111,158, 0, 55, 89,209, 0,170, 0,248, 93,155,152, 97, 24,109,139, 22, 45,208,187,119,111,149, 68, 34,225,150, 63,106, 0,160,
-184,184, 24, 15, 61,244, 16,150, 47, 95,238,151, 76,135,195,162,173, 51, 20, 43,173,214, 26,149, 66,127, 65, 19,209,162, 43, 66,
-194,218, 34, 36,172, 45,118,236, 42, 5, 25,221,180,197, 61,100,200, 16, 34,149, 74,105, 85, 85, 21,198,143, 31,111,141,137,137,
-145,178, 44,139, 75,151, 46, 1, 1, 36, 75, 62,240,192, 16, 34,147,201,104,196,137, 66, 60,249,228,159, 16,159,208, 77,250,246,
-115,127, 98,215,125,248, 41,179, 74,100, 14,168, 47,111,222,188,153, 46, 94,188, 24, 45, 90,180, 64, 73, 73, 9, 20, 10, 5, 88,
-150, 69,104,104, 40,222,120,227, 13,188,252,242,203,130, 18,112,131,145,152,152,216,168, 23,128,215, 50,192, 27,129,219,121, 85,
- 65, 83,132, 19,136,245,223,152, 60, 79, 75,157,115,221,251, 34,237, 96,203,115,247, 4, 4,122,190, 41,175,130,231,230, 63,254,
-202,251, 95, 3,195, 48,218,196,209,227, 72, 85,157, 73, 25,105,183,104, 68, 23,139,112,143,237, 42,194, 99,226, 48,164,119,119,
-196,180,107,169,138, 76, 28,233,115,124, 80, 74,209,185,115,103, 12, 27, 54,204, 21,143, 23,137, 68,176, 88, 44,174,210,189,238,
- 97,130,246,237,219, 99,232,208,161,208,106,189,139, 86, 40, 20, 72, 76, 76,132, 88, 44,134,213,106,117,125,207,125,233,160,251,
- 70, 64, 12,195,160, 95,191,126, 40, 44, 44, 12,164, 25, 40,128,218,250, 87, 48, 96, 8,132,248,189,121,141,122,245,234,197,229,
- 81, 16,150,101,149, 70,163, 17, 22,139, 5,221,187,119,199,138, 21, 43,252,220, 28,135,106,109,214, 90,216,172, 6,149,201, 84,
- 14,153, 44, 10, 18,105,184,134, 97,196,248, 98,253,119,170, 89, 51, 39, 52, 41,175,190,174, 63,121,239,189,247, 88,147,201, 4,
- 0, 72, 72, 72,240,171,252,178, 59,250,247, 31, 64, 68,247,223,255,208,220,127,188,151,231,148, 71,153,132,132,123,145, 48,105,
-210, 44,177, 88,188, 62, 16,153,203,150, 45, 19, 6,245,109,162, 4, 52, 69,254, 55, 85, 1,184, 83, 17,204,101,127,158,196,220,
- 92,107, 61, 88,242,154, 99,113,187, 19, 59,247,222,195,101, 47,116, 34,158, 24,149, 50, 73, 91,111,189, 98, 68, 0,223, 79, 75,
- 75, 67, 84, 84,148, 43,195,159,101, 89,151, 11,159,243, 0,112, 73,127,220,142,128, 93,187,118, 5, 33, 4, 27, 54,108,184, 78,
-222,202,149, 43,145,157,157,237,186,214,225,112,248,220, 14, 88, 42,149, 34, 41, 41, 9,124,178,227,239, 84,101, 45, 44, 44, 12,
- 97, 97, 97,136,137,137,105,198,216,225, 20,129, 90, 48,140, 24,206,116, 44, 86,195, 83, 30, 93,180,104, 17,169,127,158,148, 97,
-152,102,205, 35, 14, 7,187,109,193,130, 5, 4, 0,195,178,172,131, 97, 24, 5,252, 12,191,112, 16,172,251,219, 75, 9,240, 5,
-146,152,152, 40, 36,103, 8, 16, 32, 64,128, 0, 1,255, 99, 96,132, 38, 16, 32, 64,128, 0, 1, 2, 4, 5, 64,128, 0, 1, 2,
- 4, 8, 16, 32, 40, 0, 2, 4, 8, 16, 32, 64,128, 0, 65, 1, 16, 32, 64,128, 0, 1, 2, 4,220, 21,104,176, 10, 96,254,252,
-249, 1,103,112,174, 94,189,250,186,100, 66, 65,158, 32, 79,144,119,247,201, 83,171,213,244,145, 73,106,124,187, 57, 3, 25, 25,
- 25, 12,188,172, 65, 23,218, 79,144,247,198, 27,111,184,174,121,249,229,151,137,208,126, 55, 87,158,223, 10, 0, 55,184, 27,187,
- 56,144, 37, 47,119,178,188, 64,100,222,238,247,235, 5, 82, 0, 17, 0, 66,234,251, 3, 11,160, 2, 65, 88, 67, 29, 76,112,237,
- 16,140,123,246,214,166,183,170,248, 80,109,237,255,111,239,202,195,154,184,214,247, 59, 73, 8, 1, 65, 22, 17, 17,149, 42, 32,
-138,184, 32,238, 90,149, 88,144,130,128, 91,209,254,106,123,107, 55,162,183,215,122, 91, 84,172,116,177, 11,173,120,181,155,183,
-173,161,183, 85,219,122,111, 43,181,130, 59,149, 26, 92,170, 86,197, 21,180, 42,224, 86, 65,169,202, 78, 66,150, 57,191, 63,194,
- 96, 8, 89,102,146, 32,216,206,251, 60, 60, 9, 39,147, 47, 51,231,204,156,247,253,190,115,206,119,106, 35, 15, 29, 58,164,216,
-183,111, 31, 0, 96,226,196,137, 24, 59,118, 44,235, 84,194,237,209, 14, 83,167,201, 16, 23, 27,161, 5,100, 34,153, 76, 70,255,
-213, 18, 55,241,176,142,244,244,116,146,144, 16,212,226,127,107, 34,128, 71, 59, 71, 0, 24,144, 77,173, 55,128,160,102,217,190,
-111,186,169, 14,194,158,221,255, 28,109,207,212,245,218,115,205, 29,253,122, 25,226, 47, 58,115, 96, 93, 81,209,233, 71,252,122,
- 4,117,171,174,214,192,195,195, 9, 55,111,148,208, 97, 97, 67,238,134, 13, 30, 63, 18,192,101, 46, 6, 79, 28,254,140,148,150,
- 92, 68,201, 21, 21,174,151, 19,244,234, 78, 33,168,183, 4,129, 65, 33,136, 24,243,247, 14,241,240,155, 18, 18,204, 94, 3,237,
- 65,100,103,207,158, 85,132,135,239,198,218,181, 13,200,207, 7,222,124,243, 39, 92,191,126, 93,225,231,231, 7,137, 68,130,178,
-178, 50,233,244,233,211,225, 8, 65,112,224,192, 1, 82, 93, 93, 45,141,142,142,134,179,179,179, 45,246, 4, 0, 16, 23, 27, 65,
- 39, 39, 39,139,128, 76,228,100,235, 31, 21, 56,118,219, 94, 30,127, 2,168,213,169,200,205, 77, 70, 76, 76, 38, 18, 18, 50,154,
- 35, 2,188, 16,184, 63,224, 19, 1,113,128, 33,217, 83, 20, 64,127,239,245,167,189, 86,141,186,254,169,220,221,223, 47, 11, 14,
-238,219,127,198,180,137,232,213,163, 51, 60, 61,156, 81, 89,165,194,141,242, 94,130, 75,165,149, 62,219,183,126,165,136,121,116,
-246,106, 39,113,167, 53,214,236,157, 59,187, 47,242,242,197,237, 10, 33,106, 48,123, 10, 48,110, 24, 16,244, 16, 80,124,133,224,
-224,113, 37,118, 42, 78, 99,199,230,197,164, 79, 72,188,116,192, 32,235, 25,237,218, 42,218, 97, 46,138, 32,151,203,169,246, 18,
- 1,119,239,222,197, 75, 47, 53,160,107, 87, 32, 41, 9, 88,177,162, 14, 39, 79,158,132, 86,171,133, 68, 34,129,175,175,175, 98,
-251,246,237,232,219,183,175,116,248,240,225,249, 28, 59,128,200,194,194, 66,116,235,214, 77, 17, 29, 29, 77,125,251,237,183, 0,
-160,200,203,203,195, 19, 79, 60,129,145, 35, 71,114,189, 86, 49, 0,236,220,117, 66, 0,100,210,250, 87,189,134,230,123, 16, 30,
-134,222, 62, 0,204,156,185, 25,185,185,250,215,228,228, 18, 48, 17, 1, 62, 26,112,127,137,223,176,188,221, 82, 1,119,116,144,
- 77, 94,205, 34,224,207, 76,254, 0, 68,123,114, 55,189, 38,157, 16, 17, 50, 98,104,119, 80,148, 62,171, 27, 77, 19,116,118,115,
- 70,167, 32, 49,122,247,242, 64, 15, 63,183,135,246,228,110,122, 45, 46,225,153, 44, 0, 55, 45, 25,188,124,113,187, 98,252,176,
- 26,252,243, 25, 64, 40,212, 11, 40,141, 22,232,228, 10,132, 6, 3,163,195,129,237,138, 26, 28, 57,189, 93, 49, 96,208, 68,155,
- 30,124, 71, 13, 1,152,251, 62, 35, 2,238,119, 99,120,123,123, 99,251,118, 23,244,234,165, 68,126, 62, 80, 89, 41, 66,112,112,
- 48,130,131,131, 81, 87, 87,135,210,210, 82,228,231,231,163,166,166, 70,209,175, 95, 63,214, 67, 3, 63,254,248, 99,164, 82,169,
- 84,136,197, 98, 84, 86,182,140,100, 41,149, 74,124,249,229,151, 40, 45, 45, 37,143, 63,254, 56,151,250,164, 1, 32, 39, 91, 14,
- 64, 38,208,191,218,142, 99,199,142, 53,215, 55,179,137,146,169, 50, 54,247,133, 97,219,178, 45,179,234, 20, 16, 18,137, 11, 23,
- 48,178,174, 78,209,229,198, 13,252,238,235,139, 19,157, 59, 75,157, 6, 12, 0,161,168,124, 91,175,153,235,134, 81,108,108,176,
- 45,107,107,123,134,161,255,228,228, 92, 36, 36, 4, 53,191, 50, 72, 72, 8,226, 69,192,125,128, 49,217, 51,251, 3, 24,150,243,
-171, 0,140, 31,250, 63,249,245, 21,157, 57,176, 34, 56, 56, 56,100,100, 68,247, 22,229, 2, 1, 5,177, 88, 8, 23,137, 8, 78,
- 78, 2, 4,245,241, 66, 80, 80,176,111,209,153, 3,219, 45, 9,197, 19,135, 63, 35, 66,212,224,229,103, 1, 85, 35,112,249, 58,
- 80, 89, 13, 84,213, 0,255,221, 10, 44, 88, 14, 44, 91, 5,140,141, 0, 4,164, 6, 39, 14,127,198,123,139, 6, 24, 52,104,144,
- 52, 39, 39, 20,190,190,192, 19, 79,136,224,231, 55, 2, 19, 39, 78,148, 38, 36, 36, 80,241,241,241,210,152,152, 24,116,235,214,
- 13, 39, 78,156,192,247,223,127,175,248,233,167,159, 34, 27, 27, 27, 35, 45,217,252,246,219,111, 35, 27, 27, 27, 21, 78, 78, 78,
- 22,127, 91,161, 80, 96,211,166, 77,145,108, 72,118,255,254,253, 4,128, 90, 46,151,139,239,137,128,123,100,186,127,255,126,194,
- 85, 64, 29, 61,122,180,249,207, 82,153, 45,162,142,109,153, 37,242, 15,252,237, 55,197,244, 83,167, 20,189, 46, 22, 67, 92, 83,
-131,238, 23,127, 67,228,145,195,138,174,167, 79, 43, 64, 72,164, 45,237,125,244,232, 81, 28, 59,118,140, 20, 22, 22, 70,218,122,
-207, 48, 54,216,148,177,181,103, 76,244,108,202,172,129, 33,125,230, 85,157, 16,204, 63,240,247,137,248,217,164, 1,126, 96, 35,
- 0,109,233,169,145, 54, 60, 63, 71,133,152, 25,251,230,126,199,210,111, 20,157, 59, 29, 59,107,134,180,153,244, 77, 65,226, 44,
- 66, 85,117, 35, 66,130,188,145,181, 69, 17, 20, 54,120,188,135, 57,123,165, 37, 23, 49,123,138,254,253,238,253,192,167,223, 0,
-147,199, 3,113,145,192,111,197,192,201, 34, 2, 23, 9,133,161, 97, 64,204, 68,224,199,220,139,136, 24,227, 56,207,221,150,186,
-107,163, 57, 21, 54,193,221,221, 61,191,174, 78, 63,223,242,137, 39,158,192,184,113,227, 40,195,207,238,222,189, 43, 13, 13, 21,
- 41, 18, 19, 1,138, 58,142,138,138, 6,197,239,191, 7, 89, 10,255, 69, 82, 20,165, 96,187, 57, 76, 69, 69,133,194,154,238,157,
- 51,103, 14, 54,110,220,136,141, 27, 55,146, 57,115,230,180,104,139,253,251,247,147,141, 27, 55, 54, 31,215, 81,250, 3,182,101,
-230,208, 88, 88,136, 62, 5, 5, 80, 11, 4,112,162, 0, 45, 77, 64,107,116,160,181, 90,116, 61,176, 31,197,132,160,243,208,161,
- 54, 19,184,171,171,171,226,248,241,227,210,185,115,231,230,219,106, 3, 64, 11,143,220, 84,153, 45,209, 5,123,201,223, 28,209,
-231, 26, 69, 2,120,180, 63, 76, 10, 0,115,147,223,108, 33, 28,107,132,200,213,222,253, 30,163,181,101,198,184,165, 73,133,182,
-216, 51,245, 29, 27, 39, 46,138,252,252,131, 6,248,251,185,129, 16,224,192,225,235,104, 80,234,119, 93,141, 24,226,135,174, 93,
- 92,112,253, 70, 45, 93,124,185, 82, 32, 18, 9,208, 55,208, 11,254,254,193,158,208,111,209,106, 18, 37, 87, 84, 24, 55, 12,104,
-212, 0,187,246, 1,138,195, 4,254,221, 40, 4, 6, 0,143, 60, 12,244, 15,162, 32, 18,234,183, 22, 31, 29, 14,252, 75,174, 98,
- 85,223,134, 33,121, 54,239,217, 40, 94,195,177,126,195,122,119,228, 10, 3, 91,208,180,157, 43, 6, 15, 30, 44, 53,254, 76, 40,
- 20, 42, 6, 12,168,192,178,101,122,121,250,222,123, 23,113,229, 74,152, 89, 91, 42,149,202,170,231,111,136, 43, 87,174, 88, 61,
-102,194,132, 9,212,132, 9, 19,154,201,126,227,198,141,196, 88, 32, 76,152, 48,161, 93,234,174, 45,188,127, 0,232,123,251,142,
- 66,173,209, 64, 32, 16,128, 8,133,160,105, 26, 26,154, 6,173,211, 65,167,163,209,179,188, 92, 81, 51,116,168,205,215,220,208,
-208, 0, 0,138, 99,199,142,129,162, 40,206,243, 59,218, 66, 4, 56,202,243,207, 77,206, 69, 76,102, 12,102,110, 6,146,115,245,
-239,115,147,115,155,197,129,120, 91, 49,207,188,247, 17,134,115, 2, 88,205, 1, 48,183, 10,192,214,213, 1,230, 60, 46, 91, 60,
- 49, 75,162,193, 86,129, 98,233,186,141,191,203,214,139, 48, 55,169,208, 22,123,150,190,195,252, 14, 5,128,222,100,117,238, 2,
-173,159,237,239, 12, 0,184, 94, 86, 3,165, 82, 11, 0, 8, 14,244, 66,215, 46, 46, 56, 93, 84, 33,184,112,233, 46, 36, 18, 33,
-130,250,120,162,178, 90, 13, 0,102, 13, 95, 47, 39, 8,122, 72,255,251,143, 78, 0,194, 7, 80,112, 22, 3, 90,173, 62, 18,224,
-233, 14,148, 94, 3, 98, 38, 0, 15,245,212, 31,223,158, 48, 36,125, 91,198,133, 59, 58, 42, 42, 42,218, 44,138,210, 68,242,205,
- 30,127,123,147,191, 33, 50, 50, 50, 72,106,106, 42,101,235,231,198,112, 42, 41, 70,163, 70, 13, 74, 40,130,142, 16, 80, 0,180,
- 58, 26, 26, 45, 13,162,211,129,186,116, 1, 64,156,221,231, 93, 88, 88, 8, 31, 31, 31, 69,117,117,181,212,195,195,195,102, 17,
- 96,173,236,126,145,127, 90, 90, 26,149,158,158, 78,102,110,110, 41, 8, 0, 32, 38, 51, 6,226,109,197,216,182,173,164,121, 37,
- 0, 51, 97,208,219,219,155,103,234,251, 76,254,102, 5, 64, 71,135, 37, 66,180,133, 96,237, 89,226,104,209,110, 27,175, 38,160,
-102, 85,114,253, 13,202,195,195, 9,149, 85, 42,248,120,187, 34, 41,177, 63,180, 58, 26,206,206, 66, 8, 5, 2, 16, 66, 16, 63,
- 57, 8, 83,162,131, 64, 81,192,157, 74, 37, 60, 60,156, 0,224,174, 57,131,189,186, 83, 40,185, 74,189,136,105, 47, 0, 0, 32,
- 0, 73, 68, 65, 84,208, 63, 8,152, 52, 70,223,235,252, 86, 12, 12,238, 15,120,117, 6, 98, 35, 1,154, 6, 68, 66,224,226,101,
-253,241,108,219,150,203,123, 91, 19, 97, 88, 19,164,109, 13,154,166, 35,123,244,232,129,146,146, 18,236,223,191, 95, 49,126,252,
-120,169,155,155, 27, 4, 2, 65, 62, 0,232,116, 58,233,185,115,190,138,183,222,186, 1,138,162, 80, 81, 17,130,144,144,222,184,
-120,241,162, 57,123, 38,203, 55,109,218,212, 58,138, 68, 8,102,207,158,205,233,154, 13, 69, 64, 71, 34,127, 71,136, 4, 67,220,
-237,217, 3,226,223, 46,128, 56, 1, 98,154,232, 39,182,234,180, 80, 19, 29, 26,180, 90, 40,131,251, 59,228,220, 7, 14, 28, 8,
-138,162,108, 34,127, 0, 24, 57,114, 36, 70,140, 24, 65, 29, 61,122,148, 88, 42,179,134,166,136, 65, 11,194, 55, 85,198, 5,201,
-185,247,136, 31, 64, 43,207,159,153, 48,184,109, 91, 9,207,212,237, 64,254, 15,172, 0,104,107, 65,225, 40, 66, 32, 4, 16,204,
-174,108, 51, 17,192,172, 92, 16,204,170,100,227,253, 3,128,232,230,141,146,219,215,111,244,244,241,241,118,197, 7,159, 31,195,
-132,177,189, 16, 49,184, 27, 40, 39,170,121, 69, 64,211,214,241,184,126,163, 22, 55,111,148, 92, 6, 96,214,173, 12,234, 45,193,
- 47, 5, 74,244, 15, 2,124,134, 1, 75,231, 3, 11,231, 2, 30,238,250,176,255, 91,159, 0,203, 23,234,143,253,165, 64,127,188,
-173, 4,237, 40, 79,189, 35,229, 2, 56,119,238, 28, 36, 18,125,157,236,216,177, 3,215,174, 93, 83,244,235,215, 79, 58,105,210,
- 36,212,214,214, 70,122,123,123, 43, 14, 30,212, 34, 63, 31, 24, 49, 98, 56, 2, 2, 2,164, 61,123,246, 4, 0,133, 41,123,157,
- 58,117,130, 90,173,102,245,219, 90,173,246,129,127,118, 13,201,159,141, 16, 96, 43, 2, 74,186,250, 74,157,207,156, 81,208,132,
-160,147, 64, 4,161,144,130,150,232,208,160,209,160, 86,173, 70,153,191,191,212,199,142,243,118,117,117, 5, 69, 81,210, 17, 35,
- 70,228,219,106,131, 33,122,107,101,247, 91, 4,164,165,165, 81,201, 77,158,189, 49,249, 27,122,255, 60,218,151,252,121, 1,112,
- 63, 60,188, 54, 94, 82,216, 44, 2,216, 9, 13,109, 88,216,144,178,226,203,149, 62, 67,194,124,177,116,225,104,172,255,223, 89,
-184, 72, 68, 8, 31,232, 11,138,162, 12, 60, 73,130,226,203,149, 8, 11, 27, 82, 8,160,214,156,193,192,160, 16,236,216,123, 26,
-115,103, 2,164, 20, 24, 61, 3, 8,236, 5,108,204, 49, 56,104, 33,160,211, 1, 59,246,234,143,111, 47, 88,138, 20,181,215, 50,
-192,187,119,239, 42, 66, 67, 47, 99,221, 58, 0,208,225,237,183,207,224,228,201, 6, 69, 67, 67, 3,106,107,107, 81, 90, 90,138,
- 91,183,110, 33, 34, 34, 2,179,103,207,182,186, 12,144, 16, 34,165,105, 90, 33, 16, 88, 95,224,195, 8, 15,174, 96,134, 0, 54,
-110,220,136, 9, 19, 38,180,235,243,149,154,154, 74, 49,196,111,109, 8,192,218, 49,134,240, 26, 58, 20,119,212,106,232, 20,249,
- 80,139,157,224, 70, 68, 80,209, 52,170,213,106,212, 78,122, 4, 62,195,134,217, 24, 21,164, 48, 98,196, 8,155,199,253, 13,109,
- 24, 18,189,169, 50,123, 68,192,177, 99,199, 44,150,177,129, 41,242,103, 60,127, 0,252,132,192,118, 38,127, 94, 0, 60,224,104,
- 30,255,103, 63, 12,160, 11, 27, 60,126,210,246,173, 95, 29,252,181,192,189,255,168, 97,254,136,141, 10,196,238,159, 75,177,227,
- 39,253,195,249, 90,202, 88,208, 52,193,175, 5,101, 40, 41, 41,190, 26,159,248,236, 63, 0,104,204, 25,140, 24,243,119,106,199,
-230,197,228,195,175,244, 75, 1,215,190,171, 95,250, 23, 53, 78,191, 20,240,195,215,245,228,255,225, 87,128, 14,157,109,206, 8,
-104,175,103,110, 45,130,208, 94,171, 0,234,235,235, 49,116,168, 10, 35, 70,232,255, 31, 62,156, 96,247,238, 82, 92,188,120,145,
- 73, 4,132,200,200, 72,244,237,219,151, 85, 14,128,201,147, 39,231,103,103,103, 91,141, 2,104,181, 90,120,122,122, 74,185,158,
-111,211,114,192,230,149, 1,251,247,239, 39,182, 14, 3,140, 28, 57,146, 85, 25, 23, 17, 96,237, 56,214, 70, 5,130,124,245,168,
- 81,210,243, 78, 78,232, 85, 94,174,112,187,118, 13,170, 62,125,112,197,215, 87,234, 29, 17, 1, 52, 13,209,216, 64,176,142, 32,
-233, 86, 54, 76,149,177,173, 75,227,227, 24,194,183, 86,102, 11,140, 73,159,137, 8,216, 59,132,199,163, 53,216, 76,140,230, 5,
- 64, 27,122,230, 29,244, 55,238,196, 60, 58,251,163,220,221,223, 47,254,189,188, 54, 40,184,143, 23,166, 76, 14,130,151,167, 4,
-149, 85, 42,156, 60,123, 11,197,151, 43, 81, 82, 82,124, 40,230,209,217, 63, 2,184,110,205, 96,159,144,120,233,129,130,237,138,
- 67, 5, 53,152, 50, 9,248,226,125,125, 38,192,146,171,192,151,155,244,158,191, 14,157,209, 39, 36, 94,106,235,181,218, 51, 4,
-192,150,252,219, 99, 14, 64,121,121,185,212,203,203, 71,113,252,248, 31, 0,128,139, 23, 59, 99,196,136, 1,232,210,165, 11, 36,
- 18, 9,202,203,203,165,241,241,241,156, 82, 1,247,238,221, 91,122,225,194, 5,133, 97, 68,199,152,252,131,131,131, 49,114,228,
- 72, 78, 36,198,172, 2, 48, 24,251,103, 38, 4,218, 36, 2, 76, 17,161,173,228,104,141,220, 57,145,191,129, 8,232, 50,124, 56,
- 26, 0,170,161,169,200,222,169,106,246,146, 63,151,122, 99,251, 91,142,182,199,150,252,213, 9,193, 0, 63,254,127, 95, 34, 1,
-230,132, 1,167,101,128,182, 78,150,227,186, 12,208, 86,123,182,218,116,244,249, 89,170, 39, 71,157,159, 61, 19, 23,157,196,157,
-228,241,137,207,126, 87,116,230,192,103, 91,114,246, 5,250,245, 8, 26,109,176, 23,192,145,176,176, 33, 71,227, 19,159, 93, 6,
-160,158,141,189, 1,131, 38,230, 15, 24, 52,145, 58,113,248, 51,242,253,142,139,120,239,211,142,183, 23, 64, 71, 36,127, 0,120,
-252,241,199,113,250,244,105, 60,243,204,241,166, 8,192,112,204,154, 53, 68,234,234,234,154,111,171,205,240,240,240,252,240,240,
-112,106,235,214,173,145,181,181,181, 10,161, 80, 8,129, 64, 0,173, 86, 11,177, 88, 12, 55, 55, 55,169, 3,200,223, 33, 34,128,
-199,159, 19,105,105,105, 84,122,114, 58,241, 95,224, 47, 69,111,211,199,148, 37,231, 42,248,249, 0,237, 11, 17,219,142,210,209,
- 29,111, 91,216,179,229,183, 30,228,235,181, 19,213, 97,131,199, 63, 25, 54,120, 60,147, 49,198, 13,128, 15,128,114, 0, 74, 52,
-165,125,229,130,136, 49,127,167,108, 73,242,211,214,245,208,145,242, 74, 24,195,213,213, 53,127,204,152, 49,212,152, 49,142,175,
-184,196,196,196,124, 56, 40,185, 37, 51,238,111, 76,242, 19, 38, 76,160, 54,110,220, 72, 58,194,124, 0, 30, 29, 79, 4, 88, 62,
- 0, 60,249,183, 1,216,102, 1, 4, 0, 42, 60, 60,156, 31,123,225,193,131, 7, 15, 30, 60,254, 98,224,247, 2,224,193,131, 7,
- 15, 30, 60,120, 1,192,131, 7, 15, 30, 60,120,240,224, 5, 0, 15, 30, 60,120,240,224,193,131, 23, 0, 60,120,240,224,193,131,
- 7,143, 63, 7, 90,172, 2,152, 63,127,190,205,179, 50, 77, 37,114,224,237,181,141, 61, 54,155,216,180,167,189,188,188,188, 72,
- 0,138,172,172, 44,135,216,219,187,119,111, 36, 77,211, 14,179,199,223,127,237,102,111, 54,128, 77,109,124,126, 78, 0, 36,208,
- 39,173, 81, 65,191,154,133,192, 40,137, 13,223, 30,188,189, 63,187, 61,206, 2,192, 26, 57,152, 3,151,165, 84,142,182,119, 63,
-145,156, 84, 77, 32, 22, 35,115,163, 11,171,243,203,203,203,139,204,202,202, 82, 56,234,122, 13,237,173, 94,189, 90,154,146,146,
-162,176,101,123, 97, 83,246, 10, 63,237,140,129, 47,214,192, 30,123, 12,166,141,216,169, 56,125, 65, 7, 0,200,204,204, 36,201,
-201,201,118,181,103, 72,183,239,161,212,122,195,197,197, 5, 89, 89, 89, 36, 41, 41,169,163,220, 31, 93,231,189,146,242,205,218,
- 15, 86, 63, 5,224, 15, 7,216, 11,152,255,210,203, 95,124,254,201,135, 79,154,177,231, 4, 64, 11,203, 25,217,156,160,207,220,
-216,117,225,194,151,191,249,248,227, 15,159,130,126, 51, 39, 26, 14,200,228,102,252, 28,115,188, 55, 14,183, 85, 67, 80, 20, 21,
- 39, 16, 8, 6, 8, 4,130, 72,138,162, 66, 0,184,170,213,234, 92,161, 80,232, 73,211,116, 5, 33,228,117, 0,119, 28, 89, 7,
- 60,120,152,194, 83, 37, 37,228,155,160, 32,135,245, 81,201, 50, 25,201,108, 35, 78, 20, 89,123,200, 9, 33,150, 30, 58,206, 29,
-134,163,236,113,245, 96, 29,137, 61,123,246, 88,237, 68, 24,114, 77, 77, 77,133,175,175,175,201, 12,120, 41, 41, 41, 10,182,191,
-201,216, 99,136,255,200,145, 35,205, 66,192, 30,123,244,185, 55, 32, 24,240, 54,190,222,171, 79, 29, 75,159,123,163,249, 24,193,
-128,183, 57,213, 75,231,154, 87, 8, 77,128,239,118,235,109,197, 78,116, 66, 88,112, 17, 50, 51, 51, 9, 0,112, 21, 2,213,218,
-239, 34,171,174,220,129,146,154,168,168,111,236,132,216,152, 42,244,240,163,112,252,248, 33, 82, 83,163,194,164, 73,147,218, 85,
- 8,204, 95,184,240, 37,208,244,228,249, 11, 23,190,244,249,199, 31,191,110,183,189, 5, 11, 95, 32, 52, 29, 61,127,193,194,151,
- 62, 95, 99,210,158,134,133, 25, 13, 0,106,193,130,133, 47,209,180,110,242,130, 5, 11, 95, 90, 99,218,150, 0, 54,228,122,176,
- 19,106,195,251,239,135, 31,126, 80,204,152, 49, 67, 58,121,242,228,124,123,140, 10,133,194, 88,145, 72, 52, 65, 36, 18, 61, 46,
- 20, 10,189, 4, 2,129, 91, 70, 70,134, 96,241,226,197,207,234,116, 58,104,245,120, 92,167,211, 37, 0,248,165, 73, 4,168,155,
-250,191, 54, 31, 6,221,177, 99, 7, 97,219,223,197,197,197,113,186,167,119,238,220, 73,236,249, 62, 15,199,195,101,229, 74, 64,
- 46,119,152, 61,229,146, 37,118,125,159,201, 8,200,105, 59, 96, 54,228, 63,108,216, 48, 20, 20, 20,112,242,248, 45,145, 60, 27,
-123,166,236,167,166,166,162,180,180, 20, 89, 89, 89, 14,221,214, 53, 57, 33,147,192, 37, 4,153,155, 34, 41, 0,200,204,242,160,
-184,144,255,234,213,171,165, 21, 21, 21, 10,115,228,159,154,154,138,140,140, 12, 78,228, 15, 0, 73, 73, 73, 24, 61,122,180,116,
-244,232,209,118,217, 99,200,158,121, 93,241, 14, 90,144,255,146,153, 18,172,220,172, 98, 85, 87, 30,202, 20, 50, 48, 68,136,122,
- 37,193, 43, 79, 73,112,164, 72, 11,101, 61, 65,131, 26,144,134, 23,161,232,162,142, 83, 52,160,244,250,135,164,234,102, 39,184,
-119, 22,195,175,187, 27,186,118, 11,198,213, 18, 53,122, 15,208,192, 73, 82,129,188, 45,183,177,101,203, 22, 50,125,250,244,118,
-233,240,100, 50,153,179, 79,143, 30, 11,191, 61,114,148,138,237,215,247, 37,153, 76,246,174, 92, 46,111,180,199, 94, 87,191, 30,
- 11,191,219,123,132,138, 14,239,103,151, 61,153, 76, 38,246,243,235,190,240, 39,197, 1,106,248,144, 48,115,182,232,118,168,182,
-230,237, 7,179,178,178, 20, 9, 9, 9,216,188,121,179, 98,242,228,201,173,218, 48, 34, 34,130,188,245,214, 91, 72, 72, 72,176,
-216,190, 34,145,104,146, 88, 44, 30, 40, 22,139, 23,136,197, 98,215,235,215,175,163,111,223,190, 16, 10,133,112,119,119, 71,113,
-113, 49,220,220,220, 68,199,142, 29,243, 60,124,248,240,129, 23, 95,124,177, 55,128,171, 0,196,230,234, 32, 57, 57,185,149,179,
- 98,216,111, 49,229, 20, 69, 33, 51, 51,211,234,253,183,117,235, 86,179, 54, 12,203, 9, 33,136,139,139,227, 84,161, 57, 57, 57,
-118,125,191, 45,113,234,212,169,200,240,240,240,124, 71,216,186,117,235, 22,161,105, 26, 16, 84, 65,221,168,130,216, 89, 2,208,
-158, 16, 8, 4,232,214,173, 27, 53,216, 56,114,105, 33, 25,206,195, 15, 63, 76, 54,111,222, 12,115,246,102,206,156,137,131, 7,
- 15, 82,182,158, 31, 0,148,223, 58, 79, 12,207,207,158,107,183, 37,154, 96, 46, 13, 48, 43, 1,192,150,252,217, 34, 53, 53,213,
-234, 49,108,136,203, 28,249,175, 88,177, 2, 75,151, 46,109, 81,110,171, 8, 72, 30,150, 73,208, 37, 4,153, 63, 69, 82,134, 30,
-127,116,116, 52, 5, 0,204,107,113,113, 49, 97, 67,214,150,200,191, 41, 50, 96,213,107,103,194,244,134, 30,190,241,208,130, 45,
-246, 44,121,248, 75,102,178,223, 41,206, 71,249, 10,233,251,144, 16, 46,206, 20, 30,242, 23,226,118, 37, 13,141, 86,136, 59, 85,
- 4,213,117, 4,197,191,211,128, 0,240,113, 61,131,188,188,188,200,168,168, 40,139,157,194,213,107, 31, 68,134, 6, 7,225,240,
-205, 91,232, 19,208, 21, 3, 7, 7, 66,232,236,141,135,250, 84,162, 82,169, 66,197, 77, 29,126,191,165,130,171,168, 20,121,121,
-238, 86,237,181, 17,230, 60,181,120,177,184,180,187, 63,156,135, 13, 23,168, 14,236,159, 3,224, 43, 27,236, 48,158,248,156,167,
- 95, 90, 36,254, 93,236, 7,183,144, 8, 65, 77,225, 65, 91,237, 1,192,156, 23, 23,190, 44,134,179, 59,250,244, 11, 19, 92, 56,
-123,194, 30, 91,142, 4,205, 60, 35, 20, 69, 65, 34,145, 72, 1, 40,140,239,137, 97,195,134,177, 34,127, 0,112,114,114,242,148,
- 72, 36,115,111,223,190,237, 26, 18, 18,130,161, 67,135, 66, 36, 18,225,147, 79, 62,129, 78,167,195,160, 65,131,240,227,143, 63,
-226,216,177, 99, 56,115,230, 12,132, 66,225,103, 58,157,110,170, 37,155, 83,167, 78,109,238,231,172,245,131,108, 8, 87, 46,151,
- 75,253,252,252, 20,132, 16,139, 14,208,205,155, 55, 57,239,149,193,216,182,245,251, 12, 81,159, 63,127,222, 98,191, 17, 26, 26,
- 42,229, 74,230,231,207,159, 87, 84, 87, 87,195,195,195, 67,106,143, 16, 56,113,242, 16,121,235,157,249,232,212,201,165,213,103,
-245,245, 74,228,252,120, 26,103,228,114,106, 74,247,238,228,122, 98,162,249,190,253,192,106,125, 99, 30, 88,141,238,147,226, 33,
-137, 24, 14, 93, 72, 88,203,240,217,119, 27,224,245,254,116, 12, 48, 24, 42, 82, 62,250, 60, 62,183,114,126,203,210,230,193,187,
-139,171,190,224,141,143,144,178,232, 25, 0,192,221, 59, 13,120, 47,125, 45,137, 24, 58,214,102, 17,224,232, 33, 5,139, 2,128,
-241,216,173,121,234, 29, 5,165,165,165, 88,186,116,169, 77, 2,194, 18,244,158,126, 50,181,103,207, 30,146,149, 57, 18, 16, 43,
- 9,155,177,127, 83,100,109, 76,202,150,134, 5,204,193, 80, 80, 28, 57,114, 68, 49,122,244,232, 22,161,127,174,246,254,187,216,
-205,108,231, 54,103, 85, 61,107, 59, 52, 77, 71, 58,187, 82, 16, 8, 0, 87, 23,160,170,134, 70, 35, 33,232,228, 66, 65, 69, 3,
-202, 70,130,158, 93, 5,160,181,192,165,235, 58,148,150,150, 42, 96, 33, 61,237,185,162, 31, 34, 7, 14,236,175, 16,139, 9, 94,
-152, 59, 10, 58, 29,193,205, 10, 53,174,221,168, 2,156,174,195,197,171, 17,229, 21, 87, 32, 16, 87,227,220,185, 42,120,120, 89,
-182,215, 86,112,246,246,126,227,241,191,253,205,249, 53, 26,240, 90,154,230,118,235,244,169,215,109, 36, 89, 2, 0, 18, 15,239,
- 55,254,239,201,191, 57,175,186,172, 67,207,217,169,110, 23, 74,207,152,178,103,117, 71, 54,153, 76,134,206, 30,158,111,204,121,
-242, 41,231, 51,215, 42,145,248, 68,178,219,191,223, 73,177,245,220,204, 70,242,204,149, 91, 17,222, 58,230, 25,137,143,143, 71,
- 84, 84, 84,126, 86, 86, 22,148, 74,101,115, 27, 50,158,127,124,124, 60,171, 54,117,118,118, 30, 91, 95, 95,223, 63, 52, 52, 20,
- 82,169, 20, 41, 41, 41,120,238,185,231,244,157,185, 70,131,245,235,215,163,160,160, 0, 39, 78,156,192,247,223,127, 15,165, 82,
- 25, 76,211,116,172, 37,155, 83,166, 76,113,232,253,180, 99,199, 14, 86, 67,115, 20, 69, 41,184,134,240, 13,109,219,242,253,166,
-208,112,126,117,117, 53,202,202,202, 76,126,238,239,239, 15, 91, 9,188,172,172, 12,101,101,101,118, 9,129, 51,167, 47,226,155,
- 13,219, 49,126,252, 88,132, 13,234,209, 92, 94,116,246, 6, 14, 28, 56,132, 31, 55,255, 76,178, 94,125, 21,215, 19, 19,225, 50,
-110, 28,148,191,252, 98,210, 78,230,248, 20, 10, 0, 46,109, 88, 67, 6, 87,236,198, 83,123,183, 67, 23, 18, 6,229,162,229, 0,
- 0,151, 85,203,225,118,177, 8,139, 75,197,232,251,244,130,123,245, 88,127,239, 57,181,116,126, 81,209,227, 90,157, 95,222,158,
- 95,112,230,244, 69, 68, 12, 29,107,243,253, 99,203,144,130, 97,184,223, 82, 52, 64,196,213, 99,119, 52,209,218,139,172,172, 44,
-187,190,159,156, 41, 35,232, 14,100, 38,232, 59,174,204,130,228, 22, 97,126,189,199, 95, 77,140, 35, 1,108,201,186,162,162,162,
- 5, 57,219, 66,214,108,193,136, 14,153, 76, 70,172,229,131,182,228,217, 48, 96,194,255,230,236, 17, 66,200,237,115,175,160,123,
- 83,232,191, 89, 49,235, 8, 84,106, 64,211, 84,166,209, 18, 16,129,254,253,217, 51, 5,204, 42, 1,147,112,119,175, 86,212, 43,
- 5,240,241,246, 68,213,221, 6, 84, 85, 87,225,200,241,155,184,113,139, 64,220,169, 1, 61,130,235,160,108,184,141,190,131, 53,
-232, 29,218,136,239,191, 40,192,238,221,187, 35,239,227, 45, 39,144,201,100, 81, 51, 95, 72,238, 86,230,225,133, 18, 45,224, 18,
- 53, 25, 2,175, 46, 62, 50,153,108,178, 92, 46,255,201,128,172,157, 96, 48,238,109,174,223,151,201,100,209, 73,115, 95,232,246,
-135,192, 3, 87,235, 52,240,140,136,130,200,221,203,216, 30,192,110, 2, 91,204,180,233, 51,186, 17,161, 51,170,235, 27, 49,112,
-216, 24,184,117,246, 48,101,171, 93,192,120,255, 20, 69, 97,219,182,109, 36, 62, 62, 30,219,183,111,135,139,139, 75,100,106,106,
-170,130, 11,249, 3,112,174,170,170,122, 90,163,209, 8, 92, 93, 93, 49, 97,194, 4,172, 90,181, 10, 78, 78, 78,144,201,100,216,
-176, 97, 3, 10, 10, 10,112,228,200, 17,252,252,243,207, 56,123,246, 44,124,124,124,124,180, 90,237, 67,176, 50, 4,146,156,156,
- 76,172, 13, 1,124,241,197, 23,172,206,179, 45,135, 0,182,110,221,234,144, 33, 0, 15, 15, 15,105, 89, 89,153,194,220,103,246,
-182,187, 45, 66, 64, 90, 82, 66,238,172, 92,137, 15, 0,224,240, 97,220,157, 25,135,213, 67, 66,154, 67,246, 97, 3, 6, 96,214,
-236, 41,232, 93,121, 27,215, 19, 19,209,101,201, 18, 40,130,130,168,193,191,252, 98,241, 57, 17, 75, 31, 70, 72,108, 36, 22, 47,
-121, 23,255, 66, 17, 86,143,158,132,129, 35, 70, 33,248,110, 41,214,123, 14, 69,169,199, 45, 12,146, 72,136, 74,165, 98,213,190,
-210, 73, 67,240,212,211,241, 56,250,235, 89,236,206,253, 9,111, 2, 88,189,106, 29,194, 6, 12,192, 83, 79,199,163, 65,121, 7,
- 18, 14,246,140, 97,239, 28, 0, 78, 17,128, 7, 9,114,185,156,114,196,172,117,134,220,179,150, 94, 6,132, 98, 36, 79,238, 13,
-120,246, 70,102,211,130, 37,182, 99,255,142,134,225,181, 49,147,254, 12, 61,127, 99, 48,115, 3,204, 77, 6,180,101, 39,194,141,
-139, 58,153,141, 8,184,215,164,224,138,154,224,230,109, 26,128, 0,110,174,250, 16,167, 70, 75,160,106, 4, 84,106, 64,213, 8,
-168, 53,128, 74, 9,168, 27,239, 69, 73, 76, 9, 10, 55,237, 43,228,198,181, 0,244,234,227, 6,226, 36,194,109,165, 18,138,125,
-215,113,174,248, 6,238,222,173, 67,216, 48, 29,234, 85, 90,168, 26,117, 80, 54,208,184,121, 13, 80,214, 3, 91,182,108, 81,112,
-217, 0,195,206, 54,161,133,158,158,111, 60,243,234,171,146,239, 13, 40,196,235,213, 52,183,187, 75, 23,189, 14,224, 39, 3,178,
- 86,179, 48, 73, 68,110,158,111, 60,247,242, 82,201,174, 27,186,230,194,158,143, 47,117,187,250,229,171,134,246, 88, 69, 1, 92,
-221,220, 95,127,233,149, 69,146,146,178,123,187, 69, 38, 60,145,236,246, 93,230,106, 83,182, 56, 61,107,166,238, 37,142,207, 26,
- 97,188,127,137, 68, 34,141,138,138,202,103,150,140, 42,149, 74, 69, 65, 65, 1, 21, 31, 31,207,214,150, 22, 64, 48, 0, 58, 60,
- 60,156,150, 72, 36,130, 13, 27, 54,224,217,103,159,197,251,239,191, 15, 66, 8,126,253,245, 87,236,219,183, 15,103,206,156, 65,
-117,117, 53,250,246,237,139,154,154, 26, 87,129, 64,224,107,205,248,180,105,211,204,138,100,102,104, 96,202,148, 41,156,194,244,
- 29,117, 8,192, 82, 20,192, 30,239,223, 94, 33, 80, 89, 85,213,252,222, 55,109, 30, 6,166,205,199,120,163, 99, 46, 63,250, 28,
-122,238, 63,142,146, 69, 47,224, 87,127,127,184, 0, 56, 35,151, 83, 48,177, 44, 78,169, 84,146,158, 61, 59,227,234, 53, 32, 44,
- 34, 20, 88,249, 26, 94,254,114, 11,230, 6,157,198,144,198, 98, 44,190, 37,198, 59, 27,151,225,253,244,207,113,230,236, 65,244,
-234, 25, 70, 92, 92,204, 71,125, 13,237,121,119,113,197,163,113,163,240,104,220, 40,188, 69,127, 4,117,227, 82,156, 60, 9,156,
- 60, 9, 28, 56, 16,143,127,175,185,136,184,184, 88, 18, 16,240, 16,130,130,190,225,196, 79,121, 15,191,134,146,131, 34, 43,125,
-247,231,127, 13, 1, 32,147,201, 72, 82, 82,146,148, 25, 51, 52, 22, 1,134, 29, 18, 51, 30,111,235,124, 0,134,244,163,163,163,
- 41,253, 48,128, 24,153, 27,239,239,245, 50,179,254,163,162,162,168,188,188, 60, 98, 45, 26, 98,109,217,161, 37, 66,231, 58, 28,
-240,244,171,245,240,239, 38,192, 19, 9, 98,168, 26, 1, 15,119, 10, 2,170,201,235, 7,129,170, 1,168, 87, 19,212, 43, 9,234,
- 85, 4, 52, 1, 4, 22,230, 92, 63,189,176, 30,131,134,148,194,175,255, 93,236,217, 85,129,187,119, 85, 8, 31, 83,131,193,222,
-117,128, 83, 35, 84, 13, 52, 42,110, 16,212,215, 83,208,106, 41,120,251, 80, 0,117,223,231,178,133, 13, 29, 50,100,184, 87, 64,
- 0, 14,233, 12,196,203, 19, 79,226,110,106,202, 48,153, 76, 54, 64, 46,151,159,227,112, 63,135,142, 24, 55,113,120, 23,255, 0,
- 28, 63,218, 60, 71, 14, 93,165,255,135,171, 95, 44, 53,101,207,210, 86,216, 3,198,141, 27, 63,220,223,191, 39,206,157,184,220,
- 92, 62,238,145, 41,248,159,124, 21,231,115,107, 3, 52,159, 59,243,252, 50,195, 0, 12,182,111,223,222,106,254,145,137,185, 0,
- 76,163, 7, 3, 56,181,100,201,146,177, 34,145,200,237,235,175,191,198,186,117,235,240,204, 51,207, 96,197,138, 21,160, 40, 10,
- 87,174, 92,129, 82,169, 68,106,106, 42,180, 90, 45,230,205,155, 71, 83, 20,101,245, 1,112,228,108,250,142, 62, 4, 96, 41, 10,
-224, 8,239,223, 86,108,216,176, 1,127, 75,158,133,234,170, 70, 32,125, 45,234, 15, 28, 71,167,241,195,155, 63,175, 72, 95,139,
- 34,103,103, 80,255,120, 30, 3,103, 63,138,195,235,119, 97,240,224, 17,102,237, 93,186, 84,136, 49,227, 98, 81, 88,228,133,181,
-159,101, 97,252,248,177,120,231,211,101,120, 43,106, 14,190, 5,208,255,169,103,177,246,179, 44,136,197, 94,152, 58,109, 56,190,
-230, 96,239,227, 15, 54, 97, 68,252, 32,188, 59,104, 21, 10,167,184,193, 43,225,199, 22,199,250,184, 74,112, 52, 95,129,128,191,
-205,229, 92, 15, 7, 15,138,176,114,165,139, 21, 1,247, 23,138, 0, 24,143, 35,155, 35,248,166,227, 88, 35,179, 64, 63, 67, 93,
- 79,252,151,144,245,201,101,232, 87, 1,180, 20, 5,108,134, 1, 28, 29,214,207,203,203, 35,134,222, 63, 19, 17, 48,252, 63, 41,
- 41, 9, 76,178, 28,115,137, 33,184,144, 63,179, 10,192,156, 61,173, 14,168,111, 32,104, 84,235, 39,251, 53,170, 9, 68,206,247,
- 62, 83, 53, 0, 74, 13,193,157,187, 4,127, 84, 18,156, 56,167, 5, 77, 3, 73, 73, 73,210, 75,151, 46,181,106, 27,173, 22, 40,
-187,174,198,245,146, 74, 28, 60, 92, 9, 66, 40,156,251,141, 70,252, 19, 90,136, 69, 4,127,220, 2, 14,254, 4,212,212, 16, 16,
- 26,120,120, 18, 5,137, 4,136,141,157,138,171, 87,175,178,186,166,236,245, 50, 50,109,174,237,171, 68, 4,110,157, 95,125, 97,
- 69,134, 83, 14, 17,180, 96, 98, 31,103,103, 56,253, 99,161,211,149, 53, 31, 45, 3,240, 36, 91,123, 66, 23,183,101,243, 95, 95,
-225,244, 83, 25,105, 97,175, 75, 39,103, 12,156,253,162,211,185, 77,159, 24,219, 51, 27, 1,144,184,116, 90,182,244,141,229, 78,
-151,111, 86,183, 56,160,179,123, 39, 76,127,226, 25,167,156,255,126,197,233,220,218, 42,106,103,170, 44, 34, 34,130,156, 56,113,
- 2,219,182,109,107,245,157,132,132, 4,147, 77, 1,160, 16,192,169,213,171, 87, 15,241,244,244,116, 99,194,224, 95,125,245, 21,
-158,125,246, 89,172, 91,183,174,217,139, 95,189,122, 53,170,170,170, 80, 83, 83, 83,215,208,208, 80,218, 20, 65, 16, 91, 58,215,
- 23, 94,120,129, 24,135,232, 25,239,159,109,248,255, 65, 25, 2, 48, 21, 5,112,180,247,207,216,100, 59, 4,112,110,204, 24, 80,
- 47,204,134, 39, 0, 50,105, 24, 26, 78, 20,162, 62,125,237,189,122, 75,158,133,190, 79,205,130, 68,162,191,254,162,162, 98,139,
-132, 93, 84, 84, 12, 0,136,141,211,139,136,130,227,103,240,237, 55,223,193,117,212, 72, 52,104,180, 80, 67,141, 9, 19,135,182,
- 56,158,173,189,235, 58, 53,158,232,246, 34,232, 19,141, 72,250,215, 36,136, 31, 59,130, 1, 97, 3, 16, 54, 48,184,249,252, 82,
- 23,175, 65, 80,144,144,245,125,243,200,255, 61, 18,117, 14,231,246,224,127,223, 80,214,166, 0,124,254, 57,218, 38, 17, 80, 71,
- 68, 65, 65,129,213,217,228,121,121,121,145,172,151, 20, 58,119, 66, 86,239,253,128,182,128,160, 79, 39, 36,167,247, 65,102,126,
- 60, 5,100,146,123,130, 32,218,230, 97, 0,227,165,128,230,150, 6,154,235, 44,101, 50, 89, 51,249, 27, 79, 0,100, 66,234, 76,
-153,165, 8,128,161, 61, 71,117,230, 59,119,238,140,188, 81,190, 75, 65,119,165, 33, 16, 1, 78, 2,253,253,173,161, 9,180, 90,
-160,182,150, 64,173, 1,180, 26,189, 40,152, 58, 77, 31,189,185,116,233,146, 89,123,141,183,119, 42,194,194,104, 28,216,167, 3,
- 37, 0,254,184, 73, 65,226, 2,236,219, 13,168,149, 20, 40, 2, 12,142,112, 66,217, 53, 26, 19, 39, 78, 65, 92, 92, 28,197, 38,
- 19, 86,246,122, 25, 89,249, 34,176,228, 83,219, 69, 0,161,117, 49,186, 46, 62,130, 93,244, 61, 22,234, 6,192,143, 2,148,195,
-134,137, 46,107,117, 49,156,236, 17, 58, 6,238,222, 2,197, 77, 93,179,189,174, 18,192, 71, 66,193,117,208, 48, 81,209,119,116,
-140, 57, 47,218,148,173, 78,238,158,130,171,183,170,154,136, 5,112,119,113,134,187,171, 24, 17,225, 67, 69, 91,190, 37, 49,237,
-252,232,154,172,115,102,214,127,124,124,124,243, 61,202, 68,239,102,206,156,105,201, 3,173, 3,112,249,228,201,147,117,227,199,
-143,239, 10,131, 53,253, 95,125,245, 85, 51,201,106, 52, 26,232,116, 58, 92,186,116, 9, 93,187,118,189, 77,211, 52, 43,181, 56,
-109,218, 52,179, 67, 0, 92,136,246, 65, 24, 2, 48, 21, 5,112,164,247,207,133,248, 25,116,247,247,196, 23, 95,236, 69, 98,194,
- 24,116, 27, 22, 6, 12, 11, 3,245,194,236,150,162, 23,192,173,155, 74,108,221,118, 24,221,253, 61,217,219,243,115,193,176,225,
-125, 49,108,120,223, 86,199,113,181, 55, 97, 70, 40,210, 38,126, 2,186, 80, 79,254,207, 45,126,218, 38,123,198,120,213,253,213,
- 61,239,215,190, 31, 93,142,242, 54,123, 32,237, 18, 0, 5, 5, 5,247, 61,107, 31,227,229, 50, 68, 23, 21, 21, 69,153, 32,127,
-194,132, 21,147,146,146,108,250, 29,195, 85, 0, 76, 25, 87,207,223,120, 2, 96, 19,154,203, 82, 82, 82, 20, 73, 73, 73,172, 31,
- 50, 67,242, 55, 53, 39,128,171, 61,107, 88,185, 89, 5,107,246,226,226,226,242,151,165,110,197, 35,163,157, 64, 3,208,168,105,
- 56,139,245,213, 84, 91, 79,208,168, 33,208,234,128,130, 66, 29,116, 52,129,181, 37,123,113,113,113,249,111,188,182, 21, 19, 35,
-133,152, 62, 71,136,186, 90,130,218,106,160,190,150, 66,159,190, 4, 58, 13, 5,145, 64,130,170,187, 52,202,126, 87, 99,209,203,
-236, 38,140,101,175,151,145,143, 22, 2, 33, 1,192,154, 87,128, 5, 31,216, 38, 2, 72, 67,253,140,127, 12, 27,186,211, 47,103,
-167,155,215,184,135,209, 13, 64, 55, 10,208, 29, 58,136,188,167,159,172,211, 52,212, 79,231, 98,143, 86, 53, 76,127, 33,106,248,
-174,208,183,178,221,124, 7,143,133,143, 51,133,174, 18, 10,202,243,191, 96,235,107,115,235, 52,202, 6,214,246, 26, 85,202,233,
-113,143,140,223,149,146,254,153,219,128, 33,195,224,238, 42,134,187,139, 51, 74,206,157,194, 27,169, 47,213, 41, 57,216,178,197,
-147,103,115,185,166,200,127,249,242,229,173,194,252, 63,252,240,131, 34, 33, 33, 1,102,146, 4, 49, 68,175, 6,112,170, 95,191,
-126, 37, 42,149,170,135, 80, 40,148,184,186,234,151, 98,109,222,188, 25, 51,103,206,132, 82,169,132, 74,165, 66, 99, 99, 35,220,
-220,220, 84, 58,157, 46,135, 16,114,147,205,201, 58,106, 53,192,131, 50, 4, 96, 24, 5, 96,222,183, 7,241, 51,232,211,199, 15,
-175,166, 37, 99,247,174, 95,145,189,229, 4,156,197,157,241,123,217,189, 17,172,158,254, 3,208,168,174, 65,196,176,254,248,240,
-163,100,188,159,254, 57, 39,123,190,190, 30, 40, 58, 87,212,252,121,216,128, 48, 84, 84, 84,115,178, 55,101,225,116,204, 20, 60,
-137,198,194, 58,140, 94, 48, 16,244, 96, 9,190,248,226,251,230,243,171,174,174,198,216,135, 67, 89,217, 51, 70, 84,102, 20,245,
- 51,126,110, 83, 62,181, 89, 0,180, 5,249,179,177, 25, 21, 21, 69,101,101,101,145, 38,111, 23, 89, 89, 89,196,112, 89,162,177,
-215,111, 74, 32,180,142,195, 82,128, 88, 0,184, 8, 1, 55, 17,208, 88,139,172,247,157, 0,151,163, 36,249,177, 62,128,139, 55,
- 50,191,225,238,245, 91,154,237,207,144, 53,219, 53,236,198,228,111, 60, 39,128,171, 61,182,228,207,198,222,123, 25,107,169, 87,
- 22,206, 35, 18, 9, 64,211,192,160,126,194,123,237,113, 86, 7,141,142, 64, 71, 11, 49, 99,198, 12, 86,226,228,237,119,215, 82,
-139, 22,205, 35, 90, 45,160,214, 16,232,180,128,128, 2, 34,167, 0,181, 85, 20,126, 59,173,132, 82, 37, 64, 98,194, 12,214, 97,
-255,229,207, 1,193, 61,245,255, 7,245, 0,108,141, 4,200,229,242, 35, 50,153, 44,246,230,212,184, 93, 1, 91,119,186, 5,140,
-123, 24,154, 67, 7,241, 99, 66, 92,157,186,182, 54, 86, 46,151, 31,228,104,239,160, 76, 38,139, 61,255,230,180, 93,254,255,202,
-113,235, 49, 98, 28,234,207, 31,194,198,127, 76,173,107,108,224,102,143,177,181, 58,237,239,187,222,249,248, 75,183,209, 99,198,
-162,184,232, 20, 94, 74,126,178,174,161,174,142,243,185,181, 53,204, 37,251,145,201,100, 36, 62, 62,158,205,106, 0,161,167,167,
-231, 41,165, 82,249,109,105,105,105,239, 33, 67,134, 4,106,181, 90,145,147,147, 19,114,114,114, 16, 29, 29, 13,149, 74,133,134,
-134, 6, 92,186,116,169,198,203,203,107,175, 82,169,252,154,166,233,122,176,204, 0,200, 36, 5, 98, 66,236, 92, 66,255, 15,218,
- 16,128, 97, 20,192, 17,237,107, 75,238, 0, 83,120, 52,118, 20, 30,141, 29,213,244,159,253, 26,182,165,189,105,246,137, 59,207,
- 31,208,120,186, 14, 79,127, 54, 5,239,236, 93,102,247,185, 41,159, 81, 18, 47,173, 23, 84,223,168,238,139, 99,109,147, 0,104,
- 15,207,223,216,251, 48, 12, 99,155, 11,245, 59,242, 28,185,140,253, 59,154,252, 13,196,142, 97, 34, 32, 70, 4, 41,154, 34, 29,
-156,236, 89,155, 11,192,213,222, 7, 31,175,165,100, 50, 25, 17, 8,128,131, 5,250,177,126,102,194,159,126,220,127, 6, 39,123,
-171, 86,173,165,230,205,111,202, 73, 33,208,219, 56,186, 31,168,175,163, 65,104, 32, 49,113, 10, 98, 98, 98,172,182, 71,246,122,
- 25, 73,125, 18,240,116, 3,202,110, 3, 46,206, 0, 77,128, 78, 18, 32, 93, 6,164,201,109, 18, 1, 7,101, 50, 89,108, 65, 98,
-220, 46,143,229,111,187,229, 47,127,163,174,209, 6,242, 55,182,151,191,100,234, 46,151,127,188,233,150,251,239,183, 56,147,191,
-161,173, 23, 95,124, 49,238,141,127,190,176,115, 65, 74,170,219,103, 31,102, 48,228,127,218,196,179,175,229, 98,219,218,208, 17,
-215,231,205, 20,249,207,155, 55,143, 48, 43, 1,182,109,219, 70, 40,138,178, 36, 4,220,212,106,117,157, 64, 32,200,243,247,247,
-239, 89, 91, 91,251,226,241,227,199,187, 15, 29, 58,148,214,106,181, 13,213,213,213,183, 78,159, 62,125,165, 79,159, 62, 37, 93,
-186,116, 41, 85, 42,149,155,181, 90,237, 45, 66, 8,107, 1,192, 36, 5, 50,136, 10,216,210,190,210, 54,236, 11, 29,110,219, 81,
-227,254,246,218, 81, 41,133, 14, 61,222,209,246,170, 42, 5,200,208,202, 16,120,216, 15,179, 63,181, 46, 76,170, 42, 5,120, 40,
-192,242, 49,247,147,252,205, 10, 0,107,107,253,185, 62,232,108,115, 7,112,177, 43,151,203, 41,115,155,237,112, 33,175,204,100,
-185, 62,204,127, 17,192, 69,227, 79,171,155,254, 46,195,134,235, 85, 56,138, 92, 13,235, 69, 38,147, 17, 38,207, 64, 74, 74,138,
- 77, 43, 28,140,237,109, 92,212,169, 89, 20,216, 35,154,140,219,132,153,240,103,107, 84, 98,237,231, 45,237,213,213,232, 59,224,
-196,196, 68,110,247,223,183, 14,125,102, 52,134,164,189,111,249,155, 27, 26,107,107,159,182,215,187,102,236,253,244,217, 91, 27,
- 84, 13,181,115,229,114,249, 33, 91,109,125,250,233,167, 7,100, 50, 89,236,103, 31,173,220, 80, 87, 87,103,238,220,180,184,255,
-104,209,163, 26,147,127, 94, 94, 94, 36, 33, 4,219,183,111, 55, 60,198,146,189,107,106,181,218,153, 16, 82, 75,211,180, 92,173,
- 86,255, 26, 16, 16,224, 83, 85, 85, 69,189,254,250,235, 53,213,213,213,119,122,244,232, 81, 91, 87, 87, 87,175, 86,171,107, 52,
- 26, 77,163, 78,167, 83,114, 57, 97, 7, 13, 3,228,183, 97,157,230,227, 79,138,126,253, 6, 83,111,190,150, 73,102, 61, 30,141,
-176,129,125,204, 30, 87, 84,120, 25,155,190,219,131,126,253, 6, 83,247,211,222,144, 33, 67,168,212, 69,114, 50,235,241,104,203,
- 14,243,241, 82,108,250,110, 15,134, 12, 25, 98,245, 94,186,159,228,111, 82, 0, 56,218,179,111,203, 72, 65, 84, 84, 84, 62,171,
- 16,191, 21, 56,114, 86,255,253,136,140,112,217,244,199, 17,209, 0,174,109, 98,184,172,203,222, 33, 9, 99,123, 92,201,223,158,
- 25,255,108, 72, 27, 64, 80, 71,180,231,232,115,115,208,189, 77, 1, 0, 69, 81, 68, 32, 16,128,249, 99, 66,216, 83,166, 76, 65,
-108,108, 44,104,154, 6, 77,211, 32,132, 88,251, 61, 74,171,213,186, 18, 66,116, 52, 77, 55,106, 52,154,253, 66,161,144, 18, 8,
- 4,206, 0,156,105,154,134, 78,167, 19,106,181, 90,177, 86,171,237,174,211,233,206, 27,124,183,205, 55, 1,226,225, 24, 17,112,
-165, 84, 69,118,239,220,130,107, 21, 53,240,243,106,104,254,236,102,165, 43, 2,124, 59,163,127,255,254, 86,201,186,173,236, 13,
- 25, 50,132,186, 89,214, 72,214,124,180, 3,197,191,223,110,101, 47,184,167, 15, 2, 3, 3, 89,145,127, 91,193, 82,142, 20, 42,
- 60, 60,156,223, 30,147, 7, 15, 30, 15, 42, 26, 12, 8,157, 54,112,108, 68, 6,229,229, 0, 60,160,159, 52,206, 19, 63, 15, 30,
-230, 34, 0, 60,120,240,224,241, 0, 65,210, 36, 2,104, 3,226, 23,224,222, 16,135, 8, 64,247,166,247, 52, 95, 93, 60,120,240,
- 2,128, 7, 15, 30,127, 14, 8, 0,184, 25,252,207, 16,191,216,128,244,233,166,227,120,239,159, 7, 15, 94, 0,240,224,193,227,
- 47,210,167,241,164,207,131,135, 5,245,204,131, 7, 15, 30, 60,120,240,248, 43,171,229,249,243,231, 27,110,164, 67, 12,103,216,
-203,100, 50, 98,180,209,206,181,168,168,168,230, 85,141,166, 82,177, 26,218,227,138, 63,163, 61,227,101,139,134,245,201,215, 31,
-223, 30, 29,221, 94,122,122,122,243, 49,105,105,105,148, 13,246, 0, 51,233,128,249,251,217,186, 77,254,249,229,237,113,177,199,
- 89, 0,112, 68, 87, 54, 7, 49,187,247, 57, 74,177, 24, 39, 35, 49,181, 27,160,169, 99,218, 67, 93, 49, 4,147,148,148, 36,101,
-136,134,201, 0,102, 41, 39,248,253,196,246,237,219, 35,183,109,219,214, 76,130, 83,166, 76,145, 38, 38, 38,230,255, 25,213,174,
-169,246, 56,127, 94,191, 50, 44, 52, 52,180, 93,207, 77, 38,147,145,169,211,100,200,201,150,155,188,103,119,238, 58, 65,114,178,
-229, 22,239,229,157,187, 78, 88,236, 4,226, 98, 35,108,190,233,210,211,211, 73, 66, 66, 80,139,255,173,137, 0,107,168,173,171,
-141,220,250,211, 86, 4,134, 5, 42, 64, 1,231, 79,158,147,142, 9, 31,139,208,126,161,156,238,191, 67,135, 14,181,186,238,177,
- 99,199, 82,224,193,131, 71,155, 9, 0, 49,219, 3, 71,143, 30,205,217,184,169,205, 98, 24,152, 34, 81,227,141, 54,216, 18,173,
- 45, 27,227,176, 17, 20,140,221,212,212, 84,100,100,100, 40,204,237, 45,206, 28,103,105,173,166,241, 57,246,232,211, 11, 0,112,
- 75,165,130, 86,217,168, 47,172,170, 1,160,223,251,128, 75,110, 4, 67,242, 7,244,185,197,185,172,181,151,201,100, 68, 64,233,
-179,235, 49,175,128,136, 87,212,158, 0, 0, 14,255, 73, 68, 65, 84,229,247,159,175,189,255,130,204,184, 61, 24,226,183,181, 61,
- 28, 41, 42, 25,242,143,139,141, 80, 1, 50, 73, 78,182,220,230,223, 96, 4,132,105, 1, 32,183,235, 60,213,234, 84,228,230, 38,
- 35, 38, 38, 19, 9, 9, 25,205, 17, 1, 91,132,192,193,162,131,228,161,161,189,240,161,124, 21,188, 92,189, 64,107,117, 80,145,
- 70,197,238, 95,127,138,217,187,239,103, 50, 54,112,156, 84, 34,145, 88, 21, 2,135, 14, 29, 34, 77,145,133, 86, 30, 17, 47, 2,
-120,252,149,113,234,212,169, 22,255,155,234,211,236, 17, 0,156,230, 15,152,218,197,206, 17, 32, 64,164,221, 54, 8,123, 13,192,
-198,115,151,201,100, 36, 53, 53, 21, 43, 86,172, 0,128,230, 87, 83,199, 89,219, 33,172, 21, 60, 59,227, 76,233,119,112, 65, 79,
-232,240, 11, 42,254,115, 2,167, 75,238, 96,198,138,117,237,118,163,157, 57, 91,136,193,131, 6,130, 38, 64, 97,161,254, 61,112,
-239,189, 97, 57,205,178,170, 13,115,176, 91, 66,102,102, 38,197,182, 61,230,206,157, 11, 0,205,175, 38,201,159,162, 0, 11,247,
-131, 76, 38, 35,143, 60,178, 11, 50, 89,172, 67, 69, 64, 92,108, 68, 67,114,114,178, 43,144,137,156,108,110,196,110,232,225,219,
- 75,242,230,188,127, 0,152, 57,115, 51,114,115,245,175,201,201, 37, 96, 34, 2, 92,162, 1,132,144, 72,197,133,189,138, 23,255,
- 49, 31,195,187, 14,133,139,135, 7,136, 90, 11,154,232, 32, 20,137, 17, 28, 21,156,251,219,176, 11, 88,145,153,161, 24,229, 51,
- 90,234,234,234,106, 85, 4,220,190,125,187,197,255, 83,198,119,194,168,133,191,224,241, 12, 85,139,134,156, 52,105,146,205,237,
-149,157,157, 77,166, 77,155,230,176,246,118,180,189, 54, 38,146, 72,123,211,250,158, 58,117, 42,178,137,132,108,181, 51,248,149,
- 87, 94, 41,175,175,175, 15, 0, 48, 25,250, 77, 56, 67, 1,156,130,126, 83, 40, 0,216, 40,151,203,127,227,169,191, 53,249, 51,
-101,198, 34,160,133, 0, 40, 45, 45, 37,165,165,165, 0,128,192,192, 64, 24,110, 54, 3,160,197,255,166, 62, 55,135,138,138, 10,
- 69, 86, 86, 22,235, 72,128,241, 94,247,150, 72,152,106, 74,133,105, 76,162, 92, 67,236,153,153,153, 86,143,201,203,203, 99, 69,
-254, 73, 73, 73,102, 73,127,233,210,165,200,200,200,128,161, 64, 96,131, 30,125,122,225, 70,101, 53,126,156, 55, 19, 93,168,113,
- 40,249, 98, 17, 2,167, 7, 98, 79, 59,147, 63,128,102,194, 7,128,129, 3, 7,182, 40,103, 34, 3,134,229,142,246,236, 45, 17,
- 49,211, 30,230, 72,127,253,250,245,200,200,200, 64,236,184,161,216,245,203, 73,192,189, 19, 80, 83,119,223,235,112,231,174, 19,
-174, 64, 38,118,238, 58,225, 16,123,211,106,150, 89,124, 54,179, 59,191,199,234, 1, 49, 12,253, 39, 39,231, 34, 33, 33,168,249,
-149, 65, 66, 66, 16,107, 17,240,197,255,190,192,251,159,190,139,241,125, 35,161,107,108,132, 86,167, 5, 37,162, 0, 8, 65, 64,
-227,214, 31,101, 8,237,218, 31,203,230, 45,195,187, 43,223, 85, 60, 50,208,122, 52,203,184,179,155,226,191,222, 36,225,239,221,
-187,151,216, 34, 2,178,179,179,201,206,215,119, 33,238, 29, 56,132,180,179,179,179,201,202,149, 43,177,100,201,146, 14, 45, 2,
- 78,157, 58, 21, 89, 93, 93,173, 40, 43, 43, 67,120,120,184, 93,231, 89, 93, 93,173,184,215,101,219,244,156,151, 2,152, 11,224,
- 36,128,175, 1, 68, 3,120, 20,192,223, 13, 4,192,237, 63, 41,159, 83,176,176, 13,184, 69, 71, 42, 85,207, 49,153, 25, 75, 77,
-126,222, 66, 0, 4, 6, 6, 82,129,129,129,205,100,111, 24, 74,206,202,202,106,241,191,241,231,151, 46, 93, 50,123,130,140,168,
- 72, 73, 73, 81,164,166,166,194,120,163, 28,227,205,115,178,178,178,204,134, 96, 77,117,246,198,101,237,185, 81, 17, 0,108,218,
-180,201, 44,241, 3,104, 65,254, 75,151, 46,101,101,243,247,210,107,168,223,242, 6,220,158,253, 24, 61,250,244, 66,183, 46, 46,
- 40,221, 82,170, 39,127,207,206,250, 33, 0, 39, 33,231,115, 77, 72, 72,144, 26, 14, 3, 36, 36, 36,112,142,210,208, 4, 8,232,
- 4,252,251, 73,224,249,245, 64, 87, 87,224,124,149,233,242,162, 74,142,119,190, 25, 33,199, 37,106,243,246,219,111,155, 37,126,
- 0, 88, 57, 55, 30,107,118, 31,129, 95, 96,119,220,188,122,203,170,247, 15, 0,108,162, 0, 92,194,248,122, 15, 95,102,210,211,
-103,198,246,185,222,215, 43,255,107,190,142, 66,230,193,134,123, 37,168,197,171, 58, 33, 24,226,109,197,172,191,223,160,108,192,
-184,217, 99, 21,163,187,143, 66, 99,125, 61, 68,206,206, 16,137,238,117, 65,165,197,197,216,154,147,115,227,217,103,230,246,232,
-237, 28,128,161, 19,195,163,126,205,253, 53,114,212,240, 81,156,188,198,244,157,115,177,111,223, 62, 60,246, 88,203,242, 73,147,
- 38, 81, 92, 69, 0, 67,254,232,253, 33,118,190,254,178,221, 34, 32, 59, 59,155,124,244,209, 71, 8, 9, 9,193,154, 53,107,176,
- 96,193,130, 14, 39, 2, 12,137,223, 81,246, 24, 91,118, 68, 19,164, 0, 38, 2, 88, 79, 8,169,163, 40,202, 15,192, 5, 0, 87,
-229,114,185, 22,127,110, 16,142,245,221,130,252,153,247,153, 25, 75, 91, 69, 1,238, 75, 30,128,172,172, 44,102,236, 21,165,165,
-165,240,245,245,109, 37, 16,152,178,138,138, 10, 86,121,238,173, 77, 6,228,210, 97,206,154, 53,171,237,164,155, 1,129,153,242,
-250, 51, 50, 50, 32,151,203, 41,107,179, 56,149,184,134,186,233,163, 64,220, 23, 1, 81,175,163, 14,255, 3,254,163,247, 22, 73,
-214, 34, 56,253,109, 13,180, 90,238,137,206,226,227,227,243, 89,108,187,106, 57,194,243, 21,240,214, 90,160, 87, 79,224,214,118,
- 49, 54,124,169,198,220,239,204,151,115,186,243,137, 99, 51, 85, 27, 78,246, 43,207, 94, 1,247, 48, 9,220,250,254, 19,155, 86,
- 60,143, 33, 3,253,208, 47,254, 93, 86,237,193,230,254,100, 59, 84,192,220,187,134,228, 47,151,203, 41,102,226,159, 77, 68,211,
-249, 61,202, 22,146, 55, 5,117, 66,176,201,242, 92,163, 72,128, 53,148, 87,148, 99,114,210,100,184,119,246,130,142,210,226,192,
-190,253,168,173,171, 67, 66, 98, 34,254,168,168,192, 15,155,127,196,115,207,204,237,225, 44,113,134,128, 56, 33, 38, 34, 38,239,
-130, 98,141, 77, 94, 99,101,101,165,221,215,109, 72,254, 0,236, 22, 1,217,217,217,100,249,242,229, 8, 14,214,215,103, 80, 80,
- 16, 58, 82, 36,192,209,196,111,194,251,103,222,219,114,173, 3,154,136,208,137,162, 40, 87, 0, 97, 0,206, 1,232, 33,147,201,
-106, 0, 84,201,229,114, 62,173, 61, 71,220,183, 68, 64,190,190,190,210,164,164,164, 86, 67, 1, 71,142, 28, 81, 52,109,246,194,
-121,142,128,185,201,128,150, 60, 71,115, 2,165, 45,192,120,247,230,194,253,108,189,127, 0,216,253,234,114, 36,188,255, 1,180,
- 81,227, 32, 2,224,118,184, 24,123, 74,238, 0, 0,180, 81, 11,160, 57,235, 3,170,235,223, 57,147, 20,219, 40,139, 37,220,153,
-246, 63, 44,120,230, 58, 46,206, 91,130,250,159,213,240,243,177, 92,238,136, 8,128, 45,226, 96,253,250,245,122, 53,156, 48, 1,
- 71,202, 42,224, 62,196, 29, 55,114, 75, 0,137, 51,102, 46,248, 27,188,123,198,183,219,131,104,110,214,191,163,162, 90,150, 86,
- 8, 88, 91, 29,144,155,156,139,152,204, 24,204,220, 12, 36,231,234,223,231, 38,231,114,142, 2,212,169,106,225,227,210, 5, 90,
- 85, 3,136,128, 96,196,200,145,216,178,101,139,234,163, 15, 62,144,208,132, 96,206,147,115,224,221,197, 27, 13,117,117,208,234,
-180,112,119,234, 12,141, 64, 99,211,245, 86, 85, 85,181, 88, 29,192,117, 66, 96, 43,242,103, 96,163, 8,200,206,206, 38,169,169,
-169, 24, 57,114,100,139,242,129, 3, 7, 34, 61, 61, 29,105,105,105,237, 38, 2,218,138,248,141,189,127, 0, 40, 43, 43,179, 53,
- 10,240, 43,244,227,253, 53,208,135,254, 39, 3,184, 4, 96, 48,128, 28, 0,235,208,180, 83,167,165,238, 4, 54,134,210,255, 18,
- 2,192,152, 16,152, 61,231,217,124,110,105,214, 52, 3,102,120,129,153, 16,200,204, 13, 96,162, 3,129,129,129, 10,102,184,160,
-189, 58, 94, 71,194,218, 88, 63,227,253,179,177, 53, 99,237,102,144,196, 62,184, 53, 38, 2, 93, 48, 14, 46, 51,215, 64, 91,254,
- 7,224,217, 25,162, 59,255,195,246,143, 10, 0,161,144,243,181,219,178, 10,194, 24,167, 95,249, 63, 12, 15, 7, 2, 23, 20, 34,
-204,237, 25, 92,120, 40, 9,248,247, 18,179,229,237, 21, 1,200,200,200,192,248, 17,253, 16, 53, 46, 4, 9,131,150, 96,245, 71,
-159,227, 92,193, 13,204,155, 52, 28, 55,115,118,162,186,178,198, 33,247,131,169,161, 2,107,207,135, 37,111,223, 81,247,168, 57,
-251,150, 38, 14,166,165,165, 81,233,233,233,100,230,230,150,130, 0, 0, 98, 50, 99, 32,222, 86,140,109,219, 74,154, 87, 2, 48,
- 19, 6,189,189,189, 77,246,191, 52, 77, 67, 71, 3,132,214,194,217, 69,130, 39,159,122, 74,242,214,155,111,162, 91,183,110,116,
- 15, 63, 63,129,170,190, 14, 58, 2, 16, 90, 7,154,182, 30,209, 26, 59,118, 44,245,195, 15, 63,144, 59,119,238,160,166,166,166,
-133,112, 52, 92, 29,192,101, 85, 64,118,118, 54, 89,253,124, 17, 32, 9, 6,110,126,218,250, 0, 73, 48, 86, 63, 95,132,148,255,
-176, 19, 1,217,217,217,100,234,212,169,210,129, 3, 7, 42,238,220,185,211,234,243,128,128, 0, 76,157, 58, 85,250, 32, 77, 12,
-180,197,251,183, 39, 10, 32,151,203,243, 13,158,175,238, 0, 78, 3,152, 46,151,203,185,108,101,202,147,191, 37, 1, 96,148,232,
-199, 90, 34,160, 22,159, 91, 10,153, 38, 37, 37,153,140, 2, 48,100,239,235,235, 43, 77, 77, 77, 85, 48, 99,178, 73, 73, 73, 22,
-151, 1, 90,242, 14,185, 78,254,107,171,101,128,140,119,111,105, 50, 32, 23,148,252, 43, 25, 78, 51,215, 64, 89,118, 17,162,195,
-107,160,217,188, 0, 84,220, 42,108,253,251, 99,184,186,245, 50, 18, 86,126, 13,136,218, 39,179,243,146, 44, 32,119,229, 22,132,
- 93,141, 1,110,215, 99,113,244, 18,139,229,142,136, 0,216,234,253,231,108, 89, 14, 97,143, 1,112, 67, 8,174,237,203, 68, 45,
- 69,112,244,226,117, 68, 21,222, 96,217,238,215,154,255,159, 53, 75,222,130,236, 1,224,231,159, 99, 77, 30,103,233,249,176, 22,
-234,119,196,178, 67, 71,172, 16, 72,206,189, 71,252, 0, 90,121,254,204,132,193,109,219, 74, 76,126,223,221,197, 29,101,213,101,
- 24,217,123, 20,148,141, 42, 64,169,130, 86,173,193,178,212, 84, 80, 2, 8, 26,234,235, 64,211, 58,104,117, 4,206, 34, 39,252,
- 81,247, 7,156,116,214, 87, 27, 63,246,216, 99,205,117,115,232,208, 33,194,244, 55,134,171, 3,202,203,203, 89, 95,231,180,105,
-211,168,148,255,128,172,126,190, 8,161,125, 90,255,254,249,203,106,164,252, 39, 12,108,201,122,218,180,105, 84,118,118, 54, 25,
- 57,114, 36, 2, 2, 2, 90,125, 94, 88, 88,136,156,156, 28, 69,123,145,127,147, 55, 78,181,229,216,191, 33,236,136, 2, 48,152,
- 12,253,228,239, 70,158,194, 29, 40, 0,218, 10,140,231, 15, 0,163, 71,143,150,102,101,101, 41,152,208,191, 25,113, 32,189,116,
-233,146,130, 43, 9,219,218, 73, 58,122, 25,160,161,247,111,138,248, 25,161,195,229,124, 79,151,220,129,230,236, 91,184,133, 95,
-224, 23,183, 10,168,174, 65, 73,230, 34, 4,205,255, 16, 55,215, 45, 2,156, 68,128,160,125, 50, 59, 95,171, 7, 66,125,167,179,
- 46,111,143, 8, 64, 70, 70, 70,221,236,168, 81,229, 30,180, 87,175, 6, 56, 73, 54,127,184, 0,159,109, 63,133,197,143, 62,140,
-185, 31,252, 23,143,189,247, 77,187, 76, 30,101, 4,104, 83, 30, 0,202, 94,113,106, 79,168,223, 82, 20, 32,185,201,179, 55, 38,
-127, 67,239,223, 26,252,125,253,177,251, 64, 46,198,246, 26, 11,215, 78,110,160,105, 2, 1,209,130,166, 40, 16, 66,160, 35,128,
-150, 38,208,106,181, 80, 86,215, 99,199,177, 29, 16,235,196,156, 39,165, 26,175, 10, 72, 91, 48, 14, 83,252, 75,145,121,140,189,
- 13,115, 34,128, 43,249, 27,218, 75, 75, 75, 35, 43, 87,174, 68,247,238,221,239, 9,251,146, 18,100,100,100,160, 35,120,254,142,
- 22, 2,166,188,127,123,162, 0, 77,207, 68, 36,128,135, 0,188,246, 23,152,252, 7, 0, 66, 0,186, 7, 90, 0, 24,207,250, 79,
- 74, 74,106, 30,119, 55, 20, 7,134,239,237,241,224,109,233,200, 29,181, 12,208,156,247,111, 43,241, 51,152,177, 98, 29,126, 4,
-240,232,251, 83, 64,178, 22,129,154,181, 26,167, 75,238,128,242,246, 66,241,239, 53,122,239, 95, 40,108,151, 59,212,220,122,127,
-123,242, 0,176, 17, 92,108,197,193,250,245,235,213, 0,106,159,143, 28, 92,243,207, 85, 31,171, 95, 93,150,170,234,218,217,247,
- 78,209,185,107,221,230,158,251,175, 91,123,175, 26, 49, 71,206,134, 67, 52,220, 87, 20,152,250, 13,251, 34, 0,166,200,159,241,
-252, 1, 88,157, 16, 40,145, 72,168,115, 91,207, 39, 42,198,229,231, 36, 13,122, 12, 53,170, 26, 80, 2, 64,159, 82,132,134, 78,
- 71, 64,107,181,232,228,236,142, 67,213, 39,113,233,112, 49,162, 35,162,243,237,174,220,146, 23, 0,112, 95, 6,216, 66, 4,116,
-191,134,243,229, 1, 54,145,191,161,189, 37, 75,150,144, 53,107,214,192,211,211, 19,119,238,220,193,242,229,203,209,209,194,254,
-142, 16, 2,230,188,127, 91,162, 0, 50,153,172, 27, 0,191,166, 27,101, 40,128, 20, 0, 37,127, 17, 39, 93,215,150,198,239, 75,
- 30, 0,115, 17,129,213,171, 87, 75,141,133, 66, 82, 82,146,130,171, 61, 67, 34,232, 8, 41,118, 13,189,127,227,229,127,165,165,
-165, 45,234,141, 75,214, 62, 70, 4, 76,127,255, 43,144,205,128,207, 92, 57,242,255,249, 24, 30,206,216, 8, 56, 57,161,147, 68,
-220, 46,215,107,184,198,223,212,123, 27,243, 0,104, 1, 8,154,218, 86, 96,103,123,220,154, 29, 53,170,236,159,153,219,250, 44,
-123,110,114,103,127,191, 72, 53,128, 51, 73, 73, 73, 30, 0,220,108,109,143,123, 36, 29, 75, 30,121,100,151, 65,248,159,219,247,
- 45,121,240,134,233,129,217, 10,137,182, 72, 6,100, 14,198,164,207, 68, 4,204, 13,121, 60, 61,235,233,173,219,254,187, 13,186,
-217,218, 51, 19,123, 77, 28,220,197,189, 11, 84, 26, 21, 8, 33, 16,139,196,168, 82, 54,224,200,239, 63, 99,253,183, 27, 32, 29,
- 32,117, 72,226,176,244,157,115,177, 97,195, 6, 44, 90,196, 61, 7,192, 61, 17, 0,187,200,223,208,222,130, 5, 11,152, 60, 0,
-232,200, 99,254,134, 66,192,150,239,218,155, 59,192,240, 49,128,126,189,191, 10,192, 43, 0,142,201,229,114, 29,120,152,171,123,
-156, 58,117, 10,153, 25, 75, 91,229, 1,176,152, 8,168,173,242, 0,152,138, 8,152, 35,122, 91,162, 0,246,162,173,150, 1, 50,
- 98, 68, 46,151, 35, 47, 47,143, 46, 45, 45, 53, 36, 50,105, 84, 84, 20,103,239,102,198,138,117,128, 65,226,159,137,203,214, 54,
-191,175,111,135,155,173,173,188,103,138,162, 62, 2,112, 23,250,229, 63, 79,218,105,238,230,243,145,131, 27,163,243,126,237, 60,
-231,205,175, 33,151,203,197,121,121,121,221,209, 50,157,181, 77,237,209,214,145, 0,107,249,253,173,161, 45,134, 4,204,145,191,
- 58, 33, 24,216,102,221, 49,147, 14,158, 68,237,251,225, 0, 57, 28,112, 4,227, 70,141, 67, 15,247, 30, 0, 77,240,135,234, 14,
- 14,157, 56,132,155, 69, 55, 49, 41,116,146,212,217,217,185,221,219,195, 80, 4, 56,138,172,153, 72,192,131, 50,225,207,222, 44,
-128, 14,232, 99, 50, 1,100,130, 7,103,152, 75, 0,100, 82, 0,180, 21, 82, 82, 82, 76,146,189,225, 78,108, 70, 80,176, 89, 85,
-224, 40,175,191, 45,150, 1, 54,205,240,215,230,229,229,137,154,134, 14, 24,242,159, 20, 21, 21,197, 41,202,209,180,153,146,194,
-209,231,104,110,140,217,209,185,238, 57,194, 25,128, 72, 46,151,191,110, 16, 2,123,202, 94,155,209,175,125, 81, 32,151,203, 39,
-228,229,229, 33, 47, 47, 79, 5, 64,210,244,103, 55,241, 51, 81, 0, 91,235,204, 26,201, 79,157, 38,107,113, 28, 87,226,118,196,
-144, 64, 90, 90, 26,149,158,156, 78,252, 23,248, 75,209,219,244, 49,101,201,185, 10,182,243, 1, 70,134,141,164, 26, 26, 26, 34,
-215,189,191, 14, 1,193, 15, 41, 0,224, 66,225,111,210,248,232, 4,132,134,135,218,220, 30, 99,199,142,165, 54,111,222,220,106,
- 85,128, 70,163,177,235, 6,114, 52, 89,255,217,102,251,119, 0,240, 75,252, 76, 68, 1,140,203, 88, 11, 0,107,158, 56, 91, 79,
-221,214, 78,145,109, 34, 22,123,137,202,209, 68,199,216,203,203,203, 35,121,121,121, 34,195,250, 10, 12, 12,180,233,183,154, 8,
-202,225, 29, 70, 71, 24,251, 54, 1,119, 0,117,250,132,252, 20, 5,192, 5,214,215,247,178,105,143, 43,121,121,121,204,186,178,
-154,192,192,192,174,129,129,129,206, 29,161, 46,237,245,196,173,217,118,212,144,128, 85,114, 79,227,118,143,186,186,186,230,207,
-154, 58,155,233,188, 49, 58,108,180, 67,206,115,230,204,153, 60,185,254,249,201,222,144,195, 52, 14, 38,127, 9,244,195, 13, 15,
-188, 8,176, 90,145,225,225,225,188,106,226,193,131, 7, 15, 30, 60,254, 98, 16,240, 85,192,131, 7, 15, 30, 60,120,240, 2,128,
- 7, 15, 30, 60,120,240,224,241, 23,192,255, 3,211,238,250, 72,118, 88, 93,170, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
+137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0,
+ 2, 0, 0, 0, 1, 0, 8, 6, 0, 0, 0,197,144,206,103, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6,
+ 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,
+154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,216, 9, 7, 16, 32, 48, 13, 5,217, 84, 0, 0, 32, 0, 73, 68, 65, 84,120,218,
+236,125,121, 92, 84, 85,255,255,251,220,217,217, 23, 1, 21,133,193,125, 95,201, 37, 55, 40, 49, 51,205, 52,192,212, 36,219,196,
+210,180,178,180,111,249, 60,233, 79,159, 12,148,202,212,132,158, 74,179,210, 18,151,180, 92, 18,116, 80, 83, 82,209, 92,202, 5,
+ 69, 1, 65,145,101, 86,102,187,115,231,222,223, 31, 51,131, 3, 2,179,128, 73, 61,243,126,113, 95,195, 93,230, 51,231,158,237,
+253,249,124,206,231,156, 67,250,245,235,199,193, 3, 15, 60,240,192, 3, 15, 60,248,159, 2,229,201, 2, 15, 60,240,192, 3, 15,
+ 60,248,223,193,153,223,179, 1, 0,196,227, 1,240,192, 3, 15, 60,240,192, 3,143, 7,192, 3, 15, 60,240,192, 3, 15, 60,240,
+ 40, 0, 30,120,224,129, 7, 30,120,224,129, 71, 1,240,192, 3, 15, 60,240,192, 3, 15,254, 17,224,219,159,156, 61,123,150,184,
+ 43,168,190, 88, 2,143, 60,143,188,134,144,145,145,193,173, 95,191,254,129,165,111,234,212,169,220,150, 45, 91,136,167, 60,254,
+214,242,208, 4,121,240,228,159, 71,222, 63, 89,158,203, 10,192,255, 56,234,102, 32,105,201,233, 76, 79, 79,199,236,217,179,137,
+167,216,220, 47,227,184,184,184,154,243,172,172,172,127, 68, 94, 78,124, 42,185,209,142, 96,215,143, 25,255,232, 58, 35, 9,220,
+ 9,177,161, 19,162, 64,163, 26,251,144,175, 95,220,146,235,162,167,253,122,208,114, 60, 0,127, 69,101,157, 56,113, 98,204,174,
+ 93,187,100,118,231,177,187,118,237,202,105, 17, 45,146,179,244,157,132,180,216,118,201, 21, 22, 22, 2, 0,164, 82,233,223,169,
+ 19,113, 90, 59,157, 58,117,170,211,207,110,217,178,197, 21, 69,141,219,186,117,107,205,201,206,157, 59, 17, 23, 23, 87,235,254,
+131, 82, 2,242,242,242, 56, 0,136,142,142, 38,205,241,220,174, 31, 51,238,107,249,133, 71,181, 7, 0,220, 49, 24,192,232,141,
+150,139, 74, 53, 0, 32, 33, 33, 1,153,153,153, 13,166,111, 96,193, 64,174,243,237,206, 46,253,248,247,195,191,119,162, 92, 36,
+ 8,124,245, 2, 12,187,118, 66,161,152, 4, 5,128, 1,146,149, 88, 44, 57,141,246, 98,160,194, 80,128,197,250, 68,151,126, 55,
+ 33, 33, 33, 38, 51, 51, 83, 86,231, 90,108,102,102,102, 78, 11,107, 91,205, 82,111,255, 38,239,219,236,104, 19, 44, 34, 62, 2,
+127, 98, 20, 11, 57,163, 82, 79, 85,235,213,172,214,104,250,159,152, 29,231, 80, 1,176, 18,182,237,179,169, 21,129,219,181,107,
+ 23,150,110, 93, 14,159,246,254,168,190,169,194,251,137,139,101, 45,220,226,110, 73, 32, 82,169,148, 43, 44, 44, 68, 97, 97, 33,
+246,239,223,143,217,179,103,183, 84, 37,192,214,128, 72, 70, 70,134, 32, 57, 57,217,148,154,154,122, 10, 0, 22, 46, 92,248, 80,
+ 99, 95,156, 52,105, 82,205,255, 12, 99, 6,109, 50,130, 54,210,160,105,203,193, 48, 12, 22, 46, 92,232, 82, 90,236,201,191, 62,
+ 88,149, 1,238, 65,122, 2, 92, 81,126, 30,152,133, 31,224,135,243,215,191,135, 4,237, 96,198, 49,148,127,113, 6,231, 10,170,
+ 48,249,195, 13, 78,125,189,243,237,206, 78, 18,186, 5,207,252,250,140,195, 60,145,140, 91,140,160,137, 47,162,244,245, 1,128,
+ 94, 81,115,253,140,254,109,156, 1, 0, 61, 48, 82,146,128,131,129,167, 17, 0, 96,160, 98,160, 83,117, 38, 51, 51,243,158,139,
+118, 4, 73, 90, 80, 27,107,142, 62,224,239,240,190,205,138, 97,125,250,145,103,195,163,248,202,136, 86,188,208,238,225, 20,159,
+132, 18,157, 74,197,138, 17,102,166,250,183, 51, 63, 55, 97,140,217, 73, 81,183, 92,248,217,182, 78, 60,179,192, 5,121,105,247,
+ 85, 1,216,181,107,151,108,235,191,222, 69,226,178, 15,100, 77,172, 4,156,141,248, 1,160, 82, 87, 5, 4, 3,255,119,112, 9,
+212,215, 21, 88,247,242,234,150, 70,100, 13,117, 60, 15, 58,141, 53, 74,192,216,177, 99, 81, 88, 88, 8,169, 84,218,226,242, 78,
+ 38,179,244, 27,177,177,177, 28, 0, 42, 35, 35, 35, 60, 57, 57,185, 52, 53, 53,245,180,179, 66, 24,134, 1, 77,155,106,136,223,
+158,252,243,242,242, 16, 29, 29,237, 82,162, 18, 19, 19,237,201, 22, 89, 89, 89,117, 21,128,230,168, 43, 46,151, 67,116,116, 52,
+153, 58,117, 42, 55,102,204,152,123,238, 29, 56,112,192,230,233,176,121, 61,156,150,223,156,195, 1,225, 81,237, 81,170, 80, 97,
+199,236,167, 17, 76,134,161,224,191,111,161,195,164, 14,200,114,129,252,107, 50,203,234,106, 35,205,224,106, 11,223,122, 12,186,
+162,106,148, 38, 71, 53,250,220, 5,113, 54,150,246,190,131, 21, 23,222,107,106,121, 54, 7,233, 54,167, 12, 52,179,172,251,241,
+190,205,130,164,164, 36, 47, 0, 15, 3,240,177,187,172, 4,112,126,211,166, 77,114,103,229,124,178,254, 19,138,174, 52, 10,104,
+163, 65,172,128, 73, 44, 16,240,249,106,131,152, 18, 10,245, 44,207,207,155,161, 37, 38, 19,191,236,150,241,235, 47, 54, 26,158,
+123,105,166,217,153,247, 86, 42,149,255,177,253,159,159,159, 95,233,237,237, 77,105,181, 90,214,254,153, 65,131, 6,125,220,204,
+196,190,160,169,121,202,119,100,253, 95,186,116, 9,157,125,252,236,189, 1,238,120, 1,106,200,191, 82, 87,133, 21,143, 46,169,
+185,241,252,174, 87,129, 80, 96, 82,106, 34,118, 46,220,234, 74, 37,107,172,115,107,114, 69,189,121,243, 38, 0,160,125,251,246,
+181,254,135, 11,238,236,102, 84, 68, 72, 67, 74,128,201,196,216,226, 1,154,197, 10,104,134,188,180, 39,127, 0, 32,201,201,201,
+ 0,112, 43, 35, 35, 35, 48, 57, 57, 89,225, 52,249,155, 76,160,105, 35,140, 52, 13, 83, 29,242,231, 88,215,138, 33, 49, 49, 17,
+121,121,121,119, 91, 87, 90, 26,226,227,227,107,206,183,109,219,214,100,101,199, 78,225,105,114,253,179, 39,254,169, 83,167,162,
+127,255,254, 54, 5,192, 85,143, 64,179, 84,194,146,235,197,208,238,252, 55,124, 94, 88,141,240,168,246, 8, 11,150,224,250,206,
+235, 22,242, 15,240,179, 12, 1, 8,120,206,105,176,205, 52,198,214,229,226, 53,220,124,127, 57,244,153, 27, 27,247, 16, 72, 36,
+ 48, 24, 12, 40, 40, 40, 64,185,225, 10,186, 32,188,193,103,173,110,240,198,234, 62,177,181, 19,235,179, 57,110,180, 47, 98,215,
+174, 57, 55,219, 25,105,132,184,157,174,131,245,189,111,124,124, 60, 71, 8,177, 13,229, 52,229,125,109,109,153,227,243,249, 77,
+ 42,243,164,164, 36,127, 0,147, 14, 30, 60,248,111,150,101,141,118,117,137,207,227,241,188,147,146,146, 94,218,180,105,211, 94,
+135,140,185,104, 1,191,242, 86,133, 88, 32, 16,121, 83,124,226,199,241, 68, 94, 44,143,199,103, 9, 5,150,240,205, 28,143,103,
+228,177,196,160,229,153,117,222, 66, 1,249,226,216, 94,195,220,148,153, 44,138, 29,167, 81,161, 80,168,117, 58, 29, 3, 0, 90,
+173,150,125,247,221,119,107, 8,255,131, 15, 62,120,163,169,245,125,244,232,209,179,109,255,103,103,103,167, 55, 71, 27,162, 28,
+ 89,255,203,167,196,195, 80, 81,129,183,122,118,131,253,216,189,211, 86,200,196,137, 49, 0,106,145,255,196,137, 19, 99, 1,144,
+137, 19, 39,198,110,152,248,153,197,179,216,181, 85,173,231,157,193,194,117,249, 88,184, 46, 31,115, 86, 93,194,115,203,254,192,
+228,255, 59,219,244,142,174,164,196, 41,197,224,175, 34,127,235,152, 63,215,128, 39, 0, 38,154,198,224, 65,131,154, 67,201,224,
+182,110,221,138,173, 91,183, 66, 38,147,213, 28, 46, 42, 60,156, 76, 38, 67,108,108,108, 13,249,219,223, 76, 78, 78, 86, 58,211,
+ 49, 49,140,217, 98,249, 27, 45,174,255,186,228,111, 54,155,161,213,107, 93,122, 65,155,199,160,174,215, 96,219,182,109,216,182,
+109, 91, 45,101,192,165,247,205,169,221, 31, 90,207,155,164, 36,218,200,127,234,212,169, 72, 77, 77,173, 33,127, 1, 95,224, 42,
+249,219, 58,240,134, 14,167,161, 71, 49,170, 39, 13, 6,151,249, 22, 74,174, 23,131,155,212,253,110, 38,100,190, 5,126,155, 16,
+ 32, 32,224, 47,213,140,181,149, 5,208,103,110, 4,199,113,184,112,225, 2, 70,142, 28, 9,137, 68, 82,139,248, 3, 3, 3,161,
+215,235,161,215,235, 81, 90, 90,138,105,250,121,248, 34,240,245, 6,101, 58,233,242, 38,117,158,117,149,184,155,203, 88, 33, 13,
+144,191,211,117,176,238,251,198,199,199,115,219,182,109, 67,102,102, 38, 18, 18, 18,184,166,190,175,149,252,193, 48,140,219,109,
+ 34, 41, 41, 73, 12,224,229,236,236,236,119,151, 45, 91,118,130, 16, 34,181, 29, 0,218, 5, 7, 7,123, 29, 58,116,104,125, 82,
+ 82,210,200,198,228,124,150,190,158,199, 35, 2, 17,205,112,126, 70,163, 41,212,204,178,237,204, 44, 27,101, 38, 36, 2, 60, 94,
+ 48, 33, 36, 0,132,231,199,114, 8,226,104, 54, 64,173, 55,121,135,250, 49, 60,106,144,198,169, 50,210,233,116, 76, 93,171,191,
+165,131,106,140,184,187,116,233,130,206, 62,126,208,149,221,198,227,253, 7,184, 76,208, 54, 37, 98,233,214,229, 0, 80, 67,254,
+ 54, 47,194,174, 93,187,114,108, 74, 64,137,250, 22, 6, 44, 28,226,146,146,161,213,155,161,213,155,113,187,202,136,210, 10, 3,
+110,222, 49,184, 69,124,182,198,226,136,252, 31, 20, 26, 81, 2, 96,160,141, 48, 24, 12, 77, 17,207,201,100, 50,216,198,200, 67,
+ 66, 66,236,173, 89,184,208,153,212,178,132, 27,113, 37, 58,236,244,104,147,209, 98,249, 27,105,208,166,218,228,111, 50,153,160,
+213,106,161, 81,107, 30,116,177,112, 91,183,102,214,126, 37,203, 31,172,215,221,234,240,236,201,223, 70,252, 20, 69, 65, 44, 22,
+195,219,199,171, 73, 9,158,248, 84, 50,215,208,225,232,187,251,255,111, 9,130, 49, 12,204,232,215, 0, 0, 62,185,215,112,174,
+160,202,210,201,143,126, 13,166, 11, 75,129,202, 42,215, 50,208, 10,119,223,199, 27,149, 0,128,141, 27, 55, 98,215,174, 93, 88,
+185,114, 37, 78,158, 60, 9,163,209,136,242,242,114,155, 85, 86,243,124,120,120, 56,244, 0,120,184,241, 64,234, 75, 35,245,158,
+ 52, 65,105, 36,141,120,240, 92,150,105,239, 9,171, 47, 38,192, 29,242, 7, 0,119,149,128,164,164,164,214, 86,242,159,245,245,
+215, 95, 95, 92,188,120,241, 83,155, 55,111, 70,151, 46, 93, 0, 0,145,145,145, 80,169, 84,162,165, 75,151,158, 62,116,232,208,
+183, 73, 73, 73,210, 6,115,137,229, 8, 88, 70,108, 54, 51, 65,102,198,220,206,100, 54,117,226, 81,164,173,144, 79, 9,196, 2,
+158,158,239, 37, 84,122,251,242,212, 60, 49,199,136,121, 60,111, 62, 67,251,221, 56,243,187,104, 70,200, 39, 14,211,157,159,159,
+ 95,169,213,106,217,250,220,252,125,251,246,189, 66,211,116,179, 85,164,190,125,251, 54,155, 44,126, 99,196,253,223, 89, 47,222,
+ 37,219,146,155,120,171,103, 55,172,178, 16,180, 75, 90,171,205,250,183,145,126,157,223,169, 57, 15,238,221,218,165,196, 87,235,
+205,208,232, 24,168,181, 12, 84,213, 12,148, 26,198,245, 86, 89, 79,228,191,189,149,111,255,255,245,235,215,161, 84, 42,255,178,
+ 30, 35, 61, 61, 29, 82,169, 20,182,160,191, 58, 99,253, 92,122,122, 58, 12,122,125, 83, 20, 0,110,195,134, 13, 40, 41, 45,133,
+128,199, 67, 88,235,214,181,200,255,209, 71, 31,197,193,131, 7,157,237,156, 72,108,108,108, 93, 37,160,150, 39,195,217, 88, 5,
+218, 72,131, 54, 26, 97, 50,209, 96, 24,115, 13,249, 27,141, 70,232,116, 58, 84, 87, 87, 67,163,113, 93, 1,176, 31, 2,176,193,
+ 93,203,127,107,230, 86,128, 3, 42,173, 68, 99, 29,212, 6,225, 56,139, 18,144,153,137, 68,139, 5,229, 82, 91,169, 75,254, 2,
+129, 0, 34,145, 8, 98,177, 24, 98,177,184,201,117,170,161, 33,129,250,230,197,219, 99,114,250,118,112, 79, 70,225,206,208, 1,
+ 8,198, 48, 72,158, 94, 3,230,118, 5, 16,224, 7,126,213, 22,252,252,201,105,128,199,115, 41, 45, 77, 29, 10,208,242, 44,125,
+202,138, 21, 43, 80, 81, 81,129,245,235,215,163,111,223,190, 88,182,108, 25, 6, 12, 24, 0,189, 94, 95,215, 66,179,169,212,127,
+ 53,241, 59, 75,208,238, 14, 7, 52,164, 72,184, 44,199, 58,139,163,166,109,184, 59, 52,102, 79,254, 53,100, 99, 85, 2, 92, 28,
+ 14,240, 61,127,254,252,167,175,188,242,202,145,222,189,123,251, 1,192,146, 37, 75,144,159,159, 15, 0, 24, 50,100, 8,118,236,
+216,129,225,195,135,123, 79,155, 54,173, 32, 39, 39, 39,251,249,231,159,159,246,251,239,191,223,147,179, 65,193, 65,236,245,235,
+ 5, 76,142,236,224,190, 78,157, 58,231, 68, 69, 74, 47,242,124, 37,229, 60, 34,212, 82, 34,129,142, 18,123,105,104, 62,143, 6,
+103,226,177, 98,147,175,166,180,202,231,228,161,179,131, 90, 5,134,237,112,168,140,218,141,249,239,220,185,243,185, 73,147, 38,
+125,109,115,251,171,213,106, 74, 40, 20, 54,185, 34,217,220,254,217,217,217,247,215, 3, 96,179,242,163, 59,118,134,161,162, 2,
+218, 18, 11, 9,142,180, 90,135,174,122, 1,174,255,113,237, 30,217,245,157, 87, 93, 40,115, 41,241, 77, 37,127,123,226,231, 56,
+206, 54,198, 95, 3,147,201, 84,115, 40,149, 74,104,181, 90,200,229,242,191,172,231,176,205,243,223,191,127,127, 93, 79, 0,151,
+158,158,142, 62,125,250,192, 96,208,215,116,116,233,233,233, 46,185,235,215,125,182, 14, 38,147, 9,237,194,195, 97, 50,155, 27,
+ 34,127, 87, 58, 18, 82,143,235,191,102,234, 98, 99,158,140,123, 20, 0,218, 84, 67,254,167, 78,158,130, 78,175,135, 70,163,129,
+ 74,165,130, 82,169,172,101,217,185, 10,219, 48, 64, 19,198,253, 81, 85, 89,133,170,170, 74, 84, 86,201, 81, 89, 85,133,170,170,
+ 42, 84, 85, 90, 44,210,110,221,187, 67,110,253,223, 85,235, 31, 0,250,247,239,127,215,234,247,246,134,143,143, 47,124,125,124,
+161,209,104, 98,155, 72,254,110, 15, 7, 20,172,156, 5,193,211,107, 16,140, 97,224,231,174,129,105,251,107, 64,128, 31,118,191,
+ 26,143,162,221, 55, 48, 33,117, 19,192,255,139,151, 21, 49, 20, 65, 18, 46,129, 86,171,133,193, 96,128, 78,167, 67,110,110, 46,
+ 62,252,240,195,122, 31,247,242,178,121, 80,174,185, 67,222,238, 90,213,246,249, 75,156, 60,111,138,146,225,106,155,173, 37, 39,
+ 51, 51,147, 36, 36, 36,216,200,223,109,207, 4,159,207, 39, 12,195,212, 85, 10,224,106, 44,192,166, 77,155,174, 38, 36, 36,244,
+221,188,121,243,200,163, 71,143,250,142, 30, 61,250,164,141,252,173, 6, 36, 68, 34, 17, 87, 84, 84, 36,216,183,111, 95,215,192,
+192,192, 83,195,134, 13, 43,168, 79,214, 51, 83,158, 97, 59, 71,117,209, 12, 25, 50, 36,254,226,197, 63, 31, 81,107, 53,173, 57,
+198,196,128,130,137, 49, 82, 70,163,209,168, 87,163, 76,205, 26, 13,154,210,226, 50,230,231, 61,123, 83, 90, 5,135,148,211,180,
+206,161,249, 94,159,245,175, 80, 40,248, 0,224,231,231,215, 98,135, 5,168,134,172,255,173,255,122,215,162, 53,151,221,174,117,
+207,213, 88,128,137, 19, 39,198,174,123,121, 53, 0, 75,192,223,174, 93,187,100, 54,210,183,173, 9, 16,247,205, 83, 0,128, 51,
+169,191,217,226, 3,254, 42,212, 84,198,146,146,146, 26,107,223, 70,250,118,133, 11,141, 70, 3,131,193, 96,215,137,252,117,105,
+156, 61,219, 18,251, 97, 98, 24, 92,188,120, 17,191,159, 57,131,190,125,250,194, 96, 48, 64,175, 55,192,160,215,227,219,111,190,
+129,237, 57,103, 26,122, 90, 90, 26,122,116,239, 1,147,201,132,171, 87,175,130, 49,209, 40, 45, 41,109,214, 60,181,157, 91,215,
+ 44,176,173, 93,224,216, 3, 96, 50,130, 49, 91,220,254, 39, 78,252, 6,173, 94,139,106,141, 26, 42,149, 10, 10,165, 18, 10,133,
+188, 73,138,152,205, 19,224,166,245, 15, 0, 56,114,228, 8, 52, 26, 13, 52, 26,181,245, 83,131, 86,193,193,232,214,189, 59, 46,
+ 95,186,132,195, 71,142,184, 44,211,102,253,243,249, 2,120,121,121,193,199,199, 7,190, 62, 62,240,241,241,130, 92, 33,143, 77,
+ 78, 78,206,113,170,205, 53,193,213,223, 16,206, 21, 84,193,116, 97, 41,170,112, 12,100,220, 42,144, 97,255, 70,193,202, 89,120,
+ 50,245,107,136, 5, 20, 32,224, 91, 14,119, 88,199,205,161,128,210,241,159, 33,104,203,120,232,116, 58, 4, 5, 5, 65,161, 80,
+ 64,161, 80,224,248,241,227,184,125,251,118,141,155,184,230,249,210, 82,188, 26, 40, 65, 43,175,138,198, 44,224, 88,123, 82, 77,
+ 72, 72,136,177,187, 23, 83,231, 94,172,139,237,130,107,132,192,155, 99, 70,129,203,150,127,125,239,155,153,153, 73,182,109,219,
+ 70,154,248,190,181,148, 0,119,200,223,134,247,222,123,239,252, 83, 79, 61, 53,109,197,138, 21, 93,207,157, 59, 55, 76, 34,145,
+240,158,124,242, 73, 34, 18,137,192,178, 44, 25, 55,110,220,249,249,243,231,247,233,213,171,215,238,151, 94,122,233,185,151, 94,
+122,169,193,177,168,228, 57,201,236,159,151,174,158,234,213,187,207,179,167, 78,158,156,188,123,207, 79, 31,228,157, 60,217,250,
+ 98,254,101,241,213,210, 2,238,219,213, 63, 72, 86,164,173,236,145,189,103, 79, 90,167,142,157,126,246, 9,243, 62,178,105,211,
+ 38,179,179, 57, 58,122,244,104,156, 58,117,170, 95,122,122,250, 82,131,193, 32, 88,182,108,217, 71,187,119,239,158, 90, 90, 90,
+250,151, 19,135, 83,101,212,208,141,224, 27,133,144, 3, 53,214,191, 13, 35, 67, 66,176, 10,151,157,183, 58,172, 46,254,203,167,
+ 47, 34,160,107, 43,196,125,243, 20,118,205,248, 81,102,211,222,108,228,111,179,254, 93,153,101,176, 99, 69,191,230, 97, 88, 66,
+112,233,210, 37,216, 42,107, 93,247,178, 64, 32,128, 64, 32, 64, 69, 69, 5,198,141, 27,247, 32,202,137, 72,165, 82, 46, 61, 61,
+ 29,131, 6, 13,130,193,104,132,222,160,135,193, 26,220,164, 55, 88,134, 1,214,174, 93,139,185,115,231, 58,234, 76,184,212,212,
+ 84,152,205,102,156, 62,125, 6, 2,190,197,109,219,185,115,103,220, 40, 44, 68,105,105, 41,182,108,249, 30, 83,167, 62, 3, 0,
+ 92, 29, 79, 64,131, 29, 80, 70, 70,134, 16, 0,147,156,156,204,214,103, 1,185, 50, 85,209,102,249,231,230,230, 66, 91,173,171,
+ 81,192,212, 26, 53,212,106, 21,212,106,247,134, 0,236,173,255,169, 83,167,214,120, 0, 92, 85, 4,166, 78,157, 90,235, 60, 74,
+ 42, 69,183,238,150,160,184,203,151, 46,225,134,213,227, 49,117,234, 84,151,163,246,135, 62, 60, 20, 34,161, 8, 18,137, 4, 98,
+177, 24, 34,145, 8,101,101,101, 78,147,191,157,181,223,172, 21,112,242,135, 27,176, 3,192,216, 21, 79,128,203,124, 11, 36, 49,
+ 13,231, 10,170, 64,130, 2,113,173, 68,109,177,254, 93, 28, 2,176,107,127,196,166, 8,216,159, 59,132, 94, 15,240, 44,198,222,
+ 93,247,190,133,232, 77, 38, 19,190,248,226, 11,140, 28,121, 55, 46,236,224,204,112,160, 92,135,174,123, 21,232, 23, 18, 89,175,
+200,122,162,220,237,135, 60,101, 14,158,117,150,176, 73, 19, 60, 10,141,121, 35, 92, 86, 36,238,247,251, 90,149,128, 38,207, 2,
+ 88,177, 98,197,150,121,243,230,133,156, 61,127, 62, 81,175,215,247,145,201, 14, 73, 68, 98, 17,159, 34, 20, 14, 29, 58,228,219,
+163, 71,143, 77, 9, 9, 9,255,158, 60,121,178, 67,107, 61,231,208, 1,118,194, 83, 19, 14,247,237,219,127, 33,205, 24,199, 94,
+203,191,250, 1, 91, 88,192, 0,224,196,160, 76,189, 59,117,205, 12, 13, 13,217,203,227, 11,191,253,207,226, 20,250,147,101, 31,
+ 59, 44,165, 65,131, 6,125, 60,122,244,104, 0, 64, 69, 69, 5,178,179,179,253,190,250,234,171, 15, 0,224,212,169, 83,131,122,
+246,236,185,255,111,161, 0,216, 22,254,121,244,219,205,142, 44,123, 87,166, 4,146,157, 11,183,114, 3, 22, 14, 65,112,239,214,
+ 53,164, 95,227, 78,189, 80,134, 51,169,191,185,234,182,106,174, 57,169, 4, 0,215,189,123,119, 92,184,112,161, 22,177, 40,149,
+202, 2, 0, 29, 93,212,230,239,167, 39,224,158,223,252,246,155,111, 97, 48, 24, 96,164,141,160,105, 26,169,169,169,141, 45,146,
+195,165,166,166,214,156,176,172, 25, 98,137, 15,244,122, 3, 46, 93,188, 8,190, 64, 0, 19, 77,195,203,219, 11, 91,182,108, 1,
+143,199, 67, 98, 98, 34, 30,125,244, 81,174,170,170,225, 0,175,212,212,212,253,201,201,201,116, 70, 70, 70,168, 45,111,234,172,
+ 3,224,146,107,115,225,194,133, 56,118,236, 24,170,171,171, 81,173,213, 66,163, 86, 91,201, 95, 13,141, 90,131,106, 77, 53,180,
+118, 29,190, 51,121, 23, 29, 29,205,229,229,229,213, 88,255,245, 77, 3,116,118, 17, 32,235, 92,252, 90,101, 97, 35,125,219,216,
+163, 43,171, 20,218, 86,248, 3, 0, 31, 47, 31,136, 37, 98,104, 52,154, 88,219,208,142, 27,228,127, 95,230,107,219,148,128, 73,
+ 43,190, 2,183, 29,104, 53, 51, 3, 57,175,199, 99,120,202,119,128, 64, 0,111,113,211,198, 57,235, 42, 2, 0, 48,245,216, 84,
+ 7,223,186,131,222,251,189, 80,246,147, 14,138,229,119,175,154, 76, 38,140, 24, 49, 2, 0, 16, 30, 40,193,175, 25,237,177,242,
+195,155,248,236,140,222,145, 69,108, 63, 45, 14, 13,253,111,247,108,142, 27,125, 86,115,205,173,111,142, 49,255,251,249,190, 53,
+ 74, 64,115,212,191, 79, 63,253,244,211,231,103, 62,191,239,161,129,209,131, 52,106,117, 16, 99,102,140, 97, 97, 97, 21,225,225,
+225,101,106,181,250,220,228,201,147,157,238, 20,126,250,241, 39, 22,192,150,103,167,191,152, 59,108,248,240, 31, 37, 18,137, 63,
+ 1,199, 18, 66,192,178,156, 74,175, 85,200,174,156, 47,214,120,139,132, 78,245,243, 54,242, 7, 44,129,212,117, 3,245, 62,252,
+240,195,127,255, 45, 20, 0, 43,169, 59, 44,176, 93,187,118,185, 92, 89,207,164,254,198, 1,128, 77, 17,176, 35,254,230, 36,116,
+183, 27, 82,239,222,189,113,234,212, 41, 84, 84,212,184, 8, 59, 2,128,141,252,102,204,152,241,160,203,171, 86, 30,165,167,167,
+115,207,206,120, 22,107,215,174,179,142,153, 51, 88,184,112, 97,163,211,151, 92, 92, 65,207, 98, 57, 29, 60,232,104,179,137,238,
+169,169,169, 87,147,147,147,203, 51, 50, 50,120,201,201,201, 53, 1,129,214,105,129, 78,119,116, 54,139,121,216,176, 97,205,158,
+119,209,209,209,156,189, 21,111, 31, 3,224,198, 10,128, 4, 0,183,101,203,150,123,172,124,171,135,192,229,250,188,101,203, 22,
+226,170,199,192, 25, 52,230,250,119, 85, 89,152,252,225, 6,192,110,225,159, 81,239,222,157,142,172,109,174,130,178,243, 0, 56,
+ 90, 9,176,116, 88, 41, 74, 1, 12, 88, 25,136,229,167,187, 32, 4, 64, 69,129, 22,157, 58,117,178,144,198,242, 64, 60,246, 80,
+ 8,162, 30,203,119,214, 34,118,122,120,211,250, 44,113,183,191,105,166, 62,175, 73,178,254,162,247,109, 54,108,216,184,225, 42,
+128,171,205, 37,239,219,239,190, 44, 68, 51, 68,133, 54,103, 96,158, 21, 11,254,138,252,252,171, 55, 3, 34, 19, 39, 78,140,217,
+149,218, 34,247, 2, 32, 0,184,135, 30,122, 8,123,247,238, 53, 88, 73,159, 5,224,117,159, 60, 15, 77,134, 45, 72,112,238,220,
+ 57,156,213,242,127, 32,105, 91,184,112, 97,100,125,110, 73,187,105,132,174, 88, 59,228, 62,151,113, 77,122,154,186,236,111, 67,
+171,242,185, 74,226,142,214,246,111, 14, 52,101, 72, 96,209,162, 69,184,126,253,122,179,165,197,153,229,125, 93,197,153,183, 21,
+ 56, 3, 75, 96,232,200, 4, 9,126, 57,209, 5, 97, 94, 62,248, 51,239, 14,186, 58, 73,254, 78,212,191,150,186, 28, 46,185, 79,
+223,245, 44,207,238, 28,218, 54,179,188,180,191, 42,225,127,249,110,128,117, 61, 12,110,120, 18,238,187, 18, 48,110,220, 56,241,
+223,172, 2,186,101,217, 55,215,111,103,100,100,216, 86,168, 97,146,147,147,155, 58,149,201,131,230, 39,255, 38,149, 69, 74, 74,
+ 74,179,148,101, 70, 70, 6, 63,121,120,242,125,175, 23, 71, 50,245, 56,146,153,223,226,219,172,167,102,122,240,192, 43,161,187,
+251, 8,123,224,129, 7, 30,120,224,129, 7,127, 95, 80,158, 44,240,192, 3, 15, 60,240,192, 3,143, 2,224,129, 7, 30,120,224,
+129, 7, 30,120, 20, 0, 15, 60,240,192, 3, 15, 60,240,192,163, 0,120,224,129, 7, 30,120,224,129, 7,255, 8,212,154, 5,112,
+246,236, 89,183, 35, 83,235, 11, 38,244,200,243,200,243,200,243,200,115, 82, 94,163,211, 68, 91,128, 60, 79,249,122,228,213,194,
+ 43,175,188,210, 14,128, 2,128,208,186,213,121,139, 74,159,199, 3,224,129, 7, 30,192,223,223,159,242,247,247, 39,254,254,254,
+ 2, 0,188,150,150, 62,219,190,243,118,251,207, 55, 21,245,173,143,239, 65, 11,194, 19, 79, 60, 17,243, 15,120, 13,219,218, 87,
+146,191,235, 11,120, 20,128,127, 56,154,176,221,186,203,136,139,139,139,177,118,186, 53,135,245,218, 63, 82, 94, 11, 7,137, 12,
+ 11, 35, 0,160, 82,169, 88,149, 74,197,169, 84, 42, 19, 0,179, 59,194, 94,126,172,119,201,172,177,189, 39, 2,192,172,177,189,
+191,121,249,177,222,235, 0, 96,225,164,135,200,194,167,163, 5, 47,143,233,229,214,154, 34,246, 75,209,102,102,102,214,218,124,
+167, 41,228,111, 87,239,155,115,173,253,166,202,108, 14,121,220,125, 80,108,254, 82, 69,233,137, 39,158,136,217,187,119,175,236,
+ 31,208,198, 12,176, 44, 22,119, 95,121,180, 77,176,136,234,220, 58,148, 31, 33,109, 71,133, 5, 4, 11,189, 69,130,102,251, 61,
+ 62,254, 25,160,172, 90,152,222, 90, 32, 30,216, 41, 0, 78,236,173, 98, 4, 32,106,234, 79,101,101,101, 33, 45, 45,173,214,242,
+127, 11, 22, 44,176, 53,116,226,142, 60,246,135,192,218, 5, 61, 37,171,165,200,107,241, 69, 31,229, 45,225,162, 58, 72, 1, 0,
+101, 52, 51,189,181,144,255,157,237,230,101,117,181,168,172,178,146,118, 70,208, 75, 99,122,229,155,205, 92,248,195, 67, 91,249,
+117,237, 58,236,128, 72, 68, 21,205, 73, 25,244,159,255,146, 11,184,163,210, 61, 33,224,147,159, 0,114, 17, 64, 79, 87, 19, 89,
+119, 41,218, 38, 46, 55, 91,139,252,237,234,190,187, 75,229, 18, 23,175,223,119,121, 9, 9, 9,182, 53,250, 29,190, 83, 66, 66,
+ 2,151,153,153, 73, 92,200, 59,210, 12,114,156, 34,127,150,101, 65, 8,193,200,145, 35,185, 35, 71,142, 16, 23,203, 88, 8,192,
+212, 28,233, 9, 10, 10,154, 37,151,203, 63,119,243,235,126, 0,148,104,190, 85,176,107, 97, 88,159,126,212,179,225, 81, 98,101,
+ 68, 43, 97,104,247,112, 62,159,132, 82, 58,149,138, 17, 35,140,166,250,183,163,159,155, 48,134,110,234,111, 56,171, 73,132, 0,
+120,220,250,217,210,224, 7,224, 41, 0,233,214, 79,191,102,146,251,125, 75,179,176,221, 42, 96,202, 97, 17, 15,178, 54,168,208,
+166,144,205,252,249,243,239, 33,127, 0, 72, 75, 75,139,157, 63,127,190,203, 86,206,198,215,188,239, 33,107, 0, 96,127, 8,196,
+198,215,188, 31,168,188,212,212,212, 24,138,162,184,103,158,185,187,164,237, 43,175,188, 18, 3,128,139,136,136,224,218,181,107,
+199, 5, 7, 7,115, 79, 63,253,180, 83, 50, 55,164,126, 20,115,156, 26,194, 45,141,142,175,177,126,215, 45, 93, 23, 51, 15,171,
+185, 57, 17, 27,184, 25,237,182,114,227,131,247,115,131, 58, 44,115,202, 58,238,208, 46,172,117, 76, 7, 41,247,218,156, 25,198,
+229,111,189,200, 45,124, 97, 26, 90, 11,249,223,189, 59,251, 89,172,124,227,101,110,217,220, 23,216,110,126, 62, 70, 0,104,221,
+ 58,152,111, 45,255,122,113,102,231,211,157,195,195,189, 2,158,153, 18,153, 54,113, 82,123, 1,203,177,210,144, 86, 34,239,143,
+ 95, 63,145, 54,239,169,126,223, 62,254, 88,155,200,136, 8,239,226,127, 47,238,237,238, 54,153,246, 27, 69,185,180,105,148, 3,
+203, 31,205,224, 9,104,113, 30,128,204,204, 76,146,144,144, 80,243,189,132,132, 4,174,190,161, 19, 43,105, 59,173, 84, 52,148,
+ 14, 59, 57, 77,238,232,236,201,127,193,130, 5, 24, 57,114, 36,247,235,175,191,186, 35,138,110, 70,227,181, 44, 40, 40,104,146,
+155,223, 13,183, 26,156, 82, 0, 72, 74, 74,138, 76, 74, 74,218,147,148,148,148,107,119,236, 76, 74, 74,114,105, 27,229, 79,214,
+127,194, 79, 93,150,226,247,248,147,147,194, 21, 3,123,118,224,183, 13,239,168, 54,136, 59, 86,155,245,237,137,159,119, 91, 58,
+204, 20,198,148,221, 10,248,250,139,141, 66, 23,121,220, 45, 5,160, 61,128,111, 0,196, 91, 63,219,183, 32,126, 11, 6,176,197,
+170,156, 28, 7, 48,214,122, 30,220, 12,178,167,192,137,241,210,150,174, 0, 56,129, 33, 0,174, 0,136,114,199,186,177,185,208,
+ 35, 34, 34, 98,237,173,126, 59,203,191,230,158, 51,238,118,219, 51, 73,195,133,118, 86,186, 2,212, 20, 69,205,185,237,222,131,
+144, 7, 0, 39, 78,156,144,137,197, 98,228,230,230,222,163,108, 21, 23, 23,147,146,146, 18, 50,100,200,144,216, 61,123,246, 56,
+149,135,173, 79, 92,148,113, 98, 1,250, 84, 8,107, 89,195,132,226,176,174,248,121,242, 77, 73, 34,145,142,189, 16,203,220, 26,
+239,208,109, 26,211, 65,202, 69, 8, 37,183,223,124,117,186,177,157,143, 80,168,186,120,140,120,149,159,199,188, 17,157,209, 54,
+ 64,130,242, 51, 71,201,157,211,199,168, 5,179,102,208, 49, 29,164, 92, 55, 47, 95,147,181, 67,173, 23,173, 90, 9, 71, 9,133,
+148,248,248,241,219,243, 79,157,188,213, 61,172, 93, 7, 83, 64,171,118,196,215, 23, 94, 29,162,188,162,130,130, 68,157, 88,142,
+ 51,254,124,178, 92,251, 0,235, 48,103,111,241,219, 14, 55,149, 0,174,158,207,186, 71,125,207,253, 85,242,106,148, 0,185,124,
+ 52, 50, 50, 20,104, 10,249, 55,166, 84,212,145,211, 36, 15,192, 19, 79, 60, 17,179,103,207, 30, 25, 33, 4, 20, 69, 33, 47, 47,
+ 15, 71,143, 30,117, 75,150,217,108, 62,111,245, 0, 52, 71, 60,139, 68, 46,151,239, 12, 10, 10,122,218,141,239,218, 60,206,154,
+164,164,164, 94, 0, 14, 28, 60,120,112, 92, 86, 86,214, 16,219,145,157,157,253,148, 76, 38, 59,148,148,148,228,212,144,199,130,
+ 69, 11,196,149,183, 42,130,245,156, 49,130,227,147,110,156, 72,212,157, 21, 8,187,179,132,234,204, 18,126, 39,134,199,139,100,
+ 89, 18,174, 37,230, 80, 70, 72, 5,126,113,108,175, 88,252,100,232,125, 85, 0, 62, 1,112, 16,192, 60,235,231, 39, 77,200,236,
+ 64, 0, 75, 0,236,177, 86,244, 61,214,243, 64, 55,229, 29, 1,176, 23, 64, 50,128,245, 0,222,176,202, 60,210,196, 74,225,111,
+253,244,110, 6, 11, 27, 86, 11,107, 73, 99,150,214, 3,196, 67, 0,142, 1,104,109, 85,158,158,117,229,203, 89, 89, 89, 50,123,
+203,127,193,130, 5,178,180,180,180,216,180,180,180, 88,123, 37, 32, 45, 45, 45, 54, 43, 43, 75,230,140, 60,123, 75,157,154,162,
+192,213,189, 51,112,117,239,140, 90,164,205,254, 16, 8,119,229,217, 44, 77,119,228,165,167,167,199, 28, 63,126, 28,211,167, 79,
+ 71,113,113, 49,146,147,147, 99,234,123, 70, 44, 22,203,218,180,105,227, 48,255, 50,210,211, 99,218, 28,255, 3, 37,211,135, 65,
+ 88,172,194,231, 75, 62,142,169,109, 28, 3,233,233, 25, 49, 2, 67,132, 44,168,141,222, 33,249,207,122,105, 10,253,175,249, 51,
+ 56, 97,209, 25, 97,224,157, 11,228,194,109, 53,194, 67,188,241,112,143, 48,180, 85, 94,193,117,141, 30,124,150, 67, 0,225, 9,
+254,239,197,233,220,107,175,188,112, 37,166,131,180, 65,210, 81, 40, 53, 65,131, 6,249,164,245, 30,242,184,201, 55,168,163,200,
+ 39, 32,148,149,248,120, 27,131, 90, 5, 27, 66,194,219,243, 21,114,141, 72,173, 98,160, 80, 25, 93,113, 99,199, 56, 67,156, 78,
+198, 3,220, 99,249,215,167,148,187,160, 4,144,122, 62,235, 30,245, 61,231,148, 60,110,107,224, 61,135,139,242, 26,202,211, 38,
+145,118, 93,165, 34, 35, 67,129,230, 34,127,138,162,184,125,251,246,201, 88,150,197,235,175,191, 14, 66, 8,142, 30, 61, 10,203,
+214,187, 44,113, 67, 30,104,154,254, 29, 0,211, 12,158, 0, 57, 0,200,229,242,237, 65, 65, 65,177, 46,126,151, 15, 0, 51,103,
+206, 20, 1,200,202,206,206,238,178,108,217, 50,166,174, 18, 26, 28, 28,140, 67,135, 14,197, 36, 37, 37, 57,212,202,120, 68,224,
+ 71, 51, 92, 91,163,209,212,197,204,178,189,204, 44, 59,192, 76, 72, 47,240,120,237, 9, 33,109, 64,120, 97, 44,135, 8,142,102,
+219,169,245,166,144, 80, 63, 70, 72, 13,210,220, 55, 5, 32,220,106,241,175,132,101,156, 99,165,245, 60,220,141,223,154, 1,160,
+216, 90,153, 22, 1, 8,178,126, 18,235,117, 87,247,218,253, 55,128,107, 0,214, 1, 16,192, 50,134,205, 0,248,204,122,189, 41,
+251, 47,143, 4, 80, 1, 96, 84, 51,145,236, 11, 0,222,183,126,182, 52,244, 4,240, 35,128, 71,173,158,148,158,238, 10,178,145,
+191, 61,233,219, 43, 1, 46, 87, 78, 43,249,219, 80, 87, 9,112, 71, 94,157,206,140,184, 42,239,240,225,195,160,105, 26, 3, 7,
+ 14,140,237,214,173, 27, 10, 11, 11,107,222,143,101, 89, 72,165, 82,110,241,226,197,178,227,199,143, 99,220,184,113, 14, 59, 20,
+ 67,238, 41, 80, 52, 3,229, 64,105,172,177, 91, 48,174,109, 56,124,151,180, 88, 14,115,164, 27,184,195,139,131,101, 55,142,251,
+ 35,238,249,171,142, 59, 40,138, 87, 93,113, 33,151, 45, 83, 26, 80, 85, 77,115,241,253, 34, 56,127,137, 16,183,148, 90, 84,168,
+244, 72,236, 31,193, 81,132,112,191,253,180, 31,170, 35, 39,184, 51, 59,127, 46,106, 76, 92,238,239,109,231,132,132,250,117,108,
+ 27, 17,197,120, 73,216,142, 35, 31, 79,244,233, 48, 48,121,124,235, 46, 79,198, 5,181,141,238, 43,175,110, 29,111,162, 77,166,
+235, 5, 90,167,134,222,172, 4,229, 84,157,200,204,204,148, 57,152, 25, 80,239, 61, 39, 98, 94,254, 17,179, 3,146,147, 3,145,
+156,124, 87,185,181, 17,119,115,144,118, 61, 10,140,219,150, 63,199,113, 48,153,238, 14,217, 15, 31, 62,220,214, 94,220,149,109,
+ 18, 8, 4, 38,150,101,143, 91, 61, 1, 77, 81, 2,106,134, 62,229,114,185, 44, 40, 40, 40,217,133,239, 22, 38, 38, 38,250, 29,
+ 62,124,120, 69,118,118,118,235,175,191,254,154, 93,188,120, 49,127,243,230,205,232,210,165, 11, 0, 32, 50, 50, 18, 42,149, 10,
+ 75,151, 46, 53, 31, 58,116, 40, 62, 41, 41,233,213, 70, 37,178,140,191,217,204, 68,154, 25,115, 79,147,217,212,159, 71,145, 40,
+ 33,159, 18,137, 5, 60, 53,223, 75,120,219,219,151,119,135, 39,230,140, 98, 30, 47,136,207,208,109,110,156,249,221,119, 70,200,
+ 39,110,199,189, 57, 82, 0, 30,179, 90,135,246, 56,102,189,238, 10,166, 1,120, 29,150,177,146,247, 1,252, 1,203,252,201, 63,
+172,231, 82,235,253,105, 78,202,243, 2, 48, 11, 64,146,245,220,104,119,192,122,125, 22,238,221,202,215, 89, 76, 1,240,149,245,
+179,169,120, 30,192, 28,107,158,205,177,158,183, 20,116,178,186,176,126, 6, 48, 23,192,108, 0, 49,240,160, 65,148,150,150,202,
+ 6, 15, 30,140,217,179,103,231, 12, 30, 60, 24, 39, 78,156,192,250,245,235, 99, 90,183,110, 45,163, 40, 10,133,133,133,164,178,
+178,146,188,246,218,107,177, 71,142, 28,145,189,244,210, 75,141,146,205,208, 27,183,100,101,131,187, 35,121,246,236,156, 63,195,
+204,177, 61, 85, 65,178,140,245, 25, 49, 22,237, 4, 88, 87,248, 60,217, 82, 25, 79, 70,190, 86, 26,123, 52, 83, 42,139,125,120,
+101,131,229, 83, 66, 51,171, 62,255,124,115,208,246,243,165, 55, 55,159, 41, 86,110, 56,126, 93,123,163,204,192, 81, 28, 5,131,
+206,140,138, 10, 26,121,197, 10,243,174,194, 82,205,158, 91,101,202, 29, 69, 37,151,143,149,149,143,185,105, 52,125,212,144, 76,
+191,192,240,118,250,106, 69,219, 30,209,143, 80, 52,137, 28, 89,122,249, 71,125, 96,144,183,164, 67,247,126, 21, 28, 83,113,158,
+240,252, 66, 88,150,229,221,185,163,119,198,139, 87,215, 53, 93,159, 27,188, 86,148,187, 19,227,207,164,174,165,111, 59,238, 7,
+161,181, 20, 52, 22,148,103,231,206,111, 18,154, 67, 78,117,117,181, 12, 0,248,124, 62,222,122,235, 45,228,229,229,193,205,113,
+127,123, 24, 1, 24,141, 70,163,177,180,180, 52, 11, 77, 11, 8,212,212,114, 7,200,229, 25, 65, 65, 65, 19,156,245, 20, 27, 12,
+134,254, 11, 23, 46,124,242,149, 87, 94,225,122,247,238, 77, 0, 96,201,146, 37,200,207,183,236, 70, 57,100,200, 16,176, 44,139,
+225,195,135, 83,211,166, 77,227, 46, 95,190,188,238,249,231,159,127,222,203,171,126,106, 98, 89,206,144,115,240,224,182,194,194,
+235,207,155, 77,230, 48,158, 64, 98,224, 17,177,138, 18, 9, 85,148,216,171,156, 22,120, 85,130, 18,221,102,197,102,131, 70, 85,
+213, 74,182,251,236,123,230, 83,191,187, 29,247,230, 72, 1, 24, 3,224, 80,157,107,135,172,215,157, 5, 15,192,187, 0, 18, 1,
+ 84, 53,240, 76,149,245,254,187,112,110, 92,103, 26,128, 3, 0, 84, 13,220, 87, 89,239, 79,115, 35, 79, 30,129, 37,134,224, 67,
+235,231, 35, 77,168, 92,241, 86,175,201, 16,107,122,134, 88,207,227, 93,148, 19, 8, 32,192,137,195,213,161,148,161, 0,157, 16,
+ 39,240, 0, 0, 32, 0, 73, 68, 65, 84, 78,226,110, 4,112,145,213,211,227, 86,156, 71, 93,139,191,174, 71,192, 85,176, 63, 4,
+162,243,184,111,106,206, 59,143,251,166,222, 64, 62, 87,228,213, 33, 19,206, 21,121,107,215,174,229,242,242,242,112,250,244,105,
+180,107,215,142,251,229,151, 95,160, 86,171,113,233,210,165,123, 44,218,119,223,125, 55,167, 71,143, 30,177, 91,183,110,109, 80,
+222, 23,107,215,114,237,243, 46, 32,244,116, 62,100,237,198,113,189,175, 48, 50, 74,109,130,249, 82,245, 61,207,190,249,238,139,
+ 57, 17,209,167, 99,139,254,152,210,160,245,124,173,164,228,237, 18,154, 89, 85, 81,169,151,210,122,115, 96,254, 45,181,207,158,
+203,165, 85,198,200,190,232, 17, 26, 4, 0,216,115,246, 14,191,160,172,218, 15, 64, 96, 25,109,232,113,211,104, 74, 40, 40, 45,
+125,187, 33,153,163,198, 39, 82,221, 70,126,208,155,209,254, 81, 28,209,125,180, 68, 32, 48,211,215,254,200, 82,150, 22, 95,186,
+ 83, 94,252, 91,177, 90, 94, 10, 80, 20,145,107,104,255, 89,137,253, 29,213, 27, 82,135, 84,234,115,171,215, 10, 4,180, 62,255,
+ 87, 69,227,255,237, 96,111,245,215,245, 8,184,235, 85, 8, 10,202,110,178, 28, 0, 24, 57,114, 36,119,248,240, 97,176, 63, 4,
+128,227, 56,124,252,241,199, 56,114,228,136, 77, 81,115,187, 12, 20, 10,133,145, 16, 50,226,212,169, 83,134,240,240,240,184, 38,
+122,117, 2, 0,203,108, 0,235,231, 12, 0,108, 80, 80,144, 51,134,154,106,247,238,221,165,251,247,239,255,106,243,230,205,228,
+232,209,163,100,244,232,209,156,141,252, 1,203,118,247, 34,145, 8, 69, 69, 69,216,183,111, 31, 9, 12, 12,100,134, 13, 27,246,
+ 43,203,214,111,180,119,142,234,114,123,200,144, 33,179, 46, 94,252, 51, 66,173,213,132,113,140,201, 4, 10, 70,198, 72, 85, 27,
+141, 70,165, 26,101,183, 88,163,225, 78,105,113,153,241,231, 61,123,215,180, 10, 14, 41,162,105, 93,181,187,121,201,175,167, 97,
+216, 10,166,181,245, 56, 92, 71, 81, 56, 12, 96, 1,128,182, 0,202, 28,100, 62,129, 37,118,224, 56,128, 27, 14, 20,142, 27,214,
+231,230,161,225, 56, 3, 91,250, 38, 3, 72,113, 32,239,107, 88,134, 24,190,114,144, 62,251,138, 40,133, 37,206, 97, 32, 0, 53,
+128,247, 0,156, 6,208, 17, 64,161, 19, 46, 68,123,121,207, 0,120,209, 74,178,122,107, 90,245,214,243,116, 88,226, 1,190,119,
+ 66,222, 12, 0,175, 56, 89,193, 9, 44,177, 16,223, 56, 72,223, 42, 0,190,176,196, 58,236,182,166, 77,108,213,164,255, 0, 48,
+216,234, 17,248, 21,119,227, 53,234, 69, 92, 92, 92,172, 61,209,219, 43, 1,117, 99, 3,226,226,226, 98,179,178,178, 26,125,129,
+184,184,184, 88,106,202,221,113,123,246,135, 64, 80, 86, 37,160,238, 88,190,219,242,166, 40, 56,119,228,157, 61,123, 22, 17, 17,
+ 17,184,124,249,114, 77,157, 25, 54,108, 24,151,155,155,139,241,227,199,223,235,166,242,242,146,137,197, 98,168,213,234,122,229,
+ 73,207,158,133, 50,162, 13,250, 93, 62, 81, 35,239, 77,191,199, 98,162,114, 85, 50,106,188,248, 30,197,169, 56,159,134, 72,108,
+178,212,204,134,149,128,133,104,215,238, 55, 0, 67, 56,112, 60,220,168,120, 67,199, 48, 96, 12, 22,231,216,197,138, 10,220, 48,
+208,155,248,132,104, 64,136,169,160,180,116, 91, 99,249,215, 86,218,109, 33,128,212,252,163,243, 11,197, 97,147, 21,165,101,226,
+118,101, 37,167,196, 16, 4,117, 42, 44, 50,135, 87,149,221,132, 80, 40, 8,237, 25,230, 61, 77,169, 49,125, 11,224,166, 35,203,
+213, 58,247,223,225, 48, 64, 66, 66, 66,108,102,102,102,142,203,236, 94,103, 8,224, 31, 16,168,219,100,175,128,139,223,231,154,
+ 42,111,212,168,145,156, 76,150, 3,178,205, 18,143,125, 96,177, 47,198, 44,215, 96,228,200,145,112,113,218,223, 61,176,141,213,
+ 63,252,240,195,186,102, 80,232, 20, 65, 65, 65,211,237,140, 83,163, 92, 46,223,227,228,119, 25, 0,229,187,118,237,146, 61,245,
+212, 83,209, 43, 86,172,232, 99, 54,155,137, 68, 34, 65, 92, 92, 28,126,249,229, 23,176, 44,139,113,227,198,113,243,231,207, 39,
+253,250,245, 51, 78,158, 60, 57, 50, 33, 33,225, 78,191,126,253,234, 87,192,230, 36, 51, 49,143,140,217,212,171,119, 31,255, 83,
+ 39, 79,174,252,157,207,239,213, 33,178,195,151,126,193, 33, 37,130, 16, 49,119,120,223,161, 64,185,162,106, 68,120, 80,200,251,
+ 93,186,116, 57,236, 19,230,189,254,147,101,159,211, 13,201,115, 85, 1,224, 1,136, 6, 48, 12,192, 50, 0,175, 89, 43,131,119,
+ 29,242,251, 6,150,113,246,127,193, 50, 36,144,215,136,135,225, 33,171,245,235,140, 59,254,184,213,187, 64, 53, 34, 47, 4, 64,
+164,149,152, 27,147,121,218,250, 92, 40, 44,227,249, 13,201, 19, 90, 45,231, 36, 88,166, 17, 62, 3, 32,223, 42, 59,223,122,190,
+ 25,150,113,242, 77,176, 12, 93,208, 14,228, 77, 1,240, 5,128,110, 86, 37,201, 62,157,183, 97, 9, 90,188,108,125,246, 7, 7,
+242, 94,135,101,118,131,206,137,252,243, 2,176, 31,192,119, 14,202,227,105, 0,255,177,126,254,110,151, 62,129,181, 44, 51, 1,
+172, 1,176,220,122,255,118, 67, 63,152,149,149,149, 3, 0,197,197,197, 50, 91,180,127, 93,171,191,184,184, 88,102,255,108, 99,
+176, 61,179,233, 87,186, 38, 58,191,174,149,190,233, 87, 26, 15, 66, 94,110,110, 46, 70,140, 24,129,203,151, 47,223, 37,113,169,
+ 52,118,235,214,173,178, 14, 29, 58,196,178, 44, 43,139,140,140,228, 88,150,133, 94,175,199,207, 63,255,140,232,232,232,216,125,
+251,246,213, 43,175,107,110, 46,190, 15, 14,173,149, 87,221,231,142,129,118,229, 77,224,209, 80,112, 44, 48, 39,242, 43,174,154,
+245,129, 92,239, 7,121,126, 16,250,142,216, 29,123,105, 71,227,110,246,107, 37, 37,219, 1,108,239, 24,209,182, 43,128, 55,140,
+102, 22,219,206, 23, 98, 68,152,101,184,147,112,156, 70,195, 48,203,202,203,203,239, 56, 65,166, 43, 57,142,243,206,191, 44,127,
+ 86,121,122,107,171,242,219,114,148,223,209,128,207,175,242,174, 86,112, 80,170,205, 92,104,136, 48,128,207, 98,146,222,104,254,
+126,217,235, 15, 7,252,235,147,227, 74, 7, 68,147,227, 68,167, 77, 92,137,100,191, 7,163,173,158,151,236, 68, 87,191,105,243,
+134, 57,138,202,183,127,142, 56, 43,143, 36, 42,208, 68,121,247, 88,236,153,153,153, 24, 56,112, 96, 75,210, 69,184,156, 57, 23,
+ 0, 27,249,159,103,176, 65,102,105, 99, 77, 37,127, 91,221,224,241,120, 33,124, 62,191,252,248,241,227, 95, 62,252,240,195,238,
+174,243, 0, 0, 17,114,185,124,157, 85,177,152, 34,151,203,127,176,125, 58,227, 84, 4, 80, 13,160,114,197,138, 21,125,231,205,
+155, 87,122,246,252,249, 54,122,189,158,200,100,135, 32, 18,139, 64, 17, 10,135, 14, 29, 34, 61,122,244,208, 37, 36, 36, 12,158,
+ 60,121,178,195, 54,151,115,232, 0, 51,225,169, 9,107,250,246,237,223,129,102,140,143, 95,203,191,250, 34, 91, 88,240, 2, 0,
+136, 65,113,189, 59,117, 61, 21, 26, 26,146,195,227, 11,223,254,207,226,148,234, 79,150,125,236,118, 70,214,167, 0,188, 97,213,
+134,198, 3,184, 4,192,167,158,239,237,181, 90,236,241,176,204, 35, 79,106,196,253,223, 25,150,232,114,103, 20,128, 42,235,243,
+188, 70,228,197, 0,184,234,164,188,171,214,231,119, 52, 34,111, 22,128,153, 0, 46, 0,152,111,125, 47,123,217, 50,171,245, 63,
+199,106, 13,111,180, 90,217, 13,201,155, 97,205,143,126, 86, 47, 66,125,233, 84, 91,239,219, 60, 1, 27, 27,145,247,181,181, 83,
+240,114,178,243,250,218, 65,254,125,100,245,108, 28,176, 42, 53,168, 35,251, 23, 0, 61,172,101,145,111, 85,164, 28,186,118, 87,
+175, 94,205, 1,144, 53,211, 66, 64,100,230, 26, 45, 55,115,141,182,158,133,123,220, 10,114,106, 22,121,127,254,249, 39,249,243,
+207, 63,107, 93,251,238,187,239,114, 0,144, 31,126,248, 1, 0, 72, 81, 81,237,152,186,134,200, 31, 0,218,255,249, 39, 1,106,
+203,123,249,131, 5, 22,114,252,208,154,166,186, 33,122, 59, 92,232,133,205, 92, 33,248, 0,175, 26, 53,228,111,101,245, 59, 98,
+177,216,169, 69, 68, 56,142, 35,132,144, 37, 11, 19,123,122,133,181,139,156,192,194,171,115, 73,113, 25,207,100, 80,114,173, 67,
+125,136,143,183,128, 48, 38, 22, 10, 37,205, 16, 9,145,168, 52, 76,167, 70, 12,130,134,234,108,221,255, 31,164,139,222,126, 56,
+162, 33, 98,225,224,222, 44,128,230,144, 87,175,197,222,161, 67, 7,156, 62,125,186, 69,144, 63,251, 67, 32, 14,156,103, 0, 0,
+ 27,101, 52,190, 63, 78,219,188, 48,164,185,202,199,108, 54, 87, 1,192,128, 1, 3,154,180, 32,144,141,252,173,168,180,126, 58,
+187,192,142,208,106,152,157, 1,128, 79, 63,253, 52,252,249,153,207, 47,122,104, 96,244, 12,141, 90,237,207,152, 25, 83, 88, 88,
+216,157,240,240,240,171,106,181,122,249,228,201,147,243,157, 77,215, 79, 63,254,196, 0,120,237,217,233, 47, 14, 31, 54,124,248,
+120,137, 68,210,138,128, 51, 91,102, 78,112, 85,122,173, 98,221,149,243,197,183,189, 69,194, 38, 45,124, 87, 87, 1, 48,195, 18,
+164,230,204, 56,252, 41,235, 97, 70,195,203,139,154, 97,137,168,119,118,190,166, 12, 64,182, 3,121,187, 96, 9, 90,115, 6,207,
+ 58,145,190,207, 1,124,233,168,239, 7,240,170,221,119, 26,147,247,141,213, 99,224, 8,133, 86,203,222,153,244,185, 50,223,245,
+115, 7,242, 30,117, 66,158,205,219,176,209,154, 55,206, 44, 31, 75,226,226,226, 98,234, 70,253, 91,221,234, 57,238, 52,244,184,
+184,184, 24,187,149,250, 90,154,188, 22,143,235,165,183,141, 84,187,118, 27, 95, 89,153, 62,211,118,141, 22, 80,223, 25,116,236,
+254,178,226, 98,141, 83,153, 70, 8,247,159, 89, 67,200,123,159,255,182,240,231, 53,161, 59, 79,156,188, 61, 59,196,159,125,146,
+ 10,242, 11,224, 56,128, 16,206,104,100,216, 50, 22,168,164,141,108, 64,233,109,189, 75,171,147, 89,221,252,178, 58,231, 45, 37,
+ 11, 91,220, 74,128,127, 23, 60,182, 92,115,191,223,145, 5,208, 70, 44, 22,223, 30, 48, 96,192,163,103,206,156,105,178, 64,185,
+ 92,126, 48, 40, 40,104,166, 92, 46,223,232,130, 2,192, 88, 61,167, 0,128, 13, 27, 55,164,192, 50, 60,221, 44,248,246,187, 47,
+127,133,101, 40,246,190,160, 62, 5,192,224,142,214,215, 72, 33, 25, 61,242,254,177,242,106,193, 74,164,164,206, 53,183, 43,103,
+ 75,151,247,119,128, 92,167,123, 1,240, 50, 1, 8, 97,193,149, 26, 12,244,230,178,178,138,115,214,142,203, 41,188,247,249,111,
+220,143, 31,141, 37,227, 95,219,159, 11, 32, 55, 97,112,215, 55,130,130, 68,139,248, 60,194,221,174, 50, 92,185, 77, 51,155, 36,
+ 2, 74, 44,225,243,120, 38,134, 21,187,146,190,204,204,204, 28,219,242,182,214, 79,183,148,177,123,166,254,217,185,254,157,152,
+ 22,216, 88,189, 39, 46, 92,255,171,229,221, 55,197,167, 41, 74, 24, 53, 69, 1, 66, 8,158,156, 56,171,222, 62,100,215,143, 25,
+205,245,174,101, 0, 72,115,144,191,157, 18,176,209,133,199, 3,173,237, 72,251,119,237, 31,248,245, 84,196,230,140,152,241,200,
+251,103,203,243,160,165, 43, 0,114, 57, 39,151,203,103, 53, 85,206, 83,111,238,231, 0,224,217,145, 61,200,183, 71, 46,126,172,
+231,230,172,121,109,234,241, 30,180,150, 68, 5, 9,248,173, 64,136,206, 71,194,175,232,213,205, 47,127,219, 1,215,100, 91, 93,
+217, 77, 89,111,254,126,145,231,223,197, 3, 64, 90,146,215, 36, 35, 35,157, 75, 78,158, 77,118,253,152,241, 79,111, 94,225, 86,
+131,217, 23,150, 61, 1,254,118, 32,238,238, 35,236,129, 7, 30,252, 13, 53,126, 30,224, 37, 34, 96, 89, 14, 32, 4,213,122, 79,
+243,247,192,131,255,217,254,192,147, 5, 30,120,240,191, 3,198, 12,168,117, 78, 47, 59,239,129, 7, 30,252,131, 65,121,178,192,
+ 3, 15, 60,240,192, 3, 15, 60, 10,128, 7, 30,120,224,129, 7, 30,120,224, 81, 0, 60,240,192, 3, 15, 60,240,192,131,127, 34,
+106,197, 0,156, 61,123,214,237,104,212,250,130, 9,235,147, 55,254,145,232,152, 94,125, 58,201,218,180, 11,143,213,232,181,178,
+195,178,220,216,172, 67,231,114,220,149,215,123,240,152,152,126,125, 6,203,238,148,150,194, 91,226,141,155, 37, 5,177,121, 39,
+246,186, 45,175,185,223,119,238, 52, 42,102,200,224, 14, 50,137, 55, 15,124, 30, 5, 34, 38,120,114,234, 69,226,174,188,228,255,
+151, 27,243,208,224,135,100,254, 62, 60,128, 15, 36, 12,174,127,142,211,131,122, 95,143,188, 22, 43,175,209,169,102, 45,253,125,
+ 59, 12,120,154,243, 99, 11,238,107,250,126,127,183,200,237,142,180,255, 7,145,247, 92,251,184, 85,169,219,242,222,168,188,119,
+195, 85, 79,125,254, 75,228,241, 81,207, 20, 89, 87,228,197,198,198, 70, 25, 12, 6, 69,110,110,174,242, 65,190,175,203, 10, 64,
+ 67, 88, 29,131,206, 0, 58,192,178, 78, 64,193,252, 28,220,112,246, 7,198, 12,239, 16, 67,192, 34, 36, 32, 8,185,135,207,200,
+222,153, 59, 3,195, 70, 15, 3,163,213,201,122,116, 27, 9,150,133,108,222,139, 15,199,246,239,223, 7,215,174, 21, 65,165,212,
+ 98,237,198, 35, 57, 13,201, 27, 56,226,153, 24, 14, 4,145,157, 58,200,146,223, 92,142, 23,158,121, 12,223,252,247, 51, 0, 98,
+236, 61, 87, 2,138,130,108,245,146,197,200,207,191, 2,169, 52, 18, 34, 9, 31,183, 74,242, 99,161,171, 63,201,139, 30,235,203,
+ 9,133, 66, 72, 36, 18, 20, 20, 20,160,109,168, 31, 90,241,125,208, 54, 34, 0,129, 18,127,120, 19, 51, 40,138, 2,199,154,161,
+ 19,241,161,186,163,194,164,255,102, 57, 44,168,212,133,125, 56, 95,137, 10,126, 1, 66,248,120,243, 33,148, 80,224,243, 0, 74,
+200, 71,206,207,209,156,137,227, 33,110,194, 9,167, 11,188,247, 83,171, 99,194,195,195,209,174, 99, 59,153,222, 96, 4, 37,146,
+ 0, 38, 96, 78,218,169, 24,189, 78,139,175,254, 21,147,243, 0, 21,201,150, 54,143,249,127, 25,174,150,133,211,207, 39,188,179,
+200, 27,192, 67,173, 37, 94,255, 41, 45, 45,237, 38, 16,139,192,122,121,125, 8, 96,125,230,135, 41,213, 45, 37, 3,162,122,140,
+138,185,113,241,112,125,123, 13,252, 35,234,104, 70, 70, 6,249,102,211,166,203, 34,161, 80,194,178,172,191,183,143,143,207,132,
+ 39,159,244, 2, 64, 39, 39, 39,115, 45, 52,205, 20, 0, 36, 39, 39,179,205, 32,206,207,223,223,127, 65,215,174, 93, 39,139, 68,
+162,118, 37, 37, 37, 37,165,165,165, 39,105,154,254, 0, 64,129, 27,242, 2, 2, 3, 3,151, 63,242,200, 35,143,135,133,133, 73,
+ 79,157, 58,117,231,194,133, 11,199, 13, 6,195, 82, 88, 86,136,117, 26,163, 70,141, 74,141,136,136,120,219,219,219, 27,190,190,
+190,167, 15, 28, 56, 16,253,183,241, 0, 52, 64,254, 60,111, 17,255,161, 25,195, 59,174, 98, 57,206,112,244,202,157, 79, 87,199,
+168, 14,204,207,193, 69, 71,223,149,223, 62,200, 25,171,229, 48, 85, 43,193, 55, 83,248,227,226, 21, 60,247,220,252,154,251, 20,
+ 5,252,150,187, 17,173, 34,194,101,108,181, 26, 52, 75,112,232, 80,110,236,218,141, 71, 26,144, 24,201,157, 62,113, 17,196,203,
+ 15,103, 46, 22,227,220,197,231,241,213,247,191,212,220,101, 89, 96,236,208,161, 64,117, 25, 0, 95, 20, 92,184, 4, 65,171, 0,
+ 12, 27,210, 75,166,212, 53,162,179, 16, 10, 32, 20,250,245, 25,128,214,222, 66,180,109, 37,134, 95,112, 16, 2, 69,190, 8, 20,
+243, 32,224,241, 96, 50,155,161,100, 88,156,170,116,188,220,230,210, 87,219,115, 18,158, 2,126, 94, 94, 8,105, 21, 12, 63, 63,
+ 47,112,148, 25, 12, 91, 13, 51,204,240,241,241, 66,171,214,237, 80,112,185, 11,215,177,219, 55,141,118, 74,253,227,215,112,254,
+190,222,240, 15, 8, 68, 72,171, 96,104,181, 90, 8, 69, 98, 8, 12,150,197,249,162,164,145, 50,185, 66,137, 71, 94,220, 24, 91,
+ 92,114, 11,138,178, 34, 84,157,203,112,164, 12, 56,221, 73,140,158, 57, 58, 54,123, 99,118,142, 19,178,238,171, 18, 80, 88, 88,
+200, 1,128, 84, 42, 37, 45, 69, 94,120,120,248,115, 52, 77,111, 4,128,201,177,177, 84,198,214,173,238,116,190,150, 53, 82,237,
+ 28, 57, 28,199,129, 16, 82,243,105,187,102,123,206,193, 78,106,174,172, 39,239, 10,249,247,240, 54, 49,219,125, 3,252,187, 1,
+128, 80, 34, 6,173, 55,128,213,234, 82,143, 31, 57,188, 36,225,157, 69,221, 51, 63, 76, 41,118, 36,231,211,119,231,114, 86, 11,
+139,129,101, 8,146,181,246, 67,245,246, 69,125, 71, 61,142, 81,143, 61,225, 82, 25,221,184,120, 88,214,169, 87, 76,236,181, 63,
+114, 92, 87,138, 19,228, 46, 61,158,152,152,136,173, 9,217,141, 62, 19,155, 93,123, 43,146, 30, 1,150, 87, 45, 55,176,208, 51,
+150,114,213, 90, 63, 51, 6, 7,160,139,175,160, 81,121,171, 86,173,202,121,247,245,183, 66, 39, 78,158,228, 99, 48,232,177,250,
+227,143,168,181,107,215, 26,230,206,157, 27, 14,224, 86,115,183,189, 73,147, 38,141,222,185,115,103,150,171, 74,212,204,153, 51,
+185,194,194, 66, 84, 85, 85, 97,197,138, 21,240,245,245, 69, 76, 76, 12,164, 82, 41, 54,110,220,232,110,187, 27, 57, 96,192,128,
+ 77,111,190,249,230,181,174, 93,187,110,236,223,191,255,165, 59,119,238,180,203,205,205, 29,240,194, 11, 47,236, 81,171,213,169,
+176,108, 0,231, 44, 98, 39, 79,158,156,153,146,146, 18,108, 50,153, 32,145, 72,224,237,237,221, 70,171,213, 62, 61,113,226,196,
+ 9,231,207,159,159, 11,224,191,206, 10,139,136,136,104,187,104,209, 34,228,229,229,113, 26,141, 38,160,206,109, 30,156, 91, 85,
+181, 89,112,246,236,217,186, 94, 2,231, 20,128,213, 49,104, 15,203, 14,120, 60, 0,102,173,145,185,153,123,181,252,147,161,157,
+ 67,231, 63,210,163,205,146,214,254,146,182,171, 81,182, 5,192,149,249, 57, 13,111, 82, 99,172,150,163,117,167, 71,177,252,237,
+201,216,104,199, 73,135,143,167, 67,171, 51, 98,220,232,249,120,120,216, 76, 60,147,248, 8, 36, 18, 17,104, 51, 3,141,142,150,
+ 53, 92,201,138, 0, 26,152, 60,125, 61, 94,126,115,118,205,213,177, 15,199, 64, 44, 22,225,199, 67,191, 96,239,177, 92,108,218,
+240, 25, 12,122, 35,132, 60, 62,124,188,132,208, 86,149,196, 42, 75, 80,239,238, 99, 28,199, 1, 28,107, 57, 40, 22, 28,199,193,
+ 72,139, 44,221,147, 8,224,104, 51,204, 60,192, 12, 51,204, 52, 11,198,220,184, 2,187,240, 69, 41, 23,232,199,192,207,215, 27,
+225,237,162,208,173,119, 39,248,250, 72,160,170,174, 64, 89, 69, 25, 20,170, 59, 48, 25, 8,188,188,188, 16, 18, 50, 12,149,229,
+ 33, 92,171,208,143,234,119,227,143, 92,204, 49,122, 29,244,124, 64, 40, 22, 66,175, 19,130,214, 9, 97, 16,139,192, 39, 12, 56,
+240, 96,208, 87, 67,175,211,160, 93,187,182, 50, 33,143, 15, 57,212, 8,165,167,163,238, 26,243,117,177,114,211, 74,135, 21,232,
+237,164,183, 27,239, 43, 19, 18,106,237,239,158,144,144, 48, 48, 40, 40, 40,159, 16, 98,224, 56,142, 31, 24, 24,232, 85, 80, 80,
+ 16,108, 93,221,173,173,187, 21,121,238,220,185, 83,237,126, 35,198,221,213,226,234,101, 75, 66,184, 57,115,230,196,174, 93,187,
+214, 37,153,225,225,225,201,131, 6, 13,250, 96,120,191,126, 48,137, 68, 72, 75, 75, 99,103, 79,153, 18,151,254,195, 15,217, 46,
+254, 62, 86, 45, 89, 82,115,190,224,253,247,145,182,116,105,163,231,206,136,173, 67,238,156,117,179, 24,110,244,232, 14, 61, 1,
+ 92, 79, 73,201,212,187, 72,254,185,189,123,246,244,179,181, 25,111,177, 4,183, 43,202,161, 86, 40, 49, 96,208, 96,175,159,191,
+218,144,157,240,206,162,158,153, 31,166, 56, 90,155,157,153,247,193, 90,254,179, 79, 79,224,119,150, 74, 89,171, 18,128,247,211,
+214,212, 86,162, 23,188, 6, 0,120,247,245,185,110,109, 39,237, 22,249,219,144, 25,228,194,195,163, 93, 18,237,205, 39, 56,183,
+244, 69, 16,191, 86, 48, 95, 63, 7,227,245, 63,145, 47,215, 34,122, 95,185, 83,223,239, 63, 96,192,209, 89,211,146, 34,147, 94,
+122, 33, 32,243,187,239, 89,169, 84, 74, 45, 79, 73,133,239,146,229,248,241,199, 31, 75, 51, 50, 50,168,230,242, 2, 76,154, 52,
+ 41,110,231,206,157, 7,118,238,220,105, 59, 31, 99,251,223,129,130, 18,115,224,192, 1, 89, 81, 81, 17, 58,118,236,136, 17, 35,
+ 70,192,223,223, 31, 74,165, 18,183,110,221,194,141, 27, 55, 48,102,204, 24,110,204,152, 49,177,111,189,245,150, 43,229, 52,233,
+145, 71, 30, 89,189,106,213,170, 45,253,251,247, 95, 77, 8,185,101,215,143,147,248,248,120, 31, 0,185,214,195, 41,121,115,231,
+206,221, 54,103,206, 28,234,244,233,211, 32,132, 32, 56, 56,184,230,216,183,111,159,112,200,144, 33,159,221,188,121,243,132, 35,
+ 65,147, 39, 79, 38, 59,118,236,224,138,138,138, 34,242,243,243,113,253,250,117,162, 82,169, 58, 2,224, 79,156, 56,209,188,107,
+215, 46,238, 65,146,191,237, 90, 93, 37,128, 95, 15,249, 7, 71, 71, 5, 39,245,139, 12,154, 78, 8, 17,112, 28,103, 98, 45, 7,
+109, 54, 25,244, 66,138,109,219,187,181,248,237, 86,126, 29, 59,237, 60,117,227,251,213, 49,236,209,249, 57, 13,239, 22, 7, 8,
+209,163,123, 87, 80, 84, 14,242,149, 85, 0, 46, 65, 85,122, 21, 2,177, 8,187,246,124, 10, 93,165, 25,211,159,127, 3, 44, 11,
+ 60, 57, 97, 40,204,124, 31,135, 47,151,159,127, 9, 44, 11,140,235, 75,172,188, 18, 9,131,145, 70,252,216, 49, 16, 7, 80,216,
+180,121, 63, 40, 10,216,246,253, 70,148, 94,255, 51,118,223,150, 85, 57, 13,109,151,200,114, 0,203,178, 96, 89, 22,102,179, 25,
+ 70, 1, 7, 19, 49,129,166,105,232,188, 12, 0, 43, 6,197,153, 97, 22,114,168,166, 13,208,170, 85,141,166, 45,196,199, 8, 62,
+ 95,130,224,224, 96,116,234,212, 9, 97,173, 7, 3, 60, 10,102,243,105, 80,156, 18, 6, 45, 3, 51,171, 69,217, 45, 57, 66,130,
+ 43, 17, 28, 48, 12, 31,174,250, 57,230,251,111,239,149, 37, 49, 48,224,140,149,128, 65, 4,154, 50, 65, 43,228,163, 90, 34, 0,
+ 95, 32, 4, 88,111, 16, 30, 65,181, 86, 7, 69, 89, 17, 10, 78, 31,131,188,184, 24, 44,203,130,226,120,110, 85,154,175,214,223,
+ 85,156, 95,120,229, 5,199,253,100,237,213,199, 12,153,153,153,139,222,124,243,205,217,197,197,197, 20, 33, 36, 36, 35, 35,227,
+123, 88, 54,119,242,114,183, 34,207, 74, 72, 16,172, 91,183,110,243,157, 59,119,176,109,219, 54, 68,119,237,202,107,142, 6, 34,
+149, 74, 73, 98, 98, 98, 12,199,113,178,181,107,215,186,188, 97, 17, 77,211,233,195,173,117, 74, 40, 20,162, 75,151, 46,216,126,
+232, 80, 86, 72, 72, 8, 42, 42, 42,156,150,115, 31,183,170, 37, 3, 7, 14,228,108, 27,196,216,125,254, 57,106,212,168,210, 69,
+139, 18,252, 83, 82, 28,175, 30,151,240,206, 34,111,111, 19,179,189,119,207,158,126, 60,138,194,171,207, 78,135,222, 96, 68,218,
+151, 95,194, 75, 34,129,193, 96,128, 65,175, 71,223,254,253, 58,255,242,221,119,115,208,240, 86,222, 53,125,206,210, 5,175,177,
+ 0,168,171,133,133, 84, 93,194,175,219, 60,221,121,241,246,221, 70,198,222,188,124,132,139,123,242,197,216,172,221, 95,186,165,
+ 8,216,239,218,199,109, 13,116,120,221, 17,122, 4,240, 81, 84,109,198,225,184, 16, 8,230,103, 64, 61, 61, 10,252,192, 80,151,
+200, 63, 49, 49,177,204,164,213,221,122,233,213,217,237,223,121, 99, 33,214,110, 72,191, 56,104,192,128, 14,233,107,210,189, 94,
+ 95,248, 22,190, 27, 58, 24,155, 55,111,158, 1,203,174,165, 77, 33,254,152,157, 59,119,202,108,100,159,145,145, 81, 0,203, 54,
+237, 7,157, 81, 0, 14, 28, 56, 32, 11, 9, 9, 65,255,254,253, 25,138,162,248, 22,239, 44, 11,129, 64,128,160,160, 32,180,110,
+221, 26, 55,110,220,192,129, 3, 7,100, 46,180,185,132,241,227,199,127,180,106,213,170, 53, 93,187,118, 93, 79, 8, 97, 1,124,
+ 6,224, 49, 0, 71, 8, 33, 75, 97,217, 95,229, 45, 0, 75,157,145,183,106,238,220, 31,134, 39, 36,144,221,187,119,131,207,231,
+ 67, 38,147,225,220,185,115,232,212,169, 19,150, 45, 91,134, 94,189,122, 97,246,236,217,252,247,222,123,111,149, 35, 97, 59,118,
+236,224, 0,192,203,203,235,118, 64, 64, 0,196, 98, 49,132, 66, 97, 53, 0,198,129,199,238,190,145,255,172, 69, 31,214, 92,251,
+ 60,229,157,122,149,128,250,102, 1, 80,124, 30,197,103, 88, 78,163, 55, 49,183, 8, 33, 34, 31, 17,175,143,159, 16,209,146,158,
+163, 58, 34,246,101,160,219, 8,180,241,230, 38,205, 24, 22,245, 78,144,159, 87,220,234, 24,248, 55,156, 28, 22, 60,158,173,207,
+246, 3,208, 14,254,225,227,161, 55, 27,176, 62, 99, 3,190,217,188, 13, 99, 98,135, 1, 0,116, 58,128,199,111, 88,148,196,171,
+ 43, 0,192,108,182, 87,164,202, 0,228,130,226,137,144,244,220,139,136, 79, 76,196,207,123, 44, 68,230,229, 13,104,171,111, 55,
+154, 89, 38,240,106,200,223,196,152, 97, 84,155,160, 83,234,160, 52,209,144,235,104, 40,140, 26, 40, 53,213, 80,148,107, 32, 87,
+ 26, 32,175,110,120, 9,245, 87,159,233,192, 17, 66,192,227, 17, 16, 74, 4,179,153, 3,163, 43,134, 86,121, 21,165,101, 42,200,
+ 21,213, 80,105,204,144, 43, 12, 40, 41, 41,195,197,203,103,161, 84,157,197,224, 1, 3, 27,220, 27,157, 7,128,210, 24,160,191,
+118, 11, 85,127, 92, 66, 85,113, 17,212, 42, 57,212, 42, 57,138, 46,158,198,241,204,175,144,187,117, 19, 42,174, 93,131,153,102,
+ 45,173,137,247,151, 13, 3, 18,235, 65,199,199,199,119, 95,190,124,249,155,109,218,180,209,110,219,182,173, 79,102,102,230, 79,
+ 0,250, 91, 11,221,237, 5,167,132, 97, 97, 11, 0, 96, 72,175, 94,152, 51,103, 78,249,169,203,151,179, 31,234,214, 45,166, 57,
+ 18,191,117,235,214, 28, 0,100,238, 92,139,149, 57,119,238, 92,151,228,154, 68, 34, 0,192,246,237,219, 17, 26, 26,138,119,230,
+206,197,130, 5, 11, 16, 18, 18,210, 34,198, 97,109,164,159,145,145, 81,115, 0,192,225,195,135,195, 1, 76,112, 82,204, 67, 1,
+129,129,221,120, 20,133,231,227,227,161, 84,169, 81,114,251, 22, 4, 2, 62,248,124,203, 33, 16, 8, 32,146,120,161,163, 84,250,
+113,255,209,163,157,178,216,175, 22, 22,226,219,237, 63,213, 28, 54,188,159,182, 6,239,167,173,193, 94,217, 97,151,223,119,116,
+194,123, 49, 0,112,243,242,145,156,209, 22,242,151,161,133,172,118,116,254,235, 79, 80,254,242, 0,140,202,170, 64,143, 0, 62,
+120,126, 65, 96, 20,229,136,222, 87, 14,111,190,133, 31,120, 14,230,100,221,184,118,173,234,243,140,255,118,253,250,191, 95,227,
+211, 47, 63, 43,250,108,213, 71,239,191,249,218,188, 9,203, 63, 88, 14,137,175, 55, 70, 12, 25,134, 83, 39, 79,125,253,108,210,
+179,110,191,179,141,252,109,231,187,119,239,198, 67, 15, 61,212, 17,192,116,103,221,254, 38,147, 9, 3, 6, 12, 96,205,102, 51,
+ 95,165, 82,193,104, 52,194,104, 52,226,242,229,203,144,201,100, 56,118,236, 24,218,180,105, 3,147,201,132,153, 51,103, 58,147,
+214,169,137,137,137,159, 76,158, 60,217,111,253,250,245,126,132, 16, 33,128,195, 0, 84, 0, 6, 0,248,201, 78,241, 60, 8,160,
+151, 35,121, 59,223,124,243,135, 9,125,251,146,239,226,227, 81,250,251,239,248,232,163,143,216,159,127,254,249,255,221,188,121,
+ 51, 84, 38,147,189,188,104,209, 34,152, 76, 38, 12, 27, 54, 12,222,222,222, 67,157,205,191,128,128,128,202,214,173, 91,195,199,
+199,135,243,246,246,190,105,205,195, 7, 94, 7,237,149,129, 70, 61, 0,243,115, 80,177, 26, 21,233,191, 93,171,200,138,142, 10,
+142, 29, 40, 13,178,172, 35, 62,126, 25,126,243, 25,131,131,127,148, 99,104,207, 64, 60, 34,253, 25,190,191,124,208,127,108, 63,
+233,244,205, 71, 46,254, 81,159,240, 54,157, 19, 8,199,149,112, 19,159,155,143, 5,175,125, 6, 64, 14,203,178,201, 70, 68,118,
+ 29, 0,177,136, 15,189,214, 8,208, 22, 5,193,215,215, 23,229,242, 6,247,203,134, 94,119,133, 0,224, 46,254,246, 37, 40,106,
+109, 45, 35,129,213,255, 9,131,209, 4,137,143, 24, 16, 90, 20, 4,141, 90,141,161, 67,135,226,200, 79,223, 53,108,142,176, 52,
+ 88,150, 15,134, 97, 96, 52, 26, 81,205,231,129, 79, 83,192,109, 53, 24, 47, 6,102, 33, 11, 78,192,131,142,199, 7,163,213, 65,
+105,108, 56,214,201,215, 71, 11,134, 33, 48,210,102, 40, 85,106,228, 95, 43, 70,201,237, 74,232,105, 19,212,213,114, 84,107,148,
+ 48,152,105, 16, 62,129, 86,167,130, 90,119, 3, 69,165, 42, 84,105, 26,222, 75,194,108,167,165, 49, 42, 45, 74,206, 94,194,157,
+ 75, 55,160,214, 92,131, 70,169, 4, 7, 62, 4, 60, 2,142, 8, 64, 81, 22,175,175, 43,234,230,219, 73,111, 59, 53, 28,224, 0,
+119, 0,220, 89,188,120,177, 30, 0, 22, 45, 90,116, 42, 37, 37,197,219,154,116, 3,128, 98,119, 5,175, 91,183,110, 69,124,124,
+ 60, 0, 32, 42, 36, 36,212, 58, 38,206,107,206,198, 97,115,255, 91, 61, 1, 14,179, 47, 60, 60,124, 52, 77,211, 72, 75, 75,195,
+211, 79, 63,141,201, 99,198,220,237,232,207,159,183,120,130, 66, 66, 56,103,227, 2, 22,188,255,126,205,152, 63, 0,188,181,100,
+ 73, 45,207,128,147,110,255, 90,176, 89,255, 54,210,183, 33, 35, 35, 3,201,201,201,200,206,190,254, 45,128,239, 28,118,104,124,
+254,127, 12,180, 17, 60, 30, 15,151,175, 23,128,227, 56, 92,204,191, 10,154, 54,129, 2, 1,159,207, 7, 33, 4,172,217, 12,189,
+ 86,135,171,191,253,118,200,137, 60,164,236, 73,255,217,167, 39,216, 91,252, 20, 0,156, 56,115, 30,157,163, 34, 93,154,166,156,
+157,249,159, 26,107, 63,219, 98,249,219,134, 66,184,199, 39,189, 24,187,111,167,123,222,128,102,129,252, 54,132, 17, 93, 80, 62,
+ 71, 12,209, 35, 83, 97,206,219, 15,179,218, 18,111, 80, 62,231, 97, 68,102,228,194,204, 54, 94, 85,186,118,238,218,214,203,203,
+219,235,211, 47,214, 25, 98, 71,141, 18, 14, 30, 58,228,187, 3,123,127,121,252,242,181,124,128,229, 32, 22,137, 48,108,224, 48,
+236,217,189, 7, 99,199,142,229,246,239,223,239,116, 87, 80,215,234, 63,112,224, 0,174, 95,191, 78, 3, 16,158, 60,121,146,158,
+ 61,123,246,180,140,140,140,103, 29,201, 41, 44, 44, 68,199,142, 29, 1,128, 42, 44, 44,196,185,115,231, 16, 25, 25,137,168,168,
+ 40, 40, 20, 10,228,229,229,161, 67,135, 14, 8, 13, 13, 69,100,100, 36, 10, 11, 11, 27,175, 40, 20,149,148,152,152,248,193,200,
+145, 35,125, 78,157, 58,229,199, 48,204, 75, 18,137,100,162, 94,175, 95, 5,203,214,231,176, 42, 0,107, 96,217,157,143, 70, 35,
+211,219, 5, 2, 65, 82,230,188,121, 27, 31, 14, 9, 33, 21, 11, 23, 98, 40,203, 98,205,238,221, 92,169, 78,247, 34,238,110,203,
+190,241,226,197,139,235, 25,134,225,251,248,248, 32, 60, 60,220,199,100, 50, 65, 32, 16, 56,122,125,175,210,210,210,174, 55,111,
+222,132, 86,171, 37, 10,133,162, 59,159,207,143, 99, 24,166,197,238, 56, 86,223, 16, 64, 24,128,142,147,162, 35, 94,109, 31,236,
+ 61, 29, 38, 61,208, 53, 14,103, 66, 38,225,145,185, 95, 65, 95,169, 4,207,207, 23,178,213, 73, 24,209,227, 55, 4,157,207, 26,
+ 9, 32,162,161, 31,232,228,215, 14,127,156,223, 97,231,112,208, 2, 48, 89, 14,147, 17,124,150, 7,202, 74,226, 59,127,116,188,
+139,200,254, 11, 28,198,246,239, 85,199, 8,229, 3, 16, 0, 2, 49, 24, 98,134,213, 14,198,148,233,243, 0, 64,150,242,238,220,
+ 6, 27,130,153,229,192,176, 20, 40,134, 1, 69, 27,161,163, 44,117, 71,207,227,193,155,209, 67,173,231, 64, 4, 4,102,179, 25,
+ 58, 51, 80,174,109,120,183, 83,134,102, 97, 16,240,192,234, 24, 48,172, 10,154,106, 19,120, 68, 0, 35, 99, 2,205,209, 96, 76,
+ 52, 32,100, 65, 17,128,136, 88,168,244,102,148, 85,232,160, 53, 50,245, 26,201, 20, 49,215, 12, 26, 17,114,119, 72,215,100,208,
+ 67, 37,151,131, 34, 60,240,249, 28,192,241,193, 35,238,155, 58, 87,138,174,208, 93, 35,187, 10,157,113,251, 55,164,155,193,110,
+ 15,237,148,148,148, 9, 0,110, 46, 90,180,168,191,191,191,127,128, 74,165, 42, 74, 73,113,125,135,204,185,115,231,190,176,110,
+221, 58,180,110,221,218,254,154,114,205,154, 53,217, 15,117,235, 54,250,212,229,203, 7,155,171, 33,204,157, 59, 55,214,110, 40,
+160, 49,242,143, 25, 52,104, 80,248,240,126,253, 64,124,125,145,146,146,130,133, 11, 23, 66, 32, 16,192,164, 80,192,223,223, 31,
+239,204,157, 91, 19, 23,144,156,152,232, 80, 9,168, 59,198,239, 40, 38,160,177, 17,133,186,214,191, 3,239,128,195, 42,163,144,
+203,187,249,248,250,162, 82,161,128,236,196, 9,240, 41, 30,140, 38, 19,116,122, 61, 88,150,173, 81, 92, 24, 19, 13,218,104,116,
+102, 72,131, 5, 64, 89,135, 1, 88,187,138,111,176, 94,199,251,105,107,132, 0,208, 89, 42, 45,191, 81,191,109,225,146,151,170,
+ 93,199,232,152,125, 59,191,116,197,221,220,112, 6,187,224,246,175,229,150,221,250, 95,244,123,238, 13,136,162,250, 88,250,138,
+202,219,200,151, 91, 20,127,209,208,241, 40, 54, 51,240, 90,219,248, 80,179, 90,173, 14, 16, 73,196,232, 20, 21, 37,190, 81,114,
+179, 77, 85, 69, 21,166, 60, 59, 93,182,247, 96, 22, 86,127,152,182,109,231,222,221,241,157,163, 58, 35,233,233, 25,200, 61,115,
+ 12, 99,199,140,225,246, 31, 56,224,240,157,237,173,254, 3, 7, 14, 32, 46, 46,206,166, 44, 10,111,221,186,133,217,179,103, 11,
+ 1,192,153,216,130,170,170, 42,140, 24, 49, 2,102,179, 25,133,133,133, 56,118,236, 24,122,244,232, 1,127,127,127,180,111,223,
+ 30,253,250,245, 3, 69, 81,160, 40, 10,109,218,180,113, 84, 79,123,244,234,213,235,147,161, 67,135,242,206,159, 63,239,103, 54,
+155,203,182,111,223,174,214,235,245, 41, 0,236, 7, 77, 95,125,252,241,199,139,247,238,221, 27, 69, 8,185,141,134,119,180,237,
+159, 60,124,248,198,193,124, 62,169,248,224, 3,112, 38, 19,100, 60, 30,155,171,211,205,132,101, 27,119, 27, 94, 89,188,120, 49,
+159,162, 40,200,229,114, 92,191,126,189,188, 87,175, 94,161,206,148,115,120,120,120,144,153,227,160,215,233,112,241,226, 69, 48,
+ 12,211,162,103,158,240,235,144,127,231, 48,127,201,240,199,251,134,207,246,147, 8, 6, 49,102, 86,193,231,204,126, 8,104,195,
+187,173, 52, 64, 95,169, 2,132,124,152,149, 26,148, 40,104, 32, 56, 2, 20, 75,139, 27,115,241, 94, 83,171,209, 37,192, 15,140,
+ 17,184,150,243, 45, 58,197, 60, 86, 99,192,153,104, 19, 4,160, 80,109,176,236, 80, 59, 54,102, 0, 36,193,225, 88,181,241,167,
+ 6, 19, 60,182, 55,193,222,115, 28, 4, 98, 64, 24,241, 24,232,226,163, 53, 94, 0,129, 80, 4, 19, 12,240,145, 88,118, 36,221,
+189,119, 11,254, 56,153,211,168, 75,146,101, 89, 8,105, 61, 76, 16,130,162, 24,192, 96,233,216, 76, 38, 19,140, 6, 1,120,124,
+ 1, 96, 0, 56,214, 50, 68, 16, 41,141, 2,114,235,159, 81,160, 51,176,224,241, 8, 76,140, 9, 6, 35, 11,181,198, 82, 15, 77,
+ 44, 7,218,200, 2,124,128, 39,224,129, 47, 6,136,222, 12,150, 48, 96,161,135, 70, 15, 88,118,150,108, 28,102, 0, 20, 11,112,
+ 4,160, 40, 22,132,240,192,114, 4, 20,101, 53,156, 88, 10, 44, 69,129,176,206, 25,200,118, 65,126,194, 38,214, 35,111, 0, 33,
+139, 22, 45, 42, 79, 73, 73,137, 5,240,212,162, 69,139,198,164,164,164,104, 1, 84,185,229,178, 74, 72, 16,174, 91,183,238,203,
+248,248,120, 72, 91,181,170,185, 46,109,213, 42,192,234, 5, 8,121, 16, 13,134,166,105,153,109,236,159,211,104,240,175,127,253,
+ 11,198,170, 42,216, 34,223, 58, 89,149, 21,129,209,136, 9, 19, 38,148,151,150,151, 79,115,198,210,110,198, 33,153, 90, 30,128,
+ 70, 60, 4, 56,125,250, 52,169, 79,121,168,165,212, 26,105, 40,105, 57, 12, 6, 3, 2,252,253, 33, 22,138, 96, 50, 51,224, 56,
+ 14,102,179, 25, 52, 77,195,100, 50,129,101,204,206,198, 51,176, 87, 11, 11,169,206, 82,169,205, 34, 96,175, 22, 22, 82,223,110,
+255, 73,108,239, 17,232, 44,149, 42,155,203,125, 95, 82,144,215,108,150,191,187, 49, 0,163,178, 42, 80, 46,221, 6, 97, 68, 23,
+144,168, 62,136,220,240, 59, 42, 13, 44,188,249, 4,244,175, 63,226,202,245, 27,112,180,107,177,158,161,113, 58,247, 36, 62, 89,
+245, 49, 30,142, 25,142,197,255,111, 9,126,217,247, 11,190,219,244, 13,134,142, 28, 30,223, 94, 26, 1,190,151, 0, 7,143, 30,
+196,230,175,191,193,142, 31,183, 67, 40, 22,115,187,119,239,110,116,125,136,157, 59,119,214, 34,126, 27,148, 74,215, 55,184,211,
+104, 52,240,247,247, 63, 1, 96,176, 84,103, 60,227,177, 0, 0, 32, 0, 73, 68, 65, 84, 42,197,192,129, 3,193,227, 89,134, 89,
+ 35, 35, 35, 33, 18,137,160, 82,169, 32,149, 74,225,235,235, 91,164,209,104, 34, 27, 17,119,241,252,249,243, 43,118,236,216, 49,
+174,115,231,206,221,182,111,223, 94,173, 80, 40,150, 2,216,108,175,191,140, 26, 53,234,205, 13, 27, 54,108, 5, 80, 14, 32, 1,
+192,111, 0,250,214, 35,239,247,181, 50,217,138,128,188,188,119,159, 97, 24,124, 12,176, 95, 86, 87,207,168, 35,239,169,121,243,
+230,125, 60,107,214, 44,220,184,113, 3,123,246,236, 1,195, 48,135, 0, 60,227,196,235, 83, 1, 60, 94,149, 15, 77, 67,251,251,
+239, 92, 8,203,106,174, 1,154,191,186,143,234,215,175, 31,206,158, 61, 91, 51,238,223,104,130,235,156,119,152, 20, 29,177,220,
+ 79, 34, 24, 84,161, 54,252,114,252,106, 69, 10,120, 34,224,202, 81, 60, 42,229,240,127,175, 77,192,192,158, 82,204, 75,126, 28,
+ 79,118,164,129, 11, 7,192, 9, 36, 12, 26, 13,214, 81, 34, 95, 89, 12,190, 8, 24,251,228, 27,216,252,233,135, 22, 99, 81,103,
+132, 89, 15,252, 40, 59,139,236, 83,150, 25,133,237, 34,162, 64,241, 29,147,215,184,190, 4, 38, 3,176,123,207,126, 68,143,121,
+205, 98,253, 67, 0,158, 4, 72, 28,159,128,113, 35, 39, 90, 26,126, 81, 1, 24, 3,221,184, 70,207,113, 96,136,133,224,141,180,
+ 37,248,207,104,208, 67,167,211,161,186,186, 26, 26,181, 10, 26,141, 6,106, 77, 53, 12,213,213,208,235,245, 13, 87,254,106, 2,
+189,193, 12,189,193, 12,173,206, 4, 77,181, 17, 10,141, 17, 74, 53, 13,149,198, 4,165,210,242, 41,175, 98, 32, 87, 48,144,171,
+ 24, 84,202,105,220,169,108, 56,141, 20,199,193, 12,128,152, 9, 8,197,130, 35, 28,192,113,224, 56, 30,204,236,221,226, 99,173,
+189,135,171,190,241,238, 67,187,227,216,222, 99,248,229,208, 47, 53, 74,193,149,162, 43,174,214,185,112, 0, 29, 83, 83, 83,207,
+ 1, 88,251,206, 59,239,188,222,161, 67, 7, 38, 35, 35,131,164,165,165,185,172, 1,207, 74, 72, 32,194,176,176,157, 0, 16, 22,
+ 22,118,207,253, 57,115,230, 48,121, 87,174,108,105,174, 88, 0,155,251,223,217,125,227,109, 99,255, 0,240,195, 15, 63,224, 90,
+ 89, 25, 0,224,231,156,156, 90,247,174, 92,185, 18, 26, 18, 18,162,120, 16,138,202,232,209, 29,108,243,174,107, 93,183,157,219,
+238, 59,244,105,250,249, 94,102,205,102,168,229, 10, 84, 86, 86,162, 74,169,128, 86,167,131, 86,167,131,166,186, 26, 90,149, 26,
+ 26,165, 18, 6,189, 14,180,193, 0,150,113, 24,232, 76,117,150, 74,109,125, 6, 11,128,182, 31, 14, 0,128,111,183,255,132,247,
+211,214, 4, 0, 8,115,185, 34,118,140,142,169,171, 56, 68,245, 24, 21,131, 7,140,219, 83,164,136,220,240, 59, 72, 84, 31, 24,
+ 15,111, 67,209,243,253,225,205, 39, 56, 26, 23, 2, 70, 85,129,232,253,229,224, 59,168,126, 89, 89, 89,228,229,249,175,224,218,
+149, 43,200,205, 57, 10,127, 95,127, 76,157, 50, 21, 1,193, 65, 56,115, 50, 15, 62, 66, 49,188,189,189,209, 70,218, 22, 91,190,
+223,130,119,222,123, 23,213, 74,247,119,169, 29, 48, 96,128,203,223,241,245,245,133, 74,165, 26, 76, 81, 20,221,190,125,123, 12,
+ 26, 52, 8, 61,123,246, 68,171, 86,173, 32, 22,139, 33,149, 74,209,183,111, 95, 4, 4, 4, 64,163,209, 68,250,250,250, 58, 18,
+185,242,240,225,195, 89,155, 54,109, 18, 40, 20,138,197,117,200, 58, 97,196,136, 17,159,108,216,176,225,171,176,176,176, 15, 8,
+ 33, 62, 0,222, 1,208,152,155,236,189,229, 26,205,202, 23, 25,198,252,165, 94, 63,173,142,188,248,103,146,255,189,227,181,215,
+ 23,240,174, 92,185,130, 19, 39, 78, 96,195,134, 13,213, 0,254,207,201,215,167,188,140, 70, 49,119,233, 18,218,103,103,147,240,
+210, 82, 30, 30, 80, 12, 74,221,160,247,134,130,224,235,118, 2, 34, 30, 69,124,139,171,180,223,109,201,189,241,127,103,139,228,
+ 39,245,102,114, 13,149, 55, 32,222,241, 42, 62, 24,166, 65,222,210, 65, 88, 29, 91, 13,239, 31,231, 0,242, 18, 84,115,226, 11,
+ 86,205,171, 1,220,141,234, 63,119,254, 39,252,251,223,155,208,201,175, 55,254, 60,126, 14, 7,100,151, 16, 59,180, 39,226, 70,
+ 88, 42, 26,199,227,131,118, 97,162,196,216,254,221,176,124,229,135,216,127, 65, 13, 31,105, 15,140, 31, 63, 1,191, 28,218,137,
+ 61,191,108,177,188,156,217, 4,145,160,241,126,142, 99,205, 48,179, 22,107, 6, 86,107,134,166,105, 24, 12, 6,232,245,122,104,
+117,122,232,117, 90,232,117, 90,232,140, 6,208, 70, 67,195,238, 47,189, 47, 84,213,102,168,245, 44,212,122,214,242,191,134, 69,
+181,150, 65,181,142,129, 66,110, 70,149,220,132, 42,133, 9, 85, 85, 38, 84, 86,210,184, 83,105,106, 84, 1,184,235,254,191,215,
+ 84,227,243, 56,240, 8, 1, 87, 39,234,159, 35,142,235,220,219, 73,111,163,251,208,238, 53,231,217, 27,179,107, 60, 2,199,246,
+ 30,195,149,162, 43, 55, 92,169,112,219,182,109,251,149,227,184, 94,241,241,241, 73, 81, 81, 81, 33, 0, 40,150,101, 69, 38,147,
+ 41,112,254,252,249,126, 13,184,130,235,133, 48, 44,236,253,117,235,214,141,139,143,143, 71, 84, 72,136, 83, 67, 87, 77,116,255,
+199, 0, 64,116,183,110, 14, 3,216, 58,183,110, 29,155,150,150,134, 63,139,138,212, 59, 14, 28,192,229,203,151,107,172,254,174,
+ 93,187,194,122,143,222,113,224, 0,138,138,138,112, 37, 47, 79,239, 72,230,130,247,223,199, 91, 75,150,212,184,247,109,255,219,
+206,109,255,187, 18, 11,144,146,146,201,141, 26, 53,234, 85,123,210,183,125, 14, 28, 56, 16, 41, 41,153, 78,117, 76, 87, 47, 23,
+228, 49, 12, 3,154, 54, 66,126,167, 28, 21,183,203, 80, 89,118, 7,149,101,119, 32, 47,175,128,178,170, 10, 70,173,214, 18, 63,
+163, 84,194,137, 32, 64,230,253,180, 53,252,247,211,214,240, 1,168, 1,176,131, 7,244,185,231, 33,187,184, 0,167,209,182, 99,
+116, 76,105, 65,158,172,239,160,187,105,232,216,255,201, 24,101,197,117, 89, 83,234, 7, 73, 84,212,178,252,221, 65,190, 92,139,
+226,151, 30, 2,119,227, 60, 66,255,123, 6,222,235, 79,227,246, 20, 41, 6,238, 47, 7, 17,136,192, 39, 0,159,114,172,128,158,
+191,112,129,252,235,195,229,152,247,214,155, 48,177,102, 92, 46,188,138,233, 83,167, 65, 40, 22, 99,215,143,187, 1,147, 25, 70,
+131, 17, 71,243,142, 67,175,175,198,172,153, 51, 15,191,252,242,203,141,149, 53,153, 52,105, 82,236,152, 49, 99, 64, 8, 65, 86,
+ 86,214, 61, 46,253,183,223,126,219,233,247, 12, 14, 14,198,173, 91,183, 0,128,159,158,158,142,138,138, 10,244,238,221, 27, 1,
+ 1, 1,160, 40, 10, 39, 79,158, 4, 69, 81, 32,132,224,214,173, 91, 8, 14, 14,118, 70,236, 7, 52, 77,143, 4,240,131,221,181,
+169, 35, 70,140, 72,123,233,165,151, 2,211,211,211,197,132, 16, 10,192, 78, 88,102, 1,220,113, 32,111,225, 9,147, 41,186,174,
+188,103, 22,237,216,250,244,180, 57,100,220, 43,233,200, 57,113, 17,105,105,105,172, 90,173,126, 1,150,217, 5, 78,121,183, 58,
+249,250, 6,180, 47, 43,195,112,157, 14,109, 4, 2,111,111, 30,239,129, 45,183,223,175, 95,191,154,195,169, 33, 0, 0, 5, 91,
+142,223,152, 43,215, 26, 79, 3,200, 7,208, 38,247,106,197,231, 35,187,133,189,199,191,113, 34, 8, 27,102, 0, 34,111,192,168,
+ 5, 56, 14, 38,158,248,206,209, 63,111,127,137, 70, 86, 95,218,252,221,103,177,211,166, 39,201, 0, 64,203,154,112, 77, 89, 12,
+192,140, 78,126, 81,136,141,237,131,176, 86,255,159,189, 43, 13,107,234,218,218,239, 62, 25, 8,160, 34, 56,139, 86,197,138, 90,
+181, 14, 88, 17,181,146, 40, 90,171,181,195, 87,163,182, 94, 91, 63,109, 9,106,175, 83, 7,180,181,215,222, 94, 91,245,222,139,
+218, 81, 98,135, 79,219, 91,111, 53, 88, 91,167, 58,160, 9, 42, 34,136, 86,235, 12,130,138,160,136,146, 48, 37, 64,166,253,253,
+ 72, 78, 12, 33,144,147,128,162,237,121,159, 39, 15, 57, 67, 22,251,236,189,207, 94,239, 90,123,237,181,219,163,184,180,204,230,
+ 43, 48,154,113,179, 68, 95,239, 67,117,122, 36, 10,249,121,246,101,158, 68,136,113,253,109, 49, 0,123,206,152,176,119,103, 18,
+110,221,185,129, 86, 45,109, 43, 9, 90,138, 69,120,124,240, 0,168,127,174,199,165, 11, 33,196, 86, 51, 44, 16,192, 74, 8, 24,
+139, 21, 48,153, 97, 17, 9, 1,194,128,125, 39,173, 20,182, 92, 1,245,224, 87,245, 21,242,244,136,230, 52, 64, 76, 33, 20, 57,
+121, 24, 76,128,153, 2, 85, 70,192, 82,109, 1, 33, 4, 68, 76, 96,182, 0,250,106, 32, 35,173,148, 12, 24,208,153,186,117,249,
+179, 61,139,177,130,216,221,255, 54, 82, 64, 96,177, 50, 96, 4,246,149, 2, 0,168,128, 2,148,155, 23,192, 89,249,187, 59, 78,
+221,157,218,141,107, 71,155, 52,105, 82,159,164,164,164, 53, 0, 6, 36, 37, 37,237, 73, 74, 74, 58, 60,105,210,164, 55,186,119,
+239,110, 34,132,180,250,228,147, 79,246, 45, 94,188,120,218,202,149, 43, 83,234, 33,159,172,245, 47,124,235,173,183,150,189,245,
+214, 91,216,179,103, 15,244,183,106,191,203,221,218,180,193,149, 43, 87, 0, 64,205, 37,145, 79, 93, 73,127,222,120,227, 13,233,
+ 23, 95,124,161,254,252,243,207, 49,184,103, 79,217,241, 11, 23, 60,186,138,143,158, 57,163, 25,222,191,255, 83, 23,143, 31,239,
+ 10,192, 15,192,167, 38, 63, 63,136,170,171,209,163, 67, 7, 44, 90,180, 8,169,169,169,171,194,195,195, 83, 82, 83, 83, 15,228,
+231,231,123, 32,119,181,243, 0, 52, 32, 6,160, 6, 15, 76, 73, 73, 33,241,241,242,227,199,142, 21,165, 42, 20, 10, 49, 0,196,
+199,203,135,173, 90,165, 74, 3,199, 36, 64, 93,251, 63,246,110,229,205,194,177, 86,179,165,151,190,180, 20,165,119,110,131, 16,
+ 6,148, 90, 81, 85, 85, 5, 74, 41, 40,165,184,114,254, 2, 76,198,106,252,150,156,236,169, 14,157,199,156,150, 0,152,241,178,
+104,235,120, 89, 52,156,151, 5,218,167, 8, 56,163, 83,143, 33,210,252,236, 12, 53, 0,116,237,210, 5,167, 51,108, 60, 57,231,
+183,237, 0,128, 54,143, 12,146,221,206, 59,217,100, 30,128,193,191, 22, 33,243,105, 96, 64, 68, 12,138,230, 14, 67,251, 47,143,
+ 34, 75,171, 71,176,152,160, 88,171,131,144, 16,143, 30, 0,199,187,153,154, 90,227,206,238,221,187,211,241, 19,158,198,206,237,
+ 59,177,101,203, 22,124,240,222,251,216,167, 57, 0,129, 80,128,208, 78,161,209,165,165,245, 47, 93,222,182,109,155,198, 78, 4,
+164, 99,199,142,173, 17, 11,176,127,255,126, 92,190,124,185, 74,169, 84,118,112,245, 38,185,237, 47, 93,187, 34, 55, 55, 23,143,
+ 61,246,152,121,193,130, 5,226, 31,127,252, 17, 65, 65, 65,184,120,241, 98, 45,207,107,110,110, 46,186,114,111,103,231,196,115,
+211,159,120,226,137, 15, 95,122,233,165,160,204,204,204,230, 85, 85, 85,255,235,239,239,255,140, 61, 48,240, 23,142,242,156, 23,
+202, 79,127,230,175, 63,110, 28, 49,250, 5,242,207,100,128,116,124, 22, 31,175,125,151,106,179, 47,206, 4,160,242,162,153, 73,
+185,201, 84, 34,246,243, 67, 11,177, 24,254, 22, 75,181,190,230,146,181, 7, 14, 53, 8,192,124, 13,206,125, 34,173,206,154,175,
+113, 76,105,230,125, 34, 45,249,181,188,202,172,143,124,180,245,248,144, 0,193, 19,130,234,170, 64, 51,101,202,139,203,141,199,
+210, 46, 23,238, 45,208, 26, 82,230,107,112,179, 46,146, 49,237, 47, 75, 53,135,142,166,201, 0,168,173, 2,118,154, 79,128,203,
+101, 55,241,183, 55,102,194, 96,168, 70, 89,165, 45, 6,192,200,248, 97,243,182,250,211,236,230,231,165,145, 23,158,253,171, 77,
+ 89, 90, 88,203,217,140,113,253, 8,166,206, 89,141,128, 0, 63,180,240,151,200, 0,168,179,207,158,148,109,248,108, 91,189, 3,
+146,144,154, 97, 36, 54, 18, 0, 66, 96,161,212, 70, 4,204,246,229,126,132,129,208,106,133,217, 30, 28,232,137, 4,148, 84,182,
+ 68,101,117, 49,196, 66,198,145,230,204,108, 5, 76, 38, 10,147,153,162,162,210, 10, 34, 32,176,128,192,100,189,235,186,119, 7,
+139,149, 1, 67, 44, 32, 22, 2,202, 80,135,251,159,212, 97, 60,179,146,206, 93,252,145,120,202, 13,125, 33,237, 66, 67,251,142,
+195,109,209,175, 95,191,155, 97, 97, 97, 47, 92,189,122,181,199,150, 45, 91, 50, 0, 60,151,148,148,244,156,243,205, 43, 87,174,
+212, 44, 94,188, 88,182,114,229, 74, 79, 10,194, 81, 33,113,113,113,117,222,244,226,171,175,218,124,128,222, 37, 6,162, 46,110,
+127, 0,192,144,222,189,101, 25, 28,148,191, 99, 0, 62,125,218, 17,173, 58,172, 95, 63,107, 66, 66,194,231, 19, 39, 78, 52, 95,
+186,116, 73,120,237,218, 53,116,109,213, 42,109,231,206,157,156, 2, 20,239, 81, 30, 0,103,229,126, 43, 37, 37,197, 57,198,227,
+140, 83, 61,123, 36, 1,170,149,171,244,242,197,241, 47, 94, 60,112, 48,173,101, 96, 96,139, 50, 93, 9,204,102, 51,168,253, 61,
+208,221, 42, 66,153, 78, 7, 74, 41, 6,198,196,200,126, 75,246,152, 7,201,140,187, 49, 39,140,125, 57, 32, 19, 57,232,113,140,
+151, 69, 59, 86, 1,100, 95,189,202,153, 4,196, 76,120, 73,154,188,235,191, 14, 43,255, 23,213, 55,106, 0,104, 19, 54, 92,118,
+ 59, 55, 85, 3, 0, 77,163,252,105,109, 18,128,175, 48, 32,238,111, 40,180, 90,209,127, 67, 6, 50,198,181, 67,159,157,183, 32,
+ 36, 64,115,145,111,198,226,206,157, 59,201,148,151,166,208, 81, 99, 70, 99,251,214,159,241,143, 85, 43, 17, 95, 90, 10,106,181,
+ 98,243,230,173, 40, 40, 40,120, 6,192, 78, 79,114,220, 17, 1, 0,120,225,133, 23, 78,129,227, 92,246,134, 13, 27,200,216,177,
+ 99,233,201,147, 39,197,131, 6, 13,194,232,209,163,161, 86,171,241,200, 35,143,160,186,186, 26,209,209,209,160,148, 90, 79,158,
+ 60,201,136, 68, 34, 95, 50, 2, 62, 22, 20, 20,180,102,202,148, 41,162,243,231,207,183,168,174,174,174, 43, 48,144, 43, 6,134,
+ 14,152,188,113,192,200, 41,228,155, 20,160,172, 18, 48, 94,217, 99,213,102,171,103,160,102, 96, 32, 39,125,170, 45, 45, 53,139,
+ 77, 38, 24,196, 98, 8,205,102, 15,211,227,247, 6,108, 30, 0,103,203,223,221, 57,183,174, 84, 39,229,207, 30, 95,248, 68, 90,
+145,119,237, 78, 69, 26,128, 14,246,151,183, 26, 64, 1,128,220,249, 26,120,116,113, 42,191,220,165, 25, 49,162,159,204, 66,155,
+169,157, 95,142, 10,125,153,109,221, 63, 19,128,156,114,144,181, 95,110,226,244,128,219,182,127, 70,110,107,115,165, 96, 12,106,
+231,234,109,214, 44, 8, 22,147, 14,160,122,140,235,199,109, 66,215, 4, 1, 64,169, 77, 81, 67, 0, 49,181, 19, 1,187,242,183,
+229, 0, 4,192,145,200,165,157,184, 78, 34,250,118,160,102,147, 22, 66,187,247,135, 82, 10,139,153,162,202, 4,148,149,155, 97,
+ 2,133,153, 50, 16,138, 8,238,220, 50,213, 89,206,227,199, 87, 17, 0, 24, 22,245, 54, 37, 38,155,245, 79, 1, 80, 74, 0,106,
+183, 24,168, 0, 68, 96,133,213, 42, 68, 86,246, 86, 78,207,252,218, 63, 94,147, 93,205,185, 90,159, 2, 22,193,182, 84,163, 62,
+237,228,168,249,101,203,150,177,254,209,211,118,171,248,174,162,126,241, 69,233,214,173, 91,213,118, 18,160,246, 68, 2,214,171,
+ 84,166,223,206,156,145,119,237,215,207,242, 68,175, 94,122,123, 31,173,134, 75, 22, 45,249,184,113, 54,139,163, 95, 63,207,211,
+ 29,111,191, 45, 3,128,193, 61,123,214,186,150,121,233,146, 38,227,130,239,100,168, 95,239,222, 95, 50, 12, 99,185,120,252,120,
+ 96,187,118,237,238,164,230,231,111,244,100,245,223, 7,173,227,220, 15,244,246,128, 63,118,106,160,194,165,173,185,144,128,243,
+242,197,241,145,219,191,254,102,107, 88,183,174,143, 85, 87, 87,193, 98, 50,195,106,181,162,121,112, 48, 74,181, 90, 86,249,115,
+ 33, 81, 37,127,127,243,175,109, 1, 24,179,175, 94, 21,179,243,255,233, 39,127,199,120, 89,180,117, 89,194,103,158,146, 3, 57,
+ 48,103, 94, 60,189,120,233,162,204, 89,249, 3,192,168,167,158,147, 29,220,251,139,230,118,110,170,239,149, 88, 71,128,159,251,
+243,220,117,216,224, 95,139,128, 95,223,112, 28, 63,250, 75,161,227,123,169,201,119, 99,113,243,127, 55,147,225,195,135, 63, 61,
+118,194,184,221,175, 79,159,117,228,241,254,253, 70,108,255,101, 7,210, 78,157,192,137, 19, 39,118,213,231, 6,174,135, 8,204,
+218,182,109,219,215,219,182,109, 27,186,109,219, 54,206,133, 27, 59,118,236,168,125,251,246, 29,220,185,115, 39,194,194,194, 48,
+102,204, 24, 4, 5, 5,101,149,150,150,134,159, 59,119, 14,185,185,185,140, 72, 36,194,216,177, 99, 99,246,237,219,231,237,163,
+158, 47, 45, 45, 93,181, 99,199,142,250, 2, 3,189,193,111, 5,167,182,172,248, 57,233,217,119, 43, 67,167,161,242,248, 82,235,
+141,195, 31, 77,247, 81, 94,213,181,162, 34,209,155, 89, 89,249, 22,131,129, 57,205, 48,162,246, 2, 65, 97, 97, 19, 57, 1,220,
+101, 3,244, 52, 5,224, 22,243, 53,208, 3,248,221,254,241, 9, 71,142,156,209,196,197, 45,150, 37, 42,255,161, 14,237,210, 3,
+ 64, 53, 68,126, 18,228,223, 44,195,166,157,169,196,123,121,187, 52, 51, 94, 91,136, 13,223,254, 4, 88,175, 1, 16,194, 92, 85,
+137,208, 14, 65,178,143,222,158,197,217,154,131,197, 10, 33, 99,133,137, 8, 33,162,230,187, 68, 0,102,128, 90,192, 53, 48,204,
+ 25, 39,206,222, 36, 0,208, 62,132,161, 34,161,205,218, 55, 91,109, 9,140, 74,202, 41, 44,102, 64, 32,180,194, 98,230, 54,114,
+ 28, 77,251, 23, 1,128,200, 33,139, 40,216,156,240, 12, 96, 37, 54,119,255,165,236, 29, 94, 21,242,235,247,191,214, 52, 66,255,
+226,100,174,176,202,223,201, 19,224,113, 57,214,241,139, 23,147,142,187,184, 12,235,185,215,227, 61,141,153, 58,184, 22,185,181,
+ 45,241, 75,180,217,214,103,124,146,209,200,121, 0, 92,235, 86,239, 97,169, 21,167,190,163, 90,185,234,162,124,113,124, 95, 0,
+130,139, 41, 41,166, 42, 67, 37,172, 22, 11,122, 71, 68,200, 58,132, 63,134,227,191,238,224, 86,199,148, 76,217,251,235, 46,199,
+225,176,199,194, 28,223,247,254,186,171,214,113,125,161,241, 95,126,106, 35,200,163,159,122, 94,118,254, 98, 14,110, 94, 59,163,
+ 6,128,131,123,127, 81,183,123,164,175,236, 86,222, 89,175,219,125,242,228,201,240, 54,189,175,133,248,213,123, 61,239,133,246,
+248,245, 70,213, 61, 31,240, 83, 83, 83,127, 85, 42,149, 76,102,102,166,245,192,177, 20,180,106,221,202,117,165,135, 87,216,182,
+109,219, 55, 74,165,242, 59,133, 66, 97,242,230,119,111,189,245,150, 26, 0,153, 49, 99, 6,205,201,201, 65, 70, 70, 6,202,203,
+203,195,155, 55,111,142, 86,173, 90, 57,246, 2,240, 65,249,179,248, 87, 74, 74,138, 40, 45, 45,173,159,209,104, 92,138,154,115,
+249,190,224,189,179,155,255, 34, 10,234,254,221,162,210,156,125,211, 26, 32,207,252, 99,122,250, 51, 0,198, 0,248, 13, 86,107,
+ 57, 60,199, 35, 52, 58,216, 85, 0,238,206,251, 68, 0, 60, 14,130, 74,165,112,221,186,117,158, 93, 85,123,143,106, 58,117, 29,
+ 77,110,229,167,209,182,161,157,161, 45, 55, 99,211,246, 35, 62,119,208, 13, 95,175,177,255,182, 29, 5,110, 33,184,185, 16, 31,
+ 45,121,221,171,151,254,171, 99,217,247,108,157,102,161,214, 74, 0, 64,226, 47,162,198, 74, 19,172, 0, 2, 2, 2, 96, 48, 27,
+136,197,236,189,188,244, 12,219,158, 1,145, 79, 44,164, 86, 42,192,213, 43,187,155,114,141, 41,215,165,131,252, 46,129, 28,234,
+199, 89,225, 55,242,180,128, 49, 62, 94,238, 7,192,178,106,149,170, 65,166,136,106,229, 42,118, 35, 31, 71,155,230,156,245,110,
+157,254,188, 21,159,249, 68,198, 92,183, 2,118,198,129,189, 63,107, 92,251,218,173, 60,223,242, 7,120,218,216,199,149, 3,155,
+137, 31, 42,153,250, 87,164,230,148,155, 17,222, 92,120, 95, 94, 21,251, 90,253, 70,123,231,188, 85,254, 53,198,103,223, 55,252,
+225,130,143,141, 70,227,207,128,231, 77,233, 56,226,157,210,156,125,155, 80, 51, 54,192, 91,152, 0,148,192,187,184,129,123, 70,
+ 2, 56, 13, 62,190,238, 35,204,131,135, 51,122,244,232,129,236,236,108,190, 34,120,240,224,193,227, 33, 1,195, 87, 1,143,198,
+ 0,175,252,121,240,224,193,131, 39, 0, 60,120,240,224,193,131, 7, 15,158, 0,240,224,193,131, 7, 15, 30, 60,120, 2,192,131,
+ 7, 15, 30, 60,120,240,104,114,212, 8, 77, 61,117,234,148,207, 81,155,238,130, 9,121,121,188, 60, 94,222, 3, 35,175,222,232,
+112,190,254,120,121,188,188, 63,150, 60,175, 9,128,211, 64,225, 45, 60, 13, 60,141, 41,143,199,131, 9,202,183,219, 67,217, 14,
+156,239, 87, 42,149,129, 0,158, 56,114,228,200, 71, 2,129, 96,152,159,159, 31, 12, 6,195,209, 17, 35, 70,188, 7, 32, 67,161,
+ 80, 24, 30,132, 10,176,103,135, 84,255,153,199, 21, 74, 41, 61,123,246, 44,250,245,235,199,191,147, 60,188, 34, 0, 94,173, 67,
+230,146, 40,199,157, 60,231,196, 39,222,202,251, 19, 14,232,156,240,212, 83, 79,201,246,238,221,171,225, 42, 51, 52, 52,180,214,
+133,130,130, 2,215,193, 20, 42,149,138,112, 44,227, 61, 35, 1,117,229,243,111, 42,121,171, 87,175, 30,189,117,235,214,228,172,
+172, 44, 0, 64, 88, 88,216,179,233,233,233, 59,124,109, 95,231,126, 79, 41,117,188, 31,236,121,246, 93,177,159, 39, 30,200, 51,
+215,118,240, 70,249, 63,118,246,236,217,173,101,101,101,189,186,116,233,130, 59,119,238,160,170,170, 10, 0,134,109,221,186, 85,
+ 29, 24, 24,120, 81,169, 84, 62,175, 80, 40,234,221, 74,242,236,217,179, 94, 25, 4,169,169,169, 50,133, 66,161,241,230, 55, 42,
+149, 74, 45,151,203,101,190, 36,128,162, 94, 38, 97,152, 60,121,178, 55,239, 7, 0,160, 75, 23,219, 14,184,229,229,229,168,174,
+182,165, 65,215,235,245,222,188,111,245,226,204,153, 51,116,216,176, 97,232,221,187, 55,252,252,252,138,170,171,171, 31,225,135,
+209, 63, 31, 92,147, 1,221,179, 68, 64,188, 21,123,111,241, 75,226, 56,143,247, 60, 63,123,143, 87, 50,213,234,187, 6, 82, 86,
+ 86, 22, 2, 3, 3, 29,131, 16, 11, 46,155,127,200,229,114,170, 82,169, 92,143, 73, 29,247,248, 84,183,209,209,119,183,115,117,
+ 39,191, 33, 32,132,208,145, 35, 71,202, 82, 82, 82,188, 82, 22, 91,183,110, 77,110,219,182, 45, 94,121,229, 21,232,116, 58,107,
+ 66, 66,194,246,149, 43, 87, 78, 93,188,120,241,102, 47,255, 63,126,253,245, 87,199,241,184,113,227,176,103,207,158,122,143,185,
+136,117,233,203, 52, 34, 34, 2, 0,168, 83,102, 56,175,148,127,105,105,105, 90,247,238,221, 91, 0,128, 68, 34,129,191,191, 63,
+138,138,138, 80, 82, 82,130,160,160, 32, 20, 21, 21,245,218,179,103, 79,134, 82,169,236,169, 80, 40, 10,235,147,215,183,111, 95,
+200,229,114,132,133,221,205,250,183,106,213,170, 26,247,196,199,199, 3, 0,142, 29, 59,166,246,165,223, 52, 36,251,227,218,181,
+107,235,186,228,216,171,192, 87, 4, 6, 6,226,252,249,243, 16,137, 68, 48, 26,141,216,179,103, 15,178,179,179,177,100,201,146,
+ 6,245,227,224,224, 96, 1,128,152, 67,135, 14,237,137,142,142,190,245,252,243,207,183, 75, 78, 78,134, 64, 32,104,211,178,101,
+ 75, 1,120,252,169,149, 63,123,206,149, 4,252, 97,130, 0, 35, 35, 35,165,247,219,226,110, 74,132, 14, 94,238,248,248, 10,157,
+ 78,231,176,248,245,122, 61,214,175, 95,239,248,120, 49,208,186, 61,158, 52,105, 18,149,203,229, 20, 0,117,189,199, 91, 28, 58,
+116, 72,253,246,219,111,163, 91,183,110,141, 86,127, 93,187,118, 37,239,188,243, 14, 40,165, 72, 73, 73, 81,123,219,238, 89, 89,
+ 89, 24, 55,110,156, 21, 0,196, 98, 49, 19, 30, 30,142,132,132,132, 31,219,180,105, 67, 35, 35, 35,199,123, 97,113,222,171, 46,
+ 66, 34, 34, 34, 40,251, 92, 39, 78,156, 96,247, 3, 96,219,133,179,219, 95,167,211,109, 21,139,197, 45, 0, 96,238,220,185,152,
+ 54,109, 26,196, 98, 49,252,253,253, 33,145, 72, 64, 8,129, 64, 32, 64,105,105,105, 11, 0, 9, 74,165,178, 94,217,241,241,241,
+ 8, 11, 11, 67,110,110,174,227, 19, 31, 31, 95,227,211, 16,200,229,114,153,253, 57,125, 30, 19, 22, 46, 92,232,248, 56,143,151,
+ 46,231, 57,111,244,210,165, 75, 23, 4, 6, 6, 98,233,210,165, 8, 12, 12,196,246,237,219, 81, 89, 89,217, 40,202,223,254, 46,
+ 83,157, 78,247,191,211,167, 79, 71,143, 30, 61,218,237,217,179, 7,183,110,221,194,245,235,215, 81, 82, 82, 98,188,159, 99,147,
+ 82,169,148,230,231,231, 83,165, 82, 41,117,119, 45, 59, 59,155, 94,190,124,249, 79,145,128,142, 82,218,171, 41,149,127,108,252,
+ 74,196,198,175,172,147, 24,220, 23, 2, 64,220,160,190,243,190, 32, 61, 61, 93,221, 24, 36, 96,218,180,105, 15, 13, 9,104, 40,
+ 12, 6, 67, 45,171,223,151,230,101,149,201,164, 73,147, 28, 86,126, 82, 82, 18, 26,170,248,157,173,127,149, 74, 69, 70,142, 28,
+ 41, 83,169, 84, 53, 60, 2, 13,193,150, 45, 91, 8, 0, 18, 29, 29, 45,115,245, 52,112, 28,116,205,118,111, 0,218,182,109,139,
+229,203,151, 87,189,249,230,155,198,220,220,220, 93, 43, 87,174, 28,211,212,237,235,180, 7, 0,113,110, 39, 47,219,229,137,236,
+236,236, 94, 0, 48,107,214, 44,148,150,150,226,198,141, 27, 16,137, 68, 16, 10,133, 16, 10,133, 16,137, 68,240,247,247, 71,101,
+101, 37,146,147,147, 95, 6, 16,236, 73,104,110,110, 46, 84, 42,149,227,227,236, 9, 88,181,106, 21,146,147,147,125,126,110,149,
+ 74,165,177, 79, 1,168, 27,233, 93,174, 43,113, 55,231,241,243,234,213,171,216,181,107, 23,150, 47, 95,142, 46, 93,186,160,117,
+235,214, 72, 73, 73,193,146, 37, 75, 16, 24, 24, 8, 0, 16, 8, 26,100,168,119,152, 57,115,230,148,127,253,235, 95, 72, 79, 79,
+199,141, 27, 55, 96, 54,155, 95,105,213,170, 85, 48, 0,211,253,238,123,161,161,161,136,141,141, 85,231,228,228, 80,103,229, 31,
+ 27, 27,171,126,244,209, 71,241,128,239,146,219,187,129,191,247, 3,208,117,213,170, 85,207,164,167,167, 71, 3,232,223, 20, 15,
+225,172,248,157,191, 55,133, 7,128,186,249,212,119,190,201, 72,192,248,241,227, 27,131, 4, 80, 47, 62,156,241,226, 27,123, 27,
+173, 65,178,178,178,160,215,235,235,116,243, 31, 61,122,180, 49,136, 65,131,113,232,208, 33,181,157, 88, 32, 37, 37, 69, 67, 8,
+ 65,219,182,109,213,141,217, 57, 89,247,191,221, 19, 80, 47, 86,175, 94, 61,126,248,240,225, 20, 0, 18, 18, 18,196,223,126,251,
+ 45, 94,121,229, 21,214, 53, 47,249,253,247,223,197,246,107,251, 34, 35, 35,159,227,242,255,199,141, 27,135,167,159,126,218,225,
+222,103,191,179,199,236,119,142,238,127, 0,128,221,250,119,215, 14,196,229,122,189,216,179,103,207, 71,173, 91,183, 6, 0, 92,
+190,124, 25,121,121,121, 56,121,242, 36,140, 70, 35, 8, 33, 16, 10,133, 32,132,192, 98,177,192, 96, 48, 96,219,182,109,224, 50,
+224,185, 76, 27,185, 37, 47,185,185,185, 13, 34, 1, 78,207,222, 32,111, 0, 26, 97,170,212,100, 50, 97,208,160, 65,208,104, 52,
+184,122,245, 42, 6, 15, 30,236,184,166,209,104, 16, 18, 18,226, 32, 2, 62,160,227,204,153, 51,243,191,249,230, 27,196,196,216,
+ 54, 50,234,216,177, 35, 44, 22,203,247,176,229,166,191,175, 80, 40, 20, 26,150,124,134,133,133,225,248,241,227,148, 85,254, 44,
+249,235,217,179, 39,151,241, 97, 8,128,239, 96,219,243,172, 62, 76, 0, 16, 11,160, 77, 35, 41,255,134, 18,128, 14,115,231,206,
+149,189,243,206, 59,162,182,109,219,202, 1, 68, 61,168, 76,231,190,196, 0,220,207, 32, 64, 59, 9,144,165,167,167,107,124,149,
+209,181,107, 87, 76,155, 54, 13, 63,252,240,131,175, 49, 1, 4, 0,253,225,135, 31,220, 94,220,189,123, 55,236,215,188,150,125,
+236,202, 99, 24,218,237, 60, 10, 50,151, 54,168,158,156,231,252,147,147,147, 17, 19, 19,131,216,216, 88,135,242,239,220,185,115,
+ 99,144,190, 6, 17,129,232,232,104,233,161, 67,135,112,231,206, 29, 25,123, 78, 42,149,202, 84, 42,149, 58, 58, 58, 90,234,237,
+188,189,135,255, 37,227, 66, 0,182,110,221,186,139,157,251,215,235,245, 88,181,106, 21, 42, 42, 42, 32, 18,137,224,231,231,135,
+ 43, 87,174, 96,249,242,229,208,233,116, 72, 72, 72,248,121,229,202,149,163, 22, 47, 94,172,246,160,100,107,144, 1, 79, 49, 1,
+ 28,234, 28, 30,118, 0,116, 76, 7,120,122,222,144,144,144, 97,213,213,213, 48,155,205, 56,122,244, 40, 4, 2, 1,140, 70, 35,
+ 42, 43, 43, 97,181, 90, 29,239,177,201,100, 66,117,117, 53,251, 78,247,245, 36,183, 46, 55,127,124,124,188, 35, 30, 32, 44, 44,
+ 12, 69, 69, 69, 13, 38,162, 78,171, 2,184,246, 69, 45,128, 16,119, 23,214,172, 89,227, 83, 33, 18, 18, 18,240,246,219,111, 99,
+224,192,129, 14, 15, 8,155, 62,123,224,192,129,184,116,233, 18,218,182,109,235,139,232, 46, 51,103,206,188,250,205, 55,223, 56,
+143,159,161, 55,110,220,184,209,148,138,101,240,224,193,132, 85,250,131, 7, 15,198,224,193,131,213, 0,112,233,210, 37,244,234,
+213,139,107, 59,156, 2,224, 15,224, 71, 0, 83,225,178, 37,184, 29,111, 0,248,204,254,253, 61, 0,189, 0,207, 91,212,123, 80,
+254,255, 3,224, 39, 95,159,125,213,170, 85,125,223,121,231,157, 82, 0, 47,118,235,214,173,208, 78, 80, 18,239, 87,221,179,187,
+ 1,174, 95,181,216, 97,249,175, 95,181,216,113,237,190, 19,128,251,141, 7,133, 4, 76,155, 54,141,190,247,222,123,181, 92,129,
+190, 40,255,198,180,254, 1,184,181,254, 89,171, 95, 36, 18,161,176,176,176, 73,149,191,179,245,239, 28,208,165, 86,171,157,189,
+ 0,247, 61, 96, 51, 43, 43, 11,175,188,242,138, 1, 64, 64, 96, 96, 32,222,127,255,125,136, 68, 34,199,245, 25, 51,102, 0, 0,
+130,131,131, 49,113,226, 68, 28, 57,114,228,224,125, 44, 39,113,246, 0,212, 71, 2, 34, 34, 34, 92,183,138,117, 75, 6,140, 70,
+ 35,180, 90, 45,170,170,170, 16, 20, 20, 4, 63, 63, 63,152,205,102, 80, 74, 97,177, 88, 96, 52, 26, 97, 50,153, 96,177, 88,156,
+ 9,253,157,250, 10,153,155,155, 91, 35, 0,144,157, 14,112,246, 8, 56, 95,111, 40,124, 8, 8,148,212,117,193, 57, 38,192, 27,
+ 50,176,124,249,114, 76,152, 48, 1, 93,187,118, 69, 64, 64, 0,164, 82, 41,180, 90, 45, 2, 3, 3,161,211,233,176, 97,195, 6,
+ 48,140,215, 14,217, 78, 51,103,206,188,186, 96,193, 2,108,223,190, 29,207, 61,247, 28, 0,180, 71, 19,108, 65, 91,151, 39, 32,
+ 40, 40, 72, 54,101,202, 20, 53, 0,108,222,188, 89, 54,117,234, 84,111,218,194, 8, 96, 26,128, 31,234, 33, 1,206, 83,109,143,
+ 0,232, 7, 32,195, 71,229,255, 24,128, 23, 26,104,236,246,202,200,200,232,116,229,202, 21,185, 93,249,179, 59,104, 54, 9, 88,
+197, 95, 23,254,144,153, 0, 27,170,252, 89,248,106,165, 59, 15,200, 31,125,244, 81,131,149, 63,139, 65, 3, 7,224,192, 65, 53,
+ 54, 29, 12,112,144,130, 99, 87, 30,107,208, 51, 70, 68, 68, 32, 55, 55, 23, 73, 73, 73,232,220,185, 51, 54,110,220,232,181,213,
+165, 84, 38, 74,157, 60, 56,141,162,252,217,249,248,162,162, 34,153,235,181,145, 35, 71,202,146,146,146, 26, 45, 22, 0,176,185,
+255,185,122,159,116, 58,221, 5,251, 75,109,221,188,121, 51, 54,108,216, 0, 0,248,241,199, 31,161,211,233,216,219,204,151, 46,
+ 93, 66,155, 54,109,154,228, 29,112,137,246,175, 69,206,184,238, 19,159,155,155,123,212, 98,177, 64,167,211,225,206,157, 59,208,
+233,116, 48, 24, 12, 48, 24, 12,168,168,168, 64, 89, 89, 25, 74, 75, 75, 81, 89, 89,137,234,234,106,118,110, 55,173, 62,153,174,
+202,221, 93, 32,169,235,170, 0,174,176,187,250,169,155,115,222, 32,160,177,219, 99,227,198,141,144, 74,165, 8, 8, 8,192,249,
+243,231,161,209,104, 16, 24, 24,136,191,253,237,111, 56,114,228, 8,150, 44, 89,226, 45, 1,104, 63,115,230,204,235, 83,167, 78,
+197, 79, 63,253,196, 42,255,142, 15,138,242,183,141, 11, 74, 41,171,252, 1, 96,202,148, 41,234,139, 23, 47,122, 59,181,202,146,
+ 0,216, 73,128,235,116,192,101,167,239,121, 0,206, 52, 64,249,255,143,125,220,242,217,250, 39,132, 92,140,140,140, 76, 11, 11,
+ 11, 75, 34,132, 4, 17, 66,154,217,203,221, 36,112, 13, 2,108, 18, 2,112, 63,130, 0, 27, 91,249,219, 21,119, 99, 88,110,228,
+163,143, 62,106,144,242,127,241,141,189, 24, 52,240,174,235,102,235, 79,219, 28, 30,129, 3, 7,213, 62,145, 0,133, 66, 1,251,
+210, 48, 24, 12, 6,236,223,191, 31,203,151,219, 86, 20,156, 57,115, 6,102,179,217, 11, 89,113, 26,192, 22,248, 71, 41,101,131,
+ 1, 27,164,252, 89,235,191, 62, 55,127, 99,197, 2,176, 68, 66, 42,149,202, 60,221, 27, 22, 22, 54, 54, 33, 33, 33, 34, 61, 61,
+ 93,248,221,119,223, 49, 23, 47, 94,196,140, 25, 51,204,108, 61, 38, 36, 36, 32, 61, 61, 29,223,125,247,157,240,218,181,107,136,
+140,140,244, 40,243, 94,196, 0,176,150,180, 11, 9,160, 44,233,227,138,240,240,240, 76,179,217, 12,163,209,136,219,183,111,163,
+176,176, 16,183,110,221,194,173, 91,183,112,251,246,109,104,181, 90, 24, 12, 6, 84, 87, 87,163,180,180,148,253,159,249,245,201,
+100, 3,253,156, 73,104, 61,101,247, 74,249,179, 57, 0, 92,207, 53,164,127,184, 89, 13,224, 32,121, 92,101,100,103,103,227,210,
+165, 75, 48, 24, 12,136,138,138, 66,255,254,253,177,113,227, 70,188,251,238,187, 16,139,197, 16, 8, 4, 16, 10, 57, 59,100, 59,
+205,156, 57,243,230,212,169, 83,145,145,145,129, 15, 62,248,128,181,126,111,226, 1, 89,198,156,153,153, 73,217, 57,255,147, 39,
+ 79, 98,253,250,245, 50, 0,232,217,179, 39,156, 3, 3, 27, 72, 2,230,195,230, 94,159, 4, 96, 14,128, 72,248,230,254,191, 0,
+ 96,171,253,127, 76,107, 8, 1,176,227, 52,128,117, 0,158, 1,240, 60,128,205,247,179,238,217, 72,127,119, 65,128,174,171, 0,
+238,215, 20, 0,245,242,252, 31, 69,249, 59, 72, 64, 3,166, 18,106, 40,127,119,199, 7, 14,122, 63,190, 57, 15,186, 1, 1, 1,
+232,221,187,102,220, 75,122,122,186, 87,242, 38, 77,154,132,164,164, 36,176, 68, 0, 0,181,159,243,122,221,249,198,141, 27,213,
+ 0,176,103,207, 30,153,187,136,245,148,148, 20,205,213,171, 87,221, 90,143,238, 80, 87,210, 31,150,104,164,164,164, 32, 58, 58,
+ 90,166, 86,171, 61,246,157,244,244,244,253, 43, 86,172, 24,157,154,154,122, 32, 60, 60, 28, 89, 89, 89,208,233,116,194,224,224,
+ 96,204,156, 57, 19, 90,173,246, 90,106,106,106,151,240,240,112,164,166,166,146,184,184, 56, 79,228,184,214,156,127, 3, 98, 0,
+106,188, 91,108,190, 4,123,238, 4,135,103,198,105,254,223, 99,123, 12, 29, 58,244, 93,141, 70, 51,207, 98,177,160,172,172, 12,
+ 38,147,201, 49,239, 95, 85, 85, 5, 74, 41, 40,165,184,116,233, 18,140, 70, 35, 98, 98, 98, 94, 82, 40, 20,102,119, 73, 71,234,
+ 66, 76, 76, 12, 98, 98, 98,106, 4,253,121, 59, 5,224,172,232,237, 46,127,234,220, 63,236,171, 2, 26,123, 92,227, 60,126,178,
+ 75,253,222,124,243, 77,104, 52, 26,200,100, 50,100,103,103,163, 89,179,102,200,203,203,131, 64, 32,224,234, 1, 32, 51,103,206,
+188, 62,125,250,116, 28, 62,124, 24,127,251,219,223, 0, 32, 20,192, 13,220,205,255,208,228,150, 63, 59,190,228,230,230, 34, 34,
+ 34,130,237,103,178,216,216, 88,117, 88, 88, 24, 46, 93,186, 68, 57, 6, 2, 58,147,128,169,118, 2,240, 35,128,163, 0, 20, 0,
+164, 0, 10,193,163,241, 58,112, 99,103,227,115, 23,240,179,106,213,170, 58,207, 55,165,242,183,175, 0,184, 23, 44,218,103,153,
+215,243, 61,247,111,127,127,239,188,150,158,130,196,188, 69, 76, 76,140, 44, 41, 41, 73, 51,121,242,100,186,101,203,150, 26, 68,
+192,133,240,113,174,135,184,184, 56,143,204,198,203,196, 64,212,133, 72,216, 70, 37,153,140,147,242,119, 26,204, 29,243,250,145,
+145,145,127, 73, 72, 72,248,126,226,196,137,184,116,233, 18,174, 93,187,214,101,233,210,165,178,184,184, 56, 78,242,238, 81, 30,
+128, 26,245, 92,135,226,227,148, 49, 80,161, 80,232, 19, 19, 19,151,237,222,189,251,239,102,179, 25, 37, 37, 37,142, 24, 0, 0,
+184,125,251, 54, 74, 74, 74, 64, 41,101,173,118,175,180, 44, 59,255, 31, 17, 17,225,136, 96,103,207,115, 37, 1,110,172,252, 90,
+211, 80,247, 64,249,123, 13,150, 4, 44, 94,188, 24, 41, 41, 41,152, 56,113, 34, 86,172, 88,129,183,222,122, 11, 66,161, 16, 18,
+137,196,227, 24, 66, 41,181,206,154, 53, 11,223,127,255, 61,190,253,246, 91, 0,232,108,202,132,133,197, 0, 0, 32, 0, 73, 68,
+ 65, 84, 87,254,141,110, 80, 53, 4, 5, 5, 5,216,181,107, 87,141, 44,142,246,239,178, 81,163, 70,169,125, 92,242,104,177,147,
+128,157,118,235,127, 40,175,252,235,134,187, 32, 64, 78, 4,192,155, 68, 28,190, 42,236,198, 70, 99, 40,255,134, 42,234,123,129,
+249,243,231,203, 46, 94,188,216,168, 50,237, 46,210, 70, 93, 74,199, 42, 60,251,218,122,214, 43, 64, 9, 33,176, 90,173,216,186,
+117, 43,103, 18,240,246,219,111,179,229,172, 21, 3,192, 48, 12,172, 86, 43,222,121,231, 29, 53, 87,229, 89,159,188,148,148, 20,
+141,115, 86, 68, 31,250,221,127, 86,172, 88,113, 59, 53, 53,117, 15, 87,171,255, 62,120,219,136,171,183,167, 14,194,199,137, 4,
+196,197,197,125,168, 84, 42,147,126,248,225,135,115, 98,177, 24,236,170, 0,171,213,138,150, 45, 91, 66,167,211, 65, 46,151, 35,
+ 38, 38, 38, 64,161, 80,120, 92,224,205,142, 47,206,193,127, 39, 78,156, 64, 76, 76, 76,141,241,196,211, 56, 20, 31, 31, 79,115,
+115,115,101,174, 46,126, 95,211, 0, 59,195, 77,128,159, 25,128,121,205,154, 53, 18,187, 53,202, 56,125,188, 34, 1,206,137,127,
+230,204,153,227,248, 94, 86, 86,230,113,108, 34,132,144,153, 51,103,210,239,190,251,238,121, 0,191, 60,136,138,199,174,232,137,
+183,215,184,144,118, 23,220,124, 24,198,240,251, 13,118, 21,128, 59,197,207,105, 21, 64, 99, 43,245,186,228, 61, 40,228,225, 65,
+238, 56,159,124,242,137,166,177,101,186,172,145,190,103,112,113,255,115,125,169,185,230, 66, 39, 94, 60,239, 61,125,214, 37, 75,
+150,236,109, 72,125,142, 27, 55,174,198,178,216,167,159,126,186,134,103,192,203,185,127,226,165,183,135, 83,185, 21, 10,197,121,
+165, 82,217,108,223,190,125, 31,231,229,229,205,171,172,172,132,197, 98,193,128, 1, 3, 48,120,240,224,132,152,152,152,120, 46,
+202, 31, 0,142, 29, 59,230,248, 30, 29, 29, 93,227,188,235,177,135,113,133, 56, 19, 90,150, 76,216,227, 0,124,106,247,201,147,
+ 39,215,117, 73,232, 52, 94,138,239,213,184,226,193, 83, 97, 5,128,111,191,253,150,223, 48,133, 7,103, 18, 80,151,242,175,139,
+ 0, 52,118,231,226, 59, 43, 15,226, 37,179,255,211,213,141,179,194,191, 7,211, 2,141,242, 14, 42, 20, 10, 61,108,174,215,249,
+236,185, 11, 23, 46,112, 81, 92, 14,244,237,219,183,209,199, 3,119,132,214, 87,151,255,189, 38,139, 60,120,253,113, 63, 73,128,
+199,202,245,117, 31, 97, 30, 60,120,240,224,193,131,199,195, 11,134,175, 2, 30, 60,120,240,224,193,131, 39, 0, 60,120,240,224,
+193,131, 7, 15,158, 0,240,224,193,131, 7,143,135, 16,102,120,177, 93, 49,143, 63, 39,132,124, 21,240,224,193,131, 7, 63,182,
+243,248,147,119,146, 83,167, 78,249, 28,113,233, 46,152,208,131,188,122,215, 31,251, 32,175,177,203,199,203,227,229,253,169,229,
+253,246,238, 53,159, 7,150,129, 31,119,193,189,150,119, 98,137,239,242, 34, 86,212,150,199,214,159, 82,169,148,154, 76, 38, 92,
+185,114, 69,109, 52, 26, 33, 20, 10,145,159,159,143,151,130,186, 98,111,102, 38, 42, 31,239,140,161, 67,135,202, 4, 2, 1,187,
+174,189,201,218, 87,169, 84, 62, 6,160,237,185,115,231,118,117,236,216,145,209,106,181,146,142, 29, 59, 46,247,247,247, 95,167,
+ 80, 40,110, 0, 64, 98, 98, 34,147,152,152,104,169, 75, 94, 98, 98, 98,115,187,183,192, 16, 23, 23, 71, 1, 96,233, 95,159,252,
+ 74,241,100,222,204, 77,153,225, 87,132,109,199, 14,109,214,188, 69, 5, 0, 74, 41, 21, 2, 8, 78, 76, 76,188,206,191,111, 15,
+182,188,123,205, 18,185,110,250,226,109, 10, 92,175, 83,230,174,138,122, 74, 42, 12, 9, 82,231,100, 93,150, 61,234,215, 12,139,
+206, 30,210, 60, 72, 44,171,158,124,228,252, 18,151, 38,198,132, 9, 19,164,187,119,239, 86, 39,188,107, 59,254,249,240,147, 56,
+116,232, 16,167,118,249,203,140, 87,165, 12, 33,234, 75, 23, 47, 66,167,211,161, 75,151, 46,104,214,188, 57,182, 37,109,229,220,
+174,147, 38, 77,170,241,226, 38, 37, 37,213,187,151,130, 61,187,162, 79,253,134,221,168,137, 82,218,176,126, 39,215,214,124, 85,
+ 85, 33,190,203,138, 88, 3,132,189,106,251,158,187, 1, 56,177,168,225,141, 58,233, 78,205,242, 37,181,230,244, 51,165, 82, 73,
+245,122,189,108,219,182,109,234,220,220, 92,200, 69,173,208,190,115, 27, 84,233, 43,225,111, 48, 99,248, 91,175, 99,228,196, 41,
+216,249, 77, 34,118, 28, 56,160, 30, 59,118,172,236, 1,232,194, 89, 22,139,165, 67,110,110,174,181,127,255,254,226,240,240,112,
+156, 60,121,242,221,170,170,170, 9, 74,165, 50, 70,161, 80,104,227,226,226,172,245, 45, 9,139,139,139, 43,119, 62,254,226,139,
+ 47,152, 61,255,137,239,209,105,214, 64,188, 51,164, 79,155, 99,251,254,189,101,235, 25,233,169, 30,125, 71,173, 32,132,104, 21,
+ 10, 69,254,128, 1, 3,172,118,210,192,123, 26,254,100,110, 34,111,153, 6,167,108, 99,190, 40,255, 47,163,159,149, 70,181,233,
+164, 38,160,200,174, 40, 65,135,142, 93,213, 38,171, 5, 75,250, 13, 67, 81,151, 54,178,111,118,254,194,137, 8,196, 78, 5,237,
+213,157, 61, 18, 96,219, 62, 43, 14, 31,167,136,157, 10,244,234, 14, 44,250,168, 97,138,155,221,160,164,161,217,201,220,145,137,
+198,146,219, 16, 80, 74, 41,150, 17,144, 15,235,189, 7, 88, 70, 48,249,130,252,129, 89,107,125, 87,249, 83,187,242, 31,137, 35,
+ 71,142,112,250,109,218,177, 23,169,217,212, 11, 42,213, 77,164,167,217, 18,214,100, 93,188, 4, 0,216,181,139,208, 75,151, 39,
+201, 22,205,231,214, 46, 99,198,140,177,238,223,191,159, 73, 74, 74,194,193,131, 7,107, 36,195,113,133,143, 41, 84, 29,205,228,
+166, 35, 83,234, 3,161, 96,211,133, 55, 56,103, 65,216,171,142,141,118,214,172, 89,211, 56, 4,192,169,158,236,187, 19,114, 66,
+ 78, 78, 14, 52, 91,182,168, 63,140,153,140, 1,211,230, 64,220, 46, 24, 16,218,147,253, 89, 41, 96, 21,193, 90, 77, 49,254,213,
+ 88,228,125,186, 18, 71,143, 30, 85, 43,149,202, 26,233,110,155, 0, 22,134, 97,218,182,110,221, 26, 26,141, 70,216,191,127,127,
+ 12, 25, 50,132, 41, 44, 44, 28,120,250,244,233,179, 74,165,114,144, 66,161, 40,180, 43,107,134, 99,221, 53, 27, 61,106, 76,216,
+138,213,219,153,248, 25,103, 90, 12, 29, 55, 91, 54, 52, 50,249,201,183, 62,203,127, 38,252,137, 87, 34, 0,148,195, 22, 99,192,
+212,165, 31,156, 19, 91,121,234, 71, 13, 38,164, 60, 92, 61, 9,158,188, 5,142,239,222, 4, 1, 82,182,113, 7,188,210, 15, 74,
+165,146,241, 66, 17,186,110, 82, 65, 35, 34, 34, 16, 17, 17,225,115,158,120,229,203,177,210,151, 7, 70,169,123,118, 8, 69,247,
+ 14,161,120,188, 77, 71,132,250, 55,131,196, 10,116,243,107,134,160,236, 27,234,153,207, 60, 39,229, 34,171, 87,119,224, 98, 14,
+131, 11,151, 3,112, 54,167, 5,158, 31, 19,136,213,239, 9,208,171, 59,105, 52, 35,189,161, 74,154,221,230, 52, 44, 44, 76,157,
+153,153,137,204,204, 76,252,253, 63,167,241,232,248,120, 53, 0,234,229,150,167,148,235, 71, 46,151,123,126,139,151,217,234, 40,
+ 34, 34, 2,114,185,220,237,135,189,199, 91, 76,236,255,129,212,185, 60, 19,250, 45,147, 54, 70,123, 76,152, 48, 65,186,107,215,
+ 46, 53, 33, 4,111,126, 76,240,243,225,145, 56,124,248, 48,167,223,110,217, 50, 77, 58, 52, 50, 14, 35, 70,220,196,167,159,126,
+ 90,227,218,203, 47, 3,227,199, 3, 11,231, 37,169, 87,127,194,173, 77, 88,229,175,209,104,192, 48, 12,166, 76,153, 2,129, 64,
+208, 16,101, 95,203,242,119, 55, 32, 19,226,155,242,111, 52, 68,172, 6, 0,172, 93,187, 22,107,215,174,181,157, 27,148,208,100,
+197, 57,120,240, 32,190,120, 33, 22,131,159,147, 67,216, 42, 4, 68, 36, 0, 35, 18, 64, 32, 17,131,241,151, 0,160,160, 22, 51,
+168,209,136,215, 95,157,131,178, 3,153,200,201,201, 81, 43,149, 74, 41,154, 14, 36, 51, 51, 51,170,115,231,206, 98,171,213,138,
+148,148, 20,108,223,190, 29, 65, 65, 65,136,138,138,234,176,121,243,230,127,216,239,227, 20, 16,168, 84, 42, 5, 71, 14,252,247,
+255, 30, 9,200,111,167, 47, 23,224,229,101, 21,248,252,223,159, 0,205,251, 10,255, 29,223,182, 91,206,201, 31, 94,118,210, 29,
+ 76, 29,196,144, 56, 41,117, 98, 59, 77, 28,223,157,207,223,163,189, 48,120, 52,178, 7,192,209, 74,155,246,252, 80,210,253,209,
+238, 45, 21, 31,190,110,245, 82, 59,146,136,136, 8,202,166, 37,117, 74, 79, 74,189, 77,219,169,124,225, 85,233, 83,157, 31, 85,
+139,171,204,240,255,247,219, 48, 27,140,144,188,249, 17,130,196, 18, 84,137, 42,161,175,170,132, 63, 8,170,175, 23,169,255,249,
+207,127,202,222,121,231,157,122,149,239,197, 28, 96,253,143, 86, 0, 6,251, 7,120,242, 9, 6, 47,140, 37, 53,222,155,216,169,
+192,122, 31,118,118,182, 91,233,212, 87,107,157,181,250, 51, 51, 51,239,214,193, 17, 19, 42,141,122, 0,192,232,248,253, 80,173,
+ 26,227,149,151, 33,103,101, 14, 68, 36,251,110, 71, 32, 5, 32,173,123, 57, 29, 23,161,205,255,190,192,173, 97, 63,116,228,155,
+ 39,117,165,157, 37,118,210,119,226, 4,183,118, 86, 60,251,185,116,253,246,191,170,119,156,254, 0, 43, 22,252,140, 72,105, 56,
+ 54,125,121, 24, 95,239,179,109, 16, 52,251, 47, 31,200,214,253,231, 3,159, 72, 85,194,187,160,192, 46,168,190, 59, 7, 74, 41,
+154,183,125, 28,135, 15, 31,134,125,223,130,122,203,183,250, 19,185, 84, 46,111,165, 6,190, 0,240, 51,210,211,129,200,200,187,
+215,255,241,143,187,223, 23,206, 75, 82,251, 7, 44,149,205,126,125,121,189,229,100,149,127,116,116, 52,172, 86, 43, 62,255,252,
+243, 70,117,208, 0,128,213,106,173,173,252,105,253,239, 47, 51, 89, 87,227,229,103,135,112,171,220,205,125, 14, 63,159,237, 75,
+255,254,181,231,216,153, 41,186, 26, 52,223,106,157,129, 5, 11, 22, 56,174, 47, 88,176, 0,107,215,174, 5,211, 99,214,221,255,
+106,191,223,157, 60,225, 20,247,229,115,221,201, 90, 56,133, 91,249,170,170,170,208,190, 75, 87,192,106, 4,227, 7, 16,161, 0,
+230,242, 82, 84,229, 94,193,237,252, 2,116, 26, 38, 5, 17,183, 4, 49, 25, 1, 1,131, 85,179,223,194,152,245, 31, 96,209,162,
+ 69,141, 61, 46,115,210,138, 74,165,146, 80, 74, 91, 86, 86, 86, 14, 11, 9, 9,193,165, 75,151, 96,181, 90,113,229,202, 21,108,
+216,176, 1,189,123,247, 70,104,104,232, 43, 0, 94,119, 81,214,117,122, 3, 40,165,173,187, 48,233,210, 14,143,140, 19,151,164,
+156, 65,169,206, 15,223,239, 52, 99,247,177,255, 96,158,220, 95, 40, 52, 88, 35,236, 49, 5,110, 9, 0,175,208,155, 30,117, 77,
+247,184,243, 12, 48, 28, 58, 34, 59,111, 8,233,146,145, 88,159,162,108,153,115, 57, 7,167,190, 59, 3,165, 82,233,149,245,192,
+ 42, 7,131,225, 7, 24, 12,155,160,213,198,176,214,177, 87, 15, 56,196,175,133,186,109,149, 5,146,101,115, 96,185,163,133,249,
+242, 85, 8,197, 34, 4, 16, 1, 2,137, 0,129, 2, 33, 66, 68, 18,208,114, 61,110, 30, 60,234,113,167, 23,119, 74,253,240,113,
+171,227, 61, 92,253, 30, 65,194, 82, 98,247, 8,248,102,253,219,149,179, 26, 62,164,192,117, 85,254, 16, 10,144,123,179, 2, 55,
+139,141, 72, 63,111,219, 64,164,199,140, 29,240,102,223,115, 17,201,134,144, 20,192,143, 57,109,251,219,150, 32,248,229, 27, 8,
+154,122, 22,126,207, 47, 3, 66, 3,189,243,228,114,216,185,205,155, 45, 94,149,219,223, 80, 15, 13,121, 15, 39, 14, 93,193,255,
+ 76,154,136,208,214, 61, 49,231,175,175,225,179,165,251, 48, 52,120, 41,214,253,231,239, 62,239,224, 67, 8, 16,183,232,172,195,
+ 98, 25, 49, 98,132, 93, 33, 89, 61, 54,240,180,169, 34, 53,112, 16,192,207, 40,185,213, 12, 61, 30,105,134,175,190,178, 89,254,
+203,150, 1, 97, 97, 54, 17, 37,183,154,161,228, 86, 51, 12,232,119, 65,237, 73,249, 31, 60,120, 16, 86,171,213,161,164, 55,111,
+222, 12,139,197,226,149,251,186, 30, 15, 79, 45,229,111,123,159, 61,147,119, 10,144,117, 74,165,140,181,212,172,148,194,106,173,
+221,125,217,243, 86, 74,177, 46, 49, 81,150,104,251,141,219,255, 73, 1, 66, 41, 72, 98,162, 82, 70, 41,197, 39,159,124,226,184,
+206,126, 79, 76, 76,148, 81,106,187,143, 2,164, 46,121,137, 74, 37,236,215,136,197, 98,129,217, 98,129,217, 92,187,206,216,243,
+102,139, 5, 95,174, 91, 39, 91,151,152, 88, 71,249, 40,132,205,155, 3, 34, 1, 44,134, 10,156,219,154,132,191,189,166, 64,167,
+ 55, 20, 24,184,242, 67, 92,249,237, 36, 4,254, 18,152,138,111,225,204, 49, 13,118, 28,222,139,210,194, 66,156, 61,123,182,209,
+ 54,214,138,138,138,226,228, 77, 80, 42,149, 65,148,210, 33,153,153,153,191,188,255,254,251,125,206,157, 59, 39, 54, 26,141, 16,
+ 8, 4,104,222,188, 57,204,102, 51, 50, 50, 50, 64, 8, 17,123, 26,235, 19, 19, 19, 3,149, 74,165,127, 98, 98, 98,104, 73,126,
+234,111,127,255,191,188,144,223, 15,239,132, 86,207, 64, 44,100,208, 41, 88,130,210, 59, 98, 40,254,105,198,153, 59, 3, 3, 61,
+233, 13,123,172, 9,117,238,139,118, 98, 80,235, 60,175,174,239, 15, 88,229,239, 74, 14, 24, 79, 44,148,221,239,187,134,155,115,
+220, 52,239,189,125,118,119,191,193,176, 9, 0, 65, 85,213,183,144, 28,191, 10,195,222, 71,107, 92,247,132,119, 6, 69, 75,131,
+180,229,176,138,133, 48,158, 56,135,234, 11,185,168,218,119, 24,168,172,134,152, 82, 4, 64, 0, 33, 8,170,173,102,104,171,171,
+240,229,254,157, 30,101,174,126,207,102,221, 59,195,118,204,154, 43, 20,151, 46, 83, 44,250,200,247,254,234,146,175,156,179,203,
+ 94, 46,151, 59,246,214,102,241,210,218,124, 28, 56,161, 67,222,173, 42, 0, 64,222,173, 42,100,231, 87, 2, 49, 91,216,141, 81,
+ 60,187,126, 72,129,141, 8,148,159, 65, 96,224,101,248, 73,202, 97,181,106, 97, 50,157,128, 64, 16, 6,163,190,184,201, 58,235,
+228,113,127,149, 2, 4,159,255, 60, 11,205,152, 71, 0, 0, 55, 47, 81, 12,154, 40,192, 95,151,143,193,136, 49,125, 0, 80,251,
+125,222, 33, 58, 58,154,190,249, 49, 65,179, 54,253, 64, 1,140,123, 97, 54,231,121,255,117, 95, 45,165,109,219,254, 14,224, 44,
+ 74,110, 53, 67,121,177,109, 11,230,254,253,129, 30, 61,128, 87, 94,185,171,252,203,139,253, 81, 94,236,143,144,128,155,245,202,
+156, 52,105, 18,100, 50, 25, 70,141, 26, 85,195,245,239,252,241,101, 74,192,221,123,235, 11,226,156,230,183, 9, 33,142, 79, 93,
+231,226, 20, 10,141, 34,214,243,156,120,108,108,172,218,157,229,188, 96,193, 2,196,198,198,214, 80,168,117,201,251, 89,169,196,
+217,179,103, 29, 46,120,231, 58, 99,225,122,110,118, 92,156, 38, 78,225,126,171,102, 49,165, 96, 2,252, 96, 42,188, 6,229,210,
+165,216,160, 47,129, 46,122,168,227,250, 55,255,217,128, 15,222,122, 13,225,139, 94,194,135,103, 14, 98,139,238, 10,198, 60,251,
+ 44,194,194,194,188, 14, 6,180, 43,122, 26, 25, 25, 89,163, 15, 31, 59,118, 76, 93,223,118,236, 74,165, 82,164, 84, 42, 7,159,
+ 57,115, 38, 47, 37, 37, 69,243,230,155,111, 14,253,252,243,207, 37, 21, 21, 21,142,109,154,171,170,170,208,172, 89,179,236,201,
+147, 39,247, 28, 62,124,248, 35, 30,136, 4, 67, 8,233,114, 38,109,107, 81,214,222, 69, 87, 23, 45, 73,232,176, 99, 89, 71, 92,
+ 40, 16,162,180, 66, 0, 43, 1,138, 43,140,160,173,186, 87, 45,124,247,163, 62,207, 60,255,151,215,225, 33,158,192,238,254,175,
+225,234,247,240,157, 71, 19, 40,255,186,166, 0, 40, 87, 87,142, 66,161,240,116, 19,117,181,254,109,174,182,111,235,242, 14,120,
+252,167,125, 90,183, 83,107,169, 9,226, 98, 45, 36, 63, 31, 4, 17, 50, 64,149, 17,180, 92, 15, 98, 54, 67, 4,192, 66,173,168,
+178,152, 81,110, 54, 2, 86,207, 86, 20, 27,228,183,250,189, 58, 57, 45,108, 65,130,141, 66, 88,137, 83, 32,159,199, 23,160,150,
+245, 15,224,191,111,116,168,113, 60,120,113, 46, 68,244, 14, 76,164, 53, 84, 42,213, 65,174, 47,150,164, 66,141,144, 15,255,131,
+219,111,198,225,142,214, 31, 29, 77,231, 96,177,228, 2, 0,174,157,106,223,100, 29,118,203,158,207,212,175,141, 85,214, 80,254,
+ 44,134, 6, 47,197,176, 62,147, 16, 21,114, 14, 91,246, 44, 87,123, 51,136,140, 28, 57,146,166,164,164,160,184,120, 52, 90,181,
+ 58,128,102,173,251,130, 82, 10,134, 97, 56, 5, 34,229,229, 1,185,185,103,237, 71, 21,128,164, 2, 90, 61, 48,100,136,237, 76,
+118, 54,240,197, 23, 64,121, 25,160,175, 0, 42,244, 64, 96,112, 25,167,178,213,101,237,231,228,228, 0, 0, 62,254,248, 99, 0,
+ 64,120,120,248,189,112, 51,115,170,195,249,243,231,215,176,216, 93, 21, 55,103,239,142, 93, 97, 59,230,253,157,240,201, 39,159,
+ 96,237,218,181, 80, 42,149, 82, 79,193,117,179, 66,195,145,117,238, 60, 10,130,131,213, 12,195, 96,222,188,121,181, 98, 50,188,
+ 41,223,147,213, 45, 65,173, 21,120,237,227,247,208,111,210, 36, 40, 63,254, 24, 12,115, 87,207, 41,179,207,222,245, 16, 30, 62,
+140,253,251,247,227,202,149, 43, 50,133, 66,161,225,178,241,138,179,242, 79, 75, 75, 83, 3, 64, 70, 70,134, 58, 42, 42, 74,150,
+150,150,166,137,140,140,148,166,167,167, 35, 42, 42, 74, 86, 89, 89,169,174, 99,204, 53,205,152, 49,163,223,180,105,211, 90,116,
+235,214, 13,187,119,239, 54,148,150,150, 10, 43, 43, 43,109,222, 14,251,252,199,182,109,219,194,199,141, 27,231,175, 80, 40, 42,
+221,136, 97,156,148, 53,147,123,233,212,218, 15,222,153,217,172, 85, 15, 21,126, 83,189,138,223,175, 19,228,221, 18, 2,148, 65,
+181,209, 4, 45,109, 85, 48,119,214,156,161,132,144, 2,118,204,247,230,121,221,120, 8,248,169,130, 7, 4,117,178,184,148,148,
+148, 90,159,146, 2, 29, 74, 10,116, 94,181, 53,251,185,107,197,218, 26, 94,114,252, 42,252,206, 22, 64,152,175, 99, 61, 0, 53,
+238,175, 75,224,249,252, 60, 28,191,115, 3,231,174,228,226,214,149,171, 40,187,154,143,242,235, 5, 48, 27, 42, 97, 50,153, 81,
+110, 49,194, 96, 49,163,154, 90, 96, 1, 5, 37,220, 73,166,115,180,255,197, 28,219,241,162,143, 88,203,159, 65,194,123,141,179,
+226,197,219, 56,128,120,149, 14,241, 42, 93, 13,133,207,126,162,226, 51, 32,162,119, 32,164, 58,252,119,150,197,204,121, 10,224,
+214,113, 88,244,205, 0, 0,255, 22, 6,161,250,214, 53,100,254,179, 3,178,126,152,128,227,255, 28,128,236, 75, 55,154,180, 99,
+246, 31, 18, 6,189, 14,208,235, 0,131,255,121, 0,192, 79,127, 55,225,157, 5,203, 0, 0,195, 99,250,120,109,249,191, 48,242,
+ 16,180,218, 24, 4, 31, 59,128, 53,239,217, 72,238,200,145, 35, 57,185,254, 1, 96,197, 63,150,147,238,221, 1,231,207,197,139,
+ 54,247, 63, 0,244,232, 65,177,118, 45,208,165,103, 5, 30, 27,122, 27, 67, 70,223,198,243, 47,153, 56,151,209,217,226,103,143,
+195,195,195, 17, 30, 30,142,121,243,230, 53,118, 21,123,124,215,156,177,126,253,122,153, 59,133,237,240,162,173, 94,141,245,235,
+215,115,178,132, 95,127,253,117, 53, 27,249,239, 14, 11, 23, 46,172,229, 5,112,135, 67,231,243, 48,115,214, 92,156,216,180, 9,
+ 75,150, 44,169,147,156,176,229, 59,112,224, 0,234, 11,216, 27,249,216, 35,248,246,155, 47, 16,241,242,203, 88,177, 98, 5,234,
+ 43,227,130, 5, 11, 48,122,244,104,248,178, 2, 32, 45, 45, 77,237, 20, 44,135, 99,199,142,169, 1, 32, 61, 61, 93, 77, 8, 65,
+ 90, 90, 90,189, 50, 13, 6, 67,203,157, 59,119,226,252,249,243,200,206,206, 14,208,235,245, 48,153,108,253,204,104, 52, 98,207,
+158, 61,196, 78, 22, 42, 57, 20,199, 90, 93, 93, 45, 62,177,245,101, 84,101,125,134,189, 41, 57,184,114, 83,128, 50, 61, 3, 11,
+ 5, 10,244,254,152,187,232,189,168,184,184,184,124, 14, 6,159,131, 87,176, 75, 78, 57, 78, 7,240,104, 2,235,191, 46, 2, 64,
+ 0, 16,169, 84, 10,169, 84,138,211,167, 79, 59, 62,185,199,175,161,180,178, 20,173,134,120,191,238,247,196,137, 19, 4, 0, 2,
+ 2,166, 65,114,252, 42, 68,215,138, 65, 9,129,120, 86,113,141,235, 30, 21,151, 88, 0, 11, 5,242,245, 37,200, 43,213,226,118,
+153, 14,165, 85, 85,208, 25, 43,113,187,186, 18, 55,171, 12, 40,168,170,128,214, 84, 13,157,213, 4,163,213,115,240,235,147, 79,
+184, 25,240,156,226, 2, 94,155,210, 12, 20, 98, 80,175,183, 1,191, 27,189,239,230, 28,103,228,221,170,194,129, 19, 58, 12, 94,
+156, 91,179, 46,232, 29,248, 89,175,193,207,122, 13, 31, 60, 37, 68, 94, 94,158,145,171,204,173, 87,172,104,147,144,232, 56,190,
+162,183, 32, 63,167, 0,151, 82,207,161,240,106, 73,147,119,220, 77, 95,166, 0, 0,202,138, 40, 2, 42, 31,131,116,150, 16,255,
+179, 76,228,248, 36,108,121, 25,132,187,241, 79,159, 27,145,130, 87, 23,217,148, 63, 33, 4,191,164,218,154,128,235,154,127, 22,
+225,189,122,214, 44,231, 38,224,243,207,129,203,151,109,158,128,191,255,157, 58,220,239,148, 82, 4, 7, 7,123, 30,129,237,125,
+148,157,247,255,248,227,143,145,147,147,131,172,172, 44,100,101,101, 33, 57, 57, 25,111,189,245, 22,242,242,242,154,172, 61, 88,
+ 69,231,206,146,158, 63,127, 62, 8, 33,156,149, 33, 33, 4,245,145,137,250,174, 57,227,176, 95, 9, 8,211, 12, 95,191,251, 17,
+154,237, 76, 70,108,108, 44, 94,102,217, 24, 0, 69,143,190,152, 31, 49, 12, 1, 1, 1, 24, 57,114, 36,222,127,255,125, 36, 39,
+ 39,171, 87,172, 88,225,246,253,251,166, 32, 11, 55,251, 60,134,208,208, 80,153,213,106,173,151, 80,212,119,141,131,114,116,120,
+156,162,162,162,100, 78,138, 18, 67,135, 14,149,121,240,158,140, 26, 57,114,100,139,188,188, 60, 28, 62,124, 24,143, 62,250, 40,
+132, 66,161, 99,138, 35, 52, 52,148,235,116,132,213,254,127, 73,247, 94, 3,227,215,239,107,137,223,119, 47,195,147, 81,189, 17,
+ 40, 97, 16, 24, 96,129,191, 95, 53,158,126,110,178, 21,128,214,249,135,137,137,137,158,230,162, 28,171, 0, 56, 78, 7,240,120,
+208, 60, 0, 0,136, 82,169,108, 62,127,254,124,204,159, 63, 31, 0,140,255,136,251, 7, 76, 69,102,248,251, 75,224, 75,227,201,
+229,182,240,225,128,167, 46,131, 10, 24,188,255,147,193,217,250,231,132,128,208, 80,153,185, 89, 0,116,212,130,243,122, 29,206,
+150, 22,227, 92,217, 29,156, 43,211,226,188, 94,139,203, 6, 29,138,171,171, 80, 97, 54,227,134, 65,239,248,159,245,225,133,177,
+ 4,171,223, 19, 96,245,123, 2, 80, 8, 64, 9,131,216,169, 4,175, 79, 21, 99,214,148, 54,232,222,189, 29,172, 16,121,253,200,
+172,171,223,121, 94,190,158,164, 64,117,201,144,101,231,219,136,124,230, 74, 91, 16,221,222,183,131, 0, 0, 66,170,131,128,234,
+ 81,205,216, 34,154,181, 90,109,128, 92, 46,143,241,166,140, 17, 17, 17, 72, 78, 78,198,166, 10, 61, 42,141, 12, 94,253,241,107,
+ 20, 73,252, 81,105,108,186,109, 34, 38,246,255, 64,150,166,253, 8,155,190,223,226, 56,247,211,223, 77, 24, 26,188,212,113, 28,
+251,204, 23, 50, 10, 78,235,135,233,154,165,192,140, 69,163,209,242, 88, 50,100,255,140, 6, 51, 1,208,104, 52, 62,245,225, 46,
+ 93,106, 70,143,143, 26, 5,180,108, 9,132,133, 1,145,253,155, 67, 34, 22, 64,192,220, 21, 43,241,247,247, 56, 32, 51, 12,227,
+176,252,115,114,114, 28, 86, 63,251,249,240,195, 15,241,225,135, 31,226,198, 13,238, 94, 25,119,243,245, 53,175,123,111,125,173,
+ 95,191, 94,182,102,205, 26,183, 10,155,171,245,239,228,122,174, 21,167,192, 30, 91,173,220, 82,216, 27, 9,129,213, 80, 13, 81,
+251, 46, 80, 44, 95,142, 25,129, 45,209, 82,147,230,184, 62,235, 47, 51,240,193,191,191, 70,246,234,255,226,111,253, 70, 97,114,
+112, 55,236,223,190, 29,185,185,185,110,223,191,231,227, 20,232,211,183,175,204,106, 47, 19, 75,200,156,167,103,220,157,171, 11,
+179,103,207,166,132, 16,202, 6,246,177,243,253,206, 74, 62, 45, 45, 77, 51,116,232, 80, 25,165, 20,236, 84,128,135,122, 75, 17,
+137, 68,143, 62,255,252,243, 57,165,165,165,208,233,116,240,247,247, 71,155, 54,109,208,178,101, 75,180,108,217,210, 83,229, 89,
+ 93,136,157,197,207,207,207,240, 98,220,167,178, 13,199, 7,227,234,245, 50,180, 11, 18, 32,170, 39,193,227,221, 40, 2, 91,180,
+ 40, 1, 96,169, 71,111,240,251, 13, 60,164,214, 63,224, 97, 25,160, 66,161,168, 80, 42,149,126, 0, 2, 21, 10,133,131, 5,118,
+138,238,232, 19,243,101,151,250,201,229,114, 42,158,229,136,252, 39, 78,243,255, 30, 7,228,119,119,109,209,124, 28,243, 28, 12,
+230,106,148,233, 13,200, 49,153, 32,178,218,126, 92,106,170,130,149, 82, 80, 0,187,111, 93,129,222,108, 2, 0, 14, 3, 19,193,
+162,143,106,246,113, 91, 60,128, 21, 22, 84,227,194,229,114,124,187,185,204,171,135,117, 86,244,118,151, 63,181,127,119, 40,118,
+ 46,171, 31,108,191, 85, 65, 52,250, 75, 0, 97, 40, 46,190, 27,156, 39,182,222,132,145,233,128,185,253,178,112,243,166,195,114,
+ 58,192,165,124,113, 63,173,175, 65,188, 84, 42, 21,216,210,252,120,230, 40, 98, 98, 98,154,172,227,238, 56,109, 91,222,151,154,
+124, 14, 0, 48,172,143, 45, 51,222, 59, 11,150,225,232,185, 62,248,247,150,151,161,220, 57,135,243,252,255,171,139, 98, 16, 18,
+146,108, 63,210,216,201, 82, 12, 40,181, 89, 99, 0, 69, 72, 72, 50, 39, 89,251,247,238,115,228,180,120,249,101, 64, 38, 35,184,
+115, 61, 8,122,157, 4,149,101, 98,252,184,145, 96,254,124,138,107, 69,229,136,140, 26,138,148,131,106, 78, 86,177,197, 98,113,
+204,247, 39, 39,219,202,234,172,240,139,138,138, 80, 84, 84,196, 89,255, 59, 41, 12,202, 48, 76, 45,165, 74, 41,136,183, 73,128,
+ 20, 10,133,230,245,215, 95,175, 17, 11,192,122, 4,188,113,133, 19, 39, 86, 98,117, 89, 86, 64, 8,247, 57, 59, 66, 8,204,229,
+229, 16,181, 14,129, 32,160, 25,250,188, 56, 9, 31,142, 29,131,119,217,101,123, 3, 7,193, 82, 89, 5, 81,171,118,232, 55, 84,
+138,174,157,186,225,211, 11,105,232,219,183,175,236,248,241,227,181, 72, 64,156, 66, 1,128,168, 1, 96, 78, 92,156, 99,233,160,
+217, 69,217, 11,133, 2,128,222, 93,168, 88, 87,129,215,173, 91, 71, 0, 80,187,139,159,100,100,100,184,117,241,167,165,165,105,
+184, 40,255,196,196, 68, 66, 8, 89,218,178,101,203, 62, 67,135, 14,237,126,241,226, 69,156, 60,121, 18, 22,139, 5,129,129,129,
+ 48, 24, 12, 69, 33, 33, 33, 87,189, 49,250,148, 74, 37,211,174, 93,187,253,207, 61,247, 92,187, 99, 71, 50,176, 86,181, 31, 45,
+136, 24, 61,219, 85,227,242,157, 64,140,232,105,186, 2,192,117, 30,203, 82, 95,155, 56,103,156, 34,132, 56, 31,186,230,125,225,
+209,196, 16,114,120,233,141, 0,140, 78,131, 10,205, 79,241,122,126,184,134,114,175, 67,241,113,206, 24, 88,166,213,201, 76, 1,
+ 18,117, 41, 99, 69, 97, 85, 5, 96, 50,193, 98, 95,215,116,161,162, 4, 5,134, 50, 80, 74, 97,207, 47,160,225, 82,188,216,169,
+ 4,235,127,188,219, 39, 47,230, 0,189,186,155, 33,128,190, 65,202,223,165,179,123,170,131, 58,189, 0, 42,213, 28, 53,144, 9,
+173, 86,107,204,203,203, 19,174, 26, 3, 38,126,255, 72, 44,232,123,212, 97,133,113, 37, 21,238,188, 46,174,199,172, 18,226,106,
+205, 97, 25,193, 96,251, 74, 14,119,203,253,182,108,217, 98,203, 4, 40,151, 83, 46, 57, 31,226, 38,126, 41, 83,238,152,171, 78,
+219, 66, 17, 21,114, 14,195, 99,250,224,200,254,115, 56,166, 91, 14, 2, 2,197,196, 47,100,137, 59,230,114, 42, 95, 72, 72, 50,
+ 8, 33,120,225,133, 23,240,213, 87,101, 96, 85,140,237, 47,101, 9, 1,173,105,217,223,169, 83, 94,244, 40,153, 44,229,160, 90,
+ 61,106, 20, 96, 44,236,140,235, 37,126,176,218,103, 91, 59,232,219,225,237,216,114,236, 63,214, 19,205, 59,245,148,177, 89, 2,
+235, 3,171,248,243,243,243, 1, 0,133,133,133, 14,207,192,173, 91,183, 28, 3,171,143, 32, 78,110,103,215,151,146,112,201, 7,
+224,140,175,190,250, 74,182,118,237, 90, 53, 75, 0,214,172, 89,227,181,245,239,170, 48,124,133, 68, 34, 65,225,181,171,232,214,
+189, 7,172,230,106, 16,179, 5,194,230, 45,208,124,208, 96, 52, 27,248, 4,172,122, 51, 44,134,106, 80,179, 5,176, 88, 17,191,
+238,223,152,242,242, 20, 72, 36, 18,183,242,204, 63, 6,115,250,191,238,238,139, 88,225,254,222,168,168, 40,153,157, 0, 80, 74,
+ 41,134, 15, 31, 46, 75, 77, 77,173,117,159, 39,229,111,175, 43, 43,128, 61, 61,123,246, 28,248,217,103,159, 25,111,223,190, 93,
+ 53,102,204,152,231, 50, 51, 51,255,102, 48, 24,138, 91,183,110,173,248,244,211, 79,181, 92,235, 79,169, 84,138, 0, 60, 50, 52,
+ 50,178, 77,220,172, 56, 92,201,191,162,157, 62, 43,238,201,244,253, 27, 19,110,150,107,135, 13,142, 30, 99,109,215, 41,252,127,
+ 92,173,252,250, 82, 11,219,251, 24,113,226,159,196,141, 14,112,253,206,227, 65, 37, 0,245, 89, 23,190, 40,127, 86,217,212,145,
+ 48,134, 19, 9, 88,121,242,144, 6, 0,153, 58, 40,138,194, 95, 2, 29, 53,195,104, 54,195, 74,173,104, 21, 20,132,124,125, 41,
+188, 73, 46,228,110,121,223,221, 24, 0,239,214, 98,187,115,241, 55, 52, 93,175, 61,143,192,196,193,131, 7,239,136,143,143, 23,
+135,132,132, 88,111,222,188,137, 5,125,111,186, 42,127,206,255,163,174,132, 61, 62,193,158,229,207, 77,146,167, 90,247,112, 69,
+226,142, 57, 26, 0,100, 66,191,101,210, 93,103,254,174, 78,219, 2, 16, 16, 76,236,255,129,108,199,233, 15, 52, 92,149, 63,219,
+151,138,139, 71, 83,160,140,181,126,225, 78,239,108, 72, 56,192,246, 7, 82,223,230, 26,118,171,158, 20,235,250, 74, 45,229,229,
+106, 34, 0, 12, 85,254, 32,229,102, 8, 25, 33, 12,140, 68, 54,118,242,107,152, 27, 27,231,177, 61,146,146,146, 72, 82, 82, 18,
+189,135,239, 31, 40,165,132, 16, 66,157, 35,218,157, 61, 1,222,200, 82, 40, 20,154,216,216, 88, 44, 88,176,192, 65, 40,154, 42,
+ 21,238,168, 81,163, 48,119,203,122,124, 88, 94,130, 1,209, 35,192,180, 11,182,149,201, 68,109,169,123, 33, 2, 17, 8, 65,196,
+ 2,124,149,184, 26, 45, 70, 15, 70,247,238,221,189,142,218,111, 8,156,172,123,117,100,100,164, 44, 53, 53,181, 65,117,149,147,
+147, 19,115,224,192,129,107, 2,129, 96,251,147, 79, 62,249,143, 57,115,230,220, 94,183,110, 93, 10, 96,155,114,240, 66, 20, 3,
+ 32,249,228,201,147, 67,190,219,176,145, 17, 11,252,174, 79,122,105, 82,255,185,115,231,234,190,252,242,203, 9, 0,130,236,138,
+191,156,221, 32,136,139, 71,129,199,131, 1, 46,238,127, 95, 9, 64,131, 9,131, 7,229,195,121, 64,250,241,100, 26,145, 79,146,
+ 75,173,151,178,213,250,106, 35,204, 22, 11,186, 15, 25,132,112,115,164,183, 10,183,209,130, 81,216,164, 63, 0,212,172, 53,110,
+143, 3,104, 80, 14,124,149, 74,181, 83,169, 84, 10,147,147,147, 23,173, 90,181,234,159, 78,228, 98,148,243,255,226,234, 81, 0,
+208,104,201, 75, 38, 95, 96,227, 44,234,126,190,201, 23,228, 62, 49,253, 93,103,254,174, 97,219,135,130, 98,199,233, 15,124, 42,
+163, 77,185, 19,188,186,104,212, 93,179,151,220,189,182,232, 35,239,243,145,199,191,125, 86, 19, 15,144,117, 95, 45,149, 86, 26,
+108,251, 0,220,205,255, 31,231,245, 59, 98,183,200, 44, 10,133,162,209,231, 85, 89, 18,208, 24,178,236,177, 0,106,246,123, 35,
+148,205,167,223,117,239,222, 29,237,231,205,147,173,221,183, 79,157,251,143,159, 33, 23,181, 66, 75,251,230, 61,149, 6, 51,230,
+191,181, 4,130,128, 16,236,222,168,196,233,214, 4, 99,135, 13,243, 57,111,191,197, 98,246,121,152,224,234,226,231, 64,190,200,
+243,207, 63,127,155, 82,154,208,171, 87,175,255, 43, 46, 46,214,251,160,248,157,235,125,100, 70, 70, 6,172,102,130, 97,195,251,
+127, 48,119,238, 92, 29, 0,204,153, 51,199, 10, 64,215,144, 38,117,242, 56,213,248,238,198, 43,202,227, 33,243, 0,220, 19, 82,
+224,179, 98, 76,170,145, 96, 7, 25, 57,151,154,188, 82, 93,146,254,176,231, 26, 44, 87,161, 80, 88, 0,252,203,254,241, 89,174,
+187,242, 53,240,121, 73, 99,220,115, 47, 97, 83,240, 20,139, 62, 74,110,116,217,158, 82,253,122,209,190,166,123, 89, 7,141,181,
+233,138, 66,161,208, 40, 20,138, 70,145, 69, 26, 48, 7,192,150, 65,169, 84,194,190,125, 47,242,156,182,239, 77, 61,176,223,177,
+125,239,232,161,163, 97, 39,189,117,254, 63,193, 20, 29,177,108, 14,174,173,152, 56,238, 38,232,137, 4, 52, 70,125, 61,241,196,
+ 19,213,102,179, 57, 5,128,254,253,247,223,111,144, 18,141,139,139, 35,239,191,255, 62, 53, 26,141, 0,176,175,174,251, 86,174,
+ 92, 73, 22, 47, 94,236,248, 95,246, 84,192,245,142,237,174,193,157, 60,238, 47,184,122,184,136,175,251, 8,243,224,193,131, 7,
+143, 38,129, 25, 64, 21, 0, 73, 35, 27,113,158,118, 12,228,188,163, 32,143,135, 3,124, 99,242,224,193,131,199,195, 5, 33,128,
+102, 28,148,191, 1,182, 0,238,198,210, 7, 86,240,203,254,254,112, 29,137, 7, 15, 30, 60,120,252,241, 16,192,235, 11, 30,188,
+ 7,128, 7, 15, 30, 60,120,240,224,193, 19, 0, 30, 60,120,240,224,193,227,207,142, 26, 46,157, 83,167, 78,249, 28,145,235, 46,
+152,240, 65,151, 23, 54,200, 15,254,126,133, 16,137, 75, 96,181,218,150,133, 9, 4, 12, 24, 34,176,253,101, 8, 8, 97, 64,137,
+ 16,132, 16, 48, 48, 99,199, 46, 17, 40,165, 8, 97, 90,193,155,242,217, 51, 42,182,134, 45,128,167, 28,182, 4, 3, 38,118,201,
+215,195, 88,127,188, 60, 94, 30, 47,143,151,199,203,123, 48,229,241, 30, 0, 15, 56,116,228, 50,116,165, 58,152, 76, 20,183,239,
+ 16,236, 77,246,199,190,253,129, 96,136, 8,251,213,237,177,239, 96, 7,236, 83,119,192,225,227,109, 32,132, 16, 12, 36, 24, 17,
+197,192, 79,236,199,249,127, 76,125,117, 58,157,250,234,116,122, 36, 85, 93,101, 98, 72,234,185,179,153,135,212, 71,143,232,147,
+147,147,171, 0, 52,231, 57,232,195,143, 49, 79,141,144,206,153, 51,157,122,187,201,211,195, 10,165, 82, 41,165,118,212,183,187,
+ 30, 87, 80, 23,240, 61,138, 7,143, 38,240, 0,176, 24, 54,124, 8,231,151,240,104,106,134, 71,214,210,216,242, 26, 19, 25,153,
+ 34,140, 27, 99,193,233,223,253, 33, 22, 9, 33, 20, 8, 33, 18, 81,248, 9, 76,128,176, 57,132,168,196,144, 62,102, 72,196,126,
+160, 0, 58,180, 3,158, 29,111,197,129,237,220,148,255,229, 11, 89,120,244,177,238,232, 24,218, 18,249,215, 46,118, 9,106,223,
+ 13,173, 59, 90,240,235, 47,191, 32, 57, 57,185, 4, 77,188, 35,150, 92, 46, 31,175, 82,169,118, 57, 29, 63,227,124,204,163,110,
+204,157, 35,167,230,170,115,178, 33, 17,193,106,171,181, 24,165, 29, 43,213,157,218,143, 70, 69,117, 7,124,181,254, 63,127,216,
+157,206, 98, 99, 99,213, 11, 22, 44, 0, 33, 4,107,214,172, 81, 55, 70, 78, 0, 54, 29, 0,175,255,239, 63,188, 34, 93,148,130,
+ 48, 76,125,237, 77,157,219,147,109,211,187,201,183,106,182,179,243,206,136, 60, 26, 23,108, 54, 64, 39, 47, 1, 55, 2,208, 84,
+ 96,238,179, 46, 28, 63,214, 4, 10, 1,132, 2, 17,134, 69, 18,180,109,195, 64, 40,100,224, 39, 18,160, 87, 56,131,107,215,205,
+ 24, 18,193,160, 85,136, 4,191, 30,108, 1, 0, 16,208, 74, 80,106,133,167, 20,193, 83, 95,157, 78,127,207,204, 68,215,142,157,
+240,123,218, 49,164, 27, 77,208,221,209, 65,236,215, 28,189, 7, 14, 71,255,225, 99,161,222,161,130,156, 99,110,252,123,160,248,
+ 71,169, 84,170, 3, 97, 97, 97,200,204,204,100, 59, 76, 9,128,121, 42,149,106,167, 92, 46,143, 81,169, 84, 7,254,104, 47,197,
+236, 56, 57,245, 19,106, 33,100,140,168,170,178,160, 84,239,143,239,127, 56,224, 85,253,143, 30, 51, 92,218,194, 95,139, 81,195,
+197,232,218,229, 89,117,139, 22, 65, 48,153,205,184,125,251, 14,218,229, 93, 71,118, 78, 46, 94,125,101, 60,221,248,221,110,159,
+218, 53,194,190,167, 2,192,125,155,236,251,105,253, 3,119,183,195, 93,179,102, 13,148, 74,165,180,169,210, 1,223,199,247,133,
+110,221,186,181,246,126, 10, 77,164,188,148,202, 68, 41, 1, 65,108, 35,212, 59,205,251, 9, 36,253, 53,103, 29,111,207,146,233,
+216,247,202,129,215, 18,245, 30,137,220,175,191,254,234, 56, 30, 55,110, 28,246,236,217, 83,239, 49,143,123,175,252,157,207, 57,
+ 19,129,112,212,249,165, 0, 0, 32, 0, 73, 68, 65, 84,122, 9, 64,234,145,116, 12, 31, 17,121,223, 10,109,245, 46, 59,164,243,
+205, 62,189,132,140, 80, 0,157, 86,136,246,109, 69,104,223, 86,140,138, 10, 17, 36, 34, 33, 44, 66, 63, 12,234, 71, 48,224,113,
+ 1, 24, 34, 2, 33, 4,126, 34, 49, 68, 76, 53,136, 68, 12,179, 1, 48, 67, 95,175,242, 63,114,240, 0,186,117,104,131,179,167,
+207, 34,175,232,230,221,242,149, 87, 64,114,238, 56,101, 4, 4,131, 34, 6,225,215, 61,222,233,216,117,235,214, 73, 51, 51, 51,
+213,151, 47, 95,134,191,191, 63,252,253,253,101,219,182,109,211,120, 57,152,201, 84, 42,213, 1, 86,241, 59,117,142,150, 0,198,
+126,253,245,215,119, 94,123,237,181,100,185, 92, 62, 70,165, 82, 37, 63,136, 29, 60, 50, 50, 82,154,158,158,206,249,185,165,163,
+134, 73,251,134, 55, 87,119,234, 80,132,160, 22,126, 96,152, 0, 84, 86,154, 81,172,173,196,203,242,222, 84,210, 98, 16,190,253,
+230, 7, 78,253, 72,132, 66,188,240,204,227,234, 62,125,122,227,102,161, 14, 39,126, 59,137,138, 10, 61,130,130,154, 35, 44,172,
+ 11, 24,129, 8, 22, 75, 30,226,102, 79,167,137,235,190,255, 67, 89, 55,177,177,177,234,133, 11, 23, 58,142, 23, 44, 88,208,104,
+ 94,128, 7,217, 3,160, 82,169,136, 92, 46,167, 73, 73, 73,112,183,177,210,253, 54,218, 21,138, 56, 16, 66,176,126,189, 82, 22,
+ 27,219, 48, 18,192,116,121,209,161,188, 51, 86, 52,115, 59,152,182,111,201, 32, 52,132,121,104,219,239,207, 10,103,101,239,142,
+ 20,120,244, 0,164, 30, 73, 7,128, 6, 19,129, 35,243,178,235,189, 62,226,211, 30, 62, 15, 22, 78, 57,206,189, 26,132,146, 53,
+109, 33, 18,138,208,185, 99, 5,202,203, 69, 56,113,182, 51, 4, 2, 1, 4, 68, 0,177,200,140, 62, 61, 12,232,217, 67, 0, 2,
+ 6, 98,145, 31,196, 2,130,136,199,141, 8, 9,182, 98,211,255,213, 47,187,119,183,118,184,150, 83, 84, 83,249,219,145,119,227,
+ 26, 33,140,144,118,136,122, 28,193, 45,155,163, 68,119,135, 83,121,215,174, 93, 43, 93,185,114,165,250,218,181,107,206,167,213,
+227,199,143,199,238,221,220,173, 77,149, 74,117,208, 89,249,187, 65,235,132,132,132,146, 55,223,124,115, 63,154,120,138,162, 30,
+229,175,246,166,108,225, 97, 33,234,208,118,101,104,221, 42, 16,157, 66,219, 35, 32, 48, 0,215,174, 21,192, 98,177, 34,180, 99,
+115,156,187,144,134,168, 17, 67,164,105, 71, 50,234, 29, 76,223,120, 99, 58,125, 60, 92,135, 71, 30,233,132,243, 23,174,225,196,
+137, 11,184,125,167, 28,148, 2,193,193,254, 48, 24, 42, 48,112, 96, 31,148,148,148,162,224,196,111, 24,254,100,164, 52,245, 48,
+119,162,242, 32,131,181,254,237,219, 78,131,245, 4,172, 93,187,214,107, 47, 0, 59,221,239,154, 9,216,205,118,178, 13,238,127,
+157, 58,117,162,157, 59,119,110,112, 46,126,149, 74, 69, 38, 79,158, 76,183,108,217, 2,118, 99,165,250, 20,158,125, 43,220, 90,
+229,143,138,138,146,178,155, 3,213, 65, 98,169, 7,153,142,255,173, 80,196,169, 27,242,142,186,202, 27,178,164, 2,199, 87, 52,
+171,161,248,121, 60,156,214,191,171,203,191, 65, 83, 0, 13, 37, 2, 35, 62,237, 81, 39, 9,240, 69,249,179, 72, 73, 73, 65, 65,
+ 65, 1, 0, 32, 52, 52,148,122,243, 50, 8,104, 37,132,196, 2,177, 72,132,223,206,182,129, 64, 40, 68,115,145,222, 22, 7,208,
+140, 65, 65, 65,115, 60,222,199, 10, 66, 8,228,207,154, 65,173, 12, 64,252, 64, 64, 97, 11,228,119, 15, 67,201,117, 20,106, 43,
+144, 85, 80, 80,103, 89, 74, 74,181,208,221, 46,180,203,226, 60, 0,185, 42,127, 0,192,238,221,187,241,212, 83, 79, 73,247,238,
+221,235,113,128,147,203,229,163,114,115,115,221,118,152,210,210, 82,231,211, 45,151, 45, 91,134,243,231,207,143,126,144,166, 2,
+156,148, 63,103, 72, 71, 13,147, 74,132, 55,225,239,223, 18, 18, 63, 49,186,117,235,138,206, 93,187,162,172, 76, 3,173,182, 2,
+ 98,177, 0, 33,193, 18, 8,253, 91,122, 28, 76,133,180, 0,205,155,181,130,161,210,140,179,103,179,113,163,176, 20, 55, 11, 43,
+ 80, 89, 45,193, 35,161,102, 72,252, 4,200,206,202,197,163,221,187,227,198,205, 50, 84,154, 91,112, 26,160,157,221,254,117,157,
+247,118, 58,160, 46,153,190,200, 98,173,255, 5, 11, 22,212, 58,191,112,225, 66,159,188, 0,238,118, 39,116,157, 59,110, 44,175,
+ 66, 90, 90,154,186,161, 27,242, 76,158, 60,153,170, 84, 42,200,229,114,184,155, 14,224,226,169, 98,149, 63, 0,100,100,100,212,
+ 42,147,253,186, 71,163,135,221, 97,176,177, 60, 46, 91, 22, 6, 98,242, 26,189, 91,197, 31, 26,194,216, 71, 41,110,205, 59,110,
+220,184, 26, 94,146,167,159,126,186, 70, 93,241,110,255, 7, 7, 94,199, 0, 52,150, 71,160, 49,145,157,109, 35, 22, 5, 5, 5,
+ 94,145, 0,161, 80, 8,145, 64, 4,145,136, 96,228,112,192,160,175,198,149, 28, 49, 68, 66, 17,132, 22, 33,134, 70, 82,136, 69,
+ 34, 8, 4, 12, 64, 9,180, 58,224,248, 73, 33,172, 86, 43,128,219,117,202, 61,249, 91, 14, 42, 42,234,206,192,217,173,125,123,
+170, 55, 19, 84, 86,150,194, 98, 53,115,126,206,147, 39, 79,214, 77, 58, 12, 6, 78,138,198,213,245,239,142, 25,238,216,177,195,
+249,254,228,166,240, 2,184,115,241, 59, 43,127,251, 0,200,205, 2, 12,109,167,102,152,235, 48, 91,172, 48,154,204,184,125, 71,
+ 11,145, 88,130,234,106, 19, 76,102, 11,204,102, 43,204, 22,202,201, 19, 35, 22,233, 33,241,239,132,226,226, 82,148,149, 27,160,
+213, 85,162, 69,171,254, 24,246,248,227,200, 72,221,131,142, 70, 51, 74,203, 74,209,179,103,119,248,137,133,208,151,107,255, 16,
+ 3,133, 61,242,223, 49,247,239,226,153,242, 41, 22, 96,193,130, 5, 53,188, 9,174,215,184, 18, 0,173, 54,198,113, 99, 92, 92,
+ 8,182,108,217, 82,163,191,178, 6, 66, 94, 94,158,207,187,114,202,229,114,186,101,203, 22,199, 54,227,117,197, 4,184, 42, 87,
+ 87, 79, 85, 90, 90,154,154, 13,124,163,148,210, 99,199,142,213,184,126,236,216, 49,181, 39,167, 7, 75, 26, 88, 18,224,108,197,
+215,101,232,123,120, 54, 76,138, 74,198,102, 0, 83,214,232,241,196,146,138, 6,145, 47,215, 57,126, 79, 49, 1, 60,238,189, 55,
+160, 46, 15,192,125,245,239,184,179,244, 27, 98,253,187, 88,172,200,206,206,102, 7, 20, 78,189, 87, 32, 16, 98,232, 16, 43, 4,
+140, 16,199, 51, 37,184,148, 45,193,132,167,128,103,158, 6, 38,142, 35,232,208, 78, 12,137,216, 15, 18,177, 31,252, 37,126, 8,
+237,224, 7,137, 88, 2,137,135,101,128,249,121,215, 73,137,246, 22,169,107, 32,233,222,173, 11,130, 90, 6, 66, 98, 53,162,194,
+ 96,186,239,157,226,200,145, 35, 7,142, 28, 57, 82, 67,225, 59,127, 0,160,184,184, 24, 19, 39, 78,108, 50, 43,223,110, 29, 73,
+ 93,207,217,191,123,101,201, 89, 44,128,222, 96,130, 94,111, 68, 89, 89, 53,110,221,210,225,198,141, 59, 40, 47,175, 70, 69,133,
+ 9, 21, 21, 70,232,245, 38,148,150,148,122,148, 85, 93,109, 70, 85,149, 5, 38,147, 17,205,155,139,209, 57,180, 5, 2, 2, 3,
+ 1, 0, 97,221,187,162, 83,199, 22, 8,106, 33, 1,165, 22,152,204, 86, 84, 87,235,255, 16, 3, 73,108,108,172,122,209,162, 69,
+245, 42,243,216,216, 88,206, 22,169,125, 75,225, 58,175,175, 89,179, 6, 95,125,245,149,215, 91, 13, 59,109, 59,235,248,176, 10,
+181,160,160,128,221, 61,211, 43,237, 54,121,242,100,154,148,148, 4,103,242,160, 82,169,200,164, 73,147,234,253,221,236,217,179,
+ 65, 8, 1,219,143, 35, 35, 35,165, 0, 48,116,232, 80, 25,171,200, 89,171,159,189, 78, 41,117, 92,231,240,180, 53,172,120,119,
+196,129,203, 12, 74,235,214,173, 65,156, 88, 66, 67,229,241,120,240,148,191,187, 99,159, 60, 0, 15,146,229,127,119,128,183, 64,
+ 32, 16,120,253,187,225, 67,172,104,219,198, 15,101,101, 66,248, 9,205,240, 19, 11,160, 73, 23, 99,130, 76, 4,177, 72,132,178,
+ 50, 17, 82, 51, 3,209, 66, 66,192, 48, 12,198,197, 24,241,220, 4, 10,134,161, 88,126,202,251,114,202,229,114, 42, 8,144, 64,
+ 43,106,141, 0, 83, 62, 46, 23, 80,140,146,142,228,188,165,239,192,129, 3,113,244,232, 81,183,215, 2, 2, 2, 56, 15,150, 58,
+157,110, 52, 0,108,216,176, 1, 51,102,204,112,156, 47, 46, 46,118,124,159, 49, 99, 6,138,138,138,154,164, 61,211,211,211, 53,
+132, 16,176,243,164, 12,195,128,117,119,214, 51,111, 90, 39,242,174,223,144,181,105, 97, 80,251,137, 5, 48,154,172,168,170,206,
+199,245,252, 98,104,117,101,208,106, 13, 40,214, 86,162, 88, 91,137,150, 33, 93, 1,228,212, 43,235,214, 29,138,194, 91,119,208,
+187,119,119,148,232,116, 16, 9, 25,148,149,231, 67, 95, 98,197, 99,143,234,209,174, 77, 27, 4, 4, 4,192,207,207, 31, 55, 11,
+203, 65, 4,193,156,202,232,236,146,111,172, 85, 0,141,189,130,160, 46,107, 29,184, 27, 11,192, 21, 10,133, 66, 19, 27, 27,139,
+249,243,231,215,242, 42,176,211, 12,190,174, 44,152, 60,121,114, 13, 11,150,125,191, 8, 33,120,241,197, 23,145,148,148, 68,184,
+146, 0, 87,203,223,249,154,171,167,193, 21,235,214,173, 35, 0, 28, 86,126, 70, 70,134,218,222,175, 53,118,111, 0,251, 87, 13,
+128,164,167,167, 59,174,215,183,157,107, 90, 90,154,122,248,240, 97,178,163, 71,109,239,196,236,217,179,113,234,212,111, 50, 86,
+133, 31, 59,118, 76,205, 62,255,208,161, 67, 61,122,202,214,173, 91,135, 47,100,193,152,178,214, 96,123,174,133,129, 53,174, 79,
+ 89,107,112,212,231, 76,153, 8,223, 28, 52,130,199, 67, 64,218,227, 87,214, 36,221,171, 22,227,212,169, 83,220, 87, 1,220, 11,
+197,239, 28, 11,208, 16,235,191,166, 37, 95, 83,249,219,221, 76, 30,167, 2, 90,183, 22,128, 33, 2,180,105, 45, 64,143,238, 20,
+ 55,110, 8,193, 8, 8, 68, 66, 33, 68, 66, 17,126, 63, 19,136,144, 64, 17, 4, 2, 1,134, 71, 90,224,239,239, 7,171,149, 2,
+212,226,147,242,111,214,174, 51,110, 85, 80,232, 47,107, 32, 36, 2, 92,190,145, 71, 46,115, 84,254,246,129, 77,118,253,250,117,
+245,245,235,215,221, 61,175,134, 99, 57,198, 20, 23, 23,239,103,149, 60, 0, 76,156, 56, 17, 27, 54,108,112,220, 83, 86, 86,134,
+162,162, 34,236,220,185,147, 93, 46,120,223, 59,175,125,224, 82,103,100,100,168,217, 96, 49,251, 57,175,149, 66,234,225,116,141,
+ 76, 26, 1, 90, 80, 6, 67,165, 9, 58,191, 42, 80,232, 80, 85,101, 70, 89, 89, 53,138,238, 24,112,227,102, 5,158,148,117, 1,
+144, 90,175,172, 74, 99,107,228, 94,185,141,176,110,143,160, 91,183, 78, 40, 46,190,131,224,150, 22,244,232, 17,132,182,109,194,
+ 32,241,247, 71, 73, 73, 5, 78,156,188,136,252,130, 50,180,239,212,231,161, 29, 64, 18,149, 74, 74, 8,100,172, 46,117, 86,170,
+245,173,219, 79, 84, 42,165,137,235,214,113,242, 2,172, 93,187, 86,237, 74, 0, 86,175, 94,141,245,235,215,203, 60,201, 75, 76,
+ 76,164,113,113,113, 68,161, 8,118, 42, 19,117,167,152, 41, 0, 76,154, 52,137,147,251,223,121, 74,161, 85,171, 36,248, 58,109,
+192, 90,249,118, 2, 64, 41,165, 24, 62,124,184, 44, 53, 53,181,206,235,158, 20, 54, 59,183,158,154,122, 84, 77, 8, 1, 33, 4,
+ 3, 6,244,151,173, 91,183, 78, 83,251,222,187, 36,195,147, 60,102,178, 14,172, 60,249,168,174, 53,248,209,228, 53,231, 29,242,
+184,128,143, 1,120,120,224,145, 0, 60,136, 22, 63,139,169, 83,167, 54,232,247, 12,195, 64, 32,176,125,122,135, 51, 24,216,207,
+ 2, 63,177,196, 70, 0, 68, 34, 12,139, 4,252,252, 0,145,192, 15,173, 91, 75, 32, 16,232, 97,177, 88, 97,181,122,239,182, 55,
+104, 11, 33,233,212, 11, 87,146,255,131, 54, 66, 6, 71,242,174,121, 61,160, 44, 88,176, 64,179,110,221, 58, 89, 67,150, 1,178,
+203,250,222,120,227, 13,199, 57,214,210, 47, 43, 43,131,193, 96,192,204,153, 51, 1, 0, 95,126,249, 37, 0,168,155,162,109,211,
+210,210, 52,118,107, 95, 13, 0, 67,134, 12,105, 80, 0, 87,167, 46, 61,145,121,108, 47,218,182, 14, 64, 64,128,173,219, 87, 87,
+ 91, 80, 86,110,132, 86, 87,137,206,221,250,224,251,141,155, 60,182,201, 47,191,236, 35, 47, 62, 63,148, 30,203, 56,135, 39,135,
+247, 71,151, 46, 93, 96, 50, 86, 97,224,128,199, 17, 24, 20,132,107,185,121, 40,184, 81,130,212,180, 11,208,149, 7, 97,207,134,
+ 77, 15,173,207,116,118,156,194,222,254, 4,179, 21, 10,199,178,112,171,139,210,103, 24, 2, 80,135,202,160,179, 21, 10,244,119,
+ 99,193, 18, 2, 10, 39, 90, 30, 23, 23, 7, 87, 47,192,252,249,243, 65, 8, 65, 92,156, 66,109,215,231,152, 29,167, 64,255,254,
+181,229,197,197,197, 57,220,241,158,148, 28, 87,229,239,138, 73,147, 38, 97,244,232,209, 50, 95, 73,176,243, 92,125,100,100,164,
+ 44, 53, 53, 85, 83,215,117, 46, 65,138,246, 85, 5,148, 37, 95, 81, 81, 81, 50,133, 34, 78,227, 74, 58,156,228,195, 27,121, 91,
+ 22, 54,179, 29, 74,218,221,245,116, 44,204,115, 16,130,189,167,235, 31,251,220,229, 1,224, 99, 0, 30, 82, 2, 48,108,248,144,
+123, 50,231,211, 88,150,191,115, 71,242, 5, 90, 29, 65,135,118, 12, 8, 97, 64, 24, 6,251, 14,216,230,247,253,252, 36,240, 19,
+251, 97,226,211, 4, 18, 63, 49,252, 37, 4,218, 98, 1, 50, 78, 52,135,197,106, 65,231, 78,222,205,235,202,229,114,122, 35,255,
+ 10,116,153,187,209,163,179, 8,103, 11,124,159, 23,158, 61,123,182, 6, 13, 12,202,147,203,229,178,207, 63,255, 92,205,186,249,
+139,139,139,167, 68, 70, 70, 86,236,223,191,127,215,115,207, 61, 55,182,184,184,152, 76,159, 62,125,175, 61, 95, 64,147,117,206,
+244,244,116, 77,100,100,164,140,253,222, 16, 89,223,111,220, 68,166,191,250, 50,205,186,120, 30, 55,114,175,129, 97, 8, 44, 22,
+ 10,137,127, 8,194,123,247,197,158, 95,147, 57,215,233,141,219, 86,153,182,248,134,186,170,202,140,126,125,195, 16,218,177, 53,
+242,174,223,130,238, 76, 14, 46,101,229,225,192,193,223,113,173,128,226,120,230, 89,159,218,233, 65, 73,254, 99,221, 28,236,243,
+125, 3, 63,230, 40, 47,231,255,176,118,237, 90, 7, 1, 88,187,118, 45,144,187,161,214,189,238,228,113, 5,165,148, 52,164, 31,
+199,197,197, 53,168,239, 57, 41,121,141, 47,215,221,121, 21,156,127,235, 78,158, 87,237,124,109, 43,146,214,190, 98, 27, 27, 70,
+ 61, 82, 67,249, 3,128,124,252, 19,182, 47,186, 83, 30, 9, 0,159, 7,224,193,193,250, 85,139,107, 77, 3,120, 69, 0, 30,240,
+128,143, 6, 23, 46,243,164, 31, 36, 98, 49, 38,142, 39, 96, 8,193,144,193,102,156, 57,235, 15,134,216,230,252, 75, 74, 24,116,
+108, 47, 0, 67,196, 56,125, 70, 12,137, 31, 96, 52, 25,113, 45,207,223, 43,229,159,147,245, 27, 34, 71, 63, 3, 97,235, 72,228,
+100,101, 64, 88,152,132,160, 22, 33,180,180, 76,219, 36, 21,172, 82,169, 52,114,185, 92, 54,120,240, 96,117,124,124, 60,250,246,
+237, 91,164,211,233, 48,120,240, 96,153, 78,167,195,188,121,243,212,118,229,175,105,234, 70,110,168,226,119, 37, 1, 0, 16, 53,
+ 98,136,180, 67,251, 14,234,192,192, 64,124,191,113, 19, 57,123, 46,199,187, 1, 61, 53, 67, 3,128, 88,208,154,158,191,148,142,
+ 14,237,154, 65, 34, 17,161,162,194,136,130,155,101, 32,194,206, 56,158,153,202, 71, 75,113,193,201, 55,129,238,255,139, 26,203,
+ 11, 79, 44,106,210, 34,197,197,133, 56,165,173,109, 28,133,230, 73, 41,123,163,180, 27,154,207,192,221, 56, 47,143,242,179, 61,
+107,229, 77,219,135,199, 67,139, 1, 3, 6, 56, 2,254,214,175, 90, 92,235,154, 71, 2,208,216,249,248,239,119,126,127,239, 88,
+ 4,129, 78, 71, 16,208,158,160, 85, 8,193,224, 65, 38, 72,196, 2,248,137, 77,104, 21, 34,177, 15, 2, 4, 67, 7, 91,144,113,
+ 82,100,243, 22,112, 36, 70,114,185,156,246,233,217, 2,111,206,255, 16,149,226, 78,248, 41,185, 0,221,195,135, 0, 0,154, 29,
+223,137,172, 60,208,138,242,166, 35, 1, 0, 72,110,110,174,116,213,170, 85,106,103,239, 0, 0,210,148,150,255,189,134, 61,217,
+ 79,131,235,253,208,225,147,100,250,171, 47,211,219,197,183, 81, 89,104,128, 68,210, 10,157,186, 61,206,105, 42,225, 97,135, 45,
+ 29,118, 35, 61,102,238, 6, 56, 86, 4,228,110,108,242,103,243, 20,220,247, 71,195,216,103,166, 52,170,229,206,199, 0, 60, 88,
+ 36,160, 46,229,239,209, 3,240,103, 0,133, 45,170,159, 48, 20, 20, 20, 33, 45, 41, 82,142, 8, 33, 17,139,224, 39, 22,226,217,
+241, 20,148, 90, 17,220,202, 12,179,133,192,106,181,216, 7, 63,207,120,188,107, 5, 38,188, 40, 71,133,176, 7,218, 54, 11,196,
+203, 47,132, 96,211,182, 51, 14, 18, 96,178,252,132, 51, 23,155,118,157, 56, 75, 4,156,142,249,183,199, 7,175,194, 31, 17,100,
+178,142,208, 45,193,181, 53,131, 42,196, 39,121,235,117, 43, 17, 27,188,184,246,133, 19,139,154,220,234,255, 51, 99,255,239,166,
+198,236,195,196, 70, 16,169, 19, 89,228,167, 5,154,138, 4,120,108, 44, 95,247, 17,230,193,131, 7, 15, 30, 60,120, 60,188,224,
+ 19, 61,243,224,193,131, 7, 15, 30, 60, 1,224,193,131, 7, 15, 30, 60,120,240, 4,128, 7, 15, 30, 60,120,240,224,193, 19, 0,
+ 30, 60,120,240,224,193,131,199, 31, 3, 53, 86, 1,156, 58,117,202,231,104, 80,119,193,132,141, 45,111,218,204, 56,143,191,211,
+107, 11, 29,223, 3, 67,218, 59,190,255,240,109, 98,173,123,219,200, 94,243, 40,111,255,154,187, 25,243,198, 44,252,220,241,253,
+182,250,107,248, 82,190,186,224,107,249,234,130,187,242, 61, 63, 93,225,241,119,153,234, 93,232,218,181, 43,174, 94,189,138,193,
+178, 9,142,243, 63,127,175,188,231,245,231,169,191, 36,132,134, 74,223, 44, 40,112,206, 76, 72,238,103,255,115,149, 55, 97,194,
+ 4,233,238,221,187,107,100, 74, 28, 63,126,188,108,215,174, 93,154,166,120, 63, 30,100,121, 13,145,245, 71,174,191,232,232,232,
+151,250,245,235,183,233,204,153, 51, 47,166,164,164,252,212, 8,229,163, 15,202,251,193,203,107, 90,121, 94, 19, 0, 87,124,241,
+197, 23,210,170,170, 42, 16,129, 8,132, 16, 88,204, 38,136, 69, 66,204,155, 55, 79,211, 80,230,241,197, 23, 95, 72, 1, 96,238,
+220,185, 13,146,165,215, 22, 34, 48,164,189, 67,241,183,239,220, 21, 0, 80,120,253,170, 79,242,246,175,121, 3, 99, 22,126,238,
+ 80, 92, 95,108,207,248,127,246,174, 60,188,137,170,123,191,147,164, 89,186,175,148,125, 43, 84, 86, 41, 20, 17, 89, 19,217,132,
+ 2,202, 82,180, 84, 63, 17,161, 1, 17,101, 83,164,159,191, 15, 63, 23, 4, 69,138,178, 6, 68,224,131,178, 21, 68, 89, 10,133,
+ 66, 74,217,180, 82,160,236,148, 82, 74, 55,160,123,218,102, 79,102,126,127, 52, 19,211,144, 54,147, 52,172,206,251, 60,243, 36,
+179,228,100,230,206,189,247, 61,231,220,115,207, 5, 0,204, 24,221,235,185,212, 0,207,201, 15,162,167, 36, 2,231,228, 7,107,
+ 72,109,124, 52, 0, 32, 39,231,201,151, 95, 40, 32,206, 4,228,161,128, 36, 19,144,207, 45, 40, 64,218,252, 79, 1, 0,189,150,
+124,247, 68,203, 45, 42, 42,138,218,177, 99, 7, 52, 26, 77,173,227, 66,161, 80, 30, 21, 21,133,237,219,183, 63,173,211, 3,251,
+189,208,166,217,102,202,104, 84,101,230,222, 95, 0,224, 0,107, 7,213,141,159,126,250,233,213, 11, 23, 46,120, 23, 22, 22, 54,
+246,247,247,247, 13, 15, 15, 47,152, 55,111,222, 22,103,229, 13, 28, 56,112,208,196,137, 19, 79,108,219,182,109, 10, 0,159,183,
+222,155, 54, 25, 0,121,249,242,229,127,201,100,178,223,164, 82, 41,233,160, 72, 58,185, 50,229,130,254,202,154, 68, 92, 85,135,
+169, 71, 32,147,133,171, 61, 0,150,248,126,233, 15, 98,159, 22, 93,229, 3,187,118,128,187,192, 13, 20, 69,193,104,164,112,229,
+214, 93,252, 16,247,163, 68, 36,112,195, 7, 31,124,224, 20,121,199,111, 94, 32,238,220, 62, 85,126, 37,179,173,196,217, 27,167,
+ 9, 95,228, 19, 0,101,217,125, 51,241,215,231, 17, 96, 98,169,246,138,254, 12, 71,227, 62, 52, 55,164,186,174,171,111,142,165,
+245,127,242,249,252,154, 86, 64, 81, 32,201,154,246,109, 52, 26,205,247,207,225,186, 49,182,162, 1,160, 73,163,154, 84,157,186,
+202, 10,104, 13, 6, 0, 64,181,161, 70, 94,155,161,239,163, 93,231,238,140,136, 31, 0,186,245, 25,132,115,242,131,102,226,175,
+235,186,199, 89,126,116,167,145, 9, 96,152,135, 7,146,148, 74, 57, 77,252, 0,112,243,200,209,250, 58,173,122,241,221,214,111,
+196,233, 37,127,161, 32, 55, 3,237, 91,245,198,198,143,183, 59, 92,135, 35, 34, 34, 94,223,185,115, 39, 77,254, 6, 0, 26, 0,
+238, 0, 72,141, 70,195, 19,137, 68,136,136,136, 16,219,242, 4, 60, 97, 4,191, 20,214,245, 80,210,246,181,158,202,130,235,232,
+ 23, 57,125,219,221,114,253,191, 0,252,246,180,117, 76,145,145,145,148,179, 11,240, 88, 17,163, 83, 88,185,114,165, 56, 45, 45,
+ 77,190,121,243,223,137,137, 74, 74, 74,144,153,153,137,145, 35, 71,254, 79, 44, 22, 75,230,205,155,199,232,253,202,100, 50,206,
+182,109,219,254, 11,224,149,126,195,222, 16,109,219,182, 45,248,173,247,166,121, 1, 48, 2,104, 98,186,236, 5, 0,156,129, 3,
+ 7, 14, 0, 30, 94,234,188, 46, 82,237, 21,253, 25,210,226, 23, 83,117,181, 55, 7,218, 7,149,122, 54, 13, 92, 46, 15, 70,163,
+ 1,138,170,106, 76, 28,247, 58, 85, 85, 85,213, 80,194,166, 92,249, 94, 88,216,135,173,101,127, 45, 60, 5,246, 21,128,101,203,
+ 87,136,197, 35,198,203, 91, 52,242,129,187,144, 7,146, 36, 97, 36, 1, 30,151,128,191, 79, 7,116,110,223, 82,158,156,116, 80,
+178,122,245,106,177,163, 74,192,138, 21, 43,196, 29, 67, 78,203,187,117,184, 3, 46,199, 40, 95,177,114,165,100,230,135, 31, 58,
+ 36, 67, 89,118, 31, 34,159, 0,248,120,123, 1,128,249,211,214,117,141, 91,180,182,235, 13, 56, 26,247, 33,122, 69,127,134,119,
+223, 28, 11, 0,230, 79, 91,215,173,218,151,230,144,118,205,229,114,209,188,121,115,112,185, 92,232,116, 58, 40,149, 74, 24,141,
+ 70,148,151,151, 59,245,114, 61,121, 92,252,178,124, 47, 4, 62,192,131, 28,224,175,234, 2, 20,223,207,194,150,184, 5, 14, 89,
+253,221,250, 12, 66,243,166, 53, 67, 36,205,109,144,127,235,214,173,205,195, 1, 0,144,159,159,239,146,242, 99,152, 92,149, 26,
+230,225,129,175, 62,156, 1, 0,248,202,130,248,183,102,102,214,238, 76, 28,200,214, 58,113, 65,127,113,121,175,100,249,103, 45,
+223,134,150, 28, 12, 1, 73, 97,200,235, 70,108,252,126,151,228,232, 42, 48,237,204,121,211,166, 77,251, 77,173, 86, 99,211,166,
+ 77,154, 73,147, 38, 9, 1,120, 2, 32, 55,109,218,164,155, 52,105, 18, 79,173, 86, 67, 40, 20,202, 27,218,209, 13, 27, 54, 76,
+124,228,200, 17,185,105,193,150, 6,195,147,207,249,207,138,175, 62, 21,249, 94,219, 14,209,205,227,248,226, 85, 63,175,143,246,
+ 23,127, 89,165,163,158, 42, 5,128, 94,130,183,188,124, 8,229,239,159,236,240,179,191,252,242,203,226, 63,255,252,211,105,178,
+ 89,182,108,153,120,247,238,221,242,170,170, 42,155,231,239,221,187,135,221,187,119,203,223,123,239, 61,201,198,141, 27, 83,236,
+212, 23, 98,219,182,109, 91,250, 13,123, 99, 66,230,133, 51,188,230, 77, 27, 27,222,122,111, 90,173,126,247,248,193, 95,209,181,
+107,215, 14,219,182,109, 27,222,181,107,215,125, 0,112,234,212,169,122,219, 7,147,246, 86,211, 62, 8,192, 78, 34,158,238,221,
+187, 83,135,146,142,226,194,149,107,230, 99, 26,141, 22,223,173, 88, 87, 61,125, 82, 20, 75,216,207, 49, 30, 10, 2, 92,186,116,
+169,184,223,208, 49,242, 14, 45, 3, 32,112,227,128, 36, 73,220,191,127, 31,151, 51, 46, 64,103, 32, 65,146, 20, 2,124,220, 49,
+116,248, 72,185, 90,107,112,248, 15, 5,110, 69, 8,105,121, 31,224, 18,232,212, 62, 15, 2,222, 3,135, 45,127, 75,242,183,134,
+162,178, 10,247,243,114, 32,242, 9,168,211, 43, 80, 31,121, 89, 99,243,206, 95, 49, 99,116, 47,244,138,254, 12,245,104,217, 15,
+129,207,231,131,203,229,194,219,219, 27,217,217,217, 40, 47, 47,175, 81,164,156, 36,255, 38,141,130,225,201,227, 98,204,204,175,
+ 49,124, 98, 31, 28,184, 82,128,251,106, 52,152,252,173,145, 95,120, 31, 87,207,157, 70,144,159,119, 13,249,243,184, 46, 41,191,
+215,198,189, 11, 0,240,227,185, 57, 68,254, 0,240,127, 43, 87,225,255, 86,174, 50,147,127,146, 82,137, 79,134,142,172, 57, 25,
+196,103,244,220,125, 98,219,136,167,206,125, 69,254, 94,171, 15,224,198,241,132, 7,220,193, 1, 23,205,130,251,226,195,175,230,
+200,231,239,239,192, 72,141, 72, 73, 73,209, 3,192,230,205,155, 85, 0,132,244, 50,202,155, 54,109, 34, 1,184, 91, 46,171, 28,
+ 21, 21,229,212,184, 92, 92, 92,156,216,145,227, 12,208,175,103,247,110,170,132, 95,247, 74,187,119, 9,229, 42,175, 29, 67, 78,
+ 81, 21,238, 85,168, 64, 82,148, 83,129,192, 20, 69, 81,101,101,131,169, 1, 3, 6,184, 52,145,152, 5,249,195,223, 63,217, 41,
+ 25,105,105,105,114, 0, 4, 65, 16,120,249,229,151, 29, 46,179,228,228,228,135,200,255,220,185,115,152, 56,113,162,121, 95,175,
+215,227,198,141, 27,242,184,184,184,122,189,152,219,182,109,251,176,223,176, 55, 70,126, 19, 59,155,151,144,144,128,159, 87, 44,
+229,153, 60, 70,102,242, 79, 72, 72,192,202,149, 43,209,181,107,215,125,246,218,155, 53,249,215,213,222,134,247, 53,121, 1,189,
+ 60,236,202,251, 97,197, 26, 51,249, 23,149,148,162,168,164, 20,138,170,106,184,185,241, 60,215,108,218,174,129,171, 22, 68, 96,
+241, 88, 17, 22, 22,246,208, 86,175, 2,176,122,245,106, 42,160,245,139,104,221,216, 23, 26,189, 17, 4, 1, 36, 37, 29,198,255,
+ 54,111,194,165,140, 12,124, 50,103, 22,184, 92, 14, 72, 35, 9,111,119, 1, 90,191,216, 79,190,124,249,114,198, 13,108,229,202,
+149,226,206,237,239,202,189, 61, 85,248,101,115, 17, 56, 4,133, 94, 93,111,202, 87,174, 92,233, 80, 35,181, 69,254, 52,241,171,
+ 21,165,181, 20, 4, 69,101,149, 93,121,182, 26, 19,221,144,210,226, 23,215, 34,184,205, 59,127,101,116,143, 33, 33, 33, 8, 8,
+ 8, 64,101,101, 37,248,124, 62, 56, 28, 14,212,106, 53,202,203,203,193,229,214, 52,114, 71, 22, 91,218,243,219, 94,204, 90,126,
+ 4,123, 87,124,142, 38,141,130,225,238,225,143, 60, 99, 1,182,196, 45,128,167,169,211,224, 50,148,103,139,252,105,226, 87, 20,
+222, 70,135,230,141, 80,165,210, 64,224, 46, 0,140, 70,187,241, 0,246,202,111,193,250, 3,184,122,254, 44,186,180,237, 4,133,
+209,190,210, 72,147,255,205, 35, 71,241,127, 43, 87,153,143, 39, 41,149, 72, 82, 42,145, 45,253, 47,142, 92,187,132,206,189,218,
+ 2,165,246,151,102, 30, 56,175,173,120,250, 71,131,228, 65, 30, 29,161,166,170, 0,109, 17,248,218, 50,104,141, 85,208,144,106,
+144,124, 79, 52,235,223, 19, 67,166,183,162,236, 89,115,244,184,191, 84, 42,117,151, 74,165, 64,205, 16, 0,164, 82, 41, 76,251,
+ 38, 11, 74,131, 29, 59,118, 56,220,104,103,207,158, 45,158, 51,103,142,188, 83,167, 78, 20, 65, 16,114, 0,120,251,237,183,169,
+ 86,173, 90, 81,159,127,254,185, 83, 75, 51,123, 9, 56,155, 86,125,246,158,104, 88, 51, 45,247,204,141,251, 56,144,195,193,103,
+135, 30,104,255,155, 82,173, 80,234,241,174, 51, 50,203,203,135, 60, 74,203, 31,254,254,201,136,142,142,118,120,136,208,146,240,
+ 41,138, 34,232,229,164,153,226,221,119,223, 21, 63,120,192,204, 40,209,233,116,184,124,249,242,241,250,234, 11, 0,113,243,166,
+141,249,145,145,145, 0,128,244,244,116, 28, 63,248,171, 48,191,240, 62, 73,147,191,233,217,205,237,237,242,229,203,113, 13,105,
+111,223, 77, 26,137, 43,183,243,208,184,109, 19, 64,169, 98,252,236, 69, 37,165,208,235, 13, 38, 5,199, 0,189,222,128,188,187,
+ 57,194, 6,190, 86,194,206, 62,139, 39,136, 90,174, 40,173, 86,139,238, 29, 58,200,221, 69,110, 32, 73, 10, 70, 18, 56,125,242,
+ 20,254,251,213,215, 32, 41,224, 86, 86, 22, 46,101, 92, 68,151, 46,221,192,229, 18,120,161,109,115,100,159,103,238, 5,224,243,
+138, 16,218,186, 16,224, 17,200,187,167, 7,120, 4, 94,236,112, 23,105,151,139,156,126, 0, 75,247,190, 45,207,128, 90, 81, 90,
+107, 54,128, 61, 88,186,247,109,105,218,105,241,139, 49,100,246, 74,155, 81,236,150, 48, 24, 12,112,119,119, 7,135,195,129,159,
+159, 31, 84, 42, 21,148,202,154,101,128,131,130,130, 80, 90, 90,234, 80,142,108, 77, 57,208, 75, 36,194, 39, 43, 78, 98, 72, 55,
+224,238, 5,224, 47,211,185, 79, 86,156,196, 79,179, 37, 48,146, 70,135,203,239,234,185,211,230,239,131,194, 59,128,231,197, 65,
+ 82,202, 53,116,239,208, 2,222,158, 2,108,222,157,140,158,146, 8,228,219,152, 5, 96,175,252,246, 93,163,128,123,192,232, 65,
+ 4,214, 31,200, 70,128, 95, 27,140,237, 75, 48, 42, 63,218,221,159,164,252,123,233,100,234,139, 56,160,153, 2,196,212,133,160,
+254,251, 21,192, 81,131, 72, 91, 68,119, 42,117, 22,102,200, 56, 79,121, 43,223,112, 84, 26,171,161, 45,207,194,150,220,109, 56,
+ 53,186, 28,157,166, 72, 48,116,166, 39, 68,126, 47, 64,200,243, 3,111,180, 2, 83, 12, 83,168,159,215,255,108,179,147,146, 74,
+165, 20,173,180,113, 56, 28, 80, 20,165, 51, 41,209, 26, 14,135,163,162, 40,202, 31, 0,137, 6, 76,175,141,139,139, 75, 25, 54,
+108,152,164,180,180, 84,158,148,148, 84,163,248, 36, 37,161, 99,199,142,232,208,161,131,132, 62,230, 8,170,180,228, 71,147,255,
+239,167,253,223, 71, 52,230, 80, 26, 5,166,198,103,234, 13,122,253, 74,173, 17,139, 0, 56,181, 24,197, 27,111,232, 30, 57,249,
+199,199,199,167, 56, 99,253, 91, 14,153, 16, 4,129, 94,189,122,137,153,174, 42,105, 52, 26, 29, 82, 24,238,220,185, 3,153, 76,
+ 70,172, 89,179,198,214,105, 33,128, 78, 0,120,175, 70,140,173,200,206,206,246, 77, 79, 79, 71, 66, 66, 2,194,179,179, 57,233,
+233,233, 0,128,240,240,112,188, 54,176, 39,188, 61, 5, 88,185,113,111,209,196,137, 19, 99,215,172, 89, 51,219,209,246,118,239,
+183,197,240,234, 44,132,103,251, 89,216,181,120, 10,186,117,105,140, 23, 70,126,109,183,125, 40, 42,171, 32, 20, 10, 0, 0,110,
+110, 60,168, 84, 26, 87,243, 12, 75,250, 79, 0, 76, 22, 3,170,213, 81,145, 36, 9,119, 1, 31, 58, 3, 5,146, 2, 56, 4,176,
+240,203,175, 97, 36,129,234,234,106,220,191,127, 15,193,193,141, 65, 81, 36, 12, 6, 35,132,110, 60,112,221,152,185, 96, 87,173,
+ 90, 37,110,223, 58, 95, 30,232, 87, 89, 83, 29, 76, 27, 65, 80,232,209,249,150,156,158, 21,224, 8,104,235,158,118,247, 91,147,
+ 63, 19,235,223, 90,139,166,137,127,213,190,180,135,200,159,169,245, 15,212, 4, 12, 9, 4, 2,248,248,248,152, 93,134,116,224,
+159,143,143, 15, 26, 55,110, 12,131,129,185,242,180, 49,249, 4,124, 90, 3,226,208,154,253, 76, 67,141,251, 31,168, 57,246,249,
+215,114, 84,232, 28, 27,146,201, 47,172, 9, 86,108,217,200, 31, 94, 62, 30,224,121,115,161, 41, 81, 3, 28, 14,154,180,106,142,
+211, 25, 57, 78,149,223,187,115,191,193,128,222,175,130,119, 31,168, 14, 6,220, 57, 28,244,110,221, 6,210,209,193,140,228, 88,
+143,245,111,125,115, 10,198,188,209, 31,104,167, 1, 46,241, 0, 79, 30, 48, 42, 28,205,215,174,103,230,141,105,230, 15,157,174,
+ 12,132,182, 20, 91,114,183,225,236, 36, 31, 12, 24, 51, 9,253, 26,189, 38,185,114,196, 0, 3,169,132,155, 78, 9, 67, 7, 18,
+197, 15,152, 5,141,154,148, 55,205,164, 73,147, 56, 0,202, 41,211, 10, 81,166,253, 6, 33, 41, 41, 41,165, 99,199,142, 18,119,
+119,119, 4, 6, 6,194,221,221, 29,169,169,169, 68, 82, 82, 82,138, 19,226, 26,143, 28, 57,114,253,170,117,191,112, 22,166, 84,
+147,187,207,100, 65,171,211, 43, 53, 70,204,115,132,252,173, 93,254,169,169,169, 4,189, 61, 45,228,111,203,221,239,168, 23,160,
+186,186,218,252,253,220,185,115,230, 13, 0,230,204,153, 83,107,223,226,122, 65, 29,226,154, 2,104,109, 82, 10,221, 95, 27,247,
+182,198,210, 19, 64, 91,254,175,244,237,107,217,222, 14, 72,165, 82,141, 35,237, 45,102,212, 0,188, 24,222, 1, 94,221,188, 80,
+112, 44, 23, 16, 10, 48,110,230,191,208,235,157,159, 24, 61,179,193, 96, 68,193,189, 7, 6,218,242,167,145,119, 55,167,161,175,
+150,170, 99, 99,241, 20, 40, 4,176,101,169, 80,166,206,141,164, 0, 35, 89,163, 4, 16, 4,240,235,158,221, 24, 51,118, 60, 2,
+131, 26,153, 59, 64,202,129,119,201,229, 20,161,115,187, 60,243,254,139, 93,220,205,186, 97,143, 78,217,224,114, 28,247, 2, 88,
+187,251,109,157,119,196,250,183,118,247,219, 58,111, 57,151,189, 62, 84, 86, 86,162,170,170, 10, 90,173, 22, 36, 73,162,184,184,
+216,236,254, 87,169, 84,168,174,174,118,104, 8, 96,239,138,207,145,114, 5, 80,228, 0,122, 53,240,211,124,137,217,253,127,254,
+ 2,112,241,222,105,112, 29, 44, 63, 69,225,109,248,251,120, 32,192,223, 3, 47,132,118, 68,246,157, 98,100, 22,148,162,101,128,
+ 15,180, 15,138,144,117, 43,171, 86, 46, 0, 38,229,215, 71,252, 58,250, 73,162,176,119,255, 46,200, 83,119, 97,219,178,185, 24,
+ 55,119, 17, 46,233,129,226,210, 34, 70,229,103, 57,214,255, 94,159,151, 17,221,169, 21,118,237, 61,142, 75,151,114,176,236,114,
+ 58,118, 12,249, 23,176,225, 12, 10, 10,138, 25, 89, 23,205, 53, 2, 24,117, 37,208,233,106, 34,171,131,155,181, 64,135,142, 29,
+ 37,149,162,154, 88, 12, 53,169, 2, 71,171,132, 72,201,197,131,123,245, 43, 0,244, 59,211,104, 52,208,104, 52, 66, 0, 58, 0,
+ 94, 26,141,198,219,122, 74, 96, 3,188, 0,226,212,212, 84,121,199,142, 29,241,246,219,111, 75, 74, 74, 74, 48,118,236, 88, 71,
+ 58,206,126,124, 62,191,218,211,211,211, 48,100,200,144,123,243,231,207,111, 26, 27, 27,155,253,215,133, 75, 35,118, 92,213,222,
+208,147,112,120, 61,214, 71,225,242,119, 37,249, 91, 91,255,180,194, 66,191, 51,166,177, 0,110,110,127,199,168, 44, 91,182,204,
+188,217,218, 7,204, 51,124,234,122, 55,124,211,198, 1,192, 83, 20,222,182,233, 78,167,219,219,133,243, 23,238, 76,156, 56, 49,
+198,145,246,214,255,165, 23, 48,184,111, 40,190,249,114, 41,126, 88,158,136,255,108, 61,142,105,175,246,196,253,223, 19,161, 40,
+175,100,210, 62,136,200,209,175, 65,175, 55, 92,208,235, 13, 6, 75, 5, 0, 0, 22, 45, 92,208, 16, 11,158,181,252,159, 32,108,
+141,253, 91, 43, 1,181, 20, 0, 14,135, 3, 69,181, 10, 92, 14, 1,131,193, 8,146,162, 96, 32,107,130, 72, 51, 46, 94,192,171,
+131,134,213,184,201, 40, 10, 92, 14, 23, 85, 42, 29, 12, 58,173,125,235,127,245,106,113,155,102,247,228, 65,254, 10,179,150,209,
+167,151,167, 41, 70,151, 0, 65, 80,232,222, 49, 75,190,106,245,106,198, 94, 0,218,186,175, 47, 24,208, 41,235,181,158,224, 26,
+ 71,224,231,231,135,226,226, 98, 8, 4, 2, 84, 85, 85, 33, 40, 40,200, 28, 20,168,209,104, 80, 81, 81,225,144, 2, 16,243,205,
+ 14,252, 52, 95, 2,159,214, 64,202, 21,224,163, 37,114,120,242,184, 24,251,241,183,200, 39,239, 35,126,217,167,224,114,152,203,
+163,173,255,240,240, 80, 4,181,109,141, 70, 65,129,224,115, 8, 24, 8, 10,197, 74, 53,202,171, 52, 78,149,223, 15,139,127,195,
+ 27, 29,219,192,219, 59, 0,238, 65, 77,161, 47, 43,199,133, 3,219, 81, 81,150,235, 84, 37,254,101,241,135,192,236,193,224, 25,
+116,104,173, 4,138,184,149,248,233,222, 95, 0,223,155,177,140,243,251,255,144,148,112,212,200,229,171,208,179,157, 4,157,254,
+229,137,108,191, 20,121, 80,208, 5,121,139,222,217, 80,112,170,160,165,212, 80,109, 37, 33,244,244, 98, 98,249, 91,118,240,244,
+ 44, 0,190,171, 26,238,225,195,135, 1, 0,209,209,209,146,184,184,184,148, 49, 99,198,152, 45, 70, 38,228, 31, 20, 20,116,104,
+253,250,245, 30, 50,153,140, 59,123,246,108,204,154, 53,139, 58,115,230, 76,111, 0, 73,106, 3, 58, 2,248,211,209,123,146, 74,
+253,234,116,251, 59, 27, 16,232, 74,242,183, 38,120, 75,133,133,162, 40,194, 20, 24,104,191, 93,228,231,159,161,191,111,219,182,
+205,188, 89, 31,163,225,239,239, 15,169, 84, 90, 87, 39,152, 15,160, 2, 0, 39,191,240, 62,206,158, 61,107, 30,243, 15, 15, 15,
+ 7, 80,179,252,246,206,125,137, 40,175,210,168, 0, 44,156, 15, 74, 29, 0, 0, 32, 0, 73, 68, 65, 84,146, 74,165, 70, 71,218,
+219,239,123,191,192,176,249, 51, 49, 98,196, 32, 4, 10,184,168, 34, 40, 36,101,230,225,236,149, 2,135,136,122,250,164,168,151,
+178,179,178,120,121,119,115, 64,111, 38,242, 7,107,181, 63,155,196,111,125,204, 22,106,197, 0, 8, 4, 2,220,186,118, 73,210,
+186,169,191, 92,228,198,131,209, 72,130, 32, 8, 16, 4, 16, 35,157, 1,138, 34, 97, 52,229, 3, 80,105, 52,184,158,153, 13, 62,
+223,110, 84, 55, 12,250, 50,116,239,116,199,178,199,192, 7,179,239, 96,207,214,246,230,170,213,179,203,109,252,145,209,209, 97,
+235,223, 22,241,171, 21,165, 0,224,148,245,111,171,161,165,197, 47, 6, 0,198,214, 63, 80, 51,207,191,113,227,198,208,106,181,
+120,240,224, 1,140, 70, 35, 2, 3, 3, 81, 90, 90,138,192,192, 64, 83,185, 50, 39,236,226,251, 89,248,252,107, 57, 20, 57,192,
+247,115,251,163,218, 96,196,156, 37, 9,248,113,126, 36,230, 46, 59, 0, 30, 65,192, 1,254,135,162,240, 54,154, 4,250,194, 13,
+110, 48,130,192,189, 59, 87,113,183, 72,129,144, 32,127,252,126,254, 12,174, 95,131,195,214,255,184,201,115,224,230, 15,112,184,
+192,166,196, 59,216,179,250, 19, 76, 94, 44,195,156, 81,221, 48, 99, 80, 43,135,202, 47, 73,169,196, 15,163, 39, 0, 21, 66,128,
+112, 3,126, 88,138,241,127,157,196,145, 65,211, 65,124, 59, 19,196, 31,159, 50,182, 48, 46,222, 11,192,203,106, 5,170, 69, 92,
+168,132, 66,132,140,115,131,150, 82, 67,193,113,131, 1,161,160,140, 42,232, 75,238,225,244, 10, 5,162, 39,134, 32, 69, 46,127,
+236,141, 54, 38, 38,134, 2,128,117,235,214,209,174,126, 98,246,236,154, 97,224,173, 91,183, 50,125,179,125,155, 54,109,122,248,
+219,111,191,245,184,117,235, 22,220,220,220,224,237,237,141, 75,151, 46,233, 1, 20, 55,228,254,234,155,147,239,140,119,192,149,
+228,111,109,253,215, 16,243,195,211, 7, 77,211, 3, 83,236,220,215,173,157, 59,119,246, 97, 58, 60, 39, 20, 10, 39,215,173, 52,
+ 73,171, 6, 14, 28,120, 7, 64,120,230,133, 51,176, 28,243,255, 96,242, 4, 28,110,219, 22, 9, 9, 9, 72, 79, 79,199,161,182,
+109,221, 39, 78,156,184,241,196,137, 19,140,219,219,155,131, 95,134, 15,233, 7, 21,220,176, 39,110, 38, 86, 31,184,136, 79, 94,
+235,135, 73,203,182, 97,252,162, 45,142, 90,224,196,162,133, 11,108, 37, 2,162, 44,148, 0,214,162,127,206, 80,203, 3,240,193,
+ 7, 31, 16, 21,247,178,112, 59,175, 20, 60, 55, 46, 12, 70, 18,122,131, 17,231,207,167,227,127,255,219, 8,157,145,130,222, 72,
+130,207,227,160,168,188, 26, 5,215,207, 74,102,205,154, 85,111,131, 90,189,122,181,184, 99,200,221,191,173,127, 83,189,218,179,
+ 53,180,166, 62,113, 40,128, 67,129,195, 33,209,187,219,117,249,106, 6, 94, 0, 91,214,191,229, 44, 0, 15,255,198, 14,145,191,
+ 45,235,223, 50,170,118,200,236,149, 14,145, 87, 77,167, 88,142,234,234,106,184,185,185,153,173,127,146, 36,205,159,142, 42, 0,
+ 91,226, 22,224,124,193, 9,120, 54,174, 9,250,243,226,113, 81,124, 63, 11,222, 2, 55, 84,148,229,131,203, 33,192,227, 48, 27,
+126,166,173,255, 22,254, 94,184,150,125, 7, 6,157, 14, 2, 30, 31,213,213, 26,252, 46, 63,131,158,146, 8,135,200,159, 46,191,
+215, 63,252, 10,241, 63,253, 8, 21, 9,180, 8,105,142, 43, 87,255,192,156, 81,221,156, 42, 63, 0,152, 19,210, 19,251,111, 29,
+ 7, 20, 6, 64, 24,136,163,105,215, 64,124, 59,147,238,152, 24, 23,222,137,165,217, 41,167,143,166, 1,186, 42, 84, 19, 85, 40,
+231, 84, 67,193,211, 67,111,172,132, 64,163,130,176,240, 14,118,196,222, 66,235,176, 80,212, 21, 0,104, 13,145, 72,100, 73, 2,
+ 16, 10,133, 54,207, 49,197,250,245,235,177,126,253,250, 6, 53,102, 47, 47,175,143,178,178,178, 60,188,189,189, 33, 18,137,224,
+239,239,143,226,226, 98, 16, 4,161,114,101,167, 65, 91,252,145,145,145, 20, 80, 19, 16,232, 72, 80,160,171,201,255,229,151, 95,
+ 22,219, 11,168,101, 26, 11,224,225,225, 17,195,227,241,110, 91, 31, 95,182,108, 89, 45,203, 31, 0, 90,181,106,133,193,131, 7,
+111,178,103,255,228, 23,222,175, 21,237,255,249,255,205,134,128,199, 71,112,112, 48,232,152, 0,211,121, 15, 71,218,219, 20,241,
+139,152,181,244, 71, 84, 61, 40, 66,144,119, 35, 92,189,150,139, 73,203,182, 57,220, 62,172, 8,159,176,250,189,165, 28,214, 19,
+240, 12,224,226,197,139,245, 38, 3,170,211, 3, 0, 0,243,230,205, 75,249,126, 41, 33,161,168,209,242,214, 77, 3,224,229, 46,
+ 64,167, 46, 97,232,212,185, 27,120, 28,160, 90,109, 68,238,189, 50,164,165, 28,148,120,122,184,219,253, 3,165, 74,133,208, 86,
+247,160,209, 10, 77, 89, 91,106,170,145, 72,168, 1, 69, 1,101, 21, 2,128, 0,188, 60, 12,232, 26,154,131,147,231,236,103,177,
+179,180,254, 45, 45,126,145, 79, 0,220, 40, 61, 96,248,187,191, 51,242,236,223,163,165,245,111,105,241,211,199,178,174, 94, 48,
+ 95,203, 36,203,158,165, 18, 0, 0,141, 27,215, 40, 35,101,101,101,240,246,246, 54,187,255, 29, 81, 0,104, 37, 0,248, 22,211,
+ 35, 7, 2, 63,157,196,234,127, 71, 96,252,220, 31,177,109,241, 12,240, 8, 2,124, 1,179, 25, 59,180,245,127, 45,183, 8,237,
+ 90, 4, 98,195,207, 59,208,186,117,107,248, 52, 13, 65,183,166, 33,208,107,255,118,255,187, 49,144, 73, 91,255, 95, 79, 30,132,
+143, 22,110, 66,139,182, 68,131,202,143,182,254,135,238,253, 5, 71,162,163, 64, 52,239, 13,160, 38, 43, 32, 0,220, 81, 42,205,
+ 74, 98, 38,152, 37,240, 89, 53,233, 54, 49,112, 30, 37, 14, 25, 91, 37,111,221,190, 11, 42, 69,192, 29,220, 69, 85, 78, 49,138,
+ 23, 25, 81, 93,222, 28, 55, 78,103, 50,126, 33, 36, 73, 18, 34,145,136, 82,171,213,176,176, 60, 41,145, 72, 4,146, 36,137, 39,
+209, 89, 86, 85, 85,125, 63, 99,198,140,209,235,215,175, 23,250,248,248, 64, 46,151, 99,249,242,229,149, 58,157,238, 53, 87,254,
+ 15,109,241,211,211,229, 28, 13, 4, 76, 72, 72, 32, 76, 73,126, 26, 76,254, 0, 96, 65,236,118,203,220, 94,134, 65,169, 84,170,
+147,201,100,189,119,237,218,117, 73,169, 84, 54,209,235,107,166,153, 90,147,127,167, 78,157,208,187,119,239,145, 82,169,212,222,
+127,242, 20,133,183,241,205, 23,159,227,215,253,135, 48,172, 95, 15, 28, 75,254,163,198,128,105, 26, 2,159,166, 33, 8,207,206,
+198,107,227,222, 46,201, 45, 85, 13, 5,176,155,169,245, 63,107,221,126,196,190, 63, 20, 77, 27,139,205,202,133,117, 57, 52, 48,
+155, 34,235, 9,120,142,148, 2, 70, 10, 0, 0,124, 50,111,110,202,247,223,147,146, 59,205, 95, 64,219,246, 29,229,222, 30, 34,
+144, 20,160,214,234,144,157,157,141,226,236,139, 18, 47, 79, 15, 76,159, 62,221,110,195, 21, 9,133,216,117,120,160,132,142,128,
+175,215, 29,193,225,192,195,131,185,245, 68, 79, 1,244,240,111, 12,210,168,175, 33,127, 19,244,132,155,221, 20,187,214,160,167,
+212, 12,153,189,178, 22,105, 57, 67,254,150, 74,128,101,226,159,178,178, 50,251, 47,192,142, 18,176,197, 98,150,240,250, 69, 31,
+252,189,163,175,134, 39, 67, 57, 45,252,189,176,235,220, 69, 92,185,113, 19, 61, 37, 17,181, 72,223, 17,242,167,241,250,135, 95,
+ 97, 79, 15, 15,124, 56,166,131, 75,202,111, 78, 72, 79,204,221,183, 11,196, 55, 11,113, 40,248,101, 44,175,190, 82,235,252, 88,
+ 31, 95, 44, 86, 84, 56, 68, 28, 39,150,102,167,248,241,134, 32,191,252, 54,138, 75,239,225, 65,166, 39,184, 70,111,244,125,177,
+ 63,118,156,222,241, 68, 59, 53, 23,101,251, 59,183,113,227,198, 33, 4, 65, 28,253,241,199, 31,133,111,188,241, 70,165, 74,165,
+ 26, 10, 39,198,252,235,131, 43,166, 0, 74,165,126, 46, 33,127, 27, 86,170, 61,229,131,193,189, 73, 75,100, 50, 89, 72, 85, 85,
+213, 55,233,233,233,179, 11, 10, 10,160, 84, 42,193,231,243,209,164, 73, 19, 4, 5, 5,189, 33,147,201,126,223,178,133,209,146,
+ 0,215, 1,132,183,240,247,194, 43,175,188,130,139,183, 10, 16,216,166,115,173,246,246,218,184,183, 85, 0, 86,124, 19, 59,123,
+ 55,211,231,152, 34,126, 17, 67,146,255, 68,244,194,255, 97,192,128, 1, 8, 14, 14,182,169,104,185,240,181, 19, 78,144, 63, 85,
+207,113, 86,137,120, 2,164,207, 40, 21, 48, 0,124,242,201, 39, 41,171, 86,173, 18,159, 79,201,148, 0, 53,145,180, 20, 69, 65,
+ 32, 16,224,211, 79,230, 49,110,180, 31, 58,152,230,151, 41,104, 87, 63,215,160, 2, 12, 42,115, 4, 60, 77,252,142,206,197,162,
+ 93,253, 89, 87, 47, 32,235,234, 5, 4, 5, 5,161,184,184,216, 41,226,247, 9,106, 10, 29,131,224, 72,166,136,254,106, 11,206,
+156,116, 93, 49,230,228,228,152, 87,251,211,107, 53, 15,145,191, 35,196, 79,227, 95, 61, 60, 92, 86,126, 0, 64,196,125,106, 38,
+126,154,252,239, 40,149,146,177, 62,190, 72, 2, 82, 22, 43, 42,156,122,246,223, 22, 31,181,232,120,212, 0,128, 29, 87,153, 39,
+236,161, 40,138, 16, 8, 4,102, 47, 0,253, 29, 0, 4, 2, 1, 97,235,251, 99,198,169, 95,126,249,101,192,238,221,187,231, 84,
+ 86, 86,198, 1, 72,115,245, 31,184, 98,234,159,139,201,201,229,144, 74,165,106, 0,115, 76, 91,131,222,199,229,203,151,251, 2,
+104, 19,216,166,179, 74,175,213,184,155,218, 91, 37, 0, 5,128,235, 45, 3,220,223,148, 74,165, 14, 85,232, 33,159,175,127, 92,
+196,239,148,162,229,228,245, 44, 92,128,176,176, 48, 70,228,111,215, 0,109,232, 74,125,143, 2,244,216, 62, 77,252,104, 32,241,
+211, 99,211,138,162,124, 40,138,242, 17, 20, 20,212, 32,139, 31, 0, 12, 70,210, 97,239, 67,125, 40, 42, 83, 56,125, 47,214,160,
+199,246, 93, 69,252,143,160,252, 8, 0, 24,230,225, 65, 89, 90,253,221,121,110, 13, 34,254,127, 24,254,170,172,172,140, 98,139,
+225,201,227,196,137, 19, 50,153, 76,246,191,220, 82,149, 74,175,213, 88,142, 71,122,183, 12,112,247,115, 98,245, 63, 2,168, 25,
+202,120,214,148, 42, 22,143, 87, 9, 96, 84,153,156, 93, 71,152, 5, 11, 22, 44, 88,176, 96,241,236,130,195, 22, 1, 11, 22, 44,
+ 88,176, 96,193, 42, 0, 44, 88,176, 96,193,130, 5, 11, 86, 1, 96,193,130, 5, 11, 22, 44, 88,176, 10, 0, 11, 22, 44, 88,176,
+ 96,193,226,185, 64,173, 89, 0, 23, 47, 94,116, 58,138,212, 86, 48, 33, 43,143,149,231, 42,121,166,181,213, 57, 0, 72, 91,201,
+ 87,216,242,171, 91, 94, 88, 88, 24, 93,118,244, 92,110,234,226,197,139, 36, 91,126,172,188,103, 73, 94,120,120, 56, 47, 61, 61,
+221, 0, 0,189,122,245,162,218,183,111,143,248,248,120,130, 45, 63,219,242, 28, 86, 0,158, 19, 52, 40,201, 68,100,100,164, 24,
+128,101,202, 80, 73, 66, 66, 66, 10,171, 43, 62, 25,124,247,221,119,239, 92,190,124,185,219,217,179,103,231, 10, 4, 2,168, 84,
+170, 79,101, 50,217, 82, 6, 25,216, 88,252,221,177, 80, 0,140,108, 73, 60,221,136,136,136, 16, 31, 60,120, 48,197,201,223, 74,
+ 18, 19, 19,143,187, 40,161, 20, 34, 34, 34,222, 76, 76, 76,220,177,118,237, 90,127, 0, 85, 0,140, 79,186,205,209,228, 31, 29,
+ 29, 77,109,221,186, 21, 61,123,246,100, 43, 77, 3,241, 92, 13, 1,152,200,187, 65,191,223,181,107,151,117,190,112,121, 67,228,
+ 70, 70, 70,138, 77,115,118,169,200,200, 72,202, 81, 89,148,131,176, 53, 63,184,129,242,196, 79,226, 93,202,100, 50, 98,230,204,
+153, 75,175, 94,189,250, 83,171, 86,173,230, 10,133, 66,104,181, 90, 0,248,110,207,158, 61,228,152, 49, 99, 36, 79,168,201, 80,
+142,111,143, 83, 94,157,107,176, 91,174,197,238,212,250,236,145,145,145, 98,138,162, 40,234, 63,182,101,211,231,236,213, 65, 91,
+200,201,201,161,114,114,114, 92, 70, 48,101,101,131,107,173, 87,224,106,162, 38, 8,194, 33,185, 36, 73, 81, 70, 35, 69,145,164,
+237, 45, 34, 34, 66,156,152,152,232,212, 42, 84,235,214,173,123,245,208,161, 67,199, 7, 14, 28, 8,130, 32,168,237,219,183, 15,
+118,244,222,172,183, 67,135, 14,237,120,171, 15, 31,210,105,210,178,219,158,217,187,167, 78,141, 33,233,115,246,228, 41,149, 74,
+ 74,169, 84,214, 91, 15,233,107,156,125, 63, 55,206, 73,144,188, 46, 3,225,225,225,172, 33,192,220, 16,120, 40, 65, 16,207, 78,
+131,183,153, 55,219, 94, 62,237, 39,136, 6, 45,227,182,107,215, 46,249,132, 9, 19, 0,212, 36,213,176,168,156,114,103,188, 10,
+180, 66, 65,231,252, 55,165, 33,149, 71, 70, 70, 58,230, 85, 72,240,119,224, 95,237,183,125,229,168, 15,152,139,115,124, 93,155,
+186, 26, 36,227,242,147,201,100,132, 66,161,216,217,165, 75,151,113, 0, 56, 20, 69, 65, 36, 18,161,168,168, 8, 21, 21, 21,240,
+241,241, 65, 81, 81,209,241, 49, 99,198, 72,246,238,221,155,226,224, 59,161,232,116,176, 4, 65, 96,220,184,113, 24, 60,120,176,
+100,218,180,105,140,229,236,219,247,155,249,251,232,209,111,216,221,183, 7,245,153, 15,255, 46,238, 62, 43,107,237, 91, 31, 19,
+245,177,191,168, 18,189,156,176, 37, 82, 83, 83,177,104,209,162,135,222, 69,255,254,253,169,147, 39, 79, 50,170,203, 9, 9, 9,
+114, 44, 36,232,253,135, 19,207, 44, 36, 26,220, 25, 63,197,125, 75, 45, 75, 91, 38,147, 73, 98, 98, 98, 48, 96,192, 0,234,212,
+169, 83,140,126,123,166,142,156,140,123, 19,230, 34, 49, 49, 81, 78, 47, 18, 54, 96,192, 0,170,178,178,178, 62,194, 23,199,196,
+196,152,235,235,239,191,255,238, 78, 16, 4,162,162,162, 30, 0, 8,158, 56,113,226, 81,153, 76,198,113,196, 98, 95,122,116,169,
+249,251,253,164,123, 32, 8, 2,219, 62,118, 7, 64,224,251,183,191,123, 61, 48, 48, 16, 0,176,125,243, 54,198,101, 21, 30, 30,
+142,182,109,219,186,164,220,195,195,195, 57,233,233,233,100,175, 94,189,168,173, 91,183,226, 65,102,107,160,196,143,101,117, 7,
+200,223, 81, 15, 0,149,144,144,240,144,134,101,209,129, 82, 78, 52,110,151, 90,147,214,242, 18, 18, 18, 44, 23,196,112, 24, 4,
+ 65, 16, 9, 9, 9, 4,221, 1,153, 62,157,182, 52,105,242, 55,221, 19, 97,113,111, 14, 43, 42,196,132,114,243,198,228,184, 61,
+120, 30, 88, 99,222,152, 28,119,132,252, 41,138, 2,189, 58, 27, 69, 57, 86, 77,100, 50, 25,167,188,188,252,127, 62, 62, 62,227,
+ 0,112, 38, 79,158,140,232,232,104,240,249,124,136, 68, 34, 8,133, 66, 16, 4, 1, 46,151, 11,133, 66,193,184, 28,135, 12, 25,
+ 34, 6, 64,237,222,189, 27,244, 59,161, 40, 10,123,246,236,193,180,105,211,228,166,243, 79, 29,108, 41, 4, 79,194,179,150,144,
+144, 32, 7, 64,188,121, 99, 2, 38, 92,183,217,198,168, 9,215, 35, 37,196,151, 78,181, 59,234,147, 79, 62, 65,155, 54,109, 92,
+114,191, 4, 65, 80, 82,169, 31, 2, 2,142,185,180, 28,134, 15, 31, 62, 40, 57, 57,249, 56, 69, 81, 68, 76, 76, 76,138, 35,228,
+ 95, 23,246, 38,204, 69, 92, 92, 28, 72,146,196,220,185,115, 25, 41, 20,150,228, 15, 0,135, 14, 29,218, 63, 96,192, 0, 0,240,
+139,138,138, 50, 12, 28, 56, 16, 82,169,148, 52,197,205, 48,241, 50,214,218, 95,190,124, 57,222,124,165,198, 54,220,246,177, 8,
+111,245,225,227,211, 97,159, 48,126, 38, 15, 15, 15, 12, 24, 48, 0,233,233,233,230,254,212,122,163,175, 97,170,236,165,167,167,
+147, 64,205, 50,235, 0,224,237, 94,194,178,122, 3,201,191, 94, 5,128, 38,171,244,244,116,115,218, 73, 75,235,201, 81,162,181,
+232, 68, 92,221, 41, 89, 43, 3, 46,117, 13,219, 24, 18,112, 24,150, 10,133,201,250,127, 30,235, 25,101,217,153, 20, 20, 20,152,
+ 79,228,231,231, 51, 86, 24, 21, 10,197,183, 42,149,234,109, 14,135,195,153, 56,113, 34, 20, 10, 5, 10, 11, 11,225,230,230, 6,
+ 30,143, 7, 30,143, 7, 55, 55, 55,136, 68, 34,168,213,106, 48,113, 33,174, 93,187, 86,124,244,232, 81, 57, 65, 16, 24, 63,126,
+ 60, 40,138,162,149, 60, 98,252,248,241, 0,128,228,228,100, 57,219, 85,212, 79,254,166,247, 43,177, 84,146,233,119,111,233,213,
+114,198,130, 79, 72, 72, 32, 76,239, 5,107,215,174,117,137, 50,182, 96,193, 2,218, 40,104,176,103, 98,216,176, 97, 67,206,157,
+ 59,151,220,186,117,107,180,107,215,142,234,219,183,175,217,115, 98, 90,253,209, 41,242, 95,182,108, 25, 8,130, 0,135,195,193,
+185,115,231,192,196, 27, 99,229,145,120,157, 32, 8,188,245,214, 91, 6,211, 33, 93, 84, 84, 84,165, 88, 44,198,180,105,211,200,
+ 17, 35, 70,216,125,118,203, 85, 73,239, 39,221, 3, 8, 32,254,163,191,179, 22,111,251,216, 29, 81,125, 5,152,255,218,167,140,
+239,139,137,229,207,228,154,232,232,104, 42, 60, 60,220,188,157, 59,119, 14,213,185,225,128, 78, 13,194,211,128,228,175,175,195,
+242, 60,189,177, 45,183, 54,249,199,204, 95,108,243, 60,175,190, 6, 25, 30, 30, 78,165,167,167,131,246, 4,208,196, 21, 30, 30,
+238, 80, 35,127,212,228,111,105, 85, 63,237, 1,123,150, 67, 2,207,157, 6, 64, 81, 40, 40, 40,192,253,251,247,205,199,172,247,
+237, 88,255,220,195,135, 15,143, 8, 13, 13, 5,151,203, 69, 86, 86, 22, 40,138,194,205,155, 55,161,211,233, 64, 16, 4,120, 60,
+ 30, 8,130,128,209,104,132, 74,165,194,222,189,123,237,202, 61,118,236,152, 28, 0,198,143, 31,255, 80,189,165,135,122,104,162,
+ 96, 82,175,173,221,250,246,246,153, 88,249, 52,234, 26, 14, 96,226,250,183, 70,106,106, 42, 76,150, 97,195, 20,224,133, 4,136,
+ 47,107, 20, 56, 75,229,149,162, 40, 96, 33,129, 9,215, 35,157, 14,148, 37, 8,130, 50,189, 23, 51, 25,153,222, 23,209, 16,121,
+237,219,183,127,136,220,156,133, 64, 32,160,174, 94,189,138,226,226, 98,162,184,184, 24, 97, 97, 97, 84, 78, 78, 14,184, 92, 46,
+ 12, 6,131, 83,127, 48,176, 47,151, 86, 30, 48,111,222, 60, 44, 95,190, 28, 39, 79,158, 4, 65, 16, 24, 53,122, 42,238,230, 48,
+ 91,192,241,208,161, 67,191,153,222,177, 6, 0,105,218, 16, 21, 21, 85, 1,192, 55, 49, 49, 17, 17, 17, 17, 98, 75,133,188, 62,
+212, 88,255, 15,175, 99, 82, 51, 28, 0,108,223,118,193, 33,121, 13,197,141, 27, 55,112,238,220,185, 90,199,140, 21,119, 96,208,
+147, 0, 81, 5,223,215,244, 56,103,181,216, 53, 27, 28,200,140,252,235,245, 0,152,172,127,194,210, 19, 64, 91,254,233,233,233,
+ 13, 33,127,123, 1, 74, 78,201,179,240, 76,136,225, 68,128,211, 35,176,156, 40,139,206,199,124, 63,244, 49, 87, 5, 39, 81,187,
+252,204,155, 43, 80, 61,114,186,121,115,192,242,167,232,206,182,121,243,230,232,217,179,167,185, 17,210,251,214,215,214, 1, 95,
+127,127,255, 46, 90,173, 22,101,101,101, 56,115,230, 12,210,210,210, 80, 92, 92, 12,181, 90, 13,122,140,148,162, 40,232,245,122,
+104,181, 90, 70, 67, 12,116,221,168,139,220, 19, 18, 18, 8,130, 32,192,212, 51,179,111,223,111,230,141,201,190, 61,168,207,124,
+ 88,139,232,233,205,114,223,242, 26,166, 24, 48, 96, 0, 82, 83, 83, 27, 86, 33, 44,198,252, 81, 51,140, 37, 49,145, 51, 65,159,
+ 67, 3, 99,111, 44,223, 11,237, 5,112, 21, 92,225, 5,104,214,172, 25,242,243,243, 9,107,101,215, 89,242,223,155, 48,215, 92,
+135,105,244,235,215, 15, 0,112,226, 52,243,201, 26, 17, 17, 17,195, 76, 99,255,215, 0,168, 76,253, 57,189,153,181,110,166,193,
+133,181,199,254,109, 40, 87, 14,202,115, 5,210,211,211,137,158, 61,123,162,234,218,112,148,159,105,130,138, 83, 34, 80,229, 21,
+ 64, 53,192, 81, 25, 80,121,146, 3,245,159,124, 84,156,105,132,195,219,134,160,103,207,158, 14,241,211, 63, 29, 60, 38,141,147,
+246, 4, 56,106,249,207,159, 63,159, 90,178,100,137,203,110,214,158, 60, 83, 39,229,178,202,201,116, 12,173, 62,210,177,144, 85,
+ 45,149, 74, 61,235, 58,239, 44, 44,199,254, 93,161, 4, 88,142,253, 51, 85, 2,162,163,163,225,225,225, 1, 79, 79, 79,120,121,
+121,193,199,199,135,244,243,243,227, 36, 38, 38,226,157,119,222, 49, 95, 39, 20, 10, 49,116,232, 80,212,163, 4, 4,232,116, 58,
+148,149,149, 65,163,209,192,199,199, 7, 2,129, 0, 6,131, 1, 20, 69,193,104, 52, 66,167,211, 65,175,215,195,104, 52, 58, 20,
+ 95, 96, 10, 90,171,243,188,165, 21,250, 36, 97, 47, 32,208, 81, 52, 84, 9, 32,190,172,123,184,111,194,245, 72, 19,185, 58, 41,
+219,202,250,183, 56,142,241,227,199, 59, 28, 12,104,109,253, 91,202,115, 22,225,225,225,148,209,104, 68, 88, 88, 24,117,241,226,
+ 69, 34, 44, 44,140,210,235,245, 80, 40, 20, 13, 33,181,154,206,151,199,195,236,217,179,113,238,220, 57,252, 61,238,207,188, 78,
+ 31, 62,124,248,112,255,254,253, 1,192,203, 68,250, 42, 0,216,177, 99, 71,163, 19, 39, 78,120,155,218, 7, 97,250,180, 43,120,
+249,143,203,241, 86,239,135,173,255,232,159, 84,216,113, 70, 15,138,162,208,125, 98,119, 92,216,118,129,120,156,198, 85,122,122,
+ 58, 33,249, 87, 56,117,120,121, 43,240,170, 43, 1, 67,205, 95,147, 0,248, 60,160,224,190, 47,142,231,134, 27,215,109, 47,230,
+166,167,167, 19,225,225,225, 66, 58, 86,128,181,254, 23,215,123,157,221,105,128,145,145,145, 20, 93, 97, 45,227, 1,152, 96,201,
+146, 37,180,197,224, 18, 48,144,231,244,248,186,105,138, 94,173, 45, 57, 57,153,164,103, 5, 52,212, 98,143,137,137,241,124,158,
+ 43,220,186,117,235,176,108,217,178, 90,245,138, 38,255,209,163, 71, 99,244,232,209, 53, 22,206,137, 19,245,137,241,207,206,206,
+214, 24,141, 70,148,151,151,163,164,164, 4,229,229,229, 80,169, 84, 80,169, 84,168,174,174, 70,101,101, 37, 20, 10, 5,212,106,
+ 53,180, 90, 45,152, 52,116,130, 32,176,123,247,110,135, 20,182,103, 25,169,169,169,181, 54, 75,204,158, 61, 91,108,185,207,100,
+204,217,198,152,127, 45,203,189, 33, 81,251,182,126, 75, 81, 20,177,123,247,110,151,198, 2,236,222,189,219,225, 54,220,163, 71,
+ 15,202,104, 52,154, 19,180,132,133,133, 81, 36, 73,226,193,131, 7, 80, 42,149, 78, 61,243,191,231, 15,196,137, 19, 39, 64,238,
+244, 5, 69, 81,136,139,139, 51,191,163,212, 51, 36,152,142,124, 68, 68, 68,188, 1, 0, 81, 81, 81, 5, 38, 5, 64,187,125,123,
+124,163,233,211,167, 55, 58,113,226, 4,134, 15, 31, 62,196,145,156, 0,247,147,238,129, 0,129,120, 11,235,127,226,143, 42,112,
+223, 82, 96,251, 25, 29,102,205,154,133, 37,135,191,123,236,117, 57, 60, 60,156, 75, 43, 1,175,205, 50,128, 82,251, 0,149, 0,
+ 42, 1,110, 21, 80,249, 0, 56,116,161, 9, 44,200,159,151,158,158,174, 97,201,223, 62,249,219,245, 0, 88,143,251, 91,198, 3,
+ 48,117,179, 36, 36, 36,164,152, 2,132,228, 86,158, 36,103, 59,140,135,228,209,195, 2,166,113, 72,151,184,127, 6, 15, 30,124,
+ 37, 57, 57,185,203,211,248,130,105,171,223, 85,110,127,218,234,119,192,237, 95, 11,241,241,241,230,239,255,253,239,127,177,113,
+227, 70, 0,208, 1,224,211,196, 15, 0, 67,135, 14,181,167, 0,168, 67, 67, 67,161, 82,169,160,211,233, 80, 92, 92, 12,129, 64,
+ 0, 30,143,103,246, 0, 40,149, 74,168, 84, 42,104,181, 90, 40, 20, 10,140, 27, 55, 78,178,103,207,158,122,239,143,182, 50,237,
+ 76,107,197,248,241,227,237, 42, 10, 53, 10,205,163,139, 1,112,230,188, 53, 44,166,251, 61,132,184,184, 56,249,236,217,179, 37,
+113,113,113, 41, 79,180, 14,215, 97,253, 91,194,145, 88,128,186,172,127,103,209,163, 71, 15,234,252,249,243, 68, 88, 88,216, 23,
+116,213, 54, 26,141, 11, 61, 60, 60, 80, 82, 82,226, 84, 31,243,249,103, 3,145,146,146, 2, 98,119, 0, 0,224,200,231, 94, 24,
+250,117, 21, 6, 12, 24,128,111,150,156, 0, 69, 81,140,189, 21,135, 14, 29,218, 59,112,224, 64, 0, 40,222,177, 99, 91,179, 19,
+ 39, 78,250, 82, 4,133, 17,195, 71,140, 62,120,240,224,254,131, 7, 15, 58,228,229, 92,190,124, 57,222,234,227, 86,219,226, 7,
+133,217,179,102, 35,120,104, 99, 60,169,184,165,244,244,244, 90, 26, 62, 85, 5, 8,116, 0, 73, 17, 48, 24, 41, 8, 40, 32, 88,
+196,177,188,222, 0, 22, 53, 70,217,146,207,234, 84, 16,194,194,194,234, 87, 0, 44, 35,254, 77,228,111, 14,150,162, 61, 1, 76,
+ 53,127, 27,164,221, 32,216,144,231,242, 49,169,152,152,152, 46,201,201,201,174,236,240,158,215,122, 70,160, 38, 10,220,108, 73,
+191,247,222,123, 0,192,183,168, 75,230,115,166, 78,171, 46, 92,237,221,187,247, 59, 41, 41, 41, 9, 70,163, 17,149,149,149,208,
+235,245,230,113,127,141, 70, 99,158, 98, 72, 7, 6,238,217,179, 39,133, 65,125, 33, 96,154, 2,104, 93,111, 35, 35, 35, 41,154,
+244, 7, 15, 30, 44, 97,162, 0, 60,170, 60, 0,150, 99,255,150,228,111, 61, 44,192,224,125,212, 7, 42, 46, 46, 78,254,230,155,
+111, 98,231,206,157,206,122,203,196,150,158, 19,122,159, 14, 24,156,112, 61,146,186,117,235, 86,157,191,167, 19,254, 28, 62,124,
+184, 78,143,221,157, 59,119, 24,123,102,202,202, 6, 83, 0, 48,100, 72, 54,178,179,179,109, 70,151,151,150, 14, 2, 80, 14,192,
+126,191,213,169, 83, 39,234,252,249,243,132,169,179,252, 2, 0, 56, 28,206,194,187,119,239,162,188,188,220,169,134,204,225, 16,
+ 53, 10, 59, 77,254,151, 12,216, 40,215, 1, 0,190, 89,114,194,225, 62,130,110, 19,211,167, 79, 15,163, 40, 10, 17, 35, 35,198,
+ 29,216,127,224, 87,166,196,111, 41,234,141, 49,175, 95, 35, 8,162, 19, 69, 1,220,183, 20,160, 40, 10,179,231,204, 70,227,161,
+ 77, 26,152, 87,181,102, 90, 47, 93,239, 26,146, 73, 48, 60, 60,156,218,245, 89, 83,120,150,222,193,237,202,230,104, 35, 40, 6,
+ 60,130,193, 83, 62,128,183,178, 20, 64, 35,179,199,192, 90,105, 96,225,132, 7,192,114,186,159,213, 52, 54, 42, 33, 33,193, 97,
+151,169, 5,105,187,228,198, 45,229,209,243,255,159,211,233,117,207, 4,172,202,190,214, 20,177, 58,206, 61,212, 25, 72,165, 82,
+131, 76, 38,219, 51,112,224,192,153,137,137,137, 43, 12, 6, 3, 42, 42, 42,204, 49, 0, 0, 80, 92, 92,140,138,138, 10, 80, 20,
+ 5, 71,234,211,144, 33, 67, 36, 71,143, 30,149, 39, 36, 36,212,178, 62,233,223, 15, 25, 50,196,161,100, 64,143, 2,234, 51, 31,
+ 58, 67,248, 15, 17,188,157, 46,155, 32, 8,130,114,134,252, 77,158,182, 20, 91,109, 17, 0, 44,130, 2, 25, 97,218,180,105,114,
+ 6,255, 73, 57, 48, 87,188,214,103,109, 34, 98,150, 28,175, 77,155, 54,212,181,107,215,104,151,255, 23, 0, 22,106,181, 90,220,
+190,125, 27, 10,133,194, 89, 42,164,200,157,126, 56,114,169,198, 56,221, 36,215, 97,199, 25, 29, 40,138,194,201,179,206,143, 44,
+166,166,166, 98,248,240,225,146,131, 7, 15,166, 28,216,127,192, 89, 49, 28,146, 36,221, 0, 96,231, 89, 61,102,205,154,133,198,
+195,154, 48, 87, 39,109, 64,169, 84, 2, 0,178,179,179,169,117,235,214,153, 21, 50,203, 88,146, 77,155, 54, 89,246, 15,140,254,
+165, 21, 71, 9, 4,133,225,157,245, 10, 0,193, 53,101, 48, 35, 16, 45,121,121,248,122,112, 17, 54,183,127,139,218,177, 99,199,
+ 63, 62, 0,144,182,238,109, 89,254,214,231,235, 27, 2, 32, 76, 67, 0, 15, 77,155,114,100, 8,192,102, 71,225, 58,210,177,148,
+231,210,249,255,244,216,191,179,176,167,144, 56,170,176,212,229,238,119,118, 24,160, 46,119,191,147,195, 0,150, 65, 65,132, 3,
+231, 96, 67, 9,160, 0,172,148,201,100,107,227,227,227,245,124, 62, 31, 90,173, 22, 6,131, 1, 36, 73,194,215,215, 23,229,229,
+229,112, 52,155,226,209,163, 71, 83, 80, 51,239,159,218,189,123, 55, 76,138,128,121,106,224,209,163, 71,255, 17,157,195,155,111,
+190, 73, 41,149, 74, 28, 56,112,192,209,250, 44,182, 83,222,212,132,235,145, 18, 38,222,184, 79, 62,249,228, 33,227,194, 26,159,
+126,250, 41,197, 52,200, 83, 42,245,179, 43, 79, 42,245, 99, 36, 76, 36, 18,209,157, 36, 69, 81, 20, 84, 42, 21, 10, 11, 11,157,
+ 30,243,183,196,176,175,171,106,237, 55,132,252,141, 70, 35, 1, 0, 78, 88,252,214, 32,247,253,190,191,189,101, 38, 64, 87,161,
+ 62,133,204, 66, 1, 96,100,253, 75,199,135, 20,254,146,137,166,178,221,183,107, 69,249, 15, 88, 21, 78, 29,159,246, 2,110, 61,
+ 16,161, 62,175, 19, 11, 7, 61, 0,166, 23, 71, 56,114,252, 9, 91,160, 41, 79,217,253, 16, 14, 88,204,118, 20,145,193, 46,187,
+175, 9, 19, 38, 72,156, 72,239, 91,175,133,102,195, 2,173,207, 58,101, 20, 52, 38,149, 74, 13, 0,136,113,227,198,137,115,115,
+115,229,106,181, 26, 70,163, 17,157, 58,117,146,244,236,217,211,233,247,189,123,247,110,203, 41,103, 78,121,141, 30,117, 12,128,
+189,125, 38,250,162, 41, 58,188, 54,225,156, 60,233,176,219,223, 52,215,159,154,112,253, 97, 5,142,162, 40,138,206, 17, 96,161,
+144,153, 3,230,156,109, 27, 0,176,107,215, 46,194, 85,109,141,233, 53, 0, 80, 86, 86,134, 54,109,218, 80,149,149,149,104,213,
+170, 21, 50, 50, 50, 92,210,215,113,222, 44, 7, 65, 16, 24,253,122, 12,237,134,193,210, 37,211,204,223, 29,205,152,233, 42, 72,
+165, 82,114,237,137,181, 46,149, 57,105,210, 36,147,215, 69,230, 9,192, 96,218, 40,169, 84, 74, 90, 92,227,208, 3,203,118,223,
+110,106,201, 61,180,171, 63, 61, 61,157,144, 30,123,139, 98,201,255, 17, 40, 0,207, 16, 26,220, 72,159,214,252,227,174,190,175,
+ 71,224,133,121,164,229,102, 26,227, 55,255,199,245,235,215,159,240, 27, 33,137,167, 91, 94, 77, 89, 57,154, 81,174, 78, 44,172,
+181,142, 5,101,235,156,201,242, 78,121, 30, 58,146,251,247,239,155,223, 71,118,118,182,203,222,137, 76,182,150,146, 74,167, 17,
+191,255, 38, 99,244, 3,103,151,119,117, 6,166,105,125, 46,239, 19,234, 83,174, 29,236, 55, 60, 80, 19, 83,164,183, 48, 66,205,
+227,252,172,219, 31, 76,235,212,195, 21,243,113, 86, 52, 22, 44, 88,176, 96,193,130,197,211, 1, 14, 91, 4, 44, 88,176, 96,193,
+130, 5,171, 0,176, 96,193,130, 5, 11, 22, 44, 88, 5,128, 5, 11, 22, 44, 88,176, 96,193, 42, 0, 44, 88,176, 96,193,130, 5,
+139,231, 2,181,102, 1,208, 57,175,157,129,173, 96, 66, 86, 30, 43,143,149,247,248,228,197,198,198,214,214,238, 57, 28,115,118,
+ 57,203,169,102,116, 54, 69,203,169,103,182,210, 7,123,122,122, 66, 40, 20,154,127,207,225,112,192,229,114, 31,146, 71, 47,204,
+ 68,146, 53,179,188,234, 90, 44,135,125,191,117, 67, 38, 91, 39,230,242, 4,160, 72, 3,166, 78,125, 63,197, 25,121,107,215,174,
+149,100,100,100,240,194,194,194,146,173,179,238, 57, 41, 79,156,145,145,129, 53,107,214,164,176,237,237,217,147,231,176, 2,240,
+ 79, 68, 96,224,251,181, 10,174,164,100, 3,241, 84,201,123, 63,144, 2,128,146, 13, 37,132,229,247, 6,136,108, 96,114,207, 71,
+ 46,239, 31,139,245, 43,150,137,139,175,156,193, 0,191, 98,121, 51, 67, 30, 50,169, 54, 56,167,244,151,120,135,190,140,153,115,
+230,165,216,251,253,169, 83,167,208,175, 95, 63, 51,241,211,132, 77, 16,196, 67,132, 77,146,164,121,187,123,247,174, 77,121,231,
+207,159, 71,120,120, 56, 68, 34, 17,120, 60, 30,184, 92,110, 45,153, 52,233, 27,141, 70,243,166,213,106,145,158,158,142,118,237,
+218, 61,119,239, 71, 38,147, 17, 82,169,148, 90,187,118,173,248,230,205,155,184,117,235,150,220,215,215, 23, 91,183,110,109, 80,
+253, 95,183,110,189, 88, 32,244,135,175,223, 11,114,101,117,129,100,221,186,159,197,171, 87, 59,150,251, 97,205,154, 53,226,132,
+132,132,227,153,153,153, 56,112,224, 0, 66, 67, 67, 49,119,238, 92,174,229,220,123, 39,228,201,179,111,103,161, 93, 72, 91,240,
+ 5, 2,204,154, 53,251,213,152,152, 24, 57,219, 82,159, 83, 15,192,179,132, 33, 67,134,216,213,120,142, 30, 61,106,183, 97,210,
+ 4,109, 77,220,206,194,213,242, 30, 1, 8, 7, 73,219,110,106, 89, 23,203, 99,242,123,235,255,127,182,137,101,237, 90,241,181,
+ 83, 71,144,187,227,123,185, 74,165,133,254,101, 14, 68,205, 9,180,207,189,132,151,188, 40,121,121,241, 95,104,186,246, 63,146,
+113,211,190,172, 87, 9,184,118,237, 26,184, 92, 46,250,247,239, 15, 30,143,103,222,104,133,128,182,250, 13, 6, 3,140, 70, 35,
+244,122, 61,238,222,189,139,227,199,143,219,148,167, 82,169,112,225,194, 5,244,238,221, 27,124, 62, 31,110,110,110,181,100,146,
+ 36, 9,131,193, 0,131,193, 0,189, 94, 15,181, 90,141, 11, 23, 46,160,186,186,250,105, 32,107,142,169,110,112, 0, 24, 26,146,
+135, 94, 38,147, 17,177,177,177,100,108,108, 44, 2, 2, 2,240,239,127,255, 27,227,199,143, 71, 85, 85, 21, 2, 2, 2,156,202,
+ 64, 26, 16, 16, 96,190,159, 5, 11, 62,195,150,109,233, 16,137, 26,129,203,229,203,171,171,242, 28,150,153,150,150,134,234,234,
+106,244,238,221,251,238,224,193,131,155,148,150,150,226,200,145, 35,198,169, 83,167, 98,253,250,245,245,182, 17,109, 78,214, 67,
+101,115,249,198, 13,164,120,185, 99, 78,220,151,121,221,123,116,105,113, 47,191, 8, 71, 18, 83,142,111,223,190, 99,112, 84,212,
+ 91,199, 88,234,124,250, 65,167,254,181,242, 20, 48, 82, 0,172, 83,183,218,219,127,236,228,255,193, 7, 31,212,123, 77,121,121,
+ 57, 0, 80, 76,148, 0,154,172, 27,106,173, 63, 10,121,150,150,191, 11,172,127, 71, 73,155, 41, 89,187, 90,158,229,181,150,159,
+ 0,128,178,178,154,204,136,254,254,201,207, 69, 67,205,249, 51, 25,237,242,228,242, 60, 21,137,177,237,184,120, 33,200, 0,210,
+159,130,155, 63, 23, 85,165,124,136,170,212,232,152,177, 82,190, 37, 46, 86,242,206,236, 69,117, 42, 1, 4, 65,224,250,245,235,
+224,243,249,120,245,213, 87,205,164,237,230,230, 6, 14,135, 3,138,162,160,215,235, 97, 48, 24,160,213,106,145,151,151, 7,185,
+ 92, 94,231,146,202, 28, 14, 7,122,189, 30, 25, 25, 25,232,223,191, 63, 68, 34, 17, 4, 2,129, 89, 30,173, 0,104,181, 90, 84,
+ 87, 87,227,242,229,203,208,104, 52,230, 97, 2, 38,136,138,138, 18,115,185, 92,121, 85, 85, 21,248,124, 62,138,138,138, 62, 28,
+ 59,118,108,149, 80, 40,220,226, 12,105, 71, 69, 69, 77,224,114,185, 59, 19, 19, 19,105,121,153, 99,199,142,189, 41,147,201,198,
+ 75,165, 82,157, 51,150,112,108,108,172,124,209,162, 69, 69, 48,173, 56, 19, 27, 27,139,107,215,174,161, 81,163, 70, 8, 11, 11,
+195,230,205,155, 29, 38,255, 95, 38, 79,198,136,238,221, 1, 0,141,103,206,132,200, 61, 24,213,149,185,168, 84,220,150,196,196,
+ 76, 73,169, 43,159,123, 93,120,241,197, 23, 81, 84, 84,132, 83,167, 78,181,226,112, 56,184,124,249, 50,252,253,253,145,154,154,
+138,119,223,125,151,202,200,200,168,247,247,165,223,206,169,181,239,169,211,163,169, 65,131, 89,159, 44,108, 17,183,244,191,248,
+126,233,106, 52,227, 24,177,122,233,178,228,119,223,125, 23,246,228,177,120,250,200,159, 62,206,116, 45,128,135,242,127,219,219,
+127,156,112,229, 74,125,207, 2, 44,149,128,199,228, 9,112,212, 82, 39,236, 88,231,206,200,179,245,249, 92, 37,174,250,113,201,
+ 55,226,208,140, 95,228, 69, 92, 35,218,249, 0,173, 90, 82,224,190,200, 7,175,109, 91,240,181, 26,104, 79,231, 65,171,224,129,
+ 75,186, 65,147,188, 69,190,126,213, 82,201,212, 25,182,135, 3,104,247,124, 86, 86, 22,252,252,252, 32,145, 72, 32, 20, 10,193,
+231,243,193,227,241,204, 86,191, 70,163, 65, 97, 97, 33, 78,156, 56, 1, 14,135, 3, 14,135,131,250,228, 25,141, 70, 92,189,122,
+ 21,253,250,245,131,183,183, 55,132, 66, 33,184, 92, 46, 12, 6, 3,116, 58, 29, 42, 43, 43,241,215, 95,127, 65,171,213,130,199,
+227,153, 99, 1,236,161,127,255,254,226, 27, 55,110,200,239,220,185,131,202,202, 74,240,249,124, 52,110,220,120,229,201,147, 39,
+209,167, 79, 31,158, 76, 38,219,232,136, 18,208,191,127,255, 49, 55,110,220,216,105, 37, 47,244,228,201,147,161,125,250,244,217,
+110, 82, 2, 24,201, 91,179,102,141, 88,167,211,225,254,253,251,180,203,219, 92, 72,139, 22, 45, 42,136,141,141,109, 54,126,252,
+248, 87, 63,254,248, 99,135,250,191,245, 63,111, 20,127, 54,127, 94,173, 99,247, 87,172, 64,227, 55,154,227,251,239,127,148, 76,
+158,252,182, 83,253,233,169, 83,167,228,127,254,249, 39, 62,251,236,179, 74, 46,151,235, 45, 20, 10,209,167, 79, 31,200,229,114,
+ 36, 38, 38,162, 89,179,102, 14,180, 60, 2, 91,179,238, 97,207,173, 2,236,251,125, 51,184, 92, 2,115,102,190, 67,118,107, 28,
+200, 89, 55,107, 33,214, 59, 42,143,197, 19, 33,127,107, 37,210,150, 82,224,244, 44,128, 39,189,188,109,126,185,231,118, 0, 0,
+ 32, 0, 73, 68, 65, 84,219,182,109, 37,246,182,199,109,173, 63, 10,121, 46,180,250,153,146,182, 51,100, 13, 75,235,156,182,208,
+ 77,114, 40, 39,229,213,217, 81,251,251, 39, 59,101,253,175, 90,181, 74, 60,101,202, 20,170,174, 99,214,231,234,130,229,245,171,
+ 86,173, 18, 91,159,179, 62, 86,111,121, 93, 61, 47, 47, 44,168, 68, 35, 47, 30,218,122, 81,224, 5,146,224,189,242, 26, 60,186,
+109,129,168,199, 15, 16,248,136,192,175, 86, 67,165, 50,162, 37, 87,133,212,248,186, 83,201,114, 56, 28,240,120, 60,184,185,185,
+225,214,173, 91,184,124,249, 50,188,189,189, 17, 16, 16,128,128,128, 0, 4, 6, 6,194,215,215, 23, 10,133, 2,169,169,169,224,
+114,185,230,177,125, 91,160,207,243,249,124, 24,141, 70,100,102,102,194,221,221, 29,129,129,129,104,212,168, 17,130,130,130,224,
+233,233,137,204,204, 76,232,245,122,243, 16, 65, 93, 10,133,181,229,255,224,193, 3,249,237,219,183,209,166, 77, 27, 12, 27, 54,
+ 12,189,122,245,130, 74,165,194,241,227,199,145,145,145,177, 65,163,209,188,237,128,229, 47,121, 80, 84,252,107,246, 61, 5,188,
+218,245, 70,232,176,247,209,172,215,104,148,107, 57, 56,154,124, 12, 25, 25, 25, 99, 53, 26,205, 84,166,228, 95, 89, 89,137, 75,
+151, 46,201, 79,157, 58,133, 23, 95,124, 17,177,177,177,129, 0, 72,147, 7,160, 25, 0, 8,133, 66,198,100,189,254,231,141,226,
+173,241,251,197,254, 1, 93,228,241, 59, 46, 97,242, 47,191, 32,241,194, 5, 36, 94,184,128,198, 51,103, 2, 0,244,122,229, 9,
+103,218,220,235,175,191, 78,237,219,183, 15,227,198,141,187,235,229,229,197,113,119,119, 79, 79, 75, 75,195,169, 83,167, 80, 82,
+ 82,130,208,208, 80,199,148,210, 11,183,176,244,143, 43, 88,191,116,193, 37, 30, 87, 13,142,177, 10,223, 45,255,133,179, 51, 53,
+ 29,133, 28, 30, 94,120,225, 5,150,101,159, 19,240,156, 37,248, 39,181,120,197, 35,179,176,255,217,138,192, 35, 25, 87,111,160,
+171,158,176,115,220, 33,165, 98,233,210,165,226, 99,199,142,201,179,178,178,234, 60,150,150,150,198, 72, 22,125, 93, 90, 90, 26,
+202,202,202,228, 75,151, 46,149,204,155, 87, 99,149,219, 58, 86, 31,188, 53,165, 72,204,213,160, 89, 57, 23,221,189, 9, 4, 21,
+ 3,237,120, 62,224, 16, 1,160, 52, 15,160,124, 64,224,106, 46,137,251, 74, 13,120, 28, 14,186,250, 11,228,117, 61,183,165, 2,
+ 32, 16, 8,112,251,246,109, 52,107,214, 12, 67,134, 12, 1,151,203, 5, 73,146, 40, 45, 45,197,169, 83,167,224,230,230, 6, 62,
+159, 15,157, 78, 87,167, 2, 64,123, 7,104, 37,128,162, 40,100,103,103,163, 93,187,118,240,241,241, 65,117,117, 53, 46, 92,184,
+ 0,163,209, 8,129, 64, 0,173, 86, 11,173, 86, 91,103,223, 65, 7,209, 1, 64,113,113,177, 60, 63, 63, 31,221,186,117,131, 88,
+ 44, 70,243,230,205, 37, 74,165, 18, 65, 65, 65,242,228,228,100,156, 61,123, 22,190,190,190,189,101, 50,217, 54,169, 84,106,119,
+125,247,226,226,226,227, 15,202, 20,240, 15,237,141,182,253,223,132,111,243, 80,104,149, 21,200,253,243, 32,110, 29,219, 76,203,
+ 99,244,126, 77,177, 15,242,194,194, 66, 4, 7, 7, 67, 40, 20, 74, 46, 93,186, 36,143,141,141,229,152, 60, 0, 0,112, 35, 54,
+ 54,150,100, 82, 7,127,222,176, 89,236,235,247,130,220,215,255, 5,112, 56,110,208,235,149,216,176, 81,142,201,239, 73,104,143,
+ 2,166, 78,157,138,160,160, 32,210,209,182,247,206, 59,239, 80,241,241,241,232,223,191, 63,122,244,232,209, 10,128,225,216,177,
+ 99,225, 57, 57, 57, 16,137, 68, 16,137, 68,136,136,136,120,117,215,174, 93,199,153,200,219,118, 51, 15, 63,252,117, 3, 63, 47,
+158, 95,214,252,133, 86, 47, 42,171,203,241,251,161,191,112,233,242, 77,248, 82, 36,248,247, 31, 32,226,195,232,193, 59,119,238,
+250,103,185, 96,159, 33,216, 26, 62,170,203, 43, 80,151,170, 78,140, 31, 63,222,210,130, 38, 34, 35, 35,235,219,127,102, 81, 82,
+178,129,176,220,158, 54,121,192, 35,113,255,215,103,181, 55,232,158,157,181,206, 29,241, 0, 56,138,168,168, 40,241,254,253,251,
+107,145,191,173, 99,206, 32, 43, 43, 11,251,247,239,151, 71, 69, 69,137,235, 59, 86, 39,113,149,228,225,204, 61, 53, 84, 70, 18,
+ 39,243, 72,220, 55,240, 96,212,166,163,252,218, 7,216, 60, 51, 6, 7,142, 40,112,185,148,194,197, 98, 3,174,150, 26, 80, 90,
+120,191, 94,175,156,165, 18, 32, 20, 10,113,247,238, 93,220,184,113, 3, 64, 77, 92,204, 31,127,252, 81,107, 44,191,190,241,122,
+130, 32,204, 94, 0, 90, 30, 69, 81,200,203,203, 67,203,150, 45, 81, 88, 88, 8,146, 36, 33, 20, 10,205,178,234, 27, 82,176, 68,
+110,110, 46, 52, 26, 13,194,195,195,209,188,121,115, 9,151,203,133,183,183, 55, 94,126,249,101,137,167,167, 39,114,115,115, 81,
+ 89, 89,121,153,105, 61,200,205,205, 5,201,225,163, 89,216, 96,248, 54, 15, 5,135,235, 6,145,119, 16, 90,190, 28, 1,190,135,
+ 31, 45, 47,199,158,156,181,107,215,138, 43, 42, 42,228, 5, 5, 5,104,209,162, 5, 36, 18,137,100,203,150, 45, 41,165,165,165,
+ 4, 0,244,238,221,219, 96,186, 52,212,199,199, 7, 50,153,204,110,192,131, 80, 24,128,128,160,110, 48, 26,180, 40,186,151,134,
+251, 5,167, 6,149, 20, 95, 88, 96,146, 7, 0,120,112,255, 62, 76,242,220,152,214, 61,169, 84, 58, 62, 62, 62, 30,209,209,209,
+152, 56,113, 34, 0,144, 71,142, 28,225,237,223,191, 31,147, 39, 79, 30,122,254,252,121,226,244,233,211, 68,108,108, 44,163,200,
+253,204, 74, 21,230,159,184,136,111,231,198,160,255,200,193,254, 70,202,128, 93,191,158,192, 79, 43,183,224,208,236,119,177,190,
+ 91, 75,180,244,225, 97,193,130, 88, 54, 8,240, 25,193,197,139, 23,235, 36,255,122, 61, 0,214, 99,251,246,246,159, 71, 60,130,
+ 41,120, 78,225,235,151,190,150, 76,155, 54,237, 89, 40,239, 90, 67, 10,143, 56, 72,143,209,123,136,136,136, 16,223,186,117, 75,
+174,211,233,234, 61,214, 16,148,151,151, 67,169, 84,202, 35, 34, 34, 36,121,121,121, 15, 29, 59,120,240, 96,157,239, 46,163, 76,
+ 13,133,142, 68, 70,177, 1,133, 21, 6, 4,255,193,195,139,187,178,112, 55,231, 42,110,254,169,131,129,199,133,142, 4, 52, 58,
+ 10,229, 20,137,160,122,150,181,167,167,251,209, 99,247,116,196,254,131, 7, 15,208,170, 85, 43,228,228,228,152, 93,254, 60, 30,
+207,124,189,163,195,121,150, 57, 4,232,207, 71, 52, 36, 88, 1,215,198,124,216, 37,107,146, 36,161, 84, 42,107, 58, 71, 30, 79,
+242,193, 7, 31,212,122,119, 85, 85, 85,188,125,251,246, 97,244,232,209,156,249,243,231, 63, 88,178,100,137,193, 94, 93, 36,136,
+ 26,133, 72,173,122,128,234,170, 60,201,148, 41,239,166,200,100,178, 84, 0,223, 86, 85, 85, 97,223,190,125,102,197,177, 93,187,
+118, 58, 38,117,123,241,226,197,163,191,255,254,251,132,136,136, 8,244,235,215, 15, 0,200,211,167, 79,115,126,251,237, 55,136,
+197,226,145,171, 86,173, 58,234, 72,193,220, 83,105,241, 78,226, 31,152, 53, 33, 2,227,223, 25, 7,149,166, 18,123,247,165, 96,
+249,234,109,248,223,208,151,208,182, 40,159,101,211,231, 64, 25, 96,234, 1,112, 53, 40,171,134,108,111,159,133, 5, 30, 53,249,
+187,208,106,175,203,163,224,236,248,127,125,245,130, 81,125, 57,120,240, 96, 74,251,246,237, 37,126,126,126,245, 30,107, 8,252,
+252,252,208,190,125,251, 90, 68,111,235,152, 45,168,141,222,208, 19,192,185, 18, 45,138,140, 70, 28,203,214, 96, 87,130, 6,199,
+243,131,144,197,247, 65,190, 66,143,188, 42, 18, 74, 3,160, 50, 80, 16, 4, 52,182, 75,204,244,252,126,163,209, 8,131,193,128,
+128,128, 0,120,122,122,162, 85,171, 86,208,235,245,230,227,182, 18, 2, 89,203,163,231,247, 27, 12, 6,168,213,106, 80, 20,133,
+ 22, 45, 90,160,160,160, 0, 77,154, 52, 1,143,199,131, 86,171,133, 78,167, 51,255, 47,147,225,193,150, 45, 91, 66, 40, 20, 34,
+ 61, 61, 29,249,249,249,114,163,209,136,202,202, 74,226,207, 63,255,148, 87, 87, 87,163,101,203,150,240,246,246,126,141,105, 31,
+213,178,101, 75,112, 72, 29, 10, 46, 36,163, 34, 63, 19,164, 81, 15,117,101, 49,114,255, 60, 8,157,178,156,150,215,154,137,114,
+ 67, 35, 32, 32, 64,190,102,205, 26,179, 23,167,180,180,148,184,122,245, 42, 76,164, 77, 2, 8,182,149,240,200, 26, 6,131, 26,
+ 6,125, 53, 68, 30,141, 33, 20,249, 67, 38, 91, 39,150, 74,165,134, 69,139, 22, 5, 88,200,195,250,245,235,161, 80, 40,232, 41,
+140, 15, 97,209,162, 69, 84,223,190,125,169, 30, 61,122, 80, 95,126,249,229,239,163, 71,143,198,200,145, 35, 1, 0,231,207,159,
+175,220,191,127, 63,198,143, 31, 63,250,216,177, 99, 7,153,148,217,162, 69,139,168,126,253,250, 81,111,125,240, 33, 94,221,125,
+ 2,243,254, 53, 22, 31,125, 58, 29, 26, 93, 53,238,220,206,131, 76,182, 11,191,141,234, 3,113,139, 70, 78,183,141,225,195,135,
+179,253,250, 19, 68, 88, 88, 88, 45,210,183, 14, 4,124,172,169,128, 35, 35, 35,197,142,236, 63, 54, 75,191,142, 57,251,214,214,
+ 62, 83,235,191, 46,121,239, 7, 6, 82,239, 7,254,237,206,183,222,183,231,137,112,149,188, 58, 44,105,103,136,250,145,193, 74,
+137,112,218, 3, 0, 0,219,183,111, 79, 25, 53,106,148,196, 50, 57,141,173, 99,206,160, 93,187,118, 24, 53,106,148,100,251,246,
+237, 41,245, 29,171,243,247,237,219,161,189, 7, 23, 94, 4,160,167, 40, 92, 47,215, 33, 62, 75,139,237,103, 10,241,215,237, 50,
+ 20,170,129, 82,141, 17,183,171, 41,220,211, 82,168,214,233, 37,245,145, 23, 61, 53, 79,167,211, 65,173, 86,163, 73,147, 38,232,
+210,165,139, 73,209,243, 71,175, 94,189,204,132, 77,147,118, 93,132, 77, 19,186, 94,175,135, 78,167, 3, 65, 16, 8, 9, 9, 65,
+ 69, 69, 5,242,242,242, 80, 86, 86,134,214,173, 91,131,195,225, 64,167,211, 65,171,213,154,127, 99, 15, 65, 65, 65,146,230,205,
+155,227,234,213,171, 56,124,248, 48, 14, 28, 56, 32, 63,112,224,192,241,147, 39, 79,130,203,229,226,149, 87, 94, 65,219,182,109,
+213, 48, 5,222, 49,144, 55, 58,216,223, 7,165,217, 23,113,243,232, 70, 92, 61,184, 6,215, 15,202,112,247,236,111, 16,112, 72,
+ 90, 94,129, 61, 57, 51,102,204, 72, 9, 14, 14,150,120,123,123, 35, 35, 35, 3,249,249,249,242,184,184, 56,177,165, 34, 96,242,
+ 4,112,226,227,227,209,185,115,103,187,247,166,211, 42,160,168,200,130,155,155, 7,124,253, 59,200, 61, 60,155,225,151, 95,182,
+138, 9,130,211,155,190,198,171, 34, 25,242,255,125,132, 33, 29,170,235,172,219, 7, 15, 30,132, 72, 36, 66,231,206,157,209,186,
+117,107,122,248,192, 80, 94, 94, 94,189,123,247,110,223,176,176,176,209, 59,119,238,220,207,180,238, 38, 38, 30,132,183,183, 39,
+ 6, 12,124, 89, 21,214,227, 69,140,249, 96, 50, 84,132, 1,197, 69,101,152, 54,243, 43, 44,233,217, 14, 61, 26, 57,175, 36, 15,
+ 31, 62,156,250,238,187,239, 88, 37,224, 41, 81, 4,108,225,169, 89, 11,224, 73,207, 42,112,134,128, 29,197,134,146, 26, 5,194,
+146,168,233, 99, 79,131,188,167,213,163, 96,229, 9,160, 28,241, 0,208,152, 55,111, 94,202,160, 65,131, 36,189,122,245,170,243,
+152,229,185,250, 96,121,253,160, 65,131,106, 5,251,217, 58, 86,175,117, 40,240,144,116,109, 18,136,190, 1, 2,188,228,199, 71,
+ 83, 33, 7, 2,138,130, 80,107, 64, 75, 79, 30,202, 41, 10, 87,170, 13,200, 84, 26,208,172, 81, 0, 90,191, 52,176, 78, 89,180,
+213, 79, 79,245,107,217,178, 37,186,117,235,134,242,242,114, 84, 84, 84,160,162,162, 2, 94, 94, 94,232,221,187, 55,116, 58,157,
+ 57, 39, 64, 93,132, 77, 43, 19,122,189, 30, 4, 65, 32, 52, 52, 20,106,181, 26,197,197,197, 40, 42, 42, 66,113,113, 49,148, 74,
+ 37, 66, 67, 67,193,227,241,204,242,234,202, 43, 96,173,148, 5, 7, 7, 75, 66, 66, 66,112,231,206, 29, 36, 37, 37, 33, 45, 45,
+ 13,238,238,238,120,245,213, 87,209,173, 91,183,131, 66,161,112, 14,211,105,123,219,183,111,223, 31,220, 40,232,237,144, 38,190,
+168,190,253, 39, 50,147, 54,160, 32,237,119,248, 9,140, 24, 60,232, 85,116,235,214,109,210,199, 31,127,188,143,137, 44,111,111,
+111,244,232,209, 3, 20, 69,225,204,153, 51, 72, 79, 79,151, 23, 20, 20,200,191,253,246, 91,113,108,108,172,132,206,156,216,179,
+103, 79,164,166,166,218,149, 55,117,234,228, 20, 69,121,150,164,172,248, 50, 4, 66,127, 52,110,250,138, 60,168,113, 47,185,151,
+119,235,131,223, 47,253,105, 20, 45,111,251,199,238,216,113, 90,139,186,148,158,204,204, 76, 4, 6, 6,162, 95,191,126,228, 75,
+ 47,189, 4,149, 74, 5,165, 82,137,149, 43, 87,122,118,232,208,225, 13,185, 92,190,223,145, 54,113,243,102, 38, 90,181,108,142,
+183,222, 26,237,254,249,191,103,161,180, 74,129,146,210, 18,196,124,244, 21,190, 26, 51, 8,131, 90, 6, 55,136,252,151, 47, 95,
+142, 46, 93,186, 96,197,138, 21,172, 18,240, 24, 97, 57,238,111, 15,143, 45, 19,160, 43,103, 21,152,146,251,184, 36, 19,160, 61,
+ 88, 39,226,113,133, 18,224, 74,178,118,181, 60, 87,188,106,184, 32, 61,176,149, 2, 65,212,225,177,112, 8, 51,102,204, 72,177,
+254,157,229,177,159,127,254,153,145, 76,250, 58, 91,215, 51,149, 65, 99,211,246,157, 41,243,223,153, 0, 67, 90, 34,114, 20,128,
+ 39,225,134, 86,158, 28, 20, 24, 9,112, 5, 60,164, 22, 25,161, 33,129, 32, 1, 23, 33, 61, 7,224,227,165,235, 83,234, 83, 0,
+244,122, 61,184, 92, 46,218,180,105,131, 30, 61,122,160,178,178, 18, 26,141,198, 60, 63, 95,167,211,193,223,223, 31,253,250,245,
+195,254,253,251,205, 67, 2,182, 96, 52, 26,205, 89, 4, 59,118,236, 8,147,155, 30, 26,141,198,220,158,105, 79, 66,199,142, 29,
+ 81, 86, 86,134,234,234,234, 58,219,178, 53,153,159, 60,121, 50, 37, 42, 42,234,213,206,157, 59, 31,183, 72, 4, 84,209,191,127,
+255,227, 66,161, 48, 90, 42,149,106, 28, 41,203,147, 39, 79,198, 71, 69, 69, 85,118,238,220,121,159,133,188,146,254,253,251,175,
+252,248,227,143, 25,103,235,153, 62,125,122,202,154, 53,107, 36,195,134, 13,195,157, 59,119,228, 55,110,220, 64,110,110, 46,188,
+188,188,228,190,190,190, 24, 50,100, 8,126,254,249,103,244,236,217,147,241,189,189,255,254, 59, 41, 63,255,188, 73,162,209,148,
+193,215, 47, 84,238,233,213, 2, 94,222, 45,161,172, 42,216,191,120,201, 6, 68,189, 53, 24,219, 63,118, 55,151,147, 45,139,109,
+196,136, 17, 72, 76, 76, 68,126,126, 62,167,172,172, 12, 26,141, 6,169,169,169, 60,147,210, 89,121,250,244,105,135,218, 67, 68,
+196, 8,236,221,187, 31,149, 21,165,200, 47,188,135,143,103,252, 75,247,201,103,139,248, 99, 94,237,131,126,218, 74,192,205, 57,
+122, 24, 62,124, 56,245,197, 23, 95,152,211, 65,135,132,132,224,187,239,190, 3, 0,234,208,161, 67,108,218,240, 39,164, 20, 60,
+ 73, 5,128, 24, 63,126,188,165, 11,141,176,114,247, 19,142,186,255, 93, 65,238,102,146, 47,217, 0,123,217,246, 28, 9,254, 43,
+ 41,217, 0, 75, 87,188, 37, 49, 91,187,236,153,144,118,201,134, 18,151,202,123, 6,240,143,234, 36, 90,247,145, 72, 46,105, 13,
+242,226,227,199,224,102, 80,227, 82, 21,133,228, 42, 3,248, 4,129, 0,138,130,164,137, 47,252, 26, 7, 73,154,191, 44, 6, 54,
+237,180,235, 1,104,221,186, 53,122,245,234, 5,181, 90, 13,189, 94, 15, 62,159,111, 38,108,218, 74, 15, 10, 10, 66,223,190,125,
+145,148,148, 84,175, 7,128,199,227,161, 91,183,110, 32, 8, 2, 42,149,202,236, 93,160,149,118, 58,187, 32, 73,146,232,218,181,
+ 43,254,248,227, 15, 56, 18, 92,185,125,251,118, 57, 0, 66, 38,147, 17, 0, 60, 81,147,109, 47, 87, 42,149,234,157, 41,203,237,
+219,183,239, 55,201,243, 4,224, 15,160, 76, 42,149, 58,156,155,120,250,244,233, 41, 0,176,106,213, 42,137,155,155, 27,178,179,
+179,225,239,239, 47, 7,128,130,130, 2, 12, 31, 62, 28,203,150, 45,115, 72,230,148, 41,147, 82,100,178,117, 98,157, 78, 33, 17,
+ 85,230,200,189,125, 67,224,238,217, 20,238,158, 77,113,228,216, 3, 16,131,234,183,184, 55,111,222, 76, 76,157, 58,149, 42, 43,
+ 43,195,136, 17, 35,116, 1, 1, 1,124,146, 36,145,155,155,235,176, 71, 12, 0, 54,109,218, 76, 72,165, 49,148,247,181,116,204,
+152,241, 62,154,135,182,231,127, 55,235,125,114,211,234,205,156,149, 92,141, 83,117,121,248,240,225,212,252,249,243,225,235,235,
+139,194,194, 66,136, 68, 34,144, 36, 9, 15, 15, 15,124,243,205, 55,172, 18,240, 24, 16, 22, 22, 86,167, 23,128,105, 42, 96,151,
+227, 41,159, 85, 64,148,108, 40,177,121,194, 73,235,159,216, 80,242,176, 60,107, 75,157,118,221, 51, 32,109, 87,203, 99,241, 20,
+193, 68, 54,196,155, 17,195,197, 62, 6,173,156,123, 55, 27,237,244,247,224, 21, 16,140, 62, 93, 59, 32,160, 89,160,228,211, 53,
+219, 82,118,164, 77,183,235, 69,107,211,166, 13,250,245,235,103, 30,143,231,114,185,208,106,181,230,212,189,150,195, 4, 45, 90,
+180, 64,223,190,125,145,146, 98,187,233,137, 68, 34,132,133,133,129,199,227, 65,167,211,153,127,103, 57,117,208,114, 33, 32, 14,
+135,131,238,221,187, 35, 61, 61,221,225, 50, 48,121, 7,170, 76, 91,131, 97, 34,253, 6, 47, 74, 96,242, 16,153,219,225,154, 53,
+107,196, 42,149, 10, 90,173, 22, 29, 58,116, 64, 92, 92,156,220,177,251,138, 73, 1, 0,153,108,157, 68,173, 46,134, 64,224, 7,
+ 55,190,151,156,195,225, 97,107,252, 65,201,219,209, 17,245,202, 91,191,126, 61, 33,147,201,136, 31,126,248,129, 84,171,213, 0,
+128,208,208, 80,135,210, 47, 91, 66, 38, 91, 71,252,252,243,250,225,147,191,248, 33,177, 70, 30,197, 9, 13,125, 1,161,111,188,
+241,246,140, 25, 51,226,157,145,185,100,201, 18,182, 81, 63, 37, 74, 64,125,228,255, 88, 21,128,103, 21,174,156,246,103, 77,204,
+ 13, 37,106, 23,202,115,181,194,192, 42, 32, 78, 96,231,193, 67, 41,181,202,174, 50, 23, 39,239,228, 50,254,125,100,100, 36,252,
+252,252,204, 17,254, 36, 73,154, 93,248,180, 7,128, 14,250,163, 87, 4, 12, 9, 9, 1, 65, 16,216,177, 99,199, 67,242,150, 47,
+ 95,142,132,132, 4,243,181, 70,163,209,238,114,192,124, 62, 31, 61,123,246, 4,147,232,248,103, 88, 89,107,112, 93,167, 21,129,
+ 26, 82,223,128,154,112, 44, 82,206, 68,158, 73, 89, 34, 0, 96,205,154, 53,212,244,233,211,137, 99,199,156,159,154, 63,101,202,
+212, 67, 38,175, 9,135, 36, 73, 35,135,195, 17, 57, 58,252, 66,131,181,238,159, 46, 37,192,110, 71,237,236, 58,194, 44, 88,176,
+ 96,193,130, 5,139,103, 23, 28,182, 8, 88,176, 96,193,130, 5, 11, 86, 1, 96,193,130, 5, 11, 22, 44, 88,176, 10, 0, 11, 22,
+ 44, 88,176, 96,193,130, 85, 0, 88,176, 96,193,130, 5, 11, 22,207, 5,106,205, 2,184,120,241,162,211, 17,156,182,130, 9, 89,
+121,172, 60, 86,222,115, 41,143,122,253, 13, 41,126,255, 77, 6,153, 76,198,177,149,173,143, 45, 63, 86, 94,203,150, 45,205,215,
+228,230,230, 18, 79,155,188,231,253,125, 56,172, 0,208,141,187,158,235,157,185,193,103, 89,158, 51, 50,159,246,231,173, 5,153,
+ 76,198, 7,224, 13,192,221, 84, 31, 72, 0, 37,206, 36, 79,121,196,160, 92,245,204,117,148,233, 19,153,190,180,116,233, 82,241,
+153, 51,103,228, 39, 78,156, 0, 0, 12, 28, 56, 16,125,250,244, 97,156, 74,248, 73,188,135,215,223,144, 98,196,240, 30, 6, 64,
+202,147, 74,165, 36,216,105,159, 44,172,208,178,101, 75,106,212,168, 16,243,254,254,253,160,236,145,182, 61,121, 11, 22,244, 55,
+239,127,251,237,201, 6,201, 99, 81,183, 2, 0,106,215,195, 11, 64, 16, 19,202, 27,242, 63,132, 19,196,251,216,228,217,122,222,
+ 6, 62,243, 83,253,188, 52,241, 95,189,116,114,227,174,237, 43, 7, 53,110, 22, 18,172, 80,232,225,227,227,134,251, 5,183,201,
+206,157,187,149,201,100,178, 94, 82,169,244,142, 35, 50,165,147,186, 81,217,183, 51,113, 59, 71,131,188,123, 20, 90, 52, 33, 16,
+210, 90,136,182, 33,161,144,109,202,120, 90, 26,171, 45, 69,130, 94,107,224,177,223,227,229,203,151,229, 97, 97,135,177,118,173,
+ 10, 41, 41,192,194,133, 71,144,151,151, 39, 31, 53,106, 20,132, 66, 33, 10, 11, 11, 37, 99,198,140,129, 43, 20,130,183,223,126,
+155, 82, 40, 20,146, 33, 67,134,224,163,143, 62, 74,113,162,206,112,164, 82, 41, 70, 12,239, 65,198,196,196,240,128,117,248,253,
+ 55, 64, 38,147, 17, 76,115,246,179,248,231, 64,167,155,143,164,164, 24, 12, 27,182, 14,163, 70, 45,193,254,253, 53,109,207, 89,
+226,190,121,115, 14,126,253,117, 12,198,142,221,139, 5, 11,106,148,128,134,200,123,222,193, 38, 2,114,132, 97, 45,200,158, 32,
+ 0,114,167,223,115,251,172, 43, 87, 44,123,231,192,190, 95, 98,219,181,107,223, 97,236, 27, 3,209,162,153, 55,124,125, 4, 40,
+175,208,160,224, 94, 11,206,173,236,242,192, 3,251,126,145,175, 92,177,236,135, 15,103,206, 89, 97, 79,222,199, 31, 78, 20,223,
+201, 60, 32, 47, 42,204,192,155, 17, 64,223,112, 32,164, 21,144,149, 67,225,212, 57, 53, 18,229, 25, 24, 61,212,155,106, 19, 58,
+ 82,242,227,202,109,206, 18,153, 43, 45,127,194,134,236, 39,162, 4,148,149,149,225,163,143, 84, 8, 10, 2, 34, 35,129,197,139,
+171,113,225,194, 5, 24, 12, 6, 8,133, 66, 52,106,212, 72,126,224,192, 1, 76,157, 58, 85,178,126,253,122,135,202,110,250,244,
+233,226, 43, 87,174, 32, 56, 56, 88,190,123,247,110, 98,235,214,173, 0, 32, 79, 78, 78,198,251,239,191,143, 13, 27, 54, 56,250,
+172,124, 0, 72, 60,116,158, 3,172, 35,107, 62, 31,206,241,207,130,181,254, 1, 96,220,184, 61, 72, 74,170,249,140,137,185, 13,
+218, 35,224,168, 55,128,150,247,206, 59, 91,240,235,175, 53,159, 99,198,156, 4,237, 17, 96,189, 1,245, 19,191,229,113,107, 37,
+128, 13, 2,180,225, 5,120,158,201, 95, 38,147,241,142, 38,237,250, 92, 50,160, 71,135,177, 17,161,232,214,185, 17, 2,252, 68,
+ 32, 64,192,219, 83,128,208, 16,127, 12, 25,216, 26, 3,251,117,111,117, 52,105,215,231, 50,153,172,177, 61,153,119, 50, 15,200,
+251,135, 87, 98,215, 74, 96,114, 36,208,193,228,249,243,112, 7, 58,182, 3,190,156, 13,244,238, 86,137, 59,153, 7,228, 13,121,
+ 69, 13,245,122,216, 81, 36,158, 72, 7,226,239,239,143, 3, 7, 68, 40, 46, 6, 18, 18,128,242,114, 30,218,181,107,135,145, 35,
+ 71,210,203,189, 34, 37, 37, 5,233,233,233,242,165, 75,151,138,153,202, 29, 54,108,152,248,234,213,171,114, 62,159, 47, 47, 47,
+175,237,201, 82,171,213,216,176, 97, 3, 36, 18,137,163,229, 73, 2,192,239,191,201,144,120,232, 60,231,247,223,100, 13,122,246,
+ 41, 83,166, 80,244, 86,223, 49,134,245,130,114,226, 88,189, 88,183,118,173,120,221,236,217,226,139, 83,167, 82,121, 35, 70, 80,
+103, 39, 77,162, 86,125,244,145,120,221,218,181,226,134, 60,115, 67,235,140, 45, 25, 76,143, 61,106,121,180,235,127,212,168, 16,
+196,196, 36,213,250,164, 49,106, 84, 72,173,241,124,123,242, 22, 44,232,143, 5, 11,250, 99,204,152, 95,107,125,210, 88,176,160,
+ 63, 99,121,255, 36,132,133,133,213,218,108, 41, 7,172, 2,240, 52,176,192, 99,196,213, 75, 39, 23,183,107,215, 46,180, 87,143,
+ 38,181, 43, 2,135, 0,159,207,133, 72,200,131,155, 27, 7, 33,109,252, 16, 18,210,174,209,213, 75, 39, 15,200,100,178, 58, 61,
+ 69,210, 73,221, 40, 46, 42, 49,123, 50,160,209, 2,119,242,128,114, 5, 80, 81, 9,108,219, 7,204,252, 2,136, 93, 10,244,233,
+ 1,112,168, 74, 72, 39,117, 99, 27,170, 5,186,118,237, 42,249,253,247,142,104,212, 8,152, 56,145,135,198,141, 95,194,192,129,
+ 3, 37, 7, 14, 28, 32, 70,142, 28, 41, 25, 54,108, 24,130,131,131,113,254,252,121,236,220,185, 83, 62,110,220, 56,241, 79, 63,
+253, 84, 47, 1,245,239,223, 95,172,213,106,229,110,110,110,245,254,183, 92, 46,199,160, 65,131,152,144, 25, 21, 29, 29, 77, 73,
+165, 82,157, 41,102, 4, 22,228, 79, 0, 64,116,116,180,195, 10, 90, 90, 90,154,121,171,239,152,147,205,150,104, 72,243, 94,183,
+118,173,184,237,141, 27,242, 49, 23, 47,202, 91,100,102,129, 95, 89,137, 38,153, 55, 32,254,227,172, 60, 40, 35, 67, 46,115, 82,
+ 9, 72, 75, 75,195,148, 41, 83,168,153, 51,103, 58,173, 68,208, 50,152, 28, 99, 42,207,154,232,153, 28,179, 7,154,244,233, 79,
+221,168,118, 13,106, 43, 52,233,211,159, 55,123, 5,177, 29, 72, 61,196,207, 4,207,170, 2, 64,217,216, 92, 38,248, 17,222, 31,
+229,226,219,164, 28, 45,139,171,215, 50,134,135,134,248,155, 73,223,214, 50,205, 66, 1, 15, 6, 3,137,208, 16,127, 92,189,150,
+ 17, 2,192,167, 46,121,217,183, 51, 17,241,106,205,247,195,169,192,251,159, 1,107,183, 1,133, 15,128, 27, 89,192,133,171, 20,
+146, 79, 3,199,206, 0,195, 6,214, 92,223, 0,221,140,120,132,175,248,137, 40, 38,243,230,205, 75,169,174,174,137,183,156, 56,
+113, 34,206,158, 61, 75,200,100,178, 20,250, 92, 89, 89,153,164, 99, 71, 30,166, 78, 5,186,119, 63, 7,163,241,134, 60, 63, 63,
+191, 78, 79,202,244,233,211,197, 4, 65,200,153, 46, 14, 83, 84, 84,100,215, 43, 19, 29, 29,141,248,248,120, 0,160, 82, 83, 83,
+117, 22,239,130,160,137, 63, 62, 62, 30,209,209,209, 79,178, 63,112,246,152, 77,104,175, 92, 65,155, 63,255, 52, 45,130,164,131,
+129, 36, 65,234,141, 32,245, 6, 4,157, 76, 69, 37,195,245,214,235, 34,220,191,254,250, 75,254,202, 43,175, 60,114, 37,192, 25,
+239, 66, 67,201, 95, 55,170,157,205, 45, 41, 38,201,169,123,186,217, 43,200,230,246,235,152, 95, 89,182,111, 32,108, 42, 0,196,
+132,242,135, 54,103, 9,135, 1, 33, 58, 42,143,168,103,123, 42,148, 13,106,151,159,205,173, 1,202,203, 67,215,219,249, 15,155,
+144,201,100,188,198, 77, 67, 58, 53,109,236, 9,138, 2, 82,207,228,225,240,177,108, 28, 62,150,141,162, 18, 21, 40,138, 66,110,
+126, 37,153,114, 58, 23, 89,119,202, 17, 24, 32, 66,211,166,237,124, 81,179, 68,171, 77,220,206,209,160,111, 56,160,213, 3,135,
+ 78, 0,242,179, 20, 86,108, 6,110,100, 3,131,250, 1, 29, 66, 8,240,184, 53, 75,139,247, 14,171,185,158,225,179, 58,243,157,
+169,165,104,203, 61,252,196, 28, 64,166,229, 92,241,226,139, 47, 74,172,207,113,185, 92,121,167, 78, 69, 88,184, 16,248,207,127,
+ 40, 52,109,154,137,156,156,156, 58,101,105, 52, 26,187,150,191, 37,234,147, 69, 35, 62, 62,158, 38,123,179, 34, 64,111, 22,196,
+ 79,152,174,123, 18, 78, 59,235,246,207,244, 88,157,104, 95, 82, 42,215,233,245,208,233,245,208, 25, 77, 43, 40,146, 36, 72,163,
+ 17, 70, 35,137,230,247,238, 53,100, 56, 11, 42,149, 10, 74,165, 82, 62,101,202, 20,106,234,212,169, 13,242, 38,184, 74, 9,112,
+149,229, 79, 19,253,184, 61,127,127,167, 63,157,241, 2,208, 68,255,206,150,191,191,211,159,172, 23,192, 62, 44,151, 6,102,180,
+ 28,112, 93,179, 0, 26, 48, 59,160,174, 40,118,103,162,219,169,122,254,131,114,224,255, 25, 61,183,141,223, 50,106, 92,245, 4,
+ 21, 58, 35,175,206,223,208,255, 67, 0, 32,119,217,141, 93, 32,107,162,253, 5, 0,128,188,194, 74,168,213, 6, 0, 64,187,182,
+126, 8, 10, 16, 33,227,106, 17,231,230,173, 50, 8,133, 92,132,180,241, 69,185, 66, 7, 0,117, 10,206,187, 71, 33,164, 85,205,
+255,191, 54, 0, 8,235, 68, 64,192, 7, 12, 6, 96,104,127,192,215, 11,200,206, 5,134, 13, 0, 90, 53,175,185,254, 9,163, 46,
+ 37,224,185, 24,253, 41, 42, 42,114,168, 29, 86, 85, 49, 95,125, 55, 62, 62,158,136,142,142,166, 76, 74,128,165,119,224,137,151,
+ 93,219,182,109,169,236,236,108,194,217,243,214,112,187,157, 5,173, 94, 7,130,203,131,145,162, 64, 0, 48, 24, 73,232, 13, 36,
+ 40,163, 17,196,173,155, 46,185,239, 43, 87,174, 32, 48, 48, 80,254,221,119,223, 73, 62,253,244,211, 20,103,149, 0,235, 97, 20,
+ 71,137,219, 85,228,159,155,155, 75,180,108,217,146, 26,183,231, 97,133, 96,216,186, 97,224,239,207,194,254,253,183,205,145,251,
+246,198,238,105,121,239,108,121, 88, 33, 24,187,119, 44, 94, 72, 43,198,183,223,158,100, 44,239,159, 72,254, 52,158,167, 89, 0,
+245,145,168,195, 4,219,192, 41,142,117,203,125,196,179, 9,136, 9,229,142,254, 7,225,227,227,134,242, 10, 13, 2,253,221, 17,
+249,255,237,125,121, 92, 84,213,251,255,251, 14, 48, 12, 48, 40,184, 34, 26, 9,238,226, 26, 46,168, 89,140,185,141, 8,184,145,
+125,202,210,180,152,248,148, 89,185,160,150,102,125,234,167,144, 38,159, 44,117, 76, 83,250,182,104, 35, 26,226,134, 81, 67,105,
+106, 37,110,185,148, 2, 38, 38, 34,137,178, 13, 51,204,114,207,239,143,153,139,151, 97,150,123,103, 6,177, 62,247,253,122,241,
+ 98,230,204,153,103,206, 61,231,222,243,126,158,231, 60,231, 57,241, 61, 97, 52,209,240,245,245,130,151, 72, 4, 66, 8, 38,142,
+237,130,216, 49, 93, 64, 81, 64,249, 29, 45, 90,182,244, 1,128,219,246, 4, 62,208,129, 66,225, 85,130,158, 93,128, 81,195,204,
+157,253, 91, 1,208,175, 39, 16,220, 2,144,199, 0, 52, 13,120,123, 1,151,174,152,235, 23, 93, 35, 92,199,150,207,107,119, 31,
+252,102,217, 6,184, 97,195,134,152,213,171, 87,163,176,176, 16, 63,252,240,131,250,189,247,222,147, 73,165,210,250, 99,103, 77,
+ 38,147,236,194,133,118,234,183,222,186, 14,138,162, 80, 86,214, 29,221,187,119,198,165, 75,182,151, 82,104,154,182, 89,254,216,
+ 99,143, 53,234, 31, 66, 8,190,251,238, 59, 94,215,204, 86, 2,238, 39,242,247,132,146,192,198,237, 78, 29, 33,254,237,119, 16,
+ 31, 64, 76, 19, 80, 20, 96, 48, 25,161, 39, 38,212, 26,141,208,118,237, 9, 92,248,205,237,182,247,233,211, 7, 20, 69,185, 68,
+254, 0, 48,100,200, 16,108,222,188,153,234,215,175, 31,113, 84,230, 12,155, 55,111,166,172, 9,223, 86, 25, 31, 36,229,220, 37,
+126, 0, 16,103, 23, 52,248,156, 9, 24,204,206, 46,228, 36,111,242,174,187,196, 15, 0, 61,126,254,171,145,188, 37, 75, 70, 98,
+229,202,195, 2,243,115, 32,127, 64, 8, 2,180,229, 30,100,187, 9,221,154,220, 8, 1, 68,211,239, 52, 89,163,201, 87,193,230,
+223,224,174,192,120,151, 94, 47,188,117,237,186,217,234,123,127,195, 47, 56,125,174, 12, 6, 3, 13,154, 38, 22,165,133,170,143,
+ 13,184,118,189, 26,165,215, 11,175, 0,176,107, 86,118,233, 44,193,143,249,230,215,109,162,128, 83,231,129,164,127, 1, 93, 31,
+ 52,187,253,223,249, 16, 16,251, 0, 34, 17,240, 99,190,185,190, 27, 4,237,233, 24, 10,235,241,190,231,214,195,133, 11, 23, 32,
+145,152,251,100,223,190,125,248,252,243,207,213,121,121,102, 46, 88,189,122,117, 76,171, 86,173,212, 23, 47, 26,241,241,199,192,
+169, 83,131,224,229,213, 83,214,169, 83, 39,153, 61,121, 1, 1, 1,156,127,219,104, 52,254,237, 31, 92, 54,249, 71, 68, 68, 16,
+123,127,124,149,133,194,182,237,100,119,244,117,168,210,235,161,213, 27, 80,103, 52,194, 64, 76,168, 53, 24, 80,173,215,163, 36,
+ 52, 84,230, 78,187,253,253,253, 17, 16, 16, 32,219,188,121, 51,197,119,123,167, 53,209, 59, 43,227,163, 4, 12, 25, 50,196,105,
+ 25, 23, 47,128, 61,242,103, 91,255,124,228,217, 35,127,182,245, 47,128, 31,249, 11, 10,192, 61, 64, 83,111, 41, 36, 95, 5,131,
+128,179,162, 97,140,140,236, 95, 82,112,229, 14,104,154, 96,241,188,104, 92, 42,184,141,139,151,202, 65, 81,104, 16, 16, 72,211,
+ 4, 5, 87,238, 32, 50,178,255, 57, 0,118,253,196, 17, 93,186, 99,223,119,128,201, 4,144, 34, 64,125, 12,200,254, 22,144, 63,
+ 11,200,158, 4,242,142,155,235,153, 76,192,190,239,204,245,155, 17, 4,142,115, 1,220,115,220,190,125, 91,221,171,215, 21,252,
+252, 51,112,236,152, 9,157, 58,157,197,169, 83,167,212,113,113,113,100,239,222,189,234,156,156, 28,220,188,121, 19, 15, 61,244,
+ 16,166, 79,159, 46,203,204,204,204,115,148,196,135, 16, 34,179,231, 5,176, 6,163,120,240, 5,179, 4,192, 94, 10,104, 46,176,
+ 45,250,162,162, 34,202,222,159,173,250,142, 16, 60,112, 32,202, 71, 62,130,219, 90, 29,238, 24,234,160, 51, 26, 81, 99, 48,161,
+ 82,175, 71,245,168,199,208, 38, 42,202, 69,175, 32,133, 33, 67,134,160,111,223,190,178, 99,199,142,229,185, 35,131, 77,244,182,
+202,220, 81, 2,216,115,129,173, 50, 46,176, 69,254,140,165,110,157, 41,144, 11,108,145, 63, 91, 30,123,107,160, 64,254,206,201,
+ 95, 80, 0,254,238,110, 11, 38, 72,147,227, 50,128, 66,161, 48, 69,246, 27, 57,170,176,176,224,183,159,242, 75, 64,211, 4,242,
+209, 17, 56,123,190, 12,239,190,127, 12,239,172, 57, 90, 79,254, 63,229,151,160,176,176,224,106,100,191,145, 47, 41, 20, 10,131,
+ 61,153,202,109,103, 40, 19, 90, 96,237, 39,102,146,223,248, 14,240,233, 46, 64, 22, 13, 12,236, 13,228,125,105, 46, 95,251, 9,
+ 96, 66, 11,119, 50, 2,186, 27,232, 73,156,200,105,150,181, 67,141, 70,131,190,125,117, 24, 60, 24, 24, 60, 24, 24, 52,136,160,
+168,168, 8,217,217,217, 56,126,220,172, 61,197,196,196, 32, 42, 42,138, 83,122,224,204,204,204, 60, 46,196,110, 52, 26, 17, 24,
+ 24,200,219,138,181, 68,253,215, 71,252, 51,239, 93,181, 96,153, 63, 71,101,124,148, 0, 79,212, 3, 0, 69,114,114,158,126,232,
+ 80,217,197,177, 99,100,165, 61,122,160,212,199, 7,165, 61,123,226,210,184,113, 50,211,176,104,153,194,178, 68,195, 23,131, 7,
+ 15,134, 59, 86, 63, 91,134,179, 50,174,125,104,203,234, 31, 60,120,176,211, 50, 87,192,228, 8,184,155, 20,168,208, 45, 11,158,
+201, 17,192, 74, 10, 36,120, 4, 56,146, 63, 32,100, 2,108, 82,203,252,126,252, 13,133, 66, 81,254,225,186,247,211,115, 14,238,
+ 88,248,231,141,234, 46, 93,195,131, 17, 59,182, 11,130,131, 36,184, 83,161,195,169, 95,111,162,224,202, 29, 20, 22, 22, 28, 29,
+ 55,126,250, 46, 0,215,156,201, 12,239, 62, 81,118, 56,127,175,250,104,126, 21, 98, 71, 1, 31,175, 52,103, 2, 44,188, 10,108,
+249,202,108,249,155,208, 2,225,221, 39,202,112,232, 11, 79, 16,184,167,191,219,108,187, 0,110,220,184, 33, 11, 14,110,163, 62,
+113,194,108,213, 92,186,212, 2,131, 7,247, 70,235,214,173, 33,145, 72,112,227,198, 13,217,196,137, 19,121,165, 2,238,220,185,
+179,236,247,223,127, 87,219,179,216,140, 70, 35,186,118,237,138, 45, 91,182,240, 34, 33,235,181,127,214,123,226, 74, 44,128, 45,
+107,213, 85, 11,214, 25,185,243, 33,127,182, 18,208,224,190, 56,123,214,237,241,118,215, 66,231,211,111, 92,127,203,211,242, 28,
+145, 63, 27,250,184,174, 0,199,245,127,123,228,207,134,176, 35,192,190, 39,192,158, 98,224,109,207,178,228, 83,206, 99, 2,246,
+148,213, 69, 92,252,236,158,180,207, 73, 63,121,164,125,238, 4, 46,190, 52,247, 53,165, 82,169,220,126,254,236,225,245,187,179,
+190,143, 8,233,216, 37,154,117, 22,192,241,200,200,254, 63, 79,140,159,189, 84,161, 80,104,184,200,179,164,247,165, 20,179,250,
+147, 29,251, 46,225,255,125,100,231, 44, 0,215,201,223, 35, 14,147,251,141,252, 1,224,137, 39,158,192,153, 51,103,240,236,179,
+ 39, 0, 0,131, 6, 13,194,227,143,247,151,189,250,234,171,245,228,252,227,143, 63,242,146,185, 97,195,134, 60, 0, 84,108,108,
+108, 76,117,117,181,218,203,203, 11, 34,145, 8, 70,163, 17, 98,177, 24, 82,169, 84,230, 46,249, 3,240,136, 18, 32,224,159,137,
+226,226, 98, 42, 39, 41,135,132,206, 13,149,161,179,237, 58, 37, 73, 57,106,174,214,122,113,113, 49,181,107,242, 46,210, 45,181,
+155,236,215, 32,219,117, 46, 79, 62,172, 22,172,127,126,240,230, 49, 81,122,122,226,109, 10,121,212,125,222,190,251, 65, 30,227,
+ 9,168, 84, 42,149, 51, 34,251,141,100, 50,198, 72, 1,180, 1,112, 3,128,214,114,202, 27, 47, 88,187,247,139,174, 17, 20, 93,
+211, 2,135,207, 52,119, 63, 80,247,186,127,185,194, 66,244,245,109, 56,119,238,156,199,100,239,219,183, 47,207, 83,215,199, 90,
+247,167,172,202, 41, 88,242, 1, 8, 16, 96, 77,218,197, 11,139, 61,246, 76, 23, 23, 23, 83,197,255, 42,198,253,250, 44,223, 47,
+224,154, 5, 16, 0, 40, 87,207, 17, 22, 32, 64,128, 0, 1, 2, 4,252,125, 33, 4, 1, 10, 16, 32, 64,128, 0, 1,130, 2, 32,
+ 64,128, 0, 1, 2, 4,131, 1, 0,215, 0, 0, 32, 0, 73, 68, 65, 84, 8, 16, 20, 0, 1, 2, 4, 8, 16, 32, 64,128,160, 0,
+ 8, 16, 32, 64,128, 0, 1, 2,254, 25,104,176, 11,224,244,233,211, 46, 71, 81,218, 10, 38, 20,228, 53,153, 60,167,135,216, 52,
+167,188,196,196,196, 24, 0,106,149, 74,229, 17,121,211,167, 79,143,161,105,218, 99,242,132,251,175,121,228, 37, 39, 39, 79, 87,
+ 40, 20, 95, 53,101,251,148, 74,165, 15, 0,137,229,158,214, 1,160, 1, 16,133, 66, 65,132,241, 16,228,253, 47,201,243,148, 7,
+128,112,248,227, 3, 79,203,187,103, 32,183,211, 8,169, 73,231,220, 62, 11, 17,122,236,122, 89,242,176,102,205, 26,153,131,254,
+228, 45,239,220, 71, 45,224,174, 60, 6,147, 6,239, 87,135,183,200, 6, 0, 68, 69, 69,185, 61,158,221,219,239,192,131,109,191,
+133,159,159, 31, 70,143, 30,125,223,220, 31, 74,165,178, 45, 21, 32, 61,168, 84, 42,219,122, 72, 94,152,200,215, 63,199,158, 60,
+165, 82,233,163, 84, 42, 41, 39, 50,124,152,182, 73, 36,254, 7,149, 74,101, 91,165, 82,233,229,236,123,174, 60, 14, 46,220, 27,
+199,154,106, 44, 54,109,218, 52, 97,243,230,205, 11,124,124,124,118,139,197,226,124,177, 88,252, 27, 0,165,151,151,151,138,162,
+168,245, 74,165,178, 77, 19,244,129, 0, 1,141, 80,187,104, 17,241,240,131,214,100,115,158,179, 76,128,132, 16,251,191,205, 51,
+ 55, 52,177, 8,244,148, 60, 94, 22,172, 39, 49,109,218, 52, 82, 80, 80,224,148, 92, 85, 42,149, 58, 37, 37, 5,237,218,181,179,
+153,114,117,254,252,249,156,207, 20,103,228,173, 89,179, 70, 54,127,254,124,245,241,227,199,213, 86,138,128, 75,242,232, 11,203,
+ 33,234,253, 54, 62,253, 78, 15, 0,160, 47, 44,191,171, 29,246,126,155, 87,191,124,249, 94, 0,161, 9,176,253,160, 89,150,252,
+ 81, 31, 68,118, 61, 15,192,172, 4,228,231,231,243, 26,155,180,143,100, 49, 21,127,148,163, 70, 31,172,214,212, 5, 64, 62,174,
+ 2, 29, 67, 40,132,135,207, 36, 85, 85, 58,236,216,177,163, 89, 39,244,228,121,243, 94, 6, 77,143, 77,158, 55,239,101, 0,203,
+220,150, 55,119,222,243,132,166,199, 36,207,181, 45,207, 81, 74,102,118, 29,165, 82, 73,205,157, 59,239,101,154, 54,141,157, 59,
+119,222,203,122,189,110,153, 13, 69, 65,228, 74,174, 7, 55,161,103,223,127, 59,119,238, 84, 79,153, 50, 69,150,153,153,153,231,
+142,208,205,155, 55,203,189,189,189, 31,241,246,246,126,194,203,203, 43, 88, 36, 18, 73, 83, 83, 83, 69, 11, 23, 46,156,109, 50,
+153, 96, 52,227, 9,147,201, 20,167, 84, 42,127,180,120, 3,244,150,249,175,201,151, 65,227,227,227, 9,215,249, 46, 43, 43,139,
+215, 61,157,144,144, 64,220,249,190, 0,207,195, 47, 45,205,163,242,180,139, 22, 1,110,200,100, 50, 2,242, 61, 14,216, 41,249,
+ 71, 69, 69, 33, 63, 63,159, 15, 57, 59, 36,121,142,242, 26,201, 79, 73, 73, 65, 81, 81, 17, 44, 46, 98,143, 29,235, 74, 74,162,
+ 8,252,186,131, 10,254,146, 2, 0,170,213, 34,106,218,180,105, 78,181, 49, 54, 89,151,149,149,169,237,145,127, 74, 74, 10, 82,
+ 83, 83,121,145,191,229, 61,162,163,163,101,209,209,209,110,201, 99,200,158,249,191,234, 63,104, 64,254,139,166, 74,144,150,169,
+227,212, 87,219,211,165,164, 79,184, 8, 26, 45,193,107, 79, 75,112,252,188, 17, 90, 13, 65,173, 30,144, 13, 56,143,243,151, 76,
+136,138,138, 34, 92,149,128,148, 55,122,146,194, 83, 85, 8,108, 33, 70, 72, 7, 41,218,182,239,138,171,133,122,116,238,109,128,
+143,164, 12,185,187,111, 97,252,248,241,228,224,193,131,205, 53,225,249,182,106,221,122,222,103,199,127,166,228, 61,186,189, 12,
+224, 29, 0,117,238,200,107,221,170,245,188,237,223, 29,167,198, 12,232,225,150, 60,133, 66, 33, 14, 9,233, 48,239,144,250, 48,
+ 53,168,127,164, 77, 89,205, 64,254, 0, 80,127,252,160, 74,165, 82,199,197,197, 33, 51, 51, 83,109,235,121,253,229,151, 95,200,
+ 91,111,189,133,189,123,247, 58, 28,223, 45, 91,182,140, 18,139,197,125,196, 98,241, 92,177, 88,236,127,237,218, 53,116,235,214,
+ 13, 94, 94, 94, 8, 12, 12, 68, 65, 65, 1,164, 82,169,247, 47,191,252, 18,116,236,216,177,195, 47,190,248, 98,103, 0, 87, 1,
+136, 97, 94, 30,176, 59,241,177,231, 63,246,188,197,148, 83, 20, 5,138,131,213,178,103,207, 30,187, 50,216,229,142,230, 91,123,
+200,202,202,114,235,251, 77,170, 32, 39, 39,199, 88,178, 82,186,141,183,223,126,155,208, 52, 13,136, 42,160,175,211, 65,236, 43,
+ 1,232, 32,136, 68, 34, 44, 95,190,156, 58,102,197, 51,201, 14,100,157, 63,127,158,100,102,102,194,158,188,169, 83,167, 34, 50,
+ 50,146,114,181,125, 88,158,142, 21,111,191, 66,216,237,115,231,218,253,211,210,120,127,223, 94, 26, 96,174, 10, 0, 39,242,231,
+138,148,148, 20,167,117,184, 16,151, 61,242, 95,181,106, 21, 22, 47, 94,108,173,116,184,212,233,228, 68, 20, 65,235,238,160,194,
+191,164,216, 22,255,206,157, 59, 41, 0, 96,254,219, 91,115,177, 38,107, 71,228,111,241, 12, 56,181,218, 85, 42,149,218,218,194,
+103,202,216,125,204, 87,158, 35, 11,127,209, 84,238, 39,197,101,166, 7,144,110, 15,138,224,231, 75,225,193, 80, 47,220,186, 67,
+195, 96,244, 66,121, 5, 65,101, 13, 65,193,159, 52, 32, 2,218,248,159,101,250,199,225,164,176,244,245, 30, 49,221,187, 68,224,
+ 88,233, 77,132,135,181, 69,159,126, 17,240,242,109,133, 7,195,239,224,142, 86,135,178, 82, 19,254,188,169,131,191,119, 17, 39,
+121, 77,132,167,158, 94,184, 80, 92,212, 33, 20,190, 81,131, 68,186,195, 63, 60, 5,224, 19,190, 66, 88,150,248, 83, 51, 95, 94,
+ 32,254, 83, 28, 2,105,247,135, 68, 85,231,142,184, 36,143,105,219,139,243, 94, 21,195, 55, 16,225, 61, 34, 69,191,255,122,210,
+ 29, 89,158, 4,205,178,254, 33,145, 72,100, 0,212,214, 99,120,226,196, 9, 78,228, 15, 0, 62, 62, 62, 65, 18,137,100,214,173,
+ 91,183,252,187,119,239,142,129, 3, 7,194,219,219, 27, 31,124,240, 1, 76, 38, 19,250,246,237,139, 93,187,118,225,151, 95,126,
+193,217,179,103,225,229,229,181, 94,169, 84, 38,108,216,176,193,145, 85, 93, 63,207,121,194, 99,169, 84, 42,101, 33, 33, 33,106,
+ 66,136,195,239,148,150,150,202, 20, 10, 5,223,251, 71, 22, 18, 18,162,118,245,251, 12, 81, 95,188,120,209,225,188,209,171, 87,
+ 47, 25, 95, 50,191,120,241,162,250,201, 39,159, 68,203,150, 45,101,238, 40, 2,138, 23,102,146,164,228,177, 8, 8,240,107,244,
+153, 70,163,197,242,229,203, 49, 12,160,254,220,179,135, 92,139,143,183, 63,183,207,232,110, 30,204,149,147,209, 97,212, 68, 72,
+ 30, 26, 4, 83,247,200, 6,117, 12,219, 51, 16,188,114,242,221,186, 0,180,227,159,195,240,213, 95, 56,108,223,204,103,199,160,
+ 85,107,127,115,193,242,116,204, 95,240, 44, 0,224,118,121, 45,174,151, 20, 18,229,198, 12,151,149,128,218, 69,139,136, 43, 74,
+128,171, 10, 0,225, 98,169,223, 47, 40, 42, 42,194,226,197,139, 93, 85, 32,236, 98,218,180,105,132, 10,221, 73, 77,155, 22, 78,
+ 84,155,134, 0,219, 30, 38,148,244, 21,167,131, 96,139,172,173, 73,217,209,178,128, 61,176, 21,138,227,199,143,171,163,163,163,
+ 27,184,254,249,202,251, 98,161,212,238,228,246,212,106, 13,103, 57, 27, 54,108,136,241,245, 90, 8,145, 8,240,247, 3, 42,170,
+104,212, 17,130, 0, 63, 10, 58, 26,208,214, 17,116,106, 43, 2,109, 4, 46, 95, 51,161,168,168, 72,237, 72, 57,155,247,242,152,
+152,240, 7,253,213, 98, 49,193,243,179,134,194,100, 34, 40, 45,211,163,248,122, 5,224,115, 13,126,193,117,184, 81,246, 7, 68,
+226, 74, 92,184, 80,129,150,193,142,229, 53,157,249,223,106,249, 19,207, 60,227,251, 6, 13, 4, 47,126, 93,122,243,204,233,101,
+116, 85,149, 43, 36, 75, 0, 64,210,178,213,242,127,205,120,198,119,245, 21, 19, 58, 77, 79,145,254, 94,116,118,153,169,182,161,
+ 60,165, 82, 73, 89, 7,179,217, 66,139,150, 65,203,159,154,241,180,239,217,226, 59,136,127, 50, 73,250,225,127,230, 47,211,214,
+106,220, 85, 0,184,158,151,225,104, 44, 76,204, 51, 50,113,226, 68, 48,164,175,213,106,235,199,144,177,252,179,179,179, 57,141,
+169,175,175,239,112,141, 70,211,179, 87,175, 94,144,201,100,152, 63,127, 62,230,204,153, 99,158,204, 13, 6,108,219,182, 13,249,
+249,249, 56,121,242, 36,118,236,216, 1,173, 86,219,149,166,105,185, 19,139,221,163,247,211,190,125,251, 56, 45,205, 81, 20,197,
+251, 94,102,203,118,229,251,150,103, 56,239,201, 39,159, 68, 73, 73,137,205,207, 67, 67, 67,225, 42,129,151,148,148,160,164,164,
+196, 45, 69,224,236,153, 75,248,191,140,189, 24, 57,114, 56, 34,251,118,188,107,201,255,122, 29,135, 15, 31,197,176, 97,195,136,
+106,201, 18, 92,139,143,135,223,136, 17,208,218, 57, 59,131,250,236, 18, 5, 0, 11,134,247, 33,253,202, 14,226,233,239,246,194,
+212, 61, 18,218, 5, 43, 0, 0,126,171, 87, 64,122,233, 60, 22, 22,137,177,250,232,185,187,253,248,217, 34,135, 65,118, 76,251,
+ 70,143, 25,209,168,125,185,223,252,136,179,103, 46,185,117,255,184,178,164,192,118,247, 59,242, 6,120,243,181,216, 61, 77,180,
+238,194,226,246,119,125, 86,139, 2, 65, 7,128,218,107,126,112,168, 65,249,212,180,105,225,245,131,189,115,231, 78, 10,155,134,
+ 16,107, 79, 0, 87,178, 46, 43, 43,107, 64,206,174,144, 53, 87,176,148, 14,167, 36,193,197, 93,200,114,255,219,172,188,113,227,
+ 70,242,215,249, 87,209,161,187, 23, 52,218,187, 85,180, 38, 2,157, 30, 48, 88,202, 12, 70, 2, 34, 50,191,254,245,108, 62, 18,
+ 19, 19, 99, 46, 95,190,108,243, 55, 3, 3, 43,213, 26,173, 8,109, 90, 5,161,226,118, 45, 42, 42, 43,112,252, 68, 41,174,223,
+ 36, 16, 7,212,162, 99,215, 26,104,107,111,161, 91, 63, 3, 58,247,170,195,142,143,243, 49,121,242,228,152, 43, 87,174,220,147,
+251,205, 98,177,143,158, 56,117, 90,251,146,150,193, 40, 52, 2,126,163,199, 66, 20,220,186, 13, 93, 85, 53, 22,192, 33,134,172,
+ 1,248, 40, 20, 10,189,179,121, 31,192,152,184,201, 83,219,255, 37,106,137,171, 53, 6, 4, 61, 52, 26,222,129,193,109, 76,181,
+119,229, 1, 0, 23,242, 7, 48,110,210,228, 41,237,137,151, 47, 42, 53,117,232, 19, 53, 12,210, 22, 45,219,104,107, 53, 13,100,
+ 53, 23, 24,235,159,162, 40, 76,156, 56,145, 0,192,222,189,123,145,152,152, 24,147,146,146,162,230, 67,254, 74,165,210,183,162,
+162, 98,166,193, 96, 16,249,251,251,227,145, 71, 30,193,234,213,171,225,227,227, 3,133, 66,129,140,140, 12,228,231,231,227,248,
+241,227,248,246,219,111,241,235,175,191,162, 77,155, 54,109,140, 70,227,131,176,227,254,103,187, 64,157, 45, 1,136, 68, 34, 78,
+237,108,202, 37,128, 61,123,246,120,100, 9,160,101,203,150,178,146,146, 18,181,189,207,220, 29,119, 87, 20,129, 75,139, 22,145,
+242,180, 52,224,216, 49,224,216, 49,220,158, 58, 1,107,250,119,175,119,217, 71,246,238,141,199,167,199,162,243,157, 91,184, 22,
+ 31,143,214,139, 22,161,123, 90, 90,163,229, 0,107,136,101, 15,163,187, 60, 6, 11, 23,189,131,247,112, 30,107,162, 71,161,207,
+224,161,232,122,187, 8,219,130, 6,162,168,229, 77,100,100,100,144,153, 51,103,114, 26, 95,217,168,254,120,122,230, 68,252,252,
+211,175, 56,152,115, 8,111, 2, 88,179,122, 43, 34,123,247,198,211, 51, 39,162, 86, 91,142, 23, 94,120,129,179, 60,107,184, 27,
+ 3,192,215, 3,240,119, 2,101,135,156,120,119,244,180,105,211,136,106,241, 21,192, 75, 12, 4,249, 0, 65,157, 65,237,180, 8,
+227,184,246,223, 4, 32,108,171, 31, 0,216,150,191,141,201, 21,209,209,209, 50, 7,193,128,188,175,225,243, 5, 1,118, 61, 2,
+129, 85,243,241,135,158,160,244, 22, 13, 64, 4,169,191,217,197,105, 48, 18,232,234, 0,157, 30,208,213, 1,122, 3,160,211, 2,
+250,186,187, 94, 18, 91, 1, 41,159,127, 20, 64,114,143, 87,227,129,112, 41,136,143, 55,110,105,181, 80,127,127, 13, 23, 10,174,
+227,246,237, 26, 68, 70,153,160,209, 25,161,171, 51, 65, 91, 75,163,180, 24,208,106,128,221,187,119,171,249, 28,128,225, 14, 20,
+ 10, 5,237, 21, 20,180,252,217, 37, 75, 36, 59, 88, 20, 18,188,228,117,233,237,197, 11,150,153, 42, 42, 14,177,200, 90,207,101,
+140,189,165, 65,203,231,188,186, 88,114,224,186,169,190,176,211, 19,139,165, 87,183, 44, 89,102,172,169, 56,196,199, 11,224, 47,
+ 13, 92,246,242,107, 11, 36,133, 37,119, 79,139,140,123, 50, 73,186,125,211,154,101,181, 53,213,135,220,124,214,108,221, 75,124,
+158, 53,194, 88,255, 18,137, 68,166, 82,169,242,152, 45,163, 90,173, 86, 61,104,208, 32, 62,178,140, 0,186, 2,160, 7, 12, 24,
+ 64, 75, 36, 18, 81, 70, 70, 6,102,207,158,141,149, 43, 87,130, 16,130,159,126,250, 9,223,127,255, 61,206,158, 61,139,202,202,
+ 74,116,235,214, 13, 85, 85, 85,254, 34,145,168,157, 51,225,147, 38, 77,178, 75,168,206,150, 6,236,185,233,239,215, 37, 0, 71,
+ 94, 0,119,172,127,119, 21,129, 59, 21, 21,245,175,219,189,254, 2,250,188,158,140,145, 86,117,174,140,159,131, 78, 63,156, 64,
+225,130,231,241, 83,104, 40, 0, 96, 24, 64, 13,176, 49,215,165,167,167,147, 78,157, 90,224,228,169,159, 17,249, 80, 47, 32,237,
+ 13,188,186,101, 55,102,117, 57,131,254,117, 5, 88,120, 83,140,255,124,190, 20, 43,223,221,128,179,191, 30, 65,122,122, 58,121,
+229, 21,251, 94, 95,182,188, 86,173,253, 49,126,194, 80,140,159, 48, 20,111,209,233,208,215, 45,198,169, 83,192,169, 83,192,225,
+195, 19,241,225,186, 75,120,226,137,139, 36, 44,236, 65,164,165,249,243,226,167,220,135,223,192, 34,172,112,120,195, 29, 58, 52,
+252,127, 70, 1, 32,137,137,137, 50,214,154,161,181, 18, 64,177,173, 13,139, 75,222, 37,205,139, 33,253,157, 59,119, 82,170, 77,
+ 67, 0,177, 24,212,206,157,247,244, 98,153,168,127,149, 74, 69, 37, 38, 38, 18,103,222, 16,235,216, 0, 62,132,110, 11,142,234,
+206, 92,162, 65,104,123, 17,158,140, 19, 67, 87, 7,180, 12,164, 32,162, 44, 86, 63, 8,116,181,128, 70, 79,160,209, 18,104,116,
+ 4, 52, 1, 68, 14, 98,174,103,206,211,160,111,255, 34,132,244,188,141,111, 14,148,225,246,109, 29, 6, 12,171, 66,191, 86, 53,
+128, 79, 29,116,181, 52,202,174, 19,104, 52, 20,140, 70, 10,173,218, 80, 0,117,207, 99,217, 34, 7,246,239, 63, 40, 56, 44, 12,
+ 71,239,242, 53,164, 79,206,192,237,148,249, 81, 0,122, 3,184,192, 67,161,232, 53,120,196,163,131, 90,135,134,225,196,207,245,
+ 49,114,104, 43,251, 23,174,126,188,184,145, 60, 39, 94,128,222, 3,251, 15, 24, 20, 26,218, 9, 23, 78,222,245,136,140,120, 44,
+ 22, 95, 42, 87,243,110, 91, 83, 42,180,204,243,107, 29,191, 17, 23, 23,215, 40,254,200, 70, 44, 0, 51,232, 93, 1,156, 94,180,
+104,209,112,111,111,111,233,167,159,126,138,173, 91,183,226,217,103,159,197,170, 85,171, 64, 81, 20,254,248,227, 15,104,181, 90,
+164,164,164,192,104, 52,226,133, 23, 94,160, 41,138,114,250, 0,120, 50,154,254,126, 95, 2,112,228, 5,240,132,245,239, 42, 50,
+ 50, 50,240, 76,210,227,168,172,168, 3,222,221, 8,205,225, 19, 8, 24, 57,168,254,243,178,119, 55,226,188,175, 47,168,151,158,
+ 67,159,233,227,113,108,219, 1,135,242, 46, 95, 62,135, 97, 35,228, 56,119, 62, 24, 27,215,171, 48,114,228,112,252,231,163,165,
+120,107,244, 83,248, 12, 64,207,167,103, 99,227,122, 21,196,226, 96, 36, 76, 26,132, 79,121,200,251,239,251, 95, 97,240,196,190,
+120,167,239,106,156,139,149, 34, 56,110, 87,131,186,109,252, 37,248, 57, 79,141,176,103,102,241,238,135, 35, 71,188,145,150,230,
+231,176,142,171,246,207,223,210, 3, 96, 99, 29,153,114, 80,143,187,137, 51,200, 28,161, 62,109, 90, 71, 2, 92,134,234,131, 43,
+128, 95,247,122, 79, 0,163, 20,112, 89, 6,240, 20, 24,107, 62, 49, 49,145,176,173,127,198, 35,192,126,159,152,152, 8, 86,178,
+ 28,194,151,208,173,193,218, 5, 96, 83,158,209, 4,104,106, 9,234,244,230, 96,191, 58, 61,129,183,239,221,207,116,181,128,214,
+ 64, 80,126,155,224,175, 59, 4, 39, 47, 24, 65,211, 64, 98, 98,162,236,242,229,203,141,198,198,104, 4, 74,174,233,113,173,240,
+ 14,142, 28,187, 3, 66, 40, 92,248,141,198,196, 39,141, 16,123, 19,252,117, 19, 56,114, 8,168,170, 34, 32, 52,240,240, 40, 10,
+ 18, 9, 32,151, 39,224,234,213,171,156,174, 73, 62, 12,228,192, 49,215, 39, 73,145,180,197,146,231, 87,165,250,100, 17, 81,131,
+ 14,105,227,235, 11,159,151,230,249,252,177, 46,125,169,190,170,106, 6, 87,121, 94,126,210,165,201,203, 86,249, 28, 42, 33, 13,
+228,181, 14,240, 69,159,233, 47,250, 92,248,234,131,165,122, 77,205, 12, 46, 30, 0,137, 95,192,210,197,203, 87,248, 92, 41,173,
+108, 32,171, 69, 96, 0, 38, 63,249,172, 79,214, 23,159, 44,213,104, 52, 51,154,249,241,165,246,238,221,219,168,236,205, 55,223,
+ 36,123,247,238, 69,118,118, 54,231,161, 0,112, 14,192,233, 53,107,214,244, 15, 10, 10,146, 50,110,240, 79, 62,249, 4,179,103,
+207,198,214,173, 91,235, 45,245, 53,107,214,160,162,162, 2, 85, 85, 85, 53,181,181,181, 69, 22, 15,130,216,209, 15,208, 52, 77,
+172, 93,244,140,245,207,213,253,207,184,233,217,114,172,221,245,247,195, 18,128, 45, 47,128,167,173,127, 70, 38,215, 37,128, 11,
+195,134,129,122,126, 58,130, 0,144, 81, 81,168, 61,121, 14,154,119, 55,222,237,183,164,199,209,237,233,199, 33,145,152,175,255,
+252,121,199, 91,179,153,207,229, 19,204, 74, 68,254,137,179,248,236,255,182,195,127,232, 16,212, 26,140,208, 67,143, 71, 30, 29,
+216,168, 62, 23,121,215, 76,122, 60,217,254, 69,208, 39,235,144,248,222, 40,136,167, 29, 71,239,200,222,136,236,211,181,190,125,
+ 41, 11,215, 33, 45,237,223,156,239,155,130,170,130,209, 23,112,225,155,248, 22, 92, 60, 6,174, 37, 2,250, 91, 42, 0,249,249,
+249, 78,163,191, 45,159,115, 19,232, 27, 0, 85,231, 31,128,143,194, 9,194, 3,128, 46,117,160,122,100, 83,248, 32,170,126,237,
+223,157,101, 0,235,173,128,246,182, 6, 58,112,187,214,147,191,117, 0, 32,227, 82,103,202,156,120, 0, 40,107, 75,204,221,201,
+252,225, 71,227, 99,174,223, 56,160,166,219,210, 16,121, 3, 62,150,121,209, 64, 19, 24,141, 64,117, 53,129,222, 0, 24, 13,102,
+165, 32, 97,146,217,123, 99,199,101, 79, 69, 15,139,143,169,187,181, 95, 29, 25, 73,227,240,247, 38, 80, 34,224,175, 82, 10, 18,
+ 63,224,251,131,128, 94, 75,129, 34, 64,191,135,124, 80, 82, 76,227,209, 71, 99,145,149,149,197,233, 88,107,249, 48,144,180, 23,
+205,215,239,170, 18, 64,104,211, 56, 83,235, 54,162, 3,244, 93, 22,106, 15, 32,132, 2,180, 81, 81,222, 87,140,166,113,188,228,
+ 17,122, 28, 2, 91,137,212,165,166,122,121,109, 37, 64, 27, 9, 5,255,190, 81,222,231,183,211,227,172, 60, 6,196,145,172,128,
+192, 32,209,213,155, 21, 22, 98, 1, 2,253,124, 17,232, 47,198, 67, 3, 6,122,239,254,140,140,107,230, 71,215,102,159, 51, 81,
+255,236, 58,140,247,110,234,212,169,178,204,204, 76,123,242,106, 0, 92, 57,117,234, 84,205,200,145, 35,219,130,181,167,255,147,
+ 79, 62,169, 39, 68,131,193, 0,147,201,132,203,151, 47,163,109,219,182,183,104,154,230,164, 45, 78,154, 52,201,158,165,238,146,
+155,254,126, 94, 2,176,229, 5,240,164,245,207,135,248, 25,116, 8, 13,194,199, 31,127,135,248,184, 97,104, 31, 21, 9, 68, 69,
+130,122,126,122, 67,165, 23,192,205, 82, 45,246,100, 31, 67,135,208, 32,238,242, 66,252, 16, 53,168, 27,162, 6,117,107, 84,143,
+175,188, 71,166,244,194,235,143,126, 0,250,156,153,252,231, 44,156,233,146, 60,107, 44, 9, 92,242,205,202,234,149, 99,154,242,
+129,116, 75, 1,176,236,217,191,167, 17,216,140,149,171, 82,169, 24,139,151,178, 81,135, 48,228,207,178,138,121,129,189, 11,128,
+ 41,227,107,249, 91, 7, 0, 90, 80, 95, 54,127,254,124,181,101, 57,131,147, 60, 54,249,219,138, 9,224, 43,207, 25,210, 50,117,
+112, 38, 47, 43, 43, 43,175,117, 16,133,199,162,125, 64, 3, 48,232,105,248,138,205,221, 84,173, 33,168, 51, 16, 24, 77, 64,254,
+ 57, 19, 76, 52,129,179, 45,123, 89, 89, 89,121,237,219, 82,120, 52,198, 11,147,159,242, 66, 77, 53, 65,117, 37,160,169,166, 16,
+222,141,192,100,160,224, 45,146,160,226, 54,141,146, 63,245,184,252, 27,183,128, 49,249, 48,144,244,121, 64,247, 48, 96,221,107,
+192,220,247, 93, 83, 2, 72,173,102,202, 75, 81, 3,247,135,100,237,151, 6,143,120, 24,237, 1,180,167, 0,211,209, 35,200,157,
+ 57,163,198, 80,171,153,204, 71, 30,173,171,157,252,252,232, 65, 7,122,189,245,181,180, 93,191,225,104,227, 75,161,173,132,130,
+246,226,143,216,243,198,172, 26,131,182,150,179,188, 58,157,118,242,132,199, 70, 30,152,255,238,122,105,239,254, 81, 8,244, 23,
+ 35,208,207, 23,133, 23, 78, 99,121,202,203, 53, 90, 30,178, 92, 37,115,103,151,107,139,252, 87,172, 88,209,200,205,191,115,231,
+ 78, 38, 79, 64,158, 29,235, 31, 48,199, 88,156,238,209,163, 71,161, 78,167,235,232,229,229, 37,241,247, 55,111,197,202,204,204,
+196,212,169, 83,161,213,106,161,211,233, 80, 87, 87, 7,169, 84,170, 51,153, 76, 89,132,144, 82,142,214,181, 71,230,182,191,203,
+ 18, 0,219, 11,192,188,110, 14,226,103, 16, 30, 30,130, 37,175, 39,225,224,129,159,240,245,238,147,240, 21,183,192,159, 37,119,
+ 87,176, 58,133,246, 70,157,190, 10, 15, 69,245,196,218,244, 36,172,124,119, 3, 47,121,237,218,181,196,249, 11,231,235, 63,143,
+236, 29,137,178,178, 74, 94,242, 98,231, 77,198, 84,209, 12,212,157,171, 65,244,220, 62,160,251, 73,240,241,199, 59,234,219, 87,
+ 89, 89,137,225, 15,247,226, 36,207, 26, 42, 74, 69,169,160, 66, 83,194,101, 5,160, 41,200,159,139, 76, 11,225, 19,203,107, 0,
+ 32,236,109,137,249,249,249, 13, 8,223,150,130,208,216, 15, 75, 1, 98, 17,224,231, 5, 72,189,129,186,106,168, 86,250, 0,233,
+115, 8,252, 90, 1,126,173,120,175,253,219, 33,127,216, 32,107, 78, 15,134, 53,249, 91,199, 4,240,149,199,131,252,157,202, 43,
+175, 32,212,190, 60, 3,145, 72, 0,154, 6,250,246,240,186, 59, 30,191,154, 96, 48, 17,152,104, 47, 76,153, 50,133,147,114,114,
+243, 47, 66, 29, 56,104, 34, 70, 35,160, 55, 16,152,140,128,136, 2, 98, 98,129,234, 10, 10,191,157,209, 66,171, 19, 33, 62,110,
+ 10,118,237,218,197,137,252, 87,204, 1,186,118, 50,191,239,210, 17,112,213, 19,160, 84, 42,143, 43, 20, 10,121,105,194,132, 3,
+ 97,123,246, 75,195, 70, 60, 12,195,209, 35,216, 21, 55,161, 70, 95, 93, 45, 7,112,132,103, 87, 31, 49,105,171,229, 23,223,156,
+116, 32,244,189, 44,105,199,193, 35,160,185,120, 20,159,191,148, 80, 83, 87,203, 91,222, 17,157,182, 86,190,230,245,127, 31,248,
+207,127,183, 72,163,135, 13, 71,193,249,211,120, 57,105, 70, 77,109, 77,141, 43,109,107, 82, 56, 72,246, 67, 98, 99, 99,185,236,
+ 6,240, 10, 10, 10, 58,173,213,106, 63, 43, 42, 42,234,220,191,127,255, 8,163,209,232,237,227,227,131,172,172, 44,140, 25, 51,
+ 6, 58,157, 14,181,181,181,184,124,249,114, 85,112,112,240,119, 90,173,246, 83,154,166, 53,224,152, 1,144, 29,144,192,215,245,
+255,119, 91, 2, 96,123, 1, 60, 33,199,149,220, 1,182, 48, 94, 62, 20,227,229, 67, 45,239,220,215, 97, 27,202,155,228,158,114,
+ 23,180, 19,117,103,106, 48,115,125, 44,254,243,221, 82,183,219,150,174, 79, 39,193,198, 96,204,244,159,121, 79, 12,107,151, 20,
+128,230,176,252,109, 88, 31,196,170, 61,158,178, 82,236,122, 4,184,122, 0, 60, 77,254,140,178, 99,229,222, 39,236, 50,190,242,
+156,197, 2,240,149,167,209, 17, 74,163, 3, 17,137,128, 35,249,230,181,126, 38,224,207,188,238, 63,133,151,188,234,106, 66, 81,
+150,101,118, 74,100,150,241,243, 15,128,166,134, 6,161,129,248,248, 88,236,218,181,203,233,120,200,135,129,164,204, 0,130,164,
+ 64,201, 45,192,207, 23,160, 9, 16, 32, 1,222, 85,184,166, 4, 0, 56, 66, 87, 87,203,243,227, 39, 28,104,185,226,109,105,222,
+138,229, 53,117,174,145,127, 3, 37, 32,111, 81,194, 1,191,151,222,148,230,124,248,150, 43,228, 95, 47,203,104,208, 79, 88,254,
+202,243,251,231,206, 79,145,174, 95,155, 90, 83, 91, 83, 35, 87, 42,149,103,216,238, 97,165, 82,233,173, 80, 40,140,124, 29, 32,
+158,244, 10,216, 34,127,138,162, 72,108,108, 44, 0, 96,226,196,137,132,162, 40, 71,138,128, 84,175,215,215,136, 68,162,220,208,
+208,208, 78,213,213,213, 47,158, 56,113,162,195,192,129, 3,105,163,209, 88, 91, 89, 89,121,243,204,153, 51,127,132,135,135, 23,
+182,110,221,186, 72,171,213,102, 26,141,198,155, 73, 73, 73,154, 1, 3, 6,112, 82, 0,152,164, 64,238, 64,169, 84,114, 38, 84,
+ 87,150, 0,220,249,190, 61, 47,128, 39,230, 76,119,229,232,180, 94, 30,173,239,105,121, 21,119, 68, 72, 53, 42, 16,113, 44, 4,
+211, 63,114,174,152, 84,220,113,126,203,221, 75,242,183,171, 0,112,216,235,207,171,129, 60,114, 7,240,145, 75,177,162,252, 93,
+ 38, 47, 42, 31,212,180,240,241, 4,151, 0, 52,202,215, 80,105,249,227,183,199,220,114,189,106, 79,145,171, 85,191, 16, 38,207,
+128, 37, 64,144, 98,121, 67, 92,146,247,249,130, 0,182, 82,224,138,188,122,185, 83,167,222, 29, 19, 38,224, 79,165, 82,229,185,
+ 34,143,208, 13,199,184,166, 10,136,141,141,197,190,125,251, 40,198,170,226, 52, 30,159,121,238,129, 97,229,227, 63, 98,168,174,
+150,127,191,226,205,140,186,234,234,153, 30,176,174,143,232,107,171,229,135,214,191,149,161,171,173,158,165, 84, 42,143,186, 58,
+153, 27,141,198,195, 70, 99,141,124,125,122, 90, 70, 77, 77,205, 76, 0, 71,172,101,185, 64,254,158, 64,131, 25,213,154,252,153,
+184, 29,118,144, 96, 92, 92,156, 35,121,197,122,189,222,151, 16, 82, 77,211,180, 82,175,215,255, 20, 22, 22,214,166,162,162,130,
+ 90,182,108, 89, 85,101,101,101,121,199,142, 29,171,107,106,106, 52,122,189,190,202, 96, 48,212, 61,247,220,115, 90,158, 22, 54,
+229,129,123, 38,175,169, 58,180, 41,101, 55, 55,222,127,255, 35, 10, 0,121,252,137, 49,136,236, 19,110,183,222,249,115, 87,240,
+213,246,111,152,250,247, 76,222,250,245,235,235,229, 57, 52,152, 79, 20,225,171,237,223, 48,245, 29,226, 94,146,191, 61, 5,192,
+211, 13,104,178, 11,178,144, 40,101,203, 90,230, 3, 15, 71,245,115,201, 22,232,214, 15,240, 57,244,199, 19,222, 0, 23,198,196,
+238,123,119,229,237,219,183,143,215, 88,185, 19,241,207,133,180,117,213, 85, 93, 60, 41, 79, 91, 83,221,197, 67,150,220,145,154,
+234,234, 46,247,217,179, 76, 1,192,166, 77,155,136, 72, 36, 2,243,199,118, 97,203,229,114,208, 52, 13,154,166,145,148,148, 68,
+ 57,217, 21, 64, 25,141, 70,127, 66,136,137,166,233, 58,131,193,240,131,151,151, 23, 37, 18,137,124, 1,248,210, 52, 13,147,201,
+228,101, 52, 26,197, 70,163,177,195,115,207, 61,119,145,245,221, 38, 63, 4, 72,128,103,148,128, 33, 67, 70,146,131,251,119,163,
+184,172, 10, 33,193,181,245,159,149,222,241, 71, 88,187, 22,232,217,179,167, 83,178,110, 42,121,235,215,175,167, 30,121,228, 17,
+178, 46,125, 31, 10,254,188,213, 72, 94,215, 78,109, 16, 17, 17,193,137,252,155, 10,142,114,164, 80,174,158, 35, 44, 64,128, 0,
+ 1,247, 1,106, 89,132, 78,179, 12, 27,111, 86,249, 13, 0, 45, 97, 14, 26, 23,136, 95,128, 0, 7, 30, 0, 1, 2, 4, 8,248,
+187, 64, 98, 81, 2,104, 22,241,139,112,247,228, 65,111, 0, 29, 44,175,105,161,187, 4, 8, 16, 20, 0, 1, 2, 4,252, 51, 32,
+ 2, 32,101,189,103,136, 95,204, 34,125,218, 82, 79,176,254, 5, 8, 16, 20, 0, 1, 2, 4,252,143,204,105, 2,233, 11, 16,224,
+ 64,123, 22, 32, 64,128, 0, 1, 2, 4,252, 47,107,203,167, 79,159,102, 31,164, 67,172,146,232, 16, 52, 60,104,167, 88,165, 82,
+133, 49,239,109, 5, 19,178,229,241,197, 63, 81,158,141,109,139,148,208,127,194,120,252, 93,228,133,133,133,213,215, 41, 46, 46,
+166,248,202, 75, 78, 78,134, 66,161,160,132,251,207, 53,153,194,243, 43,200,227, 35,143,183, 2,192, 19,109, 57,214, 35,137,137,
+137,188, 51, 75,217, 59, 47, 30,141,147,145,216, 58, 13,208, 86,157,123, 14,134, 96, 44,123,225,213, 42,149,170, 62, 91, 23,223,
+124,226, 77,133,184,184,184,152,236,236,236,122, 18,140,141,141,149,237,219,183, 47,239,159,168,237,218, 26,143,139, 23,205, 59,
+195,122,245,234,213,220,205, 35, 9,147, 20,200,250, 90,105,243,158, 77,152,164, 32,150,207,236,222, 56, 9,147, 28,158, 20,136,
+172,175,149, 46,223,116, 97, 97, 97, 36, 46,238,238,174,194,236,108, 16,103, 74,128, 51,172, 94,179, 58,102,207,161, 61,136,136,
+140, 80,131, 2, 46,158,186, 32, 27, 54, 96, 56,210,223, 79,231,117,255,205,156, 57,179,209,117,103,100,100, 80, 16, 32, 64, 64,
+147, 41, 0, 98,174, 21,163,163,163,121, 11,119,160, 0,216, 36, 81,235,131, 54,120, 16,173, 43,154, 19,151,201,133,168, 84, 42,
+164,164,164, 32, 53, 53, 85,237, 32, 77, 39,151,223,111, 80,167, 99,248, 3, 0,128,155, 58, 29,140,218, 58,115, 97, 69, 21, 67,
+114,220,210, 31,215, 79,228,217, 13,114, 10, 88,114,139,243, 58,227, 93, 68,153,179,235, 49,255, 1,167,175,155, 99,114,110, 48,
+ 30, 12,241,187, 49, 30,158,188, 6,146, 48, 73,129, 9,242,135,116,128, 66, 98, 33,122,151,126,131,165, 64,120, 28,122,125, 10,
+114,114,146, 48,110,220, 38,196,197,165, 34, 59,219,220, 87,174, 40, 2, 79,191,252, 52,169,104,117, 27,107,149,171, 17,236, 31,
+ 12,218,104,130,142,212,169, 15,254,116,104,220,116,211,227,100,120,196, 8,217,188,121,243,156, 42, 2, 51,103,206, 36,201,201,
+201, 54,251, 84, 80, 2, 4,220, 11,196,199,199,215,207, 25,115,230,204,193,150, 45, 91, 26,112,207,236,217,179, 27, 28, 78,229,
+ 44,185,148, 51,121, 92,143,170, 62,125,250,180,181,151,192,163, 10, 0,175,248, 1, 91,167,216,121, 2, 27,149,202,152, 23,220,
+ 76,154,194, 39,135, 54, 71,203,157,164,164,164, 96,213,170, 85, 0, 80,255,223,246, 79, 19,126,222,128,160, 22, 56, 91,180, 29,
+126,232, 4, 19,126, 68,217,230,147, 56, 83, 88,142, 41,171,182, 54,219, 3,112,246,215,115,232,215,183, 15,104, 2,156, 59,103,
+126, 13,220,125,205, 46,167, 9,231, 49, 33, 28,199,131,226, 58, 30,179,102,205, 2,128,250,255, 54,137,157,162, 0,199, 63, 77,
+ 30,123,236, 0,190,253, 86,238, 81, 37, 96,130,252,161,218,164,164, 36,127, 96, 19,178,190,118,141,216,221,177,240,157, 89,255,
+ 0, 48,117,106, 38,114,114,204,255,147,146, 10,193,120, 4,248,120, 3, 54,110,220, 24,163,254,253, 59,245,243,201,179, 49,168,
+237, 64,248,181,108, 9,162, 55,130, 38, 38,120,121,139,209,117,116,215,156,223,162,126,199,170, 77,169,234,181,107,215,202, 94,
+125,245, 85,167, 74,192,173, 91,183, 26,188,143, 29, 25,128,161,243,126,132, 78, 55,189,193, 64,238,216,177,195,229,254,145,203,
+229,228,192,129, 3, 30,235, 95, 79,203,107, 74, 36, 39, 39,199,184,155,214, 55, 57, 57, 57, 6,112, 61, 61,176, 82,169,236,247,
+218,107,175,221,208,104, 52, 97, 0,198,194,124, 8,103, 47, 0,167, 97, 62, 20, 10, 0, 62, 7,240,219,189,238, 31,246, 89, 15,
+115,230,204, 65,118,118,118, 3, 78,153, 61,123, 54,248,100, 46,117, 38,175,254,121,207,202, 34, 9, 9, 9, 20, 23,242,103,202,
+172,149,128, 6, 10, 64, 74, 74, 10, 41, 42, 42, 2, 0, 68, 68, 68,128,125,216,140, 74,165,106,240,222,250,115, 71, 22,123, 89,
+ 89,153, 90,165, 82,113,246, 4, 88,159,117,239,136,132, 95,176,164,194,180,230, 1,190, 46,246, 77,155, 54, 57,173,147,155,155,
+203,137,187, 18, 19, 19,237,146,254,226,197,139,145,154,154, 10,182,130,192, 5, 29,195, 31,192,245, 59,149,216,245,194, 84,180,
+166, 70,160,240,227, 5,136,152, 28,129,111,154,153,252, 1,212, 19, 62, 0,244,233,211,167, 65, 57,227, 25, 96,151,123,218,178,
+119, 66,196, 36, 49, 49,209, 46,233,111,219,182, 13,169,169,169,144,143, 24,136, 3, 63,158, 2, 2, 3,128,170,154,123,222,135,
+251, 15,156,244, 7, 54, 97,255,129,147, 30,145,119,243,189,214, 14,181,152,246, 11,203, 57, 61, 32,108,215,127, 82, 82, 14,226,
+226,186,212,255,103, 16, 23,215,133,179, 18,240,241,151, 31, 99,229, 71,239, 96,100,183, 24,152,234,234, 96, 52, 25, 65,121, 83,
+ 0,188, 64, 64,227,230, 95, 37,232,213,182, 39,150,190,176, 20,239,164,189,195,201, 27,101, 61,217,197,134,110,179, 73,248,211,
+167, 79, 39,174, 40, 1,114,185,156,236, 95,118, 0, 19,224, 25,210,150,203,229, 36, 45, 45, 13, 0,238,107, 37, 32, 57, 57, 57,
+166,178,178,146,241,150,185,213,206,202,202, 74,102, 78,119, 73,142, 66,161, 40, 2, 48, 11,192, 41, 0,159, 2, 24, 3, 96, 60,
+128,127,179, 20,128, 91,205,209, 79,236,227,158, 1,224,235,175, 27,107,240, 95,127,253, 53, 8, 33,152, 52,105, 18,197, 87,222,
+198,141, 27, 71, 89,230, 57, 2,128, 10, 9, 9,177, 75,252,214, 72, 74, 49,115,204,166,212,197, 54, 63,111,160, 0,164,166,166,
+ 58, 12, 2,100,191,183,254,220, 81, 16, 2,163, 84,204,159, 63, 95,157,146,146, 2,235,131,114,172, 15,207, 81,169, 84,142,210,
+ 23, 82, 28,202,154,245,161,250,234,171,175,236, 18,191, 69,209,170, 39,255,197,139, 23,115,146,249,103, 81, 49, 52,187,151, 67,
+ 58,251,191,232, 24,254, 0,218,183,246, 67,209,238, 34, 51,249, 7,181, 48, 47, 1,248,120,241,110,107, 92, 92,156,140,189, 12,
+ 96,121,207, 75, 6, 77,128,176, 0,224,195, 25,192,115,219,128,182,254,192,197, 10,219,229,231,239,240,107,159, 61, 69,142,143,
+215,230,237,183,223,182, 75,252, 0,144, 54,107, 34,214, 29, 60,142,144,136, 14, 40,189,122,211,169,245, 15, 0, 28,189, 0,156,
+189, 4,102, 11, 95, 97,211,210,231,178,254,111, 11,105, 95,120, 54,201, 39, 67,250,204,127,125, 92, 87,136,179, 11, 56,127,191,
+ 86, 91,139, 17,211,135,171,163, 59, 12, 69,157, 70, 3,111, 95, 95,120,123,223,157,130,138, 10, 10,176, 39, 43,235,250,236,103,
+103,117,236,236, 27,134,129,143, 14, 24, 45,213, 5,198,124,242,241, 39,188,172,198,119,247,207,194,247,223,127, 15,160, 97,219,
+118,236,216, 65,241, 85, 2, 24,242, 71,231,181,216,191,236, 85,183,149, 0,185, 92, 78,210,211,211,209,189,123,119,172, 91,183,
+ 14,115,231,206,189,239,148, 0, 43,226,247,136, 60, 70,150, 27,222, 4, 25,128, 71, 1,108, 3, 80, 3, 32, 4,192,239, 0,174,
+226,110,238,135,102,129,245,113,207,108,183,189,181, 11, 63, 33, 33,129, 56,115,225,239,223,191,191,193,146,241,158, 61,123,212,
+108,171,159,171, 66,204,144, 63,243,122, 83,234,226, 70, 94,128,123,146, 7,128,181,246,138,162,162, 34,180,107,215,174,145,130,
+192,148,149,149,149,113,205,115,239, 44, 24,144,243,132,249,248,227,143, 55,217,181,179, 9,204,150,213,111, 33, 33, 91,109,111,
+ 0, 45,138, 81, 51,121, 40, 72,224, 2, 96,244, 50,212,224, 75, 96,243, 73,139,102,182, 0, 62,207,172,131,209,200, 63,209, 89,
+118,118,118, 30,187,159,248,146, 63, 0,148,125, 2,188,181, 17,120,160, 19,112,115,175, 24, 25, 91,244,152,181,221,126, 57, 47,
+243,158,120,150,196,216,193,126, 55,190, 94,133,192, 72, 9,164,221, 94,193, 87,171,158, 67,255, 62, 33,232, 49,241, 29, 78,227,
+193,165,233, 60,150, 10, 40, 0,196,138,252, 41,134,248, 93, 89,215,231,106,225,115,129, 62,174,171,205,242, 28, 43, 79,128, 51,
+220, 40,187,129,177,137, 99, 17,216, 34, 24, 38,202,136,195,223,255,128,234,154, 26,196,197,199,227,175,178, 50,236,204,220,133,
+ 57,207,206,234,232, 43,241,133,136,248, 96,220, 67,227,114,127, 87,175,115, 73,161,191,115,231,142,219,215,205, 38,127, 0,110,
+ 43, 1,114,185,156,172, 88,177, 2, 93,187,154,251,179, 75,151, 46,184,159, 60, 1,158, 38,126, 27,214, 63,243,218,149,107,237,
+109,121, 38,125, 0,248, 3,136, 4,112, 1, 64, 71, 0, 85, 0, 42, 60,240,204,186, 4,235,227,158,231,204,153, 83, 95,198,184,
+240,153,185,140,139,103,218,222,114, 1,155,252,185, 40, 2, 92,112,207, 87,242, 20, 7, 0, 0, 9,178, 73, 68, 65, 84, 18, 1,
+181,107,215, 78,150,152,152,216,104, 41,192,114,182, 61, 0,240,142, 17,176, 23, 12,232,200,114,180,167,160, 52, 5, 24,235,222,
+158,187,159,171,245, 15, 0, 7,151,172, 64,220,202,247, 97, 28, 61, 2,222, 0,164,199, 10,240, 77, 97, 57, 0,192, 56,122, 46,
+ 12,191,182, 1,213,246,223,188, 73,138,135,151,197, 46,202, 39,125,137,185,207, 94,195,165, 23, 22, 65,243,173, 30, 33,109, 28,
+151,123,194, 3,224,138,114,176,109,219, 54,179, 54, 28,247, 8,142,151,148, 33,176,127, 32,174,231, 20, 2, 18, 95, 76,157,251,
+ 12, 90,117,154,216,156,243,175,189,168,127,143,120,181, 28,237, 16,112, 22, 59,144,147,148,131,113,155,198, 97,106, 38,144,148,
+ 99,126,157,147,148,195,219, 11, 80,163,171, 70, 27,191,214, 48,234,106, 65, 68, 4,131,135, 12,193,238,221,187,117,233,239,191,
+ 47,161, 9,193, 83, 51,158, 66,171,214,173, 80, 91, 83, 3,163,201,136, 64,159, 22, 48,136, 12, 46, 93,111, 69, 69, 69,131,221,
+ 1,124, 3, 2, 27,145, 63, 3, 23,149, 0,185, 92, 78, 82, 82, 82, 48,100,200,144, 6,229,125,250,244,193,187,239,190,219,172,
+ 74, 64, 83, 17,191,181,245, 15, 0, 37, 37, 37,174,122, 1,126,130,121,189,191, 10,102,215,255, 88, 0,151, 1,244, 3,144, 5,
+ 96, 43, 0,135, 55,139, 82,169, 20, 41, 20, 10,143,167,131,102,187,236, 89,129,122,245,159,179,151, 4, 74, 75, 75, 99,156, 29,
+244, 69, 8,161, 24,130,103,187,250, 19, 18, 18,108,150,123, 82, 1, 32, 86,164, 72,120,126,238, 16, 17, 17, 17,245,164, 31, 29,
+ 29, 45, 99, 98, 3, 24,239, 64, 68, 68,132,154, 89, 46,104,174,137,215,147,112,182,214,207,178,254,157, 98,202,198, 76,144,248,
+112,220, 28,246, 16, 90, 99, 4,252,166,174,131,241,198, 95, 64, 80, 11,120,151,127,137,189,233,249,128,151,151, 43,215,238,182,
+ 38,121,230,181,127, 97,208, 0, 32, 98,238, 57, 68, 74,159,197,239, 15, 38, 2, 31, 46,178, 91,222, 92, 30,128,212,212, 84,140,
+ 28,220, 3,163, 71,116, 71, 92,223, 69, 88,147,190, 1, 23,242,175,227,133, 81,131, 80,154,181, 31,149,119,170, 60,117, 63,216,
+ 90, 42,112, 74,208,108,194,247, 36,249,219,145,201, 9,197,197,197, 84, 88, 88, 24,153,154,217, 80, 33, 0,128,113,155,198, 65,
+156, 93,128,236,236,194,250,157, 0,236, 92, 1,182,110, 55,154,166, 97,162, 1, 66, 27,225,235, 39,193,140,167,159,150,188,245,
+230,155,104,223,190, 61,221, 49, 36, 68,164,211,212,192, 68, 0, 66,155, 64,211,206,231,234,140,140, 12,106,204,152, 49,164,188,
+188, 28, 85, 85, 85, 13, 20, 71,171,221, 1,156,119, 5,200,229,114,178,230,185,243,128,164, 43, 80,250, 81,227, 10,146,174, 88,
+243,220,121,128,163, 18, 32,151,203, 73, 66, 66,130,172, 79,159, 62,234,242,242,242, 70,159,135,133,133, 33, 33, 33, 65,134,251,
+ 60, 38,192, 93,235,223, 77, 47, 0, 91, 97,232, 0,224, 12,128,201, 0, 56, 31,101,218, 20,228, 15, 56, 94, 2,176, 97,204,228,
+ 57,187,246,248,248,120,194,124, 63, 62, 62,158, 88,203,219,178,101, 11,226,227,227, 9,223, 93, 1, 92, 20, 0, 62,137,128,108,
+125,110, 19,137,137,137, 54,189, 0, 12,217,183,107,215, 78,150,146,146,162,102,214,100, 19, 19, 19, 29, 6, 21, 58,178, 14, 93,
+216, 95,223, 36,219, 0, 25,235,222, 81, 48, 32, 31, 20,190,151, 4,159,169,235,160, 45,185, 4,239, 99,235, 96,200,156, 11,106,
+194,106,236,249,247, 52, 92,221,115, 5,113,105,159, 2,222,205,147,217,121,145, 10,200, 73,219,141,200,171,227,128, 91, 26, 44,
+ 28,179,200, 97,185, 39, 60, 0,174, 90,255, 89,187, 87,192,171, 99,111, 72,209, 29,197,223,111, 66, 53, 69,240,243,165,107, 24,
+125,238, 58,167,230,124,251,173,220, 46,217, 3,128,229,115,155,245,184,146,191,157,123,212, 45, 98,240,196, 14,129,164,156,187,
+196, 15,160,145,229,207, 4, 12,102,103, 23,218,252,126,160, 95, 32, 74, 42, 75, 48,164,243, 80,104,235,116,128, 86, 7,163,222,
+128,165, 41, 41,160, 68, 16,213,106,106, 64,211, 38, 24, 77, 4,190,222, 62,248,171,230, 47,248,152,156,239, 54,254,230,155,111,
+234,175,109,230,204,153,132,153,111,216,187, 3,110,220,184,193,249, 58,205, 36,108, 86, 2,122,133, 55,254,253,139, 87,244,152,
+191, 57, 18, 92,201,218, 82,143, 12, 25, 50, 4, 97, 97, 97,141, 62, 63,119,238, 28,178,178,178,212,205, 69,254, 22,107,156, 98,
+ 60, 1, 37, 37, 37, 77, 98,253,123,192, 11,192, 96,172,133, 72,235,238, 7, 37,199,209, 18, 0,187,156,239, 18,128,167,150, 20,
+248, 40, 0, 77, 2,198,242, 7,128,232,232,104,153, 74,165, 82, 51,174,127, 59,202,129,236,242,229,203,206, 98, 1, 40,142,101,
+ 30,181, 50,185,118, 56, 99,253,219, 34,126, 70,209,225,211,222, 51,133,229, 48,252,250, 22,110,226, 71,132, 76, 88, 13, 84, 86,
+161,112,211, 2,116, 73, 94,139,210,173, 11, 0, 31,111, 64,212, 60,153,157,139, 53, 64,175,118,147, 57,151, 55,135, 7, 32, 53,
+ 53,181,102,250,232,161, 55, 90,210,193, 15,212,194, 71,146,185,118, 46,214,239, 61,141,133,227, 31,198,172,247,191,192,180,255,
+247,127, 77,234, 13,114,116,137, 89, 95, 43, 97, 73, 2, 68,185,171,156,186,227,234,119,228, 5, 72,202,201, 33,182,200,159,109,
+253, 59, 67,104,187, 80, 28, 60,156,131,225, 15, 12,135,127,128, 20, 52, 77, 32, 34, 70,208, 20, 5, 66, 8, 76, 4, 48,210, 4,
+ 70,163, 17,218, 74, 13,246,253,178, 15, 98,147,152,247,214, 97,235, 93, 1,175,207, 29,129,216,208, 34, 80,135,184,203,176,167,
+ 4,240, 37,127,107, 37, 32, 45, 45, 13, 29, 58,116,184,171,216, 23, 22, 34, 53, 53, 21,247,131,229,239,105, 69,192,150,245,239,
+166, 23, 0, 0, 98, 0, 60, 8,224, 13, 52,115,240, 31, 3,165, 82,217,224, 30, 45, 45, 45,133, 82,169,116,228,137,112, 42,143,
+189,164, 80, 90, 90, 26,163, 84, 42, 41, 0,164,180,180,148,218,184,113, 35, 97,121,111, 41,133, 27,219,224,239,137, 2, 96, 29,
+245,111, 73, 86,211, 72, 57, 96,191,118,211,130,231,125, 99,121,112, 27,160, 77,235,223, 85,226,103, 48,101,213, 86,236, 2, 48,
+126,101, 44,136,106, 1,168,199,215,224, 76, 97, 57,168, 86,193, 40,248,179,202,108,253,243, 95, 2,240, 8,236,237,247,119, 39,
+ 15, 0, 23,133,139,171,114,176,109,219, 54, 61,128,234,231, 98,250, 85,189,178,250,191,250, 37, 75, 83,116,109, 91,180, 43, 63,
+127,161,184,253,172, 11, 95, 72,209,204,187, 70, 28,144, 51,123,137,134,231,142, 2,207,195, 22,249, 51,150, 63, 0,167, 1,129,
+243,230,205,163,134, 63, 54, 60, 94, 61, 34, 47, 43,177,239, 52, 84,233,170, 64,137, 0,115, 74, 17, 26, 38, 19, 1,109, 52, 34,
+192, 55, 16, 71, 43, 79,225,242,177, 2,236, 84,238,204,115,187,225,133,207, 3,224,191, 13,176,129, 18,208,161, 24, 23,111,132,
+185, 68,254,214, 74,192,186,117,235, 16, 20, 20,132,242,242,114,172, 88,177, 2,247,155,219,223, 19,138,128, 61,235,223, 69, 47,
+ 64,123,152,163,254, 69, 0, 6, 2,152, 15,160,240,126,233, 47,133,101, 43,186,167, 96,189,164,176,103,207,158,239,155,170,237,
+247, 36, 15,128, 61,143,192,154, 53,107,100,214,138, 66, 98, 98,162,154,239, 69,176,137,224,126, 72,177,203,182,254,173,183,255,
+ 89,250,151,221,175,156, 27,204, 40, 1,147, 87,126, 2,146, 9,180,153,165, 68,222, 43,211,240,112,234,231,128,143, 15, 2, 36,
+226,102,185, 94,246, 30,127, 91,175, 93,204, 3, 96, 4, 32,178,140,173,200,205,241,184, 57,125,244,208,146, 87, 54,101,135, 47,
+157, 51,182, 69,104, 72,140, 30,192,217,196,196,196,150, 48, 31, 37,235,210,120, 48,183,220,183,223,202,153,136,127, 87,148, 59,
+202,153, 5,207,135,208,155, 42, 25,144, 61, 88,147, 62,227, 17,104,213,170,149, 77,237,236,232,183, 71,247,132,245,124, 0,166,
+233,198,179,143, 62,240,104,191,214,129,173,161, 51,232, 64, 8,129,216, 91,140, 10,109, 45,142,255,249, 45,182,125,150, 1, 89,
+111,153,108, 39,118,186,221,198,119,247,207, 66, 70, 70, 6, 46, 95,230,159, 3,224,174, 18, 0,183,200,159, 45,111,238,220,185,
+ 36, 45, 45, 13,139, 22, 45,194,253,188,230,207, 86, 4,242,242,242, 92,250,174,163, 58, 60,100, 38,192,188,223, 95, 7,224, 53,
+ 0,191, 0, 48,225, 31, 10,235, 37, 0,190, 24, 48, 96, 0, 78,159, 62,141, 77,169,139, 27,229, 1,112,152, 8,168,169,242, 0,
+216,242, 8,216, 35,122, 23,189, 0,110,161,169,182, 1, 50, 3,168, 84, 42,145,155,155, 75, 23, 21, 21,177,137, 76,166, 82,169,
+120,107,142, 83, 86,109, 5, 88,137,127, 30, 93,186,177,254,181,166,121,238, 87,167,119, 41, 77, 92,234,187,116, 0,183, 97,222,
+254, 51,195,205, 54,150, 62, 23,211,175,110, 76,238, 79, 45,158,122,243, 83, 40,149, 74,113,110,110,110, 7, 52, 76,103,237,210,
+120, 52,181, 39,192, 89,126,127,167, 51,103, 19, 44, 9,216, 35,127,125, 92, 87, 32,219,185, 97,182,253,163, 29, 84,128,151,148,
+ 28, 11, 59,142, 17, 67, 71,160, 99, 96, 71,128, 38,248, 75, 87,142,163, 39,143,162,244,124, 41, 70,245, 26, 37,123,249,229,151,
+155,125, 60,216, 74,128,167,200,154,241, 4,252, 93, 2,254,220,205, 2,232, 1,108,178,252,253, 79,192,122, 73,193, 29, 23,191,
+189, 4, 64, 54, 21,128,166,194,252,249,243,109,146,189,213, 73,108,108,168, 29, 36, 2,178, 75,180,174,162, 41,182, 1,166,166,
+166, 66,169, 84, 26,115,115,115,189, 45, 75, 7, 12,249,143,114,112,221, 54, 97, 57, 76, 73,221, 4, 67, 67, 28,148, 83,205,116,
+243,251, 90,238,203,101,150, 34,147, 66,161,120,218, 77,177,190, 99,222,248, 56, 95,169, 84, 62,146,155,155,139,220,220, 92, 29,
+ 0,137,229,207, 19,196, 79,185,147, 26,216, 25,201, 39, 76, 82, 52, 24, 47,190,196,237,137, 37,129,226,226, 98, 42, 39, 41,135,
+132,206, 13,149,161,179,237, 58, 37, 73, 57,106,174,241, 0, 91, 62,216, 66,173, 93,187, 54,102,235,202,173, 8,235,250,160, 26,
+ 0,126, 63,247,155,108,226,152, 56,164,111, 72,207,219,142,237, 46,181, 51, 35, 35,131, 26, 59,118,108,163, 93, 1, 6,131,193,
+173,235,247, 52, 89,255,211,162,253,239, 3,210,164, 20, 10, 5,249, 39, 92,139, 39,150, 20, 24, 47,128,117, 25,103, 5,192,153,
+ 37,206,195, 82,119,245, 70, 39, 77, 44,223, 83,223,183, 41, 47, 49, 49,145,228,230,230,122,179,251,139,237, 97,225,169,160,228,
+ 53, 17, 33,223,143,147, 80, 32,128, 26,115, 66,126,138, 2,224, 7, 39,251,123, 57,142,199, 31,185,185,185,204, 54,160,170,136,
+136,136,182,169,169,169,190,247, 67, 95, 54,165,219,222,147,178,139,139,139,169,226,133,197, 30,235, 3, 86,158,255,250,239, 29,
+253,238,152,219,237, 60,116,232,144, 64,174,255,112,178,103,115,152, 66,161, 48,120,146,252,149, 74,101,144, 66,161,168,248,187,
+247, 19, 23, 35,154,114,245, 28, 97, 1, 2, 4, 8, 16, 32, 64,192,223, 23, 34,161, 11, 4, 8, 16, 32, 64,128, 0, 65, 1, 16,
+ 32, 64,128, 0, 1, 2, 4,252, 15,224,255, 3, 40, 50, 24,122,163,191,209,130, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
0};
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 529a795a101..425ec8956cb 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -1573,6 +1573,18 @@ static void build_uvlayer_menu_vars(CustomData *data, char **menu_string,
}
}
+void set_wave_uvlayer(void *arg1, void *arg2)
+{
+ WaveModifierData *wmd=arg1;
+ CustomDataLayer *layer = arg2;
+
+ /*check we have UV layers*/
+ if (wmd->uvlayer_tmp < 1) return;
+ layer = layer + (wmd->uvlayer_tmp-1);
+
+ strcpy(wmd->uvlayer_name, layer->name);
+}
+
void set_displace_uvlayer(void *arg1, void *arg2)
{
DisplaceModifierData *dmd=arg1;
@@ -1826,6 +1838,16 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
height = 94;
} else if (md->type==eModifierType_Explode) {
height = 94;
+ } else if (md->type==eModifierType_Shrinkwrap) {
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
+ height = 86 + 3;
+ if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT)
+ {
+ height += 19*5;
+ if(smd->projAxis == 0) height += 19;
+ }
+ else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE)
+ height += 19;
}
/* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */
uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, "");
@@ -1833,6 +1855,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
y -= 18;
if (!isVirtual && (md->type!=eModifierType_Collision)) {
+ uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); /* only here obdata, the rest of modifiers is ob level */
+
uiBlockBeginAlign(block);
if (md->type==eModifierType_ParticleSystem) {
but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Convert", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Convert the current particles to a mesh object");
@@ -1848,6 +1872,8 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
uiButSetFunc(but, modifiers_copyModifier, ob, md);
}
uiBlockEndAlign(block);
+
+ uiSetButLock(ob && ob->id.lib, ERROR_LIBDATA_MESSAGE);
}
lx = x + 10;
@@ -1929,7 +1955,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
uiBlockBeginAlign(block);
uiDefButF(block, NUM, B_MODIFIER_RECALC, "Width: ",
lx, (cy -= 19), buttonWidth, 19, &bmd->value,
- 0.0, 0.5, 5, 2,
+ 0.0, 0.5, 5, 4,
"Bevel value/amount");
/*uiDefButI(block, NUM, B_MODIFIER_RECALC, "Recurs",
lx, (cy -= 19), buttonWidth, 19, &bmd->res,
@@ -2183,7 +2209,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
0.0, 1.0, 0, 0, "Set the UV layer to use");
MEM_freeN(strtmp);
i = CustomData_get_layer_index(fdata, CD_MTFACE);
- uiButSetFunc(but, set_displace_uvlayer, wmd,
+ uiButSetFunc(but, set_wave_uvlayer, wmd,
&fdata->layers[i]);
}
if(wmd->texmapping == MOD_DISP_MAP_OBJECT) {
@@ -2446,6 +2472,51 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
uiDefButBitS(block, TOG, eExplodeFlag_Alive, B_MODIFIER_RECALC, "Alive", lx+buttonWidth/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are alive");
uiDefButBitS(block, TOG, eExplodeFlag_Dead, B_MODIFIER_RECALC, "Dead", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are dead");
uiBlockEndAlign(block);
+ } else if (md->type==eModifierType_Shrinkwrap) {
+ ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
+
+ char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|projection %x1|nearest vertex %x2";
+
+ uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to");
+
+ but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name");
+ uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
+
+ uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keepDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to keep from the target");
+
+ cy -= 3;
+ uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position.");
+
+ if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT){
+
+
+ /* UI for projection axis */
+ uiBlockBeginAlign(block);
+ uiDefButC(block, ROW, B_MODIFIER_RECALC, "Normal" , lx,(cy-=19),buttonWidth,19, &smd->projAxis, 18.0, MOD_SHRINKWRAP_PROJECT_OVER_NORMAL, 0, 0, "Projection over X axis");
+ if(smd->projAxis == 0)
+ {
+ uiDefButC(block, NUM, B_MODIFIER_RECALC, "SS Levels:", lx, (cy-=19), buttonWidth,19, &smd->subsurfLevels, 0, 6, 0, 0, "This indicates the number of CCSubdivisions that must be performed before extracting vertexs positions and normals");
+ }
+
+ uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS, B_MODIFIER_RECALC, "X", lx+buttonWidth/3*0,(cy-=19),buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over X axis");
+ uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS, B_MODIFIER_RECALC, "Y", lx+buttonWidth/3*1,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Y axis");
+ uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, B_MODIFIER_RECALC, "Z", lx+buttonWidth/3*2,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Z axis");
+
+
+ /* allowed directions of projection axis */
+ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR, B_MODIFIER_RECALC, "Negative", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows to move the vertex in the negative direction of axis");
+ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, B_MODIFIER_RECALC, "Positive", lx + buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows to move the vertex in the positive direction of axis");
+
+ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces",lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target");
+ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx+buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target");
+ uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->auxTarget, "Aditional mesh to project over");
+ }
+ else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){
+ uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces");
+ }
+
+ uiBlockEndAlign(block);
+
}
uiBlockEndAlign(block);
@@ -2485,7 +2556,7 @@ static void editing_panel_modifiers(Object *ob)
block= uiNewBlock(&curarea->uiblocks, "editing_panel_modifiers", UI_EMBOSS, UI_HELV, curarea->win);
if( uiNewPanel(curarea, block, "Modifiers", "Editing", 640, 0, 318, 204)==0) return;
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+ uiSetButLock((ob && ob->id.lib), ERROR_LIBDATA_MESSAGE);
uiNewPanelHeight(block, 204);
uiDefBlockBut(block, modifiers_add_menu, ob, "Add Modifier", 0, 190, 130, 20, "Add a new modifier");
@@ -4145,7 +4216,7 @@ static void validate_posebonebutton_cb(void *bonev, void *namev)
static void armature_layer_cb(void *lay_v, void *value_v)
{
short *layer= lay_v;
- int value= (long)value_v;
+ int value= (intptr_t)value_v;
if(*layer==0 || G.qual==0) *layer= value;
allqueue(REDRAWBUTSEDIT, 0);
@@ -4371,11 +4442,12 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm)
uiDefButF(block, NUM,B_ARM_RECALCDATA, "Weight:", 225, by-19,105, 18, &curBone->weight, 0.0F, 1000.0F, 10.0F, 0.0F, "Bone deformation weight");
/* bone types */
- uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone");
- uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone");
- uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 90, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry");
- uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup");
- uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 250,by-38,80,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode");
+ uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,60,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone");
+ uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 50,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone");
+ uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 70, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry");
+ uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 150,by-38,60,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup");
+ uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 210,by-38,60,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode");
+ uiDefButBitI(block, TOG, BONE_EDITMODE_LOCKED, REDRAWVIEW3D, "Lock", 270,by-38,60,18, &curBone->flag, 0, 0, 0, 0, "Prevents this bone from being transformed in Edit Mode");
/* layers */
uiBlockBeginAlign(block);
@@ -5670,13 +5742,9 @@ void sculptmode_draw_interface_textures(uiBlock *block, unsigned short cx, unsig
void do_fpaintbuts(unsigned short event)
{
- Mesh *me;
Object *ob;
bDeformGroup *defGroup;
- MTFace *activetf, *tf;
- MFace *mf;
- MCol *activemcol;
- int a;
+ MTFace *activetf;
SculptData *sd= &G.scene->sculptdata;
ID *id, *idtest;
extern VPaint Gwp; /* from vpaint */
@@ -5694,45 +5762,19 @@ void do_fpaintbuts(unsigned short event)
vpaint_dogamma();
break;
case B_COPY_TF_MODE:
+ EM_mesh_copy_face(4); /* todo, get rid of magic numbers */
+ break;
+ case B_COPY_TF_TRANSP:
+ EM_mesh_copy_face(5);
+ break;
case B_COPY_TF_UV:
+ EM_mesh_copy_face(3);
+ break;
case B_COPY_TF_COL:
+ EM_mesh_copy_face(6);
+ break;
case B_COPY_TF_TEX:
- me= get_mesh(OBACT);
- activetf= get_active_mtface(NULL, &activemcol, 0);
-
- if(me && activetf) {
- for (a=0, tf=me->mtface, mf=me->mface; a < me->totface; a++, tf++, mf++) {
- if(tf!=activetf && (mf->flag & ME_FACE_SEL)) {
- if(event==B_COPY_TF_MODE) {
- tf->mode= activetf->mode;
- tf->transp= activetf->transp;
- }
- else if(event==B_COPY_TF_UV) {
- memcpy(tf->uv, activetf->uv, sizeof(tf->uv));
- tf->tpage= activetf->tpage;
- tf->tile= activetf->tile;
-
- if(activetf->mode & TF_TILES) tf->mode |= TF_TILES;
- else tf->mode &= ~TF_TILES;
-
- }
- else if(event==B_COPY_TF_TEX) {
- tf->tpage= activetf->tpage;
- tf->tile= activetf->tile;
-
- if(activetf->mode & TF_TILES) tf->mode |= TF_TILES;
- else tf->mode &= ~TF_TILES;
- }
- else if(event==B_COPY_TF_COL && activemcol)
- memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4);
- }
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- do_shared_vertexcol(me);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- }
+ EM_mesh_copy_face(2);
break;
case B_SET_VCOL:
if(FACESEL_PAINT_TEST)
@@ -6169,8 +6211,20 @@ static void editing_panel_mesh_texface(void)
if(uiNewPanel(curarea, block, "Texture Face", "Editing", 960, 0, 318, 204)==0) return;
tf = get_active_mtface(NULL, NULL, 0);
+
if(tf) {
+ uiDefBut(block, LABEL, B_NOP, "Active Face Mode", 600,185,300,19, NULL, 0.0, 0.0, 0, 0, "Face mode its used for TexFace display and the game engine ");
+ uiDefBut(block, BUT,B_COPY_TF_MODE, "Copy", 850,185,50,19, 0, 0, 0, 0, 0, "Copy active faces mode to other selected (View3D Ctrl+C)");
+
+ /* Other copy buttons, layout isnt that nice */
+ uiBlockBeginAlign(block);
+ uiDefBut(block, BUT,B_COPY_TF_UV, "CopyUV", 600,15,100,19, 0, 0, 0, 0, 0, "Copy active faces UVs to other selected (View3D Ctrl+C)");
+ uiDefBut(block, BUT,B_COPY_TF_TEX, "CopyTex", 700,15,100,19, 0, 0, 0, 0, 0, "Copy active faces Texture to other selected (View3D Ctrl+C)");
+ uiDefBut(block, BUT,B_COPY_TF_COL, "CopyColor", 800,15,100,19, 0, 0, 0, 0, 0, "Copy active faces Color to other selected (View3D Ctrl+C)");
+ uiBlockEndAlign(block);
+
uiBlockBeginAlign(block);
+
uiDefButBitS(block, TOG, TF_TEX, B_REDR_3D_IMA, "Tex", 600,160,60,19, &tf->mode, 0, 0, 0, 0, "Render face with texture");
uiDefButBitS(block, TOG, TF_TILES, B_REDR_3D_IMA, "Tiles", 660,160,60,19, &tf->mode, 0, 0, 0, 0, "Use tilemode for face");
uiDefButBitS(block, TOG, TF_LIGHT, REDRAWVIEW3D, "Light", 720,160,60,19, &tf->mode, 0, 0, 0, 0, "Use light for face");
@@ -6181,23 +6235,30 @@ static void editing_panel_mesh_texface(void)
uiDefButBitS(block, TOG, TF_SHAREDCOL, REDRAWVIEW3D, "Shared", 600,135,60,19, &tf->mode, 0, 0, 0, 0, "Blend vertex colors across face when vertices are shared");
uiDefButBitS(block, TOG, TF_TWOSIDE, REDRAWVIEW3D, "Twoside",660,135,60,19, &tf->mode, 0, 0, 0, 0, "Render face twosided");
uiDefButBitS(block, TOG, TF_OBCOL, REDRAWVIEW3D, "ObColor",720,135,60,19, &tf->mode, 0, 0, 0, 0, "Use ObColor instead of vertex colors");
-
- uiBlockBeginAlign(block);
+ uiBlockEndAlign(block);
+ uiBlockBeginAlign(block);
uiDefButBitS(block, TOG, TF_BILLBOARD, B_TFACE_HALO, "Halo", 600,110,60,19, &tf->mode, 0, 0, 0, 0, "Screen aligned billboard");
uiDefButBitS(block, TOG, TF_BILLBOARD2, B_TFACE_BILLB, "Billboard",660,110,60,19, &tf->mode, 0, 0, 0, 0, "Billboard with Z-axis constraint");
uiDefButBitS(block, TOG, TF_SHADOW, REDRAWVIEW3D, "Shadow", 720,110,60,19, &tf->mode, 0, 0, 0, 0, "Face is used for shadow");
uiDefButBitS(block, TOG, TF_BMFONT, REDRAWVIEW3D, "Text", 780,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable bitmap text on face");
-
+ uiDefButBitS(block, TOG, TF_ALPHASORT, REDRAWVIEW3D, "Sort", 840,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)");
+ uiBlockEndAlign(block);
+
+ uiDefBut(block, LABEL, B_NOP, "Active Face Alpha Blending (Transp)", 600,75,300,19, NULL, 0.0, 0.0, 0, 0, "Face mode its used for TexFace display and the game engine");
+ uiDefBut(block, BUT,B_COPY_TF_TRANSP, "Copy", 850,75,50,19, 0, 0, 0, 0, 0, "Copy active faces transp to other selected (View3D Ctrl+C)");
+
uiBlockBeginAlign(block);
uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,80,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,80,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,80,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha", 780,80,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)");
- }
- else
+ uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,50,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color");
+ uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,50,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face");
+ uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,50,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture");
+ uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha", 780,50,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)");
+ uiBlockEndAlign(block);
+
+ } else {
uiDefBut(block,LABEL,B_NOP, "(No Active Face)", 10,200,150,19,0,0,0,0,0,"");
+ }
}
@@ -6232,6 +6293,11 @@ static void editing_panel_mesh_uvautocalculation(void)
row= 180;
uiDefButBitS(block, TOGN, UVCALC_NO_ASPECT_CORRECT, B_NOP, "Image Aspect",100,row,200,butH,&G.scene->toolsettings->uvcalc_flag, 0, 0, 0, 0, "Scale the UV Unwrapping to correct for the current images aspect ratio");
+
+ row-= butHB+butS;
+ uiDefButBitS(block, TOG, UVCALC_TRANSFORM_CORRECT, B_NOP, "Transform Correction",100,row,200,butH,&G.scene->toolsettings->uvcalc_flag, 0, 0, 0, 0, "Correct for UV distortion while transforming, (only works with edge slide now)");
+
+ row= 180;
uiBlockBeginAlign(block);
uiDefButF(block, NUM,B_UVAUTO_CUBESIZE ,"Cube Size:",315,row,200,butH, &G.scene->toolsettings->uvcalc_cubesize, 0.0001, 100.0, 10, 3, "Defines the cubemap size for cube mapping");
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c
index 6b29a05bd22..df76534f3f5 100644
--- a/source/blender/src/buttons_logic.c
+++ b/source/blender/src/buttons_logic.c
@@ -683,6 +683,8 @@ static char *sensor_name(int type)
return "Property";
case SENS_ACTUATOR:
return "Actuator";
+ case SENS_DELAY:
+ return "Delay";
case SENS_MOUSE:
return "Mouse";
case SENS_COLLISION:
@@ -704,7 +706,7 @@ static char *sensor_name(int type)
static char *sensor_pup(void)
{
/* the number needs to match defines in game.h */
- return "Sensors %t|Always %x0|Keyboard %x3|Mouse %x5|"
+ return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|"
"Touch %x1|Collision %x6|Near %x2|Radar %x7|"
"Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12";
}
@@ -1000,6 +1002,7 @@ static int get_col_sensor(int type)
{
switch(type) {
case SENS_ALWAYS: return TH_BUT_ACTION;
+ case SENS_DELAY: return TH_BUT_ACTION;
case SENS_TOUCH: return TH_BUT_NEUTRAL;
case SENS_COLLISION: return TH_BUT_SETTING;
case SENS_NEAR: return TH_BUT_SETTING1;
@@ -1070,8 +1073,8 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
bRaySensor *raySens = NULL;
bMessageSensor *mes = NULL;
bJoystickSensor *joy = NULL;
- bActuatorSensor *as = NULL;
-
+ bActuatorSensor *as = NULL;
+ bDelaySensor *ds = NULL;
short ysize;
char *str;
@@ -1297,6 +1300,27 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
yco-= ysize;
break;
}
+ case SENS_DELAY:
+ {
+ ysize= 48;
+
+ glRects(xco, yco-ysize, xco+width, yco);
+ uiEmboss((float)xco, (float)yco-ysize,
+ (float)xco+width, (float)yco, 1);
+
+ draw_default_sensor_header(sens, block, xco, yco, width);
+ ds = sens->data;
+
+ uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19,
+ &ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of frames before the positive trigger");
+ uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19,
+ &ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of frames before the negative trigger following the positive trigger");
+ uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44),
+ (short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0,
+ "Toggle repeat option. If selected, the sensor restarts after Delay+Dur frames");
+ yco-= ysize;
+ break;
+ }
case SENS_MOUSE:
{
ms= sens->data;
@@ -1366,9 +1390,14 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
&raySens->propname, 0, 31, 0, 0,
"Only look for Objects with this property");
}
-
+
+ /* X-Ray option */
+ uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X",
+ xco + 10,yco - 68, 0.10 * (width-20), 19,
+ &raySens->mode, 0.0, 0.0, 0, 0,
+ "Toggle X-Ray option (see through objects that don't have the property)");
/* 2. sensing range */
- uiDefButF(block, NUM, 1, "Range", xco+10, yco-68, 0.6 * (width-20), 19,
+ uiDefButF(block, NUM, 1, "Range", xco+10 + 0.10 * (width-20), yco-68, 0.5 * (width-20), 19,
&raySens->range, 0.01, 10000.0, 100, 0,
"Sense objects no farther than this distance");
@@ -1415,10 +1444,13 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
draw_default_sensor_header(sens, block, xco, yco, width);
joy= sens->data;
-
+
+ uiDefButS(block, NUM, 1, "Index:", xco+10, yco-44, 0.6 * (width-120), 19,
+ &joy->joyindex, 0, SENS_JOY_MAXINDEX-1, 100, 0,
+ "Spesify which joystick to use");
str= "Type %t|Button %x0|Axis %x1|Hat%x2";
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, 0.6 * (width-20), 19,
+ uiDefButS(block, MENU, B_REDR, str, xco+87, yco-44, 0.6 * (width-150), 19,
&joy->type, 0, 31, 0, 0,
"The type of event this joystick sensor is triggered on.");
@@ -1654,53 +1686,66 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
wval = (width-100)/3;
if (oa->type == ACT_OBJECT_NORMAL)
{
- ysize= 175;
-
+ if ( ob->gameflag & OB_DYNAMIC )
+ {
+ ysize= 175;
+ }
+ else
+ {
+ ysize= 72;
+ }
+
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefBut(block, LABEL, 0, "Force", xco, yco-45, 55, 19, NULL, 0, 0, 0, 0, "Sets the force");
- uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, "");
+ uiDefBut(block, LABEL, 0, "Loc", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the location");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, "");
- uiDefBut(block, LABEL, 0, "Torque", xco, yco-64, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque");
- uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefBut(block, LABEL, 0, "dLoc", xco, yco-87, 45, 19, NULL, 0, 0, 0, 0, "Sets the dLoc");
- uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefBut(block, LABEL, 0, "dRot", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Sets the dRot");
- uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, "");
+ uiDefBut(block, LABEL, 0, "Rot", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the rotation");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, "");
+
+ uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+ uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+
+ if ( ob->gameflag & OB_DYNAMIC )
+ {
+ uiDefBut(block, LABEL, 0, "Force", xco, yco-87, 55, 19, NULL, 0, 0, 0, 0, "Sets the force");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, "");
- uiDefBut(block, LABEL, 0, "linV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity");
- uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, "");
+ uiDefBut(block, LABEL, 0, "Torque", xco, yco-106, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, "");
+ }
- uiDefBut(block, LABEL, 0, "angV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity");
- uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, "");
+ if ( ob->gameflag & OB_DYNAMIC )
+ {
+ uiDefBut(block, LABEL, 0, "LinV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, "");
- uiDefBut(block, LABEL, 0, "damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity");
- uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, "");
-
- uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+ uiDefBut(block, LABEL, 0, "AngV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, "");
- uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
+ uiDefBut(block, LABEL, 0, "Damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity");
+ uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, "");
+
+ uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+ uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+ uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+ uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
+ uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
+ }
} else if (oa->type == ACT_OBJECT_SERVO)
{
ysize= 172;
@@ -1820,7 +1865,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
but = uiDefButBitS(block, TOG, ACT_IPOFORCE, ACT_IPOFORCE,
"Force", xco+10+(width-20)/2, yco-24, (width-20)/4-10, 19,
&ia->flag, 0, 0, 0, 0,
- "Convert Ipo to force. Force is applied in global or local coordinate according to Local flag");
+ "Apply Ipo as a global or local force depending on the local option (dynamic objects only)");
uiButSetFunc(but, change_ipo_actuator, but, ia);
but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD,
@@ -1985,7 +2030,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
if(eoa->type==ACT_EDOB_ADD_OBJECT) {
int wval; /* just a temp width */
- ysize = 72;
+ ysize = 92;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
@@ -2005,9 +2050,27 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19,
eoa->linVelocity+2, -100.0, 100.0, 10, 0,
"Velocity upon creation, z component.");
- uiDefButBitS(block, TOG, 2, 0, "L", xco+45+3*wval, yco-68, 15, 19,
+ uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_LINV, 0, "L", xco+45+3*wval, yco-68, 15, 19,
&eoa->localflag, 0.0, 0.0, 0, 0,
"Apply the transformation locally");
+
+
+ uiDefBut(block, LABEL, 0, "AngV", xco, yco-90, 45, 19,
+ NULL, 0, 0, 0, 0,
+ "Angular velocity upon creation.");
+ uiDefButF(block, NUM, 0, "", xco+45, yco-90, wval, 19,
+ eoa->angVelocity, -10000.0, 10000.0, 10, 0,
+ "Angular velocity upon creation, x component.");
+ uiDefButF(block, NUM, 0, "", xco+45+wval, yco-90, wval, 19,
+ eoa->angVelocity+1, -10000.0, 10000.0, 10, 0,
+ "Angular velocity upon creation, y component.");
+ uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-90, wval, 19,
+ eoa->angVelocity+2, -10000.0, 10000.0, 10, 0,
+ "Angular velocity upon creation, z component.");
+ uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_ANGV, 0, "L", xco+45+3*wval, yco-90, 15, 19,
+ &eoa->localflag, 0.0, 0.0, 0, 0,
+ "Apply the rotation locally");
+
}
else if(eoa->type==ACT_EDOB_END_OBJECT) {
@@ -2088,8 +2151,8 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
uiDefBut(block, LABEL, 0, "Range", xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, "Set the maximum length of ray");
uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, "Dist", xco+80+(width-115)/2, yco-45, (width-115)/2, 19, &coa->flag, 0.0, 0.0, 0, 0, "Force distance of object to point of impact of ray");
- if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRMX)) fp= coa->minloc;
- else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRMY)) fp= coa->minloc+1;
+ if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
+ else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
else fp= coa->minloc+2;
uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray");
@@ -2287,7 +2350,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
visAct = act->data;
- str= "Visibility %t|Visible %x0|Invisible %x1";
+ str= "Visibility %t|Visible %x0|Invisible %x1|Visible Recursive %x2|Invisible Recursive %x3";
uiDefButI(block, MENU, B_REDR, str,
xco + 10, yco - 24, width - 20, 19, &visAct->flag,
@@ -3042,6 +3105,9 @@ void logic_buts(void)
int a, iact, stbit, offset;
short xco, yco, count, width, ycoo;
char *pupstr, name[32];
+ /* pin is a bool used for actuator and sensor drawing with states
+ * pin so changing states dosnt hide the logic brick */
+ char pin;
wrld= G.scene->world;
@@ -3170,7 +3236,8 @@ void logic_buts(void)
while(cont) {
for (iact=0; iact<cont->totlinks; iact++) {
act = cont->links[iact];
- act->flag |= ACT_LINKED;
+ if (act)
+ act->flag |= ACT_LINKED;
}
controller_state_mask |= cont->state_mask;
cont = cont->next;
@@ -3218,7 +3285,8 @@ void logic_buts(void)
/* this controller is visible, mark all its actuator */
for (iact=0; iact<cont->totlinks; iact++) {
act = cont->links[iact];
- act->flag |= ACT_VISIBLE;
+ if (act)
+ act->flag |= ACT_VISIBLE;
}
uiBlockSetEmboss(block, UI_EMBOSSM);
uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller");
@@ -3300,18 +3368,25 @@ void logic_buts(void)
sens= ob->sensors.first;
while(sens) {
if (!(G.buts->scaflag & BUTS_SENS_STATE) ||
- sens->totlinks == 0 || /* always display sensor without links so that is can be edited */
- is_sensor_linked(block, sens)) {
+ (sens->totlinks == 0) || /* always display sensor without links so that is can be edited */
+ (sens->flag & SENS_PIN && G.buts->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */
+ (is_sensor_linked(block, sens))
+ ) {
+ /* should we draw the pin? - for now always draw when there is a state */
+ pin = (G.buts->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1:0 ;
+
sens->flag |= SENS_VISIBLE;
uiBlockSetEmboss(block, UI_EMBOSSM);
uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor");
+ if (pin)
+ uiDefIconButBitS(block, ICONTOG, SENS_PIN, B_REDR, (sens->flag & SENS_PIN) ? ICON_PIN_DEHLT:ICON_PIN_HLT, (short)(xco+width-44), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings");
ycoo= yco;
if(sens->flag & SENS_SHOW)
{
- uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 100, 19, &sens->type, 0, 0, 0, 0, "Sensor type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, sens->name, 0, 31, 0, 0, "Sensor name");
+ uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, 19, &sens->type, 0, 0, 0, 0, "Sensor type");
+ but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens->name, 0, 31, 0, 0, "Sensor name");
uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
sens->otype= sens->type;
@@ -3321,9 +3396,9 @@ void logic_buts(void)
else {
set_col_sensor(sens->type, 1);
glRecti(xco+22, yco, xco+width-22,yco+19);
- but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 100, 19, sens, 0, 0, 0, 0, "");
+ but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, 19, sens, 0, 0, 0, 0, "");
uiButSetFunc(but, sca_move_sensor, sens, NULL);
- but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+122), yco, (short)(width-144), 19, sens, 0, 31, 0, 0, "");
+ but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens, 0, 31, 0, 0, "");
uiButSetFunc(but, sca_move_sensor, sens, NULL);
}
@@ -3372,16 +3447,22 @@ void logic_buts(void)
while(act) {
if (!(G.buts->scaflag & BUTS_ACT_STATE) ||
!(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */
- (act->flag & ACT_VISIBLE)) { /* this actuator has visible connection, display it */
+ (act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */
+ (act->flag & ACT_PIN && G.buts->scaflag & BUTS_ACT_STATE)) {
+
+ pin = (G.buts->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1:0 ;
+
act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */
uiBlockSetEmboss(block, UI_EMBOSSM);
uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator");
- uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Actuator settings");
-
+ if (pin)
+ uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, (act->flag & ACT_PIN) ? ICON_PIN_DEHLT:ICON_PIN_HLT, (short)(xco+width-44), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
+ uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display the actuator");
+
if(act->flag & ACT_SHOW) {
act->otype= act->type;
- uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 100, 19, &act->type, 0, 0, 0, 0, "Actuator type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, act->name, 0, 31, 0, 0, "Actuator name");
+ uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, 19, &act->type, 0, 0, 0, 0, "Actuator type");
+ but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act->name, 0, 31, 0, 0, "Actuator name");
uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
ycoo= yco;
@@ -3391,9 +3472,9 @@ void logic_buts(void)
else {
set_col_actuator(act->type, 1);
glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19));
- but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 100, 19, act, 0, 0, 0, 0, "Actuator type");
+ but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, 19, act, 0, 0, 0, 0, "Actuator type");
uiButSetFunc(but, sca_move_actuator, act, NULL);
- but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+122), yco, (short)(width-144), 19, act, 0, 0, 0, 0, "Actuator name");
+ but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act, 0, 0, 0, 0, "Actuator name");
uiButSetFunc(but, sca_move_actuator, act, NULL);
ycoo= yco;
}
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index ebe770c89e7..18384dd90b3 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -173,6 +173,7 @@ static void constraint_active_func(void *ob_v, void *con_v)
}
lb= get_active_constraints(ob);
+ if (lb == NULL) return;
for(con= lb->first; con; con= con->next) {
if(con==con_v) con->flag |= CONSTRAINT_ACTIVE;
@@ -307,7 +308,7 @@ void del_constr_func (void *ob_v, void *con_v)
}
/* remove constraint itself */
lb= get_active_constraints(ob_v);
- free_constraint_data (con);
+ free_constraint_data(con);
BLI_freelinkN(lb, con);
constraint_active_func(ob_v, NULL);
@@ -480,7 +481,7 @@ static void draw_constraint_spaceselect (uiBlock *block, bConstraint *con, short
/* Target-Space */
if (target == 1) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1",
+ uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1",
tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in");
}
else if (target == 0) {
@@ -490,7 +491,7 @@ static void draw_constraint_spaceselect (uiBlock *block, bConstraint *con, short
/* Owner-Space */
if (owner == 1) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1",
+ uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1",
ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in");
}
else if (owner == 0) {
@@ -2589,19 +2590,32 @@ static void object_panel_object(Object *ob)
/* all groups */
for(group= G.main->group.first; group; group= group->id.next) {
if(object_in_group(ob, group)) {
- xco= 160;
+ xco= 130;
+ if(group->id.lib) {
+ uiBlockBeginAlign(block);
+ uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE); /* We cant actually use this button */
+ uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 100, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
+ uiClearButLock();
+
+ but= uiDefIconBut(block, BUT, B_NOP, ICON_PARLIB, 110, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Make Group local");
+ uiButSetFunc(but, group_local, group, NULL);
+ uiBlockEndAlign(block);
+ } else {
+ but = uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 120, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
+ uiButSetFunc(but, test_idbutton_cb, group->id.name, NULL);
+ }
+
+ uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE);
uiBlockBeginAlign(block);
- uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE); /* We cant actually use this button */
- but = uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 150, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
- uiButSetFunc(but, test_idbutton_cb, group->id.name, NULL);
+ uiDefButF(block, NUM, REDRAWALL, "X:", xco+5, 120-yco, 50, 20, &group->dupli_ofs[0], -100000, 100000, 100, 0, "Offset to use when instacing the group");
+ uiDefButF(block, NUM, REDRAWALL, "Y:", xco+55, 120-yco, 50, 20, &group->dupli_ofs[1], -100000, 100000, 100, 0, "Offset to use when instacing the group");
+ uiDefButF(block, NUM, REDRAWALL, "Z:", xco+105, 120-yco, 50, 20, &group->dupli_ofs[2], -100000, 100000, 100, 0, "Offset to use when instacing the group");
+ uiBlockEndAlign(block);
uiClearButLock();
- if(group->id.lib) {
- but= uiDefIconBut(block, BUT, B_NOP, ICON_PARLIB, 160, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Make Group local");
- uiButSetFunc(but, group_local, group, NULL);
- xco= 180;
- } else { /* cant remove objects from linked groups */
+ xco = 290;
+ if(group->id.lib==0) { /* cant remove objects from linked groups */
but = uiDefIconBut(block, BUT, B_NOP, VICON_X, xco, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove Group membership");
uiButSetFunc(but, group_ob_rem, group, ob);
}
@@ -3278,6 +3292,8 @@ static void object_panel_collision(Object *ob)
uiDefBut(block, LABEL, 0, "",160,160,150,2, NULL, 0.0, 0, 0, 0, "");
if(pd->deflect) {
+ CollisionModifierData *collmd = (CollisionModifierData *)modifiers_findByType ( ob, eModifierType_Collision );
+
uiDefBut(block, LABEL, 0, "Particle Interaction", 10,135,310,20, NULL, 0.0, 0, 0, 0, "");
uiBlockBeginAlign(block);
@@ -3293,12 +3309,18 @@ static void object_panel_collision(Object *ob)
uiDefBut(block, LABEL, 0, "Soft Body and Cloth Interaction", 10,65,310,20, NULL, 0.0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 10,45,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during collision");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 10,25,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 10, 5,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 10,45,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 160, 45,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness");
uiBlockEndAlign(block);
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 10,25,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during collision");
- uiDefButBitS(block, TOG, OB_SB_COLLFINAL, B_FIELD_CHANGE, "Ev.M.Stack", 170,45,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack (softbody only)");
+ uiDefButBitS(block, TOG, OB_SB_COLLFINAL, B_FIELD_CHANGE, "Ev.M.Stack", 160,25,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack (softbody only)");
+
+ // collision options
+ if(collmd)
+ {
+ uiDefButS(block, NUM, B_FIELD_CHANGE, "Absorption: ", 10,0,150,20, &collmd->absorption, 0.0, 100, 1, 2, "How much of effector force gets lost during collision with this object (in percent).");
+ }
}
}
}
@@ -3308,6 +3330,7 @@ static void object_panel_fields(Object *ob)
uiBut *but;
int particles=0;
static short actpsys=-1;
+ static char slot=0;
block= uiNewBlock(&curarea->uiblocks, "object_panel_fields", UI_EMBOSS, UI_HELV, curarea->win);
if(uiNewPanel(curarea, block, "Fields", "Physics", 0, 0, 318, 204)==0) return;
@@ -3329,7 +3352,7 @@ static void object_panel_fields(Object *ob)
char *tipstr="Choose field type";
uiBlockBeginAlign(block);
-
+
if(ob->particlesystem.first) {
ParticleSystem *psys;
char *menustr2= psys_menu_string(ob,1);
@@ -3341,8 +3364,16 @@ static void object_panel_fields(Object *ob)
if(psys->part->pd==NULL)
psys->part->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
- pd= psys->part->pd;
+ if(psys->part->pd2==NULL)
+ psys->part->pd2= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
+
+ pd= ((slot==1) ? psys->part->pd2 : psys->part->pd);
particles=1;
+
+ uiDefButC(block, ROW, B_REDR, "", 10, 163, 14, 14, &slot, 3.0, 0, 0, 0, "Edit first particle effector slot");
+ uiDefButC(block, ROW, B_REDR, "", 24, 163, 14, 14, &slot, 3.0, 1, 0, 0, "Edit second particle effector slot");
+ uiBlockEndAlign(block);
+ uiBlockBeginAlign(block);
}
else
actpsys= -1; /* -1 = object */
@@ -3355,8 +3386,8 @@ static void object_panel_fields(Object *ob)
/* setup menu button */
if(particles){
- sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d",
- PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC);
+ sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Charge%%x%d|Lennard-Jones%%x%d",
+ PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_CHARGE, PFIELD_LENNARDJ);
if(pd->forcefield==PFIELD_FORCE) tipstr= "Particle attracts or repels particles (On shared object layers)";
else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of particle Z axis (On shared object layers)";
@@ -3364,11 +3395,11 @@ static void object_panel_fields(Object *ob)
}
else{
if(ob->type==OB_CURVE)
- sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d",
- PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE);
+ sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d",
+ PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ);
else
- sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d",
- PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE);
+ sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d",
+ PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ);
if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles (On shared object layers)";
else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis (On shared object layers)";
@@ -3383,8 +3414,6 @@ static void object_panel_fields(Object *ob)
uiBlockEndAlign(block);
uiDefBut(block, LABEL, 0, "",160,180,150,2, NULL, 0.0, 0, 0, 0, "");
-
- MEM_freeN(menustr);
if(pd->forcefield) {
uiBlockBeginAlign(block);
@@ -3410,6 +3439,8 @@ static void object_panel_fields(Object *ob)
}
else if(pd->forcefield == PFIELD_HARMONIC)
uiDefButF(block, NUM, B_FIELD_CHANGE, "Damp: ", 10,120,140,20, &pd->f_damp, 0, 10, 10, 0, "Damping of the harmonic force");
+ else if(pd->forcefield == PFIELD_WIND)
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Noise: ",10,120,140,20, &pd->f_noise, 0, 10, 100, 0, "Noise of the wind force");
}
uiBlockEndAlign(block);
@@ -3448,40 +3479,49 @@ static void object_panel_fields(Object *ob)
uiBlockEndAlign(block);
}
else{
- uiDefButS(block, MENU, B_FIELD_DEP, "Fall-off%t|Cone%x2|Tube%x1|Sphere%x0", 160,180,140,20, &pd->falloff, 0.0, 0.0, 0, 0, "Fall-off shape");
- if(pd->falloff==PFIELD_FALL_TUBE)
- uiDefBut(block, LABEL, 0, "Longitudinal", 160,160,140,20, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PFIELD_POSZ, B_FIELD_CHANGE, "Pos", 160,140,40,20, &pd->flag, 0.0, 0, 0, 0, "Effect only in direction of positive Z axis");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 200,140,100,20, &pd->f_power, 0, 10, 10, 0, "Falloff power (real gravitational falloff = 2)");
- uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 160,120,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,120,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work");
- uiDefButBitS(block, TOG, PFIELD_USEMIN, B_FIELD_CHANGE, "Use", 160,100,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum distance for the field's fall-off");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,100,100,20, &pd->mindist, 0, 1000.0, 10, 0, "Minimum distance for the field's fall-off");
- uiBlockEndAlign(block);
-
- if(pd->falloff==PFIELD_FALL_TUBE){
- uiDefBut(block, LABEL, 0, "Radial", 160,80,70,20, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)");
- uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum radial distance for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,40,100,20, &pd->maxrad, 0, 1000.0, 10, 0, "Maximum radial distance for the field to work");
- uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum radial distance for the field's fall-off");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,20,100,20, &pd->minrad, 0, 1000.0, 10, 0, "Minimum radial distance for the field's fall-off");
- uiBlockEndAlign(block);
+ if(pd->forcefield==PFIELD_LENNARDJ) {
+ uiDefBut(block, LABEL, 0, "Fall-off determined", 160,140,140,20, NULL, 0.0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "by particle sizes", 160,120,140,20, NULL, 0.0, 0, 0, 0, "");
}
- else if(pd->falloff==PFIELD_FALL_CONE){
- uiDefBut(block, LABEL, 0, "Angular", 160,80,70,20, NULL, 0.0, 0, 0, 0, "");
+ else {
+ uiDefButS(block, MENU, B_FIELD_DEP, "Fall-off%t|Cone%x2|Tube%x1|Sphere%x0", 160,180,140,20, &pd->falloff, 0.0, 0.0, 0, 0, "Fall-off shape");
+ if(pd->falloff==PFIELD_FALL_TUBE)
+ uiDefBut(block, LABEL, 0, "Longitudinal", 160,160,140,20, NULL, 0.0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)");
- uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum angle for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxAngle: ", 200,40,100,20, &pd->maxrad, 0, 89.0, 10, 0, "Maximum angle for the field to work (in radians)");
- uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum angle for the field's fall-off");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinAngle: ", 200,20,100,20, &pd->minrad, 0, 89.0, 10, 0, "Minimum angle for the field's fall-off (in radians)");
+ uiDefButBitS(block, TOG, PFIELD_POSZ, B_FIELD_CHANGE, "Pos", 160,140,40,20, &pd->flag, 0.0, 0, 0, 0, "Effect only in direction of positive Z axis");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 200,140,100,20, &pd->f_power, 0, 10, 10, 0, "Falloff power (real gravitational falloff = 2)");
+ uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 160,120,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,120,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work");
+ uiDefButBitS(block, TOG, PFIELD_USEMIN, B_FIELD_CHANGE, "Use", 160,100,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum distance for the field's fall-off");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,100,100,20, &pd->mindist, 0, 1000.0, 10, 0, "Minimum distance for the field's fall-off");
uiBlockEndAlign(block);
+
+ if(pd->falloff==PFIELD_FALL_TUBE){
+ uiDefBut(block, LABEL, 0, "Radial", 160,80,70,20, NULL, 0.0, 0, 0, 0, "");
+ uiBlockBeginAlign(block);
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)");
+ uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum radial distance for the field to work");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,40,100,20, &pd->maxrad, 0, 1000.0, 10, 0, "Maximum radial distance for the field to work");
+ uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum radial distance for the field's fall-off");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,20,100,20, &pd->minrad, 0, 1000.0, 10, 0, "Minimum radial distance for the field's fall-off");
+ uiBlockEndAlign(block);
+ }
+ else if(pd->falloff==PFIELD_FALL_CONE){
+ uiDefBut(block, LABEL, 0, "Angular", 160,80,70,20, NULL, 0.0, 0, 0, 0, "");
+ uiBlockBeginAlign(block);
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)");
+ uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum angle for the field to work");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxAngle: ", 200,40,100,20, &pd->maxrad, 0, 89.0, 10, 0, "Maximum angle for the field to work (in radians)");
+ uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum angle for the field's fall-off");
+ uiDefButF(block, NUM, B_FIELD_CHANGE, "MinAngle: ", 200,20,100,20, &pd->minrad, 0, 89.0, 10, 0, "Minimum angle for the field's fall-off (in radians)");
+ uiBlockEndAlign(block);
+ }
}
}
+
}
+
+ MEM_freeN(menustr);
}
}
@@ -4328,6 +4368,8 @@ static void object_panel_particle_extra(Object *ob)
uiDefButBitI(block, TOG, PART_CHILD_EFFECT, B_PART_RECALC, "Children", butx+(butw*3)/5,buty,(butw*2)/5,buth, &part->flag, 0, 0, 0, 0, "Apply effectors to children");
uiBlockEndAlign(block);
}
+ else if(part->phystype == PART_PHYS_NEWTON)
+ uiDefButBitI(block, TOG, PART_SELF_EFFECT, B_PART_RECALC, "Self Effect", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Particle effectors effect themselves");
else
buty-=buth;
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index 6edf3ebf168..fbc9e0aa7cb 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -33,6 +33,7 @@
#include <string.h>
#include "MEM_guardedalloc.h"
+#include "BLO_sys_types.h" // for intptr_t support
#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@@ -765,7 +766,16 @@ static void seq_panel_input()
}
if (last_seq->type == SEQ_IMAGE) {
- StripElem * se = give_stripelem(last_seq, CFRA);
+ int cfra = CFRA;
+ StripElem * se;
+
+ if(last_seq->startdisp >cfra) {
+ cfra = last_seq->startdisp;
+ } else if (last_seq->enddisp <= cfra) {
+ cfra = last_seq->enddisp - 1;
+ }
+
+ se = give_stripelem(last_seq, cfra);
if (se) {
uiDefBut(block, TEX,
@@ -3291,7 +3301,7 @@ static void layer_copy_func(void *lay_v, void *lay_p)
static void delete_scene_layer_func(void *srl_v, void *act_i)
{
if(BLI_countlist(&G.scene->r.layers)>1) {
- long act= (long)act_i;
+ intptr_t act= (intptr_t)act_i;
BLI_remlink(&G.scene->r.layers, srl_v);
MEM_freeN(srl_v);
@@ -3352,7 +3362,7 @@ static char *scene_layer_menu(void)
static void draw_3d_layer_buttons(uiBlock *block, int type, unsigned int *poin, short xco, short yco, short dx, short dy, char *tip)
{
uiBut *bt;
- long a;
+ intptr_t a;
uiBlockBeginAlign(block);
for(a=0; a<5; a++) {
@@ -3411,7 +3421,7 @@ static void render_panel_layers(void)
uiDefButBitI(block, TOG, R_SINGLE_LAYER, B_NOP, "Single", 230,145,60,20, &G.scene->r.scemode, 0, 0, 0, 0, "Only render this layer");
bt=uiDefIconBut(block, BUT, B_NOP, ICON_X, 285, 145, 25, 20, 0, 0, 0, 0, 0, "Deletes current Render Layer");
- uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(long)G.scene->r.actlay);
+ uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(intptr_t)G.scene->r.actlay);
uiBlockEndAlign(block);
/* RenderLayer visible-layers */
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index 1b580381ca5..6d5e1a62ad4 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -113,6 +113,8 @@
#include "RE_pipeline.h"
+#include "GPU_material.h"
+
/* -----includes for this file specific----- */
#include "butspace.h" // own module
@@ -209,6 +211,7 @@ static void load_image_cb(char *str, void *ima_pp_v, void *iuser_v) /* called fr
if(GS(tex->id.name)==ID_TE) {
BIF_preview_changed(ID_TE);
allqueue(REDRAWBUTSSHADING, 0);
+ allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWOOPS, 0);
}
}
@@ -1542,10 +1545,35 @@ static void texture_panel_colors(Tex *tex)
uiDefButF(block, NUMSLI, B_TEXPRV, "Contr", 160,10,150,20, &tex->contrast, 0.01, 5.0, 0, 0, "Changes the contrast of the color or intensity of a texture");
}
+static int texture_channels_num_display(MTex **mtex)
+{
+ int a, num_mtex;
+
+ if(!mtex)
+ return 0;
+
+ /* compute number of texture channels to draw, 1 more
+ * than the last, used texture channel, and at least 10 */
+ num_mtex = 0;
+
+ for(a=MAX_MTEX-1; a>=0; a--) {
+ if (mtex[a]) {
+ num_mtex = a+1;
+ break;
+ }
+ }
-static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *la, bNode *node, Brush *br, SculptData *sd)
+ if (num_mtex < 10)
+ return 10;
+ else if(num_mtex < MAX_MTEX)
+ return num_mtex + 1;
+ else
+ return MAX_MTEX;
+}
+
+static void texture_panel_texture(MTex *actmtex, Material *ma, World *wrld, Lamp *la, bNode *node, Brush *br, SculptData *sd)
{
- MTex *mt=NULL;
+ MTex **mtex, *mt;
uiBlock *block;
ID *id=NULL, *idfrom;
int a, yco, loos;
@@ -1556,17 +1584,35 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
if(uiNewPanel(curarea, block, "Texture", "Texture", 320, 0, 318, 204)==0) return;
/* first do the browse but */
- if(mtex)
- id= (ID *)mtex->tex;
+ if(actmtex)
+ id= (ID *)actmtex->tex;
else if(node)
id= node->id;
- if(ma) idfrom= &ma->id;
- else if(wrld) idfrom= &wrld->id;
- else if(la) idfrom= &la->id;
- else if(br) idfrom= &br->id;
- else if(sd) idfrom= NULL; /* Not sure what this does */
- else idfrom= NULL;
+ if(ma) {
+ idfrom= &ma->id;
+ mtex= ma->mtex;
+ }
+ else if(wrld) {
+ idfrom= &wrld->id;
+ mtex= wrld->mtex;
+ }
+ else if(la) {
+ idfrom= &la->id;
+ mtex= la->mtex;
+ }
+ else if(br) {
+ idfrom= &br->id;
+ mtex= br->mtex;
+ }
+ else if(sd) {
+ idfrom= NULL; /* Not sure what this does */
+ mtex= sd->mtex;
+ }
+ else {
+ idfrom= NULL;
+ mtex= NULL;
+ }
uiBlockSetCol(block, TH_BUT_SETTING2);
if(ma) {
@@ -1595,15 +1641,13 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
/* CHANNELS */
if(node==NULL) {
+ int num_mtex;
uiBlockBeginAlign(block);
yco= 150;
- for(a= 0; a<MAX_MTEX; a++) {
-
- if(ma) mt= ma->mtex[a];
- else if(wrld) mt= wrld->mtex[a];
- else if(la) mt= la->mtex[a];
- else if(br) mt= br->mtex[a];
- else if(sd) mt= sd->mtex[a];
+
+ num_mtex= texture_channels_num_display(mtex);
+ for(a=0; a<num_mtex; a++) {
+ mt= mtex[a];
if(mt && mt->tex) splitIDname(mt->tex->id.name+2, str, &loos);
else strcpy(str, "");
@@ -2030,7 +2074,7 @@ static void world_panel_texture(World *wrld)
uiBlock *block;
MTex *mtex;
ID *id;
- int a, loos;
+ int a, loos, num_mtex;
char str[64], *strp;
block= uiNewBlock(&curarea->uiblocks, "world_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
@@ -2041,7 +2085,8 @@ static void world_panel_texture(World *wrld)
/* TEX CHANNELS */
uiBlockSetCol(block, TH_BUT_NEUTRAL);
uiBlockBeginAlign(block);
- for(a= 0; a<MAX_MTEX; a++) {
+ num_mtex= texture_channels_num_display(wrld->mtex);
+ for(a= 0; a<num_mtex; a++) {
mtex= wrld->mtex[a];
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
else strcpy(str, "");
@@ -2506,7 +2551,7 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
uiBlock *block;
MTex *mtex;
ID *id;
- int a, loos;
+ int a, loos, num_mtex;
char *strp, str[64];
block= uiNewBlock(&curarea->uiblocks, "lamp_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
@@ -2517,7 +2562,8 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
/* TEX CHANNELS */
uiBlockSetCol(block, TH_BUT_NEUTRAL);
uiBlockBeginAlign(block);
- for(a= 0; a<MAX_MTEX; a++) {
+ num_mtex= texture_channels_num_display(la->mtex);
+ for(a= 0; a<num_mtex; a++) {
mtex= la->mtex[a];
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
else strcpy(str, "");
@@ -2603,9 +2649,9 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
uiBlockSetCol(block, TH_BUT_SETTING1);
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
+ uiDefButBitI(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
if(la->type==LA_SPOT) {
- uiDefButBitS(block, TOG, LA_SHAD_BUF, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets spotlight produce shadows using shadow buffer");
+ uiDefButBitI(block, TOG, LA_SHAD_BUF, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets spotlight produce shadows using shadow buffer");
if(la->mode & LA_SHAD_BUF) {
char *tip= "Regular buffer type";
if(la->buftype==LA_SHADBUF_IRREGULAR)
@@ -2618,12 +2664,15 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
}
uiBlockEndAlign(block);
- uiDefButBitS(block, TOG, LA_ONLYSHADOW, B_LAMPPRV,"OnlyShadow", 10,110,80,19,&la->mode, 0, 0, 0, 0, "Causes light to cast shadows only without illuminating objects");
+ uiBlockBeginAlign(block);
+ uiDefButBitI(block, TOG, LA_ONLYSHADOW, B_LAMPPRV,"OnlyShadow", 10,110,80,19,&la->mode, 0, 0, 0, 0, "Causes light to cast shadows only without illuminating objects");
+ uiDefButBitI(block, TOG, LA_LAYER_SHADOW, B_LAMPPRV,"Layer", 10,90,80,19,&la->mode, 0, 0, 0, 0, "Causes only objects on the same layer to cast shadows");
+ uiBlockEndAlign(block);
if(la->type==LA_SPOT) {
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LA_SQUARE, B_LAMPREDRAW,"Square", 10,60,80,19,&la->mode, 0, 0, 0, 0, "Sets square spotbundles");
- uiDefButBitS(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,40,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
+ uiDefButBitI(block, TOG, LA_SQUARE, B_LAMPREDRAW,"Square", 10,60,80,19,&la->mode, 0, 0, 0, 0, "Sets square spotbundles");
+ uiDefButBitI(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,40,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
uiBlockBeginAlign(block);
uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the spotlight beam in degrees");
@@ -2747,12 +2796,12 @@ static void lamp_panel_yafray(Object *ob, Lamp *la)
/* in yafray arealights always cast shadows, so ray shadow flag not needed */
/* ray shadow also not used when halo for spot enabled */
if ((la->type!=LA_AREA) && (!((la->type==LA_SPOT) && (la->mode & LA_HALO))))
- uiDefButBitS(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
+ uiDefButBitI(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
/* in yafray the regular lamp can use shadowbuffers (softlight), used by spot with halo as well */
/* to prevent clash with blender shadowbuf flag, a special flag is used for yafray */
if (la->type==LA_LOCAL) {
- uiDefButBitS(block, TOG, LA_YF_SOFT, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets light produce shadows using shadow buffer");
+ uiDefButBitI(block, TOG, LA_YF_SOFT, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets light produce shadows using shadow buffer");
uiDefButF(block, NUM, B_DIFF, "GloInt:", 100,155,200,19, &la->YF_glowint, 0.0, 1.0, 1, 0, "Sets light glow intensity, 0 is off");
uiDefButF(block, NUM, B_DIFF, "GloOfs:", 100,135,100,19, &la->YF_glowofs, 0.0, 2.0, 1, 0, "Sets light glow offset, the higher, the less 'peaked' the glow");
uiDefButS(block, NUM, B_DIFF, "GlowType:", 200,135,100,19, &la->YF_glowtype, 0, 1, 1, 0, "Sets light glow type");
@@ -2780,7 +2829,7 @@ static void lamp_panel_yafray(Object *ob, Lamp *la)
if (la->type==LA_SPOT) {
- uiDefButBitS(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,50,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
+ uiDefButBitI(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,50,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
uiBlockSetCol(block, TH_AUTO);
uiBlockBeginAlign(block);
@@ -2900,15 +2949,15 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButS(block, MENU, B_LAMPREDRAW, "Falloff %t|Constant %x0|Inverse Linear %x1|Inverse Square %x2|Custom Curve %x3|Lin/Quad Weighted %x4|",
10,150,100,19, &la->falloff_type, 0,0,0,0, "Lamp falloff - intensity decay with distance");
- uiDefButBitS(block, TOG, LA_SPHERE, B_LAMPPRV,"Sphere", 10,130,100,19,&la->mode, 0, 0, 0, 0, "Sets light intensity to zero for objects beyond the distance value");
+ uiDefButBitI(block, TOG, LA_SPHERE, B_LAMPPRV,"Sphere", 10,130,100,19,&la->mode, 0, 0, 0, 0, "Sets light intensity to zero for objects beyond the distance value");
}
uiBlockBeginAlign(block);
uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, LA_LAYER, 0,"Layer", 10,70,100,19,&la->mode, 0, 0, 0, 0, "Illuminates objects in the same layer as the lamp only");
- uiDefButBitS(block, TOG, LA_NEG, B_LAMPPRV,"Negative", 10,50,100,19,&la->mode, 0, 0, 0, 0, "Sets lamp to cast negative light");
- uiDefButBitS(block, TOG, LA_NO_DIFF, B_LAMPPRV,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp");
- uiDefButBitS(block, TOG, LA_NO_SPEC, B_LAMPPRV,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp");
+ uiDefButBitI(block, TOG, LA_LAYER, 0,"Layer", 10,70,100,19,&la->mode, 0, 0, 0, 0, "Illuminates objects in the same layer as the lamp only");
+ uiDefButBitI(block, TOG, LA_NEG, B_LAMPPRV,"Negative", 10,50,100,19,&la->mode, 0, 0, 0, 0, "Sets lamp to cast negative light");
+ uiDefButBitI(block, TOG, LA_NO_DIFF, B_LAMPPRV,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp");
+ uiDefButBitI(block, TOG, LA_NO_SPEC, B_LAMPPRV,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp");
uiBlockEndAlign(block);
uiBlockSetCol(block, TH_AUTO);
@@ -3523,7 +3572,7 @@ static void material_panel_texture(Object *ob, Material *ma)
ID *id;
ParticleSystem *psys;
int loos, psys_mapto=0;
- int a;
+ int a, num_mtex;
char str[64], *strp;
block= uiNewBlock(&curarea->uiblocks, "material_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
@@ -3539,7 +3588,8 @@ static void material_panel_texture(Object *ob, Material *ma)
uiBlockSetCol(block, TH_BUT_NEUTRAL);
uiBlockBeginAlign(block);
- for(a= 0; a<MAX_MTEX; a++) {
+ num_mtex= texture_channels_num_display(ma->mtex);
+ for(a= 0; a<num_mtex; a++) {
mtex= ma->mtex[a];
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
else strcpy(str, "");
@@ -3553,10 +3603,10 @@ static void material_panel_texture(Object *ob, Material *ma)
/* SEPTEX */
uiBlockSetCol(block, TH_AUTO);
- for(a= 0; a<MAX_MTEX; a++) {
+ for(a= 0; a<num_mtex; a++) {
mtex= ma->mtex[a];
if(mtex && mtex->tex) {
- but=uiDefIconButBitS(block, ICONTOGN, 1<<a, B_MATPRV, ICON_CHECKBOX_HLT-1, -20, 180-18*a, 28, 20, &ma->septex, 0.0, 0.0, 0, 0, "Click to disable or enable this texture channel");
+ but=uiDefIconButBitI(block, ICONTOGN, 1<<a, B_MATPRV, ICON_CHECKBOX_HLT-1, -20, 180-18*a, 28, 20, &ma->septex, 0.0, 0.0, 0, 0, "Click to disable or enable this texture channel");
if(psys_mapto && ma->mtex[a]->mapto & MAP_PA_IVEL)
uiButSetFunc(but, particle_recalc_material, ma, NULL);
@@ -4091,13 +4141,14 @@ static void material_panel_material(Material *ma)
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButBitI(block, TOG, MA_VERTEXCOL, B_MAT_VCOL_LIGHT, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colors as extra light");
uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_MAT_VCOL_PAINT, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colors with vertex colors");
- uiDefButBitI(block, TOG, MA_FACETEXTURE, B_REDR, "TexFace", 156,166,64,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
- if (ma->mode & MA_FACETEXTURE) uiDefButBitI(block, TOG, MA_FACETEXTURE_ALPHA, B_REDR, "A", 220,166,20,20, &(ma->mode), 0, 0, 0, 0, "Use alpha channel in 'TexFace' assigned images");
- uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 240,166,63,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
+ uiDefButBitI(block, TOG, MA_FACETEXTURE, B_MATPRV, "TexFace", 156,166,60,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
+ uiDefButBitI(block, TOG, MA_FACETEXTURE_ALPHA, B_MATPRV, "A", 216,166,20,20, &(ma->mode), 0, 0, 0, 0, "Use alpha channel in 'TexFace' assigned images");
+ uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 236,166,67,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
- uiDefButBitI(block, TOG, MA_NOMIST, B_NOP, "No Mist", 8,146,74,20, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values");
+ uiDefButBitI(block, TOG, MA_NOMIST, B_MATPRV, "No Mist", 8,146,74,20, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values");
uiDefButBitI(block, TOG, MA_ENV, B_MATPRV, "Env", 82,146,74,20, &(ma->mode), 0, 0, 0, 0, "Causes faces to render with alpha zero: allows sky/backdrop to show through (only for solid faces)");
- uiDefButF(block, NUM, B_NOP, "Shad A ", 156,146,147,19, &ma->shad_alpha, 0.001, 1.0f, 100, 0, "Shadow casting alpha, only in use for Irregular Shadowbuffer");
+ uiDefButBitS(block, TOG, MA_OBCOLOR, B_MATPRV, "ObColor", 156,146,60,20, &(ma->shade_flag), 0, 0, 0, 0, "Modulate the result with a per object color");
+ uiDefButF(block, NUM, B_NOP, "Shad A ", 216,146,87,20, &ma->shad_alpha, 0.001, 1.0f, 10, 2, "Shadow casting alpha, only in use for Irregular Shadowbuffer");
}
uiBlockSetCol(block, TH_AUTO);
uiBlockBeginAlign(block);
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index 9b1af3f1a06..33eb5262c3d 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -89,6 +89,7 @@
#include "BSE_drawnla.h"
#include "BSE_drawipo.h"
+#include "BSE_drawview.h"
#include "BSE_editaction_types.h"
#include "BSE_editipo.h"
#include "BSE_time.h"
@@ -467,7 +468,7 @@ static void draw_channel_names(void)
bActionGroup *grp = NULL;
short indent= 0, offset= 0, sel= 0, group=0;
int expand= -1, protect = -1, special= -1, mute = -1;
- char name[32];
+ char name[64];
/* determine what needs to be drawn */
switch (ale->type) {
@@ -625,6 +626,84 @@ static void draw_channel_names(void)
sprintf(name, "Constraint");
}
break;
+ case ACTTYPE_GPDATABLOCK: /* gpencil datablock */
+ {
+ bGPdata *gpd = (bGPdata *)ale->data;
+ ScrArea *sa = (ScrArea *)ale->owner;
+
+ indent = 0;
+ group= 3;
+
+ /* only show expand if there are any channels */
+ if (gpd->layers.first) {
+ if (gpd->flag & GP_DATA_EXPAND)
+ expand = ICON_TRIA_DOWN;
+ else
+ expand = ICON_TRIA_RIGHT;
+ }
+
+ switch (sa->spacetype) {
+ case SPACE_VIEW3D:
+ {
+ /* this shouldn't cause any overflow... */
+ sprintf(name, "3DView: %s", view3d_get_name(sa->spacedata.first));
+ special= ICON_VIEW3D;
+ }
+ break;
+ case SPACE_NODE:
+ {
+ SpaceNode *snode= sa->spacedata.first;
+ char treetype[12];
+
+ if (snode->treetype == 1)
+ sprintf(treetype, "Composite");
+ else
+ sprintf(treetype, "Material");
+ sprintf(name, "Nodes: %s", treetype);
+
+ special= ICON_NODE;
+ }
+ break;
+ case SPACE_SEQ:
+ {
+ SpaceSeq *sseq= sa->spacedata.first;
+ char imgpreview[10];
+
+ switch (sseq->mainb) {
+ case 1: sprintf(imgpreview, "Image..."); break;
+ case 2: sprintf(imgpreview, "Luma..."); break;
+ case 3: sprintf(imgpreview, "Chroma..."); break;
+ case 4: sprintf(imgpreview, "Histogram"); break;
+
+ default: sprintf(imgpreview, "Sequence"); break;
+ }
+ sprintf(name, "Sequencer: %s", imgpreview);
+
+ special= ICON_SEQUENCE;
+ }
+ break;
+ case SPACE_IMAGE:
+ {
+ SpaceImage *sima= sa->spacedata.first;
+
+ if (sima->image)
+ sprintf(name, "Image: %s", sima->image->id.name+2);
+ else
+ sprintf(name, "Image: <None>");
+
+ special= ICON_IMAGE_COL;
+ }
+ break;
+
+ default:
+ {
+ sprintf(name, "<Unknown GP-Data Source>");
+ special= -1;
+ }
+ break;
+ }
+ }
+ break;
case ACTTYPE_GPLAYER: /* gpencil layer */
{
bGPDlayer *gpl = (bGPDlayer *)ale->data;
@@ -632,7 +711,8 @@ static void draw_channel_names(void)
indent = 0;
special = -1;
expand = -1;
-
+ group = 1;
+
if (EDITABLE_GPL(gpl))
protect = ICON_UNLOCKED;
else
@@ -651,8 +731,19 @@ static void draw_channel_names(void)
/* now, start drawing based on this information */
/* draw backing strip behind channel name */
- if (group == 2) {
- /* only for group-channels */
+ if (group == 3) {
+ /* only for gp-data channels */
+ if (ale->owner == curarea) // fixme... currently useless
+ BIF_ThemeColorShade(TH_GROUP_ACTIVE, 10);
+ else
+ BIF_ThemeColorShade(TH_GROUP, 20);
+ uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
+ gl_round_box(GL_POLYGON, x, yminc, (float)NAMEWIDTH, ymaxc, 8);
+
+ offset = 0;
+ }
+ else if (group == 2) {
+ /* only for action group channels */
if (ale->flag & AGRP_ACTIVE)
BIF_ThemeColorShade(TH_GROUP_ACTIVE, 10);
else
@@ -698,13 +789,19 @@ static void draw_channel_names(void)
offset += 17;
}
- /* draw special icon indicating type of ipo-blocktype?
- * only for expand widgets for Ipo and Constraint Channels
- */
- if (special > 0) {
- offset = (group) ? 29 : 24;
- BIF_icon_draw(x+offset, yminc, special);
- offset += 17;
+ /* draw special icon indicating certain data-types */
+ if (special > -1) {
+ if (group == 3) {
+ /* for gpdatablock channels */
+ BIF_icon_draw(x+offset, yminc, special);
+ offset += 17;
+ }
+ else {
+ /* for ipo/constraint channels */
+ offset = (group) ? 29 : 24;
+ BIF_icon_draw(x+offset, yminc, special);
+ offset += 17;
+ }
}
/* draw name */
@@ -720,13 +817,13 @@ static void draw_channel_names(void)
offset = 0;
/* draw protect 'lock' */
- if (protect > 0) {
+ if (protect > -1) {
offset = 16;
BIF_icon_draw(NAMEWIDTH-offset, yminc, protect);
}
/* draw mute 'eye' */
- if (mute > 0) {
+ if (mute > -1) {
offset += 16;
BIF_icon_draw(NAMEWIDTH-offset, yminc, mute);
}
@@ -1148,12 +1245,6 @@ void drawactionspace(ScrArea *sa, void *spacedata)
G.saction->action= NULL;
}
break;
- case SACTCONT_GPENCIL:
- {
- /* this searching could be slow (so users should pin after this is found) */
- G.saction->gpd= gpencil_data_getetime(G.curscreen);
- }
- break;
}
}
diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c
index 6d78b21dfbb..c37eaf7986c 100644
--- a/source/blender/src/drawarmature.c
+++ b/source/blender/src/drawarmature.c
@@ -2505,6 +2505,9 @@ int draw_armature(Base *base, int dt, int flag)
Object *ob= base->object;
bArmature *arm= ob->data;
int retval= 0;
+
+ if(G.f & G_SIMULATION)
+ return 1;
if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) {
/* we use color for solid lighting */
diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c
index 55d0464b9af..fb21d94f39a 100644
--- a/source/blender/src/drawgpencil.c
+++ b/source/blender/src/drawgpencil.c
@@ -37,6 +37,9 @@
#include "MEM_guardedalloc.h"
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
#include "BMF_Api.h"
#include "BLI_arithb.h"
@@ -57,6 +60,7 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "BIF_butspace.h"
+#include "BIF_drawseq.h"
#include "BIF_graphics.h"
#include "BIF_interface.h"
#include "BIF_mywindow.h"
@@ -94,6 +98,9 @@
void gp_ui_activelayer_cb (void *gpd, void *gpl)
{
gpencil_layer_setactive(gpd, gpl);
+
+ scrarea_queue_winredraw(curarea);
+ allqueue(REDRAWACTION, 0);
}
/* rename layer and set active */
@@ -104,18 +111,27 @@ void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg)
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info[0]), 128);
gpencil_layer_setactive(gpd, gpl);
+
+ scrarea_queue_winredraw(curarea);
+ allqueue(REDRAWACTION, 0);
}
/* add a new layer */
void gp_ui_addlayer_cb (void *gpd, void *dummy)
{
gpencil_layer_addnew(gpd);
+
+ scrarea_queue_winredraw(curarea);
+ allqueue(REDRAWACTION, 0);
}
/* delete active layer */
void gp_ui_dellayer_cb (void *gpd, void *dummy)
{
gpencil_layer_delactive(gpd);
+
+ scrarea_queue_winredraw(curarea);
+ allqueue(REDRAWACTION, 0);
}
/* delete last stroke of active layer */
@@ -125,6 +141,8 @@ void gp_ui_delstroke_cb (void *gpd, void *gpl)
gpencil_layer_setactive(gpd, gpl);
gpencil_frame_delete_laststroke(gpf);
+
+ scrarea_queue_winredraw(curarea);
}
/* delete active frame of active layer */
@@ -134,28 +152,27 @@ void gp_ui_delframe_cb (void *gpd, void *gpl)
gpencil_layer_setactive(gpd, gpl);
gpencil_layer_delframe(gpl, gpf);
+
+ scrarea_queue_winredraw(curarea);
+ allqueue(REDRAWACTION, 0);
}
-
-/* set this set of gpencil data for editing in action editor */
-void gp_ui_dotime_cb (void *gpd_arg, void *dummy)
+/* convert the active layer to geometry */
+void gp_ui_convertlayer_cb (void *gpd, void *gpl)
{
- bGPdata *gpd= (bGPdata *)gpd_arg;
+ gpencil_layer_setactive(gpd, gpl);
+ gpencil_convert_menu();
- /* check if setting or clearing (note: setting was just set...) */
- if (gpd->flag & GP_DATA_EDITTIME)
- gpencil_data_setetime(G.curscreen, gpd);
- else
- gpencil_data_setetime(G.curscreen, NULL);
+ scrarea_queue_winredraw(curarea);
}
-
/* ------- Drawing Code ------- */
/* draw the controls for a given layer */
static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco)
{
uiBut *but;
+ short active= (gpl->flag & GP_LAYER_ACTIVE);
short width= 314;
short height;
int rb_col;
@@ -168,40 +185,41 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short
uiBlockSetEmboss(block, UI_EMBOSSN);
/* rounded header */
- rb_col= (gpl->flag & GP_LAYER_ACTIVE)?50:20;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15 , rb_col-20, "");
+ if (active) uiBlockSetCol(block, TH_BUT_ACTION);
+ rb_col= (active)?-20:20;
+ uiDefBut(block, ROUNDBOX, B_REDR, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15 , rb_col-20, "");
+ if (active) uiBlockSetCol(block, TH_AUTO);
/* lock toggle */
uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified");
}
- /* when layer is locked or hidden, don't draw the rest of its settings */
+ /* when layer is locked or hidden, only draw header */
if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
- height= 26;
+ char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */
- /* draw rest of header */
- {
- /* visibility button (only if hidden but not locked!) */
- if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer");
-
- /* name */
- uiDefBut(block, LABEL, 1, gpl->info, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)");
- }
+ height= 0;
- /* draw backdrop */
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, "");
+ /* visibility button (only if hidden but not locked!) */
+ if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
+ uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer");
- /* draw settings... (i.e. just warning for this one) */
+ /* name */
if (gpl->flag & GP_LAYER_HIDE)
- uiDefBut(block, LABEL, 1, "Grease Pencil Layer Hidden", *xco+60, *yco-26, 205, 20, NULL, 0.0, 0.0, 0, 0, "");
+ sprintf(name, "%s (Hidden)", gpl->info);
else
- uiDefBut(block, LABEL, 1, "Grease Pencil Layer Locked", *xco+60, *yco-26, 205, 20, NULL, 0.0, 0.0, 0, 0, "");
+ sprintf(name, "%s (Locked)", gpl->info);
+ uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)");
+ /* delete button (only if hidden but not locked!) */
+ if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) {
+ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
+ uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL);
+ }
uiBlockSetEmboss(block, UI_EMBOSS);
}
else {
- height= 100;
+ height= 97;
/* draw rest of header */
{
@@ -211,7 +229,7 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short
uiBlockSetEmboss(block, UI_EMBOSS);
/* name */
- but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+35, *yco, 240, 20, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)");
+ but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)");
uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl);
/* delete 'button' */
@@ -224,7 +242,9 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short
}
/* draw backdrop */
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, "");
+ if (active) uiBlockSetCol(block, TH_BUT_ACTION);
+ uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12, rb_col, "");
+ if (active) uiBlockSetCol(block, TH_AUTO);
/* draw settings */
{
@@ -237,21 +257,31 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short
/* stroke thickness */
uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)");
+ /* debugging options */
+ if (G.f & G_DEBUG) {
+ uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes");
+ }
/* onion-skinning */
uiBlockBeginAlign(block);
uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame");
- uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Maximum frame range on either side of active frame to show (0 = just 'first' available frame on either side)");
+ uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)");
uiBlockEndAlign(block);
/* options */
- but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer");
- uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl);
-
- but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame");
- uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl);
-
- //uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco+160, *yco-75, 130, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes");
+ uiBlockBeginAlign(block);
+ if (curarea->spacetype == SPACE_VIEW3D) {
+ but= uiDefBut(block, BUT, B_REDR, "Convert to...", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Converts this layer's strokes to geometry (Hotkey = Alt-Shift-C)");
+ uiButSetFunc(but, gp_ui_convertlayer_cb, gpd, gpl);
+ }
+ else {
+ but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)");
+ uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl);
+ }
+
+ but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)");
+ uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl);
+ uiBlockEndAlign(block);
}
}
@@ -262,36 +292,40 @@ static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short
/* Draw the contents for a grease-pencil panel. This assumes several things:
* - that panel has been created, is 318 x 204. max yco is 225
* - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225)
+ * which is basically the top left-hand corner
* It will return the amount of extra space to extend the panel by
*/
short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa)
{
uiBut *but;
bGPDlayer *gpl;
- short xco= 10, yco= 155;
+ short xco= 10, yco= 170;
/* draw gpd settings first */
{
- /* show status info button */
- uiDefButBitI(block, TOG, GP_DATA_DISPINFO, B_REDR, "Show Status Info", 10, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "Display status info about current status of Grease Pencil");
-
- /* add new/duplicate layer buttons */
- but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,182,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer");
+ /* add new layer buttons */
+ but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer");
uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL);
- /* show override lmb-clicks button */
- uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret LMB-click as new strokes (same as holding Shift-Key per stroke)");
+ /* show override lmb-clicks button + painting lock */
+ uiBlockBeginAlign(block);
+ if ((gpd->flag & GP_DATA_EDITPAINT)==0) {
+ uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes");
+
+ uiBlockSetCol(block, TH_BUT_SETTING);
+ uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)");
+ uiBlockSetCol(block, TH_AUTO);
+ }
+ else
+ uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes");
+ uiBlockEndAlign(block);
/* 'view align' button (naming depends on context) */
if (sa->spacetype == SPACE_VIEW3D)
- uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Draw in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space");
- else if (sa->spacetype != SPACE_SEQ) /* not available for sequencer yet */
+ uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space");
+ else
uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas");
-
- /* show edit-in-action button */
- but= uiDefButBitI(block, TOG, GP_DATA_EDITTIME, B_REDR, "Edit Timing", 170, 182, 150, 20, &gpd->flag, 0, 0, 0, 0, "Edit timing of frames for the Grease Pencil block");
- uiButSetFunc(but, gp_ui_dotime_cb, gpd, NULL);
}
/* draw for each layer */
@@ -306,124 +340,417 @@ short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa)
/* ************************************************** */
/* GREASE PENCIL DRAWING */
+/* ----- General Defines ------ */
+
/* flags for sflag */
enum {
GP_DRAWDATA_NOSTATUS = (1<<0), /* don't draw status info */
GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */
GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */
+ GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */
};
-/* draw a given stroke */
-static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy)
+/* thickness above which we should use special drawing */
+#define GP_DRAWTHICKNESS_SPECIAL 3
+
+/* ----- Tool Buffer Drawing ------ */
+
+/* draw stroke defined in buffer (simple ogl lines/points for now, as dotted lines) */
+static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thickness, short dflag, short sflag)
{
- bGPDspoint *pt;
+ tGPspoint *pt;
int i;
/* error checking */
if ((points == NULL) || (totpoints <= 0))
return;
- /* check if stroke can be drawn */
- if ((dflag & GP_DRAWDATA_ONLY3D) && !(sflag & GP_STROKE_3DSPACE))
- return;
- if (!(dflag & GP_DRAWDATA_ONLY3D) && (sflag & GP_STROKE_3DSPACE))
- return;
- if ((dflag & GP_DRAWDATA_ONLYV2D) && !(sflag & GP_STROKE_2DSPACE))
- return;
- if (!(dflag & GP_DRAWDATA_ONLYV2D) && (sflag & GP_STROKE_2DSPACE))
+ /* check if buffer can be drawn */
+ if (dflag & (GP_DRAWDATA_ONLY3D|GP_DRAWDATA_ONLYV2D))
return;
- /* if drawing a single point, draw it larger */
+ /* if drawing a single point, draw it larger */
if (totpoints == 1) {
/* draw point */
- if (sflag & GP_STROKE_3DSPACE) {
- glBegin(GL_POINTS);
- glVertex3f(points->x, points->y, points->z);
- glEnd();
+ glBegin(GL_POINTS);
+ glVertex2f(points->x, points->y);
+ glEnd();
+ }
+ else if (sflag & GP_STROKE_ERASER) {
+ /* don't draw stroke at all! */
+ }
+ else {
+ float oldpressure = 0.0f;
+
+ /* draw stroke curve */
+ if (G.f & G_DEBUG) setlinestyle(2);
+
+ glBegin(GL_LINE_STRIP);
+ for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
+ if (fabs(pt->pressure - oldpressure) > 0.2f) {
+ glEnd();
+ glLineWidth(pt->pressure * thickness);
+ glBegin(GL_LINE_STRIP);
+
+ glVertex2f(pt->x, pt->y);
+
+ oldpressure = pt->pressure;
+ }
+ else
+ glVertex2f(pt->x, pt->y);
+ }
+ glEnd();
+
+ if (G.f & G_DEBUG) setlinestyle(0);
+ }
+}
+
+/* ----- Existing Strokes Drawing (3D and Point) ------ */
+
+/* draw a given stroke - just a single dot (only one point) */
+static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy)
+{
+ /* draw point */
+ if (sflag & GP_STROKE_3DSPACE) {
+ glBegin(GL_POINTS);
+ glVertex3f(points->x, points->y, points->z);
+ glEnd();
+ }
+ else {
+ float co[2];
+
+ /* get coordinates of point */
+ if (sflag & GP_STROKE_2DSPACE) {
+ co[0]= points->x;
+ co[1]= points->y;
+ }
+ else if (sflag & GP_STROKE_2DIMAGE) {
+ co[0]= (points->x * winx) + offsx;
+ co[1]= (points->y * winy) + offsy;
+ }
+ else {
+ co[0]= (points->x / 1000 * winx);
+ co[1]= (points->y / 1000 * winy);
}
- else if (sflag & GP_STROKE_2DSPACE) {
+
+ /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple opengl point will do */
+ if (thickness < GP_DRAWTHICKNESS_SPECIAL) {
glBegin(GL_POINTS);
- glVertex2f(points->x, points->y);
+ glVertex2fv(co);
glEnd();
}
else {
- const float x= (points->x / 1000 * winx);
- const float y= (points->y / 1000 * winy);
+ /* draw filled circle as is done in circf (but without the matrix push/pops which screwed things up) */
+ GLUquadricObj *qobj = gluNewQuadric();
- glBegin(GL_POINTS);
- glVertex2f(x, y);
+ gluQuadricDrawStyle(qobj, GLU_FILL);
+
+ /* need to translate drawing position, but must reset after too! */
+ glTranslatef(co[0], co[1], 0.);
+ gluDisk( qobj, 0.0, thickness, 32, 1);
+ glTranslatef(-co[0], -co[1], 0.);
+
+ gluDeleteQuadric(qobj);
+ }
+ }
+}
+
+/* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */
+static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy)
+{
+ bGPDspoint *pt;
+ float oldpressure = 0.0f;
+ int i;
+
+ /* draw stroke curve */
+ glBegin(GL_LINE_STRIP);
+ for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
+ if (fabs(pt->pressure - oldpressure) > 0.2f) {
glEnd();
+ glLineWidth(pt->pressure * thickness);
+ glBegin(GL_LINE_STRIP);
+
+ glVertex3f(pt->x, pt->y, pt->z);
+
+ oldpressure = pt->pressure;
}
+ else
+ glVertex3f(pt->x, pt->y, pt->z);
}
- else {
- float oldpressure = 0.0f;
+ glEnd();
+
+ /* draw debug points of curve on top? */
+ if (debug) {
+ glBegin(GL_POINTS);
+ for (i=0, pt=points; i < totpoints && pt; i++, pt++)
+ glVertex3f(pt->x, pt->y, pt->z);
+ glEnd();
+ }
+}
+
+/* ----- Fancy 2D-Stroke Drawing ------ */
+
+/* draw a given stroke in 2d */
+static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag,
+ short debug, int offsx, int offsy, int winx, int winy)
+{
+ /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, 'smooth' opengl lines look better
+ * - but NOT if Image Editor 'image-based' stroke
+ */
+ if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
+ ((curarea->spacetype==SPACE_IMAGE) && (dflag & GP_DRAWDATA_ONLYV2D)) )
+ {
+ bGPDspoint *pt;
+ int i;
- /* draw stroke curve */
glBegin(GL_LINE_STRIP);
for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
- float x, y, z;
-
- if (sflag & GP_STROKE_3DSPACE) {
- x= pt->x;
- y= pt->y;
- z= pt->z;
+ if (sflag & GP_STROKE_2DSPACE) {
+ glVertex2f(pt->x, pt->y);
}
- else if (sflag & GP_STROKE_2DSPACE) {
- x= pt->x;
- y= pt->y;
- z= 0;
+ else if (sflag & GP_STROKE_2DIMAGE) {
+ const float x= (pt->x * winx) + offsx;
+ const float y= (pt->y * winy) + offsy;
+
+ glVertex2f(x, y);
}
else {
- x= (pt->x / 1000 * winx);
- y= (pt->y / 1000 * winy);
- z= 0;
+ const float x= (pt->x / 1000 * winx);
+ const float y= (pt->y / 1000 * winy);
+
+ glVertex2f(x, y);
}
+ }
+ glEnd();
+ }
+
+ /* tesselation code: currently only enabled with rt != 0 */
+ else
+ {
+ bGPDspoint *pt1, *pt2;
+ float pm[2];
+ int i;
+
+ glShadeModel(GL_FLAT);
+ glBegin(GL_QUADS);
+
+ for (i=0, pt1=points, pt2=points+1; i < (totpoints-1); i++, pt1++, pt2++) {
+ float s0[2], s1[2]; /* segment 'center' points */
+ float t0[2], t1[2]; /* tesselated coordinates */
+ float m1[2], m2[2]; /* gradient and normal */
+ float mt[2], sc[2]; /* gradient for thickness, point for end-cap */
+ float pthick; /* thickness at segment point */
- if (fabs(pt->pressure - oldpressure) > 0.2f) {
- glEnd();
- glLineWidth(pt->pressure * thickness);
- glBegin(GL_LINE_STRIP);
+ /* get x and y coordinates from points */
+ if (sflag & GP_STROKE_2DSPACE) {
+ s0[0]= pt1->x; s0[1]= pt1->y;
+ s1[0]= pt2->x; s1[1]= pt2->y;
+ }
+ else if (sflag & GP_STROKE_2DIMAGE) {
+ s0[0]= (pt1->x * winx) + offsx;
+ s0[1]= (pt1->y * winy) + offsy;
+ s1[0]= (pt2->x * winx) + offsx;
+ s1[1]= (pt2->y * winy) + offsy;
+ }
+ else {
+ s0[0]= (pt1->x / 1000 * winx);
+ s0[1]= (pt1->y / 1000 * winy);
+ s1[0]= (pt2->x / 1000 * winx);
+ s1[1]= (pt2->y / 1000 * winy);
+ }
+
+ /* calculate gradient and normal - 'angle'=(ny/nx) */
+ m1[1]= s1[1] - s0[1];
+ m1[0]= s1[0] - s0[0];
+ Normalize2(m1);
+ m2[1]= -m1[0];
+ m2[0]= m1[1];
+
+ /* always use pressure from first point here */
+ pthick= (pt1->pressure * thickness);
+
+ /* if the first segment, start of segment is segment's normal */
+ if (i == 0) {
+ /* draw start cap first
+ * - make points slightly closer to center (about halfway across)
+ */
+ mt[0]= m2[0] * pthick * 0.5;
+ mt[1]= m2[1] * pthick * 0.5;
+ sc[0]= s0[0] - (m1[0] * pthick * 0.75);
+ sc[1]= s0[1] - (m1[1] * pthick * 0.75);
- if (sflag & GP_STROKE_3DSPACE)
- glVertex3f(x, y, z);
- else
- glVertex2f(x, y);
+ t0[0]= sc[0] - mt[0];
+ t0[1]= sc[1] - mt[1];
+ t1[0]= sc[0] + mt[0];
+ t1[1]= sc[1] + mt[1];
- oldpressure = pt->pressure;
+ glVertex2fv(t0);
+ glVertex2fv(t1);
+
+ /* calculate points for start of segment */
+ mt[0]= m2[0] * pthick;
+ mt[1]= m2[1] * pthick;
+
+ t0[0]= s0[0] - mt[0];
+ t0[1]= s0[1] - mt[1];
+ t1[0]= s0[0] + mt[0];
+ t1[1]= s0[1] + mt[1];
+
+ /* draw this line twice (first to finish off start cap, then for stroke) */
+ glVertex2fv(t1);
+ glVertex2fv(t0);
+ glVertex2fv(t0);
+ glVertex2fv(t1);
}
+ /* if not the first segment, use bisector of angle between segments */
else {
- if (sflag & GP_STROKE_3DSPACE)
- glVertex3f(x, y, z);
- else
- glVertex2f(x, y);
+ float mb[2]; /* bisector normal */
+ float athick, dfac; /* actual thickness, difference between thicknesses */
+
+ /* calculate gradient of bisector (as average of normals) */
+ mb[0]= (pm[0] + m2[0]) / 2;
+ mb[1]= (pm[1] + m2[1]) / 2;
+ Normalize2(mb);
+
+ /* calculate gradient to apply
+ * - as basis, use just pthick * bisector gradient
+ * - if cross-section not as thick as it should be, add extra padding to fix it
+ */
+ mt[0]= mb[0] * pthick;
+ mt[1]= mb[1] * pthick;
+ athick= Vec2Length(mt);
+ dfac= pthick - (athick * 2);
+ if ( ((athick * 2) < pthick) && (IS_EQ(athick, pthick)==0) )
+ {
+ mt[0] += (mb[0] * dfac);
+ mt[1] += (mb[1] * dfac);
+ }
+
+ /* calculate points for start of segment */
+ t0[0]= s0[0] - mt[0];
+ t0[1]= s0[1] - mt[1];
+ t1[0]= s0[0] + mt[0];
+ t1[1]= s0[1] + mt[1];
+
+ /* draw this line twice (once for end of current segment, and once for start of next) */
+ glVertex2fv(t1);
+ glVertex2fv(t0);
+ glVertex2fv(t0);
+ glVertex2fv(t1);
+ }
+
+ /* if last segment, also draw end of segment (defined as segment's normal) */
+ if (i == totpoints-2) {
+ /* for once, we use second point's pressure (otherwise it won't be drawn) */
+ pthick= (pt2->pressure * thickness);
+
+ /* calculate points for end of segment */
+ mt[0]= m2[0] * pthick;
+ mt[1]= m2[1] * pthick;
+
+ t0[0]= s1[0] - mt[0];
+ t0[1]= s1[1] - mt[1];
+ t1[0]= s1[0] + mt[0];
+ t1[1]= s1[1] + mt[1];
+
+ /* draw this line twice (once for end of stroke, and once for endcap)*/
+ glVertex2fv(t1);
+ glVertex2fv(t0);
+ glVertex2fv(t0);
+ glVertex2fv(t1);
+
+
+ /* draw end cap as last step
+ * - make points slightly closer to center (about halfway across)
+ */
+ mt[0]= m2[0] * pthick * 0.5;
+ mt[1]= m2[1] * pthick * 0.5;
+ sc[0]= s1[0] + (m1[0] * pthick * 0.75);
+ sc[1]= s1[1] + (m1[1] * pthick * 0.75);
+
+ t0[0]= sc[0] - mt[0];
+ t0[1]= sc[1] - mt[1];
+ t1[0]= sc[0] + mt[0];
+ t1[1]= sc[1] + mt[1];
+
+ glVertex2fv(t1);
+ glVertex2fv(t0);
}
+
+ /* store stroke's 'natural' normal for next stroke to use */
+ Vec2Copyf(pm, m2);
}
+
glEnd();
+ }
+
+ /* draw debug points of curve on top? (original stroke points) */
+ if (debug) {
+ bGPDspoint *pt;
+ int i;
- /* draw debug points of curve on top? */
- if (debug) {
- glBegin(GL_POINTS);
- for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
- if (sflag & GP_STROKE_3DSPACE) {
- glVertex3f(pt->x, pt->y, pt->z);
- }
- else if (sflag & GP_STROKE_2DSPACE) {
- glVertex2f(pt->x, pt->y);
- }
- else {
- const float x= (pt->x / 1000 * winx);
- const float y= (pt->y / 1000 * winy);
-
- glVertex2f(x, y);
- }
+ glBegin(GL_POINTS);
+ for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
+ if (sflag & GP_STROKE_2DSPACE) {
+ glVertex2f(pt->x, pt->y);
+ }
+ else if (sflag & GP_STROKE_2DIMAGE) {
+ const float x= (pt->x * winx) + offsx;
+ const float y= (pt->y * winy) + offsy;
+
+ glVertex2f(x, y);
+ }
+ else {
+ const float x= (pt->x / 1000 * winx);
+ const float y= (pt->y / 1000 * winy);
+
+ glVertex2f(x, y);
}
- glEnd();
}
+ glEnd();
+ }
+}
+
+/* ----- General Drawing ------ */
+
+/* draw a set of strokes */
+static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag,
+ short debug, short lthick, float color[4])
+{
+ bGPDstroke *gps;
+
+ /* set color first (may need to reset it again later too) */
+ glColor4f(color[0], color[1], color[2], color[3]);
+
+ for (gps= gpf->strokes.first; gps; gps= gps->next) {
+ /* check if stroke can be drawn */
+ if ((dflag & GP_DRAWDATA_ONLY3D) && !(gps->flag & GP_STROKE_3DSPACE))
+ continue;
+ if (!(dflag & GP_DRAWDATA_ONLY3D) && (gps->flag & GP_STROKE_3DSPACE))
+ continue;
+ if ((dflag & GP_DRAWDATA_ONLYV2D) && !(gps->flag & GP_STROKE_2DSPACE))
+ continue;
+ if (!(dflag & GP_DRAWDATA_ONLYV2D) && (gps->flag & GP_STROKE_2DSPACE))
+ continue;
+ if ((dflag & GP_DRAWDATA_ONLYI2D) && !(gps->flag & GP_STROKE_2DIMAGE))
+ continue;
+ if (!(dflag & GP_DRAWDATA_ONLYI2D) && (gps->flag & GP_STROKE_2DIMAGE))
+ continue;
+ if ((gps->points == 0) || (gps->totpoints < 1))
+ continue;
+
+ /* check which stroke-drawer to use */
+ if (gps->totpoints == 1)
+ gp_draw_stroke_point(gps->points, lthick, gps->flag, offsx, offsy, winx, winy);
+ else if (dflag & GP_DRAWDATA_ONLY3D)
+ gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
+ else if (gps->totpoints > 1)
+ gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, offsx, offsy, winx, winy);
}
}
/* draw grease-pencil datablock */
-static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
+static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy, int dflag)
{
bGPDlayer *gpl, *actlay=NULL;
@@ -437,11 +764,10 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
/* loop over layers, drawing them */
for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
bGPDframe *gpf;
- bGPDstroke *gps;
short debug = (gpl->flag & GP_LAYER_DRAWDEBUG) ? 1 : 0;
short lthick= gpl->thickness;
- float color[4];
+ float color[4], tcolor[4];
/* don't draw layer if hidden */
if (gpl->flag & GP_LAYER_HIDE)
@@ -459,6 +785,7 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
/* set color, stroke thickness, and point size */
glLineWidth(lthick);
QUATCOPY(color, gpl->color); // just for copying 4 array elements
+ QUATCOPY(tcolor, gpl->color); // additional copy of color (for ghosting)
glColor4f(color[0], color[1], color[2], color[3]);
glPointSize(gpl->thickness + 2);
@@ -474,11 +801,8 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
/* check if frame is drawable */
if ((gpf->framenum - gf->framenum) <= gpl->gstep) {
/* alpha decreases with distance from curframe index */
- glColor4f(color[0], color[1], color[2], (color[3]-(i*0.7)));
-
- for (gps= gf->strokes.first; gps; gps= gps->next) {
- gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
- }
+ tcolor[3] = color[3] - (i/gpl->gstep);
+ gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
else
break;
@@ -489,11 +813,8 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
/* check if frame is drawable */
if ((gf->framenum - gpf->framenum) <= gpl->gstep) {
/* alpha decreases with distance from curframe index */
- glColor4f(color[0], color[1], color[2], (color[3]-(i*0.7)));
-
- for (gps= gf->strokes.first; gps; gps= gps->next) {
- gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
- }
+ tcolor[3] = color[3] - (i/gpl->gstep);
+ gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
else
break;
@@ -504,19 +825,14 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
}
else {
/* draw the strokes for the ghost frames (at half of the alpha set by user) */
- glColor4f(color[0], color[1], color[2], (color[3] / 7));
-
if (gpf->prev) {
- for (gps= gpf->prev->strokes.first; gps; gps= gps->next) {
- gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
- }
+ tcolor[3] = (color[3] / 7);
+ gp_draw_strokes(gpf->prev, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
- glColor4f(color[0], color[1], color[2], (color[3] / 4));
if (gpf->next) {
- for (gps= gpf->next->strokes.first; gps; gps= gps->next) {
- gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
- }
+ tcolor[3] = (color[3] / 4);
+ gp_draw_strokes(gpf->next, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
/* restore alpha */
@@ -525,20 +841,17 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
}
/* draw the strokes already in active frame */
- for (gps= gpf->strokes.first; gps; gps= gps->next) {
- gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
- }
+ tcolor[3]= color[3];
+ gp_draw_strokes(gpf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
/* Check if may need to draw the active stroke cache, only if this layer is the active layer
- * that is being edited. (Stroke cache is currently stored in gp-data)
+ * that is being edited. (Stroke buffer is currently stored in gp-data)
*/
if ((G.f & G_GREASEPENCIL) && (gpl->flag & GP_LAYER_ACTIVE) &&
(gpf->flag & GP_FRAME_PAINT))
{
/* Buffer stroke needs to be drawn with a different linestyle to help differentiate them from normal strokes. */
- setlinestyle(2);
- gp_draw_stroke(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag, debug, winx, winy);
- setlinestyle(0);
+ gp_draw_stroke_buffer(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag);
}
}
@@ -591,7 +904,76 @@ static void gp_draw_data (bGPdata *gpd, int winx, int winy, int dflag)
glColor4f(0, 0, 0, 1);
}
-/* ----------- */
+/* ----- Grease Pencil Sketches Drawing API ------ */
+
+/* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */
+void draw_gpencil_2dimage (ScrArea *sa, ImBuf *ibuf)
+{
+ bGPdata *gpd;
+ int offsx, offsy, sizex, sizey;
+ int dflag = GP_DRAWDATA_NOSTATUS;
+
+ /* check that we have grease-pencil stuff to draw */
+ if (ELEM(NULL, sa, ibuf)) return;
+ gpd= gpencil_data_getactive(sa);
+ if (gpd == NULL) return;
+
+ /* calculate rect */
+ switch (sa->spacetype) {
+ case SPACE_IMAGE: /* image */
+ {
+ SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
+
+ /* just draw using standard scaling (settings here are currently ignored anyways) */
+ // FIXME: the opengl poly-strokes don't draw at right thickness when done this way, so disabled
+ offsx= 0;
+ offsy= 0;
+ sizex= sa->winx;
+ sizey= sa->winy;
+
+ myortho2(sima->v2d.cur.xmin, sima->v2d.cur.xmax, sima->v2d.cur.ymin, sima->v2d.cur.ymax);
+
+ dflag |= GP_DRAWDATA_ONLYV2D;
+ }
+ break;
+
+ case SPACE_SEQ: /* sequence */
+ {
+ SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first;
+ float zoom, zoomx, zoomy;
+
+ /* calculate accessory values */
+ zoom= SEQ_ZOOM_FAC(sseq->zoom);
+ if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
+ zoomy = zoom;
+ }
+ else
+ zoomx = zoomy = zoom;
+
+ sizex= zoomx * ibuf->x;
+ sizey= zoomy * ibuf->y;
+ offsx= (sa->winx-sizex)/2 + sseq->xof;
+ offsy= (sa->winy-sizey)/2 + sseq->yof;
+
+ dflag |= GP_DRAWDATA_ONLYI2D;
+ }
+ break;
+
+ default: /* for spacetype not yet handled */
+ offsx= 0;
+ offsy= 0;
+ sizex= sa->winx;
+ sizey= sa->winy;
+
+ dflag |= GP_DRAWDATA_ONLYI2D;
+ break;
+ }
+
+
+ /* draw it! */
+ gp_draw_data(gpd, offsx, offsy, sizex, sizey, dflag);
+}
/* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly
* Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes
@@ -608,7 +990,7 @@ void draw_gpencil_2dview (ScrArea *sa, short onlyv2d)
/* draw it! */
if (onlyv2d) dflag |= (GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_NOSTATUS);
- gp_draw_data(gpd, sa->winx, sa->winy, dflag);
+ gp_draw_data(gpd, 0, 0, sa->winx, sa->winy, dflag);
}
/* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly
@@ -625,7 +1007,7 @@ void draw_gpencil_3dview (ScrArea *sa, short only3d)
/* draw it! */
if (only3d) dflag |= (GP_DRAWDATA_ONLY3D|GP_DRAWDATA_NOSTATUS);
- gp_draw_data(gpd, sa->winx, sa->winy, dflag);
+ gp_draw_data(gpd, 0, 0, sa->winx, sa->winy, dflag);
}
/* draw grease-pencil sketches to opengl render window assuming that matrices are already set correctly */
@@ -639,7 +1021,7 @@ void draw_gpencil_oglrender (View3D *v3d, int winx, int winy)
if (gpd == NULL) return;
/* pass 1: draw 3d-strokes ------------ > */
- gp_draw_data(gpd, winx, winy, (GP_DRAWDATA_NOSTATUS|GP_DRAWDATA_ONLY3D));
+ gp_draw_data(gpd, 0, 0, winx, winy, (GP_DRAWDATA_NOSTATUS|GP_DRAWDATA_ONLY3D));
/* pass 2: draw 2d-strokes ------------ > */
/* adjust view matrices */
@@ -647,7 +1029,7 @@ void draw_gpencil_oglrender (View3D *v3d, int winx, int winy)
glLoadIdentity();
/* draw it! */
- gp_draw_data(gpd, winx, winy, GP_DRAWDATA_NOSTATUS);
+ gp_draw_data(gpd, 0, 0, winx, winy, GP_DRAWDATA_NOSTATUS);
}
/* ************************************************** */
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
index 14849cdd450..97765690ceb 100644
--- a/source/blender/src/drawimage.c
+++ b/source/blender/src/drawimage.c
@@ -52,6 +52,7 @@
#include "DNA_camera_types.h"
#include "DNA_color_types.h"
#include "DNA_image_types.h"
+#include "DNA_gpencil_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
@@ -79,6 +80,7 @@
#include "BDR_editface.h"
#include "BDR_drawobject.h"
#include "BDR_drawmesh.h"
+#include "BDR_gpencil.h"
#include "BDR_imagepaint.h"
#include "BIF_cursors.h"
@@ -86,6 +88,7 @@
#include "BIF_graphics.h"
#include "BIF_mywindow.h"
#include "BIF_drawimage.h"
+#include "BIF_drawgpencil.h"
#include "BIF_resources.h"
#include "BIF_interface.h"
#include "BIF_interface_icons.h"
@@ -1778,6 +1781,45 @@ static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVI
}
+static void image_panel_gpencil(short cntrl) // IMAGE_HANDLER_GREASEPENCIL
+{
+ uiBlock *block;
+ SpaceImage *sima;
+
+ sima= curarea->spacedata.first;
+
+ block= uiNewBlock(&curarea->uiblocks, "image_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win);
+ uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
+ uiSetPanelHandler(IMAGE_HANDLER_GREASEPENCIL); // for close and esc
+ if (uiNewPanel(curarea, block, "Grease Pencil", "SpaceImage", 100, 30, 318, 204)==0) return;
+
+ /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */
+ if (sima->flag & SI_DISPGP) {
+ if (sima->gpd == NULL)
+ gpencil_data_setactive(curarea, gpencil_data_addnew());
+ }
+
+ if (sima->flag & SI_DISPGP) {
+ bGPdata *gpd= sima->gpd;
+ short newheight;
+
+ /* this is a variable height panel, newpanel doesnt force new size on existing panels */
+ /* so first we make it default height */
+ uiNewPanelHeight(block, 204);
+
+ /* draw button for showing gpencil settings and drawings */
+ uiDefButBitI(block, TOG, SI_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sima->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Image/UV Editor (draw using Shift-LMB)");
+
+ /* extend the panel if the contents won't fit */
+ newheight= draw_gpencil_panel(block, gpd, curarea);
+ uiNewPanelHeight(block, newheight);
+ }
+ else {
+ uiDefButBitI(block, TOG, SI_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sima->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Image/UV Editor");
+ uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
+ }
+}
+
static void image_blockhandlers(ScrArea *sa)
{
SpaceImage *sima= sa->spacedata.first;
@@ -1788,7 +1830,6 @@ static void image_blockhandlers(ScrArea *sa)
for(a=0; a<SPACE_MAXHANDLER; a+=2) {
switch(sima->blockhandler[a]) {
-
case IMAGE_HANDLER_PROPERTIES:
image_panel_properties(sima->blockhandler[a+1]);
break;
@@ -1806,7 +1847,10 @@ static void image_blockhandlers(ScrArea *sa)
break;
case IMAGE_HANDLER_PREVIEW:
image_panel_preview(sa, sima->blockhandler[a+1]);
- break;
+ break;
+ case IMAGE_HANDLER_GREASEPENCIL:
+ image_panel_gpencil(sima->blockhandler[a+1]);
+ break;
}
/* clear action value for event */
sima->blockhandler[a+1]= 0;
@@ -2339,9 +2383,17 @@ void drawimagespace(ScrArea *sa, void *spacedata)
}
draw_image_transform(ibuf, xuser_asp, yuser_asp);
+
+ /* draw grease-pencil ('image' strokes) */
+ if (sima->flag & SI_DISPGP)
+ draw_gpencil_2dimage(sa, ibuf);
mywinset(sa->win); /* restore scissor after gla call... */
myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
+
+ /* draw grease-pencil (screen strokes) */
+ if (sima->flag & SI_DISPGP)
+ draw_gpencil_2dview(sa, 0);
if(G.rendering==0) {
draw_image_view_tool();
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
index 0e7476bbe82..9b5be04eac1 100644
--- a/source/blender/src/drawipo.c
+++ b/source/blender/src/drawipo.c
@@ -442,7 +442,7 @@ int in_ipo_buttons(void)
else return 1;
}
-static View2D *spacelink_get_view2d(SpaceLink *sl)
+View2D *spacelink_get_view2d(SpaceLink *sl)
{
if(sl->spacetype==SPACE_IPO)
return &((SpaceIpo *)sl)->v2d;
@@ -1212,16 +1212,9 @@ static void draw_ipovertices(int sel)
/*}*/
} else { /* normal non bit curves */
if(ei->flag & IPO_EDIT) {
- if(ei->icu->ipo==IPO_BEZ) {
- /* Draw the editmode hendels for a bezier curve */
- if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
- bglVertex3fv(bezt->vec[0]);
-
- if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
- bglVertex3fv(bezt->vec[2]);
-
- }
-
+ /* Only the vertex of the line, the
+ * handler are draw below.
+ */
if( (bezt->f2 & SELECT) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/
bglVertex3fv(bezt->vec[1]);
@@ -1237,6 +1230,45 @@ static void draw_ipovertices(int sel)
bezt++;
}
bglEnd();
+
+ if (ei->flag & IPO_EDIT) {
+ /* Now draw the two vertex of the handler,
+ * need split it because we can't call glPointSize
+ * in the middle of a glBegin/glEnd also the
+ * bug comment before.
+ */
+ a= ei->icu->totvert;
+ bezt= ei->icu->bezt;
+
+ glPointSize(BIF_GetThemeValuef(TH_HANDLE_VERTEX_SIZE));
+
+ if(sel) BIF_ThemeColor(TH_HANDLE_VERTEX_SELECT);
+ else BIF_ThemeColor(TH_HANDLE_VERTEX);
+
+ bglBegin(GL_POINTS);
+
+ while(a--) {
+ if (ei->disptype!=IPO_DISPBITS) {
+ if(ei->flag & IPO_EDIT) {
+ if(ei->icu->ipo==IPO_BEZ) {
+ /* Draw the editmode hendels for a bezier curve */
+ if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
+ bglVertex3fv(bezt->vec[0]);
+
+ if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
+ bglVertex3fv(bezt->vec[2]);
+ }
+ }
+ }
+ bezt++;
+ }
+ bglEnd();
+
+ /* The color are always reset (see the while)
+ * but the point size not so we reset now.
+ */
+ glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
+ }
}
}
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c
index dd512595ebc..8f22c704fd0 100644
--- a/source/blender/src/drawmesh.c
+++ b/source/blender/src/drawmesh.c
@@ -76,534 +76,12 @@
#include "BSE_drawview.h"
+#include "GPU_extensions.h"
+#include "GPU_draw.h"
+
#include "blendef.h"
#include "nla.h"
-#ifndef GL_CLAMP_TO_EDGE
-#define GL_CLAMP_TO_EDGE 0x812F
-#endif
-
-//#include "glext.h"
-/* some local functions */
-#if defined(GL_EXT_texture_object) && (!defined(__sun__) || (!defined(__sun))) && !defined(__APPLE__) && !defined(__linux__) && !defined(WIN32)
- #define glBindTexture(A,B) glBindTextureEXT(A,B)
- #define glGenTextures(A,B) glGenTexturesEXT(A,B)
- #define glDeleteTextures(A,B) glDeleteTexturesEXT(A,B)
- #define glPolygonOffset(A,B) glPolygonOffsetEXT(A,B)
-
-#else
-
-/* #define GL_FUNC_ADD_EXT GL_FUNC_ADD */
-/* #define GL_FUNC_REVERSE_SUBTRACT_EXT GL_FUNC_REVERSE_SUBTRACT */
-/* #define GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET */
-
-#endif
-
- /* (n&(n-1)) zeros the least significant bit of n */
-static int is_pow2(int num) {
- return ((num)&(num-1))==0;
-}
-static int smaller_pow2(int num) {
- while (!is_pow2(num))
- num= num&(num-1);
- return num;
-}
-
-/* These are used to enable texture clamping */
-static int is_pow2_limit(int num) {
- if (U.glreslimit != 0 && num > U.glreslimit) return 0;
- return ((num)&(num-1))==0;
-}
-
-static int smaller_pow2_limit(int num) {
- if (U.glreslimit != 0 && num > U.glreslimit)
- return U.glreslimit;
- return smaller_pow2(num);
-}
-
-static int fCurtile=0, fCurmode=0,fCurtileXRep=0,fCurtileYRep=0;
-static Image *fCurpage=0;
-static short fTexwindx, fTexwindy, fTexwinsx, fTexwinsy;
-static int fDoMipMap = 1;
-static int fLinearMipMap = 0;
-
-/* local prototypes --------------- */
-void update_realtime_textures(void);
-
-
-/* static int source, dest; also not used */
-
-/**
- * Enables or disable mipmapping for realtime images.
- * @param mipmap Turn mipmapping on (mipmap!=0) or off (mipmap==0).
- */
-void set_mipmap(int mipmap)
-{
- if (fDoMipMap != (mipmap != 0)) {
- free_all_realtime_images();
- fDoMipMap = mipmap != 0;
- }
-}
-
-/**
- * Returns the current setting for mipmapping.
- */
-static int get_mipmap(void)
-{
- return fDoMipMap && (!(G.f & G_TEXTUREPAINT));
-}
-
-/**
- * Enables or disable linear mipmap setting for realtime images (textures).
- * Note that this will will destroy all texture bindings in OpenGL.
- * @see free_realtime_image()
- * @param mipmap Turn linear mipmapping on (linear!=0) or off (linear==0).
- */
-void set_linear_mipmap(int linear)
-{
- if (fLinearMipMap != (linear != 0)) {
- free_all_realtime_images();
- fLinearMipMap = linear != 0;
- }
-}
-
-/**
- * Returns the current setting for linear mipmapping.
- */
-int get_linear_mipmap(void)
-{
- return fLinearMipMap;
-}
-
-
-/**
- * Resets the realtime image cache variables.
- */
-void clear_realtime_image_cache()
-{
- fCurpage = NULL;
- fCurtile = 0;
- fCurmode = 0;
- fCurtileXRep = 0;
- fCurtileYRep = 0;
-}
-
-/* REMEMBER! Changes here must go into my_set_tpage() as well */
-int set_tpage(MTFace *tface)
-{
- static int alphamode= -1;
- static MTFace *lasttface= 0;
- Image *ima;
- ImBuf *ibuf;
- unsigned int *rect=NULL, *bind;
- int tpx=0, tpy=0, tilemode, tileXRep,tileYRep;
-
- /* disable */
- if(tface==0) {
- if(lasttface==0) return 0;
-
- lasttface= 0;
- fCurtile= 0;
- fCurpage= 0;
- if(fCurmode!=0) {
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- }
- fCurmode= 0;
- fCurtileXRep=0;
- fCurtileYRep=0;
- alphamode= -1;
-
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_TEXTURE_GEN_S);
- glDisable(GL_TEXTURE_GEN_T);
- glDisable ( GL_ALPHA_TEST );
- return 0;
- }
- lasttface= tface;
-
- if( alphamode != tface->transp) {
- alphamode= tface->transp;
-
- if(alphamode) {
- if(alphamode==TF_ADD) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- glDisable ( GL_ALPHA_TEST );
- /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */
- }
- else if(alphamode==TF_ALPHA) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- /* added after 2.45 to clip alpha */
-
- /*if U.glalphaclip == 1.0, some cards go bonkers... turn off alpha test in this case*/
- if(U.glalphaclip == 1.0) glDisable(GL_ALPHA_TEST);
- else{
- glEnable ( GL_ALPHA_TEST );
- glAlphaFunc ( GL_GREATER, U.glalphaclip );
- }
- } else if (alphamode==TF_CLIP){
- glDisable(GL_BLEND);
- glEnable ( GL_ALPHA_TEST );
- glAlphaFunc(GL_GREATER, 0.5f);
- }
- /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */
- /* else { */
- /* glBlendFunc(GL_ONE, GL_ONE); */
- /* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */
- /* } */
- } else {
- glDisable(GL_BLEND);
- glDisable ( GL_ALPHA_TEST );
- }
- }
-
- ima= tface->tpage;
-
- /* Enable or disable reflection mapping */
- if (ima && (ima->flag & IMA_REFLECT)){
-
-// glActiveTextureARB(GL_TEXTURE0_ARB);
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
-
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
-
- /* Handle multitexturing here */
- }
- else{
- glDisable(GL_TEXTURE_GEN_S);
- glDisable(GL_TEXTURE_GEN_T);
- }
-
- tilemode= tface->mode & TF_TILES;
- tileXRep = 0;
- tileYRep = 0;
- if (ima) {
- tileXRep = ima->xrep;
- tileYRep = ima->yrep;
- }
-
-
- if(ima==fCurpage && fCurtile==tface->tile && tilemode==fCurmode && fCurtileXRep==tileXRep && fCurtileYRep == tileYRep) return ima!=0;
-
- if(tilemode!=fCurmode || fCurtileXRep!=tileXRep || fCurtileYRep != tileYRep) {
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
-
- if(tilemode && ima!=NULL)
- glScalef(ima->xrep, ima->yrep, 1.0);
-
- glMatrixMode(GL_MODELVIEW);
- }
-
- if(ima==NULL || ima->ok==0) {
- glDisable(GL_TEXTURE_2D);
-
- fCurtile= tface->tile;
- fCurpage= 0;
- fCurmode= tilemode;
- fCurtileXRep = tileXRep;
- fCurtileYRep = tileYRep;
-
- return 0;
- }
-
- ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf==NULL) {
-
- fCurtile= tface->tile;
- fCurpage= 0;
- fCurmode= tilemode;
- fCurtileXRep = tileXRep;
- fCurtileYRep = tileYRep;
-
- glDisable(GL_TEXTURE_2D);
- return 0;
- }
-
- if ((ibuf->rect==NULL) && ibuf->rect_float)
- IMB_rect_from_float(ibuf);
-
- if(ima->tpageflag & IMA_TWINANIM) fCurtile= ima->lastframe;
- else fCurtile= tface->tile;
-
- if(tilemode) {
- if(ima->repbind==0) make_repbind(ima);
-
- if(fCurtile>=ima->totbind) fCurtile= 0;
-
- /* this happens when you change repeat buttons */
- if(ima->repbind) bind= ima->repbind+fCurtile;
- else bind= &ima->bindcode;
-
- if(*bind==0) {
-
- fTexwindx= ibuf->x/ima->xrep;
- fTexwindy= ibuf->y/ima->yrep;
-
- if(fCurtile>=ima->xrep*ima->yrep) fCurtile= ima->xrep*ima->yrep-1;
-
- fTexwinsy= fCurtile / ima->xrep;
- fTexwinsx= fCurtile - fTexwinsy*ima->xrep;
-
- fTexwinsx*= fTexwindx;
- fTexwinsy*= fTexwindy;
-
- tpx= fTexwindx;
- tpy= fTexwindy;
-
- rect= ibuf->rect + fTexwinsy*ibuf->x + fTexwinsx;
- }
- }
- else {
- bind= &ima->bindcode;
-
- if(*bind==0) {
- tpx= ibuf->x;
- tpy= ibuf->y;
- rect= ibuf->rect;
- }
- }
-
- if(*bind==0) {
- int rectw= tpx, recth= tpy;
- unsigned int *tilerect= NULL, *scalerect= NULL;
-
- /*
- * Maarten:
- * According to Ton this code is not needed anymore. It was used only
- * in really old Blenders.
- * Reevan:
- * Actually it is needed for backwards compatibility. Simpledemo 6 does not display correctly without it.
- */
-#if 1
- if (tilemode) {
- int y;
-
- tilerect= MEM_mallocN(rectw*recth*sizeof(*tilerect), "tilerect");
- for (y=0; y<recth; y++) {
- unsigned int *rectrow= &rect[y*ibuf->x];
- unsigned int *tilerectrow= &tilerect[y*rectw];
-
- memcpy(tilerectrow, rectrow, tpx*sizeof(*rectrow));
- }
-
- rect= tilerect;
- }
-#endif
- if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) {
- rectw= smaller_pow2_limit(rectw);
- recth= smaller_pow2_limit(recth);
-
- scalerect= MEM_mallocN(rectw*recth*sizeof(*scalerect), "scalerect");
- gluScaleImage(GL_RGBA, tpx, tpy, GL_UNSIGNED_BYTE, rect, rectw, recth, GL_UNSIGNED_BYTE, scalerect);
- rect= scalerect;
- }
-
- glGenTextures(1, (GLuint *)bind);
-
- if((G.f & G_DEBUG) || !*bind) {
- GLenum error = glGetError();
- printf("Texture: %s\n", ima->id.name+2);
- printf("name: %d, tpx: %d\n", *bind, tpx);
- printf("tile: %d, mode: %d\n", fCurtile, tilemode);
- if (error)
- printf("error: %s\n", gluErrorString(error));
- }
- glBindTexture( GL_TEXTURE_2D, *bind);
-
- if (!get_mipmap())
- {
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- } else
- {
- int minfilter= fLinearMipMap?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST;
-
- gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, rectw, recth, GL_RGBA, GL_UNSIGNED_BYTE, rect);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- ima->tpageflag |= IMA_MIPMAP_COMPLETE;
- }
-
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- if (tilerect)
- MEM_freeN(tilerect);
- if (scalerect)
- MEM_freeN(scalerect);
- }
- else glBindTexture( GL_TEXTURE_2D, *bind);
-
- /* dont tile x/y as set the the game properties */
- if (ima->tpageflag & IMA_CLAMP_U)
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- else
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- if (ima->tpageflag & IMA_CLAMP_V)
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- else
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-
- /* tag_image_time(ima);*/ /* Did this get lost in the image recode? */
-
- glEnable(GL_TEXTURE_2D);
-
- fCurpage= ima;
- fCurmode= tilemode;
- fCurtileXRep = tileXRep;
- fCurtileYRep = tileYRep;
-
- return 1;
-}
-
-void update_realtime_image(Image *ima, int x, int y, int w, int h)
-{
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
-
- if (ima->repbind || get_mipmap() || !ima->bindcode || !ibuf ||
- (!is_pow2(ibuf->x) || !is_pow2(ibuf->y)) ||
- (w == 0) || (h == 0)) {
- /* these special cases require full reload still */
- free_realtime_image(ima);
- }
- else {
- int row_length = glaGetOneInteger(GL_UNPACK_ROW_LENGTH);
- int skip_pixels = glaGetOneInteger(GL_UNPACK_SKIP_PIXELS);
- int skip_rows = glaGetOneInteger(GL_UNPACK_SKIP_ROWS);
-
- if ((ibuf->rect==NULL) && ibuf->rect_float)
- IMB_rect_from_float(ibuf);
-
- glBindTexture(GL_TEXTURE_2D, ima->bindcode);
-
- glPixelStorei(GL_UNPACK_ROW_LENGTH, ibuf->x);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, x);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, y);
-
- glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA,
- GL_UNSIGNED_BYTE, ibuf->rect);
-
- glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length);
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows);
-
- if(ima->tpageflag & IMA_MIPMAP_COMPLETE)
- ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
- }
-}
-
-void free_realtime_image(Image *ima)
-{
- if(ima->bindcode) {
- glDeleteTextures(1, (GLuint *)&ima->bindcode);
- ima->bindcode= 0;
- ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
- }
- if(ima->repbind) {
- glDeleteTextures(ima->totbind, (GLuint *)ima->repbind);
-
- MEM_freeN(ima->repbind);
- ima->repbind= NULL;
- ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
- }
-}
-
-void free_all_realtime_images(void)
-{
- Image* ima;
-
- for(ima=G.main->image.first; ima; ima=ima->id.next)
- free_realtime_image(ima);
-}
-
-/* these two functions are called on entering and exiting texture paint mode,
- temporary disabling/enabling mipmapping on all images for quick texture
- updates with glTexSubImage2D. images that didn't change don't have to be
- re-uploaded to OpenGL */
-void texpaint_disable_mipmap(void)
-{
- Image* ima;
-
- if(!fDoMipMap)
- return;
-
- for(ima=G.main->image.first; ima; ima=ima->id.next) {
- if(ima->bindcode) {
- glBindTexture(GL_TEXTURE_2D, ima->bindcode);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- }
-}
-
-void texpaint_enable_mipmap(void)
-{
- Image* ima;
-
- if(!fDoMipMap)
- return;
-
- for(ima=G.main->image.first; ima; ima=ima->id.next) {
- if(ima->bindcode) {
- if(ima->tpageflag & IMA_MIPMAP_COMPLETE) {
- int minfilter= fLinearMipMap?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST;
-
- glBindTexture(GL_TEXTURE_2D, ima->bindcode);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
- else
- free_realtime_image(ima);
- }
- }
-}
-
-void make_repbind(Image *ima)
-{
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
-
- if(ibuf==NULL) return;
-
- if(ima->repbind) {
- glDeleteTextures(ima->totbind, (GLuint *)ima->repbind);
- MEM_freeN(ima->repbind);
- ima->repbind= 0;
- ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
- }
- ima->totbind= ima->xrep*ima->yrep;
- if(ima->totbind>1) {
- ima->repbind= MEM_callocN(sizeof(int)*ima->totbind, "repbind");
- }
-}
-
-void update_realtime_textures()
-{
- Image *ima;
-
- ima= G.main->image.first;
- while(ima) {
- if(ima->tpageflag & IMA_TWINANIM) {
- if(ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1;
-
- /* check: is bindcode not in the array? Free. (to do) */
-
- ima->lastframe++;
- if(ima->lastframe > ima->twend) ima->lastframe= ima->twsta;
-
- }
- ima= ima->id.next;
- }
-}
-
/***/
/* Flags for marked edges */
@@ -627,7 +105,7 @@ static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flag
*flags_p |= flags;
}
-EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
+static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
{
EdgeHash *eh = BLI_edgehash_new();
int i;
@@ -664,7 +142,7 @@ static int draw_tfaces3D__setHiddenOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if((G.f & G_DRAWSEAMS) && (med->flag&ME_SEAM)) {
return 0;
@@ -682,7 +160,7 @@ static int draw_tfaces3D__setSeamOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if (med->flag&ME_SEAM) {
if (G.f&G_HIDDENEDGES) {
@@ -698,7 +176,7 @@ static int draw_tfaces3D__setSelectOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
return flags & eEdge_Select;
}
@@ -706,7 +184,7 @@ static int draw_tfaces3D__setActiveOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if (flags & eEdge_Select) {
return 1;
@@ -775,81 +253,6 @@ static void draw_tfaces3D(Object *ob, Mesh *me, DerivedMesh *dm)
BLI_edgehash_free(data.eh, NULL);
}
-static int set_gl_light(Object *ob)
-{
- Base *base;
- Lamp *la;
- int count;
- /* float zero[4]= {0.0, 0.0, 0.0, 0.0}; */
- float vec[4];
-
- vec[3]= 1.0;
-
- for(count=0; count<8; count++) glDisable(GL_LIGHT0+count);
-
- count= 0;
-
- base= FIRSTBASE;
- while(base) {
- if(base->object->type==OB_LAMP ) {
- if(base->lay & G.vd->lay) {
- if(base->lay & ob->lay)
- {
- la= base->object->data;
-
- glPushMatrix();
- glLoadMatrixf((float *)G.vd->viewmat);
-
- where_is_object_simul(base->object);
- VECCOPY(vec, base->object->obmat[3]);
-
- if(la->type==LA_SUN) {
- vec[0]= base->object->obmat[2][0];
- vec[1]= base->object->obmat[2][1];
- vec[2]= base->object->obmat[2][2];
- vec[3]= 0.0;
- glLightfv(GL_LIGHT0+count, GL_POSITION, vec);
- }
- else {
- vec[3]= 1.0;
- glLightfv(GL_LIGHT0+count, GL_POSITION, vec);
- glLightf(GL_LIGHT0+count, GL_CONSTANT_ATTENUATION, 1.0);
- glLightf(GL_LIGHT0+count, GL_LINEAR_ATTENUATION, la->att1/la->dist);
- /* post 2.25 engine supports quad lights */
- glLightf(GL_LIGHT0+count, GL_QUADRATIC_ATTENUATION, la->att2/(la->dist*la->dist));
-
- if(la->type==LA_SPOT) {
- vec[0]= -base->object->obmat[2][0];
- vec[1]= -base->object->obmat[2][1];
- vec[2]= -base->object->obmat[2][2];
- glLightfv(GL_LIGHT0+count, GL_SPOT_DIRECTION, vec);
- glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, la->spotsize/2.0);
- glLightf(GL_LIGHT0+count, GL_SPOT_EXPONENT, 128.0*la->spotblend);
- }
- else glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, 180.0);
- }
-
- vec[0]= la->energy*la->r;
- vec[1]= la->energy*la->g;
- vec[2]= la->energy*la->b;
- vec[3]= 1.0;
- glLightfv(GL_LIGHT0+count, GL_DIFFUSE, vec);
- glLightfv(GL_LIGHT0+count, GL_SPECULAR, vec);//zero);
- glEnable(GL_LIGHT0+count);
-
- glPopMatrix();
-
- count++;
- if(count>7) break;
- }
- }
- }
- base= base->next;
- }
-
- return count;
-}
-
static Material *give_current_material_or_def(Object *ob, int matnr)
{
extern Material defmaterial; // render module abuse...
@@ -893,9 +296,9 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac
if (textured!=c_textured || texface!=c_texface) {
if (textured ) {
- c_badtex= !set_tpage(texface);
+ c_badtex= !GPU_set_tpage(texface);
} else {
- set_tpage(0);
+ GPU_set_tpage(0);
c_badtex= 0;
}
c_textured= textured;
@@ -950,7 +353,7 @@ static void draw_textured_begin(Object *ob)
}
else
/* draw with lights in the scene otherwise */
- Gtexdraw.islit= set_gl_light(ob);
+ Gtexdraw.islit= GPU_scene_object_lights(G.scene, ob, G.vd->lay, G.vd->viewmat);
obcol[0]= CLAMPIS(ob->col[0]*255, 0, 255);
obcol[1]= CLAMPIS(ob->col[1]*255, 0, 255);
@@ -971,12 +374,12 @@ static void draw_textured_begin(Object *ob)
static void draw_textured_end()
{
/* switch off textures */
- set_tpage(0);
+ GPU_set_tpage(0);
glShadeModel(GL_FLAT);
glDisable(GL_CULL_FACE);
- /* XXX, bad patch - default_gl_light() calls
+ /* XXX, bad patch - GPU_default_lights() calls
* glLightfv(GL_LIGHT_POSITION, ...) which
* is transformed by the current matrix... we
* need to make sure that matrix is identity.
@@ -987,7 +390,7 @@ static void draw_textured_end()
*/
glPushMatrix();
glLoadIdentity();
- default_gl_light();
+ GPU_default_lights();
glPopMatrix();
}
@@ -1057,50 +460,71 @@ static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmoot
return 1;
}
-static void draw_game_text_mesh(Object *ob, Mesh *me)
+void draw_mesh_text(Object *ob, int glsl)
{
- DerivedMesh *ddm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH);
- MFace *mface= me->mface;
+ Mesh *me = ob->data;
+ DerivedMesh *ddm;
+ MFace *mf, *mface= me->mface;
MTFace *tface= me->mtface;
MCol *mcol= me->mcol; /* why does mcol exist? */
bProperty *prop = get_property(ob, "Text");
- int a, start= 0, totface= me->totface;
+ GPUVertexAttribs gattribs;
+ int a, totface= me->totface;
+
+ /* don't draw without tfaces */
+ if(!tface)
+ return;
+
+ /* don't draw when editing */
+ if(ob==G.obedit)
+ return;
+ else if(ob==OBACT)
+ if(FACESEL_PAINT_TEST)
+ return;
+
+ ddm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH);
- tface+= start;
- mcol+= start*4;
- for (a=start; a<totface; a++, tface++, mcol+=4) {
- MFace *mf= &mface[a];
+ for(a=0, mf=mface; a<totface; a++, tface++, mf++) {
int mode= tface->mode;
int matnr= mf->mat_nr;
int mf_smooth= mf->flag & ME_SMOOTH;
if (!(mf->flag&ME_HIDE) && !(mode&TF_INVISIBLE) && (mode&TF_BMFONT)) {
- int badtex= set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE);
float v1[3], v2[3], v3[3], v4[3];
char string[MAX_PROPSTRING];
- int characters, index;
- ImBuf *ibuf;
- float curpos;
+ int characters, i, glattrib= -1, badtex= 0;
- if (badtex)
- continue;
+ if(glsl) {
+ GPU_enable_material(matnr+1, &gattribs);
+
+ for(i=0; i<gattribs.totlayer; i++) {
+ if(gattribs.layer[i].type == CD_MTFACE) {
+ glattrib = gattribs.layer[i].glindex;
+ break;
+ }
+ }
+ }
+ else {
+ badtex = set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE);
+ if (badtex) {
+ if (mcol) mcol+=4;
+ continue;
+ }
+ }
ddm->getVertCo(ddm, mf->v1, v1);
ddm->getVertCo(ddm, mf->v2, v2);
ddm->getVertCo(ddm, mf->v3, v3);
if (mf->v4) ddm->getVertCo(ddm, mf->v4, v4);
- // The BM_FONT handling code is duplicated in the gameengine
- // Search for 'Frank van Beek' ;-)
- // string = "Frank van Beek";
+ // The BM_FONT handling is in the gpu module, shared with the
+ // game engine, was duplicated previously
set_property_valstr(prop, string);
characters = strlen(string);
- ibuf= BKE_image_get_ibuf(tface->tpage, NULL);
- if (ibuf == NULL) {
+ if(!BKE_image_get_ibuf(tface->tpage, NULL))
characters = 0;
- }
if (!mf_smooth) {
float nor[3];
@@ -1110,46 +534,11 @@ static void draw_game_text_mesh(Object *ob, Mesh *me)
glNormal3fv(nor);
}
- curpos= 0.0;
- glBegin(mf->v4?GL_QUADS:GL_TRIANGLES);
- for (index = 0; index < characters; index++) {
- float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance;
- int character = string[index];
- char *cp= NULL;
-
- // lets calculate offset stuff
- // space starts at offset 1
- // character = character - ' ' + 1;
-
- matrixGlyph(ibuf, character, & centerx, &centery, &sizex, &sizey, &transx, &transy, &movex, &movey, &advance);
- movex+= curpos;
-
- if (tface->mode & TF_OBCOL)
- glColor3ubv(Gtexdraw.obcol);
- else if (me->mcol) cp= (char *)mcol;
- else glColor3ub(255, 255, 255);
-
- glTexCoord2f((tface->uv[0][0] - centerx) * sizex + transx, (tface->uv[0][1] - centery) * sizey + transy);
- if (cp) glColor3ub(cp[3], cp[2], cp[1]);
- glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]);
-
- glTexCoord2f((tface->uv[1][0] - centerx) * sizex + transx, (tface->uv[1][1] - centery) * sizey + transy);
- if (cp) glColor3ub(cp[7], cp[6], cp[5]);
- glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]);
-
- glTexCoord2f((tface->uv[2][0] - centerx) * sizex + transx, (tface->uv[2][1] - centery) * sizey + transy);
- if (cp) glColor3ub(cp[11], cp[10], cp[9]);
- glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]);
-
- if(mf->v4) {
- glTexCoord2f((tface->uv[3][0] - centerx) * sizex + transx, (tface->uv[3][1] - centery) * sizey + transy);
- if (cp) glColor3ub(cp[15], cp[14], cp[13]);
- glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]);
- }
-
- curpos+= advance;
- }
- glEnd();
+ GPU_render_text(tface, tface->mode, string, characters,
+ (unsigned int*)mcol, v1, v2, v3, (mf->v4? v4: NULL), glattrib);
+ }
+ if (mcol) {
+ mcol+=4;
}
}
@@ -1159,7 +548,6 @@ static void draw_game_text_mesh(Object *ob, Mesh *me)
void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect)
{
Mesh *me= ob->data;
- int editing= 0;
/* correct for negative scale */
if(ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
@@ -1168,38 +556,20 @@ void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect)
/* draw the textured mesh */
draw_textured_begin(ob);
-#ifdef WITH_VERSE
- if(me->vnode) {
- /* verse-blender doesn't support uv mapping of textures yet */
- dm->drawFacesTex(dm, NULL);
- }
- else {
-#endif
- if(ob==G.obedit) {
- dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, G.editMesh);
- } else if(faceselect) {
- if(G.f & G_WEIGHTPAINT)
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1);
- else
- dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me);
- }
+ if(ob==G.obedit) {
+ dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, G.editMesh);
+ } else if(faceselect) {
+ if(G.f & G_WEIGHTPAINT)
+ dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1);
else
- dm->drawFacesTex(dm, draw_tface__set_draw);
-#ifdef WITH_VERSE
- }
-#endif
-
- /* draw game engine text hack - but not if we are editing the mesh */
- if (me->mtface && get_property(ob, "Text")) {
- if(ob==G.obedit)
- editing= 1;
- else if(ob==OBACT)
- if(FACESEL_PAINT_TEST)
- editing= 1;
-
- if(!editing)
- draw_game_text_mesh(ob, me);
+ dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me);
}
+ else
+ dm->drawFacesTex(dm, draw_tface__set_draw);
+
+ /* draw game engine text hack */
+ if(get_property(ob, "Text"))
+ draw_mesh_text(ob, 0);
draw_textured_end();
@@ -1214,10 +584,3 @@ void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
-void init_realtime_GL(void)
-{
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
-}
-
diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c
index 3a73ee84ead..853df3bedfc 100644
--- a/source/blender/src/drawnode.c
+++ b/source/blender/src/drawnode.c
@@ -3336,7 +3336,7 @@ static void nodes_panel_gpencil(short cntrl) // NODES_HANDLER_GREASEPENCIL
uiNewPanelHeight(block, 204);
/* draw button for showing gpencil settings and drawings */
- uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor");
+ uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor (draw using Shift-LMB)");
/* extend the panel if the contents won't fit */
newheight= draw_gpencil_panel(block, gpd, curarea);
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 1a469e8b366..4876e6cae7c 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -93,6 +93,7 @@
#include "BKE_object.h"
#include "BKE_anim.h" //for the where_on_path function
#include "BKE_particle.h"
+#include "BKE_property.h"
#include "BKE_utildefines.h"
#ifdef WITH_VERSE
#include "BKE_verse.h"
@@ -129,6 +130,10 @@
#include "BKE_deform.h"
+#include "GPU_draw.h"
+#include "GPU_material.h"
+#include "GPU_extensions.h"
+
/* pretty stupid */
/* extern Lattice *editLatt; already in BKE_lattice.h */
/* editcurve.c */
@@ -143,114 +148,37 @@ static void drawcircle_size(float size);
static void draw_empty_sphere(float size);
static void draw_empty_cone(float size);
-/* ************* Setting OpenGL Material ************ */
-
-// Materials start counting at # one....
-#define MAXMATBUF (MAXMAT + 1)
-static float matbuf[MAXMATBUF][2][4];
-static int totmat_gl= 0;
+/* check for glsl drawing */
-int set_gl_material(int nr)
+int draw_glsl_material(Object *ob, int dt)
{
- static int last_gl_matnr= -1;
- static int last_ret_val= 1;
-
- /* prevent index to use un-initialized array items */
- if(nr>totmat_gl) nr= totmat_gl;
-
- if(nr<0) {
- last_gl_matnr= -1;
- last_ret_val= 1;
- }
- else if(nr<MAXMATBUF && nr!=last_gl_matnr) {
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matbuf[nr][0]);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, matbuf[nr][1]);
- last_gl_matnr = nr;
- last_ret_val= matbuf[nr][0][3]!=0.0;
-
- /* matbuf alpha: 0.0 = skip draw, 1.0 = no blending, else blend */
- if(matbuf[nr][0][3]!= 0.0 && matbuf[nr][0][3]!= 1.0) {
- glEnable(GL_BLEND);
- }
- else
- glDisable(GL_BLEND);
-
- }
+ if(!GPU_extensions_minimum_support())
+ return 0;
+ if(G.f & G_PICKSEL)
+ return 0;
+ if(!CHECK_OB_DRAWTEXTURE(G.vd, dt))
+ return 0;
+ if(ob==OBACT && (G.f & G_WEIGHTPAINT))
+ return 0;
- return last_ret_val;
+ return ((G.fileflags & G_FILE_GAME_MAT) &&
+ (G.fileflags & G_FILE_GAME_MAT_GLSL) && (dt >= OB_SHADED));
}
-/* returns 1: when there's alpha needed to be drawn in a 2nd pass */
-int init_gl_materials(Object *ob, int check_alpha)
+static int check_material_alpha(Base *base, Object *ob, int glsl)
{
- extern Material defmaterial; // render module abuse...
- Material *ma;
- int a, has_alpha= 0;
-
- if(ob->totcol==0) {
- matbuf[0][0][0]= defmaterial.r;
- matbuf[0][0][1]= defmaterial.g;
- matbuf[0][0][2]= defmaterial.b;
- matbuf[0][0][3]= 1.0;
-
- matbuf[0][1][0]= defmaterial.specr;
- matbuf[0][1][1]= defmaterial.specg;
- matbuf[0][1][2]= defmaterial.specb;
- matbuf[0][1][3]= 1.0;
-
- /* do material 1 too, for displists! */
- QUATCOPY(matbuf[1][0], matbuf[0][0]);
- QUATCOPY(matbuf[1][1], matbuf[0][1]);
- }
-
- for(a=1; a<=ob->totcol; a++) {
- ma= give_current_material(ob, a);
- ma= editnode_get_active_material(ma);
- if(ma==NULL) ma= &defmaterial;
-
- if(a<MAXMATBUF) {
- if (ma->mode & MA_SHLESS) {
- matbuf[a][0][0]= ma->r;
- matbuf[a][0][1]= ma->g;
- matbuf[a][0][2]= ma->b;
- } else {
- matbuf[a][0][0]= (ma->ref+ma->emit)*ma->r;
- matbuf[a][0][1]= (ma->ref+ma->emit)*ma->g;
- matbuf[a][0][2]= (ma->ref+ma->emit)*ma->b;
- }
+ if(base->flag & OB_FROMDUPLI)
+ return 0;
- /* draw transparent, not in pick-select, nor editmode */
- if(check_alpha && !(G.f & G_PICKSEL) && (ob->dtx & OB_DRAWTRANSP) && !(G.obedit && G.obedit->data==ob->data)) {
- if(G.vd->transp) { // drawing the transparent pass
- if(ma->alpha==1.0) matbuf[a][0][3]= 0.0; // means skip solid
- else matbuf[a][0][3]= ma->alpha;
- }
- else { // normal pass
- if(ma->alpha==1.0) matbuf[a][0][3]= 1.0;
- else {
- matbuf[a][0][3]= 0.0; // means skip transparent
- has_alpha= 1; // return value, to indicate adding to after-draw queue
- }
- }
- }
- else
- matbuf[a][0][3]= 1.0;
+ if(G.f & G_PICKSEL)
+ return 0;
- if (!(ma->mode & MA_SHLESS)) {
- matbuf[a][1][0]= ma->spec*ma->specr;
- matbuf[a][1][1]= ma->spec*ma->specg;
- matbuf[a][1][2]= ma->spec*ma->specb;
- matbuf[a][1][3]= 1.0;
- }
- }
- }
-
- totmat_gl= ob->totcol;
- set_gl_material(-1); // signal for static variable
- return has_alpha;
+ if(G.obedit && G.obedit->data==ob->data)
+ return 0;
+
+ return (glsl || (ob->dtx & OB_DRAWTRANSP));
}
-
/***/
static unsigned int colortab[24]=
{0x0, 0xFF88FF, 0xFFBBFF,
@@ -352,6 +280,9 @@ void drawaxes(float size, int flag, char drawtype)
float v1[3]= {0.0, 0.0, 0.0};
float v2[3]= {0.0, 0.0, 0.0};
float v3[3]= {0.0, 0.0, 0.0};
+
+ if(G.f & G_SIMULATION)
+ return;
switch(drawtype) {
@@ -734,6 +665,9 @@ static void drawlamp(Object *ob)
float pixsize, lampsize;
float imat[4][4], curcol[4];
char col[4];
+
+ if(G.f & G_SIMULATION)
+ return;
la= ob->data;
@@ -1024,6 +958,9 @@ static void drawcamera(Object *ob, int flag)
float vec[8][4], tmat[4][4], fac, facx, facy, depth;
int i;
+ if(G.f & G_SIMULATION)
+ return;
+
cam= ob->data;
glDisable(GL_LIGHTING);
@@ -1830,6 +1767,9 @@ static void draw_verse_debug(Object *ob, EditMesh *em)
struct EditFace *efa=NULL;
float v1[3], v2[3], v3[3], v4[3], fvec[3], col[3];
char val[32];
+
+ if(G.f & G_SIMULATION)
+ return;
if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0)
glDisable(GL_DEPTH_TEST);
@@ -1894,6 +1834,9 @@ static void draw_em_measure_stats(Object *ob, EditMesh *em)
char conv_float[5]; /* Use a float conversion matching the grid size */
float area, col[3]; /* area of the face, color of the text to draw */
+ if(G.f & G_SIMULATION)
+ return;
+
/* make the precission of the pronted value proportionate to the gridsize */
if ((G.vd->grid) < 0.01)
strcpy(conv_float, "%.6f");
@@ -2054,12 +1997,20 @@ static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth
EditFace *efa = EM_get_face_for_index(index);
if (efa->h==0) {
- set_gl_material(efa->mat_nr+1);
+ GPU_enable_material(efa->mat_nr+1, NULL);
return 1;
- } else {
- return 0;
}
+ else
+ return 0;
}
+
+static int draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
+{
+ EditFace *efa = EM_get_face_for_index(index);
+
+ return (efa->h==0);
+}
+
static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, int dt)
{
Mesh *me = ob->data;
@@ -2082,9 +2033,21 @@ static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, Derived
EM_init_index_arrays(1, 1, 1);
if(dt>OB_WIRE) {
- if( CHECK_OB_DRAWTEXTURE(G.vd, dt) ) {
- draw_mesh_textured(ob, finalDM, 0);
- } else {
+ if(CHECK_OB_DRAWTEXTURE(G.vd, dt)) {
+ if(draw_glsl_material(ob, dt)) {
+ glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+
+ finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
+ draw_em_fancy__setGLSLFaceOpts, NULL);
+ GPU_disable_material();
+
+ glFrontFace(GL_CCW);
+ }
+ else {
+ draw_mesh_textured(ob, finalDM, 0);
+ }
+ }
+ else {
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED);
glEnable(GL_LIGHTING);
@@ -2208,6 +2171,7 @@ static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, Derived
if(dt>OB_WIRE) {
glDepthMask(1);
bglPolygonOffset(0.0);
+ GPU_disable_material();
}
EM_free_index_arrays();
@@ -2226,8 +2190,9 @@ static void draw_mesh_object_outline(Object *ob, DerivedMesh *dm)
drawFacesSolid() doesn't draw the transparent faces */
if(ob->dtx & OB_DRAWTRANSP) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- dm->drawFacesSolid(dm, set_gl_material);
+ dm->drawFacesSolid(dm, GPU_enable_material);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ GPU_disable_material();
}
else {
dm->drawEdges(dm, 0);
@@ -2312,7 +2277,19 @@ static void draw_mesh_fancy(Base *base, int dt, int flag)
draw_mesh_object_outline(ob, dm);
}
- draw_mesh_textured(ob, dm, faceselect);
+ if(draw_glsl_material(ob, dt)) {
+ glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+
+ dm->drawFacesGLSL(dm, GPU_enable_material);
+ if(get_property(ob, "Text"))
+ draw_mesh_text(ob, 1);
+ GPU_disable_material();
+
+ glFrontFace(GL_CCW);
+ }
+ else {
+ draw_mesh_textured(ob, dm, faceselect);
+ }
if(!faceselect) {
if(base->flag & SELECT)
@@ -2323,18 +2300,17 @@ static void draw_mesh_fancy(Base *base, int dt, int flag)
dm->drawLooseEdges(dm);
}
}
- else if(dt==OB_SOLID ) {
-
- if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire) {
+ else if(dt==OB_SOLID) {
+ if((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire)
draw_mesh_object_outline(ob, dm);
- }
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED );
glEnable(GL_LIGHTING);
glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
- dm->drawFacesSolid(dm, set_gl_material);
+ dm->drawFacesSolid(dm, GPU_enable_material);
+ GPU_disable_material();
glFrontFace(GL_CCW);
glDisable(GL_LIGHTING);
@@ -2352,7 +2328,8 @@ static void draw_mesh_fancy(Base *base, int dt, int flag)
if(ob==OBACT) {
do_draw= 0;
if( (G.f & G_WEIGHTPAINT)) {
- set_gl_material(0); /* enforce defmaterial settings */
+ /* enforce default material settings */
+ GPU_enable_material(0, NULL);
/* but set default spec */
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
@@ -2367,6 +2344,8 @@ static void draw_mesh_fancy(Base *base, int dt, int flag)
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
+
+ GPU_disable_material();
}
else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) {
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1);
@@ -2385,7 +2364,7 @@ static void draw_mesh_fancy(Base *base, int dt, int flag)
dm->release(dm);
shadeDispList(base);
dl = find_displist(&ob->disp, DL_VERTCOL);
- dm= mesh_get_derived_final(ob, get_viewedit_datamask());
+ dm= mesh_get_derived_final(ob, get_viewedit_datamask());
}
if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire) {
@@ -2462,7 +2441,7 @@ static int draw_mesh_object(Base *base, int dt, int flag)
{
Object *ob= base->object;
Mesh *me= ob->data;
- int has_alpha= 0, drawlinked= 0, retval= 0;
+ int do_alpha_pass= 0, drawlinked= 0, retval= 0, glsl, check_alpha;
if(G.obedit && ob!=G.obedit && ob->data==G.obedit->data) {
if(ob_get_key(ob));
@@ -2478,7 +2457,12 @@ static int draw_mesh_object(Base *base, int dt, int flag)
cageDM = editmesh_get_derived_cage_and_final(&finalDM,
get_viewedit_datamask());
- if(dt>OB_WIRE) init_gl_materials(ob, 0); // no transp in editmode, the fancy draw over goes bad then
+ if(dt>OB_WIRE) {
+ // no transp in editmode, the fancy draw over goes bad then
+ glsl = draw_glsl_material(ob, dt);
+ GPU_set_object_materials(G.scene, ob, glsl, NULL);
+ }
+
draw_em_fancy(ob, G.editMesh, cageDM, finalDM, dt);
if (G.obedit!=ob && finalDM)
@@ -2491,15 +2475,22 @@ static int draw_mesh_object(Base *base, int dt, int flag)
else {
/* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
if(me->totface<=4 || boundbox_clip(ob->obmat, (ob->bb)? ob->bb: me->bb)) {
- if(dt==OB_SOLID) has_alpha= init_gl_materials(ob, (base->flag & OB_FROMDUPLI)==0);
+ glsl = draw_glsl_material(ob, dt);
+ check_alpha = check_material_alpha(base, ob, glsl);
+
+ if(dt==OB_SOLID || glsl) {
+ GPU_set_object_materials(G.scene, ob, glsl,
+ (check_alpha)? &do_alpha_pass: NULL);
+ }
+
draw_mesh_fancy(base, dt, flag);
if(me->totvert==0) retval= 1;
}
}
- /* init_gl_materials did the proper checking if this is needed */
- if(has_alpha) add_view3d_after(G.vd, base, V3D_TRANSP, flag);
+ /* GPU_set_object_materials checked if this is needed */
+ if(do_alpha_pass) add_view3d_after(G.vd, base, V3D_TRANSP, flag);
return retval;
}
@@ -2601,9 +2592,10 @@ static int drawDispListwire(ListBase *dlbase)
return 0;
}
-static void drawDispListsolid(ListBase *lb, Object *ob)
+static void drawDispListsolid(ListBase *lb, Object *ob, int glsl)
{
DispList *dl;
+ GPUVertexAttribs gattribs;
float *data, curcol[4];
float *ndata;
@@ -2667,7 +2659,7 @@ static void drawDispListsolid(ListBase *lb, Object *ob)
case DL_SURF:
if(dl->index) {
- set_gl_material(dl->col+1);
+ GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
if(dl->rt & CU_SMOOTH) glShadeModel(GL_SMOOTH);
else glShadeModel(GL_FLAT);
@@ -2675,12 +2667,12 @@ static void drawDispListsolid(ListBase *lb, Object *ob)
glVertexPointer(3, GL_FLOAT, 0, dl->verts);
glNormalPointer(GL_FLOAT, 0, dl->nors);
glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index);
+ GPU_disable_material();
}
break;
case DL_INDEX3:
-
- set_gl_material(dl->col+1);
+ GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
glVertexPointer(3, GL_FLOAT, 0, dl->verts);
@@ -2693,6 +2685,7 @@ static void drawDispListsolid(ListBase *lb, Object *ob)
glNormalPointer(GL_FLOAT, 0, dl->nors);
glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index);
+ GPU_disable_material();
if(index3_nors_incr==0)
glEnableClientState(GL_NORMAL_ARRAY);
@@ -2700,12 +2693,13 @@ static void drawDispListsolid(ListBase *lb, Object *ob)
break;
case DL_INDEX4:
-
- set_gl_material(dl->col+1);
+ GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
glVertexPointer(3, GL_FLOAT, 0, dl->verts);
glNormalPointer(GL_FLOAT, 0, dl->nors);
glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index);
+
+ GPU_disable_material();
break;
}
@@ -2799,14 +2793,18 @@ static int drawDispList(Base *base, int dt)
draw_index_wire= 1;
}
else {
- if(dt==OB_SHADED) {
+ if(draw_glsl_material(ob, dt)) {
+ GPU_set_object_materials(G.scene, ob, 1, NULL);
+ drawDispListsolid(lb, ob, 1);
+ }
+ else if(dt == OB_SHADED) {
if(ob->disp.first==0) shadeDispList(base);
drawDispListshaded(lb, ob);
}
else {
- init_gl_materials(ob, 0);
+ GPU_set_object_materials(G.scene, ob, 0, NULL);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
- drawDispListsolid(lb, ob);
+ drawDispListsolid(lb, ob, 0);
}
if(ob==G.obedit && cu->bevobj==NULL && cu->taperobj==NULL && cu->ext1 == 0.0 && cu->ext2 == 0.0) {
cpack(0);
@@ -2833,15 +2831,19 @@ static int drawDispList(Base *base, int dt)
if(dl->nors==NULL) addnormalsDispList(ob, lb);
- if(dt==OB_SHADED) {
+ if(draw_glsl_material(ob, dt)) {
+ GPU_set_object_materials(G.scene, ob, 1, NULL);
+ drawDispListsolid(lb, ob, 1);
+ }
+ else if(dt==OB_SHADED) {
if(ob->disp.first==NULL) shadeDispList(base);
drawDispListshaded(lb, ob);
}
else {
- init_gl_materials(ob, 0);
+ GPU_set_object_materials(G.scene, ob, 0, NULL);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
- drawDispListsolid(lb, ob);
+ drawDispListsolid(lb, ob, 0);
}
}
else {
@@ -2857,16 +2859,20 @@ static int drawDispList(Base *base, int dt)
if(solid) {
- if(dt==OB_SHADED) {
+ if(draw_glsl_material(ob, dt)) {
+ GPU_set_object_materials(G.scene, ob, 1, NULL);
+ drawDispListsolid(lb, ob, 1);
+ }
+ else if(dt == OB_SHADED) {
dl= lb->first;
if(dl && dl->col1==0) shadeDispList(base);
drawDispListshaded(lb, ob);
}
else {
- init_gl_materials(ob, 0);
+ GPU_set_object_materials(G.scene, ob, 0, NULL);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
- drawDispListsolid(lb, ob);
+ drawDispListsolid(lb, ob, 0);
}
}
else{
@@ -4624,9 +4630,8 @@ static void drawSolidSelect(Base *base)
drawDispListwire(&ob->disp);
}
else if(ob->type==OB_ARMATURE) {
- if(!(ob->flag & OB_POSEMODE)) {
+ if(!(ob->flag & OB_POSEMODE))
draw_armature(base, OB_WIRE, 0);
- }
}
glLineWidth(1.0);
@@ -5094,8 +5099,9 @@ void draw_object(Base *base, int flag)
drawlattice(ob);
break;
case OB_ARMATURE:
- if(dt>OB_WIRE) set_gl_material(0); // we use defmaterial
+ if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material
empty_object= draw_armature(base, dt, flag);
+ if(dt>OB_WIRE) GPU_disable_material();
break;
default:
drawaxes(1.0, flag, OB_ARROWS);
@@ -5138,9 +5144,8 @@ void draw_object(Base *base, int flag)
}
/* draw extra: after normal draw because of makeDispList */
- if(dtx) {
- if(G.f & G_SIMULATION);
- else if(dtx & OB_AXIS) {
+ if(dtx && !(G.f & G_SIMULATION)) {
+ if(dtx & OB_AXIS) {
drawaxes(1.0f, flag, OB_ARROWS);
}
if(dtx & OB_BOUNDBOX) draw_bounding_volume(ob);
@@ -5315,7 +5320,7 @@ void draw_object_ext(Base *base)
static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
{
- int offset = (long) userData;
+ int offset = (intptr_t) userData;
EditVert *eve = EM_get_vert_for_index(index);
if (eve->h==0) {
@@ -5327,7 +5332,7 @@ static int bbs_mesh_verts(DerivedMesh *dm, int offset)
{
glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) );
bglBegin(GL_POINTS);
- dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(long) offset);
+ dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(intptr_t) offset);
bglEnd();
glPointSize(1.0);
@@ -5336,7 +5341,7 @@ static int bbs_mesh_verts(DerivedMesh *dm, int offset)
static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
{
- int offset = (long) userData;
+ int offset = (intptr_t) userData;
EditEdge *eed = EM_get_edge_for_index(index);
if (eed->h==0) {
@@ -5348,7 +5353,7 @@ static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
}
static int bbs_mesh_wire(DerivedMesh *dm, int offset)
{
- dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(long) offset);
+ dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(intptr_t) offset);
return offset + G.totedge;
}
@@ -5382,7 +5387,7 @@ static int bbs_mesh_solid_EM(DerivedMesh *dm, int facecol)
cpack(0);
if (facecol) {
- dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(long) 1, 0);
+ dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(intptr_t) 1, 0);
if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) {
glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE));
@@ -5411,19 +5416,6 @@ static int bbs_mesh_solid__setDrawOpts(void *userData, int index, int *drawSmoot
}
}
-static int bbs_mesh_wire__setDrawOpts(void *userData, int index)
-{
- struct { Mesh *me; EdgeHash *eh; int offset; } *data = userData;
- MEdge *med = data->me->medge + index;
- unsigned long flags = (long)BLI_edgehash_lookup(data->eh, med->v1, med->v2);
-
- if (flags & 1) {
- set_framebuffer_index_color(data->offset+index);
- return 1;
- } else
- return 0;
-}
-
/* TODO remove this - since face select mode now only works with painting */
static void bbs_mesh_solid(Object *ob)
{
@@ -5433,22 +5425,6 @@ static void bbs_mesh_solid(Object *ob)
glColor3ub(0, 0, 0);
dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, me, 0);
- /* draw edges for seam marking in faceselect mode, but not when painting,
- so that painting doesn't get interrupted on an edge */
- if ((G.f & G_FACESELECT) && !(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))) {
- struct { Mesh *me; EdgeHash *eh; int offset; } userData;
-
- userData.me = me;
- userData.eh = get_tface_mesh_marked_edge_info(me);
- userData.offset = userData.me->totface+1;
-
- bglPolygonOffset(1.0);
- dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOpts, (void*)&userData);
- bglPolygonOffset(0.0);
-
- BLI_edgehash_free(userData.eh, NULL);
- }
-
dm->release(dm);
}
@@ -5504,6 +5480,7 @@ void draw_object_backbufsel(Object *ob)
static void draw_object_mesh_instance(Object *ob, int dt, int outline)
{
DerivedMesh *dm=NULL, *edm=NULL;
+ int glsl;
if(G.obedit && ob->data==G.obedit->data)
edm= editmesh_get_derived_base();
@@ -5520,8 +5497,10 @@ static void draw_object_mesh_instance(Object *ob, int dt, int outline)
if(outline)
draw_mesh_object_outline(ob, dm?dm:edm);
- if(dm)
- init_gl_materials(ob, 0);
+ if(dm) {
+ glsl = draw_glsl_material(ob, dt);
+ GPU_set_object_materials(G.scene, ob, glsl, NULL);
+ }
else {
glEnable(GL_COLOR_MATERIAL);
BIF_ThemeColor(TH_BONE_SOLID);
@@ -5532,8 +5511,10 @@ static void draw_object_mesh_instance(Object *ob, int dt, int outline)
glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
glEnable(GL_LIGHTING);
- if(dm)
- dm->drawFacesSolid(dm, set_gl_material);
+ if(dm) {
+ dm->drawFacesSolid(dm, GPU_enable_material);
+ GPU_disable_material();
+ }
else if(edm)
edm->drawMappedFaces(edm, NULL, NULL, 0);
diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c
index c8c74ad8279..d7346a1ed21 100644
--- a/source/blender/src/drawseq.c
+++ b/source/blender/src/drawseq.c
@@ -98,7 +98,7 @@
int no_rightbox=0, no_leftbox= 0;
static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short direction);
static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq);
-static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2);
+static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2, char *background_col);
static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2);
static void draw_seq_strip(struct Sequence *seq, struct ScrArea *sa, struct SpaceSeq *sseq, int outline_tint, float pixelx);
@@ -134,7 +134,7 @@ static void seq_panel_gpencil(short cntrl) // SEQ_HANDLER_GREASEPENCIL
uiNewPanelHeight(block, 204);
/* draw button for showing gpencil settings and drawings */
- uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View");
+ uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View (draw using Shift-LMB)");
/* extend the panel if the contents won't fit */
newheight= draw_gpencil_panel(block, gpd, curarea);
@@ -604,7 +604,7 @@ static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq)
}
/* draw info text on a sequence strip */
-static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2)
+static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2, char *background_col)
{
float v1[2], v2[2];
int len, size;
@@ -670,8 +670,13 @@ static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2)
mval[1]= 1;
areamouseco_to_ipoco(G.v2d, mval, &x1, &x2);
- if(seq->flag & SELECT) cpack(0xFFFFFF);
- else cpack(0);
+ if(seq->flag & SELECT){
+ cpack(0xFFFFFF);
+ }else if ((((int)background_col[0] + (int)background_col[1] + (int)background_col[2]) / 3) < 50){
+ cpack(0x505050); /* use lighter text colour for dark background */
+ }else{
+ cpack(0);
+ }
glRasterPos3f(x1, y1+SEQ_STRIP_OFSBOTTOM, 0.0);
BMF_DrawString(G.font, strp);
}
@@ -740,7 +745,7 @@ so wave file sample drawing precission is zoom adjusted
static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outline_tint, float pixelx)
{
float x1, x2, y1, y2;
- char col[3], is_single_image;
+ char col[3], background_col[3], is_single_image;
/* we need to know if this is a single image/color or not for drawing */
is_single_image = (char)check_single_seq(seq);
@@ -755,13 +760,14 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outli
/* get the correct color per strip type*/
- get_seq_color3ubv(seq, col);
+ //get_seq_color3ubv(seq, col);
+ get_seq_color3ubv(seq, background_col);
/* draw the main strip body */
if (is_single_image) /* single image */
- draw_shadedstrip(seq, col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2);
+ draw_shadedstrip(seq, background_col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2);
else /* normal operation */
- draw_shadedstrip(seq, col, x1, y1, x2, y2);
+ draw_shadedstrip(seq, background_col, x1, y1, x2, y2);
/* draw additional info and controls */
if (seq->type == SEQ_RAM_SOUND)
@@ -814,7 +820,7 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outli
/* nice text here would require changing the view matrix for texture text */
if( (x2-x1) / pixelx > 32) {
- draw_seq_text(seq, x1, x2, y1, y2);
+ draw_seq_text(seq, x1, x2, y1, y2, background_col);
}
}
@@ -916,17 +922,11 @@ static void draw_image_seq(ScrArea *sa)
if(ibuf->rect_float && ibuf->rect==NULL)
IMB_rect_from_float(ibuf);
-
- if (sseq->zoom > 0) {
- zoom = sseq->zoom;
- } else if (sseq->zoom == 0) {
- zoom = 1.0;
- } else {
- zoom = -1.0/sseq->zoom;
- }
-
+
/* needed for gla draw */
glaDefine2DArea(&curarea->winrct);
+
+ zoom= SEQ_ZOOM_FAC(sseq->zoom);
if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
zoomy = zoom;
@@ -970,7 +970,10 @@ static void draw_image_seq(ScrArea *sa)
setlinestyle(0);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
-
+
+ /* draw grease-pencil (image aligned) */
+ if (sseq->flag & SEQ_DRAW_GPENCIL)
+ draw_gpencil_2dimage(sa, ibuf);
if (free_ibuf) {
IMB_freeImBuf(ibuf);
diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c
index 71f0bbef7ca..3f21d32c2d4 100644
--- a/source/blender/src/drawtext.c
+++ b/source/blender/src/drawtext.c
@@ -31,6 +31,8 @@
#include <math.h>
#include <string.h>
#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -60,6 +62,7 @@
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_node.h"
+#include "BKE_suggestions.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -74,32 +77,84 @@
#include "BIF_space.h"
#include "BIF_mywindow.h"
#include "BIF_resources.h"
+#include "BIF_mainqueue.h"
#include "BSE_filesel.h"
#include "BPY_extern.h"
+#include "BPY_menus.h"
#include "mydevice.h"
#include "blendef.h"
#include "winlay.h"
-#define TEXTXLOC 38
+/***********************/ /*
+
+Notes on word-wrap
+--
+All word-wrap functions follow the algorithm below to maintain consistency.
+ line The line to wrap (tabs converted to spaces)
+ view_width The maximum number of characters displayable in the region
+ This equals region_width/font_width for the region
+ wrap_chars Characters that allow wrapping. This equals [' ', '\t', '-']
+
+def wrap(line, view_width, wrap_chars):
+ draw_start = 0
+ draw_end = view_width
+ pos = 0
+ for c in line:
+ if pos-draw_start >= view_width:
+ print line[draw_start:draw_end]
+ draw_start = draw_end
+ draw_end += view_width
+ elif c in wrap_chars:
+ draw_end = pos+1
+ pos += 1
+ print line[draw_start:]
+
+*/ /***********************/
+
+#define TEXTXLOC 38
+
+#define SUGG_LIST_SIZE 7
+#define SUGG_LIST_WIDTH 20
+#define DOC_WIDTH 40
+#define DOC_HEIGHT 10
+
+#define TOOL_SUGG_LIST 0x01
+#define TOOL_DOCUMENT 0x02
+
+#define TMARK_GRP_CUSTOM 0x00010000 /* Lower 2 bytes used for Python groups */
+#define TMARK_GRP_FINDALL 0x00020000
/* forward declarations */
void drawtextspace(ScrArea *sa, void *spacedata);
void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
void txt_copy_selectbuffer (Text *text);
-void do_brackets();
-
-void get_selection_buffer(Text *text);
-int check_bracket(char *string);
-static int check_delim(char *string);
-static int check_numbers(char *string);
-static int check_builtinfuncs(char *string);
-static int check_specialvars(char *string);
-
-static void *last_txt_find_string= NULL;
+void draw_brackets(SpaceText *st);
+
+static void get_selection_buffer(Text *text);
+static int check_bracket(char ch);
+static int check_delim(char ch);
+static int check_digit(char ch);
+static int check_identifier(char ch);
+static int check_whitespace(char ch);
+
+static int get_wrap_width(SpaceText *st);
+static int get_wrap_points(SpaceText *st, char *line);
+static void get_suggest_prefix(Text *text, int offset);
+static void confirm_suggestion(Text *text, int skipleft);
+
+#define TXT_MAXFINDSTR 255
+static int g_find_flags= TXT_FIND_WRAP;
+static char *g_find_str= NULL;
+static char *g_replace_str= NULL;
+
+static int doc_scroll= 0;
+static double last_check_time= 0;
+static int jump_to= 0;
+static double last_jump= 0;
static BMF_Font *spacetext_get_font(SpaceText *st) {
static BMF_Font *scr12= NULL;
@@ -160,7 +215,8 @@ static void temp_char_write(char c, int accum) {
void free_txt_data(void) {
txt_free_cut_buffer();
- if (last_txt_find_string) MEM_freeN(last_txt_find_string);
+ if (g_find_str) MEM_freeN(g_find_str);
+ if (g_replace_str) MEM_freeN(g_replace_str);
if (temp_char_buf) MEM_freeN(temp_char_buf);
if (temp_char_accum) MEM_freeN(temp_char_accum);
}
@@ -184,352 +240,279 @@ static int render_string (SpaceText *st, char *in) {
return r;
}
-void get_format_string(SpaceText *st)
+static int find_builtinfunc(char *string)
{
- Text *text = st->text;
- TextLine *tmp;
- char *in_line;
- char format[2000], check[200], other[2];
- unsigned char c;
- int spot, letter, tabs, mem_amount;
- size_t a, b, len;
-
- if(!text) return;
- tmp = text->lines.first;
-
- while(tmp) {
- in_line = tmp->line;
-
- len = strlen(in_line);
- /* weak code... but we dont want crashes (ton) */
- if(len>2000-1) {
- if (tmp->format) MEM_freeN(tmp->format);
- tmp->format= NULL;
+ int a, i;
+ char builtinfuncs[][11] = {"and", "as", "assert", "break", "class", "continue", "def",
+ "del", "elif", "else", "except", "exec", "finally",
+ "for", "from", "global", "if", "import", "in",
+ "is", "lambda", "not", "or", "pass", "print",
+ "raise", "return", "try", "while", "yield"};
+ for (a=0; a<30; a++) {
+ i = 0;
+ while (1) {
+ if (builtinfuncs[a][i]=='\0') {
+ if (check_identifier(string[i]))
+ i = -1;
+ break;
+ } else if (string[i]!=builtinfuncs[a][i]) {
+ i = -1;
+ break;
+ }
+ i++;
}
+ if (i>0) break;
+ }
+ return i;
+}
+
+static int find_specialvar(char *string)
+{
+ int i = 0;
+ if (string[0]=='d' && string[1]=='e' && string[2]=='f')
+ i = 3;
+ else if (string[0]=='c' && string[1]=='l' && string[2]=='a' && string[3]=='s' && string[4]=='s')
+ i = 5;
+ if (i==0 || check_identifier(string[i]))
+ return -1;
+ return i;
+}
+
+static void print_format(SpaceText *st, TextLine *line) {
+ int i, a;
+ char *s, *f;
+ s = line->line;
+ f = line->format;
+ for (a=0; *s; s++) {
+ if (*s == '\t') {
+ for (i=st->tabnumber-(a%st->tabnumber); i>0; i--)
+ printf(" "), f++, a++;
+ } else
+ printf("%c", *s), f++, a++;
+ }
+ printf("\n%s [%#x]\n", line->format, (int) (f[strlen(f)+1]));
+}
+
+/* Ensures the format string for the given line is long enough, reallocating as needed */
+static int check_format_len(TextLine *line, unsigned int len) {
+ if (line->format) {
+ if (strlen(line->format) < len) {
+ MEM_freeN(line->format);
+ line->format = MEM_mallocN(len+2, "SyntaxFormat");
+ if (!line->format) return 0;
+ }
+ } else {
+ line->format = MEM_mallocN(len+2, "SyntaxFormat");
+ if (!line->format) return 0;
+ }
+ return 1;
+}
+
+/* Formats the specified line and if allowed and needed will move on to the
+ * next line. The format string contains the following characters:
+ * '_' Whitespace
+ * '#' Comment text
+ * '!' Punctuation and other symbols
+ * 'n' Numerals
+ * 'l' String letters
+ * 'v' Special variables (class, def)
+ * 'b' Built-in names (print, for, etc.)
+ * 'q' Other text (identifiers, etc.)
+ * It is terminated with a null-terminator '\0' followed by a continuation
+ * flag indicating whether the line is part of a multi-line string.
+ */
+void txt_format_line(SpaceText *st, TextLine *line, int do_next) {
+ char *str, *fmt, orig, cont, find, prev = ' ';
+ int len, i;
+
+ /* Get continuation from previous line */
+ if (line->prev && line->prev->format != NULL) {
+ fmt= line->prev->format;
+ cont = fmt[strlen(fmt)+1]; /* Just after the null-terminator */
+ } else cont = 0;
+
+ /* Get original continuation from this line */
+ if (line->format != NULL) {
+ fmt= line->format;
+ orig = fmt[strlen(fmt)+1]; /* Just after the null-terminator */
+ } else orig = 0xFF;
+
+ render_string(st, line->line);
+ str = temp_char_buf;
+ len = strlen(str);
+ if (!check_format_len(line, len)) return;
+ fmt = line->format;
+
+ while (*str) {
+ /* Handle escape sequences by skipping both \ and next char */
+ if (*str == '\\') {
+ *fmt = prev; fmt++; str++;
+ if (*str == '\0') break;
+ *fmt = prev; fmt++; str++;
+ continue;
+ }
+ /* Handle continuations */
+ else if (cont) {
+ /* Triple strings ("""...""" or '''...''') */
+ if (cont & TXT_TRISTR) {
+ find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
+ if (*str==find && *(str+1)==find && *(str+2)==find) {
+ *fmt = 'l'; fmt++; str++;
+ *fmt = 'l'; fmt++; str++;
+ cont = 0;
+ }
+ /* Handle other strings */
+ } else {
+ find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
+ if (*str == find) cont = 0;
+ }
+ *fmt = 'l';
+ }
+ /* Not in a string... */
else {
-
- spot = 0;
- tabs = 0;
- //see how many tabs we have
- for(a = 0; a <len; a++) {
- c = (unsigned char) in_line[a];
- if(c == '\t') {
- tabs++;
+ /* Deal with comments first */
+ if (prev == '#' || *str == '#')
+ *fmt = '#';
+ /* Strings */
+ else if (*str == '"' || *str == '\'') {
+ find = *str;
+ cont = (*str== '"') ? TXT_DBLQUOTSTR : TXT_SNGQUOTSTR;
+ if (*(str+1) == find && *(str+2) == find) {
+ *fmt = 'l'; fmt++; str++;
+ *fmt = 'l'; fmt++; str++;
+ cont |= TXT_TRISTR;
}
+ *fmt = 'l';
}
- //calculate the amount of MEM_mallocN we neen
- mem_amount = (((tabs*st->tabnumber)-tabs)+2)+len; // +2 for good measure
- if (tmp->format) MEM_freeN(tmp->format);
- tmp->format = MEM_mallocN(mem_amount, "Syntax_format");
-
- for (a = 0; a < len; a++) {
- c = (unsigned char) in_line[a];
+ /* Whitespace (all ws. has been converted to spaces) */
+ else if (*str == ' ')
+ *fmt = '_';
+ /* Numbers (digits not part of an identifier and periods followed by digits) */
+ else if ((prev != 'q' && check_digit(*str)) || (*str == '.' && check_digit(*(str+1))))
+ *fmt = 'n';
+ /* Punctuation */
+ else if (check_delim(*str))
+ *fmt = '!';
+ /* Identifiers and other text (no previous ws. or delims. so text continues) */
+ else if (prev == 'q')
+ *fmt = 'q';
+ /* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
+ else {
+ /* Special vars(v) or built-in keywords(b) */
+ if ((i=find_specialvar(str)) != -1)
+ prev = 'v';
+ else if ((i=find_builtinfunc(str)) != -1)
+ prev = 'b';
+ if (i>0) {
+ while (i>1) {
+ *fmt = prev; fmt++; str++;
+ i--;
+ }
+ *fmt = prev;
+ } else
+ *fmt = 'q';
+ }
+ }
+ prev = *fmt;
+ fmt++;
+ str++;
+ }
- check[0] = c;
- check[1] = '\0';
+ /* Terminate and add continuation char */
+ *fmt = '\0'; fmt++;
+ *fmt = cont;
- if (check_delim(check))
- {
- switch (c) {
- case '\"':
- if(in_line[a] == '\"' && in_line[a+1] == '\"' && in_line[a+2] == '\"') {
- format[spot] = format[spot+1] = format[spot+2] = 'l';
- spot +=3;
- a += 3;
- while(in_line[a] != '\"' || in_line[a-1] != '\"' || in_line[a-2] != '\"') {
- c = (unsigned char) in_line[a];
- if(a >= len) {
- format[spot] = '\0';
- memcpy(tmp->format, format, strlen(format));
- if(!(tmp= tmp->next)) {
- return;
- } else {
- in_line = tmp->line;
- len = strlen(in_line);
- tabs = 0;
- for(b = 0; b <len; b++) {
- c = (unsigned char) in_line[b];
- if(c == '\t') {
- tabs++;
- }
- }
- mem_amount = (((tabs*st->tabnumber)-tabs)+2)+len;
- if (tmp->format) MEM_freeN(tmp->format);
- tmp->format = MEM_mallocN(mem_amount, "Syntax_format");
- a = 0; spot = 0;
- }
- } else {
- if(c == '\t' || c == ' ') {
- if(c == '\t') {
- for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) {
- format[spot] = ' ';
- spot++;
- }
- a++;
- } else {
- format[spot] = ' ';
- a++; spot++;
- }
- } else {
- format[spot] = 'l';
- a++; spot++;
- }
- }
- }
- format[spot] = 'l';
- spot++;
- } else {
- format[spot] = 'l';
- a++; spot++;
- while(in_line[a] != '\"') {
- c = (unsigned char) in_line[a];
- if(a >= len) {
- format[spot] = '\0';
- memcpy(tmp->format, format, strlen(format));
- if(!(tmp= tmp->next)) {
- return;
- } else {
- in_line = tmp->line;
- len = strlen(in_line);
- for(b = 0; b <len; b++) {
- c = (unsigned char) in_line[b];
- if(c == '\t') {
- tabs++;
- }
- }
- //calculate the amount of MEM_mallocN we neen
- mem_amount = (((tabs*st->tabnumber)-tabs)+2)+len;
- if (tmp->format) MEM_freeN(tmp->format);
- tmp->format = MEM_mallocN(mem_amount, "Syntax_format");
- a = 0; spot = 0;
- }
- }
- if(c == '\t' || c == ' ') {
- if(c == '\t') {
- for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) {
- format[spot] = ' ';
- spot++;
- }
- a++;
- } else {
- format[spot] = ' ';
- a++; spot++;
- }
- } else {
- format[spot] = 'l';
- a++; spot++;
- }
- }
- format[spot] = 'l';
- spot++;
- }
- break;
- case '\'':
- if(in_line[a] == '\'' && in_line[a+1] == '\'' && in_line[a+2] == '\'') {
- format[spot] = format[spot+1] = format[spot+2] = 'l';
- spot +=3;
- a += 3;
- while(in_line[a] != '\'' || in_line[a-1] != '\'' || in_line[a-2] != '\'') {
- c = (unsigned char) in_line[a];
- if(a >= len) {
- format[spot] = '\0';
- memcpy(tmp->format, format, strlen(format));
- if(!(tmp= tmp->next)) {
- return;
- } else {
- in_line = tmp->line;
- len = strlen(in_line);
- tabs = 0;
- for(b = 0; b <len; b++) {
- c = (unsigned char) in_line[b];
- if(c == '\t') {
- tabs++;
- }
- }
- mem_amount = (((tabs*st->tabnumber)-tabs)+2)+len;
- if (tmp->format) MEM_freeN(tmp->format);
- tmp->format = MEM_mallocN(mem_amount, "Syntax_format");
- a = 0; spot = 0;
- }
- } else {
- if(c == '\t' || c == ' ') {
- if(c == '\t') {
- for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) {
- format[spot] = ' ';
- spot++;
- }
- a++;
- } else {
- format[spot] = ' ';
- a++; spot++;
- }
- } else {
- format[spot] = 'l';
- a++; spot++;
- }
- }
- }
- format[spot] = 'l';
- spot++;
- } else {
- format[spot] = 'l';
- a++; spot++;
- while(in_line[a] != '\'') {
- c = (unsigned char) in_line[a];
- if(a >= len) {
- format[spot] = '\0';
- memcpy(tmp->format, format, strlen(format));
- if(!(tmp= tmp->next)) {
- return;
- } else {
- in_line = tmp->line;
- len = strlen(in_line);
- for(b = 0; b <len; b++) {
- c = (unsigned char) in_line[b];
- if(c == '\t') {
- tabs++;
- }
- }
- //calculate the amount of MEM_mallocN we neen
- mem_amount = (((tabs*st->tabnumber)-tabs)+2)+len;
- if (tmp->format) MEM_freeN(tmp->format);
- tmp->format = MEM_mallocN(mem_amount, "Syntax_format");
- a = 0; spot = 0;
- }
- }
- if(c == '\t' || c == ' ') {
- if(c == '\t') {
- for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) {
- format[spot] = ' ';
- spot++;
- }
- a++;
- } else {
- format[spot] = ' ';
- a++; spot++;
- }
- } else {
- format[spot] = 'l';
- a++; spot++;
- }
- }
- format[spot] = 'l';
- spot++;
- }
- break;
- case '#':
- while(a<len) {
- c = (unsigned char) in_line[a];
- if(c == '\t' || c == ' ') {
- if(c == '\t') {
- for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) {
- format[spot] = '#';
- spot++;
- }
- a++;
- } else {
- format[spot] = '#';
- a++; spot++;
- }
- } else {
- format[spot] = '#';
- a++; spot++;
- }
- }
- break;
- case ' ':
- format[spot] = ' ';
- spot++;
- break;
- case '\t':
- for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) {
- format[spot] = ' ';
- spot++;
- }
- break;
- default:
- format[spot] = 'q';
- spot++;
-
- break;
- }
- } else if (check_numbers(check)) {
- while (a < len) {
- c = (unsigned char) in_line[a];
- other[0] = c;
- other[1] = '\0';
- if (check_delim(other) && c != '.') {
- a--; break;
- } else {
- format[spot] = 'n';
- a++; spot++;
- }
- }
- } else {
- letter = 0;
- while (a < len) {
- c = (unsigned char) in_line[a];
- other[0] = c;
- other[1] = '\0';
- if (check_delim(other)) {
- a--;
- break;
- } else {
- check[letter] = (unsigned char) in_line[a];
- letter++;
- a++;
- }
- }
- check[letter] = '\0';
- if (check_builtinfuncs(check)) {
- for (b = 0; b < strlen(check); b++) {
- format[spot] = 'b';
- spot++;
- }
- } else if (check_specialvars(check)) { /*If TRUE then color and color next word*/
- for (b = 0; b < strlen(check); b++) {
- format[spot] = 'b';
- spot++;
- }
- a++;
- format[spot] = 'q';
- spot++; a++;
- letter = 0;
- while (a < len) {
- c = (unsigned char) in_line[a];
- other[0] = c;
- other[1] = '\0';
- if (check_delim(other)) {
- a--;
- break;
- } else {
- check[letter] = (unsigned char) in_line[a];
- letter++;
- a++;
- }
- }
- check[letter] = '\0';
- for (b = 0; b < strlen(check); b++) {
- format[spot] = 'v';
- spot++;
- }
- }else {
- for (b = 0; b < strlen(check); b++) {
- format[spot] = 'q';
- spot++;
- }
- }
- }
+ /* Debugging */
+ //print_format(st, line);
+
+ /* If continuation has changed and we're allowed, process the next line */
+ if (cont!=orig && do_next && line->next) {
+ txt_format_line(st, line->next, do_next);
+ }
+}
+
+void txt_format_text(SpaceText *st)
+{
+ TextLine *linep;
+
+ if (!st->text) return;
+
+ for (linep=st->text->lines.first; linep; linep=linep->next)
+ txt_format_line(st, linep, 0);
+}
+
+static void format_draw_color(char formatchar) {
+ switch (formatchar) {
+ case '_': /* Whitespace */
+ break;
+ case '!': /* Symbols */
+ BIF_ThemeColorBlend(TH_TEXT, TH_BACK, 0.5f);
+ break;
+ case '#': /* Comments */
+ BIF_ThemeColor(TH_SYNTAX_C);
+ break;
+ case 'n': /* Numerals */
+ BIF_ThemeColor(TH_SYNTAX_N);
+ break;
+ case 'l': /* Strings */
+ BIF_ThemeColor(TH_SYNTAX_L);
+ break;
+ case 'v': /* Specials: class, def */
+ BIF_ThemeColor(TH_SYNTAX_V);
+ break;
+ case 'b': /* Keywords: for, print, etc. */
+ BIF_ThemeColor(TH_SYNTAX_B);
+ break;
+ case 'q': /* Other text (identifiers) */
+ default:
+ BIF_ThemeColor(TH_TEXT);
+ break;
+ }
+}
+
+static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char *format)
+{
+ int basex, i, a, len, start, end, max, lines;
+
+ len= render_string(st, str);
+ str= temp_char_buf;
+ max= w/spacetext_get_fontwidth(st);
+ if (max<8) max= 8;
+ basex= x;
+
+ lines= 1;
+ start= 0;
+ end= max;
+ for (i=0; i<len; i++) {
+ if (i-start >= max) {
+ /* Draw the visible portion of text on the overshot line */
+ for (a=start; a<end; a++) {
+ if (st->showsyntax && format) format_draw_color(format[a]);
+ glRasterPos2i(x, y);
+ BMF_DrawCharacter(spacetext_get_font(st), str[a]);
+ x += BMF_GetCharacterWidth(spacetext_get_font(st), str[a]);
}
- format[spot] = '\0';
- memcpy(tmp->format, format, strlen(format));
+ y -= st->lheight;
+ x= basex;
+ lines++;
+ start= end;
+ end += max;
+ } else if (str[i]==' ' || str[i]=='-') {
+ end = i+1;
}
-
- tmp = tmp->next;
}
+ /* Draw the remaining text */
+ for (a=start; a<len; a++) {
+ if (st->showsyntax && format) format_draw_color(format[a]);
+ glRasterPos2i(x, y);
+ BMF_DrawCharacter(spacetext_get_font(st), str[a]);
+ x += BMF_GetCharacterWidth(spacetext_get_font(st), str[a]);
+ }
+ return lines;
}
-static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int draw, int x, int y, char *format) {
+static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int draw, int x, int y, char *format)
+{
int r=0, w= 0;
char *in;
int *acc;
@@ -544,40 +527,15 @@ static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int dra
if (draw) {
if(st->showsyntax && format) {
int amount, a;
- char out[2];
format = format+cshift;
amount = strlen(in);
for(a = 0; a < amount; a++) {
- out[0] = (unsigned char) in[a];
- out[1] = '\0';
- switch (format[a]) {
- case 'l':
- BIF_ThemeColor(TH_SYNTAX_L);
- break;
- case 'b':
- BIF_ThemeColor(TH_SYNTAX_B);
- break;
- case '#':
- BIF_ThemeColor(TH_SYNTAX_C);
- break;
- case 'v':
- BIF_ThemeColor(TH_SYNTAX_V);
- break;
- case 'n':
- BIF_ThemeColor(TH_SYNTAX_N);
- break;
- case 'q':
- BIF_ThemeColor(TH_TEXT);
- break;
- default:
- BIF_ThemeColor(TH_TEXT);
- break;
- }
+ format_draw_color(format[a]);
glRasterPos2i(x, y);
- BMF_DrawString(spacetext_get_font(st), out);
- x = x+BMF_GetStringWidth(spacetext_get_font(st), out);
+ BMF_DrawCharacter(spacetext_get_font(st), in[a]);
+ x = x+BMF_GetCharacterWidth(spacetext_get_font(st), in[a]);
}
} else {
glRasterPos2i(x, y);
@@ -609,14 +567,6 @@ static void set_cursor_to_pos (SpaceText *st, int x, int y, int sel)
else { linep= &text->curl; charp= &text->curc; }
y= (curarea->winy - y)/st->lheight;
-
- y-= txt_get_span(text->lines.first, *linep) - st->top;
-
- if (y>0) {
- while (y-- != 0) if((*linep)->next) *linep= (*linep)->next;
- } else if (y<0) {
- while (y++ != 0) if((*linep)->prev) *linep= (*linep)->prev;
- }
if(st->showlinenrs)
x-= TXT_OFFSET+TEXTXLOC;
@@ -626,97 +576,353 @@ static void set_cursor_to_pos (SpaceText *st, int x, int y, int sel)
if (x<0) x= 0;
x = (x/spacetext_get_fontwidth(st)) + st->left;
- w= render_string(st, (*linep)->line);
- if(x<w) *charp= temp_char_accum[x];
- else *charp= (*linep)->len;
-
- if(!sel) txt_pop_sel(text);
-}
-
-static void draw_cursor(SpaceText *st) {
- int h, x, i;
- Text *text= st->text;
- TextLine *linef, *linel;
- int charf, charl;
-
- if (text->curl==text->sell && text->curc==text->selc) {
- x= text_draw(st, text->curl->line, st->left, text->curc, 0, 0, 0, NULL);
-
- if (x) {
- h= txt_get_span(text->lines.first, text->curl) - st->top;
+ if (st->wordwrap) {
+ int i, j, endj, curs, max, chop, start, end, chars, loop;
+ char ch;
+
+ /* Point to first visible line */
+ *linep= text->lines.first;
+ for (i=0; i<st->top && (*linep)->next; i++) *linep= (*linep)->next;
+
+ max= get_wrap_width(st);
+
+ loop= 1;
+ while (loop && *linep) {
+ start= 0;
+ end= max;
+ chop= 1;
+ chars= 0;
+ curs= 0;
+ endj= 0;
+ for (i=0, j=0; loop; j++) {
+
+ /* Mimic replacement of tabs */
+ ch= (*linep)->line[j];
+ if (ch=='\t') {
+ chars= st->tabnumber-i%st->tabnumber;
+ ch= ' ';
+ } else
+ chars= 1;
+
+ while (chars--) {
+ /* Gone too far, go back to last wrap point */
+ if (y<0) {
+ *charp= endj;
+ loop= 0;
+ break;
+ /* Exactly at the cursor, done */
+ } else if (y==0 && i-start==x) {
+ *charp= curs= j;
+ loop= 0;
+ break;
+ /* Prepare curs for next wrap */
+ } else if (i-end==x) {
+ curs= j;
+ }
+ if (i-start>=max) {
+ if (chop) endj= j;
+ y--;
+ start= end;
+ end += max;
+ chop= 1;
+ if (y==0 && i-start>=x) {
+ *charp= curs;
+ loop= 0;
+ break;
+ }
+ } else if (ch==' ' || ch=='-' || ch=='\0') {
+ if (y==0 && i-start>=x) {
+ *charp= curs;
+ loop= 0;
+ break;
+ }
+ end = i+1;
+ endj = j;
+ chop= 0;
+ }
+ i++;
+ }
+ if (ch=='\0') break;
+ }
+ if (!loop || y<0) break;
- BIF_ThemeColor(TH_HILITE);
+ if (!(*linep)->next) {
+ *charp= (*linep)->len;
+ break;
+ }
- glRecti(x-1, curarea->winy-st->lheight*(h)-2, x+1, curarea->winy-st->lheight*(h+1)-2);
+ /* On correct line but didn't meet cursor, must be at end */
+ if (y==0) {
+ *charp= (*linep)->len;
+ break;
+ }
+ *linep= (*linep)->next;
+ y--;
}
+
} else {
- int span= txt_get_span(text->curl, text->sell);
+ y-= txt_get_span(text->lines.first, *linep) - st->top;
- if (span<0) {
- linef= text->sell;
- charf= text->selc;
-
- linel= text->curl;
- charl= text->curc;
- } else if (span>0) {
- linef= text->curl;
- charf= text->curc;
-
- linel= text->sell;
- charl= text->selc;
- } else {
- linef= linel= text->curl;
-
- if (text->curc<text->selc) {
- charf= text->curc;
- charl= text->selc;
- } else {
- charf= text->selc;
- charl= text->curc;
+ if (y>0) {
+ while (y-- != 0) if((*linep)->next) *linep= (*linep)->next;
+ } else if (y<0) {
+ while (y++ != 0) if((*linep)->prev) *linep= (*linep)->prev;
+ }
+
+
+ w= render_string(st, (*linep)->line);
+ if(x<w) *charp= temp_char_accum[x];
+ else *charp= (*linep)->len;
+ }
+ if(!sel) txt_pop_sel(text);
+}
+
+static int get_wrap_width(SpaceText *st) {
+ int x, max;
+ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ max= (curarea->winx-x)/spacetext_get_fontwidth(st);
+ return max>8 ? max : 8;
+}
+
+/* Returns the number of wrap points (or additional lines) in the given string */
+static int get_wrap_points(SpaceText *st, char *line) {
+ int start, end, taboffs, i, max, count;
+
+ if (!st->wordwrap) return 0;
+
+ end= max= get_wrap_width(st);
+ count= taboffs= start= 0;
+
+ for (i=0; line[i]!='\0'; i++) {
+ if (i-start+taboffs>=max) {
+ count++;
+ start= end;
+ end += max;
+ taboffs= 0;
+ } else if (line[i]==' ' || line[i]=='\t' || line[i]=='-') {
+ end = i+1;
+ if (line[i]=='\t')
+ taboffs += st->tabnumber-(i-start)%st->tabnumber;
+ }
+ }
+ return count;
+}
+
+/* Sets (offl, offc) for transforming (line, curs) to its wrapped position */
+static void wrap_offset(SpaceText *st, TextLine *linein, int cursin, int *offl, int *offc) {
+ Text *text;
+ TextLine *linep;
+ int i, j, start, end, chars, max, chop;
+ char ch;
+
+ *offl= *offc= 0;
+
+ if (!st->text) return;
+ if (!st->wordwrap) return;
+
+ text= st->text;
+
+ /* Move pointer to first visible line (top) */
+ linep= text->lines.first;
+ i= st->top;
+ while (i>0 && linep) {
+ if (linep == linein) return; /* Line before top */
+ linep= linep->next;
+ i--;
+ }
+
+ max= get_wrap_width(st);
+
+ while (linep) {
+ start= 0;
+ end= max;
+ chop= 1;
+ chars= 0;
+ *offc= 0;
+ for (i=0, j=0; linep->line[j]!='\0'; j++) {
+
+ /* Mimic replacement of tabs */
+ ch= linep->line[j];
+ if (ch=='\t') {
+ chars= st->tabnumber-i%st->tabnumber;
+ if (linep==linein && i<cursin) cursin += chars-1;
+ ch= ' ';
+ } else
+ chars= 1;
+
+ while (chars--) {
+ if (i-start>=max) {
+ if (chop && linep==linein && i >= cursin)
+ return;
+ (*offl)++;
+ *offc -= end-start;
+ start= end;
+ end += max;
+ chop= 1;
+ } else if (ch==' ' || ch=='-') {
+ end = i+1;
+ chop= 0;
+ if (linep==linein && i >= cursin)
+ return;
+ }
+ i++;
}
}
-
- /* Walk to the beginning of visible text */
- h= txt_get_span(text->lines.first, linef) - st->top;
- while (h++<-1 && linef!=linel) linef= linef->next;
-
- x= text_draw(st, linef->line, st->left, charf, 0, 0, 0, NULL);
+ if (linep==linein) break;
+ linep= linep->next;
+ }
+}
- BIF_ThemeColor(TH_SHADE2);
+static int get_char_pos(SpaceText *st, char *line, int cur) {
+ int a=0, i;
+ for (i=0; i<cur && line[i]; i++) {
+ if (line[i]=='\t')
+ a += st->tabnumber-a%st->tabnumber;
+ else
+ a++;
+ }
+ return a;
+}
- if(st->showlinenrs) {
- if (!x) x= TXT_OFFSET + TEXTXLOC -4;
- } else {
- if (!x) x= TXT_OFFSET - 4;
+static void draw_markers(SpaceText *st) {
+ Text *text= st->text;
+ TextMarker *marker, *next;
+ TextLine *top, *bottom, *line;
+ int offl, offc, i, cy, x1, x2, y1, y2, x, y;
+
+ for (i=st->top, top= text->lines.first; top->next && i>0; i--) top= top->next;
+ for (i=st->viewlines-1, bottom=top; bottom->next && i>0; i--) bottom= bottom->next;
+
+ for (marker= text->markers.first; marker; marker= next) {
+ next= marker->next;
+ for (cy= 0, line= top; line; cy++, line= line->next) {
+ if (cy+st->top==marker->lineno) {
+ /* Remove broken markers */
+ if (marker->end>line->len || marker->start>marker->end) {
+ BLI_freelinkN(&text->markers, marker);
+ break;
+ }
+
+ wrap_offset(st, line, marker->start, &offl, &offc);
+ x1= get_char_pos(st, line->line, marker->start) - st->left + offc;
+ y1= cy + offl;
+ wrap_offset(st, line, marker->end, &offl, &offc);
+ x2= get_char_pos(st, line->line, marker->end) - st->left + offc;
+ y2= cy + offl;
+
+ glColor3ub(marker->color[0], marker->color[1], marker->color[2]);
+ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ y= curarea->winy-3;
+
+ if (y1==y2) {
+ y -= y1*st->lheight;
+ glBegin(GL_LINE_LOOP);
+ glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y);
+ glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y);
+ glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y-st->lheight);
+ glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y-st->lheight);
+ glEnd();
+ } else {
+ y -= y1*st->lheight;
+ glBegin(GL_LINE_STRIP);
+ glVertex2i(curarea->winx, y);
+ glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y);
+ glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y-st->lheight);
+ glVertex2i(curarea->winx, y-st->lheight);
+ glEnd();
+ y-=st->lheight;
+ for (i=y1+1; i<y2; i++) {
+ glBegin(GL_LINES);
+ glVertex2i(x, y);
+ glVertex2i(curarea->winx, y);
+ glVertex2i(x, y-st->lheight);
+ glVertex2i(curarea->winx, y-st->lheight);
+ glEnd();
+ y-=st->lheight;
+ }
+ glBegin(GL_LINE_STRIP);
+ glVertex2i(x, y);
+ glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y);
+ glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y-st->lheight);
+ glVertex2i(x, y-st->lheight);
+ glEnd();
+ }
+
+ break;
+ }
+ if (line==bottom) break;
}
+ }
+}
+
+static void draw_cursor(SpaceText *st) {
+ Text *text= st->text;
+ int vcurl, vcurc, vsell, vselc, hidden=0;
+ int offl, offc, x, y, w, i;
+
+ /* Draw the selection */
+ if (text->curl!=text->sell || text->curc!=text->selc) {
+
+ /* Convert all to view space character coordinates */
+ wrap_offset(st, text->curl, text->curc, &offl, &offc);
+ vcurl = txt_get_span(text->lines.first, text->curl) - st->top + offl;
+ vcurc = get_char_pos(st, text->curl->line, text->curc) - st->left + offc;
+ wrap_offset(st, text->sell, text->selc, &offl, &offc);
+ vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl;
+ vselc = get_char_pos(st, text->sell->line, text->selc) - st->left + offc;
+
+ if (vcurc<0) vcurc=0;
+ if (vselc<0) vselc=0, hidden=1;
- while (linef && linef != linel) {
- h= txt_get_span(text->lines.first, linef) - st->top;
- if (h>st->viewlines) break;
-
- glRecti(x, curarea->winy-st->lheight*(h)-2, curarea->winx, curarea->winy-st->lheight*(h+1)-2);
- if(st->showlinenrs)
- glRecti(TXT_OFFSET+TEXTXLOC-4, curarea->winy-st->lheight*(h+1)-2, TXT_OFFSET+TEXTXLOC, curarea->winy-st->lheight*(h+2)-2);
- else
- glRecti(TXT_OFFSET-4, curarea->winy-st->lheight*(h+1)-2, TXT_OFFSET, curarea->winy-st->lheight*(h+2)-2);
+ BIF_ThemeColor(TH_SHADE2);
+ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ y= curarea->winy-2;
- if(st->showlinenrs)
- x= TXT_OFFSET + TEXTXLOC;
+ if (vcurl==vsell) {
+ y -= vcurl*st->lheight;
+ if (vcurc < vselc)
+ glRecti(x+vcurc*spacetext_get_fontwidth(st)-1, y, x+vselc*spacetext_get_fontwidth(st), y-st->lheight);
else
- x= TXT_OFFSET;
-
- linef= linef->next;
+ glRecti(x+vselc*spacetext_get_fontwidth(st)-1, y, x+vcurc*spacetext_get_fontwidth(st), y-st->lheight);
+ } else {
+ int froml, fromc, tol, toc;
+ if (vcurl < vsell) {
+ froml= vcurl; tol= vsell;
+ fromc= vcurc; toc= vselc;
+ } else {
+ froml= vsell; tol= vcurl;
+ fromc= vselc; toc= vcurc;
+ }
+ y -= froml*st->lheight;
+ glRecti(x+fromc*spacetext_get_fontwidth(st)-1, y, curarea->winx, y-st->lheight); y-=st->lheight;
+ for (i=froml+1; i<tol; i++)
+ glRecti(x-4, y, curarea->winx, y-st->lheight), y-=st->lheight;
+ glRecti(x-4, y, x+toc*spacetext_get_fontwidth(st), y-st->lheight); y-=st->lheight;
}
-
- h= txt_get_span(text->lines.first, linef) - st->top;
-
- i= text_draw(st, linel->line, st->left, charl, 0, 0, 0, NULL);
- if(i) glRecti(x, curarea->winy-st->lheight*(h)-2, i, curarea->winy-st->lheight*(h+1)-2);
-
+ } else {
+ wrap_offset(st, text->sell, text->selc, &offl, &offc);
+ vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl;
+ vselc = get_char_pos(st, text->sell->line, text->selc) - st->left + offc;
+ if (vselc<0) vselc=0, hidden=1;
}
- do_brackets();
- BIF_ThemeColor(TH_TEXT);
+ if (!hidden) {
+ /* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */
+ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ x += vselc*spacetext_get_fontwidth(st);
+ y= curarea->winy-2 - vsell*st->lheight;
+
+ if (st->overwrite) {
+ char ch= text->sell->line[text->selc];
+ if (!ch) ch= ' ';
+ w= BMF_GetCharacterWidth(spacetext_get_font(st), ch);
+ BIF_ThemeColor(TH_HILITE);
+ glRecti(x, y-st->lheight-1, x+w, y-st->lheight+1);
+ } else {
+ BIF_ThemeColor(TH_HILITE);
+ glRecti(x-1, y, x+1, y-st->lheight);
+ }
+ }
}
static void calc_text_rcts(SpaceText *st)
@@ -859,6 +1065,38 @@ static void screen_skip(SpaceText *st, int lines)
if (st->top<0) st->top= 0;
}
+static void cursor_skip(SpaceText *st, int lines, int sel)
+{
+ Text *text;
+ TextLine **linep;
+ int oldl, oldc, *charp;
+
+ if (!st) return;
+ if (st->spacetype != SPACE_TEXT) return;
+ if (!st->text) return;
+
+ text= st->text;
+
+ if (sel) linep= &text->sell, charp= &text->selc;
+ else linep= &text->curl, charp= &text->curc;
+ oldl= txt_get_span(text->lines.first, *linep);
+ oldc= *charp;
+
+ while (lines>0 && (*linep)->next) {
+ *linep= (*linep)->next;
+ lines--;
+ }
+ while (lines<0 && (*linep)->prev) {
+ *linep= (*linep)->prev;
+ lines++;
+ }
+
+ if (*charp > (*linep)->len) *charp= (*linep)->len;
+
+ if (!sel) txt_pop_sel(st->text);
+ txt_undo_add_toop(st->text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, txt_get_span(text->lines.first, *linep), *charp);
+}
+
/*
* mode 1 == view scroll
* mode 2 == scrollbar
@@ -874,10 +1112,8 @@ static void do_textscroll(SpaceText *st, int mode)
st->flags|= ST_SCROLL_SELECT;
- glDrawBuffer(GL_FRONT);
- uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT);
- bglFlush();
- glDrawBuffer(GL_BACK);
+ scrarea_do_windraw(curarea);
+ screen_swapbuffers();
getmouseco_areawin(mval);
old[0]= hold[0]= mval[0];
@@ -895,9 +1131,12 @@ static void do_textscroll(SpaceText *st, int mode)
if (delta[0] || delta[1]) {
screen_skip(st, delta[1]);
- st->left+= delta[0];
- if (st->left<0) st->left= 0;
-
+ if (st->wordwrap) {
+ st->left= 0;
+ } else {
+ st->left+= delta[0];
+ if (st->left<0) st->left= 0;
+ }
scrarea_do_windraw(curarea);
screen_swapbuffers();
@@ -912,10 +1151,8 @@ static void do_textscroll(SpaceText *st, int mode)
}
st->flags^= ST_SCROLL_SELECT;
- glDrawBuffer(GL_FRONT);
- uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT);
- bglFlush();
- glDrawBuffer(GL_BACK);
+ scrarea_do_windraw(curarea);
+ screen_swapbuffers();
}
static void do_selection(SpaceText *st, int selecting)
@@ -957,7 +1194,7 @@ static void do_selection(SpaceText *st, int selecting)
scrarea_do_windraw(curarea);
screen_swapbuffers();
- } else if (mval[0]<0 || mval[0]>curarea->winx) {
+ } else if (!st->wordwrap && (mval[0]<0 || mval[0]>curarea->winx)) {
if (mval[0]>curarea->winx) st->left++;
else if (mval[0]<0 && st->left>0) st->left--;
@@ -986,19 +1223,409 @@ static void do_selection(SpaceText *st, int selecting)
if (sell!=linep2 || selc!=charp2)
txt_undo_add_toop(st->text, UNDO_STO, sell, selc, linep2, charp2);
+
+ pop_space_text(st);
+}
+
+static int do_suggest_select(SpaceText *st)
+{
+ SuggItem *item, *first, *last, *sel;
+ short mval[2];
+ TextLine *tmp;
+ int l, x, y, w, h, i;
+ int tgti, *top;
+
+ if (!st || !st->text) return 0;
+ if (!texttool_text_is_active(st->text)) return 0;
+
+ first = texttool_suggest_first();
+ last = texttool_suggest_last();
+ sel = texttool_suggest_selected();
+ top = texttool_suggest_top();
+
+ if (!last || !first)
+ return 0;
+
+ /* Count the visible lines to the cursor */
+ for (tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
+ if (l<0) return 0;
+
+ if(st->showlinenrs) {
+ x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
+ } else {
+ x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET - 4;
+ }
+ y = curarea->winy - st->lheight*l - 2;
+
+ w = SUGG_LIST_WIDTH*spacetext_get_fontwidth(st) + 20;
+ h = SUGG_LIST_SIZE*st->lheight + 8;
+
+ getmouseco_areawin(mval);
+
+ if (mval[0]<x || x+w<mval[0] || mval[1]<y-h || y<mval[1])
+ return 0;
+
+ /* Work out which of the items is at the top of the visible list */
+ for (i=0, item=first; i<*top && item->next; i++, item=item->next);
+
+ /* Work out the target item index in the visible list */
+ tgti = (y-mval[1]-4) / st->lheight;
+ if (tgti<0 || tgti>SUGG_LIST_SIZE)
+ return 1;
+
+ for (i=tgti; i>0 && item->next; i--, item=item->next);
+ if (item)
+ texttool_suggest_select(item);
+ return 1;
+}
+
+static void pop_suggest_list() {
+ SuggItem *item, *sel;
+ int *top, i;
+
+ item= texttool_suggest_first();
+ sel= texttool_suggest_selected();
+ top= texttool_suggest_top();
+
+ i= 0;
+ while (item && item != sel) {
+ item= item->next;
+ i++;
+ }
+ if (i > *top+SUGG_LIST_SIZE-1)
+ *top= i-SUGG_LIST_SIZE+1;
+ else if (i < *top)
+ *top= i;
+}
+
+void draw_documentation(SpaceText *st)
+{
+ TextLine *tmp;
+ char *docs, buf[DOC_WIDTH+1], *p;
+ int len, i, br, lines;
+ int boxw, boxh, l, x, y, top;
+
+ if (!st || !st->text) return;
+ if (!texttool_text_is_active(st->text)) return;
+
+ docs = texttool_docs_get();
+
+ if (!docs) return;
+
+ /* Count the visible lines to the cursor */
+ for (tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
+ if (l<0) return;
+
+ if(st->showlinenrs) {
+ x= spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
+ } else {
+ x= spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET - 4;
+ }
+ if (texttool_suggest_first()) {
+ x += SUGG_LIST_WIDTH*spacetext_get_fontwidth(st) + 50;
+ }
+
+ top= y= curarea->winy - st->lheight*l - 2;
+ len= strlen(docs);
+ boxw= DOC_WIDTH*spacetext_get_fontwidth(st) + 20;
+ boxh= (DOC_HEIGHT+1)*st->lheight;
+
+ /* Draw panel */
+ BIF_ThemeColor(TH_BACK);
+ glRecti(x, y, x+boxw, y-boxh);
+ BIF_ThemeColor(TH_SHADE1);
+ glBegin(GL_LINE_LOOP);
+ glVertex2i(x, y);
+ glVertex2i(x+boxw, y);
+ glVertex2i(x+boxw, y-boxh);
+ glVertex2i(x, y-boxh);
+ glEnd();
+ glBegin(GL_LINE_LOOP);
+ glVertex2i(x+boxw-10, y-7);
+ glVertex2i(x+boxw-4, y-7);
+ glVertex2i(x+boxw-7, y-2);
+ glEnd();
+ glBegin(GL_LINE_LOOP);
+ glVertex2i(x+boxw-10, y-boxh+7);
+ glVertex2i(x+boxw-4, y-boxh+7);
+ glVertex2i(x+boxw-7, y-boxh+2);
+ glEnd();
+ BIF_ThemeColor(TH_TEXT);
+
+ i= 0; br= DOC_WIDTH; lines= -doc_scroll;
+ for (p=docs; *p; p++) {
+ if (*p == '\r' && *(++p) != '\n') *(--p)= '\n'; /* Fix line endings */
+ if (*p == ' ' || *p == '\t')
+ br= i;
+ else if (*p == '\n') {
+ buf[i]= '\0';
+ if (lines>=0) {
+ y -= st->lheight;
+ text_draw(st, buf, 0, 0, 1, x+4, y-3, NULL);
+ }
+ i= 0; br= DOC_WIDTH; lines++;
+ }
+ buf[i++]= *p;
+ if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */
+ buf[br]= '\0';
+ if (lines>=0) {
+ y -= st->lheight;
+ text_draw(st, buf, 0, 0, 1, x+4, y-3, NULL);
+ }
+ p -= i-br-1; /* Rewind pointer to last break */
+ i= 0; br= DOC_WIDTH; lines++;
+ }
+ if (lines >= DOC_HEIGHT) break;
+ }
+ if (doc_scroll > 0 && lines < DOC_HEIGHT) {
+ doc_scroll--;
+ draw_documentation(st);
+ }
+}
+
+void draw_suggestion_list(SpaceText *st)
+{
+ SuggItem *item, *first, *last, *sel;
+ TextLine *tmp;
+ char str[SUGG_LIST_WIDTH+1];
+ int w, boxw=0, boxh, i, l, x, y, b, *top;
+
+ if (!st || !st->text) return;
+ if (!texttool_text_is_active(st->text)) return;
+
+ first = texttool_suggest_first();
+ last = texttool_suggest_last();
+
+ if (!first || !last) return;
+
+ pop_suggest_list();
+ sel = texttool_suggest_selected();
+ top = texttool_suggest_top();
+
+ /* Count the visible lines to the cursor */
+ for (tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
+ if (l<0) return;
+
+ if(st->showlinenrs) {
+ x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
+ } else {
+ x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET - 4;
+ }
+ y = curarea->winy - st->lheight*l - 2;
+
+ boxw = SUGG_LIST_WIDTH*spacetext_get_fontwidth(st) + 20;
+ boxh = SUGG_LIST_SIZE*st->lheight + 8;
+
+ BIF_ThemeColor(TH_SHADE1);
+ glRecti(x-1, y+1, x+boxw+1, y-boxh-1);
+ BIF_ThemeColor(TH_BACK);
+ glRecti(x, y, x+boxw, y-boxh);
+
+ /* Set the top 'item' of the visible list */
+ for (i=0, item=first; i<*top && item->next; i++, item=item->next);
+
+ for (i=0; i<SUGG_LIST_SIZE && item; i++, item=item->next) {
+
+ y -= st->lheight;
+
+ strncpy(str, item->name, SUGG_LIST_WIDTH);
+ str[SUGG_LIST_WIDTH] = '\0';
+
+ w = BMF_GetStringWidth(spacetext_get_font(st), str);
+
+ if (item == sel) {
+ BIF_ThemeColor(TH_SHADE2);
+ glRecti(x+16, y-3, x+16+w, y+st->lheight-3);
+ }
+ b=1; /* b=1 colour block, text is default. b=0 no block, colour text */
+ switch (item->type) {
+ case 'k': BIF_ThemeColor(TH_SYNTAX_B); b=0; break;
+ case 'm': BIF_ThemeColor(TH_TEXT); break;
+ case 'f': BIF_ThemeColor(TH_SYNTAX_L); break;
+ case 'v': BIF_ThemeColor(TH_SYNTAX_N); break;
+ case '?': BIF_ThemeColor(TH_TEXT); b=0; break;
+ }
+ if (b) {
+ glRecti(x+8, y+2, x+11, y+5);
+ BIF_ThemeColor(TH_TEXT);
+ }
+ text_draw(st, str, 0, 0, 1, x+16, y-1, NULL);
+
+ if (item == last) break;
+ }
+}
+
+static short check_blockhandler(SpaceText *st, short handler) {
+ short a;
+ for(a=0; a<SPACE_MAXHANDLER; a+=2)
+ if (st->blockhandler[a]==handler) return 1;
+ return 0;
+}
+
+static void text_panel_find(short cntrl) // TEXT_HANDLER_FIND
+{
+ uiBlock *block;
+
+ if (!g_find_str || !g_replace_str) {
+ g_find_str= MEM_mallocN(TXT_MAXFINDSTR+1, "find_string");
+ g_replace_str= MEM_mallocN(TXT_MAXFINDSTR+1, "replace_string");
+ g_find_str[0]= g_replace_str[0]= '\0';
+ }
+
+ block= uiNewBlock(&curarea->uiblocks, "text_panel_find", UI_EMBOSS, UI_HELV, curarea->win);
+ uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
+ uiSetPanelHandler(TEXT_HANDLER_FIND); // for close and esc
+ if(uiNewPanel(curarea, block, "Find & Replace", "Text", curarea->winx-230, curarea->winy-130, 260, 120)==0) return;
+
+ uiBlockBeginAlign(block);
+ uiDefButC(block, TEX, 0, "Find: ", 0,80,220,20, g_find_str, 0,(float)TXT_MAXFINDSTR, 0,0, "");
+ uiDefIconBut(block, BUT, B_PASTEFIND, ICON_TEXT, 220,80,20,20, NULL, 0,0,0,0, "Copy from selection");
+ uiDefButC(block, TEX, 0, "Replace: ", 0,60,220,20, g_replace_str, 0,(float)TXT_MAXFINDSTR, 0,0, "");
+ uiDefIconBut(block, BUT, B_PASTEREPLACE, ICON_TEXT, 220,60,20,20, NULL, 0,0,0,0, "Copy from selection");
+ uiBlockEndAlign(block);
+ uiDefButBitI(block, TOG, TXT_FIND_WRAP, 0,"Wrap Around", 0,30,110,20,&g_find_flags,0,0,0,0,"Wrap search around current text");
+ uiDefButBitI(block, TOG, TXT_FIND_ALLTEXTS,0,"Search All Texts", 110,30,130,20,&g_find_flags,0,0,0,0,"Search in each text");
+ uiDefBut(block, BUT, B_TEXTFIND, "Find", 0,0,50,20, NULL, 0,0,0,0, "Find next");
+ uiDefBut(block, BUT, B_TEXTREPLACE, "Replace/Find", 50,0,110,20, NULL, 0,0,0,0, "Replace then find next");
+ uiDefBut(block, BUT, B_TEXTMARKALL, "Mark All", 160,0,80,20, NULL, 0,0,0,0, "Mark each occurrence to edit all from one");
+}
+
+/* mode: 0 find only, 1 replace/find, 2 mark all occurrences */
+void find_and_replace(SpaceText *st, short mode) {
+ char *tmp;
+ Text *start= NULL, *text= st->text;
+ int flags, first= 1;
+
+ if (!check_blockhandler(st, TEXT_HANDLER_FIND)) {
+ toggle_blockhandler(st->area, TEXT_HANDLER_FIND, UI_PNL_TO_MOUSE);
+ return;
+ }
+
+ if (!g_find_str || !g_replace_str) return;
+ if (g_find_str[0] == '\0') return;
+ flags= g_find_flags;
+ if (flags & TXT_FIND_ALLTEXTS) flags ^= TXT_FIND_WRAP;
+
+ do {
+ if (first)
+ txt_clear_markers(text, TMARK_GRP_FINDALL, 0);
+ first= 0;
+
+ /* Replace current */
+ if (mode && txt_has_sel(text)) {
+ tmp= txt_sel_to_buf(text);
+ if (strcmp(g_find_str, tmp)==0) {
+ if (mode==1) {
+ txt_insert_buf(text, g_replace_str);
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
+ } else if (mode==2) {
+ char color[4];
+ BIF_GetThemeColor4ubv(TH_SHADE2, color);
+ if (txt_find_marker(text, text->curl, text->selc, TMARK_GRP_FINDALL, 0)) {
+ if (tmp) MEM_freeN(tmp), tmp=NULL;
+ break;
+ }
+ txt_add_marker(text, text->curl, text->curc, text->selc, color, TMARK_GRP_FINDALL, TMARK_EDITALL);
+ }
+ }
+ MEM_freeN(tmp);
+ tmp= NULL;
+ }
+
+ /* Find next */
+ if (txt_find_string(text, g_find_str, flags & TXT_FIND_WRAP)) {
+ pop_space_text(st);
+ } else if (flags & TXT_FIND_ALLTEXTS) {
+ if (text==start) break;
+ if (!start) start= text;
+ if (text->id.next)
+ text= st->text= text->id.next;
+ else
+ text= st->text= G.main->text.first;
+ txt_move_toline(text, 0, 0);
+ pop_space_text(st);
+ first= 1;
+ } else {
+ okee("Text not found: %s", g_find_str);
+ break;
+ }
+ } while (mode==2);
+}
+
+static void do_find_buttons(val) {
+ Text *text;
+ SpaceText *st;
+ int do_draw= 0;
+ char *tmp;
+
+ st= curarea->spacedata.first;
+ if (!st || st->spacetype != SPACE_TEXT) return;
+ text= st->text;
+ if (!text) return;
+
+ switch (val) {
+ case B_PASTEFIND:
+ if (!g_find_str) break;
+ tmp= txt_sel_to_buf(text);
+ strncpy(g_find_str, tmp, TXT_MAXFINDSTR);
+ MEM_freeN(tmp);
+ do_draw= 1;
+ break;
+ case B_PASTEREPLACE:
+ if (!g_replace_str) break;
+ tmp= txt_sel_to_buf(text);
+ strncpy(g_replace_str, tmp, TXT_MAXFINDSTR);
+ MEM_freeN(tmp);
+ do_draw= 1;
+ break;
+ case B_TEXTFIND:
+ find_and_replace(st, 0);
+ do_draw= 1;
+ break;
+ case B_TEXTREPLACE:
+ find_and_replace(st, 1);
+ do_draw= 1;
+ break;
+ case B_TEXTMARKALL:
+ find_and_replace(st, 2);
+ do_draw= 1;
+ break;
+ }
+}
+
+static void text_blockhandlers(ScrArea *sa)
+{
+ SpaceText *st= sa->spacedata.first;
+ short a;
+
+ /* warning; blocks need to be freed each time, handlers dont remove */
+ uiFreeBlocksWin(&sa->uiblocks, sa->win);
+
+ for(a=0; a<SPACE_MAXHANDLER; a+=2) {
+ /* clear action value for event */
+ switch(st->blockhandler[a]) {
+ case TEXT_HANDLER_FIND:
+ text_panel_find(st->blockhandler[a+1]);
+ break;
+ }
+ }
+ uiDrawBlocksPanels(sa, 0);
}
void drawtextspace(ScrArea *sa, void *spacedata)
{
SpaceText *st= curarea->spacedata.first;
Text *text;
- int i;
+ int i, x, y;
TextLine *tmp;
char linenr[12];
float col[3];
int linecount = 0;
if (st==NULL || st->spacetype != SPACE_TEXT) return;
+
+ bwin_clear_viewmat(sa->win); /* clear buttons view */
+ glLoadIdentity();
BIF_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
@@ -1022,23 +1649,23 @@ void drawtextspace(ScrArea *sa, void *spacedata)
glRecti(23, 0, (st->lheight==15)?63:59, curarea->winy - 2);
}
- BIF_ThemeColor(TH_TEXT);
-
draw_cursor(st);
tmp= text->lines.first;
for (i= 0; i<st->top && tmp; i++) {
+ if (st->showsyntax && !tmp->format) txt_format_line(st, tmp, 0);
tmp= tmp->next;
linecount++;
}
-
- if(st->showsyntax) {
- if (tmp && !tmp->format) {
- get_format_string(st);
+
+ y= curarea->winy-st->lheight;
+ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+
+ BIF_ThemeColor(TH_TEXT);
+ for (i=0; y>0 && i<st->viewlines && tmp; i++, tmp= tmp->next) {
+ if (st->showsyntax && !tmp->format) {
+ txt_format_line(st, tmp, 0);
}
- }
-
- for (i=0; i<st->viewlines && tmp; i++, tmp= tmp->next) {
if(st->showlinenrs) {
/*Change the color of the current line the cursor is on*/
if(tmp == text->curl) {
@@ -1048,20 +1675,33 @@ void drawtextspace(ScrArea *sa, void *spacedata)
}
if(((float)(i + linecount + 1)/10000.0) < 1.0) {
sprintf(linenr, "%4d", i + linecount + 1);
- glRasterPos2i(TXT_OFFSET - 7, curarea->winy-st->lheight*(i+1));
+ glRasterPos2i(TXT_OFFSET - 7, y);
} else {
sprintf(linenr, "%5d", i + linecount + 1);
- glRasterPos2i(TXT_OFFSET - 11, curarea->winy-st->lheight*(i+1));
+ glRasterPos2i(TXT_OFFSET - 11, y);
}
BIF_ThemeColor(TH_TEXT);
BMF_DrawString(spacetext_get_font(st), linenr);
- text_draw(st, tmp->line, st->left, 0, 1, TXT_OFFSET + TEXTXLOC, curarea->winy-st->lheight*(i+1), tmp->format);
- } else
- text_draw(st, tmp->line, st->left, 0, 1, TXT_OFFSET, curarea->winy-st->lheight*(i+1), tmp->format);
+ }
+ if (st->wordwrap) {
+ int lines = text_draw_wrapped(st, tmp->line, x, y, curarea->winx-x, tmp->format);
+ y -= lines*st->lheight;
+ } else {
+ text_draw(st, tmp->line, st->left, 0, 1, x, y, tmp->format);
+ y -= st->lheight;
+ }
}
+
+ draw_brackets(st);
+ draw_markers(st);
draw_textscroll(st);
-
+ draw_documentation(st);
+ draw_suggestion_list(st);
+
+ bwin_scalematrix(sa->win, st->blockscale, st->blockscale, st->blockscale);
+ text_blockhandlers(sa);
+
curarea->win_swap= WIN_BACK_OK;
}
@@ -1075,15 +1715,19 @@ void pop_space_text (SpaceText *st)
if(!st->text) return;
if(!st->text->curl) return;
- i= txt_get_span(st->text->lines.first, st->text->curl);
+ i= txt_get_span(st->text->lines.first, st->text->sell);
if (st->top+st->viewlines <= i || st->top > i) {
st->top= i - st->viewlines/2;
}
- x= text_draw(st, st->text->curl->line, st->left, st->text->curc, 0, 0, 0, NULL);
+ if (st->wordwrap) {
+ st->left= 0;
+ } else {
+ x= text_draw(st, st->text->sell->line, st->left, st->text->selc, 0, 0, 0, NULL);
- if (x==0 || x>curarea->winx) {
- st->left= st->text->curc-0.5*(curarea->winx)/spacetext_get_fontwidth(st);
+ if (x==0 || x>curarea->winx) {
+ st->left= st->text->curc-0.5*(curarea->winx)/spacetext_get_fontwidth(st);
+ }
}
if (st->top < 0) st->top= 0;
@@ -1103,7 +1747,7 @@ void add_text_fs(char *file) /* bad but cant pass an as arg here */
st->top= 0;
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
}
@@ -1115,6 +1759,60 @@ void free_textspace(SpaceText *st)
st->text= NULL;
}
+/* returns 0 if file on disk is the same or Text is in memory only
+ returns 1 if file has been modified on disk since last local edit
+ returns 2 if file on disk has been deleted
+ -1 is returned if an error occurs
+*/
+int txt_file_modified(Text *text)
+{
+ struct stat st;
+ int result;
+ char file[FILE_MAXDIR+FILE_MAXFILE];
+
+ if (!text || !text->name)
+ return 0;
+
+ BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_convertstringcode(file, G.sce);
+
+ if (!BLI_exists(file))
+ return 2;
+
+ result = stat(file, &st);
+
+ if(result == -1)
+ return -1;
+
+ if((st.st_mode & S_IFMT) != S_IFREG)
+ return -1;
+
+ if (st.st_mtime > text->mtime)
+ return 1;
+
+ return 0;
+}
+
+void txt_ignore_modified(Text *text) {
+ struct stat st;
+ int result;
+ char file[FILE_MAXDIR+FILE_MAXFILE];
+
+ if (!text || !text->name) return;
+
+ BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_convertstringcode(file, G.sce);
+
+ if (!BLI_exists(file)) return;
+
+ result = stat(file, &st);
+
+ if(result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
+ return;
+
+ text->mtime= st.st_mtime;
+}
+
static void save_mem_text(char *str)
{
SpaceText *st= curarea->spacedata.first;
@@ -1141,6 +1839,9 @@ void txt_write_file(Text *text)
{
FILE *fp;
TextLine *tmp;
+ int res;
+ struct stat st;
+ char file[FILE_MAXDIR+FILE_MAXFILE];
/* Do we need to get a filename? */
if (text->flags & TXT_ISMEM) {
@@ -1148,19 +1849,22 @@ void txt_write_file(Text *text)
activate_fileselect(FILE_SPECIAL, "SAVE TEXT FILE", text->name, save_mem_text);
else
activate_fileselect(FILE_SPECIAL, "SAVE TEXT FILE", text->id.name+2, save_mem_text);
- return;
+ return;
}
+
+ BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_convertstringcode(file, G.sce);
/* Should we ask to save over? */
if (text->flags & TXT_ISTMP) {
- if (BLI_exists(text->name)) {
+ if (BLI_exists(file)) {
if (!okee("Save over")) return;
} else if (!okee("Create new file")) return;
text->flags ^= TXT_ISTMP;
}
- fp= fopen(text->name, "w");
+ fp= fopen(file, "w");
if (fp==NULL) {
error("Unable to save file");
return;
@@ -1175,6 +1879,9 @@ void txt_write_file(Text *text)
}
fclose (fp);
+
+ res= stat(file, &st);
+ text->mtime= st.st_mtime;
if (text->flags & TXT_ISDIRTY) text->flags ^= TXT_ISDIRTY;
}
@@ -1386,44 +2093,6 @@ void txt_copy_clipboard(Text *text) {
}
}
-/*
- * again==0 show find panel or find
- * again==1 find text again */
-void txt_find_panel(SpaceText *st, int again)
-{
- Text *text=st->text;
- char *findstr= last_txt_find_string;
-
- if (again==0) {
- findstr= txt_sel_to_buf(text);
- } else if (again==1) {
- char buf[256];
-
- if (findstr && strlen(findstr)<(sizeof(buf)-1))
- strcpy(buf, findstr);
- else
- buf[0]= 0;
-
- if (sbutton(buf, 0, sizeof(buf)-1, "Find: ") && buf[0])
- findstr= BLI_strdup(buf);
- else
- findstr= NULL;
- }
-
- if (findstr!=last_txt_find_string) {
- if (last_txt_find_string)
- MEM_freeN(last_txt_find_string);
- last_txt_find_string= findstr;
- }
-
- if (findstr) {
- if (txt_find_string(text, findstr))
- pop_space_text(st);
- else
- error("Not found: %s", findstr);
- }
-}
-
void run_python_script(SpaceText *st)
{
char *py_filename;
@@ -1458,6 +2127,580 @@ static void set_tabs(Text *text)
st->currtab_set = setcurr_tab(text);
}
+static void wrap_move_bol(SpaceText *st, short sel) {
+ int offl, offc, lin;
+ Text *text= st->text;
+
+ lin= txt_get_span(text->lines.first, text->sell);
+ wrap_offset(st, text->sell, text->selc, &offl, &offc);
+
+ if (sel) {
+ txt_undo_add_toop(text, UNDO_STO, lin, text->selc, lin, -offc);
+ text->selc= -offc;
+ } else {
+ txt_undo_add_toop(text, UNDO_CTO, lin, text->curc, lin, -offc);
+ text->curc= -offc;
+ txt_pop_sel(text);
+ }
+}
+
+static void wrap_move_eol(SpaceText *st, short sel) {
+ int offl, offc, lin, startl, c;
+ Text *text= st->text;
+
+ lin= txt_get_span(text->lines.first, text->sell);
+ wrap_offset(st, text->sell, text->selc, &offl, &offc);
+ startl= offl;
+ c= text->selc;
+ while (offl==startl && text->sell->line[c]!='\0') {
+ c++;
+ wrap_offset(st, text->sell, c, &offl, &offc);
+ } if (offl!=startl) c--;
+
+ if (sel) {
+ txt_undo_add_toop(text, UNDO_STO, lin, text->selc, lin, c);
+ text->selc= c;
+ } else {
+ txt_undo_add_toop(text, UNDO_CTO, lin, text->curc, lin, c);
+ text->curc= c;
+ txt_pop_sel(text);
+ }
+}
+
+static void wrap_move_up(SpaceText *st, short sel) {
+ int offl, offl_1, offc, fromline, toline, c, target;
+ Text *text= st->text;
+
+ wrap_offset(st, text->sell, 0, &offl_1, &offc);
+ wrap_offset(st, text->sell, text->selc, &offl, &offc);
+ fromline= toline= txt_get_span(text->lines.first, text->sell);
+ target= text->selc + offc;
+
+ if (offl==offl_1) {
+ if (!text->sell->prev) {
+ txt_move_bol(text, sel);
+ return;
+ }
+ toline--;
+ c= text->sell->prev->len; /* End of prev. line */
+ wrap_offset(st, text->sell->prev, c, &offl, &offc);
+ c= -offc+target;
+ } else {
+ c= -offc-1; /* End of prev. line */
+ wrap_offset(st, text->sell, c, &offl, &offc);
+ c= -offc+target;
+ }
+ if (c<0) c=0;
+
+ if (sel) {
+ txt_undo_add_toop(text, UNDO_STO, fromline, text->selc, toline, c);
+ if (toline<fromline) text->sell= text->sell->prev;
+ if (c>text->sell->len) c= text->sell->len;
+ text->selc= c;
+ } else {
+ txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
+ if (toline<fromline) text->curl= text->curl->prev;
+ if (c>text->curl->len) c= text->curl->len;
+ text->curc= c;
+ txt_pop_sel(text);
+ }
+}
+
+static void wrap_move_down(SpaceText *st, short sel) {
+ int offl, startoff, offc, fromline, toline, c, target;
+ Text *text= st->text;
+
+ wrap_offset(st, text->sell, text->selc, &offl, &offc);
+ fromline= toline= txt_get_span(text->lines.first, text->sell);
+ target= text->selc + offc;
+ startoff= offl;
+ c= text->selc;
+ while (offl==startoff && text->sell->line[c]!='\0') {
+ c++;
+ wrap_offset(st, text->sell, c, &offl, &offc);
+ }
+
+ if (text->sell->line[c]=='\0') {
+ if (!text->sell->next) {
+ txt_move_eol(text, sel);
+ return;
+ }
+ toline++;
+ c= target;
+ } else {
+ c += target;
+ if (c > text->sell->len) c= text->sell->len;
+ }
+ if (c<0) c=0;
+
+ if (sel) {
+ txt_undo_add_toop(text, UNDO_STO, fromline, text->selc, toline, c);
+ if (toline>fromline) text->sell= text->sell->next;
+ if (c>text->sell->len) c= text->sell->len;
+ text->selc= c;
+ } else {
+ txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
+ if (toline>fromline) text->curl= text->curl->next;
+ if (c>text->curl->len) c= text->curl->len;
+ text->curc= c;
+ txt_pop_sel(text);
+ }
+}
+
+static void get_suggest_prefix(Text *text, int offset) {
+ int i, len;
+ char *line, tmp[256];
+
+ if (!text) return;
+ if (!texttool_text_is_active(text)) return;
+
+ line= text->curl->line;
+ for (i=text->curc-1+offset; i>=0; i--)
+ if (!check_identifier(line[i]))
+ break;
+ i++;
+ len= text->curc-i+offset;
+ if (len > 255) {
+ printf("Suggestion prefix too long\n");
+ len = 255;
+ }
+ strncpy(tmp, line+i, len);
+ tmp[len]= '\0';
+ texttool_suggest_prefix(tmp);
+}
+
+static void confirm_suggestion(Text *text, int skipleft) {
+ int i, over=0;
+ char *line;
+ SuggItem *sel;
+
+ if (!text) return;
+ if (!texttool_text_is_active(text)) return;
+
+ sel = texttool_suggest_selected();
+ if (!sel) return;
+
+ line= text->curl->line;
+ i=text->curc-skipleft-1;
+ while (i>=0) {
+ if (!check_identifier(line[i]))
+ break;
+ over++;
+ i--;
+ }
+
+ for (i=0; i<skipleft; i++)
+ txt_move_left(text, 0);
+ for (i=0; i<over; i++)
+ txt_move_left(text, 1);
+
+ txt_insert_buf(text, sel->name);
+
+ for (i=0; i<skipleft; i++)
+ txt_move_right(text, 0);
+
+ texttool_text_clear();
+}
+
+static short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val) {
+ int draw=0, tools=0, swallow=0, scroll=1;
+ if (!texttool_text_is_active(st->text)) return 0;
+ if (!st->text || st->text->id.lib) return 0;
+
+ if (st->doplugins && texttool_text_is_active(st->text)) {
+ if (texttool_suggest_first()) tools |= TOOL_SUGG_LIST;
+ if (texttool_docs_get()) tools |= TOOL_DOCUMENT;
+ }
+
+ if (ascii) {
+ if (tools & TOOL_SUGG_LIST) {
+ if ((ascii != '_' && ascii != '*' && ispunct(ascii)) || check_whitespace(ascii)) {
+ confirm_suggestion(st->text, 0);
+ if (st->showsyntax) txt_format_line(st, st->text->curl, 1);
+ } else if ((st->overwrite && txt_replace_char(st->text, ascii)) || txt_add_char(st->text, ascii)) {
+ get_suggest_prefix(st->text, 0);
+ pop_suggest_list();
+ swallow= 1;
+ draw= 1;
+ }
+ }
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
+
+ } else if (val==1 && evnt) {
+ switch (evnt) {
+ case LEFTMOUSE:
+ if (do_suggest_select(st))
+ swallow= 1;
+ else {
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ }
+ draw= 1;
+ break;
+ case MIDDLEMOUSE:
+ if (do_suggest_select(st)) {
+ confirm_suggestion(st->text, 0);
+ if (st->showsyntax) txt_format_line(st, st->text->curl, 1);
+ swallow= 1;
+ } else {
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ }
+ draw= 1;
+ break;
+ case ESCKEY:
+ draw= swallow= 1;
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
+ else if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ else draw= swallow= 0;
+ break;
+ case RETKEY:
+ if (tools & TOOL_SUGG_LIST) {
+ confirm_suggestion(st->text, 0);
+ if (st->showsyntax) txt_format_line(st, st->text->curl, 1);
+ swallow= 1;
+ draw= 1;
+ }
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
+ break;
+ case LEFTARROWKEY:
+ case BACKSPACEKEY:
+ if (tools & TOOL_SUGG_LIST) {
+ if (G.qual)
+ texttool_suggest_clear();
+ else {
+ /* Work out which char we are about to delete/pass */
+ if (st->text->curl && st->text->curc > 0) {
+ char ch= st->text->curl->line[st->text->curc-1];
+ if ((ch=='_' || !ispunct(ch)) && !check_whitespace(ch)) {
+ get_suggest_prefix(st->text, -1);
+ pop_suggest_list();
+ }
+ else
+ texttool_suggest_clear();
+ } else
+ texttool_suggest_clear();
+ }
+ }
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ break;
+ case RIGHTARROWKEY:
+ if (tools & TOOL_SUGG_LIST) {
+ if (G.qual)
+ texttool_suggest_clear();
+ else {
+ /* Work out which char we are about to pass */
+ if (st->text->curl && st->text->curc < st->text->curl->len) {
+ char ch= st->text->curl->line[st->text->curc+1];
+ if ((ch=='_' || !ispunct(ch)) && !check_whitespace(ch)) {
+ get_suggest_prefix(st->text, 1);
+ pop_suggest_list();
+ }
+ else
+ texttool_suggest_clear();
+ } else
+ texttool_suggest_clear();
+ }
+ }
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
+ break;
+ case PAGEDOWNKEY:
+ scroll= SUGG_LIST_SIZE-1;
+ case WHEELDOWNMOUSE:
+ case DOWNARROWKEY:
+ if (tools & TOOL_DOCUMENT) {
+ doc_scroll++;
+ swallow= 1;
+ draw= 1;
+ break;
+ } else if (tools & TOOL_SUGG_LIST) {
+ SuggItem *sel = texttool_suggest_selected();
+ if (!sel) {
+ texttool_suggest_select(texttool_suggest_first());
+ } else while (sel && sel!=texttool_suggest_last() && sel->next && scroll--) {
+ texttool_suggest_select(sel->next);
+ sel= sel->next;
+ }
+ pop_suggest_list();
+ swallow= 1;
+ draw= 1;
+ break;
+ }
+ case PAGEUPKEY:
+ scroll= SUGG_LIST_SIZE-1;
+ case WHEELUPMOUSE:
+ case UPARROWKEY:
+ if (tools & TOOL_DOCUMENT) {
+ if (doc_scroll>0) doc_scroll--;
+ swallow= 1;
+ draw= 1;
+ break;
+ } else if (tools & TOOL_SUGG_LIST) {
+ SuggItem *sel = texttool_suggest_selected();
+ while (sel && sel!=texttool_suggest_first() && sel->prev && scroll--) {
+ texttool_suggest_select(sel->prev);
+ sel= sel->prev;
+ }
+ pop_suggest_list();
+ swallow= 1;
+ draw= 1;
+ break;
+ }
+ case RIGHTSHIFTKEY:
+ case LEFTSHIFTKEY:
+ break;
+ default:
+ if (tools & TOOL_SUGG_LIST) texttool_suggest_clear(), draw= 1;
+ if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
+ }
+ }
+
+ if (draw) {
+ ScrArea *sa;
+
+ for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
+ SpaceText *st= sa->spacedata.first;
+
+ if (st && st->spacetype==SPACE_TEXT) {
+ scrarea_queue_redraw(sa);
+ }
+ }
+ }
+
+ return swallow;
+}
+
+static short do_markers(SpaceText *st, char ascii, unsigned short evnt, short val) {
+ Text *text;
+ TextMarker *marker, *mrk, *nxt;
+ int c, s, draw=0, swallow=0;
+
+ text= st->text;
+ if (!text || text->id.lib || text->curl != text->sell) return 0;
+
+ marker= txt_find_marker(text, text->sell, text->selc, 0, 0);
+ if (marker && (marker->start > text->curc || marker->end < text->curc))
+ marker= NULL;
+
+ if (!marker) {
+ /* Find the next temporary marker */
+ if (evnt==TABKEY) {
+ int lineno= txt_get_span(text->lines.first, text->curl);
+ TextMarker *mrk= text->markers.first;
+ while (mrk) {
+ if (!marker && (mrk->flags & TMARK_TEMP)) marker= mrk;
+ if ((mrk->flags & TMARK_TEMP) && (mrk->lineno > lineno || (mrk->lineno==lineno && mrk->end > text->curc))) {
+ marker= mrk;
+ break;
+ }
+ mrk= mrk->next;
+ }
+ if (marker) {
+ txt_move_to(text, marker->lineno, marker->start, 0);
+ txt_move_to(text, marker->lineno, marker->end, 1);
+ pop_space_text(st);
+ evnt= ascii= val= 0;
+ draw= 1;
+ swallow= 1;
+ }
+ } else if (evnt==ESCKEY) {
+ if (txt_clear_markers(text, 0, TMARK_TEMP)) swallow= 1;
+ else if (txt_clear_markers(text, 0, 0)) swallow= 1;
+ else return 0;
+ evnt= ascii= val= 0;
+ draw= 1;
+ }
+ if (!swallow) return 0;
+ }
+
+ if (ascii) {
+ if (marker->flags & TMARK_EDITALL) {
+ c= text->curc-marker->start;
+ s= text->selc-marker->start;
+ if (s<0 || s>marker->end-marker->start) return 0;
+
+ mrk= txt_next_marker(text, marker);
+ while (mrk) {
+ nxt=txt_next_marker(text, mrk); /* mrk may become invalid */
+ txt_move_to(text, mrk->lineno, mrk->start+c, 0);
+ if (s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
+ if (st->overwrite) {
+ if (txt_replace_char(text, ascii))
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
+ } else {
+ if (txt_add_char(text, ascii)) {
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
+ }
+ }
+
+ if (mrk==marker || mrk==nxt) break;
+ mrk=nxt;
+ }
+ swallow= 1;
+ draw= 1;
+ }
+ } else if (val) {
+ switch(evnt) {
+ case BACKSPACEKEY:
+ if (marker->flags & TMARK_EDITALL) {
+ c= text->curc-marker->start;
+ s= text->selc-marker->start;
+ if (s<0 || s>marker->end-marker->start) return 0;
+
+ mrk= txt_next_marker(text, marker);
+ while (mrk) {
+ nxt= txt_next_marker(text, mrk); /* mrk may become invalid */
+ txt_move_to(text, mrk->lineno, mrk->start+c, 0);
+ if (s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
+ txt_backspace_char(text);
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
+ if (mrk==marker || mrk==nxt) break;
+ mrk= nxt;
+ }
+ swallow= 1;
+ draw= 1;
+ }
+ break;
+ case DELKEY:
+ if (marker->flags & TMARK_EDITALL) {
+ c= text->curc-marker->start;
+ s= text->selc-marker->start;
+ if (s<0 || s>marker->end-marker->start) return 0;
+
+ mrk= txt_next_marker(text, marker);
+ while (mrk) {
+ nxt= txt_next_marker(text, mrk); /* mrk may become invalid */
+ txt_move_to(text, mrk->lineno, mrk->start+c, 0);
+ if (s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
+ txt_delete_char(text);
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
+ if (mrk==marker || mrk==nxt) break;
+ mrk= nxt;
+ }
+ swallow= 1;
+ draw= 1;
+ }
+ break;
+ case TABKEY:
+ if (G.qual & LR_SHIFTKEY) {
+ nxt= marker->prev;
+ if (!nxt) nxt= text->markers.last;
+ } else {
+ nxt= marker->next;
+ if (!nxt) nxt= text->markers.first;
+ }
+ if (marker->flags & TMARK_TEMP) {
+ if (nxt==marker) nxt= NULL;
+ BLI_freelinkN(&text->markers, marker);
+ }
+ mrk= nxt;
+ if (mrk) {
+ txt_move_to(text, mrk->lineno, mrk->start, 0);
+ txt_move_to(text, mrk->lineno, mrk->end, 1);
+ pop_space_text(st);
+ }
+ swallow= 1;
+ draw= 1;
+ break;
+
+ /* Events that should clear markers */
+ case UKEY: if (!(G.qual & LR_ALTKEY)) break;
+ case ZKEY: if (evnt==ZKEY && !(G.qual & LR_CTRLKEY)) break;
+ case RETKEY:
+ case ESCKEY:
+ if (marker->flags & (TMARK_EDITALL | TMARK_TEMP))
+ txt_clear_markers(text, marker->group, 0);
+ else
+ BLI_freelinkN(&text->markers, marker);
+ swallow= 1;
+ draw= 1;
+ break;
+ case RIGHTMOUSE: /* Marker context menu? */
+ case LEFTMOUSE:
+ break;
+ case FKEY: /* Allow find */
+ if (G.qual & LR_SHIFTKEY) swallow= 1;
+ break;
+
+ default:
+ if (G.qual!=0 && G.qual!=LR_SHIFTKEY)
+ swallow= 1; /* Swallow all other shortcut events */
+ }
+ }
+
+ if (draw) {
+ ScrArea *sa;
+
+ for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
+ SpaceText *st= sa->spacedata.first;
+
+ if (st && st->spacetype==SPACE_TEXT) {
+ scrarea_queue_redraw(sa);
+ }
+ }
+ }
+ return swallow;
+}
+
+static short do_modification_check(SpaceText *st) {
+ Text *text= st->text;
+
+ if (last_check_time < PIL_check_seconds_timer() - 2.0) {
+ switch (txt_file_modified(text)) {
+ case 1:
+ /* Modified locally and externally, ahhh. Offer more possibilites. */
+ if (text->flags & TXT_ISDIRTY) {
+ switch (pupmenu("File Modified Outside and Inside Blender %t|Load outside changes (ignore local changes) %x0|Save local changes (ignore outside changes) %x1|Make text internal (separate copy) %x2")) {
+ case 0:
+ reopen_text(text);
+ if (st->showsyntax) txt_format_text(st);
+ return 1;
+ case 1:
+ txt_write_file(text);
+ return 1;
+ case 2:
+ text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
+ MEM_freeN(text->name);
+ text->name= NULL;
+ return 1;
+ }
+ } else {
+ switch (pupmenu("File Modified Outside Blender %t|Reload from disk %x0|Make text internal (separate copy) %x1|Ignore %x2")) {
+ case 0:
+ reopen_text(text);
+ if (st->showsyntax) txt_format_text(st);
+ return 1;
+ case 1:
+ text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
+ MEM_freeN(text->name);
+ text->name= NULL;
+ return 1;
+ case 2:
+ txt_ignore_modified(text);
+ return 1;
+ }
+ }
+ break;
+ case 2:
+ switch (pupmenu("File Deleted Outside Blender %t|Make text internal %x0|Recreate file %x1")) {
+ case 0:
+ text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
+ MEM_freeN(text->name);
+ text->name= NULL;
+ return 1;
+ case 1:
+ txt_write_file(text);
+ return 1;
+ }
+ break;
+ default:
+ break;
+ }
+ last_check_time = PIL_check_seconds_timer();
+ }
+ return 0;
+}
+
void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{
unsigned short event= evt->event;
@@ -1528,8 +2771,16 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
return;
}
+
+ if (val && uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING) event= 0;
+
+ if (st->doplugins && do_texttools(st, ascii, event, val)) return;
+ if (do_markers(st, ascii, event, val)) return;
- if (event==LEFTMOUSE) {
+ if (event==UI_BUT_EVENT) {
+ do_find_buttons(val);
+ do_draw= 1;
+ } else if (event==LEFTMOUSE) {
if (val) {
short mval[2];
char *buffer;
@@ -1550,20 +2801,20 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
} else if (event==MIDDLEMOUSE) {
if (val) {
- if (U.uiflag & USER_MMB_PASTE)
- {
+ if (U.uiflag & USER_MMB_PASTE) {
do_selection(st, G.qual&LR_SHIFTKEY);
get_selection_buffer(text);
do_draw= 1;
- }
- else
- {
+ } else {
do_textscroll(st, 1);
}
}
} else if (event==RIGHTMOUSE) {
if (val) {
- p= pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3|Execute Script%x4");
+ if (txt_has_sel(text))
+ p= pupmenu("Text %t|Cut%x10|Copy%x11|Paste%x12|New %x0|Open... %x1|Save %x2|Save As...%x3|Execute Script%x4");
+ else
+ p= pupmenu("Text %t|Paste%x12|New %x0|Open... %x1|Save %x2|Save As...%x3|Execute Script%x4");
switch(p) {
case 0:
@@ -1589,13 +2840,48 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
run_python_script(st);
do_draw= 1;
break;
- default:
+ case 10:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
+ txt_copy_clipboard(text);
+ txt_cut_sel(text);
+ pop_space_text(st);
+ do_draw= 1;
+ break;
+ case 11:
+ //txt_copy_sel(text);
+ txt_copy_clipboard(text);
+ break;
+ case 12:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
+ txt_paste_clipboard(text);
+ if (st->showsyntax) txt_format_text(st);
+ do_draw= 1;
break;
}
}
} else if (ascii) {
- if (txt_add_char(text, ascii)) {
- if (st->showsyntax) get_format_string(st);
+ if (text && text->id.lib) {
+ error_libdata();
+ } else {
+ short mval[2];
+ getmouseco_areawin(mval);
+ if (st->showlinenrs && mval[0]>2 && mval[0]<60 && mval[1]>2 && mval[1]<curarea->winy-2) {
+ if (ascii>='0' && ascii<='9') {
+ double time = PIL_check_seconds_timer();
+ if (last_jump < time-1) jump_to= 0;
+ jump_to *= 10; jump_to += (int)(ascii-'0');
+ txt_move_toline(text, jump_to-1, 0);
+ last_jump= time;
+ }
+ } else if ((st->overwrite && txt_replace_char(text, ascii)) || txt_add_char(text, ascii)) {
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
+ }
pop_space_text(st);
do_draw= 1;
}
@@ -1622,16 +2908,20 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
break; /* BREAK C */
case DKEY:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
//uncommenting
txt_order_cursors(text);
uncomment(text);
do_draw = 1;
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
break;
} else if (G.qual == LR_CTRLKEY) {
txt_delete_char(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
do_draw= 1;
pop_space_text(st);
}
@@ -1640,6 +2930,10 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
switch(pupmenu("Edit %t|Cut %x0|Copy %x1|Paste %x2|Print Cut Buffer %x3")) {
case 0:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
txt_copy_clipboard(text); //First copy to clipboard
txt_cut_sel(text);
do_draw= 1;
@@ -1650,9 +2944,13 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
do_draw= 1;
break;
case 2:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
//txt_paste(text);
txt_paste_clipboard(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
do_draw= 1;
break;
case 3:
@@ -1687,17 +2985,17 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
}
}
- else if (G.qual == LR_ALTKEY) {
- if (txt_has_sel(text)) {
- txt_find_panel(st,0);
- do_draw= 1;
- }
- }
- else if (G.qual == (LR_ALTKEY|LR_CTRLKEY)) { /* always search button */
- txt_find_panel(st,1);
+ else if (G.qual & (LR_ALTKEY|LR_CTRLKEY)) {
+ find_and_replace(st, 0);
do_draw= 1;
}
break; /* BREAK F */
+ case HKEY:
+ if (G.qual & (LR_ALTKEY|LR_CTRLKEY)) {
+ find_and_replace(st, 1);
+ do_draw= 1;
+ }
+ break; /* BREAK H */
case JKEY:
if (G.qual == LR_ALTKEY) {
do_draw= jumptoline_interactive(st);
@@ -1706,7 +3004,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case MKEY:
if (G.qual == LR_ALTKEY) {
txt_export_to_object(text);
- do_draw= 1;
+ do_draw= 1;
}
break; /* BREAK M */
case NKEY:
@@ -1716,7 +3014,6 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
-
}
break; /* BREAK N */
case OKEY:
@@ -1740,7 +3037,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (okee("Reopen text")) {
if (!reopen_text(text))
error("Could not reopen file");
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
}
do_draw= 1;
}
@@ -1780,11 +3077,13 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
//txt_print_undo(text); //debug buffer in console
if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
txt_do_redo(text);
+ pop_space_text(st);
do_draw= 1;
}
if (G.qual == LR_ALTKEY) {
txt_do_undo(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
+ pop_space_text(st);
do_draw= 1;
}
break; /* BREAK U */
@@ -1813,20 +3112,28 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
/* Support for both Alt-V and Ctrl-V for Paste, for backward compatibility reasons */
else if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) {
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
/* Throwing in the Shift modifier Paste from the OS clipboard */
if (G.qual & LR_SHIFTKEY)
txt_paste_clipboard(text);
else
txt_paste_clipboard(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
do_draw= 1;
pop_space_text(st);
}
break; /* BREAK V */
case XKEY:
if (G.qual == LR_ALTKEY || G.qual == LR_CTRLKEY) {
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
txt_cut_sel(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
do_draw= 1;
pop_space_text(st);
}
@@ -1838,31 +3145,40 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} else {
txt_do_undo(text);
}
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
+ pop_space_text(st);
do_draw= 1;
}
break;
case TABKEY:
- if (G.qual & LR_SHIFTKEY) {
- if (txt_has_sel(text)) {
- txt_order_cursors(text);
- unindent(text);
-
- }
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
} else {
- if ( txt_has_sel(text)) {
- txt_order_cursors(text);
- indent(text);
+ if (txt_has_sel(text)) {
+ if (G.qual & LR_SHIFTKEY) {
+ txt_order_cursors(text);
+ unindent(text);
+ if (st->showsyntax) txt_format_text(st);
+ } else {
+ txt_order_cursors(text);
+ indent(text);
+ if (st->showsyntax) txt_format_text(st);
+ }
} else {
txt_add_char(text, '\t');
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
}
}
- if (st->showsyntax) get_format_string(st);
pop_space_text(st);
do_draw= 1;
st->currtab_set = setcurr_tab(text);
break;
case RETKEY:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
//double check tabs before splitting the line
st->currtab_set = setcurr_tab(text);
txt_split_curline(text);
@@ -1876,33 +3192,52 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
}
}
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) {
+ if (text->curl->prev) txt_format_line(st, text->curl->prev, 0);
+ txt_format_line(st, text->curl, 1);
+ }
do_draw= 1;
pop_space_text(st);
break;
case BACKSPACEKEY:
- txt_backspace_char(text);
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
+ if (G.qual & (LR_ALTKEY | LR_CTRLKEY)) {
+ txt_backspace_word(text);
+ } else {
+ txt_backspace_char(text);
+ }
set_tabs(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
do_draw= 1;
pop_space_text(st);
break;
case DELKEY:
- txt_delete_char(text);
- if (st->showsyntax) get_format_string(st);
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
+ if (G.qual & (LR_ALTKEY | LR_CTRLKEY)) {
+ txt_delete_word(text);
+ } else {
+ txt_delete_char(text);
+ }
+ if (st->showsyntax) txt_format_line(st, text->curl, 1);
do_draw= 1;
pop_space_text(st);
st->currtab_set = setcurr_tab(text);
break;
- case DOWNARROWKEY:
- txt_move_down(text, G.qual & LR_SHIFTKEY);
- set_tabs(text);
+ case INSERTKEY:
+ st->overwrite= !st->overwrite;
do_draw= 1;
- pop_space_text(st);
break;
case LEFTARROWKEY:
if (G.qual & LR_COMMANDKEY)
txt_move_bol(text, G.qual & LR_SHIFTKEY);
+ else if (G.qual & LR_ALTKEY)
+ txt_jump_left(text, G.qual & LR_SHIFTKEY);
else
txt_move_left(text, G.qual & LR_SHIFTKEY);
set_tabs(text);
@@ -1912,6 +3247,8 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case RIGHTARROWKEY:
if (G.qual & LR_COMMANDKEY)
txt_move_eol(text, G.qual & LR_SHIFTKEY);
+ else if (G.qual & LR_ALTKEY)
+ txt_jump_right(text, G.qual & LR_SHIFTKEY);
else
txt_move_right(text, G.qual & LR_SHIFTKEY);
set_tabs(text);
@@ -1919,26 +3256,38 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
pop_space_text(st);
break;
case UPARROWKEY:
- txt_move_up(text, G.qual & LR_SHIFTKEY);
+ if (st->wordwrap) wrap_move_up(st, G.qual & LR_SHIFTKEY);
+ else txt_move_up(text, G.qual & LR_SHIFTKEY);
+ set_tabs(text);
+ do_draw= 1;
+ pop_space_text(st);
+ break;
+ case DOWNARROWKEY:
+ if (st->wordwrap) wrap_move_down(st, G.qual & LR_SHIFTKEY);
+ else txt_move_down(text, G.qual & LR_SHIFTKEY);
set_tabs(text);
do_draw= 1;
pop_space_text(st);
break;
case PAGEDOWNKEY:
- screen_skip(st, st->viewlines);
+ cursor_skip(st, st->viewlines, G.qual & LR_SHIFTKEY);
+ pop_space_text(st);
do_draw= 1;
break;
case PAGEUPKEY:
- screen_skip(st, -st->viewlines);
+ cursor_skip(st, -st->viewlines, G.qual & LR_SHIFTKEY);
+ pop_space_text(st);
do_draw= 1;
break;
case HOMEKEY:
- txt_move_bol(text, G.qual & LR_SHIFTKEY);
+ if (st->wordwrap) wrap_move_bol(st, G.qual & LR_SHIFTKEY);
+ else txt_move_bol(text, G.qual & LR_SHIFTKEY);
do_draw= 1;
pop_space_text(st);
break;
case ENDKEY:
- txt_move_eol(text, G.qual & LR_SHIFTKEY);
+ if (st->wordwrap) wrap_move_eol(st, G.qual & LR_SHIFTKEY);
+ else txt_move_eol(text, G.qual & LR_SHIFTKEY);
do_draw= 1;
pop_space_text(st);
break;
@@ -1953,6 +3302,15 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
}
+ /* Run text plugin scripts if enabled */
+ if (st->doplugins && event && val) {
+ if (BPY_menu_do_shortcut(PYMENU_TEXTPLUGIN, event, G.qual)) {
+ do_draw= 1;
+ }
+ }
+
+ if (do_modification_check(st)) do_draw= 1;
+
if (do_draw) {
ScrArea *sa;
@@ -1966,179 +3324,150 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
}
-void do_brackets(void)
+void draw_brackets(SpaceText *st)
{
- SpaceText *st = curarea->spacedata.first;
+ char ch;
+ int b, c, startc, endc, find, stack;
+ int viewc, viewl, offl, offc, x, y;
+ TextLine *startl, *endl, *linep;
Text *text = st->text;
- TextLine *tmp, *start;
- char test[2];
- int d, pos, open, x, y, x2, y2, h=0;
-
- if(!text) return;
-
- tmp = text->curl;
- start = text->curl;
-
- test[0] = (unsigned char) tmp->line[text->curc];
- test[1] = '\0';
-
- d = check_bracket(test);
- if (!d) /* If not pri char */
- {
- test[0] = (unsigned char) tmp->line[text->curc-1];
- test[1] = '\0';
- d = check_bracket(test);
- if(!d) {
- return; /*If the current char or prev is not a bracket then return*/
- } else { /* current char */
- h= txt_get_span(text->lines.first, start) - st->top;
- x = text_draw(st, start->line, st->left, text->curc-1, 0, 0, 0, NULL);
- y = text_draw(st, start->line, st->left, text->curc, 0, 0, 0, NULL);
- if (d < 4) {
- pos = text->curc;
- } else {
- pos = text->curc-2;
- }
- }
- } else { /* is pri char */
- h= txt_get_span(text->lines.first, start) - st->top;
- x = text_draw(st, start->line, st->left, text->curc, 0, 0, 0, NULL);
- y = text_draw(st, start->line, st->left, text->curc+1, 0, 0, 0, NULL);
- if (d < 4) {
- pos = text->curc+1;
- } else {
- pos = text->curc-1;
- }
- }
-
- if (d < 4) /*reading forward*/
- {
- open = 1;
- while ( tmp ) {
- while (pos <= tmp->len) {
- test[0] = (unsigned char) tmp->line[pos];
- test[1] = '\0';
- if(check_bracket(test) == d) {
- open++;
- } else if (check_bracket(test) == d+3) {
- open--;
- if (open == 0) {
- BIF_ThemeColorBlend(TH_BACK, TH_SHADE2, 0.5);
- glRecti(x, curarea->winy-st->lheight*(h)-2, y, curarea->winy-st->lheight*(h+1)-2);
-
- h= txt_get_span(text->lines.first, tmp) - st->top;
- x2= text_draw(st, tmp->line, st->left, pos, 0, 0, 0, NULL);
- y2= text_draw(st, tmp->line, st->left, pos+1, 0, 0, 0, NULL);
- glRecti(x2, curarea->winy-st->lheight*(h)-2, y2, curarea->winy-st->lheight*(h+1)-2);
- BIF_ThemeColor(TH_TEXT);
- return;
+
+ if (!text || !text->curl) return;
+
+ startl= text->curl;
+ startc= text->curc;
+ b= check_bracket(startl->line[startc]);
+ if (b==0 && startc>0) b = check_bracket(startl->line[--startc]);
+ if (b==0) return;
+
+ linep= startl;
+ c= startc;
+ endl= NULL;
+ endc= -1;
+ find= -b;
+ stack= 0;
+
+ /* Opening bracket, search forward for close */
+ if (b>0) {
+ c++;
+ while (linep) {
+ while (c<linep->len) {
+ b= check_bracket(linep->line[c]);
+ if (b==find) {
+ if (stack==0) {
+ endl= linep;
+ endc= c;
+ break;
}
+ stack--;
+ } else if (b==-find) {
+ stack++;
}
- pos++;
+ c++;
}
- tmp = tmp->next;
- pos = 0;
+ if (endl) break;
+ linep= linep->next;
+ c= 0;
}
- } else { /* reading back */
- open = 1;
- while ( tmp ) {
- while (pos >= 0) {
- test[0] = (unsigned char) tmp->line[pos];
- test[1] = '\0';
- if(check_bracket(test) == d) {
- open++;
- } else if (check_bracket(test) == d-3) {
- open--;
- if (open == 0) {
- BIF_ThemeColorBlend(TH_BACK, TH_SHADE2, 0.5);
- glRecti(x, curarea->winy-st->lheight*(h)-2, y, curarea->winy-st->lheight*(h+1)-2);
-
- h= txt_get_span(text->lines.first, tmp) - st->top;
- x2= text_draw(st, tmp->line, st->left, pos, 0, 0, 0, NULL);
- y2= text_draw(st, tmp->line, st->left, pos+1, 0, 0, 0, NULL);
- glRecti(x2, curarea->winy-st->lheight*(h)-2, y2, curarea->winy-st->lheight*(h+1)-2);
- BIF_ThemeColor(TH_TEXT);
- return;
+ }
+ /* Closing bracket, search backward for open */
+ else {
+ c--;
+ while (linep) {
+ while (c>=0) {
+ b= check_bracket(linep->line[c]);
+ if (b==find) {
+ if (stack==0) {
+ endl= linep;
+ endc= c;
+ break;
}
+ stack--;
+ } else if (b==-find) {
+ stack++;
}
- pos--;
- }
- tmp = tmp->prev;
- if (tmp) {
- pos = tmp->len;
+ c--;
}
+ if (endl) break;
+ linep= linep->prev;
+ if (linep) c= linep->len-1;
}
}
-
+
+ if (!endl || endc==-1) return;
+
+ BIF_ThemeColor(TH_HILITE);
+ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
+ y= curarea->winy - st->lheight;
+
+ ch= startl->line[startc];
+ wrap_offset(st, startl, startc, &offl, &offc);
+ viewc= get_char_pos(st, startl->line, startc) - st->left + offc;
+ if (viewc >= 0){
+ viewl= txt_get_span(text->lines.first, startl) - st->top + offl;
+ glRasterPos2i(x+viewc*spacetext_get_fontwidth(st), y-viewl*st->lheight);
+ BMF_DrawCharacter(spacetext_get_font(st), ch);
+ glRasterPos2i(x+viewc*spacetext_get_fontwidth(st)+1, y-viewl*st->lheight);
+ BMF_DrawCharacter(spacetext_get_font(st), ch);
+ }
+ ch= endl->line[endc];
+ wrap_offset(st, endl, endc, &offl, &offc);
+ viewc= get_char_pos(st, endl->line, endc) - st->left + offc;
+ if (viewc >= 0) {
+ viewl= txt_get_span(text->lines.first, endl) - st->top + offl;
+ glRasterPos2i(x+viewc*spacetext_get_fontwidth(st), y-viewl*st->lheight);
+ BMF_DrawCharacter(spacetext_get_font(st), ch);
+ glRasterPos2i(x+viewc*spacetext_get_fontwidth(st)+1, y-viewl*st->lheight);
+ BMF_DrawCharacter(spacetext_get_font(st), ch);
+ }
}
-int check_bracket(char *string)
+static int check_bracket(char ch)
{
- int number, a = 0;
- char other[][3] = {"(", "[", "{", ")", "]", "}"};
-
- number = 6;
+ int a;
+ char opens[] = "([{";
+ char close[] = ")]}";
- while(a < number) {
- if(strcmp(other[a], string) == 0)
- {
+ for (a=0; a<3; a++) {
+ if(ch==opens[a])
return a+1;
- }
- a++;
+ else if (ch==close[a])
+ return -(a+1);
}
return 0;
}
-static int check_builtinfuncs(char *string)
+static int check_delim(char ch)
{
- int number = 30, a = 0;
+ int a;
+ char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,";
- char builtinfuncs[][11] = {"and", "as", "assert", "break", "class", "continue", "def",
- "del", "elif", "else", "except", "exec", "finally",
- "for", "from", "global", "if", "import", "in",
- "is", "lambda", "not", "or", "pass", "print",
- "raise", "return", "try", "while", "yield"};
-
- for( a = 0; a < number; a++) {
- if(!strcmp(builtinfuncs[a], string))
+ for (a=0; a<28; a++) {
+ if (ch==delims[a])
return 1;
}
return 0;
}
-static int check_specialvars(char *string)
-{
- int number = 2, a = 0;
- char specialvars[][7] = {"def", "class"};
-
- for( a = 0; a < number; a++) {
- if(!strcmp(specialvars[a], string))
- return a+1;
- }
+static int check_digit(char ch) {
+ if (ch < '0') return 0;
+ if (ch <= '9') return 1;
return 0;
}
-static int check_delim(char *string)
-{
- int number = 28, a = 0;
- char other[][3] = {"(", ")", ":", "\"", "\'", " ", "~", "!", "%", "^", "&", "*", "-", "+", "=", "[", "]", "{", "}", ";", "/", "<", ">", "|", ".", "#", "\t", ","};
-
- for( a = 0; a < number; a++) {
- if(!strcmp(other[a], string))
- return 1;
- }
+static int check_identifier(char ch) {
+ if (ch < '0') return 0;
+ if (ch <= '9') return 1;
+ if (ch < 'A') return 0;
+ if (ch <= 'Z' || ch == '_') return 1;
+ if (ch < 'a') return 0;
+ if (ch <= 'z') return 1;
return 0;
}
-static int check_numbers(char *string)
-{
- int number = 10, a = 0;
- char other[][2] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
-
- for( a = 0; a < number; a++) {
- if(!strcmp(other[a], string))
- return 1;
- }
+static int check_whitespace(char ch) {
+ if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n')
+ return 1;
return 0;
}
@@ -2146,7 +3475,7 @@ void convert_tabs (struct SpaceText *st, int tab)
{
Text *text = st->text;
TextLine *tmp;
- char *check_line, *new_line, *format;
+ char *check_line, *new_line;
int extra, number; //unknown for now
size_t a, j;
@@ -2158,7 +3487,6 @@ void convert_tabs (struct SpaceText *st, int tab)
while(tmp) {
check_line = tmp->line;
new_line = MEM_mallocN(render_string(st, check_line)+1, "Converted_Line");
- format = MEM_mallocN(render_string(st, check_line)+1, "Converted_Syntax_format");
j = 0;
for (a=0; a < strlen(check_line); a++) { //foreach char in line
if(check_line[a] == '\t') { //checking for tabs
@@ -2185,7 +3513,7 @@ void convert_tabs (struct SpaceText *st, int tab)
tmp->line = new_line;
tmp->len = strlen(new_line);
- tmp->format = format;
+ tmp->format = NULL;
tmp = tmp->next;
}
@@ -2213,7 +3541,6 @@ void convert_tabs (struct SpaceText *st, int tab)
if ( extra > 0 ) { //got tabs make malloc and do what you have to do
new_line = MEM_mallocN(strlen(check_line)-(((st->tabnumber*extra)-extra)-1), "Converted_Line");
- format = MEM_mallocN(strlen(check_line)-(((st->tabnumber*extra)-extra)-1), "Converted_Syntax_format");
extra = 0; //reuse vars
for (a = 0; a < strlen(check_line); a++) {
number = 0;
@@ -2241,9 +3568,11 @@ void convert_tabs (struct SpaceText *st, int tab)
tmp->line = new_line;
tmp->len = strlen(new_line);
- tmp->format = format;
+ tmp->format = NULL;
}
tmp = tmp->next;
}
}
+
+ if (st->showsyntax) txt_format_text(st);
}
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index 14434504e7a..42576c901d7 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -64,6 +64,7 @@
#include "DNA_gpencil_types.h"
#include "DNA_image_types.h"
#include "DNA_key_types.h"
+#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -134,6 +135,7 @@
#include "BIF_verse.h"
#endif
+#include "BDR_drawaction.h"
#include "BDR_drawmesh.h"
#include "BDR_drawobject.h"
#include "BDR_editobject.h"
@@ -162,6 +164,9 @@
#include "RE_pipeline.h" // make_stars
+#include "GPU_draw.h"
+#include "GPU_material.h"
+
#include "multires.h"
/* For MULTISAMPLE_ARB #define.
@@ -193,132 +198,6 @@ static void star_stuff_term_func(void)
glEnd();
}
-void default_gl_light(void)
-{
- int a;
-
- /* initialize */
- if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
- U.light[0].flag= 1;
- U.light[0].vec[0]= -0.3; U.light[0].vec[1]= 0.3; U.light[0].vec[2]= 0.9;
- U.light[0].col[0]= 0.8; U.light[0].col[1]= 0.8; U.light[0].col[2]= 0.8;
- U.light[0].spec[0]= 0.5; U.light[0].spec[1]= 0.5; U.light[0].spec[2]= 0.5;
- U.light[0].spec[3]= 1.0;
-
- U.light[1].flag= 0;
- U.light[1].vec[0]= 0.5; U.light[1].vec[1]= 0.5; U.light[1].vec[2]= 0.1;
- U.light[1].col[0]= 0.4; U.light[1].col[1]= 0.4; U.light[1].col[2]= 0.8;
- U.light[1].spec[0]= 0.3; U.light[1].spec[1]= 0.3; U.light[1].spec[2]= 0.5;
- U.light[1].spec[3]= 1.0;
-
- U.light[2].flag= 0;
- U.light[2].vec[0]= 0.3; U.light[2].vec[1]= -0.3; U.light[2].vec[2]= -0.2;
- U.light[2].col[0]= 0.8; U.light[2].col[1]= 0.5; U.light[2].col[2]= 0.4;
- U.light[2].spec[0]= 0.5; U.light[2].spec[1]= 0.4; U.light[2].spec[2]= 0.3;
- U.light[2].spec[3]= 1.0;
- }
-
-
- glLightfv(GL_LIGHT0, GL_POSITION, U.light[0].vec);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, U.light[0].col);
- glLightfv(GL_LIGHT0, GL_SPECULAR, U.light[0].spec);
-
- glLightfv(GL_LIGHT1, GL_POSITION, U.light[1].vec);
- glLightfv(GL_LIGHT1, GL_DIFFUSE, U.light[1].col);
- glLightfv(GL_LIGHT1, GL_SPECULAR, U.light[1].spec);
-
- glLightfv(GL_LIGHT2, GL_POSITION, U.light[2].vec);
- glLightfv(GL_LIGHT2, GL_DIFFUSE, U.light[2].col);
- glLightfv(GL_LIGHT2, GL_SPECULAR, U.light[2].spec);
-
- for(a=0; a<8; a++) {
- if(a<3) {
- if(U.light[a].flag) glEnable(GL_LIGHT0+a);
- else glDisable(GL_LIGHT0+a);
-
- // clear stuff from other opengl lamp usage
- glLightf(GL_LIGHT0+a, GL_SPOT_CUTOFF, 180.0);
- glLightf(GL_LIGHT0+a, GL_CONSTANT_ATTENUATION, 1.0);
- glLightf(GL_LIGHT0+a, GL_LINEAR_ATTENUATION, 0.0);
- }
- else glDisable(GL_LIGHT0+a);
- }
-
- glDisable(GL_LIGHTING);
-
- glDisable(GL_COLOR_MATERIAL);
-}
-
-/* also called when render 'ogl'
- keep synced with Myinit_gl_stuff in the game engine! */
-void init_gl_stuff(void)
-{
- float mat_ambient[] = { 0.0, 0.0, 0.0, 0.0 };
- float mat_specular[] = { 0.5, 0.5, 0.5, 1.0 };
- float mat_shininess[] = { 35.0 };
- int a, x, y;
- GLubyte pat[32*32];
- const GLubyte *patc= pat;
-
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_specular);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
-
- default_gl_light();
-
- /* no local viewer, looks ugly in ortho mode */
- /* glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, &one); */
-
- glDepthFunc(GL_LEQUAL);
- /* scaling matrices */
- glEnable(GL_NORMALIZE);
-
- glShadeModel(GL_FLAT);
-
- glDisable(GL_ALPHA_TEST);
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_FOG);
- glDisable(GL_LIGHTING);
- glDisable(GL_LOGIC_OP);
- glDisable(GL_STENCIL_TEST);
- glDisable(GL_TEXTURE_1D);
- glDisable(GL_TEXTURE_2D);
-
- /* default on, disable/enable should be local per function */
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
- glPixelTransferi(GL_RED_SCALE, 1);
- glPixelTransferi(GL_RED_BIAS, 0);
- glPixelTransferi(GL_GREEN_SCALE, 1);
- glPixelTransferi(GL_GREEN_BIAS, 0);
- glPixelTransferi(GL_BLUE_SCALE, 1);
- glPixelTransferi(GL_BLUE_BIAS, 0);
- glPixelTransferi(GL_ALPHA_SCALE, 1);
- glPixelTransferi(GL_ALPHA_BIAS, 0);
-
- glPixelTransferi(GL_DEPTH_BIAS, 0);
- glPixelTransferi(GL_DEPTH_SCALE, 1);
- glDepthRange(0.0, 1.0);
-
- a= 0;
- for(x=0; x<32; x++) {
- for(y=0; y<4; y++) {
- if( (x) & 1) pat[a++]= 0x88;
- else pat[a++]= 0x22;
- }
- }
-
- glPolygonStipple(patc);
-
-
- init_realtime_GL();
-}
-
void circf(float x, float y, float rad)
{
GLUquadricObj *qobj = gluNewQuadric();
@@ -1329,60 +1208,196 @@ void drawname(Object *ob)
BMF_DrawString(G.font, ob->id.name+2);
}
-
-static void draw_selected_name(Object *ob)
+static char *get_cfra_marker_name()
{
- char info[128];
- short offset=30;
+ ListBase *markers= &G.scene->markers;
+ TimeMarker *m1, *m2;
+
+ /* search through markers for match */
+ for (m1=markers->first, m2=markers->last; m1 && m2; m1=m1->next, m2=m2->prev) {
+ if (m1->frame==CFRA)
+ return m1->name;
+ if (m2->frame==CFRA)
+ return m2->name;
+
+ if (m1 == m2)
+ break;
+ }
+
+ return NULL;
+}
- if(ob->type==OB_ARMATURE) {
- bArmature *arm= ob->data;
- char *name= NULL;
+// TODO: move this func into some keyframing API
+short ob_cfra_has_keyframe (Object *ob)
+{
+ // fixme... this is slow!
+ if (ob) {
+ ListBase keys = {NULL, NULL};
+ ActKeyColumn *ak, *akn;
+ Key *key= ob_get_key(ob);
+ int cfra, found= 0;
- if(ob==G.obedit) {
- EditBone *ebo;
- for (ebo=G.edbo.first; ebo; ebo=ebo->next){
- if ((ebo->flag & BONE_ACTIVE) && (ebo->layer & arm->layer)) {
- name= ebo->name;
+ /* check active action */
+ if (ob->action) {
+ /* get keyframes of action */
+ action_to_keylist(ob->action, &keys, NULL, NULL);
+
+ cfra= frame_to_float(CFRA);
+ cfra= get_action_frame(ob, cfra);
+
+ /* check if a keyframe occurs on current frame */
+ for (ak=keys.first, akn=keys.last; ak && akn; ak=ak->next, akn=akn->prev) {
+ if (cfra == ak->cfra) {
+ found= 1;
break;
}
+ else if (cfra == akn->cfra) {
+ found= 1;
+ break;
+ }
+
+ if (ak == akn)
+ break;
}
+
+ /* free temp list */
+ BLI_freelistN(&keys);
+ keys.first= keys.last= NULL;
+
+ /* return if found */
+ if (found) return 1;
}
- else if(ob->pose && (ob->flag & OB_POSEMODE)) {
- bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) {
- name= pchan->name;
+
+ /* accumulate keyframes for available ipo's */
+ if (ob->ipo)
+ ipo_to_keylist(ob->ipo, &keys, NULL, NULL);
+ if (key)
+ ipo_to_keylist(key->ipo, &keys, NULL, NULL);
+
+ if (keys.first) {
+ cfra= frame_to_float(CFRA);
+ found= 0;
+
+ /* check if a keyframe occurs on current frame */
+ for (ak=keys.first, akn=keys.last; ak && akn; ak=ak->next, akn=akn->prev) {
+ if (IS_EQ(cfra, ak->cfra)) {
+ found= 1;
break;
}
+ else if (IS_EQ(cfra, akn->cfra)) {
+ found= 1;
+ break;
+ }
+
+ if (ak == akn)
+ break;
}
+
+ /* free temp list */
+ BLI_freelistN(&keys);
+ keys.first= keys.last= NULL;
+
+ /* return if found */
+ if (found) return 1;
}
- if(name)
- sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, name);
- else
- sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
- }
- else if(ob->type==OB_MESH) {
- Key *key= NULL;
- KeyBlock *kb = NULL;
- char shapes[75];
-
- shapes[0] = 0;
- key = ob_get_key(ob);
- if(key){
- kb = BLI_findlink(&key->block, ob->shapenr-1);
- if(kb){
- sprintf(shapes, ": %s ", kb->name);
- if(ob->shapeflag == OB_SHAPE_LOCK){
- sprintf(shapes, "%s (Pinned)",shapes);
+ }
+
+ /* couldn't find a keyframe */
+ return 0;
+}
+
+/* draw info beside axes in bottom left-corner:
+ * framenum, object name, bone name (if available), marker name (if available)
+ */
+static void draw_selected_name(Object *ob)
+{
+ char info[256], *markern;
+ short offset=30;
+
+ /* get name of marker on current frame (if available) */
+ markern= get_cfra_marker_name();
+
+ /* check if there is an object */
+ if(ob) {
+ /* name(s) to display depends on type of object */
+ if(ob->type==OB_ARMATURE) {
+ bArmature *arm= ob->data;
+ char *name= NULL;
+
+ /* show name of active bone too (if possible) */
+ if(ob==G.obedit) {
+ EditBone *ebo;
+ for (ebo=G.edbo.first; ebo; ebo=ebo->next){
+ if ((ebo->flag & BONE_ACTIVE) && (ebo->layer & arm->layer)) {
+ name= ebo->name;
+ break;
+ }
+ }
+ }
+ else if(ob->pose && (ob->flag & OB_POSEMODE)) {
+ bPoseChannel *pchan;
+ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) {
+ name= pchan->name;
+ break;
+ }
+ }
+ }
+ if(name && markern)
+ sprintf(info, "(%d) %s %s <%s>", CFRA, ob->id.name+2, name, markern);
+ else if(name)
+ sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, name);
+ else
+ sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
+ }
+ else if(ELEM3(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) {
+ Key *key= NULL;
+ KeyBlock *kb = NULL;
+ char shapes[75];
+
+ /* try to display active shapekey too */
+ shapes[0] = 0;
+ key = ob_get_key(ob);
+ if(key){
+ kb = BLI_findlink(&key->block, ob->shapenr-1);
+ if(kb){
+ sprintf(shapes, ": %s ", kb->name);
+ if(ob->shapeflag == OB_SHAPE_LOCK){
+ sprintf(shapes, "%s (Pinned)",shapes);
+ }
}
}
+
+ if(markern)
+ sprintf(info, "(%d) %s %s <%s>", CFRA, ob->id.name+2, shapes, markern);
+ else
+ sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, shapes);
}
- sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, shapes);
+ else {
+ /* standard object */
+ if (markern)
+ sprintf(info, "(%d) %s <%s>", CFRA, ob->id.name+2, markern);
+ else
+ sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
+ }
+
+ /* colour depends on whether there is a keyframe */
+ if (ob_cfra_has_keyframe(ob))
+ BIF_ThemeColor(TH_VERTEX_SELECT);
+ else
+ BIF_ThemeColor(TH_TEXT_HI);
}
- else sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
-
- BIF_ThemeColor(TH_TEXT_HI);
+ else {
+ /* no object */
+ if (markern)
+ sprintf(info, "(%d) <%s>", CFRA, markern);
+ else
+ sprintf(info, "(%d)", CFRA);
+
+ /* colour is always white */
+ BIF_ThemeColor(TH_TEXT_HI);
+ }
+
if (U.uiflag & USER_SHOW_ROTVIEWICON)
offset = 14 + (U.rvisize * 2);
@@ -1502,44 +1517,52 @@ static void draw_view_icon(void)
glDisable(GL_BLEND);
}
-static void draw_viewport_name(ScrArea *sa)
+char *view3d_get_name(View3D *v3d)
{
char *name = NULL;
- char *printable = NULL;
- switch(G.vd->view) {
+ switch (v3d->view) {
case 1:
- if (G.vd->persp == V3D_ORTHO)
- name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Ortho" : "Front Ortho";
+ if (v3d->persp == V3D_ORTHO)
+ name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Ortho" : "Front Ortho";
else
- name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Persp" : "Front Persp";
+ name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Persp" : "Front Persp";
break;
case 3:
- if (G.vd->persp == V3D_ORTHO)
- name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Ortho" : "Right Ortho";
+ if (v3d->persp == V3D_ORTHO)
+ name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Ortho" : "Right Ortho";
else
- name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Persp" : "Right Persp";
+ name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Persp" : "Right Persp";
break;
case 7:
- if (G.vd->persp == V3D_ORTHO)
- name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Ortho" : "Top Ortho";
+ if (v3d->persp == V3D_ORTHO)
+ name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Ortho" : "Top Ortho";
else
- name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Persp" : "Top Persp";
+ name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Persp" : "Top Persp";
break;
default:
- if (G.vd->persp==V3D_CAMOB) {
- if ((G.vd->camera) && (G.vd->camera->type == OB_CAMERA)) {
+ if (v3d->persp==V3D_CAMOB) {
+ if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
Camera *cam;
- cam = G.vd->camera->data;
+ cam = v3d->camera->data;
name = (cam->type != CAM_ORTHO) ? "Camera Persp" : "Camera Ortho";
} else {
name = "Object as Camera";
}
} else {
- name = (G.vd->persp == V3D_ORTHO) ? "User Ortho" : "User Persp";
+ name = (v3d->persp == V3D_ORTHO) ? "User Ortho" : "User Persp";
}
+ break;
}
+ return name;
+}
+
+static void draw_viewport_name(ScrArea *sa)
+{
+ char *name = view3d_get_name(sa->spacedata.first);
+ char *printable = NULL;
+
if (G.vd->localview) {
printable = malloc(strlen(name) + strlen(" (Local)_")); /* '_' gives space for '\0' */
strcpy(printable, name);
@@ -1987,6 +2010,8 @@ static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim)
tfp->ob_eul[0]= 180.0*ebone->roll/M_PI;
uiDefButF(block, NUM, B_ARMATUREPANEL1, "Roll:", 10, 100, 140, 19, tfp->ob_eul, -lim, lim, 1000, 3, "");
+ uiDefButBitI(block, TOG, BONE_EDITMODE_LOCKED, REDRAWVIEW3D, "Lock", 160, 100, 140, 19, &(ebone->flag), 0, 0, 0, 0, "Prevents bone from being transformed in edit mode");
+
uiBlockBeginAlign(block);
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailRadius:", 10, 150, 140, 19, &ebone->rad_tail, 0, lim, 10, 3, "");
if (ebone->parent && ebone->flag & BONE_CONNECTED )
@@ -2654,7 +2679,7 @@ static void view3d_panel_gpencil(short cntrl) // VIEW3D_HANDLER_GREASEPENCIL
uiNewPanelHeight(block, 204);
/* draw button for showing gpencil settings and drawings */
- uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View");
+ uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View (draw using Shift-LMB)");
/* extend the panel if the contents won't fit */
newheight= draw_gpencil_panel(block, gpd, curarea);
@@ -2727,7 +2752,7 @@ void add_view3d_after(View3D *v3d, Base *base, int type, int flag)
}
/* clears zbuffer and draws it over */
-static void view3d_draw_xray(View3D *v3d)
+static void view3d_draw_xray(View3D *v3d, int clear)
{
View3DAfter *v3da, *next;
int doit= 0;
@@ -2736,7 +2761,7 @@ static void view3d_draw_xray(View3D *v3d)
if(v3da->type==V3D_XRAY) doit= 1;
if(doit) {
- if(v3d->zbuf) glClear(GL_DEPTH_BUFFER_BIT);
+ if(clear && v3d->zbuf) glClear(GL_DEPTH_BUFFER_BIT);
v3d->xray= TRUE;
for(v3da= v3d->afterdraw.first; v3da; v3da= next) {
@@ -2758,7 +2783,7 @@ static void view3d_draw_transp(View3D *v3d)
glDepthMask(0);
v3d->transp= TRUE;
-
+
for(v3da= v3d->afterdraw.first; v3da; v3da= next) {
next= v3da->next;
if(v3da->type==V3D_TRANSP) {
@@ -2801,7 +2826,8 @@ static void draw_dupli_objects_color(View3D *v3d, Base *base, int color)
tbase.object= dob->ob;
/* extra service: draw the duplicator in drawtype of parent */
- dt= tbase.object->dt; tbase.object->dt= base->object->dt;
+ /* MIN2 for the drawtype to allow bounding box objects in groups for lods */
+ dt= tbase.object->dt; tbase.object->dt= MIN2(tbase.object->dt, base->object->dt);
dtx= tbase.object->dtx; tbase.object->dtx= base->object->dtx;
/* negative scale flag has to propagate */
@@ -2936,7 +2962,7 @@ static void draw_sculpt_depths(View3D *v3d)
}
}
-void draw_depth(ScrArea *sa, void *spacedata)
+void draw_depth(ScrArea *sa, void *spacedata, int (* func)(void *))
{
View3D *v3d= spacedata;
Base *base;
@@ -2976,9 +3002,11 @@ void draw_depth(ScrArea *sa, void *spacedata)
if(G.scene->set) {
for(SETLOOPER(G.scene->set, base)) {
if(v3d->lay & base->lay) {
- draw_object(base, 0);
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects_color(v3d, base, TH_WIRE);
+ if (func == NULL || func(base)) {
+ draw_object(base, 0);
+ if(base->object->transflag & OB_DUPLI) {
+ draw_dupli_objects_color(v3d, base, TH_WIRE);
+ }
}
}
}
@@ -2986,12 +3014,13 @@ void draw_depth(ScrArea *sa, void *spacedata)
for(base= G.scene->base.first; base; base= base->next) {
if(v3d->lay & base->lay) {
-
- /* dupli drawing */
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects(v3d, base);
+ if (func == NULL || func(base)) {
+ /* dupli drawing */
+ if(base->object->transflag & OB_DUPLI) {
+ draw_dupli_objects(v3d, base);
+ }
+ draw_object(base, 0);
}
- draw_object(base, 0);
}
}
@@ -3036,6 +3065,84 @@ void draw_depth(ScrArea *sa, void *spacedata)
static void draw_viewport_fps(ScrArea *sa);
+typedef struct View3DShadow{
+ struct View3DShadow*next, *prev;
+ GPULamp *lamp;
+} View3DShadow;
+
+static void gpu_render_lamp_update(View3D *v3d, Object *ob, Object *par, float obmat[][4], ListBase *shadows)
+{
+ GPULamp *lamp;
+ View3DShadow *shadow;
+
+ lamp = GPU_lamp_from_blender(G.scene, ob, par);
+
+ if(lamp) {
+ GPU_lamp_update(lamp, ob->lay, obmat);
+
+ if((ob->lay & v3d->lay) && GPU_lamp_has_shadow_buffer(lamp)) {
+ shadow= MEM_callocN(sizeof(View3DShadow), "View3DShadow");
+ shadow->lamp = lamp;
+ BLI_addtail(shadows, shadow);
+ }
+ }
+}
+
+static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
+{
+ ListBase shadows;
+ View3DShadow *shadow;
+ Scene *sce;
+ Base *base;
+ Object *ob;
+
+ shadows.first= shadows.last= NULL;
+
+ /* update lamp transform and gather shadow lamps */
+ for(SETLOOPER(G.scene, base)) {
+ ob= base->object;
+
+ if(ob->type == OB_LAMP)
+ gpu_render_lamp_update(v3d, ob, NULL, ob->obmat, &shadows);
+
+ if (ob->transflag & OB_DUPLI) {
+ DupliObject *dob;
+ ListBase *lb = object_duplilist(G.scene, ob);
+
+ for(dob=lb->first; dob; dob=dob->next)
+ if(dob->ob->type==OB_LAMP)
+ gpu_render_lamp_update(v3d, dob->ob, ob, dob->mat, &shadows);
+
+ free_object_duplilist(lb);
+ }
+ }
+
+ /* render shadows after updating all lamps, nested object_duplilist
+ * don't work correct since it's replacing object matrices */
+ for(shadow=shadows.first; shadow; shadow=shadow->next) {
+ /* this needs to be done better .. */
+ float viewmat[4][4], winmat[4][4];
+ int drawtype, lay, winsize, flag2;
+
+ drawtype= v3d->drawtype;
+ lay= v3d->lay;
+ flag2= v3d->flag2 & V3D_SOLID_TEX;
+
+ v3d->drawtype = OB_SOLID;
+ v3d->lay &= GPU_lamp_shadow_layer(shadow->lamp);
+ v3d->flag2 &= ~V3D_SOLID_TEX;
+
+ GPU_lamp_shadow_buffer_bind(shadow->lamp, viewmat, &winsize, winmat);
+ drawview3d_render(v3d, viewmat, winsize, winsize, winmat, 1);
+ GPU_lamp_shadow_buffer_unbind(shadow->lamp);
+
+ v3d->drawtype= drawtype;
+ v3d->lay= lay;
+ v3d->flag2 |= flag2;
+ }
+
+ BLI_freelistN(&shadows);
+}
void drawview3dspace(ScrArea *sa, void *spacedata)
{
@@ -3053,9 +3160,16 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
for(SETLOOPER(G.scene->set, base))
object_handle_update(base->object); // bke_object.h
}
-
- for(base= G.scene->base.first; base; base= base->next)
+
+ v3d->lay_used = 0;
+ for(base= G.scene->base.first; base; base= base->next) {
object_handle_update(base->object); // bke_object.h
+ v3d->lay_used |= base->lay;
+ }
+
+ /* shadow buffers, before we setup matrices */
+ if(draw_glsl_material(NULL, v3d->drawtype))
+ gpu_update_lamps_shadows(G.scene, v3d);
setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */
setviewmatrixview3d(); /* note: calls where_is_object for camera... */
@@ -3198,8 +3312,8 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID);
/* Transp and X-ray afterdraw stuff */
- view3d_draw_xray(v3d); // clears zbuffer if it is used!
view3d_draw_transp(v3d);
+ view3d_draw_xray(v3d, 1); // clears zbuffer if it is used!
if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) {
if(G.f & G_SCULPTMODE)
@@ -3280,7 +3394,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
}
ob= OBACT;
- if(ob && (U.uiflag & USER_DRAWVIEWINFO))
+ if(U.uiflag & USER_DRAWVIEWINFO)
draw_selected_name(ob);
draw_area_emboss(sa);
@@ -3318,18 +3432,29 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
}
-
-void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4])
+void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int winy, float winmat[][4], int shadow)
{
Base *base;
Scene *sce;
- float v3dwinmat[4][4];
+ float v3dviewmat[4][4], v3dwinmat[4][4];
+
+ /* shadow buffers, before we setup matrices */
+ if(!shadow && draw_glsl_material(NULL, v3d->drawtype))
+ gpu_update_lamps_shadows(G.scene, v3d);
if(!winmat)
setwinmatrixview3d(winx, winy, NULL);
- setviewmatrixview3d();
- myloadmatrix(v3d->viewmat);
+ if(viewmat) {
+ Mat4CpyMat4(v3dviewmat, viewmat);
+ Mat4CpyMat4(v3d->viewmat, viewmat);
+ }
+ else {
+ setviewmatrixview3d();
+ Mat4CpyMat4(v3dviewmat, v3d->viewmat);
+ }
+
+ myloadmatrix(v3dviewmat);
/* when winmat is not NULL, it overrides the regular window matrix */
glMatrixMode(GL_PROJECTION);
@@ -3338,12 +3463,14 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4]
mygetmatrix(v3dwinmat);
glMatrixMode(GL_MODELVIEW);
- Mat4MulMat4(v3d->persmat, v3d->viewmat, v3dwinmat);
+ Mat4MulMat4(v3d->persmat, v3dviewmat, v3dwinmat);
Mat4Invert(v3d->persinv, v3d->persmat);
Mat4Invert(v3d->viewinv, v3d->viewmat);
- free_all_realtime_images();
- reshadeall_displist();
+ if(!shadow) {
+ GPU_free_images();
+ reshadeall_displist();
+ }
if(v3d->drawtype > OB_WIRE) {
v3d->zbuf= TRUE;
@@ -3421,8 +3548,8 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4]
if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID);
/* Transp and X-ray afterdraw stuff */
- view3d_draw_xray(v3d); // clears zbuffer if it is used!
view3d_draw_transp(v3d);
+ view3d_draw_xray(v3d, !shadow); // clears zbuffer if it is used!
if(v3d->flag & V3D_CLIPPING)
view3d_clr_clipping();
@@ -3441,11 +3568,12 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4]
G.f &= ~G_SIMULATION;
- glFlush();
+ if(!shadow) {
+ glFlush();
+ GPU_free_images();
+ }
glLoadIdentity();
-
- free_all_realtime_images();
}
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index 3251cb33b53..c454715b1df 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -517,23 +517,43 @@ static void actdata_filter_shapekey (ListBase *act_data, Key *key, int filter_mo
}
}
-static void actdata_filter_gpencil (ListBase *act_data, bGPdata *gpd, int filter_mode)
+
+static void actdata_filter_gpencil (ListBase *act_data, bScreen *sc, int filter_mode)
{
bActListElem *ale;
+ ScrArea *sa;
+ bGPdata *gpd;
bGPDlayer *gpl;
/* check if filtering types are appropriate */
if ( !(filter_mode & (ACTFILTER_IPOKEYS|ACTFILTER_ONLYICU|ACTFILTER_ACTGROUPED)) )
{
- /* loop over layers as the conditions are acceptable */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- /* only if selected */
- if (!(filter_mode & ACTFILTER_SEL) || SEL_GPL(gpl)) {
- /* only if editable */
- if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_GPL(gpl)) {
- /* add to list */
- ale= make_new_actlistelem(gpl, ACTTYPE_GPLAYER, NULL, ACTTYPE_NONE);
- if (ale) BLI_addtail(act_data, ale);
+ /* loop over spaces in current screen, finding gpd blocks (could be slow!) */
+ for (sa= sc->areabase.first; sa; sa= sa->next) {
+ /* try to get gp data */
+ gpd= gpencil_data_getactive(sa);
+ if (gpd == NULL) continue;
+
+ /* add gpd as channel too (if for drawing, and it has layers) */
+ if ((filter_mode & ACTFILTER_FORDRAWING) && (gpd->layers.first)) {
+ /* add to list */
+ ale= make_new_actlistelem(gpd, ACTTYPE_GPDATABLOCK, sa, ACTTYPE_SPECIALDATA);
+ if (ale) BLI_addtail(act_data, ale);
+ }
+
+ /* only add layers if they will be visible (if drawing channels) */
+ if ( !(filter_mode & ACTFILTER_VISIBLE) || (EXPANDED_GPD(gpd)) ) {
+ /* loop over layers as the conditions are acceptable */
+ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+ /* only if selected */
+ if (!(filter_mode & ACTFILTER_SEL) || SEL_GPL(gpl)) {
+ /* only if editable */
+ if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_GPL(gpl)) {
+ /* add to list */
+ ale= make_new_actlistelem(gpl, ACTTYPE_GPLAYER, gpd, ACTTYPE_GPDATABLOCK);
+ if (ale) BLI_addtail(act_data, ale);
+ }
+ }
}
}
}
@@ -637,11 +657,8 @@ int get_nearest_key_num (Key *key, short *mval, float *x)
return (num + 1);
}
-/* this function is used to get a pointer to an action or shapekey
- * datablock, thus simplying that process.
- */
-/* this function is intended for use */
-void *get_nearest_act_channel (short mval[], short *ret_type)
+/* this function finds the channel that mouse is floating over */
+void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
{
ListBase act_data = {NULL, NULL};
bActListElem *ale;
@@ -652,6 +669,9 @@ void *get_nearest_act_channel (short mval[], short *ret_type)
int clickmin, clickmax;
float x,y;
+ /* init 'owner' return val */
+ *owner= NULL;
+
/* determine what type of data we are operating on */
data = get_action_context(&datatype);
if (data == NULL) {
@@ -679,6 +699,7 @@ void *get_nearest_act_channel (short mval[], short *ret_type)
/* found match */
*ret_type= ale->type;
data= ale->data;
+ *owner= ale->owner;
BLI_freelistN(&act_data);
@@ -854,10 +875,7 @@ void *get_action_context (short *datatype)
case SACTCONT_GPENCIL:
*datatype= ACTCONT_GPENCIL;
- if (G.saction->pin)
- return G.saction->gpd;
- else
- return gpencil_data_getetime(G.curscreen);
+ return G.curscreen; // FIXME: add that dopesheet type thing here!
default: /* includes SACTCONT_DOPESHEET for now */
*datatype= ACTCONT_NONE;
@@ -2327,7 +2345,7 @@ static void numbuts_action ()
void *data;
short datatype;
- void *act_channel;
+ void *act_channel, *channel_owner;
short chantype;
bActionGroup *agrp= NULL;
@@ -2335,6 +2353,7 @@ static void numbuts_action ()
bConstraintChannel *conchan= NULL;
IpoCurve *icu= NULL;
KeyBlock *kb= NULL;
+ bGPdata *gpd= NULL;
bGPDlayer *gpl= NULL;
short mval[2];
@@ -2353,7 +2372,7 @@ static void numbuts_action ()
getmouseco_areawin(mval);
if (mval[0] > NAMEWIDTH)
return;
- act_channel= get_nearest_act_channel(mval, &chantype);
+ act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner);
/* create items for clever-numbut */
if (chantype == ACTTYPE_ACHAN) {
@@ -2451,6 +2470,7 @@ static void numbuts_action ()
}
else if (chantype == ACTTYPE_GPLAYER) {
/* Grease-Pencil Layer */
+ gpd= (bGPdata *)channel_owner;
gpl= (bGPDlayer *)act_channel;
strcpy(str, gpl->info);
@@ -2511,7 +2531,7 @@ static void numbuts_action ()
}
else if (gpl) {
strcpy(gpl->info, str);
- BLI_uniquename(&( ((bGPdata *)data)->layers ), gpl, "GP_Layer", offsetof(bGPDlayer, info), 128);
+ BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info), 128);
if (mute) gpl->flag |= GP_LAYER_HIDE;
else gpl->flag &= ~GP_LAYER_HIDE;;
@@ -2871,9 +2891,10 @@ int select_gplayer_channel (bGPdata *gpd, bGPDlayer *gpl, int selectmode)
gpl->flag ^= GP_LAYER_SELECT;
break;
}
+
flag = (gpl->flag & GP_LAYER_SELECT) ? 1 : 0;
-
- gpencil_layer_setactive(gpd, gpl);
+ if (flag)
+ gpencil_layer_setactive(gpd, gpl);
return flag;
}
@@ -3100,11 +3121,11 @@ void selectall_action_keys (short mval[], short mode, short select_mode)
switch (mode) {
case 0: /* all in channel*/
{
- void *act_channel;
+ void *act_channel, *channel_owner;
short chantype;
/* get channel, and act according to type */
- act_channel= get_nearest_act_channel(mval, &chantype);
+ act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner);
switch (chantype) {
case ACTTYPE_GROUP:
{
@@ -3939,8 +3960,7 @@ static void mouse_action (int selectmode)
static void mouse_actionchannels (short mval[])
{
bAction *act= G.saction->action;
- bGPdata *gpd= G.saction->gpd;
- void *data, *act_channel;
+ void *data, *act_channel, *channel_owner;
short datatype, chantype;
/* determine what type of data we are operating on */
@@ -3948,7 +3968,7 @@ static void mouse_actionchannels (short mval[])
if (data == NULL) return;
/* get channel to work on */
- act_channel= get_nearest_act_channel(mval, &chantype);
+ act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner);
/* action to take depends on what channel we've got */
switch (chantype) {
@@ -4086,8 +4106,17 @@ static void mouse_actionchannels (short mval[])
}
}
break;
+ case ACTTYPE_GPDATABLOCK:
+ {
+ bGPdata *gpd= (bGPdata *)act_channel;
+
+ /* toggle expand */
+ gpd->flag ^= GP_DATA_EXPAND;
+ }
+ break;
case ACTTYPE_GPLAYER:
{
+ bGPdata *gpd= (bGPdata *)channel_owner;
bGPDlayer *gpl= (bGPDlayer *)act_channel;
if (mval[0] >= (NAMEWIDTH-16)) {
@@ -4100,7 +4129,13 @@ static void mouse_actionchannels (short mval[])
}
else {
/* select/deselect */
- select_gplayer_channel(gpd, gpl, SELECT_INVERT);
+ if (G.qual & LR_SHIFTKEY) {
+ select_gplayer_channel(gpd, gpl, SELECT_INVERT);
+ }
+ else {
+ deselect_gpencil_layers(data, 0);
+ select_gplayer_channel(gpd, gpl, SELECT_INVERT);
+ }
}
}
break;
diff --git a/source/blender/src/editaction_gpencil.c b/source/blender/src/editaction_gpencil.c
index b91c5a8b332..14269080b1f 100644
--- a/source/blender/src/editaction_gpencil.c
+++ b/source/blender/src/editaction_gpencil.c
@@ -246,7 +246,7 @@ void borderselect_gplayer_frames (bGPDlayer *gpl, float min, float max, short se
/* De-selects or inverts the selection of Layers for a grease-pencil block
* mode: 0 = default behaviour (select all), 1 = test if (de)select all, 2 = invert all
*/
-void deselect_gpencil_layers (bGPdata *gpd, short mode)
+void deselect_gpencil_layers (void *data, short mode)
{
ListBase act_data = {NULL, NULL};
bActListElem *ale;
@@ -254,7 +254,7 @@ void deselect_gpencil_layers (bGPdata *gpd, short mode)
/* filter data */
filter= ACTFILTER_VISIBLE;
- actdata_filter(&act_data, filter, gpd, ACTCONT_GPENCIL);
+ actdata_filter(&act_data, filter, data, ACTCONT_GPENCIL);
/* See if we should be selecting or deselecting */
if (mode == 1) {
@@ -294,7 +294,6 @@ void delete_gpencil_layers (void)
{
ListBase act_data = {NULL, NULL};
bActListElem *ale, *next;
- bGPdata *gpd;
void *data;
short datatype;
int filter;
@@ -303,7 +302,6 @@ void delete_gpencil_layers (void)
data = get_action_context(&datatype);
if (data == NULL) return;
if (datatype != ACTCONT_GPENCIL) return;
- gpd= (bGPdata *)data;
/* filter data */
filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_CHANNELS | ACTFILTER_SEL);
@@ -311,6 +309,7 @@ void delete_gpencil_layers (void)
/* clean up grease-pencil layers */
for (ale= act_data.first; ale; ale= next) {
+ bGPdata *gpd= (bGPdata *)ale->owner;
bGPDlayer *gpl= (bGPDlayer *)ale->data;
next= ale->next;
diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c
index 6310dd0a262..5e50c8117cc 100644
--- a/source/blender/src/editarmature.c
+++ b/source/blender/src/editarmature.c
@@ -439,6 +439,109 @@ void docenter_armature (Object *ob, int centermode)
}
}
+/* helper for apply_armature_pose2bones - fixes parenting of objects that are bone-parented to armature */
+static void applyarmature_fix_boneparents (Object *armob)
+{
+ Object *ob;
+
+ /* go through all objects in database */
+ for (ob= G.main->object.first; ob; ob= ob->id.next) {
+ /* if parent is bone in this armature, apply corrections */
+ if ((ob->parent == armob) && (ob->partype == PARBONE)) {
+ /* apply current transform from parent (not yet destroyed),
+ * then calculate new parent inverse matrix
+ */
+ apply_obmat(ob);
+
+ what_does_parent(ob);
+ Mat4Invert(ob->parentinv, workob.obmat);
+ }
+ }
+}
+
+/* set the current pose as the restpose */
+void apply_armature_pose2bones(void)
+{
+ Object *ob;
+ bArmature *arm;
+ bPose *pose;
+ bPoseChannel *pchan;
+ EditBone *curbone;
+
+ /* don't check if editmode (should be done by caller) */
+ ob= OBACT;
+ if (ob->type!=OB_ARMATURE) return;
+ if (object_data_is_libdata(ob)) {
+ error_libdata();
+ return;
+ }
+ arm= get_armature(ob);
+
+ /* helpful warnings... */
+ // TODO: add warnings to be careful about actions, applying deforms first, etc.
+
+ /* Get editbones of active armature to alter */
+ if (G.edbo.first) BLI_freelistN(&G.edbo);
+ make_boneList(&G.edbo, &arm->bonebase, NULL);
+
+ /* get pose of active object and move it out of posemode */
+ pose= ob->pose;
+
+ for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
+ curbone= editbone_name_exists(&G.edbo, pchan->name);
+
+ /* simply copy the head/tail values from pchan over to curbone */
+ VECCOPY(curbone->head, pchan->pose_head);
+ VECCOPY(curbone->tail, pchan->pose_tail);
+
+ /* fix roll:
+ * 1. find auto-calculated roll value for this bone now
+ * 2. remove this from the 'visual' y-rotation
+ */
+ {
+ float premat[3][3], imat[3][3],pmat[3][3], tmat[3][3];
+ float delta[3], eul[3];
+
+ /* obtain new auto y-rotation */
+ VecSubf(delta, curbone->tail, curbone->head);
+ vec_roll_to_mat3(delta, 0.0, premat);
+ Mat3Inv(imat, premat);
+
+ /* get pchan 'visual' matrix */
+ Mat3CpyMat4(pmat, pchan->pose_mat);
+
+ /* remove auto from visual and get euler rotation */
+ Mat3MulMat3(tmat, imat, pmat);
+ Mat3ToEul(tmat, eul);
+
+ /* just use this euler-y as new roll value */
+ curbone->roll= eul[1];
+ }
+
+ /* clear transform values for pchan */
+ pchan->loc[0]= pchan->loc[1]= pchan->loc[2]= 0;
+ pchan->quat[1]= pchan->quat[2]= pchan->quat[3]= 0;
+ pchan->quat[0]= pchan->size[0]= pchan->size[1]= pchan->size[2]= 1;
+
+ /* set anim lock */
+ curbone->flag |= BONE_UNKEYED;
+ }
+
+ /* convert editbones back to bones */
+ editbones_to_armature(&G.edbo, ob);
+ if (G.edbo.first) BLI_freelistN(&G.edbo);
+
+ /* flush positions of posebones */
+ where_is_pose(ob);
+
+ /* fix parenting of objects which are bone-parented */
+ applyarmature_fix_boneparents(ob);
+
+ BIF_undo_push("Apply new restpose");
+ allqueue(REDRAWVIEW3D, 0);
+}
+
+
/* Helper function for armature joining - link fixing */
static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone)
{
@@ -854,6 +957,7 @@ static void separate_armature_bones (Object *ob, short sel)
BLI_freelistN(&edbo);
}
+/* separate selected bones into their armature */
void separate_armature (void)
{
Object *oldob, *newob;
@@ -1033,87 +1137,6 @@ static void *get_nearest_bone (short findunsel)
return NULL;
}
-/* used by posemode and editmode */
-void select_bone_parent (void)
-{
- Object *ob;
- bArmature *arm;
-
- /* get data */
- if (G.obedit)
- ob= G.obedit;
- else if (OBACT)
- ob= OBACT;
- else
- return;
- arm= (bArmature *)ob->data;
-
- /* determine which mode armature is in */
- if ((!G.obedit) && (ob->flag & OB_POSEMODE)) {
- /* deal with pose channels */
- /* channels are sorted on dependency, so the loop below won't result in a flood-select */
- bPoseChannel *pchan=NULL;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- /* check if bone in original selection */
- if (pchan->bone->flag & BONE_SELECTED) {
- bPoseChannel *chanpar= pchan->parent;
-
- /* check if any parent */
- if ((chanpar) && ((chanpar->bone->flag & BONE_SELECTED)==0)) {
- chanpar->bone->flag |= BONE_SELECTED;
- select_actionchannel_by_name (ob->action, pchan->name, 1);
- }
- }
- }
- }
- else if (G.obedit) {
- /* deal with editbones */
- EditBone *curbone, *parbone, *parpar;
-
- /* prevent floods */
- for (curbone= G.edbo.first; curbone; curbone= curbone->next)
- curbone->temp= NULL;
-
- for (curbone= G.edbo.first; curbone; curbone= curbone->next) {
- /* check if bone selected */
- if ((curbone->flag & BONE_SELECTED) && curbone->temp==NULL) {
- parbone= curbone->parent;
-
- /* check if any parent */
- if ((parbone) && ((parbone->flag & BONE_SELECTED)==0)) {
- /* select the parent bone */
- parbone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
-
- /* check if parent has parent */
- parpar= parbone->parent;
-
- if ((parpar) && (parbone->flag & BONE_CONNECTED)) {
- parpar->flag |= BONE_TIPSEL;
- }
- /* tag this bone to not flood selection */
- parbone->temp= parbone;
- }
- }
- }
-
- /* to be sure... */
- for (curbone= G.edbo.first; curbone; curbone= curbone->next)
- curbone->temp= NULL;
-
- }
-
- /* undo + redraw pushes */
- countall(); // flushes selection!
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Select Parent");
-}
-
/* helper for setflag_sel_bone() */
static void bone_setflag (int *bone, int flag, short mode)
{
@@ -1139,6 +1162,90 @@ static void bone_setflag (int *bone, int flag, short mode)
}
}
+/* Get the first available child of an editbone */
+static EditBone *editbone_get_child(EditBone *pabone, short use_visibility)
+{
+ Object *ob;
+ bArmature *arm;
+ EditBone *curbone, *chbone=NULL;
+
+ if (!G.obedit) return NULL;
+ else ob= G.obedit;
+ arm= (bArmature *)ob->data;
+
+ for (curbone= G.edbo.first; curbone; curbone= curbone->next) {
+ if (curbone->parent == pabone) {
+ if (use_visibility) {
+ if ((arm->layer & curbone->layer) && !(pabone->flag & BONE_HIDDEN_A))
+ chbone = curbone;
+ }
+ else
+ chbone = curbone;
+ }
+ }
+
+ return chbone;
+}
+
+void armature_select_hierarchy(short direction, short add_to_sel)
+{
+ Object *ob;
+ bArmature *arm;
+ EditBone *curbone, *pabone, *chbone;
+
+ if (!G.obedit) return;
+ else ob= G.obedit;
+ arm= (bArmature *)ob->data;
+
+ for (curbone= G.edbo.first; curbone; curbone= curbone->next) {
+ if (EBONE_VISIBLE(arm, curbone)) {
+ if (curbone->flag & (BONE_ACTIVE)) {
+ if (direction == BONE_SELECT_PARENT) {
+ if (curbone->parent == NULL) continue;
+ else pabone = curbone->parent;
+
+ if (EBONE_VISIBLE(arm, pabone)) {
+ pabone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ if (pabone->parent) pabone->parent->flag |= BONE_TIPSEL;
+
+ if (!add_to_sel) curbone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+ curbone->flag &= ~BONE_ACTIVE;
+ break;
+ }
+
+ }
+ else { // BONE_SELECT_CHILD
+ chbone = editbone_get_child(curbone, 1);
+ if (chbone == NULL) continue;
+
+ if (EBONE_VISIBLE(arm, chbone)) {
+ chbone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
+
+ if (!add_to_sel) {
+ curbone->flag &= ~(BONE_SELECTED|BONE_ROOTSEL);
+ if (curbone->parent) curbone->parent->flag &= ~BONE_TIPSEL;
+ }
+ curbone->flag &= ~BONE_ACTIVE;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ countall(); // flushes selection!
+
+ allqueue (REDRAWVIEW3D, 0);
+ allqueue (REDRAWBUTSEDIT, 0);
+ allqueue (REDRAWBUTSOBJECT, 0);
+ allqueue (REDRAWOOPS, 0);
+
+ if (direction==BONE_SELECT_PARENT)
+ BIF_undo_push("Select edit bone parent");
+ if (direction==BONE_SELECT_CHILD)
+ BIF_undo_push("Select edit bone child");
+}
+
/* used by posemode and editmode */
void setflag_armature (short mode)
{
@@ -1157,17 +1264,18 @@ void setflag_armature (short mode)
/* get flag to set (sync these with the ones used in eBone_Flag */
if (mode == 2)
- flag= pupmenu("Disable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5");
+ flag= pupmenu("Disable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6");
else if (mode == 1)
- flag= pupmenu("Enable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5");
+ flag= pupmenu("Enable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6");
else
- flag= pupmenu("Toggle Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5");
+ flag= pupmenu("Toggle Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6");
switch (flag) {
case 1: flag = BONE_DRAWWIRE; break;
case 2: flag = BONE_NO_DEFORM; break;
case 3: flag = BONE_MULT_VG_ENV; break;
case 4: flag = BONE_HINGE; break;
case 5: flag = BONE_NO_SCALE; break;
+ case 6: flag = BONE_EDITMODE_LOCKED; break;
default: return;
}
@@ -1723,12 +1831,12 @@ void auto_align_armature(short mode)
float *cursor= give_cursor();
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (arm->flag & ARM_MIRROR_EDIT)
flipbone = armature_bone_get_mirrored(ebone);
if ((ebone->flag & BONE_SELECTED) ||
- (flipbone && flipbone->flag & BONE_SELECTED))
+ (flipbone && (flipbone->flag & BONE_SELECTED)))
{
/* specific method used to calculate roll depends on mode */
if (mode == 1) {
@@ -1973,7 +2081,7 @@ void addvert_armature(void)
/* find the active or selected bone */
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (ebone->flag & (BONE_ACTIVE|BONE_TIPSEL))
break;
}
@@ -1981,7 +2089,7 @@ void addvert_armature(void)
if (ebone==NULL) {
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (ebone->flag & (BONE_ACTIVE|BONE_ROOTSEL))
break;
}
@@ -2064,11 +2172,12 @@ static EditBone *get_named_editbone(char *name)
{
EditBone *eBone;
- if (name)
+ if (name) {
for (eBone=G.edbo.first; eBone; eBone=eBone->next) {
if (!strcmp(name, eBone->name))
return eBone;
}
+ }
return NULL;
}
@@ -2134,7 +2243,7 @@ void adduplicate_armature(void)
/* Select mirrored bones */
if (arm->flag & ARM_MIRROR_EDIT) {
for (curBone=G.edbo.first; curBone; curBone=curBone->next) {
- if (arm->layer & curBone->layer) {
+ if (EBONE_VISIBLE(arm, curBone)) {
if (curBone->flag & BONE_SELECTED) {
eBone = armature_bone_get_mirrored(curBone);
if (eBone)
@@ -2146,13 +2255,13 @@ void adduplicate_armature(void)
/* Find the selected bones and duplicate them as needed */
for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) {
- if (arm->layer & curBone->layer) {
+ if (EBONE_VISIBLE(arm, curBone)) {
if (curBone->flag & BONE_SELECTED) {
eBone=MEM_callocN(sizeof(EditBone), "addup_editbone");
eBone->flag |= BONE_SELECTED;
/* Copy data from old bone to new bone */
- memcpy (eBone, curBone, sizeof(EditBone));
+ memcpy(eBone, curBone, sizeof(EditBone));
curBone->temp = eBone;
eBone->temp = curBone;
@@ -2202,7 +2311,7 @@ void adduplicate_armature(void)
/* Run though the list and fix the pointers */
for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) {
- if (arm->layer & curBone->layer) {
+ if (EBONE_VISIBLE(arm, curBone)) {
if (curBone->flag & BONE_SELECTED) {
eBone=(EditBone*) curBone->temp;
@@ -2234,7 +2343,7 @@ void adduplicate_armature(void)
/* Deselect the old bones and select the new ones */
for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) {
- if (arm->layer & curBone->layer)
+ if (EBONE_VISIBLE(arm, curBone))
curBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE);
}
@@ -2371,7 +2480,7 @@ void fill_bones_armature(void)
/* loop over all bones, and only consider if visible */
for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
- if ((arm->layer & ebo->layer) && !(ebo->flag & BONE_HIDDEN_A)) {
+ if (EBONE_VISIBLE(arm, ebo)) {
if (!(ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL))
fill_add_joint(ebo, 0, &points);
if (ebo->flag & BONE_TIPSEL)
@@ -2606,7 +2715,7 @@ void merge_armature(void)
/* only consider bones that are visible and selected */
for (ebo=chain->data; ebo; child=ebo, ebo=ebo->parent) {
/* check if visible + selected */
- if ( (arm->layer & ebo->layer) && !(ebo->flag & BONE_HIDDEN_A) &&
+ if ( EBONE_VISIBLE(arm, ebo) &&
((ebo->flag & BONE_CONNECTED) || (ebo->parent==NULL)) &&
(ebo->flag & (BONE_SELECTED|BONE_ACTIVE)) )
{
@@ -2657,7 +2766,7 @@ void hide_selected_armature_bones(void)
EditBone *ebone;
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (ebone->flag & (BONE_SELECTED)) {
ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE);
ebone->flag |= BONE_HIDDEN_A;
@@ -2676,7 +2785,7 @@ void hide_unselected_armature_bones(void)
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
bArmature *arm= G.obedit->data;
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL));
else {
ebone->flag &= ~BONE_ACTIVE;
@@ -2775,7 +2884,7 @@ void make_bone_parent(void)
/* find active bone to parent to */
for (actbone = G.edbo.first; actbone; actbone=actbone->next) {
- if (arm->layer & actbone->layer) {
+ if (EBONE_VISIBLE(arm, actbone)) {
if (actbone->flag & BONE_ACTIVE)
break;
}
@@ -2787,7 +2896,7 @@ void make_bone_parent(void)
/* find selected bones */
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if ((ebone->flag & BONE_SELECTED) && (ebone != actbone)) {
foundselbone++;
if (ebone->parent != actbone) allchildbones= 1;
@@ -2823,7 +2932,7 @@ void make_bone_parent(void)
else {
/* loop through all editbones, parenting all selected bones to the active bone */
for (selbone = G.edbo.first; selbone; selbone=selbone->next) {
- if (arm->layer & selbone->layer) {
+ if (EBONE_VISIBLE(arm, selbone)) {
if ((selbone->flag & BONE_SELECTED) && (selbone!=actbone)) {
/* parent selbone to actbone */
bone_connect_to_new_parent(selbone, actbone, val);
@@ -2881,7 +2990,7 @@ void clear_bone_parent(void)
if (val<1) return;
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (ebone->flag & BONE_SELECTED) {
if (arm->flag & ARM_MIRROR_EDIT)
flipbone = armature_bone_get_mirrored(ebone);
@@ -2931,7 +3040,7 @@ void unique_editbone_name (ListBase *ebones, char *name)
}
for (number = 1; number <=999; number++) {
- sprintf (tempname, "%s.%03d", name, number);
+ sprintf(tempname, "%s.%03d", name, number);
if (!editbone_name_exists(ebones, tempname)) {
BLI_strncpy(name, tempname, 32);
return;
@@ -2952,7 +3061,7 @@ void extrude_armature(int forked)
/* since we allow root extrude too, we have to make sure selection is OK */
for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
if (ebone->flag & BONE_ROOTSEL) {
if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
if (ebone->parent->flag & BONE_TIPSEL)
@@ -2964,7 +3073,7 @@ void extrude_armature(int forked)
/* Duplicate the necessary bones */
for (ebone = G.edbo.first; ((ebone) && (ebone!=first)); ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
+ if (EBONE_VISIBLE(arm, ebone)) {
/* we extrude per definition the tip */
do_extrude= 0;
if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED))
@@ -2978,7 +3087,7 @@ void extrude_armature(int forked)
if (do_extrude) {
/* we re-use code for mirror editing... */
flipbone= NULL;
- if(arm->flag & ARM_MIRROR_EDIT) {
+ if (arm->flag & ARM_MIRROR_EDIT) {
flipbone= armature_bone_get_mirrored(ebone);
if (flipbone) {
forked= 0; // we extrude 2 different bones
@@ -3008,7 +3117,7 @@ void extrude_armature(int forked)
newbone->parent = ebone;
newbone->flag = ebone->flag & BONE_TIPSEL; // copies it, in case mirrored bone
-
+
if (newbone->parent) newbone->flag |= BONE_CONNECTED;
}
else {
@@ -3018,7 +3127,7 @@ void extrude_armature(int forked)
newbone->flag= BONE_TIPSEL;
- if (newbone->parent && ebone->flag & BONE_CONNECTED) {
+ if (newbone->parent && (ebone->flag & BONE_CONNECTED)) {
newbone->flag |= BONE_CONNECTED;
}
}
@@ -3037,8 +3146,8 @@ void extrude_armature(int forked)
BLI_strncpy (newbone->name, ebone->name, 32);
if (flipbone && forked) { // only set if mirror edit
- if(strlen(newbone->name)<30) {
- if(a==0) strcat(newbone->name, "_L");
+ if (strlen(newbone->name)<30) {
+ if (a==0) strcat(newbone->name, "_L");
else strcat(newbone->name, "_R");
}
}
@@ -3083,7 +3192,7 @@ void subdivide_armature(int numcuts)
if (numcuts < 1) return;
for (mbone = G.edbo.last; mbone; mbone= mbone->prev) {
- if (arm->layer & mbone->layer) {
+ if (EBONE_VISIBLE(arm, mbone)) {
if (mbone->flag & BONE_SELECTED) {
for (i=numcuts+1; i>1; i--) {
/* compute cut ratio first */
@@ -3148,6 +3257,59 @@ void subdivide_armature(int numcuts)
else BIF_undo_push("Subdivide multi");
}
+/* switch direction of bone chains */
+void switch_direction_armature (void)
+{
+ bArmature *arm= (G.obedit) ? G.obedit->data : NULL;
+ ListBase chains = {NULL, NULL};
+ LinkData *chain;
+
+ /* error checking paranoia */
+ if (arm == NULL)
+ return;
+
+ /* get chains of bones (ends on chains) */
+ chains_find_tips(&chains);
+ if (chains.first == NULL) return;
+
+ /* loop over chains, only considering selected and visible bones */
+ for (chain= chains.first; chain; chain= chain->next) {
+ EditBone *ebo, *child=NULL, *parent=NULL;
+
+ /* loop over bones in chain */
+ for (ebo= chain->data; ebo; child= ebo, ebo=parent) {
+ parent= ebo->parent;
+
+ /* only if selected and editable */
+ if (EBONE_VISIBLE(arm, ebo) && EBONE_EDITABLE(ebo)) {
+ /* swap head and tail coordinates */
+ SWAP(float, ebo->head[0], ebo->tail[0]);
+ SWAP(float, ebo->head[1], ebo->tail[1]);
+ SWAP(float, ebo->head[2], ebo->tail[2]);
+
+ /* do parent swapping:
+ * - use 'child' as new parent
+ * - connected flag is only set if points are coincidental
+ */
+ ebo->parent= child;
+ if ((child) && VecEqual(ebo->head, child->tail))
+ ebo->flag |= BONE_CONNECTED;
+ else
+ ebo->flag &= ~BONE_CONNECTED;
+
+ /* FIXME: other things that need fixing?
+ * i.e. roll?
+ */
+ }
+ }
+ }
+
+ /* free chains */
+ BLI_freelistN(&chains);
+
+ BIF_undo_push("Switch Direction");
+}
+
/* ***************** Pose tools ********************* */
void clear_armature(Object *ob, char mode)
diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c
index 5de4c6ed23c..3f178e1ea2b 100644
--- a/source/blender/src/editdeform.c
+++ b/source/blender/src/editdeform.c
@@ -270,7 +270,7 @@ static void del_defgroup_update_users(Object *ob, int id)
int a;
/* these cases don't use names to refer to vertex groups, so when
- * they get deleted the numbers get out of synce, this corrects that */
+ * they get deleted the numbers get out of sync, this corrects that */
if(ob->soft) {
if(ob->soft->vertgroup == id)
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c
index 781210cd373..008ddf3b5f0 100644
--- a/source/blender/src/editface.c
+++ b/source/blender/src/editface.c
@@ -82,13 +82,14 @@
#include "BIF_space.h" /* for allqueue */
#include "BIF_drawimage.h" /* for allqueue */
-#include "BDR_drawmesh.h"
#include "BDR_editface.h"
#include "BDR_vpaint.h"
#include "BDR_editface.h"
#include "BDR_vpaint.h"
+#include "GPU_draw.h"
+
#include "mydevice.h"
#include "blendef.h"
#include "butspace.h"
@@ -1315,7 +1316,7 @@ void set_texturepaint() /* toggle */
if(G.f & G_TEXTUREPAINT) {
G.f &= ~G_TEXTUREPAINT;
- texpaint_enable_mipmap();
+ GPU_paint_set_mipmap(1);
}
else if (me) {
G.f |= G_TEXTUREPAINT;
@@ -1324,7 +1325,7 @@ void set_texturepaint() /* toggle */
make_tfaces(me);
brush_check_exists(&G.scene->toolsettings->imapaint.brush);
- texpaint_disable_mipmap();
+ GPU_paint_set_mipmap(0);
}
allqueue(REDRAWVIEW3D, 0);
diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c
index 67e10d771e0..97ddc2e0f1d 100644
--- a/source/blender/src/editimasel.c
+++ b/source/blender/src/editimasel.c
@@ -1076,6 +1076,12 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
toggle_blockhandler(sa, IMASEL_HANDLER_IMAGE, UI_PNL_UNSTOW);
scrarea_queue_winredraw(sa);
break;
+ case HKEY:
+ simasel->flag ^= FILE_HIDE_DOT;
+ BIF_filelist_free(simasel->files);
+ do_draw= 1;
+ do_headdraw= 1;
+ break;
case PKEY:
if(G.qual & LR_SHIFTKEY) {
extern char bprogname[]; /* usiblender.c */
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index c5dd41e16d5..cd6aefdb87c 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -82,6 +82,7 @@
#include "BKE_group.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
+#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_particle.h"
#include "BKE_texture.h"
@@ -461,24 +462,7 @@ static void make_part_editipo(SpaceIpo *si)
name = getname_part_ei(part_ar[a]);
strcpy(ei->name, name);
ei->adrcode= part_ar[a];
-
- //if(ei->adrcode & MA_MAP1) {
- // ei->adrcode-= MA_MAP1;
- // ei->adrcode |= texchannel_to_adrcode(si->channel);
- //}
- //else {
- // if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS;
- //}
-
ei->col= ipo_rainbow(a, PART_TOTIPO);
-
- //len= strlen(ei->name);
- //if(len) {
- // if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF;
- // else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50;
- // else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050;
- //}
-
ei->icu= find_ipocurve(si->ipo, ei->adrcode);
if(ei->icu) {
ei->flag= ei->icu->flag;
@@ -933,6 +917,9 @@ static void make_editipo(void)
ob->ipowin= ID_TE;
make_texture_editipo(G.sipo);
}
+ else if(G.scene->world && give_current_world_texture()) {
+ make_texture_editipo(G.sipo);
+ }
}
else if(G.sipo->blocktype==ID_CA) {
if (ob) {
@@ -1120,6 +1107,11 @@ static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname
*from= (ID *)tex;
if(tex) *ipo= tex->ipo;
}
+ else if(G.scene->world) {
+ Tex *tex= give_current_world_texture();
+ *from= (ID *)tex;
+ if(tex) *ipo= tex->ipo;
+ }
}
else if(blocktype==ID_MA) {
if(ob) {
diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c
index 41044ad13d7..7bfd097b87f 100644
--- a/source/blender/src/editipo_lib.c
+++ b/source/blender/src/editipo_lib.c
@@ -103,7 +103,8 @@ char *ic_name_empty[1] ={ "" };
char *fluidsim_ic_names[FLUIDSIM_TOTNAM] = { "Fac-Visc", "Fac-Time", "GravX","GravY","GravZ", "VelX","VelY","VelZ", "Active" };
char *part_ic_names[PART_TOTNAM] = { "E_Freq", "E_Life", "E_Speed", "E_Angular", "E_Size",
"Angular", "Size", "Drag", "Brown", "Damp", "Length", "Clump",
-"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt"};
+"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt",
+"FStreng", "FFall", "FMaxD", "F2Streng", "F2Fall", "F2MaxD"};
/* gets the appropriate icon for the given blocktype */
int geticon_ipo_blocktype(short blocktype)
@@ -391,7 +392,15 @@ int texchannel_to_adrcode(int channel)
case 6: return MA_MAP7;
case 7: return MA_MAP8;
case 8: return MA_MAP9;
- case 9: return MA_MAP10;
+ case 9: return MA_MAP10;
+ case 10: return MA_MAP11;
+ case 11: return MA_MAP12;
+ case 12: return MA_MAP13;
+ case 13: return MA_MAP14;
+ case 14: return MA_MAP15;
+ case 15: return MA_MAP16;
+ case 16: return MA_MAP17;
+ case 17: return MA_MAP18;
default: return 0;
}
}
diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c
index 1f24fb07667..ce798064632 100644
--- a/source/blender/src/editkey.c
+++ b/source/blender/src/editkey.c
@@ -84,6 +84,8 @@
#include "blendef.h"
#include "mydevice.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
extern ListBase editNurb; /* in editcurve.c */
/* temporary storage for slider values */
@@ -162,7 +164,7 @@ static void rvk_slider_func(void *voidob, void *voidkeynum)
IpoCurve *icu=NULL;
BezTriple *bezt=NULL;
float cfra, rvkval;
- int keynum = (long) voidkeynum;
+ int keynum = (intptr_t) voidkeynum;
cfra = frame_to_float(CFRA);
@@ -275,7 +277,7 @@ void make_rvk_slider(uiBlock *block, Object *ob, int keynum,
x, y , w, h,
meshslidervals+keynum, min, max, 10, 2, tip);
- uiButSetFunc(but, rvk_slider_func, ob, (void *)(long)keynum);
+ uiButSetFunc(but, rvk_slider_func, ob, (void *)(intptr_t)keynum);
// no hilite, the winmatrix is not correct later on...
uiButSetFlag(but, UI_NO_HILITE);
diff --git a/source/blender/src/editlattice.c b/source/blender/src/editlattice.c
index 0782e012f68..06b092a30ac 100644
--- a/source/blender/src/editlattice.c
+++ b/source/blender/src/editlattice.c
@@ -131,7 +131,7 @@ void make_editLatt(void)
copy_dverts(editLatt->dvert, lt->dvert, tot);
}
- BIF_undo_push("original");
+ BIF_undo_push("Original");
}
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index 188f7476728..b75f7e07143 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -1683,6 +1683,10 @@ void separate_mesh(void)
efa= em->faces.first;
while(efa) {
vl1= efa->next;
+ if (efa == G.editMesh->act_face && (efa->f & SELECT)) {
+ EM_set_actFace(NULL);
+ }
+
if((efa->f & SELECT)==0) {
BLI_remlink(&em->faces, efa);
BLI_addtail(&edvl, efa);
diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c
index c7a75b32df1..81d0ffeeb3b 100644
--- a/source/blender/src/editmesh_mods.c
+++ b/source/blender/src/editmesh_mods.c
@@ -109,6 +109,7 @@ editmesh_mods.c, UI level access, no geometry changes
#include "editmesh.h"
+#include "BLO_sys_types.h" // for intptr_t support
/* ****************************** MIRROR **************** */
@@ -1432,361 +1433,398 @@ int mesh_layers_menu(CustomData *data, int type) {
return ret;
}
-/* ctrl+c in mesh editmode */
-void mesh_copy_menu(void)
+void EM_mesh_copy_edge(short type)
{
EditMesh *em = G.editMesh;
EditSelection *ese;
- short ret, change=0;
+ short change=0;
+
+ EditEdge *eed, *eed_act;
+ float vec[3], vec_mid[3], eed_len, eed_len_act;
if (!em) return;
ese = em->selected.last;
+ if (!ese) return;
- /* Faces can have a NULL ese, so dont return on a NULL ese here */
+ eed_act = (EditEdge*)ese->data;
- if(ese && ese->type == EDITVERT) {
-
- if (!ese) return;
- /*EditVert *ev, *ev_act = (EditVert*)ese->data;
- ret= pupmenu("");*/
- } else if(ese && ese->type == EDITEDGE) {
- EditEdge *eed, *eed_act;
- float vec[3], vec_mid[3], eed_len, eed_len_act;
-
- if (!ese) return;
-
- eed_act = (EditEdge*)ese->data;
-
- ret= pupmenu("Copy Active Edge to Selected%t|Crease%x1|Bevel Weight%x2|Length%x3");
- if (ret<1) return;
-
- eed_len_act = VecLenf(eed_act->v1->co, eed_act->v2->co);
-
- switch (ret) {
- case 1: /* copy crease */
- for(eed=em->edges.first; eed; eed=eed->next) {
- if (eed->f & SELECT && eed != eed_act && eed->crease != eed_act->crease) {
- eed->crease = eed_act->crease;
- change = 1;
- }
+ switch (type) {
+ case 1: /* copy crease */
+ for(eed=em->edges.first; eed; eed=eed->next) {
+ if (eed->f & SELECT && eed != eed_act && eed->crease != eed_act->crease) {
+ eed->crease = eed_act->crease;
+ change = 1;
}
- break;
- case 2: /* copy bevel weight */
- for(eed=em->edges.first; eed; eed=eed->next) {
- if (eed->f & SELECT && eed != eed_act && eed->bweight != eed_act->bweight) {
- eed->bweight = eed_act->bweight;
- change = 1;
- }
+ }
+ break;
+ case 2: /* copy bevel weight */
+ for(eed=em->edges.first; eed; eed=eed->next) {
+ if (eed->f & SELECT && eed != eed_act && eed->bweight != eed_act->bweight) {
+ eed->bweight = eed_act->bweight;
+ change = 1;
}
- break;
-
- case 3: /* copy length */
-
- for(eed=em->edges.first; eed; eed=eed->next) {
- if (eed->f & SELECT && eed != eed_act) {
-
- eed_len = VecLenf(eed->v1->co, eed->v2->co);
-
- if (eed_len == eed_len_act) continue;
- /* if this edge is zero length we cont do anything with it*/
- if (eed_len == 0.0f) continue;
- if (eed_len_act == 0.0f) {
- VecAddf(vec_mid, eed->v1->co, eed->v2->co);
- VecMulf(vec_mid, 0.5);
- VECCOPY(eed->v1->co, vec_mid);
- VECCOPY(eed->v2->co, vec_mid);
- } else {
- /* copy the edge length */
- VecAddf(vec_mid, eed->v1->co, eed->v2->co);
- VecMulf(vec_mid, 0.5);
-
- /* SCALE 1 */
- VecSubf(vec, eed->v1->co, vec_mid);
- VecMulf(vec, eed_len_act/eed_len);
- VecAddf(eed->v1->co, vec, vec_mid);
-
- /* SCALE 2 */
- VecSubf(vec, eed->v2->co, vec_mid);
- VecMulf(vec, eed_len_act/eed_len);
- VecAddf(eed->v2->co, vec, vec_mid);
- }
- change = 1;
+ }
+ break;
+
+ case 3: /* copy length */
+ eed_len_act = VecLenf(eed_act->v1->co, eed_act->v2->co);
+ for(eed=em->edges.first; eed; eed=eed->next) {
+ if (eed->f & SELECT && eed != eed_act) {
+
+ eed_len = VecLenf(eed->v1->co, eed->v2->co);
+
+ if (eed_len == eed_len_act) continue;
+ /* if this edge is zero length we cont do anything with it*/
+ if (eed_len == 0.0f) continue;
+ if (eed_len_act == 0.0f) {
+ VecAddf(vec_mid, eed->v1->co, eed->v2->co);
+ VecMulf(vec_mid, 0.5);
+ VECCOPY(eed->v1->co, vec_mid);
+ VECCOPY(eed->v2->co, vec_mid);
+ } else {
+ /* copy the edge length */
+ VecAddf(vec_mid, eed->v1->co, eed->v2->co);
+ VecMulf(vec_mid, 0.5);
+
+ /* SCALE 1 */
+ VecSubf(vec, eed->v1->co, vec_mid);
+ VecMulf(vec, eed_len_act/eed_len);
+ VecAddf(eed->v1->co, vec, vec_mid);
+
+ /* SCALE 2 */
+ VecSubf(vec, eed->v2->co, vec_mid);
+ VecMulf(vec, eed_len_act/eed_len);
+ VecAddf(eed->v2->co, vec, vec_mid);
}
+ change = 1;
}
-
- if (change)
- recalc_editnormals();
-
-
- break;
}
+
+ if (change)
+ recalc_editnormals();
+
+ break;
+ }
+
+ if (change) {
+ DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
- } else if(ese==NULL || ese->type == EDITFACE) {
- EditFace *efa, *efa_act;
- MTFace *tf, *tf_act = NULL;
- MCol *mcol, *mcol_act = NULL;
-
- efa_act = EM_get_actFace(0);
-
- if (efa_act) {
- ret= pupmenu(
- "Copy Face Selected%t|"
- "Active Material%x1|Active Image%x2|Active UV Coords%x3|"
- "Active Mode%x4|Active Transp%x5|Active Vertex Colors%x6|%l|"
-
- "TexFace UVs from layer%x7|"
- "TexFace Images from layer%x8|"
- "TexFace All from layer%x9|"
- "Vertex Colors from layer%x10");
- if (ret<1) return;
- tf_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MTFACE);
- mcol_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MCOL);
- } else {
- ret= pupmenu(
- "Copy Face Selected%t|"
-
- /* Make sure these are always the same as above */
- "TexFace UVs from layer%x7|"
- "TexFace Images from layer%x8|"
- "TexFace All from layer%x9|"
- "Vertex Colors from layer%x10");
- if (ret<1) return;
+ BIF_undo_push("Copy Edge Attribute");
+ }
+}
+
+void EM_mesh_copy_face(short type)
+{
+ EditMesh *em = G.editMesh;
+ short change=0;
+
+ EditFace *efa, *efa_act;
+ MTFace *tf, *tf_act = NULL;
+ MCol *mcol, *mcol_act = NULL;
+ if (!em) return;
+ efa_act = EM_get_actFace(0);
+
+ if (!efa_act) return;
+
+ tf_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MTFACE);
+ mcol_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MCOL);
+
+ switch (type) {
+ case 1: /* copy material */
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT && efa->mat_nr != efa_act->mat_nr) {
+ efa->mat_nr = efa_act->mat_nr;
+ change = 1;
+ }
}
-
- switch (ret) {
- case 1: /* copy material */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa->mat_nr != efa_act->mat_nr) {
- efa->mat_nr = efa_act->mat_nr;
- change = 1;
+ break;
+ case 2: /* copy image */
+ if (!tf_act) {
+ error("mesh has no uv/image layers");
+ return;
+ }
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT && efa != efa_act) {
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ if (tf_act->tpage) {
+ tf->tpage = tf_act->tpage;
+ tf->mode |= TF_TEX;
+ } else {
+ tf->tpage = NULL;
+ tf->mode &= ~TF_TEX;
}
+ tf->tile= tf_act->tile;
+ change = 1;
}
- break;
- case 2: /* copy image */
- if (!tf_act) {
- error("mesh has no uv/image layers");
- return;
+ }
+ break;
+
+ case 3: /* copy UV's */
+ if (!tf_act) {
+ error("mesh has no uv/image layers");
+ return;
+ }
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT && efa != efa_act) {
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ memcpy(tf->uv, tf_act->uv, sizeof(tf->uv));
+ change = 1;
}
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (tf_act->tpage) {
- tf->tpage = tf_act->tpage;
- tf->mode |= TF_TEX;
- } else {
- tf->tpage = NULL;
- tf->mode &= ~TF_TEX;
- }
- tf->tile= tf_act->tile;
- change = 1;
- }
+ }
+ break;
+ case 4: /* mode's */
+ if (!tf_act) {
+ error("mesh has no uv/image layers");
+ return;
+ }
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT && efa != efa_act) {
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ tf->mode= tf_act->mode;
+ change = 1;
}
- break;
-
- case 3: /* copy UV's */
- if (!tf_act) {
- error("mesh has no uv/image layers");
- return;
+ }
+ break;
+ case 5: /* copy transp's */
+ if (!tf_act) {
+ error("mesh has no uv/image layers");
+ return;
+ }
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT && efa != efa_act) {
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ tf->transp= tf_act->transp;
+ change = 1;
}
+ }
+ break;
+
+ case 6: /* copy vcols's */
+ if (!mcol_act) {
+ error("mesh has no color layers");
+ return;
+ } else {
+ /* guess the 4th color if needs be */
+ float val =- 1;
+
+ if (!efa_act->v4) {
+ /* guess the othe vale, we may need to use it
+ *
+ * Modifying the 4th value of the mcol is ok here since its not seen
+ * on a triangle
+ * */
+ val = ((float)(mcol_act->r + (mcol_act+1)->r + (mcol_act+2)->r)) / 3; CLAMP(val, 0, 255);
+ (mcol_act+3)->r = (char)val;
+
+ val = ((float)(mcol_act->g + (mcol_act+1)->g + (mcol_act+2)->g)) / 3; CLAMP(val, 0, 255);
+ (mcol_act+3)->g = (char)val;
+
+ val = ((float)(mcol_act->b + (mcol_act+1)->b + (mcol_act+2)->b)) / 3; CLAMP(val, 0, 255);
+ (mcol_act+3)->b = (char)val;
+ }
+
+
for(efa=em->faces.first; efa; efa=efa->next) {
if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- memcpy(tf->uv, tf_act->uv, sizeof(tf->uv));
+ /* TODO - make copy from tri to quad guess the 4th vert */
+ mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
+ memcpy(mcol, mcol_act, sizeof(MCol)*4);
change = 1;
}
}
- break;
- case 4: /* mode's */
- if (!tf_act) {
- error("mesh has no uv/image layers");
+ }
+ break;
+ }
+
+ if (change) {
+ DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
+ if (type==3) {
+ allqueue(REDRAWIMAGE, 0);
+ }
+
+ BIF_undo_push("Copy Face Attribute");
+ }
+}
+
+
+void EM_mesh_copy_face_layer(short type)
+{
+ EditMesh *em = G.editMesh;
+ short change=0;
+
+ EditFace *efa;
+ MTFace *tf, *tf_from;
+ MCol *mcol, *mcol_from;
+
+ if (!em) return;
+
+ switch(type) {
+ case 7:
+ case 8:
+ case 9:
+ if (CustomData_number_of_layers(&em->fdata, CD_MTFACE)<2) {
+ error("mesh does not have multiple uv/image layers");
+ return;
+ } else {
+ int layer_orig_idx, layer_idx;
+
+ layer_idx = mesh_layers_menu(&em->fdata, CD_MTFACE);
+ if (layer_idx<0) return;
+
+ /* warning, have not updated mesh pointers however this is not needed since we swicth back */
+ layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MTFACE);
+ if (layer_idx==layer_orig_idx)
return;
- }
+
+ /* get the tfaces */
+ CustomData_set_layer_active(&em->fdata, CD_MTFACE, (int)layer_idx);
+ /* store the tfaces in our temp */
for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tf->mode= tf_act->mode;
- change = 1;
- }
+ if (efa->f & SELECT) {
+ efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ }
}
- break;
- case 5: /* copy transp's */
- if (!tf_act) {
- error("mesh has no uv/image layers");
+ CustomData_set_layer_active(&em->fdata, CD_MTFACE, layer_orig_idx);
+ }
+ break;
+
+ case 10: /* select vcol layers - make sure this stays in sync with above code */
+ if (CustomData_number_of_layers(&em->fdata, CD_MCOL)<2) {
+ error("mesh does not have multiple color layers");
+ return;
+ } else {
+ int layer_orig_idx, layer_idx;
+
+ layer_idx = mesh_layers_menu(&em->fdata, CD_MCOL);
+ if (layer_idx<0) return;
+
+ /* warning, have not updated mesh pointers however this is not needed since we swicth back */
+ layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MCOL);
+ if (layer_idx==layer_orig_idx)
return;
- }
+
+ /* get the tfaces */
+ CustomData_set_layer_active(&em->fdata, CD_MCOL, (int)layer_idx);
+ /* store the tfaces in our temp */
for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tf->transp= tf_act->transp;
- change = 1;
- }
- }
- break;
-
- case 6: /* copy vcols's */
- if (!mcol_act) {
- error("mesh has no color layers");
- return;
- } else {
- /* guess the 4th color if needs be */
- float val =- 1;
-
- if (!efa_act->v4) {
- /* guess the othe vale, we may need to use it
- *
- * Modifying the 4th value of the mcol is ok here since its not seen
- * on a triangle
- * */
- val = ((float)(mcol_act->r + (mcol_act+1)->r + (mcol_act+2)->r)) / 3; CLAMP(val, 0, 255);
- (mcol_act+3)->r = (char)val;
-
- val = ((float)(mcol_act->g + (mcol_act+1)->g + (mcol_act+2)->g)) / 3; CLAMP(val, 0, 255);
- (mcol_act+3)->g = (char)val;
-
- val = ((float)(mcol_act->b + (mcol_act+1)->b + (mcol_act+2)->b)) / 3; CLAMP(val, 0, 255);
- (mcol_act+3)->b = (char)val;
- }
-
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- /* TODO - make copy from tri to quad guess the 4th vert */
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- memcpy(mcol, mcol_act, sizeof(MCol)*4);
- change = 1;
- }
- }
- }
-
- break;
-
- /* Copy from layer - Warning! tf_act and mcol_act will be NULL here */
- case 7:
- case 8:
- case 9:
- if (CustomData_number_of_layers(&em->fdata, CD_MTFACE)<2) {
- error("mesh does not have multiple uv/image layers");
- return;
- } else {
- int layer_orig_idx, layer_idx;
-
- layer_idx = mesh_layers_menu(&em->fdata, CD_MTFACE);
- if (layer_idx<0) return;
-
- /* warning, have not updated mesh pointers however this is not needed since we swicth back */
- layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MTFACE);
- if (layer_idx==layer_orig_idx)
- return;
-
- /* get the tfaces */
- CustomData_set_layer_active(&em->fdata, CD_MTFACE, (int)layer_idx);
- /* store the tfaces in our temp */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- }
- }
- CustomData_set_layer_active(&em->fdata, CD_MTFACE, layer_orig_idx);
- }
- break;
-
- case 10: /* select vcol layers - make sure this stays in sync with above code */
- if (CustomData_number_of_layers(&em->fdata, CD_MCOL)<2) {
- error("mesh does not have multiple color layers");
- return;
- } else {
- int layer_orig_idx, layer_idx;
-
- layer_idx = mesh_layers_menu(&em->fdata, CD_MCOL);
- if (layer_idx<0) return;
-
- /* warning, have not updated mesh pointers however this is not needed since we swicth back */
- layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MCOL);
- if (layer_idx==layer_orig_idx)
- return;
-
- /* get the tfaces */
- CustomData_set_layer_active(&em->fdata, CD_MCOL, (int)layer_idx);
- /* store the tfaces in our temp */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- }
- }
- CustomData_set_layer_active(&em->fdata, CD_MCOL, layer_orig_idx);
-
+ if (efa->f & SELECT) {
+ efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
+ }
}
- break;
+ CustomData_set_layer_active(&em->fdata, CD_MCOL, layer_orig_idx);
+
}
-
- /* layer copy only - sanity checks done above */
- switch (ret) {
- case 7: /* copy UV's only */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- memcpy(tf->uv, tf_act->uv, sizeof(tf->uv));
- change = 1;
- }
+ break;
+ }
+
+ /* layer copy only - sanity checks done above */
+ switch (type) {
+ case 7: /* copy UV's only */
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT) {
+ tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ memcpy(tf->uv, tf_from->uv, sizeof(tf->uv));
+ change = 1;
}
- break;
- case 8: /* copy image settings only */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (tf_act->tpage) {
- tf->tpage = tf_act->tpage;
- tf->mode |= TF_TEX;
- } else {
- tf->tpage = NULL;
- tf->mode &= ~TF_TEX;
- }
- tf->tile= tf_act->tile;
- change = 1;
+ }
+ break;
+ case 8: /* copy image settings only */
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT) {
+ tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ if (tf_from->tpage) {
+ tf->tpage = tf_from->tpage;
+ tf->mode |= TF_TEX;
+ } else {
+ tf->tpage = NULL;
+ tf->mode &= ~TF_TEX;
}
+ tf->tile= tf_from->tile;
+ change = 1;
}
- break;
- case 9: /* copy all tface info */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- memcpy(tf->uv, ((MTFace *)efa->tmp.p)->uv, sizeof(tf->uv));
- tf->tpage = tf_act->tpage;
- tf->mode = tf_act->mode;
- tf->transp = tf_act->transp;
- change = 1;
- }
+ }
+ break;
+ case 9: /* copy all tface info */
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT) {
+ tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
+ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+ memcpy(tf->uv, ((MTFace *)efa->tmp.p)->uv, sizeof(tf->uv));
+ tf->tpage = tf_from->tpage;
+ tf->mode = tf_from->mode;
+ tf->transp = tf_from->transp;
+ change = 1;
}
- break;
- case 10:
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- mcol_act = (MCol *)efa->tmp.p;
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- memcpy(mcol, mcol_act, sizeof(MCol)*4);
- change = 1;
- }
+ }
+ break;
+ case 10:
+ for(efa=em->faces.first; efa; efa=efa->next) {
+ if (efa->f & SELECT) {
+ mcol_from = (MCol *)efa->tmp.p;
+ mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
+ memcpy(mcol, mcol_from, sizeof(MCol)*4);
+ change = 1;
}
- break;
}
-
+ break;
}
-
+
if (change) {
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSEDIT, 0);
- if (ese==NULL || ese->type == EDITFACE) BIF_undo_push("Copy Face Attribute");
- else if ( ese->type == EDITEDGE) BIF_undo_push("Copy Edge Attribute");
- else if ( ese->type == EDITVERT) BIF_undo_push("Copy Vert Attribute");
-
+ BIF_undo_push("Copy Face Layer");
}
+}
+
+
+/* ctrl+c in mesh editmode */
+void mesh_copy_menu(void)
+{
+ EditMesh *em = G.editMesh;
+ EditSelection *ese;
+ int ret;
+ if (!em) return;
+ ese = em->selected.last;
+
+ /* Faces can have a NULL ese, so dont return on a NULL ese here */
+
+ if(ese && ese->type == EDITVERT) {
+ /* EditVert *ev, *ev_act = (EditVert*)ese->data;
+ ret= pupmenu(""); */
+ } else if(ese && ese->type == EDITEDGE) {
+ ret= pupmenu("Copy Active Edge to Selected%t|Crease%x1|Bevel Weight%x2|Length%x3");
+ if (ret<1) return;
+
+ EM_mesh_copy_edge(ret);
+
+ } else if(ese==NULL || ese->type == EDITFACE) {
+ ret= pupmenu(
+ "Copy Face Selected%t|"
+ "Active Material%x1|Active Image%x2|Active UV Coords%x3|"
+ "Active Mode%x4|Active Transp%x5|Active Vertex Colors%x6|%l|"
+
+ "TexFace UVs from layer%x7|"
+ "TexFace Images from layer%x8|"
+ "TexFace All from layer%x9|"
+ "Vertex Colors from layer%x10");
+ if (ret<1) return;
+
+ if (ret<=6) {
+ EM_mesh_copy_face(ret);
+ } else {
+ EM_mesh_copy_face_layer(ret);
+ }
+ }
}
@@ -2900,7 +2938,7 @@ void select_sharp_edges(void)
EditFace *efa;
EditFace **efa1;
EditFace **efa2;
- long edgecount = 0, i;
+ intptr_t edgecount = 0, i;
static short sharpness = 135;
float fsharpness;
@@ -3004,7 +3042,7 @@ void select_linked_flat_faces(void)
EditFace *efa;
EditFace **efa1;
EditFace **efa2;
- long edgecount = 0, i, faceselcount=0, faceselcountold=0;
+ intptr_t edgecount = 0, i, faceselcount=0, faceselcountold=0;
static short sharpness = 135;
float fsharpness;
@@ -4164,7 +4202,7 @@ void editmesh_align_view_to_selected(View3D *v3d, int axis)
void vertexsmooth(void)
{
EditMesh *em = G.editMesh;
- EditVert *eve;
+ EditVert *eve, *eve_mir = NULL;
EditEdge *eed;
float *adror, *adr, fac;
float fvec[3];
@@ -4247,13 +4285,19 @@ void vertexsmooth(void)
while(eve) {
if(eve->f & SELECT) {
if(eve->f1) {
+
+ if (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR) {
+ eve_mir= editmesh_get_x_mirror_vert(G.obedit, eve->co);
+ }
+
adr = eve->tmp.p;
fac= 0.5/(float)eve->f1;
eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
eve->co[1]= 0.5*eve->co[1]+fac*adr[1];
eve->co[2]= 0.5*eve->co[2]+fac*adr[2];
-
+
+
/* clip if needed by mirror modifier */
if (eve->f2) {
if (eve->f2 & 1) {
@@ -4266,6 +4310,13 @@ void vertexsmooth(void)
eve->co[2]= 0.0f;
}
}
+
+ if (eve_mir) {
+ eve_mir->co[0]=-eve->co[0];
+ eve_mir->co[1]= eve->co[1];
+ eve_mir->co[2]= eve->co[2];
+ }
+
}
eve->tmp.p= NULL;
}
diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c
index f9bb14a08c6..c2fccb0e50f 100644
--- a/source/blender/src/editmesh_tools.c
+++ b/source/blender/src/editmesh_tools.c
@@ -110,6 +110,8 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise
#include "PIL_time.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/* local prototypes ---------------*/
void bevel_menu(void);
static void free_tagged_edges_faces(EditEdge *eed, EditFace *efa);
@@ -132,7 +134,7 @@ static int vergxco(const void *v1, const void *v2)
}
struct facesort {
- unsigned long x;
+ uintptr_t x;
struct EditFace *efa;
};
@@ -433,8 +435,8 @@ int removedoublesflag(short flag, short automerge, float limit) /* return amoun
efa= em->faces.first;
while(efa) {
if(efa->f1 & 1) {
- if(efa->v4) vsb->x= (unsigned long) MIN4( (unsigned long)efa->v1, (unsigned long)efa->v2, (unsigned long)efa->v3, (unsigned long)efa->v4);
- else vsb->x= (unsigned long) MIN3( (unsigned long)efa->v1, (unsigned long)efa->v2, (unsigned long)efa->v3);
+ if(efa->v4) vsb->x= (uintptr_t) MIN4( (uintptr_t)efa->v1, (uintptr_t)efa->v2, (uintptr_t)efa->v3, (uintptr_t)efa->v4);
+ else vsb->x= (uintptr_t) MIN3( (uintptr_t)efa->v1, (uintptr_t)efa->v2, (uintptr_t)efa->v3);
vsb->efa= efa;
vsb++;
@@ -4646,6 +4648,12 @@ void bevel_menu_old()
}
/* *********** END BEVEL *********/
+typedef struct SlideUv {
+ float origuv[2];
+ float *uv_up, *uv_down;
+ //float *fuv[4];
+ LinkNode *fuv_list;
+} SlideUv;
typedef struct SlideVert {
EditEdge *up,*down;
@@ -4653,9 +4661,19 @@ typedef struct SlideVert {
} SlideVert;
int EdgeLoopDelete(void) {
+
+ /* temporal flag setting so we keep UVs when deleting edge loops,
+ * this is a bit of a hack but it works how you would want in almost all cases */
+ short uvcalc_flag_orig = G.scene->toolsettings->uvcalc_flag;
+ G.scene->toolsettings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
+
if(!EdgeSlide(1, 1)) {
return 0;
}
+
+ /* restore uvcalc flag */
+ G.scene->toolsettings->uvcalc_flag = uvcalc_flag_orig;
+
EM_select_more();
removedoublesflag(1,0, 0.001);
EM_select_flush();
@@ -4665,22 +4683,35 @@ int EdgeLoopDelete(void) {
int EdgeSlide(short immediate, float imperc)
{
+ NumInput num;
EditMesh *em = G.editMesh;
EditFace *efa;
EditEdge *eed,*first=NULL,*last=NULL, *temp = NULL;
EditVert *ev, *nearest;
LinkNode *edgelist = NULL, *vertlist=NULL, *look;
GHash *vertgh;
+
SlideVert *tempsv;
float perc = 0, percp = 0,vertdist, projectMat[4][4], viewMat[4][4];
float shiftlabda= 0.0f,len = 0.0f;
int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0;
int wasshift = 0;
+
+ /* UV correction vars */
+ GHash **uvarray;
+ int uvlay_tot= CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE);
+ int uvlay_idx;
+ SlideUv *slideuvs, *suv, *suv_last;
+ float uv_tmp[2];
+ LinkNode *fuv_link;
+
short event, draw=1;
short mval[2], mvalo[2];
char str[128];
float labda = 0.0f;
+ initNumInput(&num);
+
view3d_get_object_project_mat(curarea, G.obedit, projectMat, viewMat);
mvalo[0] = -1; mvalo[1] = -1;
@@ -4980,6 +5011,99 @@ int EdgeSlide(short immediate, float imperc)
look = look->next;
}
+
+
+ if (uvlay_tot && (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
+ int maxnum = 0;
+ uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array");
+ suv_last = slideuvs = MEM_callocN( uvlay_tot * (numadded+1) * sizeof(SlideUv), "SlideUVs"); /* uvLayers * verts */
+ suv = NULL;
+
+ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
+
+ uvarray[uvlay_idx] = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
+
+ for(ev=em->verts.first;ev;ev=ev->next) {
+ ev->tmp.l = 0;
+ }
+ look = vertlist;
+ while(look) {
+ float *uv_new;
+ tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
+
+ ev = look->link;
+ suv = NULL;
+ for(efa = em->faces.first;efa;efa=efa->next) {
+ if (ev->tmp.l != -1) { /* test for self, in this case its invalid */
+ int k=-1; /* face corner */
+
+ /* Is this vert in the faces corner? */
+ if (efa->v1==ev) k=0;
+ else if (efa->v2==ev) k=1;
+ else if (efa->v3==ev) k=2;
+ else if (efa->v4 && efa->v4==ev) k=3;
+
+ if (k != -1) {
+ MTFace *tf = CustomData_em_get_n(&em->fdata, efa->data, CD_MTFACE, uvlay_idx);
+ EditVert *ev_up, *ev_down;
+
+ uv_new = tf->uv[k];
+
+ if (ev->tmp.l) {
+ if (fabs(suv->origuv[0]-uv_new[0]) > 0.0001 || fabs(suv->origuv[1]-uv_new[1])) {
+ ev->tmp.l = -1; /* Tag as invalid */
+ BLI_linklist_free(suv->fuv_list,NULL);
+ suv->fuv_list = NULL;
+ BLI_ghash_remove(uvarray[uvlay_idx],ev, NULL, NULL);
+ suv = NULL;
+ break;
+ }
+ } else {
+ ev->tmp.l = 1;
+ suv = suv_last;
+
+ suv->fuv_list = NULL;
+ suv->uv_up = suv->uv_down = NULL;
+ suv->origuv[0] = uv_new[0];
+ suv->origuv[1] = uv_new[1];
+
+ BLI_linklist_prepend(&suv->fuv_list, uv_new);
+ BLI_ghash_insert(uvarray[uvlay_idx],ev,suv);
+
+ suv_last++; /* advance to next slide UV */
+ maxnum++;
+ }
+
+ /* Now get the uvs along the up or down edge if we can */
+ if (suv) {
+ if (!suv->uv_up) {
+ ev_up = editedge_getOtherVert(tempsv->up,ev);
+ if (efa->v1==ev_up) suv->uv_up = tf->uv[0];
+ else if (efa->v2==ev_up) suv->uv_up = tf->uv[1];
+ else if (efa->v3==ev_up) suv->uv_up = tf->uv[2];
+ else if (efa->v4 && efa->v4==ev_up) suv->uv_up = tf->uv[3];
+ }
+ if (!suv->uv_down) { /* if the first face was apart of the up edge, it cant be apart of the down edge */
+ ev_down = editedge_getOtherVert(tempsv->down,ev);
+ if (efa->v1==ev_down) suv->uv_down = tf->uv[0];
+ else if (efa->v2==ev_down) suv->uv_down = tf->uv[1];
+ else if (efa->v3==ev_down) suv->uv_down = tf->uv[2];
+ else if (efa->v4 && efa->v4==ev_down) suv->uv_down = tf->uv[3];
+ }
+
+ /* Copy the pointers to the face UV's */
+ BLI_linklist_prepend(&suv->fuv_list, uv_new);
+ }
+ }
+ }
+ }
+ look = look->next;
+ }
+ } /* end uv layer loop */
+ } /* end uvlay_tot */
+
+
+
// we should have enough info now to slide
len = 0.0f;
@@ -4992,17 +5116,84 @@ int EdgeSlide(short immediate, float imperc)
float v2[2], v3[2];
EditVert *centerVert, *upVert, *downVert;
-
-
getmouseco_areawin(mval);
if (!immediate && (mval[0] == mvalo[0] && mval[1] == mvalo[1])) {
PIL_sleep_ms(10);
} else {
+ char *p = str;;
mvalo[0] = mval[0];
mvalo[1] = mval[1];
+
+ tempsv = BLI_ghash_lookup(vertgh,nearest);
+
+ centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
+ upVert = editedge_getOtherVert(tempsv->up, centerVert);
+ downVert = editedge_getOtherVert(tempsv->down, centerVert);
+
+ view3d_project_float(curarea, upVert->co, v2, projectMat);
+ view3d_project_float(curarea, downVert->co, v3, projectMat);
+
+ /* Determine the % on which the loop should be cut */
+
+ rc[0]= v3[0]-v2[0];
+ rc[1]= v3[1]-v2[1];
+ len= rc[0]*rc[0]+ rc[1]*rc[1];
+ if (len==0) {len = 0.0001;}
+
+ if ((G.qual & LR_SHIFTKEY)==0) {
+ wasshift = 0;
+ labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len;
+ }
+ else {
+ if (wasshift==0) {
+ wasshift = 1;
+ shiftlabda = labda;
+ }
+ labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda;
+ }
+
+
+ if(labda<=0.0) labda=0.0;
+ else if(labda>=1.0)labda=1.0;
+
+ perc=((1-labda)*2)-1;
+
+ if(G.qual == 0) {
+ perc *= 100;
+ perc = floor(perc);
+ perc /= 100;
+ } else if (G.qual == LR_CTRLKEY) {
+ perc *= 10;
+ perc = floor(perc);
+ perc /= 10;
+ }
+
+ if(prop == 0) {
+ len = VecLenf(upVert->co,downVert->co)*((perc+1)/2);
+ if(flip == 1) {
+ len = VecLenf(upVert->co,downVert->co) - len;
+ }
+ }
+
+ if (hasNumInput(&num))
+ {
+ applyNumInput(&num, &perc);
+
+ if (prop)
+ {
+ perc = MIN2(perc, 1);
+ perc = MAX2(perc, -1);
+ }
+ else
+ {
+ len = MIN2(perc, VecLenf(upVert->co,downVert->co));
+ len = MAX2(len, 0);
+ }
+ }
+
//Adjust Edgeloop
if(immediate) {
perc = imperc;
@@ -5017,7 +5208,21 @@ int EdgeSlide(short immediate, float imperc)
tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev);
VecLerpf(ev->co, tempsv->origvert.co, tempev->co, fabs(perc));
-
+
+ if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
+ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
+ suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
+ if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
+ Vec2Lerpf(uv_tmp, suv->origuv, (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc));
+ fuv_link = suv->fuv_list;
+ while (fuv_link) {
+ VECCOPY2D(((float *)fuv_link->link), uv_tmp);
+ fuv_link = fuv_link->next;
+ }
+ }
+ }
+ }
+
look = look->next;
}
}
@@ -5033,21 +5238,44 @@ int EdgeSlide(short immediate, float imperc)
if(newlen < 0.0) {newlen = 0.0;}
if(flip == 0) {
VecLerpf(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
+ if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
+ /* dont do anything if no UVs */
+ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
+ suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
+ if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
+ Vec2Lerpf(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen));
+ fuv_link = suv->fuv_list;
+ while (fuv_link) {
+ VECCOPY2D(((float *)fuv_link->link), uv_tmp);
+ fuv_link = fuv_link->next;
+ }
+ }
+ }
+ }
} else{
VecLerpf(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen));
+
+ if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
+ /* dont do anything if no UVs */
+ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
+ suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
+ if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
+ Vec2Lerpf(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen));
+ fuv_link = suv->fuv_list;
+ while (fuv_link) {
+ VECCOPY2D(((float *)fuv_link->link), uv_tmp);
+ fuv_link = fuv_link->next;
+ }
+ }
+ }
+ }
}
look = look->next;
}
}
- tempsv = BLI_ghash_lookup(vertgh,nearest);
-
- centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
- upVert = editedge_getOtherVert(tempsv->up, centerVert);
- downVert = editedge_getOtherVert(tempsv->down, centerVert);
// Highlight the Control Edges
-
scrarea_do_windraw(curarea);
persp(PERSP_VIEW);
glPushMatrix();
@@ -5075,55 +5303,36 @@ int EdgeSlide(short immediate, float imperc)
glPopMatrix();
- view3d_project_float(curarea, upVert->co, v2, projectMat);
- view3d_project_float(curarea, downVert->co, v3, projectMat);
-
- /* Determine the % on which the loop should be cut */
-
- rc[0]= v3[0]-v2[0];
- rc[1]= v3[1]-v2[1];
- len= rc[0]*rc[0]+ rc[1]*rc[1];
- if (len==0) {len = 0.0001;}
-
- if ((G.qual & LR_SHIFTKEY)==0) {
- wasshift = 0;
- labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len;
+ if(prop) {
+ p += sprintf(str, "(P)ercentage: ");
+ } else {
+ p += sprintf(str, "Non (P)rop Length: ");
}
- else {
- if (wasshift==0) {
- wasshift = 1;
- shiftlabda = labda;
- }
- labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda;
+
+ if (hasNumInput(&num))
+ {
+ char num_str[20];
+
+ outputNumInput(&num, num_str);
+ p += sprintf(p, "%s", num_str);
+ }
+ else
+ {
+ if (prop)
+ {
+ p += sprintf(p, "%f", perc);
+ }
+ else
+ {
+ p += sprintf(p, "%f", len);
+ }
}
-
- if(labda<=0.0) labda=0.0;
- else if(labda>=1.0)labda=1.0;
-
- perc=((1-labda)*2)-1;
- if(G.qual == 0) {
- perc *= 100;
- perc = floor(perc);
- perc /= 100;
- } else if (G.qual == LR_CTRLKEY) {
- perc *= 10;
- perc = floor(perc);
- perc /= 10;
- }
- if(prop) {
- sprintf(str, "(P)ercentage: %f", perc);
- } else {
- len = VecLenf(upVert->co,downVert->co)*((perc+1)/2);
- if(flip == 1) {
- len = VecLenf(upVert->co,downVert->co) - len;
- }
- sprintf(str, "Non (P)rop Length: %f, Press (F) to flip control side", len);
+ if (prop == 0) {
+ p += sprintf(p, ", Press (F) to flip control side");
}
-
-
headerprint(str);
screen_swapbuffers();
}
@@ -5146,7 +5355,14 @@ int EdgeSlide(short immediate, float imperc)
perc = 0;
immediate = 1;
} else if(event==PKEY) {
- (prop == 1) ? (prop = 0):(prop = 1);
+ initNumInput(&num); /* reset num input */
+ if (prop) {
+ prop = 0;
+ num.flag |= NUM_NO_NEGATIVE;
+ }
+ else {
+ prop = 1;
+ }
mvalo[0] = -1;
} else if(event==FKEY) {
(flip == 1) ? (flip = 0):(flip = 1);
@@ -5184,7 +5400,13 @@ int EdgeSlide(short immediate, float imperc)
look = look->next;
}
}
+
+ if (handleNumInput(&num, event))
+ {
+ mvalo[0] = -1; /* NEED A BETTER WAY TO TRIGGER REDRAW */
+ }
}
+
}
} else {
draw = 0;
@@ -5216,6 +5438,24 @@ int EdgeSlide(short immediate, float imperc)
BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
BLI_linklist_free(vertlist,NULL);
BLI_linklist_free(edgelist,NULL);
+
+ if (uvlay_tot && (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
+ for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
+ BLI_ghash_free(uvarray[uvlay_idx], NULL, NULL);
+ }
+ MEM_freeN(uvarray);
+ MEM_freeN(slideuvs);
+
+ suv = suv_last-1;
+ while (suv >= slideuvs) {
+ if (suv->fuv_list) {
+ BLI_linklist_free(suv->fuv_list,NULL);
+ }
+ suv--;
+ }
+
+ allqueue(REDRAWIMAGE, 0);
+ }
if(cancel == 1) {
return -1;
diff --git a/source/blender/src/editmode_undo.c b/source/blender/src/editmode_undo.c
index d0a44360ad5..7893dac2408 100644
--- a/source/blender/src/editmode_undo.c
+++ b/source/blender/src/editmode_undo.c
@@ -107,6 +107,7 @@ typedef struct UndoElem {
Object *ob; // pointer to edited object
int type; // type of edited object
void *undodata;
+ uintptr_t undosize;
char name[MAXUNDONAME];
void (*freedata)(void *);
void (*to_editmode)(void *);
@@ -138,6 +139,7 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
{
UndoElem *uel;
int nr;
+ uintptr_t memused, totmem, maxmem;
/* at first here was code to prevent an "original" key to be insterted twice
this was giving conflicts for example when mesh changed due to keys or apply */
@@ -145,9 +147,8 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
/* remove all undos after (also when curundo==NULL) */
while(undobase.last != curundo) {
uel= undobase.last;
- BLI_remlink(&undobase, uel);
uel->freedata(uel->undodata);
- MEM_freeN(uel);
+ BLI_freelinkN(&undobase, uel);
}
/* make new */
@@ -160,7 +161,7 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
uel->from_editmode= from_editmode;
uel->validate_undo= validate_undo;
- /* and limit amount to the maximum */
+ /* limit amount to the maximum amount*/
nr= 0;
uel= undobase.last;
while(uel) {
@@ -171,19 +172,43 @@ void undo_editmode_push(char *name, void (*freedata)(void *),
if(uel) {
while(undobase.first!=uel) {
UndoElem *first= undobase.first;
- BLI_remlink(&undobase, first);
first->freedata(first->undodata);
- MEM_freeN(first);
+ BLI_freelinkN(&undobase, first);
}
}
/* copy */
+ memused= MEM_get_memory_in_use();
curundo->undodata= curundo->from_editmode();
+ curundo->undosize= MEM_get_memory_in_use() - memused;
curundo->ob= G.obedit;
curundo->id= G.obedit->id;
curundo->type= G.obedit->type;
-}
+ if(U.undomemory != 0) {
+ /* limit to maximum memory (afterwards, we can't know in advance) */
+ totmem= 0;
+ maxmem= ((uintptr_t)U.undomemory)*1024*1024;
+
+ uel= undobase.last;
+ while(uel && uel->prev) {
+ totmem+= uel->undosize;
+ if(totmem>maxmem) break;
+ uel= uel->prev;
+ }
+
+ if(uel) {
+ if(uel->prev && uel->prev->prev)
+ uel= uel->prev;
+
+ while(undobase.first!=uel) {
+ UndoElem *first= undobase.first;
+ first->freedata(first->undodata);
+ BLI_freelinkN(&undobase, first);
+ }
+ }
+ }
+}
/* helper to remove clean other objects from undo stack */
static void undo_clean_stack(void)
@@ -205,9 +230,8 @@ static void undo_clean_stack(void)
}
else {
mixed= 1;
- BLI_remlink(&undobase, uel);
uel->freedata(uel->undodata);
- MEM_freeN(uel);
+ BLI_freelinkN(&undobase, uel);
}
uel= next;
diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c
index 5c137e67c1a..d3ba153e600 100644
--- a/source/blender/src/editnode.c
+++ b/source/blender/src/editnode.c
@@ -2001,7 +2001,10 @@ void node_hide(SpaceNode *snode)
void node_insert_key(SpaceNode *snode)
{
bNode *node= editnode_get_active(snode->edittree);
-
+
+ if(node == NULL)
+ return;
+
if(node->type==CMP_NODE_TIME) {
if(node->custom1<node->custom2) {
@@ -2110,6 +2113,7 @@ static void node_border_link_delete(SpaceNode *snode)
mval[1]= rect.ymax;
areamouseco_to_ipoco(&snode->v2d, mval, &rectf.xmax, &rectf.ymax);
+ glLoadIdentity();
myortho2(rectf.xmin, rectf.xmax, rectf.ymin, rectf.ymax);
glSelectBuffer(256, buffer);
@@ -2400,7 +2404,7 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
switch(event) {
case LEFTMOUSE:
- if(gpencil_do_paint(sa)) {
+ if(gpencil_do_paint(sa, L_MOUSE)) {
return;
}
else if(fromlib) {
@@ -2421,7 +2425,10 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case RIGHTMOUSE:
- if(find_indicated_socket(snode, &actnode, &actsock, SOCK_IN)) {
+ if(gpencil_do_paint(sa, R_MOUSE)) {
+ return;
+ }
+ else if(find_indicated_socket(snode, &actnode, &actsock, SOCK_IN)) {
if(actsock->flag & SOCK_SEL) {
snode->edittree->selin= NULL;
actsock->flag&= ~SOCK_SEL;
@@ -2568,8 +2575,13 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case DELKEY:
case XKEY:
- if(fromlib) fromlib= -1;
- else node_delete(snode);
+ if(G.qual==LR_ALTKEY) {
+ gpencil_delete_menu();
+ }
+ else {
+ if(fromlib) fromlib= -1;
+ else node_delete(snode);
+ }
break;
}
}
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index 6af4f47ed11..e8084bd45a9 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -172,6 +172,7 @@
#include "BDR_drawobject.h"
#include "BDR_editcurve.h"
#include "BDR_unwrapper.h"
+#include "BDR_gpencil.h"
#include <time.h>
#include "mydevice.h"
@@ -2760,7 +2761,7 @@ void special_editmenu(void)
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
}
else if(G.obedit->type==OB_ARMATURE) {
- nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6");
+ nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Switch Direction%x7|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6");
if(nr==1)
subdivide_armature(1);
if(nr==2) {
@@ -2773,6 +2774,8 @@ void special_editmenu(void)
else if(ELEM3(nr, 4, 5, 6)) {
armature_autoside_names(nr-4);
}
+ else if(nr == 7)
+ switch_direction_armature();
}
else if(G.obedit->type==OB_LATTICE) {
static float weight= 1.0f;
@@ -2825,7 +2828,7 @@ void convertmenu(void)
if(G.scene->id.lib) return;
obact= OBACT;
- if(obact==0) return;
+ if (obact == NULL) return;
if(!obact->flag & SELECT) return;
if(G.obedit) return;
@@ -3020,6 +3023,10 @@ void convertmenu(void)
basedel = NULL;
}
+ /* delete object should renew depsgraph */
+ if(nr==2)
+ DAG_scene_sort(G.scene);
+
/* texspace and normals */
if(!basen) BASACT= base;
@@ -3502,6 +3509,17 @@ void copy_attr(short event)
base->object->damping= ob->damping;
base->object->rdamping= ob->rdamping;
}
+ else if(event==11) { /* all physical attributes */
+ base->object->gameflag = ob->gameflag;
+ base->object->inertia = ob->inertia;
+ base->object->formfactor = ob->formfactor;
+ base->object->damping= ob->damping;
+ base->object->rdamping= ob->rdamping;
+ base->object->mass= ob->mass;
+ if (ob->gameflag & OB_BOUNDS) {
+ base->object->boundtype = ob->boundtype;
+ }
+ }
else if(event==17) { /* tex space */
copy_texture_space(base->object, ob);
}
@@ -3688,7 +3706,7 @@ void copy_attr_menu()
* view3d_edit_object_copyattrmenu() and in toolbox.c
*/
- strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l");
+ strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l");
strcat (str, "|Object Constraints%x22");
strcat (str, "|NLA Strips%x26");
@@ -4117,15 +4135,26 @@ void apply_object( void )
}
allqueue(REDRAWVIEW3D, 0);
- } else {
+ }
+ else {
+ ob= OBACT;
- evt = pupmenu("Apply Object%t|Scale and Rotation to ObData|Visual Transform to Objects Loc/Scale/Rot");
+ if ((ob->pose) && (ob->flag & OB_POSEMODE))
+ evt = pupmenu("Apply Object%t|Current Pose as RestPose%x3");
+ else
+ evt = pupmenu("Apply Object%t|Scale and Rotation to ObData%x1|Visual Transform to Objects Loc/Scale/Rot%x2");
if (evt==-1) return;
- if (evt==1) {
- apply_objects_locrot();
- } else if (evt==2) {
- apply_objects_visual_tx();
+ switch (evt) {
+ case 1:
+ apply_objects_locrot();
+ break;
+ case 2:
+ apply_objects_visual_tx();
+ break;
+ case 3:
+ apply_armature_pose2bones();
+ break;
}
}
}
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index f9432f8e69a..e9d0b57a166 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -122,13 +122,28 @@ Sequence *get_last_seq()
if(!_last_seq_init) {
Editing *ed;
Sequence *seq;
+ Sequence *l_sel = NULL;
+ Sequence *l_act = NULL;
ed= G.scene->ed;
if(!ed) return NULL;
- for(seq= ed->seqbasep->first; seq; seq=seq->next)
+ for(seq= ed->seqbasep->first; seq; seq=seq->next) {
+ if(seq->flag & SEQ_ACTIVE)
+ l_act = seq;
if(seq->flag & SELECT)
- _last_seq= seq;
+ l_sel = seq;
+ }
+
+ if (l_act) {
+ _last_seq = l_act;
+ } else {
+ _last_seq = l_sel;
+ }
+
+ if (_last_seq) {
+ _last_seq->flag |= SEQ_ACTIVE;
+ }
_last_seq_init = 1;
}
@@ -138,12 +153,23 @@ Sequence *get_last_seq()
void set_last_seq(Sequence *seq)
{
+ if (_last_seq_init && _last_seq) {
+ _last_seq->flag &= ~SEQ_ACTIVE;
+ }
+
_last_seq = seq;
_last_seq_init = 1;
+
+ if (_last_seq) {
+ _last_seq->flag |= SEQ_ACTIVE;
+ }
}
-void clear_last_seq(Sequence *seq)
+void clear_last_seq()
{
+ if (_last_seq_init && _last_seq) {
+ _last_seq->flag &= ~SEQ_ACTIVE;
+ }
_last_seq = NULL;
_last_seq_init = 0;
}
@@ -618,6 +644,7 @@ static int seq_is_parent(Sequence *par, Sequence *seq)
static int seq_is_predecessor(Sequence *pred, Sequence *seq)
{
+ if (!pred) return 0;
if(pred == seq) return 0;
else if(seq_is_parent(pred, seq)) return 1;
else if(pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1;
@@ -2261,6 +2288,8 @@ static Sequence *dupli_seq(Sequence *seq)
"handled in duplicate!\nExpect a crash"
" now...\n");
}
+
+ seqn->flag &= ~SEQ_ACTIVE;
return seqn;
}
diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c
index 05eb094a7c2..2d70525f971 100644
--- a/source/blender/src/editsound.c
+++ b/source/blender/src/editsound.c
@@ -275,6 +275,12 @@ void sound_initialize_sounds(void)
bSound *sound;
if(ghSoundScene) {
+ for(sound=G.main->sound.first; sound; sound=sound->id.next) {
+ if(sound->snd_sound) {
+ SND_RemoveSound(ghSoundScene, sound->snd_sound);
+ sound->snd_sound = NULL;
+ }
+ }
/* clear the soundscene */
SND_RemoveAllSounds(ghSoundScene);
@@ -908,7 +914,16 @@ void sound_stop_all_sounds(void)
void sound_end_all_sounds(void)
{
#if GAMEBLENDER == 1
+ bSound *sound;
+
if(ghSoundScene) {
+ for(sound=G.main->sound.first; sound; sound=sound->id.next) {
+ if(sound->snd_sound) {
+ SND_RemoveSound(ghSoundScene, sound->snd_sound);
+ sound->snd_sound = NULL;
+ }
+ }
+
sound_stop_all_sounds();
SND_RemoveAllSounds(ghSoundScene);
}
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index e3ec69975de..2133a92a54e 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -298,7 +298,7 @@ int lasso_inside(short mcords[][2], short moves, short sx, short sy)
}
/* edge version for lasso select. we assume boundbox check was done */
-static int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1)
+int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1)
{
short v1[2], v2[2];
int a;
@@ -371,7 +371,7 @@ static void do_lasso_select_objects(short mcords[][2], short moves, short select
}
}
-static void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves)
+void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves)
{
short a;
@@ -1631,7 +1631,7 @@ void mouse_select(void)
/* ------------------------------------------------------------------------- */
-static int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2)
+int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2)
{
int radsq= rad*rad;
float v1[2], v2[2], v3[2];
@@ -2247,7 +2247,7 @@ void view3d_border_zoom(void)
/* Get Z Depths, needed for perspective, nice for ortho */
bgl_get_mats(&mats);
- draw_depth(curarea, (void *)v3d);
+ draw_depth(curarea, (void *)v3d, NULL);
/* force updating */
if (v3d->depths) {
diff --git a/source/blender/src/gpencil.c b/source/blender/src/gpencil.c
index fa32b0ac7d4..c7540bc4a1f 100644
--- a/source/blender/src/gpencil.c
+++ b/source/blender/src/gpencil.c
@@ -39,24 +39,37 @@
#include "BMF_Api.h"
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "DNA_listBase.h"
+#include "DNA_armature_types.h"
+#include "DNA_curve_types.h"
#include "DNA_gpencil_types.h"
+#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
+#include "DNA_vec_types.h"
#include "DNA_view3d_types.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
#include "BKE_blender.h"
+#include "BKE_armature.h"
+#include "BKE_curve.h"
+#include "BKE_image.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "BIF_butspace.h"
+#include "BIF_drawseq.h"
+#include "BIF_editarmature.h"
+#include "BIF_editview.h"
#include "BIF_graphics.h"
#include "BIF_interface.h"
#include "BIF_mywindow.h"
@@ -69,6 +82,8 @@
#include "BDR_gpencil.h"
#include "BIF_drawgpencil.h"
+#include "BDR_editobject.h"
+
#include "BSE_drawipo.h"
#include "BSE_headerbuttons.h"
#include "BSE_view.h"
@@ -209,8 +224,8 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd)
BLI_addtail(&gpd->layers, gpl);
/* set basic settings */
- gpl->color[3]= 1.0f;
- gpl->thickness = 1;
+ gpl->color[3]= 0.9f;
+ gpl->thickness = 3;
/* auto-name */
sprintf(gpl->info, "GP_Layer");
@@ -232,8 +247,7 @@ bGPdata *gpencil_data_addnew (void)
gpd= MEM_callocN(sizeof(bGPdata), "GreasePencilData");
/* initial settings */
- /* it is quite useful to be able to see this info, so on by default */
- gpd->flag = GP_DATA_DISPINFO;
+ gpd->flag = (GP_DATA_DISPINFO|GP_DATA_EXPAND);
return gpd;
}
@@ -310,11 +324,17 @@ bGPdata *gpencil_data_getactive (ScrArea *sa)
{
SpaceSeq *sseq= sa->spacedata.first;
- /* only applicable for "Image Preview" mode */
+ /* only applicable for image modes */
if (sseq->mainb)
return sseq->gpd;
}
break;
+ case SPACE_IMAGE:
+ {
+ SpaceImage *sima= sa->spacedata.first;
+ return sima->gpd;
+ }
+ break;
}
/* nothing found */
@@ -377,117 +397,23 @@ short gpencil_data_setactive (ScrArea *sa, bGPdata *gpd)
}
}
break;
+ case SPACE_IMAGE:
+ {
+ SpaceImage *sima= sa->spacedata.first;
+
+ if (sima->gpd)
+ free_gpencil_data(sima->gpd);
+ sima->gpd= gpd;
+
+ return 1;
+ }
+ break;
}
/* failed to add */
return 0;
}
-/* Find gp-data destined for editing in animation editor (for editing time) */
-bGPdata *gpencil_data_getetime (bScreen *sc)
-{
- bGPdata *gpd= NULL;
- ScrArea *sa;
-
- /* error checking */
- if (sc == NULL)
- return NULL;
-
- /* search through areas, checking if an appropriate gp-block is available
- * (this assumes that only one will have the active flag set)
- */
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- /* handle depending on space type */
- switch (sa->spacetype) {
- case SPACE_VIEW3D: /* 3d-view */
- {
- View3D *v3d= sa->spacedata.first;
- gpd= v3d->gpd;
- }
- break;
- case SPACE_NODE: /* Node Editor */
- {
- SpaceNode *snode= sa->spacedata.first;
- gpd= snode->gpd;
- }
- break;
- case SPACE_SEQ: /* Sequence Editor - Image Preview */
- {
- SpaceSeq *sseq= sa->spacedata.first;
-
- if (sseq->mainb)
- gpd= sseq->gpd;
- else
- gpd= NULL;
- }
- break;
-
- default: /* unsupported space-type */
- gpd= NULL;
- break;
- }
-
- /* check if ok */
- if ((gpd) && (gpd->flag & GP_DATA_EDITTIME))
- return gpd;
- }
-
- /* didn't find a match */
- return NULL;
-}
-
-/* make sure only the specified view can have gp-data for time editing
- * - gpd can be NULL, if we wish to make sure no gp-data is being edited
- */
-void gpencil_data_setetime (bScreen *sc, bGPdata *gpd)
-{
- bGPdata *gpdn= NULL;
- ScrArea *sa;
-
- /* error checking */
- if (sc == NULL)
- return;
-
- /* search through areas, checking if an appropriate gp-block is available
- * (this assumes that only one will have the active flag set)
- */
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- /* handle depending on space type */
- switch (sa->spacetype) {
- case SPACE_VIEW3D: /* 3d-view */
- {
- View3D *v3d= sa->spacedata.first;
- gpdn= v3d->gpd;
- }
- break;
- case SPACE_NODE: /* Node Editor */
- {
- SpaceNode *snode= sa->spacedata.first;
- gpdn= snode->gpd;
- }
- break;
- case SPACE_SEQ: /* Sequence Editor - Image Preview */
- {
- SpaceSeq *sseq= sa->spacedata.first;
- gpdn= sseq->gpd;
- }
- break;
-
- default: /* unsupported space-type */
- gpdn= NULL;
- break;
- }
-
- /* clear flag if a gp-data block found */
- if (gpdn)
- gpdn->flag &= ~GP_DATA_EDITTIME;
- }
-
- /* set active flag for this block (if it is provided) */
- if (gpd)
- gpd->flag |= GP_DATA_EDITTIME;
-}
-
/* -------- GP-Frame API ---------- */
/* delete the last stroke of the given frame */
@@ -692,7 +618,7 @@ void gpencil_layer_delactive (bGPdata *gpd)
}
/* ************************************************** */
-/* GREASE-PENCIL EDITING MODE - Tools */
+/* GREASE-PENCIL EDITING - Tools */
/* --------- Data Deletion ---------- */
@@ -721,7 +647,7 @@ void gpencil_delete_actframe (bGPdata *gpd)
* 2 - active frame
* 3 - active layer
*/
-void gpencil_delete_operation (short mode) // unused
+void gpencil_delete_operation (short mode)
{
bGPdata *gpd;
@@ -747,23 +673,330 @@ void gpencil_delete_operation (short mode) // unused
}
/* display a menu for deleting different grease-pencil elements */
-void gpencil_delete_menu (void) // unused
+void gpencil_delete_menu (void)
{
+ bGPdata *gpd= gpencil_data_getactive(NULL);
short mode;
- mode= pupmenu("Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3");
+ /* only show menu if it will be relevant */
+ if (gpd == NULL) return;
+
+ mode= pupmenu("Grease Pencil Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3");
if (mode <= 0) return;
gpencil_delete_operation(mode);
}
+/* --------- Data Conversion ---------- */
+
+/* convert the coordinates from the given stroke point into 3d-coordinates */
+static void gp_strokepoint_convertcoords (bGPDstroke *gps, bGPDspoint *pt, float p3d[3])
+{
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ /* directly use 3d-coordinates */
+ VecCopyf(p3d, &pt->x);
+ }
+ else {
+ short mval[2], mx, my;
+ float *fp= give_cursor();
+ float dvec[3];
+
+ /* get screen coordinate */
+ if (gps->flag & GP_STROKE_2DSPACE) {
+ View2D *v2d= spacelink_get_view2d(curarea->spacedata.first);
+ ipoco_to_areaco_noclip(v2d, &pt->x, mval);
+ }
+ else {
+ mval[0]= (pt->x / 1000 * curarea->winx);
+ mval[1]= (pt->y / 1000 * curarea->winy);
+ }
+ mx= mval[0];
+ my= mval[1];
+
+ /* convert screen coordinate to 3d coordinates
+ * - method taken from editview.c - mouse_cursor()
+ */
+ project_short_noclip(fp, mval);
+ window_to_3d(dvec, mval[0]-mx, mval[1]-my);
+ VecSubf(p3d, fp, dvec);
+ }
+}
+
+/* --- */
+
+/* convert stroke to 3d path */
+static void gp_stroke_to_path (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
+{
+ bGPDspoint *pt;
+ Nurb *nu;
+ BPoint *bp;
+ int i;
+
+ /* create new 'nurb' within the curve */
+ nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_path(nurb)");
+
+ nu->pntsu= gps->totpoints;
+ nu->pntsv= 1;
+ nu->orderu= gps->totpoints;
+ nu->flagu= 2; /* endpoint */
+ nu->resolu= 32;
+
+ nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*gps->totpoints, "bpoints");
+
+ /* add points */
+ for (i=0, pt=gps->points, bp=nu->bp; i < gps->totpoints; i++, pt++, bp++) {
+ float p3d[3];
+
+ /* get coordinates to add at */
+ gp_strokepoint_convertcoords(gps, pt, p3d);
+ VecCopyf(bp->vec, p3d);
+
+ /* set settings */
+ bp->f1= SELECT;
+ bp->radius = bp->weight = pt->pressure * gpl->thickness;
+ }
+
+ /* add nurb to curve */
+ BLI_addtail(&cu->nurb, nu);
+}
+
+/* convert stroke to 3d bezier */
+static void gp_stroke_to_bezier (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
+{
+ bGPDspoint *pt;
+ Nurb *nu;
+ BezTriple *bezt;
+ int i;
+
+ /* create new 'nurb' within the curve */
+ nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_bezier(nurb)");
+
+ nu->pntsu= gps->totpoints;
+ nu->resolu= 12;
+ nu->resolv= 12;
+ nu->type= CU_BEZIER;
+ nu->bezt = (BezTriple *)MEM_callocN(gps->totpoints*sizeof(BezTriple), "bezts");
+
+ /* add points */
+ for (i=0, pt=gps->points, bezt=nu->bezt; i < gps->totpoints; i++, pt++, bezt++) {
+ float p3d[3];
+
+ /* get coordinates to add at */
+ gp_strokepoint_convertcoords(gps, pt, p3d);
+
+ /* TODO: maybe in future the handles shouldn't be in same place */
+ VecCopyf(bezt->vec[0], p3d);
+ VecCopyf(bezt->vec[1], p3d);
+ VecCopyf(bezt->vec[2], p3d);
+
+ /* set settings */
+ bezt->h1= bezt->h2= HD_FREE;
+ bezt->f1= bezt->f2= bezt->f3= SELECT;
+ bezt->radius = bezt->weight = pt->pressure * gpl->thickness;
+ }
+
+ /* must calculate handles or else we crash */
+ calchandlesNurb(nu);
+
+ /* add nurb to curve */
+ BLI_addtail(&cu->nurb, nu);
+}
+
+/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
+static void gp_layer_to_curve (bGPdata *gpd, bGPDlayer *gpl, short mode)
+{
+ bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
+ bGPDstroke *gps;
+ Object *ob;
+ Curve *cu;
+
+ /* error checking */
+ if (ELEM3(NULL, gpd, gpl, gpf))
+ return;
+
+ /* only convert if there are any strokes on this layer's frame to convert */
+ if (gpf->strokes.first == NULL)
+ return;
+
+ /* initialise the curve */
+ cu= add_curve(gpl->info, 1);
+ cu->flag |= CU_3D;
+
+ /* init the curve object (remove rotation and assign curve data to it) */
+ add_object_draw(OB_CURVE);
+ ob= OBACT;
+ ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
+ ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
+ ob->data= cu;
+
+ /* add points to curve */
+ for (gps= gpf->strokes.first; gps; gps= gps->next) {
+ switch (mode) {
+ case 1:
+ gp_stroke_to_path(gpl, gps, cu);
+ break;
+ case 2:
+ gp_stroke_to_bezier(gpl, gps, cu);
+ break;
+ }
+ }
+}
+
+/* --- */
+
+/* convert a stroke to a bone chain */
+static void gp_stroke_to_bonechain (bGPDlayer *gpl, bGPDstroke *gps, bArmature *arm, ListBase *bones)
+{
+ EditBone *ebo, *prev=NULL;
+ bGPDspoint *pt, *ptn;
+ int i;
+
+ /* add each segment separately */
+ for (i=0, pt=gps->points, ptn=gps->points+1; i < (gps->totpoints-1); prev=ebo, i++, pt++, ptn++) {
+ float p3da[3], p3db[3];
+
+ /* get coordinates to add at */
+ gp_strokepoint_convertcoords(gps, pt, p3da);
+ gp_strokepoint_convertcoords(gps, ptn, p3db);
+
+ /* allocate new bone */
+ ebo= MEM_callocN(sizeof(EditBone), "eBone");
+
+ VecCopyf(ebo->head, p3da);
+ VecCopyf(ebo->tail, p3db);
+
+ /* add new bone - note: sync with editarmature.c::add_editbone() */
+ BLI_strncpy(ebo->name, "Stroke", 32);
+ unique_editbone_name(bones, ebo->name);
+
+ BLI_addtail(bones, ebo);
+
+ ebo->flag |= BONE_CONNECTED;
+ ebo->weight= 1.0F;
+ ebo->dist= 0.25F;
+ ebo->xwidth= 0.1;
+ ebo->zwidth= 0.1;
+ ebo->ease1= 1.0;
+ ebo->ease2= 1.0;
+ ebo->rad_head= pt->pressure * gpl->thickness * 0.1;
+ ebo->rad_tail= ptn->pressure * gpl->thickness * 0.1;
+ ebo->segments= 1;
+ ebo->layer= arm->layer;
+
+ /* set parenting */
+ // TODO: also adjust roll....
+ ebo->parent= prev;
+ }
+}
+
+/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
+static void gp_layer_to_armature (bGPdata *gpd, bGPDlayer *gpl, short mode)
+{
+ bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
+ bGPDstroke *gps;
+ Object *ob;
+ bArmature *arm;
+ ListBase bones = {0,0};
+
+ /* error checking */
+ if (ELEM3(NULL, gpd, gpl, gpf))
+ return;
+
+ /* only convert if there are any strokes on this layer's frame to convert */
+ if (gpf->strokes.first == NULL)
+ return;
+
+ /* initialise the armature */
+ arm= add_armature(gpl->info);
+
+ /* init the armature object (remove rotation and assign armature data to it) */
+ add_object_draw(OB_ARMATURE);
+ ob= OBACT;
+ ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
+ ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
+ ob->data= arm;
+
+ /* convert segments to bones, strokes to bone chains */
+ for (gps= gpf->strokes.first; gps; gps= gps->next) {
+ gp_stroke_to_bonechain(gpl, gps, arm, &bones);
+ }
+
+ /* flush editbones to armature */
+ editbones_to_armature(&bones, ob);
+ if (bones.first) BLI_freelistN(&bones);
+}
+
+/* --- */
+
+/* convert grease-pencil strokes to another representation
+ * mode: 1 - Active layer to path
+ * 2 - Active layer to bezier
+ * 3 - Active layer to armature
+ */
+void gpencil_convert_operation (short mode)
+{
+ bGPdata *gpd;
+ float *fp= give_cursor();
+
+ /* get datablock to work on */
+ gpd= gpencil_data_getactive(NULL);
+ if (gpd == NULL) return;
+
+ /* initialise 3d-cursor correction globals */
+ initgrabz(fp[0], fp[1], fp[2]);
+
+ /* handle selection modes */
+ switch (mode) {
+ case 1: /* active layer only (to path) */
+ case 2: /* active layer only (to bezier) */
+ {
+ bGPDlayer *gpl= gpencil_layer_getactive(gpd);
+ gp_layer_to_curve(gpd, gpl, mode);
+ }
+ break;
+ case 3: /* active layer only (to armature) */
+ {
+ bGPDlayer *gpl= gpencil_layer_getactive(gpd);
+ gp_layer_to_armature(gpd, gpl, mode);
+ }
+ break;
+ }
+
+ /* redraw and undo-push */
+ BIF_undo_push("GPencil Convert");
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWOOPS, 0);
+}
+
+/* display a menu for converting grease-pencil strokes */
+void gpencil_convert_menu (void)
+{
+ bGPdata *gpd= gpencil_data_getactive(NULL);
+ short mode;
+
+ /* only show menu if it will be relevant */
+ if (gpd == NULL) return;
+
+ mode= pupmenu("Grease Pencil Convert %t|Active Layer To Path%x1|Active Layer to Bezier%x2|Active Layer to Armature%x3");
+ if (mode <= 0) return;
+
+ gpencil_convert_operation(mode);
+}
+
/* ************************************************** */
/* GREASE-PENCIL EDITING MODE - Painting */
/* ---------- 'Globals' and Defines ----------------- */
/* maximum sizes of gp-session buffer */
-#define GP_STROKE_BUFFER_MAX 500
+#define GP_STROKE_BUFFER_MAX 5000
+
+/* Hardcoded sensitivity thresholds... */
+// TODO: one day, these might be added to the UI if it is necessary
+ /* minimum number of pixels mouse should move before new point created */
+#define MIN_MANHATTEN_PX 3
+ /* minimum length of new segment before new point can be added */
+#define MIN_EUCLIDEAN_PX 20
/* ------ */
@@ -771,13 +1004,18 @@ void gpencil_delete_menu (void) // unused
typedef struct tGPsdata {
ScrArea *sa; /* area where painting originated */
View2D *v2d; /* needed for GP_STROKE_2DSPACE */
+ ImBuf *ibuf; /* needed for GP_STROKE_2DIMAGE */
bGPdata *gpd; /* gp-datablock layer comes from */
bGPDlayer *gpl; /* layer we're working on */
bGPDframe *gpf; /* frame we're working on */
short status; /* current status of painting */
- short paintmode; /* mode for painting (L_MOUSE or R_MOUSE for now) */
+ short paintmode; /* mode for painting */
+
+ short mval[2]; /* current mouse-position */
+ short mvalo[2]; /* previous recorded mouse-position */
+ short radius; /* radius of influence for eraser */
} tGPsdata;
/* values for tGPsdata->status */
@@ -787,6 +1025,12 @@ enum {
GP_STATUS_DONE /* painting done */
};
+/* values for tGPsdata->paintmode */
+enum {
+ GP_PAINTMODE_DRAW = 0,
+ GP_PAINTMODE_ERASER
+};
+
/* Return flags for adding points to stroke buffer */
enum {
GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */
@@ -804,9 +1048,9 @@ static void gp_session_validatebuffer (tGPsdata *p)
/* clear memory of buffer (or allocate it if starting a new session) */
if (gpd->sbuffer)
- memset(gpd->sbuffer, 0, sizeof(bGPDspoint)*GP_STROKE_BUFFER_MAX);
+ memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX);
else
- gpd->sbuffer= MEM_callocN(sizeof(bGPDspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer");
+ gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer");
/* reset indices */
gpd->sbuffer_size = 0;
@@ -886,6 +1130,16 @@ static void gp_session_initpaint (tGPsdata *p)
}
}
break;
+ case SPACE_IMAGE:
+ {
+ SpaceImage *sima= curarea->spacedata.first;
+
+ /* set the current area */
+ p->sa= curarea;
+ p->v2d= &sima->v2d;
+ p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
+ }
+ break;
/* unsupported views */
default:
{
@@ -944,6 +1198,26 @@ static void gp_session_cleanup (tGPsdata *p)
gpd->sbuffer_sflag= 0;
}
+/* check if the current mouse position is suitable for adding a new point */
+static short gp_stroke_filtermval (tGPsdata *p, short mval[2], short pmval[2])
+{
+ short dx= abs(mval[0] - pmval[0]);
+ short dy= abs(mval[1] - pmval[1]);
+
+ /* check if mouse moved at least certain distance on both axes (best case) */
+ if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX))
+ return 1;
+
+ /* check if the distance since the last point is significant enough */
+ // future optimisation: sqrt here may be too slow?
+ else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX)
+ return 1;
+
+ /* mouse 'didn't move' */
+ else
+ return 0;
+}
+
/* convert screen-coordinates to buffer-coordinates */
static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
{
@@ -951,7 +1225,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
/* in 3d-space - pt->x/y/z are 3 side-by-side floats */
if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) {
- short mx=mval[0], my=mval[1];
+ const short mx=mval[0], my=mval[1];
float *fp= give_cursor();
float dvec[3];
@@ -971,6 +1245,47 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
out[1]= y;
}
+ /* 2d - on image 'canvas' (assume that p->v2d is set) */
+ else if ( (gpd->sbuffer_sflag & GP_STROKE_2DIMAGE) && (p->v2d) )
+ {
+ /* for now - space specific */
+ switch (p->sa->spacetype) {
+ case SPACE_SEQ: /* sequencer */
+ {
+ SpaceSeq *sseq= (SpaceSeq *)p->sa->spacedata.first;
+ int sizex, sizey, offsx, offsy, rectx, recty;
+ float zoom, zoomx, zoomy;
+
+ /* calculate zoom factor */
+ zoom= SEQ_ZOOM_FAC(sseq->zoom);
+ if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
+ zoomy = zoom;
+ }
+ else
+ zoomx = zoomy = zoom;
+
+ /* calculate rect size */
+ rectx= (G.scene->r.size*G.scene->r.xsch)/100;
+ recty= (G.scene->r.size*G.scene->r.ysch)/100;
+ sizex= zoomx * rectx;
+ sizey= zoomy * recty;
+ offsx= (p->sa->winx-sizex)/2 + sseq->xof;
+ offsy= (p->sa->winy-sizey)/2 + sseq->yof;
+
+ /* calculate new points */
+ out[0]= (float)(mval[0] - offsx) / (float)sizex;
+ out[1]= (float)(mval[1] - offsy) / (float)sizey;
+ }
+ break;
+
+ default: /* just use raw mouse coordinates - BAD! */
+ out[0]= mval[0];
+ out[1]= mval[1];
+ break;
+ }
+ }
+
/* 2d - relative to screen (viewport area) */
else {
out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000;
@@ -979,23 +1294,21 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
}
/* add current stroke-point to buffer (returns whether point was successfully added) */
-static short gp_stroke_addpoint (tGPsdata *p, short mval[], float pressure)
+static short gp_stroke_addpoint (tGPsdata *p, short mval[2], float pressure)
{
bGPdata *gpd= p->gpd;
- bGPDspoint *pt;
+ tGPspoint *pt;
/* check if still room in buffer */
if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX)
return GP_STROKEADD_OVERFLOW;
-
/* get pointer to destination point */
- pt= gpd->sbuffer + gpd->sbuffer_size;
-
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, mval, &pt->x);
+ pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size);
- /* store other settings */
+ /* store settings */
+ pt->x= mval[0];
+ pt->y= mval[1];
pt->pressure= pressure;
/* increment counters */
@@ -1008,39 +1321,26 @@ static short gp_stroke_addpoint (tGPsdata *p, short mval[], float pressure)
return GP_STROKEADD_NORMAL;
}
-/* smooth a stroke (in buffer) before storing it */
-static void gp_stroke_smooth (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- int i=0, cmx=gpd->sbuffer_size;
-
- /* don't try if less than 2 points in buffer */
- if ((cmx <= 2) || (gpd->sbuffer == NULL))
- return;
-
- /* apply weighting-average (note doing this along path sequentially does introduce slight error) */
- for (i=0; i < gpd->sbuffer_size; i++) {
- bGPDspoint *pc= (gpd->sbuffer + i);
- bGPDspoint *pb= (i-1 > 0)?(pc-1):(pc);
- bGPDspoint *pa= (i-2 > 0)?(pc-2):(pb);
- bGPDspoint *pd= (i+1 < cmx)?(pc+1):(pc);
- bGPDspoint *pe= (i+2 < cmx)?(pc+2):(pd);
-
- pc->x= (0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x);
- pc->y= (0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y);
- }
-}
-
/* make a new stroke from the buffer data */
static void gp_stroke_newfrombuffer (tGPsdata *p)
{
bGPdata *gpd= p->gpd;
bGPDstroke *gps;
- bGPDspoint *pt, *ptc;
+ bGPDspoint *pt;
+ tGPspoint *ptc;
int i, totelem;
+
+ /* macro to test if only converting endpoints */
+ #define GP_BUFFER2STROKE_ENDPOINTS ((gpd->flag & GP_DATA_EDITPAINT) && (G.qual & LR_CTRLKEY))
- /* get total number of points to allocate space for */
- totelem = gpd->sbuffer_size;
+ /* get total number of points to allocate space for:
+ * - in 'Draw Mode', holding the Ctrl-Modifier will only take endpoints
+ * - otherwise, do whole stroke
+ */
+ if (GP_BUFFER2STROKE_ENDPOINTS)
+ totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size;
+ else
+ totelem = gpd->sbuffer_size;
/* exit with error if no valid points from this stroke */
if (totelem == 0) {
@@ -1061,19 +1361,263 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
gps->flag= gpd->sbuffer_sflag;
/* copy points from the buffer to the stroke */
- for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) {
- memcpy(pt, ptc, sizeof(bGPDspoint));
- pt++;
+ if (GP_BUFFER2STROKE_ENDPOINTS) {
+ /* 'Draw Mode' + Ctrl-Modifier - only endpoints */
+ {
+ /* first point */
+ ptc= gpd->sbuffer;
+
+ /* convert screen-coordinates to appropriate coordinates (and store them) */
+ gp_stroke_convertcoords(p, &ptc->x, &pt->x);
+
+ /* copy pressure */
+ pt->pressure= ptc->pressure;
+
+ pt++;
+ }
+
+ if (totelem == 2) {
+ /* last point if applicable */
+ ptc= ((tGPspoint *)gpd->sbuffer) + (gpd->sbuffer_size - 1);
+
+ /* convert screen-coordinates to appropriate coordinates (and store them) */
+ gp_stroke_convertcoords(p, &ptc->x, &pt->x);
+
+ /* copy pressure */
+ pt->pressure= ptc->pressure;
+ }
+ }
+ else {
+ /* convert all points (normal behaviour) */
+ for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) {
+ /* convert screen-coordinates to appropriate coordinates (and store them) */
+ gp_stroke_convertcoords(p, &ptc->x, &pt->x);
+
+ /* copy pressure */
+ pt->pressure= ptc->pressure;
+
+ pt++;
+ }
}
/* add stroke to frame */
BLI_addtail(&p->gpf->strokes, gps);
+
+ /* undefine macro to test if only converting endpoints */
+ #undef GP_BUFFER2STROKE_ENDPOINTS
+}
+
+/* --- 'Eraser' for 'Paint' Tool ------ */
+
+/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */
+static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i)
+{
+ bGPDspoint *pt_tmp= gps->points;
+ bGPDstroke *gsn = NULL;
+
+ /* if stroke only had two points, get rid of stroke */
+ if (gps->totpoints == 2) {
+ /* free stroke points, then stroke */
+ MEM_freeN(pt_tmp);
+ BLI_freelinkN(&gpf->strokes, gps);
+
+ /* nothing left in stroke, so stop */
+ return 1;
+ }
+
+ /* if last segment, just remove segment from the stroke */
+ else if (i == gps->totpoints - 2) {
+ /* allocate new points array, and assign most of the old stroke there */
+ gps->totpoints--;
+ gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
+ memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints);
+
+ /* free temp buffer */
+ MEM_freeN(pt_tmp);
+
+ /* nothing left in stroke, so stop */
+ return 1;
+ }
+
+ /* if first segment, just remove segment from the stroke */
+ else if (i == 0) {
+ /* allocate new points array, and assign most of the old stroke there */
+ gps->totpoints--;
+ gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
+ memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints);
+
+ /* free temp buffer */
+ MEM_freeN(pt_tmp);
+
+ /* no break here, as there might still be stuff to remove in this stroke */
+ return 0;
+ }
+
+ /* segment occurs in 'middle' of stroke, so split */
+ else {
+ /* duplicate stroke, and assign 'later' data to that stroke */
+ gsn= MEM_dupallocN(gps);
+ gsn->prev= gsn->next= NULL;
+ BLI_insertlinkafter(&gpf->strokes, gps, gsn);
+
+ gsn->totpoints= gps->totpoints - i;
+ gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points");
+ memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints);
+
+ /* adjust existing stroke */
+ gps->totpoints= i;
+ gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
+ memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i);
+
+ /* free temp buffer */
+ MEM_freeN(pt_tmp);
+
+ /* nothing left in stroke, so stop */
+ return 1;
+ }
+}
+
+/* eraser tool - check if part of stroke occurs within last segment drawn by eraser */
+static short gp_stroke_eraser_strokeinside (short mval[], short mvalo[], short rad, short x0, short y0, short x1, short y1)
+{
+ /* simple within-radius check for now */
+ if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1))
+ return 1;
+
+ /* not inside */
+ return 0;
+}
+
+/* eraser tool - evaluation per stroke */
+static void gp_stroke_eraser_dostroke (tGPsdata *p, short mval[], short mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
+{
+ bGPDspoint *pt1, *pt2;
+ short x0=0, y0=0, x1=0, y1=0;
+ short xyval[2];
+ int i;
+
+ if (gps->totpoints == 0) {
+ /* just free stroke */
+ if (gps->points)
+ MEM_freeN(gps->points);
+ BLI_freelinkN(&gpf->strokes, gps);
+ }
+ else if (gps->totpoints == 1) {
+ /* get coordinates */
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ project_short(&gps->points->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DSPACE) {
+ ipoco_to_areaco_noclip(p->v2d, &gps->points->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DIMAGE) {
+ ipoco_to_areaco_noclip(p->v2d, &gps->points->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+ }
+ else {
+ x0= (gps->points->x / 1000 * p->sa->winx);
+ y0= (gps->points->y / 1000 * p->sa->winy);
+ }
+
+ /* do boundbox check first */
+ if (BLI_in_rcti(rect, x0, y0)) {
+ /* only check if point is inside */
+ if ( ((x0-mval[0])*(x0-mval[0]) + (y0-mval[1])*(y0-mval[1])) <= rad*rad ) {
+ /* free stroke */
+ MEM_freeN(gps->points);
+ BLI_freelinkN(&gpf->strokes, gps);
+ }
+ }
+ }
+ else {
+ /* loop over the points in the stroke, checking for intersections
+ * - an intersection will require the stroke to be split
+ */
+ for (i=0; (i+1) < gps->totpoints; i++) {
+ /* get points to work with */
+ pt1= gps->points + i;
+ pt2= gps->points + i + 1;
+
+ /* get coordinates */
+ if (gps->flag & GP_STROKE_3DSPACE) {
+ project_short(&pt1->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+
+ project_short(&pt2->x, xyval);
+ x1= xyval[0];
+ y1= xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DSPACE) {
+ ipoco_to_areaco_noclip(p->v2d, &pt1->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+
+ ipoco_to_areaco_noclip(p->v2d, &pt2->x, xyval);
+ x1= xyval[0];
+ y1= xyval[1];
+ }
+ else if (gps->flag & GP_STROKE_2DIMAGE) {
+ ipoco_to_areaco_noclip(p->v2d, &pt1->x, xyval);
+ x0= xyval[0];
+ y0= xyval[1];
+
+ ipoco_to_areaco_noclip(p->v2d, &pt2->x, xyval);
+ x1= xyval[0];
+ y1= xyval[1];
+ }
+ else {
+ x0= (pt1->x / 1000 * p->sa->winx);
+ y0= (pt1->y / 1000 * p->sa->winy);
+ x1= (pt2->x / 1000 * p->sa->winx);
+ y1= (pt2->y / 1000 * p->sa->winy);
+ }
+
+ /* check that point segment of the boundbox of the eraser stroke */
+ if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) {
+ /* check if point segment of stroke had anything to do with
+ * eraser region (either within stroke painted, or on its lines)
+ * - this assumes that linewidth is irrelevant
+ */
+ if (gp_stroke_eraser_strokeinside(mval, mvalo, rad, x0, y0, x1, y1)) {
+ /* if function returns true, break this loop (as no more point to check) */
+ if (gp_stroke_eraser_splitdel(gpf, gps, i))
+ break;
+ }
+ }
+ }
+ }
+}
+
+/* erase strokes which fall under the eraser strokes */
+static void gp_stroke_doeraser (tGPsdata *p)
+{
+ bGPDframe *gpf= p->gpf;
+ bGPDstroke *gps, *gpn;
+ rcti rect;
+
+ /* rect is rectangle of eraser */
+ rect.xmin= p->mval[0] - p->radius;
+ rect.ymin= p->mval[1] - p->radius;
+ rect.xmax= p->mval[0] + p->radius;
+ rect.ymax= p->mval[1] + p->radius;
+
+ /* loop over strokes, checking segments for intersections */
+ for (gps= gpf->strokes.first; gps; gps= gpn) {
+ gpn= gps->next;
+ gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps);
+ }
}
/* ---------- 'Paint' Tool ------------ */
/* init new stroke */
-static void gp_paint_initstroke (tGPsdata *p)
+static void gp_paint_initstroke (tGPsdata *p, short paintmode)
{
/* get active layer (or add a new one if non-existent) */
p->gpl= gpencil_layer_getactive(p->gpd);
@@ -1096,8 +1640,13 @@ static void gp_paint_initstroke (tGPsdata *p)
}
else
p->gpf->flag |= GP_FRAME_PAINT;
-
- /* check if points will need to be made in 3d-space */
+
+ /* set 'eraser' for this stroke if using eraser */
+ p->paintmode= paintmode;
+ if (p->paintmode == GP_PAINTMODE_ERASER)
+ p->gpd->sbuffer_sflag |= GP_STROKE_ERASER;
+
+ /* check if points will need to be made in view-aligned space */
if (p->gpd->flag & GP_DATA_VIEWALIGN) {
switch (p->sa->spacetype) {
case SPACE_VIEW3D:
@@ -1116,6 +1665,14 @@ static void gp_paint_initstroke (tGPsdata *p)
case SPACE_SEQ:
{
/* for now, this is not applicable here... */
+ p->gpd->sbuffer_sflag |= GP_STROKE_2DIMAGE;
+ }
+ break;
+ case SPACE_IMAGE:
+ {
+ /* check if any ibuf available */
+ if (p->ibuf)
+ p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
}
break;
}
@@ -1125,11 +1682,11 @@ static void gp_paint_initstroke (tGPsdata *p)
/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */
static void gp_paint_strokeend (tGPsdata *p)
{
- /* sanitize stroke-points in buffer */
- gp_stroke_smooth(p);
-
- /* transfer stroke to frame */
- gp_stroke_newfrombuffer(p);
+ /* check if doing eraser or not */
+ if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) {
+ /* transfer stroke to frame */
+ gp_stroke_newfrombuffer(p);
+ }
/* clean up buffer now */
gp_session_validatebuffer(p);
@@ -1151,16 +1708,15 @@ static void gp_paint_cleanup (tGPsdata *p)
//BIF_undo_push("GPencil Stroke");
/* force redraw after drawing action */
- force_draw(0);
+ force_draw_plus(SPACE_ACTION, 0);
}
/* -------- */
/* main call to paint a new stroke */
-short gpencil_paint (short mousebutton)
+short gpencil_paint (short mousebutton, short paintmode)
{
tGPsdata p;
- short prevmval[2], mval[2];
float opressure, pressure;
short ok = GP_STROKEADD_NORMAL;
@@ -1170,7 +1726,7 @@ short gpencil_paint (short mousebutton)
gp_session_cleanup(&p);
return 0;
}
- gp_paint_initstroke(&p);
+ gp_paint_initstroke(&p, paintmode);
if (p.status == GP_STATUS_ERROR) {
gp_session_cleanup(&p);
return 0;
@@ -1180,31 +1736,51 @@ short gpencil_paint (short mousebutton)
setcursor_space(p.sa->spacetype, CURSOR_VPAINT);
/* init drawing-device settings */
- getmouseco_areawin(mval);
+ getmouseco_areawin(p.mval);
pressure = get_pressure();
- prevmval[0]= mval[0];
- prevmval[1]= mval[1];
+ p.mvalo[0]= p.mval[0];
+ p.mvalo[1]= p.mval[1];
opressure= pressure;
+ /* radius for eraser circle is thickness^2 */
+ p.radius= p.gpl->thickness * p.gpl->thickness;
+
+ /* start drawing eraser-circle (if applicable) */
+ if (paintmode == GP_PAINTMODE_ERASER)
+ draw_sel_circle(p.mval, NULL, p.radius, p.radius, 0); // draws frontbuffer, but sets backbuf again
+
/* only allow painting of single 'dots' if:
* - pressure is not excessive (as it can be on some windows tablets)
* - draw-mode for active datablock is turned on
+ * - not erasing
*/
- if (!(pressure >= 0.99f) || (p.gpd->flag & GP_DATA_EDITPAINT)) {
- gp_stroke_addpoint(&p, mval, pressure);
+ if (paintmode != GP_PAINTMODE_ERASER) {
+ if (!(pressure >= 0.99f) || (p.gpd->flag & GP_DATA_EDITPAINT)) {
+ gp_stroke_addpoint(&p, p.mval, pressure);
+ }
}
/* paint loop */
do {
/* get current user input */
- getmouseco_areawin(mval);
+ getmouseco_areawin(p.mval);
pressure = get_pressure();
/* only add current point to buffer if mouse moved (otherwise wait until it does) */
- if ((mval[0] != prevmval[0]) || (mval[1] != prevmval[1])) {
+ if (paintmode == GP_PAINTMODE_ERASER) {
+ /* do 'live' erasing now */
+ gp_stroke_doeraser(&p);
+
+ draw_sel_circle(p.mval, p.mvalo, p.radius, p.radius, 0);
+ force_draw(0);
+
+ p.mvalo[0]= p.mval[0];
+ p.mvalo[1]= p.mval[1];
+ }
+ else if (gp_stroke_filtermval(&p, p.mval, p.mvalo)) {
/* try to add point */
- ok= gp_stroke_addpoint(&p, mval, pressure);
+ ok= gp_stroke_addpoint(&p, p.mval, pressure);
/* handle errors while adding point */
if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) {
@@ -1212,8 +1788,8 @@ short gpencil_paint (short mousebutton)
gp_paint_strokeend(&p);
/* start a new stroke, starting from previous point */
- gp_stroke_addpoint(&p, prevmval, opressure);
- ok= gp_stroke_addpoint(&p, mval, pressure);
+ gp_stroke_addpoint(&p, p.mvalo, opressure);
+ ok= gp_stroke_addpoint(&p, p.mval, pressure);
}
else if (ok == GP_STROKEADD_INVALID) {
/* the painting operation cannot continue... */
@@ -1226,8 +1802,8 @@ short gpencil_paint (short mousebutton)
}
force_draw(0);
- prevmval[0]= mval[0];
- prevmval[1]= mval[1];
+ p.mvalo[0]= p.mval[0];
+ p.mvalo[1]= p.mval[1];
opressure= pressure;
}
else
@@ -1245,7 +1821,12 @@ short gpencil_paint (short mousebutton)
setcursor_space(p.sa->spacetype, CURSOR_STD);
/* check size of buffer before cleanup, to determine if anything happened here */
- ok= p.gpd->sbuffer_size;
+ if (paintmode == GP_PAINTMODE_ERASER) {
+ ok= 1; // fixme
+ draw_sel_circle(NULL, p.mvalo, 0, p.radius, 0);
+ }
+ else
+ ok= p.gpd->sbuffer_size;
/* cleanup */
gp_paint_cleanup(&p);
@@ -1259,28 +1840,53 @@ short gpencil_paint (short mousebutton)
/* All event (loops) handling checking if stroke drawing should be initiated
* should call this function.
*/
-short gpencil_do_paint (ScrArea *sa)
+short gpencil_do_paint (ScrArea *sa, short mbut)
{
bGPdata *gpd = gpencil_data_getactive(sa);
- short mousebutton = L_MOUSE; /* for now, this is always on L_MOUSE*/
short retval= 0;
/* check if possible to do painting */
if (gpd == NULL)
return 0;
- /* currently, we will only paint if:
+ /* currently, we will only 'paint' if:
* 1. draw-mode on gpd is set (for accessibility reasons)
- * (single 'dots' are only available via this method)
+ * a) single dots are only available by this method if a single click is made
+ * b) a straight line is drawn if ctrl-modifier is held (check is done when stroke is converted!)
* 2. if shift-modifier is held + lmb -> 'quick paint'
+ *
+ * OR
+ *
+ * draw eraser stroke if:
+ * 1. using the eraser on a tablet
+ * 2. draw-mode on gpd is set (for accessiblity reasons)
+ * (eraser is mapped to right-mouse)
+ * 3. Alt + 'select' mouse-button
+ * i.e. if LMB = select: Alt-LMB
+ * if RMB = select: Alt-RMB
*/
- if (gpd->flag & GP_DATA_EDITPAINT) {
- /* try to paint */
- retval = gpencil_paint(mousebutton);
+ if (get_activedevice() == 2) {
+ /* eraser on a tablet - always try to erase strokes */
+ retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
+ }
+ else if (gpd->flag & GP_DATA_EDITPAINT) {
+ /* try to paint/erase */
+ if (mbut == L_MOUSE)
+ retval = gpencil_paint(mbut, GP_PAINTMODE_DRAW);
+ else if (mbut == R_MOUSE)
+ retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
}
- else if (G.qual == LR_SHIFTKEY) {
- /* try to paint */
- retval = gpencil_paint(mousebutton);
+ else if (!(gpd->flag & GP_DATA_LMBPLOCK)) {
+ /* try to paint/erase as not locked */
+ if ((G.qual == LR_SHIFTKEY) && (mbut == L_MOUSE)) {
+ retval = gpencil_paint(mbut, GP_PAINTMODE_DRAW);
+ }
+ else if (G.qual == LR_ALTKEY) {
+ if ((U.flag & USER_LMOUSESELECT) && (mbut == L_MOUSE))
+ retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
+ else if (!(U.flag & USER_LMOUSESELECT) && (mbut == R_MOUSE))
+ retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
+ }
}
/* return result of trying to paint */
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index 50d343ca470..4bb7bb9677e 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -1683,7 +1683,7 @@ void action_buttons(void)
"Channel", xco, -2, xmax-3, 24, "");
xco+= xmax;
}
- else if ((G.saction->gpd) && (G.saction->mode==SACTCONT_GPENCIL)) {
+ else if (G.saction->mode==SACTCONT_GPENCIL) {
xmax= GetButStringLength("Channel");
uiDefPulldownBut(block, action_gplayermenu, NULL,
"Channel", xco, -2, xmax-3, 24, "");
@@ -1722,24 +1722,7 @@ void action_buttons(void)
xco += (90 + 8);
/* MODE-DEPENDENT DRAWING */
- if (G.saction->mode == SACTCONT_GPENCIL) {
- char gp_name[64];
-
- /* pin button */
- uiDefIconButS(block, ICONTOG, B_ACTPIN, ICON_PIN_DEHLT, xco,0,XIC,YIC, &G.saction->pin, 0, 0, 0, 0, "Keeps this view displaying the current data regardless of what Grease Pencil set is active");
- xco += (XIC + 5);
-
- /* just a simple string to help identify if any content */
- glRasterPos2f((float)xco, 5.0);
- BIF_RasterPos((float)xco, 5.0); // stupid texture fonts
- BIF_ThemeColor(TH_TEXT);
-
- sprintf(gp_name, (G.saction->gpd)?"Grease Pencil Data":"<None>");
- xmax= GetButStringLength(gp_name);
- BIF_DrawString(uiBlockGetCurFont(block), gp_name, (U.transopts & USER_TR_BUTTONS));
- xco += xmax;
- }
- else {
+ if (G.saction->mode != SACTCONT_GPENCIL) {
/* NAME ETC */
ob= OBACT;
from = (ID *)ob;
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
index fac9e3af1af..4ca287d81c5 100644
--- a/source/blender/src/header_image.c
+++ b/source/blender/src/header_image.c
@@ -239,8 +239,10 @@ void do_image_buttons(unsigned short event)
if(ima->twsta>=nr) ima->twsta= 1;
if(ima->twend>=nr) ima->twend= nr-1;
if(ima->twsta>ima->twend) ima->twsta= 1;
- allqueue(REDRAWIMAGE, 0);
}
+
+ allqueue(REDRAWIMAGE, 0);
+ allqueue(REDRAWVIEW3D, 0);
}
break;
}
@@ -475,6 +477,9 @@ static void do_image_viewmenu(void *arg, int event)
G.sima->flag ^= SI_LOCAL_UV;
allqueue(REDRAWIMAGE, 0);
break;
+ case 15: /* Grease Pencil... */
+ add_blockhandler(curarea, IMAGE_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
+ break;
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -497,6 +502,8 @@ static uiBlock *image_viewmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Curves Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Composite Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
+
if(G.sima->flag & SI_LOCAL_UV) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
if(!(G.sima->flag & SI_LOCAL_UV)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
@@ -1293,7 +1300,7 @@ void image_buttons(void)
uiBlockEndAlign(block);
xco+= 166;
}
- uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button");
+ uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enable image painting");
xco+= XIC+8;
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c
index dac7c7bc2c6..9bacc2b6351 100644
--- a/source/blender/src/header_info.c
+++ b/source/blender/src/header_info.c
@@ -118,6 +118,9 @@
#include "BPY_extern.h"
#include "BPY_menus.h"
+#include "GPU_extensions.h"
+#include "GPU_material.h"
+
#include "blendef.h"
#include "interface.h"
#include "mydevice.h"
@@ -540,6 +543,42 @@ static void check_packAll()
}
}
+#ifdef _WIN32
+static void copy_game_dll(char *dll_filename, char *source_dir, char *dest_dir)
+{
+ char source_filename[FILE_MAX];
+ char dest_filename[FILE_MAX];
+
+ strcpy( source_filename, source_dir );
+ strcat( source_filename, dll_filename );
+
+ strcpy( dest_filename, dest_dir );
+ strcat( dest_filename, dll_filename );
+
+ if(!BLI_exists(dest_filename)) {
+ BLI_copy_fileops( source_filename, dest_filename );
+ }
+}
+
+static void copy_all_game_dlls(char *str)
+{
+#define GAME_DLL_COUNT 7
+ char *game_dll_list[GAME_DLL_COUNT]={"gnu_gettext.dll", "libpng.dll", "libtiff.dll", "pthreadVC2.dll", "python25.dll", "SDL.dll", "zlib.dll"};
+
+ char dest_dir[FILE_MAX];
+ char source_dir[FILE_MAX];
+ int i;
+
+ strcpy(source_dir, get_install_dir());
+ strcat(source_dir, "\\");
+ BLI_split_dirfile_basic(str, dest_dir, NULL);
+
+ for (i= 0; i< GAME_DLL_COUNT; i++) {
+ copy_game_dll(game_dll_list[i], source_dir, dest_dir );
+ };
+}
+#endif
+
static int write_runtime(char *str, char *exename)
{
char *freestr= NULL;
@@ -587,7 +626,14 @@ static void write_runtime_check(char *str)
#endif
write_runtime(str, player);
+
+#ifdef _WIN32
+ // get a list of the .DLLs in the Blender folder and copy all of these to the destination folder if they don't exist
+ copy_all_game_dlls(str);
+#endif
}
+
+
/* end keyed functions */
/************************** MAIN MENU *****************************/
@@ -881,7 +927,7 @@ static void do_info_filemenu(void *arg, int event)
winqueue_break= 1; /* leave queues everywhere */
BKE_reset_undo();
- BKE_write_undo("original"); /* save current state */
+ BKE_write_undo("Original"); /* save current state */
refresh_interface_font();
}
break;
@@ -1026,7 +1072,7 @@ static uiBlock *info_externalfiles(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "info_externalfiles", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_info_externalfiles, NULL);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into Blend", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into .blend file", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
#if 0
uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Removes all packed files from the project and saves them to the current directory");
#endif
@@ -1036,8 +1082,8 @@ static uiBlock *info_externalfiles(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Relative", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Absolute", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
@@ -1078,9 +1124,9 @@ static uiBlock *info_filemenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, "");
#if GAMEBLENDER == 1
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
#ifdef _WIN32
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, "");
+// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, "");
#endif
#endif
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@@ -1546,20 +1592,83 @@ static uiBlock *info_addmenu(void *arg_unused)
/************************** GAME *****************************/
-
+void do_info_game_glslmenu(void *arg, int event)
+{
+ switch (event) {
+ case G_FILE_GLSL_NO_LIGHTS:
+ case G_FILE_GLSL_NO_SHADERS:
+ case G_FILE_GLSL_NO_SHADOWS:
+ case G_FILE_GLSL_NO_RAMPS:
+ case G_FILE_GLSL_NO_NODES:
+ case G_FILE_GLSL_NO_EXTRA_TEX:
+ G.fileflags ^= event;
+ GPU_materials_free();
+ allqueue(REDRAWINFO, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ break;
+ default:
+ break;
+ }
+}
+
+static uiBlock *info_game_glslmenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco= 0, menuwidth=160;
+ int check;
+
+ block= uiNewBlock(&curarea->uiblocks, "game_glslmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_info_game_glslmenu, NULL);
+
+ check = (G.fileflags & G_FILE_GLSL_NO_LIGHTS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
+ uiDefIconTextBut(block, BUTM, 1, check, "Enable Lights", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_LIGHTS,
+ "Enable using lights in GLSL materials.");
+ check = (G.fileflags & G_FILE_GLSL_NO_SHADERS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
+ uiDefIconTextBut(block, BUTM, 1, check, "Enable Shaders", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_SHADERS,
+ "Enable using shaders other than Lambert in GLSL materials");
+ check = (G.fileflags & G_FILE_GLSL_NO_SHADOWS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
+ uiDefIconTextBut(block, BUTM, 1, check, "Enable Shadows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_SHADOWS,
+ "Enable using shadows in GLSL materials");
+ check = (G.fileflags & G_FILE_GLSL_NO_RAMPS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
+ uiDefIconTextBut(block, BUTM, 1, check, "Enable Ramps", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_RAMPS,
+ "Enable using ramps in GLSL materials");
+ check = (G.fileflags & G_FILE_GLSL_NO_NODES)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
+ uiDefIconTextBut(block, BUTM, 1, check, "Enable Nodes", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_NODES,
+ "Enable using nodes in GLSL materials.");
+ check = (G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
+ uiDefIconTextBut(block, BUTM, 1, check, "Enable Extra Textures", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_EXTRA_TEX,
+ "Enable using texture channels other than Col and Alpha in GLSL materials.");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 50);
+
+ return block;
+}
+
static void do_info_gamemenu(void *arg, int event)
{
switch (event) {
case G_FILE_ENABLE_ALL_FRAMES:
- case G_FILE_DIAPLAY_LISTS:
+ case G_FILE_DISPLAY_LISTS:
case G_FILE_SHOW_FRAMERATE:
case G_FILE_SHOW_DEBUG_PROPS:
case G_FILE_AUTOPLAY:
case G_FILE_GAME_TO_IPO:
- case G_FILE_GAME_MAT:
case G_FILE_SHOW_PHYSICS:
G.fileflags ^= event;
break;
+ case G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL:
+ G.fileflags &= ~(G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL);
+ break;
+ case G_FILE_GAME_MAT:
+ G.fileflags |= G_FILE_GAME_MAT;
+ G.fileflags &= ~G_FILE_GAME_MAT_GLSL;
+ break;
+ case G_FILE_GAME_MAT_GLSL:
+ if(!GPU_extensions_minimum_support())
+ error("GLSL not supported with this graphics card or driver.");
+ G.fileflags |= (G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL);
+ break;
default:
; /* ignore the rest */
}
@@ -1590,22 +1699,14 @@ static uiBlock *info_gamemenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, "");
} else {
- if(G.fileflags & G_FILE_DIAPLAY_LISTS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DIAPLAY_LISTS, "");
+ if(G.fileflags & G_FILE_DISPLAY_LISTS) {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DISPLAY_LISTS, "");
} else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DIAPLAY_LISTS, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DISPLAY_LISTS, "");
}
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, "");
}
- if(G.fileflags & G_FILE_GAME_MAT) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Use Blender Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Use Blender Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT, "");
- }
-
-
-
if(G.fileflags & G_FILE_SHOW_FRAMERATE) {
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE, "");
} else {
@@ -1624,6 +1725,28 @@ static uiBlock *info_gamemenu(void *arg_unused)
} else {
uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS, "");
}
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, "");
+
+ if(!(G.fileflags & G_FILE_GAME_MAT)) {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Texture Face Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
+ } else {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Texture Face Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL, "");
+ }
+
+ if((G.fileflags & G_FILE_GAME_MAT) && !(G.fileflags & G_FILE_GAME_MAT_GLSL)) {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Blender Multitexture Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
+ } else {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Blender Multitexture Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT, "");
+ }
+
+ if((G.fileflags & G_FILE_GAME_MAT) && (G.fileflags & G_FILE_GAME_MAT_GLSL)) {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Blender GLSL Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
+ } else {
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Blender GLSL Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT_GLSL, "");
+ }
+
+ uiDefIconTextBlockBut(block, info_game_glslmenu, NULL, ICON_RIGHTARROW_THIN, "GLSL Material Settings", 0, yco-=20, menuwidth, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, "");
@@ -2063,13 +2186,16 @@ static void info_text(int x, int y)
{
Object *ob= OBACT;
extern float hashvectf[];
- extern unsigned long mem_in_use, mmap_in_use;
+ uintptr_t mem_in_use, mmap_in_use;
unsigned int swatch_color;
float fac1, fac2, fac3;
char infostr[300], memstr[64];
char *headerstr, *s;
int hsize;
+ mem_in_use= MEM_get_memory_in_use();
+ mmap_in_use= MEM_get_mapped_memory_in_use();
+
s= memstr + sprintf(memstr," | Mem:%.2fM ", ((mem_in_use-mmap_in_use)>>10)/1024.0);
if(mmap_in_use)
sprintf(s,"(%.2fM) ", ((mmap_in_use)>>10)/1024.0);
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c
index 15caf325ec6..59d542e72ec 100644
--- a/source/blender/src/header_ipo.c
+++ b/source/blender/src/header_ipo.c
@@ -970,7 +970,7 @@ static char *ipo_modeselect_pup(void)
if(ob && ob->type==OB_LAMP)
str += sprintf(str,formatstring, "Lamp",ID_LA, ICON_LAMP);
- if(ob && give_current_texture(ob, ob->actcol))
+ if((ob && give_current_texture(ob, ob->actcol))||(give_current_world_texture()))
str += sprintf(str,formatstring, "Texture",ID_TE, ICON_TEXTURE);
if(ob){
diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c
index 4c7b4aa80bc..d27a41c59f5 100644
--- a/source/blender/src/header_node.c
+++ b/source/blender/src/header_node.c
@@ -112,7 +112,7 @@ static void do_node_viewmenu(void *arg, int event)
break;
case 4: /* Grease Pencil */
add_blockhandler(curarea, NODES_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
+ break;
}
allqueue(REDRAWNODE, 0);
}
@@ -602,11 +602,11 @@ static uiBlock *node_nodemenu(void *arg_unused)
if(snode->treetype==NTREE_COMPOSIT) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Execute Composite|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Read Saved Render Results|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Read Saved Full Sample Results|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Read Saved Full Sample Results|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect Node to Viewer|Ctrl LMB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect Node to Viewer|Ctrl RMB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
}
diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c
index 3c96e1692bf..53c4b9b5953 100644
--- a/source/blender/src/header_script.c
+++ b/source/blender/src/header_script.c
@@ -63,12 +63,14 @@
#include "blendef.h"
#include "mydevice.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/* ********************** SCRIPT ****************************** */
/* action executed after clicking in Scripts menu */
static void do_scripts_submenus(void *int_arg, int event)
{
- int menutype = (long)int_arg;
+ int menutype = (intptr_t)int_arg;
BPY_menu_do_python (menutype, event);
@@ -80,7 +82,7 @@ static uiBlock *script_scripts_submenus(void *int_menutype)
uiBlock *block;
short yco = 20, menuwidth = 120;
BPyMenu *pym;
- int i = 0, menutype = (long)int_menutype;
+ int i = 0, menutype = (intptr_t)int_menutype;
if ((menutype < 0) || (menutype > PYMENU_SCRIPTS_MENU_TOTAL))
return NULL;
@@ -132,7 +134,7 @@ static uiBlock *script_scriptsmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL);
for (i = 0; i < PYMENU_SCRIPTS_MENU_TOTAL; i++) {
- uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(long)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, "");
+ uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(intptr_t)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, "");
}
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/header_text.c b/source/blender/src/header_text.c
index cf6d21ff264..e7552434b19 100644
--- a/source/blender/src/header_text.c
+++ b/source/blender/src/header_text.c
@@ -42,6 +42,7 @@
#include "BMF_Api.h"
#include "BIF_language.h"
+#include "MEM_guardedalloc.h"
#include "BSE_headerbuttons.h"
@@ -52,6 +53,7 @@
#include "DNA_constraint_types.h"
#include "DNA_action_types.h"
+#include "BIF_gl.h" /* for glRasterPos2i */
#include "BIF_drawtext.h"
#include "BIF_interface.h"
#include "BIF_resources.h"
@@ -128,7 +130,7 @@ void do_text_buttons(unsigned short event)
st->top= 0;
pop_space_text(st);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
}
@@ -194,14 +196,20 @@ void do_text_buttons(unsigned short event)
break;
case B_TAB_NUMBERS:
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
case B_SYNTAX:
- if (st->showsyntax) {
- get_format_string(st);
- }
+ if (st->showsyntax) txt_format_text(st);
+ allqueue(REDRAWTEXT, 0);
+ allqueue(REDRAWHEADERS, 0);
+ break;
+ case B_TEXTPLUGINS:
+ allqueue(REDRAWHEADERS, 0);
+ break;
+ case B_WORDWRAP:
+ st->left= 0;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
@@ -239,6 +247,37 @@ static uiBlock *text_template_scriptsmenu (void *args_unused)
return block;
}
+static void do_text_plugin_scriptsmenu(void *arg, int event)
+{
+ BPY_menu_do_python(PYMENU_TEXTPLUGIN, event);
+
+ allqueue(REDRAWIMAGE, 0);
+}
+
+static uiBlock *text_plugin_scriptsmenu (void *args_unused)
+{
+ uiBlock *block;
+ BPyMenu *pym;
+ int i= 0;
+ short yco = 20, menuwidth = 120;
+
+ block= uiNewBlock(&curarea->uiblocks, "text_plugin_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_text_plugin_scriptsmenu, NULL);
+
+ /* note that we acount for the N previous entries with i+20: */
+ for (pym = BPyMenuTable[PYMENU_TEXTPLUGIN]; pym; pym = pym->next, i++) {
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
+ NULL, 0.0, 0.0, 1, i,
+ pym->tooltip?pym->tooltip:pym->filename);
+ }
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+
+ return block;
+}
+
/* action executed after clicking in File menu */
static void do_text_filemenu(void *arg, int event)
{
@@ -268,7 +307,7 @@ static void do_text_filemenu(void *arg, int event)
if (!reopen_text(text)) {
error("Could not reopen file");
}
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
}
break;
case 5:
@@ -277,9 +316,14 @@ static void do_text_filemenu(void *arg, int event)
txt_write_file(text);
break;
case 6:
- run_python_script(st);
+ text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
+ MEM_freeN(text->name);
+ text->name= NULL;
break;
case 7:
+ run_python_script(st);
+ break;
+ case 8:
{
Object *ob;
bConstraint *con;
@@ -340,11 +384,17 @@ static void do_text_editmenu(void *arg, int event)
switch(event) {
case 1:
txt_do_undo(text);
+ pop_space_text(st);
break;
case 2:
txt_do_redo(text);
+ pop_space_text(st);
break;
case 3:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
txt_copy_clipboard(text);
txt_cut_sel(text);
pop_space_text(st);
@@ -354,8 +404,12 @@ static void do_text_editmenu(void *arg, int event)
txt_copy_clipboard(text);
break;
case 5:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
txt_paste_clipboard(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
break;
case 6:
txt_print_cutbuffer();
@@ -364,10 +418,11 @@ static void do_text_editmenu(void *arg, int event)
jumptoline_interactive(st);
break;
case 8:
- txt_find_panel(st,1);
- break;
case 9:
- txt_find_panel(st,0);
+ find_and_replace(st, 0);
+ break;
+ case 10:
+ find_and_replace(st, 1);
break;
default:
break;
@@ -443,6 +498,57 @@ static void do_text_editmenu_selectmenu(void *arg, int event)
}
}
+/* action executed after clicking in Markers menu */
+static void do_text_editmenu_markermenu(void *arg, int event)
+{
+ SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
+ Text *text;
+ TextMarker *mrk;
+ ScrArea *sa;
+ int lineno;
+
+ if (st==NULL || st->spacetype != SPACE_TEXT) return;
+
+ text = st->text;
+
+ switch(event) {
+ case 1:
+ txt_clear_markers(text, 0, 0);
+ break;
+ case 2:
+ lineno= txt_get_span(text->lines.first, text->curl);
+ mrk= text->markers.first;
+ while (mrk && (mrk->lineno<lineno || (mrk->lineno==lineno && mrk->start <= text->curc)))
+ mrk= mrk->next;
+ if (!mrk) mrk= text->markers.first;
+ if (mrk) {
+ txt_move_to(text, mrk->lineno, mrk->start, 0);
+ txt_move_to(text, mrk->lineno, mrk->end, 1);
+ }
+ break;
+ case 3:
+ lineno= txt_get_span(text->lines.first, text->curl);
+ mrk= text->markers.last;
+ while (mrk && (mrk->lineno>lineno || (mrk->lineno==lineno && mrk->end > text->curc)))
+ mrk= mrk->prev;
+ if (!mrk) mrk= text->markers.last;
+ if (mrk) {
+ txt_move_to(text, mrk->lineno, mrk->start, 0);
+ txt_move_to(text, mrk->lineno, mrk->end, 1);
+ }
+ break;
+ default:
+ break;
+ }
+
+ for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
+ SpaceText *st= sa->spacedata.first;
+ if (st && st->spacetype==SPACE_TEXT) {
+ scrarea_queue_redraw(sa);
+ }
+ }
+}
+
/* action executed after clicking in Format menu */
static void do_text_formatmenu(void *arg, int event)
{
@@ -456,6 +562,10 @@ static void do_text_formatmenu(void *arg, int event)
switch(event) {
case 3:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
if (txt_has_sel(text)) {
txt_order_cursors(text);
indent(text);
@@ -466,6 +576,10 @@ static void do_text_formatmenu(void *arg, int event)
break;
}
case 4:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
if ( txt_has_sel(text)) {
txt_order_cursors(text);
unindent(text);
@@ -473,18 +587,26 @@ static void do_text_formatmenu(void *arg, int event)
}
break;
case 5:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
if ( txt_has_sel(text)) {
txt_order_cursors(text);
comment(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
break;
}
break;
case 6:
+ if (text && text->id.lib) {
+ error_libdata();
+ break;
+ }
if ( txt_has_sel(text)) {
txt_order_cursors(text);
uncomment(text);
- if (st->showsyntax) get_format_string(st);
+ if (st->showsyntax) txt_format_text(st);
break;
}
break;
@@ -536,6 +658,25 @@ static uiBlock *text_editmenu_selectmenu(void *arg_unused)
return block;
}
+/* Select menu */
+static uiBlock *text_editmenu_markermenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco = 20, menuwidth = 120;
+
+ block= uiNewBlock(&curarea->uiblocks, "text_editmenu_markermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_text_editmenu_markermenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Marker", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Marker", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+
+ return block;
+}
+
void do_text_formatmenu_convert(void *arg, int event)
{
SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
@@ -649,10 +790,12 @@ static uiBlock *text_editmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBlockBut(block, text_editmenu_viewmenu, NULL, ICON_RIGHTARROW_THIN, "View|Alt Shift V ", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, text_editmenu_selectmenu, NULL, ICON_RIGHTARROW_THIN, "Select|Alt Shift S ", 0, yco-=20, 120, 19, "");
+ uiDefIconTextBlockBut(block, text_editmenu_markermenu, NULL, ICON_RIGHTARROW_THIN, "Markers", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump...|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find...|Alt Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Again|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find And Replace...|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Next|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBlockBut(block, text_editmenu_to3dmenu, NULL, ICON_RIGHTARROW_THIN, "Text to 3d Object", 0, yco-=20, 120, 19, "");
@@ -690,17 +833,21 @@ static uiBlock *text_filemenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
+ if (text->name)
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Internal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Run Python Script|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Run Python Script|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
if (BPY_is_pyconstraint(text))
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Refresh All PyConstraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Refresh All PyConstraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
}
uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, "");
+ uiDefIconTextBlockBut(block, text_plugin_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Text Plugins", 0, yco-=20, 120, 19, "");
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
@@ -715,13 +862,15 @@ static uiBlock *text_filemenu(void *arg_unused)
}
/* header */
+#define PATH_MAX 260
void text_buttons(void)
{
uiBlock *block;
SpaceText *st= curarea->spacedata.first;
Text *text;
short xco, xmax;
- char naam[256];
+ char naam[256], fname[PATH_MAX], headtxt[PATH_MAX+17];
+ int len;
if (st==NULL || st->spacetype != SPACE_TEXT) return;
@@ -779,8 +928,9 @@ void text_buttons(void)
else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
uiDefIconButI(block, ICONTOG, B_TEXTLINENUM, ICON_LONGDISPLAY, xco+=XIC,0,XIC,YIC, &st->showlinenrs, 0, 0, 0, 0, "Displays line numbers");
-
- uiDefIconButI(block, ICONTOG, B_SYNTAX, ICON_SYNTAX, xco+=XIC,0,XIC,YIC, &st->showsyntax, 0, 0, 0, 0, "Enables Syntax Highlighting");
+ uiDefIconButI(block, ICONTOG, B_WORDWRAP, ICON_WORDWRAP, xco+=XIC,0,XIC,YIC, &st->wordwrap, 0, 0, 0, 0, "Enables word wrap");
+ uiDefIconButI(block, ICONTOG, B_SYNTAX, ICON_SYNTAX, xco+=XIC,0,XIC,YIC, &st->showsyntax, 0, 0, 0, 0, "Enables syntax highlighting");
+ uiDefIconButI(block, ICONTOG, B_TEXTPLUGINS, ICON_PYTHON, xco+=XIC,0,XIC,YIC, &st->doplugins, 0, 0, 0, 0, "Enables Python text plugins");
uiBlockEndAlign(block);
/* STD TEXT BUTTONS */
@@ -804,9 +954,30 @@ void text_buttons(void)
uiDefButI(block, MENU, B_TEXTFONT, "Screen 12 %x0|Screen 15%x1", xco,0,100,YIC, &st->font_id, 0, 0, 0, 0, "Displays available fonts");
xco+=110;
- uiDefButI(block, NUM, B_TAB_NUMBERS, "Tab:", xco, 0, XIC+50, YIC, &st->tabnumber, 2, 8, 0, 0, "Set spacing of Tab");
+ uiDefButI(block, NUM, B_TAB_NUMBERS, "Tab:", xco, 0, XIC+50, YIC, &st->tabnumber, 2, 8, 0, 0, "Set spacing of Tab");
xco+= XIC+50;
-
+
+ /* File info */
+ if (text) {
+ if (text->name) {
+ len = strlen(text->name);
+ if (len > PATH_MAX-1)
+ len = PATH_MAX-1;
+ strncpy(fname, text->name, len);
+ fname[len]='\0';
+ if (text->flags & TXT_ISDIRTY)
+ sprintf(headtxt, "File: *%s (unsaved)", fname);
+ else
+ sprintf(headtxt, "File: %s", fname);
+ } else {
+ sprintf(headtxt, text->id.lib?"Text: External":"Text: Internal");
+ }
+ BIF_ThemeColor(TH_MENU_TEXT);
+ glRasterPos2i(xco+=XIC, 5);
+ BMF_DrawString(G.font, headtxt);
+ xco += BMF_GetStringWidth(G.font, headtxt);
+ }
+
/* always as last */
curarea->headbutlen= xco+2*XIC;
diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c
index 71bf0cd9bd4..704d4bdea54 100644
--- a/source/blender/src/header_view3d.c
+++ b/source/blender/src/header_view3d.c
@@ -166,9 +166,9 @@ void do_layer_buttons(short event)
if(event==-1 && (G.qual & LR_CTRLKEY)) {
G.vd->scenelock= !G.vd->scenelock;
do_view3d_buttons(B_SCENELOCK);
- } else if (event==-1) {
+ } else if (event<0) {
if(G.vd->lay== (1<<20)-1) {
- if(G.qual & LR_SHIFTKEY) G.vd->lay= oldlay;
+ if(event==-2 || G.qual & LR_SHIFTKEY) G.vd->lay= oldlay;
}
else {
oldlay= G.vd->lay;
@@ -605,6 +605,9 @@ static void do_view3d_viewmenu(void *arg, int event)
case 21: /* Grease Pencil */
add_blockhandler(curarea, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
break;
+ case 22: /* View all layers */
+ do_layer_buttons(-2);
+ break;
}
allqueue(REDRAWVIEW3D, 1);
}
@@ -648,6 +651,11 @@ static uiBlock *view3d_viewmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+ if(G.vd->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
+ else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
if(G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
if(!G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
@@ -726,6 +734,9 @@ void do_view3d_select_object_typemenu(void *arg, int event)
case 10: /* Lamp */
selectall_type(OB_LAMP);
break;
+ case 20:
+ do_layer_buttons(-2);
+ break;
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -1314,12 +1325,21 @@ static void do_view3d_select_armaturemenu(void *arg, int event)
case 2: /* Select/Deselect all */
deselectall_armature(1, 1);
break;
- case 3: /* Select Parent(s) */
- select_bone_parent();
- break;
- case 4: /* Swap Select All */
+ case 3: /* Swap Select All */
deselectall_armature(3, 1);
break;
+ case 4: /* Select parent */
+ armature_select_hierarchy(BONE_SELECT_PARENT, 0);
+ break;
+ case 5: /* Select child */
+ armature_select_hierarchy(BONE_SELECT_CHILD, 0);
+ break;
+ case 6: /* Extend Select parent */
+ armature_select_hierarchy(BONE_SELECT_PARENT, 1);
+ break;
+ case 7: /* Extend Select child */
+ armature_select_hierarchy(BONE_SELECT_CHILD, 1);
+ break;
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -1337,11 +1357,18 @@ static uiBlock *view3d_select_armaturemenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
}
@@ -1368,12 +1395,21 @@ static void do_view3d_select_pose_armaturemenu(void *arg, int event)
case 3: /* Select Target(s) of Constraint(s) */
pose_select_constraint_target();
break;
- case 4: /* Select Bone's Parent */
- select_bone_parent();
- break;
case 5: /* Swap Select All */
deselectall_posearmature(OBACT, 3, 1);
break;
+ case 6: /* Select parent */
+ pose_select_hierarchy(BONE_SELECT_PARENT, 0);
+ break;
+ case 7: /* Select child */
+ pose_select_hierarchy(BONE_SELECT_CHILD, 0);
+ break;
+ case 8: /* Extend Select parent */
+ pose_select_hierarchy(BONE_SELECT_PARENT, 1);
+ break;
+ case 9: /* Extend Select child */
+ pose_select_hierarchy(BONE_SELECT_CHILD, 1);
+ break;
}
allqueue(REDRAWVIEW3D, 0);
}
@@ -1393,8 +1429,17 @@ static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Constraint Target|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
+
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
}
@@ -2196,6 +2241,7 @@ static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mass|Ctrl C, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Damping|Ctrl C, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Physical Attributes|Ctrl C, 11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Properties|Ctrl C, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Logic Bricks|Ctrl C, 10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Protected Transform |Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 29, "");
@@ -2466,8 +2512,11 @@ static void do_view3d_edit_objectmenu(void *arg, int event)
case 15: /* Object Panel */
add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
break;
+ case 16: /* make proxy object*/
+ make_proxy();
+ break;
#ifdef WITH_VERSE
- case 16: /* Share Object at Verse server */
+ case 17: /* Share Object at Verse server */
if(session_list.first != session_list.last) session = session_menu();
else session = session_list.first;
if(session) b_verse_push_object(session, ob);
@@ -2492,7 +2541,7 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused)
if (base) ob= base->object;
if(ob && (ob->type == OB_MESH) && (!ob->vnode)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
}
}
@@ -2518,6 +2567,7 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Proxy|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, "");
@@ -4320,6 +4370,9 @@ static void do_view3d_pose_armaturemenu(void *arg, int event)
case 18:
pose_autoside_names(event-16);
break;
+ case 19: /* assign pose as restpose */
+ apply_armature_pose2bones();
+ break;
}
allqueue(REDRAWVIEW3D, 0);
@@ -4345,6 +4398,7 @@ static uiBlock *view3d_pose_armaturemenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Pose as Restpose|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@@ -4458,7 +4512,7 @@ static void do_view3d_tpaintmenu(void *arg, int event)
{
switch(event) {
case 0: /* undo image painting */
- imagepaint_undo();
+ undo_imagepaint_step(1);
break;
}
@@ -5089,7 +5143,7 @@ static char *snapmode_pup(void)
static char string[512];
char *str = string;
- str += sprintf(str, "%s", "Snap Mode: %t");
+ str += sprintf(str, "%s", "Snap Element: %t");
str += sprintf(str, "%s", "|Vertex%x0");
str += sprintf(str, "%s", "|Edge%x1");
str += sprintf(str, "%s", "|Face%x2");
@@ -5333,7 +5387,11 @@ void do_view3d_buttons(short event)
case B_MAN_MODE:
allqueue(REDRAWVIEW3D, 1);
break;
-
+ case B_VIEW_BUTSEDIT:
+ allqueue(REDRAWVIEW3D, 1);
+ allqueue(REDRAWBUTSEDIT, 1);
+ break;
+
default:
if(event>=B_LAY && event<B_LAY+31) {
@@ -5513,6 +5571,16 @@ static void view3d_header_pulldowns(uiBlock *block, short *xcoord)
*xcoord= xco;
}
+static int view3d_layer_icon(int but_lay, int ob_lay, int used_lay)
+{
+ if (but_lay & ob_lay)
+ return ICON_LAYER_ACTIVE;
+ else if (but_lay & used_lay)
+ return ICON_LAYER_USED;
+ else
+ return ICON_BLANK1;
+}
+
void view3d_buttons(void)
{
uiBlock *block;
@@ -5616,7 +5684,7 @@ void view3d_buttons(void)
}
} else {
if (G.obedit==NULL && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) {
- uiDefIconButBitI(block, TOG, G_FACESELECT, B_REDR, ICON_FACESEL_HLT,xco,0,XIC,YIC, &G.f, 0, 0, 0, 0, "Painting Mask (FKey)");
+ uiDefIconButBitI(block, TOG, G_FACESELECT, B_VIEW_BUTSEDIT, ICON_FACESEL_HLT,xco,0,XIC,YIC, &G.f, 0, 0, 0, 0, "Painting Mask (FKey)");
xco+= XIC+10;
} else {
/* Manipulators arnt used in weight paint mode */
@@ -5679,19 +5747,22 @@ void view3d_buttons(void)
/* LAYERS */
if(G.obedit==NULL && G.vd->localview==0) {
+ int ob_lay = ob ? ob->lay : 0;
uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<a, B_LAY+a, "", (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Num, Shift Num)");
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, "",(short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
-
+ for(a=0; a<5; a++) {
+ uiDefIconButBitI(block, TOG, 1<<a, B_LAY+a, view3d_layer_icon(1<<a, ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
+ }
+ for(a=0; a<5; a++) {
+ uiDefIconButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, view3d_layer_icon(1<<(a+10), ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
+ }
xco+= 5;
uiBlockBeginAlign(block);
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<a, B_LAY+a, "", (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Num, Shift Num)");
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, "",(short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
-
+ for(a=5; a<10; a++) {
+ uiDefIconButBitI(block, TOG, 1<<a, B_LAY+a, view3d_layer_icon(1<<a, ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
+ }
+ for(a=5; a<10; a++) {
+ uiDefIconButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, view3d_layer_icon(1<<(a+10), ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
+ }
uiBlockEndAlign(block);
xco+= (a-2)*(XIC/2)+3;
@@ -5727,7 +5798,7 @@ void view3d_buttons(void)
xco+= XIC;
uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode");
xco+= XIC;
- uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
+ uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
xco+= 70;
} else {
uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)");
diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c
index 1a91ada1562..44044841a99 100644
--- a/source/blender/src/headerbuttons.c
+++ b/source/blender/src/headerbuttons.c
@@ -154,7 +154,6 @@
#include "BSE_editipo.h"
#include "BSE_drawipo.h"
-#include "BDR_drawmesh.h"
#include "BDR_vpaint.h"
#include "BDR_editface.h"
#include "BDR_editobject.h"
@@ -165,6 +164,8 @@
#include "BPY_extern.h"
#include "BPY_menus.h"
+#include "GPU_draw.h"
+
#include "mydevice.h"
#include "blendef.h"
#include "interface.h"
@@ -1425,11 +1426,11 @@ void do_global_buttons(unsigned short event)
show_splash();
break;
case B_MIPMAPCHANGED:
- set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
+ GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
allqueue(REDRAWVIEW3D, 0);
break;
case B_GLRESLIMITCHANGED:
- free_all_realtime_images(); /* force reloading with new res limit */
+ GPU_free_images(); /* force reloading with new res limit */
allqueue(REDRAWVIEW3D, 0);
break;
case B_NEWSPACE:
diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c
index 15c289cc21c..164c368b6fa 100644
--- a/source/blender/src/imagepaint.c
+++ b/source/blender/src/imagepaint.c
@@ -44,6 +44,8 @@
#include "BLI_winstuff.h"
#endif
#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BLI_dynstr.h"
#include "PIL_time.h"
#include "IMB_imbuf.h"
@@ -64,10 +66,12 @@
#include "BKE_brush.h"
#include "BKE_global.h"
#include "BKE_image.h"
+#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_node.h"
#include "BKE_utildefines.h"
+#include "BIF_interface.h"
#include "BIF_mywindow.h"
#include "BIF_screen.h"
#include "BIF_space.h"
@@ -78,10 +82,11 @@
#include "BSE_trans_types.h"
#include "BSE_view.h"
-#include "BDR_drawmesh.h"
#include "BDR_imagepaint.h"
#include "BDR_vpaint.h"
+#include "GPU_draw.h"
+
#include "GHOST_Types.h"
#include "blendef.h"
@@ -103,6 +108,8 @@
#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
#define IMAPAINT_TILE_NUMBER(size) (((size)+IMAPAINT_TILE_SIZE-1) >> IMAPAINT_TILE_BITS)
+#define MAXUNDONAME 64
+
typedef struct ImagePaintState {
Brush *brush;
short tool, blend;
@@ -120,48 +127,206 @@ typedef struct ImagePaintState {
float uv[2];
} ImagePaintState;
-typedef struct ImagePaintUndo {
- Image *image;
- ImBuf *tilebuf;
- void **tiles;
- int xtiles, ytiles;
-} ImagePaintUndo;
+typedef struct UndoTile {
+ struct UndoTile *next, *prev;
+ ID id;
+ void *rect;
+ int x, y;
+} UndoTile;
+
+typedef struct UndoElem {
+ struct UndoElem *next, *prev;
+ char name[MAXUNDONAME];
+ unsigned long undosize;
+
+ ImBuf *ibuf;
+ ListBase tiles;
+} UndoElem;
typedef struct ImagePaintPartialRedraw {
int x1, y1, x2, y2;
int enabled;
} ImagePaintPartialRedraw;
-static ImagePaintUndo imapaintundo = {NULL, NULL, NULL, 0, 0};
+static ListBase undobase = {NULL, NULL};
+static UndoElem *curundo = NULL;
static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0};
-static void init_imagapaint_undo(Image *ima, ImBuf *ibuf)
+/* UNDO */
+
+/* internal functions */
+
+static void undo_copy_tile(UndoTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, int restore)
{
- int xt, yt;
-
- imapaintundo.image = ima;
- imapaintundo.xtiles = xt = IMAPAINT_TILE_NUMBER(ibuf->x);
- imapaintundo.ytiles = yt = IMAPAINT_TILE_NUMBER(ibuf->y);
- imapaintundo.tiles = MEM_callocN(sizeof(void*)*xt*yt, "ImagePaintUndoTiles");
- imapaintundo.tilebuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE,
- ibuf->depth, (ibuf->rect_float)? IB_rectfloat: IB_rect, 0);
+ /* copy or swap contents of tile->rect and region in ibuf->rect */
+ IMB_rectcpy(tmpibuf, ibuf, 0, 0, tile->x*IMAPAINT_TILE_SIZE,
+ tile->y*IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+
+ if(ibuf->rect_float) SWAP(void*, tmpibuf->rect_float, tile->rect)
+ else SWAP(void*, tmpibuf->rect, tile->rect)
+
+ if(restore)
+ IMB_rectcpy(ibuf, tmpibuf, tile->x*IMAPAINT_TILE_SIZE,
+ tile->y*IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
}
-static void imapaint_copy_tile(ImBuf *ibuf, int tile, int x, int y, int swapundo)
+static void undo_restore(UndoElem *undo)
{
- IMB_rectcpy(imapaintundo.tilebuf, ibuf, 0, 0, x*IMAPAINT_TILE_SIZE,
- y*IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+ Image *ima = NULL;
+ ImBuf *ibuf, *tmpibuf;
+ UndoTile *tile;
- if (imapaintundo.tilebuf->rect_float)
- SWAP(void*, imapaintundo.tilebuf->rect_float, imapaintundo.tiles[tile])
- else
- SWAP(void*, imapaintundo.tilebuf->rect, imapaintundo.tiles[tile])
+ if(!undo)
+ return;
+
+ tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
+ IB_rectfloat|IB_rect, 0);
+
+ for(tile=undo->tiles.first; tile; tile=tile->next) {
+ /* find image based on name, pointer becomes invalid with global undo */
+ if(ima && strcmp(tile->id.name, ima->id.name)==0);
+ else {
+ for(ima=G.main->image.first; ima; ima=ima->id.next)
+ if(strcmp(tile->id.name, ima->id.name)==0)
+ break;
+ }
+
+ ibuf= BKE_image_get_ibuf(ima, NULL);
+
+ if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
+ continue;
+
+ undo_copy_tile(tile, tmpibuf, ibuf, 1);
+
+ GPU_free_image(ima); /* force OpenGL reload */
+ if(ibuf->rect_float)
+ imb_freerectImBuf(ibuf); /* force recreate of char rect */
+ }
+
+ IMB_freeImBuf(tmpibuf);
+}
+
+static void undo_free(UndoElem *undo)
+{
+ UndoTile *tile;
+
+ for(tile=undo->tiles.first; tile; tile=tile->next)
+ MEM_freeN(tile->rect);
+ BLI_freelistN(&undo->tiles);
+}
+
+static void undo_imagepaint_push_begin(char *name)
+{
+ UndoElem *uel;
+ int nr;
+
+ /* Undo push is split up in begin and end, the reason is that as painting
+ * happens more tiles are added to the list, and at the very end we know
+ * how much memory the undo used to remove old undo elements */
+
+ /* remove all undos after (also when curundo==NULL) */
+ while(undobase.last != curundo) {
+ uel= undobase.last;
+ undo_free(uel);
+ BLI_freelinkN(&undobase, uel);
+ }
+
+ /* make new */
+ curundo= uel= MEM_callocN(sizeof(UndoElem), "undo file");
+ BLI_addtail(&undobase, uel);
+
+ /* name can be a dynamic string */
+ strncpy(uel->name, name, MAXUNDONAME-1);
+
+ /* limit amount to the maximum amount*/
+ nr= 0;
+ uel= undobase.last;
+ while(uel) {
+ nr++;
+ if(nr==U.undosteps) break;
+ uel= uel->prev;
+ }
+ if(uel) {
+ while(undobase.first!=uel) {
+ UndoElem *first= undobase.first;
+ undo_free(first);
+ BLI_freelinkN(&undobase, first);
+ }
+ }
+}
+
+static void undo_imagepaint_push_end()
+{
+ UndoElem *uel;
+ unsigned long totmem, maxmem;
+
+ if(U.undomemory != 0) {
+ /* limit to maximum memory (afterwards, we can't know in advance) */
+ totmem= 0;
+ maxmem= ((unsigned long)U.undomemory)*1024*1024;
+
+ uel= undobase.last;
+ while(uel) {
+ totmem+= uel->undosize;
+ if(totmem>maxmem) break;
+ uel= uel->prev;
+ }
+
+ if(uel) {
+ while(undobase.first!=uel) {
+ UndoElem *first= undobase.first;
+ undo_free(first);
+ BLI_freelinkN(&undobase, first);
+ }
+ }
+ }
+}
+
+/* external functions */
+
+/* 1= an undo, -1 is a redo. */
+void undo_imagepaint_step(int step)
+{
+ UndoElem *undo;
+
+ if(step==1) {
+ if(curundo==NULL) error("No more steps to undo");
+ else {
+ if(G.f & G_DEBUG) printf("undo %s\n", curundo->name);
+ undo_restore(curundo);
+ curundo= curundo->prev;
+ }
+ }
+ else if(step==-1) {
+ if((curundo!=NULL && curundo->next==NULL) || undobase.first==NULL) error("No more steps to redo");
+ else {
+ undo= (curundo && curundo->next)? curundo->next: undobase.first;
+ undo_restore(undo);
+ curundo= undo;
+ if(G.f & G_DEBUG) printf("redo %s\n", undo->name);
+ }
+ }
+
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWIMAGE, 0);
+}
+
+void undo_imagepaint_clear(void)
+{
+ UndoElem *uel;
- if (swapundo)
- IMB_rectcpy(ibuf, imapaintundo.tilebuf, x*IMAPAINT_TILE_SIZE,
- y*IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+ uel= undobase.first;
+ while(uel) {
+ undo_free(uel);
+ uel= uel->next;
+ }
+
+ BLI_freelistN(&undobase);
+ curundo= NULL;
}
+/* Imagepaint Partial Redraw & Dirty Region */
+
static void imapaint_clear_partial_redraw()
{
memset(&imapaintpartial, 0, sizeof(imapaintpartial));
@@ -169,7 +334,9 @@ static void imapaint_clear_partial_redraw()
static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, int h)
{
- int srcx= 0, srcy= 0, origx, tile, allocsize;
+ ImBuf *tmpibuf;
+ UndoTile *tile;
+ int srcx= 0, srcy= 0, origx, allocsize;
IMB_rectclip(ibuf, NULL, &x, &y, &srcx, &srcy, &w, &h);
@@ -195,24 +362,36 @@ static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w,
origx = (x >> IMAPAINT_TILE_BITS);
y = (y >> IMAPAINT_TILE_BITS);
+ tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
+ IB_rectfloat|IB_rect, 0);
+
for (; y <= h; y++) {
for (x=origx; x <= w; x++) {
- if (ima != imapaintundo.image) {
- free_imagepaint();
- init_imagapaint_undo(ima, ibuf);
- }
+ for(tile=curundo->tiles.first; tile; tile=tile->next)
+ if(tile->x == x && tile->y == y && strcmp(tile->id.name, ima->id.name)==0)
+ break;
+
+ if(!tile) {
+ tile= MEM_callocN(sizeof(UndoTile), "ImaUndoTile");
+ tile->id= ima->id;
+ tile->x= x;
+ tile->y= y;
+
+ allocsize= IMAPAINT_TILE_SIZE*IMAPAINT_TILE_SIZE*4;
+ allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
+ tile->rect= MEM_mapallocN(allocsize, "ImaUndoRect");
+
+ undo_copy_tile(tile, tmpibuf, ibuf, 0);
+ curundo->undosize += allocsize;
- tile = y*imapaintundo.xtiles + x;
- if (!imapaintundo.tiles[tile]) {
- allocsize= (ibuf->rect_float)? sizeof(float): sizeof(char);
- imapaintundo.tiles[tile]= MEM_mapallocN(allocsize*4*
- IMAPAINT_TILE_SIZE*IMAPAINT_TILE_SIZE, "ImagePaintUndoTile");
- imapaint_copy_tile(ibuf, tile, x, y, 0);
+ BLI_addtail(&curundo->tiles, tile);
}
}
}
ibuf->userflags |= IB_BITMAPDIRTY;
+
+ IMB_freeImBuf(tmpibuf);
}
static void imapaint_image_update(Image *image, ImBuf *ibuf, short texpaint)
@@ -226,7 +405,7 @@ static void imapaint_image_update(Image *image, ImBuf *ibuf, short texpaint)
if(texpaint || G.sima->lock) {
int w = imapaintpartial.x2 - imapaintpartial.x1;
int h = imapaintpartial.y2 - imapaintpartial.y1;
- update_realtime_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h);
+ GPU_paint_update_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h);
}
}
@@ -239,7 +418,7 @@ static void imapaint_redraw(int final, int texpaint, Image *image)
allqueue(REDRAWIMAGE, 0);
else if(!G.sima->lock) {
if(image)
- free_realtime_image(image); /* force OpenGL reload */
+ GPU_free_image(image); /* force OpenGL reload */
allqueue(REDRAWVIEW3D, 0);
}
allqueue(REDRAWHEADERS, 0);
@@ -269,46 +448,6 @@ static void imapaint_redraw(int final, int texpaint, Image *image)
force_draw(0);
}
-void imagepaint_undo()
-{
- Image *ima= imapaintundo.image;
- ImBuf *ibuf= BKE_image_get_ibuf(ima, G.sima?&G.sima->iuser:NULL);
- int x, y, tile;
-
- if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
- return;
-
- for (tile = 0, y = 0; y < imapaintundo.ytiles; y++)
- for (x = 0; x < imapaintundo.xtiles; x++, tile++)
- if (imapaintundo.tiles[tile])
- imapaint_copy_tile(ibuf, tile, x, y, 1);
-
- free_realtime_image(ima); /* force OpenGL reload */
- if(ibuf->rect_float)
- imb_freerectImBuf(ibuf); /* force recreate of char rect */
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void free_imagepaint()
-{
- /* todo: does this need to be in the same places as editmode_undo_clear,
- vertex paint isn't? */
- int i, size = imapaintundo.xtiles*imapaintundo.ytiles;
-
- if (imapaintundo.tiles) {
- for (i = 0; i < size; i++)
- if (imapaintundo.tiles[i])
- MEM_freeN(imapaintundo.tiles[i]);
- MEM_freeN(imapaintundo.tiles);
- }
- if (imapaintundo.tilebuf)
- IMB_freeImBuf(imapaintundo.tilebuf);
-
- memset(&imapaintundo, 0, sizeof(imapaintundo));
-}
-
/* Image Paint Operations */
static void imapaint_ibuf_get_set_rgb(ImBuf *ibuf, int x, int y, short torus, short set, float *rgb)
@@ -580,7 +719,6 @@ static void imapaint_paint_stroke(ImagePaintState *s, BrushPainter *painter, sho
int breakstroke = 0, redraw = 0;
if (texpaint) {
-
/* pick new face and image */
if (facesel_face_pick(s->me, mval, &newfaceindex, 0)) {
ImBuf *ibuf;
@@ -692,7 +830,7 @@ void imagepaint_paint(short mousebutton, short texpaint)
}
settings->imapaint.flag |= IMAGEPAINT_DRAWING;
- free_imagepaint();
+ undo_imagepaint_push_begin("Image Paint");
/* create painter and paint once */
painter= brush_painter_new(s.brush);
@@ -741,6 +879,7 @@ void imagepaint_paint(short mousebutton, short texpaint)
brush_painter_free(painter);
imapaint_redraw(1, texpaint, s.image);
+ undo_imagepaint_push_end();
if (texpaint) {
if (s.warnmultifile)
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index ba8649eaa86..a2b2af05083 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -105,6 +105,8 @@
#include "blendef.h"
#include "winlay.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#define INSIDE_BLOCK 1
#define INSIDE_PANEL_HEADER 2
#define INSIDE_PANEL_SCALE 3
@@ -532,7 +534,7 @@ static int ui_but_copy_paste(uiBut *but, char mode)
/* give butfunc the original text too */
/* feature used for bone renaming, channels, etc */
if(but->func_arg2==NULL) {
- strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR);
+ strncpy(backstr, but->poin, UI_MAX_DRAW_STR);
but->func_arg2= backstr;
}
strncpy(but->poin, but_copypaste_str, but->max);
@@ -5651,6 +5653,8 @@ static int ui_auto_themecol(uiBut *but)
// (weak!) detect if it is a blockloop
if(but->block->dt == UI_EMBOSSP) return TH_MENU_ITEM;
return TH_BUT_POPUP;
+ case ROUNDBOX:
+ return TH_PANEL;
default:
return TH_BUT_NEUTRAL;
}
@@ -6037,7 +6041,7 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname)
/* autocomplete callback for ID buttons */
static void autocomplete_id(char *str, void *arg_v)
{
- int blocktype= (long)arg_v;
+ int blocktype= (intptr_t)arg_v;
ListBase *listb= wich_libbase(G.main, blocktype);
if(listb==NULL) return;
@@ -6368,7 +6372,7 @@ uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int
ui_check_but(but);
if(blocktype)
- uiButSetCompleteFunc(but, autocomplete_id, (void *)(long)blocktype);
+ uiButSetCompleteFunc(but, autocomplete_id, (void *)(intptr_t)blocktype);
return but;
}
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c
index e7041e60003..83ae449b989 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/src/interface_draw.c
@@ -2351,7 +2351,7 @@ static void ui_draw_roundbox(uiBut *but)
{
glEnable(GL_BLEND);
- BIF_ThemeColorShadeAlpha(TH_PANEL, but->a2, but->a2);
+ BIF_ThemeColorShadeAlpha(but->themecol, but->a2, but->a2);
uiSetRoundBox(but->a1);
gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, but->min);
diff --git a/source/blender/src/keyval.c b/source/blender/src/keyval.c
index dab4b4ae839..5a2ba531821 100644
--- a/source/blender/src/keyval.c
+++ b/source/blender/src/keyval.c
@@ -27,6 +27,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include "stdio.h"
+#include "ctype.h"
+#include "string.h"
+
+#include "BKE_global.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BIF_keyval.h"
@@ -349,3 +354,193 @@ char *key_event_to_string(unsigned short event)
return "";
}
+
+/*
+ * Decodes key combination strings [qual1+[qual2+[...]]]keyname
+ * The '+'s may be replaced by '-' or ' ' characters to support different
+ * formats. No additional whitespace is allowed. The keyname may be an internal
+ * name, like "RETKEY", or a more common name, like "Return". Decoding is case-
+ * insensitive.
+ *
+ * Example strings: "Ctrl+L", "ALT-ESC", "Shift A"
+ *
+ * Returns 1 if successful.
+ */
+int decode_key_string(char *str, unsigned short *key, unsigned short *qual)
+{
+ int i, prev, len, invalid=0;
+
+ len= strlen(str);
+ *key= *qual= 0;
+
+ /* Convert to upper case */
+ for (i=0; i<len; i++) {
+ str[i]= toupper(str[i]);
+ }
+
+ /* Handle modifiers */
+ for (prev=i=0; i<len; i++) {
+ if (str[i]==' ' || str[i]=='+' || str[i]=='-') {
+ if (!strncmp(str+prev, "CTRL", i-prev)) *qual |= LR_CTRLKEY;
+ else if (!strncmp(str+prev, "ALT", i-prev)) *qual |= LR_ALTKEY;
+ else if (!strncmp(str+prev, "SHIFT", i-prev)) *qual |= LR_SHIFTKEY;
+ else if (!strncmp(str+prev, "COMMAND", i-prev)) *qual |= LR_COMMANDKEY;
+ prev=i+1;
+ }
+ }
+
+ /* Compare last part against key names */
+ if ((len-prev==1) || ((len-prev==4) && !strncmp(str+prev, "KEY", 3))) {
+
+ if (str[prev]>='A' && str[prev]<='Z') {
+ *key= str[prev]-'A'+AKEY;
+ } else if (str[prev]>='0' && str[prev]<='9') {
+ *key= str[prev]-'0'+ZEROKEY;
+ } else {
+ invalid= 1;
+ }
+
+ } else if (!strncmp(str+prev, "ZEROKEY", len-prev) || !strncmp(str+prev, "ZERO", len-prev)) {
+ *key= ZEROKEY;
+ } else if (!strncmp(str+prev, "ONEKEY", len-prev) || !strncmp(str+prev, "ONE", len-prev)) {
+ *key= ONEKEY;
+ } else if (!strncmp(str+prev, "TWOKEY", len-prev) || !strncmp(str+prev, "TWO", len-prev)) {
+ *key= TWOKEY;
+ } else if (!strncmp(str+prev, "THREEKEY", len-prev) || !strncmp(str+prev, "THREE", len-prev)) {
+ *key= THREEKEY;
+ } else if (!strncmp(str+prev, "FOURKEY", len-prev) || !strncmp(str+prev, "FOUR", len-prev)) {
+ *key= FOURKEY;
+ } else if (!strncmp(str+prev, "FIVEKEY", len-prev) || !strncmp(str+prev, "FIVE", len-prev)) {
+ *key= FIVEKEY;
+ } else if (!strncmp(str+prev, "SIZEKEY", len-prev) || !strncmp(str+prev, "SIX", len-prev)) {
+ *key= SIXKEY;
+ } else if (!strncmp(str+prev, "SEVENKEY", len-prev) || !strncmp(str+prev, "SEVEN", len-prev)) {
+ *key= SEVENKEY;
+ } else if (!strncmp(str+prev, "EIGHTKEY", len-prev) || !strncmp(str+prev, "EIGHT", len-prev)) {
+ *key= EIGHTKEY;
+ } else if (!strncmp(str+prev, "NINEKEY", len-prev) || !strncmp(str+prev, "NINE", len-prev)) {
+ *key= NINEKEY;
+
+ } else if (!strncmp(str+prev, "ESCKEY", len-prev) || !strncmp(str+prev, "ESC", len-prev)) {
+ *key= ESCKEY;
+ } else if (!strncmp(str+prev, "TABKEY", len-prev) || !strncmp(str+prev, "TAB", len-prev)) {
+ *key= TABKEY;
+ } else if (!strncmp(str+prev, "RETKEY", len-prev) || !strncmp(str+prev, "RETURN", len-prev) || !strncmp(str+prev, "ENTER", len-prev)) {
+ *key= RETKEY;
+ } else if (!strncmp(str+prev, "SPACEKEY", len-prev) || !strncmp(str+prev, "SPACE", len-prev)) {
+ *key= SPACEKEY;
+ } else if (!strncmp(str+prev, "LINEFEEDKEY", len-prev) || !strncmp(str+prev, "LINEFEED", len-prev)) {
+ *key= LINEFEEDKEY;
+ } else if (!strncmp(str+prev, "BACKSPACEKEY", len-prev) || !strncmp(str+prev, "BACKSPACE", len-prev)) {
+ *key= BACKSPACEKEY;
+ } else if (!strncmp(str+prev, "DELKEY", len-prev) || !strncmp(str+prev, "DELETE", len-prev)) {
+ *key= DELKEY;
+
+ } else if (!strncmp(str+prev, "SEMICOLONKEY", len-prev) || !strncmp(str+prev, "SEMICOLON", len-prev)) {
+ *key= SEMICOLONKEY;
+ } else if (!strncmp(str+prev, "PERIODKEY", len-prev) || !strncmp(str+prev, "PERIOD", len-prev)) {
+ *key= PERIODKEY;
+ } else if (!strncmp(str+prev, "COMMAKEY", len-prev) || !strncmp(str+prev, "COMMA", len-prev)) {
+ *key= COMMAKEY;
+ } else if (!strncmp(str+prev, "QUOTEKEY", len-prev) || !strncmp(str+prev, "QUOTE", len-prev)) {
+ *key= QUOTEKEY;
+ } else if (!strncmp(str+prev, "ACCENTGRAVEKEY", len-prev) || !strncmp(str+prev, "ACCENTGRAVE", len-prev)) {
+ *key= ACCENTGRAVEKEY;
+ } else if (!strncmp(str+prev, "MINUSKEY", len-prev) || !strncmp(str+prev, "MINUS", len-prev)) {
+ *key= MINUSKEY;
+ } else if (!strncmp(str+prev, "SLASHKEY", len-prev) || !strncmp(str+prev, "SLASH", len-prev)) {
+ *key= SLASHKEY;
+ } else if (!strncmp(str+prev, "BACKSLASHKEY", len-prev) || !strncmp(str+prev, "BACKSLASH", len-prev)) {
+ *key= BACKSLASHKEY;
+ } else if (!strncmp(str+prev, "EQUALKEY", len-prev) || !strncmp(str+prev, "EQUAL", len-prev)) {
+ *key= EQUALKEY;
+ } else if (!strncmp(str+prev, "LEFTBRACKETKEY", len-prev) || !strncmp(str+prev, "LEFTBRACKET", len-prev)) {
+ *key= LEFTBRACKETKEY;
+ } else if (!strncmp(str+prev, "RIGHTBRACKETKEY", len-prev) || !strncmp(str+prev, "RIGHTBRACKET", len-prev)) {
+ *key= RIGHTBRACKETKEY;
+ } else if (!strncmp(str+prev, "DELKEY", len-prev) || !strncmp(str+prev, "DELETE", len-prev)) {
+ *key= DELKEY;
+
+ } else if (!strncmp(str+prev, "LEFTARROWKEY", len-prev) || !strncmp(str+prev, "LEFTARROW", len-prev)) {
+ *key= LEFTARROWKEY;
+ } else if (!strncmp(str+prev, "DOWNARROWKEY", len-prev) || !strncmp(str+prev, "DOWNARROW", len-prev)) {
+ *key= DOWNARROWKEY;
+ } else if (!strncmp(str+prev, "RIGHTARROWKEY", len-prev) || !strncmp(str+prev, "RIGHTARROW", len-prev)) {
+ *key= RIGHTARROWKEY;
+ } else if (!strncmp(str+prev, "UPARROWKEY", len-prev) || !strncmp(str+prev, "UPARROW", len-prev)) {
+ *key= UPARROWKEY;
+
+ } else if (!strncmp(str+prev, "PAD", 3)) {
+
+ if (len-prev<=4) {
+
+ if (str[prev]>='0' && str[prev]<='9') {
+ *key= str[prev]-'0'+ZEROKEY;
+ } else {
+ invalid= 1;
+ }
+
+ } else if (!strncmp(str+prev+3, "PERIODKEY", len-prev-3) || !strncmp(str+prev+3, "PERIOD", len-prev-3)) {
+ *key= PADPERIOD;
+ } else if (!strncmp(str+prev+3, "SLASHKEY", len-prev-3) || !strncmp(str+prev+3, "SLASH", len-prev-3)) {
+ *key= PADSLASHKEY;
+ } else if (!strncmp(str+prev+3, "ASTERKEY", len-prev-3) || !strncmp(str+prev+3, "ASTERISK", len-prev-3)) {
+ *key= PADASTERKEY;
+ } else if (!strncmp(str+prev+3, "MINUSKEY", len-prev-3) || !strncmp(str+prev+3, "MINUS", len-prev-3)) {
+ *key= PADMINUS;
+ } else if (!strncmp(str+prev+3, "ENTERKEY", len-prev-3) || !strncmp(str+prev+3, "ENTER", len-prev-3)) {
+ *key= PADENTER;
+ } else if (!strncmp(str+prev+3, "PLUSKEY", len-prev-3) || !strncmp(str+prev+3, "PLUS", len-prev-3)) {
+ *key= PADPLUSKEY;
+ } else {
+ invalid= 1;
+ }
+
+ } else if (!strncmp(str+prev, "F1KEY", len-prev) || !strncmp(str+prev, "F1", len-prev)) {
+ *key= F1KEY;
+ } else if (!strncmp(str+prev, "F2KEY", len-prev) || !strncmp(str+prev, "F2", len-prev)) {
+ *key= F2KEY;
+ } else if (!strncmp(str+prev, "F3KEY", len-prev) || !strncmp(str+prev, "F3", len-prev)) {
+ *key= F3KEY;
+ } else if (!strncmp(str+prev, "F4KEY", len-prev) || !strncmp(str+prev, "F4", len-prev)) {
+ *key= F4KEY;
+ } else if (!strncmp(str+prev, "F5KEY", len-prev) || !strncmp(str+prev, "F5", len-prev)) {
+ *key= F5KEY;
+ } else if (!strncmp(str+prev, "F6KEY", len-prev) || !strncmp(str+prev, "F6", len-prev)) {
+ *key= F6KEY;
+ } else if (!strncmp(str+prev, "F7KEY", len-prev) || !strncmp(str+prev, "F7", len-prev)) {
+ *key= F7KEY;
+ } else if (!strncmp(str+prev, "F8KEY", len-prev) || !strncmp(str+prev, "F8", len-prev)) {
+ *key= F8KEY;
+ } else if (!strncmp(str+prev, "F9KEY", len-prev) || !strncmp(str+prev, "F9", len-prev)) {
+ *key= F9KEY;
+ } else if (!strncmp(str+prev, "F10KEY", len-prev) || !strncmp(str+prev, "F10", len-prev)) {
+ *key= F10KEY;
+ } else if (!strncmp(str+prev, "F11KEY", len-prev) || !strncmp(str+prev, "F11", len-prev)) {
+ *key= F11KEY;
+ } else if (!strncmp(str+prev, "F12KEY", len-prev) || !strncmp(str+prev, "F12", len-prev)) {
+ *key= F12KEY;
+
+ } else if (!strncmp(str+prev, "PAUSEKEY", len-prev) || !strncmp(str+prev, "PAUSE", len-prev)) {
+ *key= PAUSEKEY;
+ } else if (!strncmp(str+prev, "INSERTKEY", len-prev) || !strncmp(str+prev, "INSERT", len-prev)) {
+ *key= INSERTKEY;
+ } else if (!strncmp(str+prev, "HOMEKEY", len-prev) || !strncmp(str+prev, "HOME", len-prev)) {
+ *key= HOMEKEY;
+ } else if (!strncmp(str+prev, "PAGEUPKEY", len-prev) || !strncmp(str+prev, "PAGEUP", len-prev)) {
+ *key= PAGEUPKEY;
+ } else if (!strncmp(str+prev, "PAGEDOWNKEY", len-prev) || !strncmp(str+prev, "PAGEDOWN", len-prev)) {
+ *key= PAGEDOWNKEY;
+ } else if (!strncmp(str+prev, "ENDKEY", len-prev) || !strncmp(str+prev, "END", len-prev)) {
+ *key= ENDKEY;
+
+ } else {
+ invalid= 1;
+ }
+
+ if (!invalid && *key) {
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/source/blender/src/meshlaplacian.c b/source/blender/src/meshlaplacian.c
index 4d84672185a..2de6367c9ad 100644
--- a/source/blender/src/meshlaplacian.c
+++ b/source/blender/src/meshlaplacian.c
@@ -63,6 +63,8 @@
#include "ONL_opennl.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/************************** Laplacian System *****************************/
struct LaplacianSystem {
@@ -126,14 +128,14 @@ static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2)
void **p = BLI_edgehash_lookup_p(edgehash, v1, v2);
if(p)
- *p = (void*)((long)*p + (long)1);
+ *p = (void*)((intptr_t)*p + (intptr_t)1);
else
- BLI_edgehash_insert(edgehash, v1, v2, (void*)(long)1);
+ BLI_edgehash_insert(edgehash, v1, v2, (void*)(intptr_t)1);
}
static int laplacian_edge_count(EdgeHash *edgehash, int v1, int v2)
{
- return (int)(long)BLI_edgehash_lookup(edgehash, v1, v2);
+ return (int)(intptr_t)BLI_edgehash_lookup(edgehash, v1, v2);
}
static float cotan_weight(float *v1, float *v2, float *v3)
@@ -1281,9 +1283,9 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1];
outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2];
+ VECCOPY(start, co);
VECSUB(dir, outside, start);
Normalize(dir);
- VECCOPY(start, co);
isect = meshdeform_ray_tree_intersect(mdb, start, outside);
if(isect && !isect->facing)
diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c
index 0f30aef04df..eed7737c26d 100644
--- a/source/blender/src/meshtools.c
+++ b/source/blender/src/meshtools.c
@@ -84,7 +84,6 @@ void sort_faces(void);
#include "BIF_toolbox.h"
#include "BIF_editconstraint.h"
-#include "BDR_drawmesh.h"
#include "BDR_editobject.h"
#include "BDR_editface.h"
#include "BDR_sculptmode.h"
@@ -107,6 +106,10 @@ void sort_faces(void);
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
+#include "GPU_draw.h"
+
+#include "BLO_sys_types.h" // for intptr_t support
+
/* from rendercode.c */
#define VECMUL(dest, f) dest[0]*= f; dest[1]*= f; dest[2]*= f
@@ -592,7 +595,7 @@ void sort_faces(void)
typedef struct MocNode {
struct MocNode *next;
- long index[MOC_NODE_RES];
+ intptr_t index[MOC_NODE_RES];
} MocNode;
static int mesh_octree_get_base_offs(float *co, float *offs, float *div)
@@ -610,7 +613,7 @@ static int mesh_octree_get_base_offs(float *co, float *offs, float *div)
return (vx*MOC_RES*MOC_RES) + vy*MOC_RES + vz;
}
-static void mesh_octree_add_node(MocNode **bt, long index)
+static void mesh_octree_add_node(MocNode **bt, intptr_t index)
{
if(*bt==NULL) {
*bt= MEM_callocN(sizeof(MocNode), "MocNode");
@@ -642,7 +645,7 @@ static void mesh_octree_free_node(MocNode **bt)
/* temporal define, just to make nicer code below */
#define MOC_ADDNODE(vx, vy, vz) mesh_octree_add_node(basetable + ((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz), index)
-static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, long index)
+static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, intptr_t index)
{
float fx, fy, fz;
int vx, vy, vz;
@@ -690,7 +693,7 @@ static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, f
}
-static long mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co)
+static intptr_t mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co)
{
float *vec;
int a;
@@ -734,7 +737,7 @@ static struct {
/* mode is 's' start, or 'e' end, or 'u' use */
/* if end, ob can be NULL */
-long mesh_octree_table(Object *ob, float *co, char mode)
+intptr_t mesh_octree_table(Object *ob, float *co, char mode)
{
MocNode **bt;
@@ -805,7 +808,7 @@ long mesh_octree_table(Object *ob, float *co, char mode)
EditVert *eve;
for(eve= G.editMesh->verts.first; eve; eve= eve->next) {
- mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (long)(eve));
+ mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (intptr_t)(eve));
}
}
else {
@@ -863,7 +866,7 @@ int mesh_get_x_mirror_vert(Object *ob, int index)
EditVert *editmesh_get_x_mirror_vert(Object *ob, float *co)
{
float vec[3];
- long poinval;
+ intptr_t poinval;
/* ignore nan verts */
if (isnan(co[0]) || !finite(co[0]) ||
@@ -1128,7 +1131,7 @@ void objects_bake_render(short event, char **error_msg)
if(ima->ok==IMA_OK_LOADED) {
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
- free_realtime_image(ima);
+ GPU_free_image(ima);
imb_freemipmapImBuf(ibuf);
}
}
diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c
index 683b06aafc4..3f328a0cfb2 100644
--- a/source/blender/src/outliner.c
+++ b/source/blender/src/outliner.c
@@ -68,6 +68,7 @@
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_modifier.h"
+#include "BKE_object.h"
#include "BKE_screen.h"
#include "BKE_scene.h"
#include "BKE_utildefines.h"
@@ -698,6 +699,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
for (index=0,md=ob->modifiers.first; md; index++,md=md->next) {
TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index);
te->name= md->name;
+ te->directdata = md;
if (md->type==eModifierType_Lattice) {
outliner_add_element(soops, &te->subtree, ((LatticeModifierData*) md)->object, te, TSE_LINKED_OB, 0);
@@ -3523,6 +3525,27 @@ static void restrictbutton_r_lay_cb(void *poin, void *poin2)
allqueue(REDRAWBUTSSCENE, 0);
}
+static void restrictbutton_modifier_cb(void *poin, void *poin2)
+{
+ Object *ob = (Object *)poin;
+
+ DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
+ object_handle_update(ob);
+ countall();
+
+ allqueue(REDRAWOOPS, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
+}
+
+static void restrictbutton_bone_cb(void *poin, void *poin2)
+{
+ allqueue(REDRAWOOPS, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
+}
+
static void namebutton_cb(void *tep, void *oldnamep)
{
SpaceOops *soops= curarea->spacedata.first;
@@ -3631,7 +3654,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
uiBut *bt;
TreeElement *te;
TreeStoreElem *tselem;
- Object *ob;
+ Object *ob = NULL;
for(te= lb->first; te; te= te->next) {
tselem= TREESTORE(te);
@@ -3639,7 +3662,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
/* objects have toggle-able restriction flags */
if(tselem->type==0 && te->idcode==ID_OB) {
ob = (Object *)tselem->id;
-
+
uiBlockSetEmboss(block, UI_EMBOSSN);
bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
(int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
@@ -3685,6 +3708,40 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
uiBlockSetEmboss(block, UI_EMBOSS);
}
+ else if(tselem->type==TSE_MODIFIER) {
+ ModifierData *md= (ModifierData *)te->directdata;
+ ob = (Object *)tselem->id;
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Realtime, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
+ uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+
+ bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Render, REDRAWALL, ICON_RESTRICT_RENDER_OFF,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability");
+ uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+ }
+ else if(tselem->type==TSE_POSE_CHANNEL) {
+ bPoseChannel *pchan= (bPoseChannel *)te->directdata;
+ Bone *bone = pchan->bone;
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_P, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
+ uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+ }
+ else if(tselem->type==TSE_EBONE) {
+ EditBone *ebone= (EditBone *)te->directdata;
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_A, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
+ (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ebone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
+ uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL);
+ uiButSetFlag(bt, UI_NO_HILITE);
+ }
}
if((tselem->flag & TSE_CLOSED)==0) outliner_draw_restrictbuts(block, soops, &te->subtree);
diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c
index 096629b01ec..7aa27f99d77 100644
--- a/source/blender/src/parametrizer.c
+++ b/source/blender/src/parametrizer.c
@@ -22,6 +22,8 @@
#include <stdio.h>
#include <string.h>
+#include "BLO_sys_types.h" // for intptr_t support
+
#if defined(_WIN32)
#define M_PI 3.14159265358979323846
#endif
@@ -38,7 +40,7 @@ static int PHashSizes[] = {
4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459
};
-#define PHASH_hash(ph, item) (((unsigned long) (item))%((unsigned int) (ph)->cursize))
+#define PHASH_hash(ph, item) (((uintptr_t) (item))%((unsigned int) (ph)->cursize))
#define PHASH_edge(v1, v2) ((v1)^(v2))
static PHash *phash_new(PHashLink **list, int sizehint)
diff --git a/source/blender/src/parametrizer.h b/source/blender/src/parametrizer.h
index 80fab110d5f..c468b8d62c5 100644
--- a/source/blender/src/parametrizer.h
+++ b/source/blender/src/parametrizer.h
@@ -5,9 +5,11 @@
#ifdef __cplusplus
extern "C" {
#endif
+
+#include "BLO_sys_types.h" // for intptr_t support
typedef void ParamHandle; /* handle to a set of charts */
-typedef long ParamKey; /* (hash) key for identifying verts and faces */
+typedef intptr_t ParamKey; /* (hash) key for identifying verts and faces */
typedef enum ParamBool {
PARAM_TRUE = 1,
PARAM_FALSE = 0
diff --git a/source/blender/src/parametrizer_intern.h b/source/blender/src/parametrizer_intern.h
index f7a32816b33..bc38cb4bc0f 100644
--- a/source/blender/src/parametrizer_intern.h
+++ b/source/blender/src/parametrizer_intern.h
@@ -30,7 +30,7 @@ typedef enum PBool {
/* Special Purpose Hash */
-typedef long PHashKey;
+typedef intptr_t PHashKey;
typedef struct PHashLink {
struct PHashLink *next;
diff --git a/source/blender/src/playanim.c b/source/blender/src/playanim.c
index 7a61368b4cd..8421101f66c 100644
--- a/source/blender/src/playanim.c
+++ b/source/blender/src/playanim.c
@@ -45,15 +45,6 @@
#endif
#include "MEM_guardedalloc.h"
-#ifdef WITH_QUICKTIME
-#ifdef _WIN32
-#include <QTML.h>
-#include <Movies.h>
-#elif defined(__APPLE__)
-#include <QuickTime/Movies.h>
-#endif /* __APPLE__ */
-#endif /* WITH_QUICKTIME */
-
#include "PIL_time.h"
#include <math.h>
@@ -77,6 +68,15 @@
#include "BMF_Api.h"
+#ifdef WITH_QUICKTIME
+#ifdef _WIN32
+#include <QTML.h>
+#include <Movies.h>
+#elif defined(__APPLE__)
+#include <QuickTime/Movies.h>
+#endif /* __APPLE__ */
+#endif /* WITH_QUICKTIME */
+
#include "playanim_ext.h"
#include "mydevice.h"
#include "blendef.h"
@@ -346,6 +346,7 @@ void playanim(int argc, char **argv)
int start_x= 0, start_y= 0;
int sfra= -1;
int efra= -1;
+ int totblock;
while (argc > 1) {
if (argv[1][0] == '-'){
@@ -823,6 +824,7 @@ void playanim(int argc, char **argv)
free_blender();
window_destroy(g_window);
+ totblock= MEM_get_memory_blocks_in_use();
if(totblock!=0) {
printf("Error Totblock: %d\n",totblock);
MEM_printmemlist();
diff --git a/source/blender/src/poselib.c b/source/blender/src/poselib.c
index fb2bfe5b605..6aeef7c75c2 100644
--- a/source/blender/src/poselib.c
+++ b/source/blender/src/poselib.c
@@ -312,7 +312,7 @@ void poselib_add_current_pose (Object *ob, int val)
/* mode - add new or replace existing */
if (val == 0) {
if ((ob->poselib) && (ob->poselib->markers.first)) {
- val= pupmenu("PoseLib Add Current Pose%t|Add New%x1|Replace Existing%x2");
+ val= pupmenu("PoseLib Add Current Pose%t|Add New%x1|Add New (Current Frame)%x3|Replace Existing%x2");
if (val <= 0) return;
}
else
@@ -347,7 +347,10 @@ void poselib_add_current_pose (Object *ob, int val)
act= poselib_validate(ob);
/* get frame */
- frame= poselib_get_free_index(act);
+ if (val == 3)
+ frame= CFRA;
+ else /* if (val == 1) */
+ frame= poselib_get_free_index(act);
/* add pose to poselib - replaces any existing pose there */
for (marker= act->markers.first; marker; marker= marker->next) {
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c
index cc08bf53a72..28b8729a247 100644
--- a/source/blender/src/poseobject.c
+++ b/source/blender/src/poseobject.c
@@ -180,27 +180,26 @@ bPoseChannel *get_active_posechannel (Object *ob)
return NULL;
}
-/* if a selected or active bone is protected, throw error and return 1 */
+/* if a selected or active bone is protected, throw error (oonly if warn==1) and return 1 */
/* only_selected==1 : the active bone is allowed to be protected */
-static int pose_has_protected_selected(Object *ob, int only_selected)
+static short pose_has_protected_selected(Object *ob, short only_selected, short warn)
{
-
/* check protection */
- if(ob->proxy) {
+ if (ob->proxy) {
bPoseChannel *pchan;
bArmature *arm= ob->data;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone && (pchan->bone->layer & arm->layer)) {
- if(pchan->bone->layer & arm->layer_protected) {
- if(only_selected && (pchan->bone->flag & BONE_ACTIVE));
- else if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED))
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if (pchan->bone && (pchan->bone->layer & arm->layer)) {
+ if (pchan->bone->layer & arm->layer_protected) {
+ if (only_selected && (pchan->bone->flag & BONE_ACTIVE));
+ else if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED))
break;
}
}
}
- if(pchan) {
- error("Cannot change Proxy protected bones");
+ if (pchan) {
+ if (warn) error("Cannot change Proxy protected bones");
return 1;
}
}
@@ -480,6 +479,67 @@ void pose_select_constraint_target(void)
}
+void pose_select_hierarchy(short direction, short add_to_sel)
+{
+ Object *ob= OBACT;
+ bArmature *arm= ob->data;
+ bPoseChannel *pchan;
+ Bone *curbone, *pabone, *chbone;
+
+ /* paranoia checks */
+ if (!ob && !ob->pose) return;
+ if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
+
+ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ curbone= pchan->bone;
+
+ if (arm->layer & curbone->layer) {
+ if (curbone->flag & (BONE_ACTIVE)) {
+ if (direction == BONE_SELECT_PARENT) {
+
+ if (pchan->parent == NULL) continue;
+ else pabone= pchan->parent->bone;
+
+ if ((arm->layer & pabone->layer) && !(pabone->flag & BONE_HIDDEN_P)) {
+
+ if (!add_to_sel) curbone->flag &= ~BONE_SELECTED;
+ curbone->flag &= ~BONE_ACTIVE;
+ pabone->flag |= (BONE_ACTIVE|BONE_SELECTED);
+
+ select_actionchannel_by_name (ob->action, pchan->name, 0);
+ select_actionchannel_by_name (ob->action, pchan->parent->name, 1);
+ break;
+ }
+ } else { // BONE_SELECT_CHILD
+
+ if (pchan->child == NULL) continue;
+ else chbone = pchan->child->bone;
+
+ if ((arm->layer & chbone->layer) && !(chbone->flag & BONE_HIDDEN_P)) {
+
+ if (!add_to_sel) curbone->flag &= ~BONE_SELECTED;
+ curbone->flag &= ~BONE_ACTIVE;
+ chbone->flag |= (BONE_ACTIVE|BONE_SELECTED);
+
+ select_actionchannel_by_name (ob->action, pchan->name, 0);
+ select_actionchannel_by_name (ob->action, pchan->child->name, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ allqueue (REDRAWVIEW3D, 0);
+ allqueue (REDRAWBUTSOBJECT, 0);
+ allqueue (REDRAWOOPS, 0);
+
+ if (direction==BONE_SELECT_PARENT)
+ BIF_undo_push("Select pose bone parent");
+ if (direction==BONE_SELECT_CHILD)
+ BIF_undo_push("Select pose bone child");
+}
+
/* context: active channel */
void pose_special_editmenu(void)
{
@@ -540,7 +600,7 @@ void pose_clear_IK(void)
if(!ob && !ob->pose) return;
if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
- if(pose_has_protected_selected(ob, 0))
+ if(pose_has_protected_selected(ob, 0, 1))
return;
if(okee("Remove IK constraint(s)")==0) return;
@@ -581,7 +641,7 @@ void pose_clear_constraints(void)
if(!ob && !ob->pose) return;
if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
- if(pose_has_protected_selected(ob, 0))
+ if(pose_has_protected_selected(ob, 0, 1))
return;
if(okee("Remove Constraints")==0) return;
@@ -612,38 +672,49 @@ void pose_copy_menu(void)
Object *ob= OBACT;
bArmature *arm= ob->data;
bPoseChannel *pchan, *pchanact;
- short nr;
+ short nr=0;
int i=0;
/* paranoia checks */
- if(!ob && !ob->pose) return;
- if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if (ELEM(NULL, ob, ob->pose)) return;
+ if ((ob==G.obedit) || (ob->flag & OB_POSEMODE)==0) return;
/* find active */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone->flag & BONE_ACTIVE) break;
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if (pchan->bone->flag & BONE_ACTIVE)
+ break;
}
- if(pchan==NULL) return;
-
- if(pose_has_protected_selected(ob, 1))
- return;
-
+ if (pchan==NULL) return;
pchanact= pchan;
- i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
- if (i<25)
- nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
- else
- nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
+ /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable,
+ * but for constraints (just add local constraints)
+ */
+ if (pose_has_protected_selected(ob, 1, 0)) {
+ i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
+ if (i < 25)
+ nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5");
+ else
+ nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4");
+ }
+ else {
+ i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
+ if (i < 25)
+ nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
+ else
+ nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
+ }
- if(nr==-1) return;
- if(nr!=5) {
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if( (arm->layer & pchan->bone->layer) &&
- (pchan->bone->flag & BONE_SELECTED) &&
- (pchan!=pchanact)
- ) {
+ if (nr <= 0)
+ return;
+
+ if (nr != 5) {
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if ( (arm->layer & pchan->bone->layer) &&
+ (pchan->bone->flag & BONE_SELECTED) &&
+ (pchan != pchanact) )
+ {
switch (nr) {
case 1: /* Local Location */
VECCOPY(pchan->loc, pchanact->loc);
@@ -656,13 +727,26 @@ void pose_copy_menu(void)
break;
case 4: /* All Constraints */
{
- free_constraints(&pchan->constraints);
- copy_constraints(&pchan->constraints, &pchanact->constraints);
- pchan->constflag = pchanact->constflag;
+ ListBase tmp_constraints = {NULL, NULL};
- if (ob->pose) {
- ob->pose->flag |= POSE_RECALC;
+ /* copy constraints to tmpbase and apply 'local' tags before
+ * appending to list of constraints for this channel
+ */
+ copy_constraints(&tmp_constraints, &pchanact->constraints);
+ if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) {
+ bConstraint *con;
+
+ /* add proxy-local tags */
+ for (con= tmp_constraints.first; con; con= con->next)
+ con->flag |= CONSTRAINT_PROXY_LOCAL;
}
+ addlisttolist(&pchan->constraints, &tmp_constraints);
+
+ /* update flags (need to add here, not just copy) */
+ pchan->constflag |= pchanact->constflag;
+
+ if (ob->pose)
+ ob->pose->flag |= POSE_RECALC;
}
break;
case 6: /* Transform Locks */
@@ -703,12 +787,13 @@ void pose_copy_menu(void)
}
}
}
- } else { /* constraints, optional */
+ }
+ else { /* constraints, optional (note: max we can have is 24 constraints) */
bConstraint *con, *con_back;
int const_toggle[24];
- ListBase const_copy={0, 0};
+ ListBase const_copy = {NULL, NULL};
- duplicatelist (&const_copy, &(pchanact->constraints));
+ duplicatelist(&const_copy, &(pchanact->constraints));
/* build the puplist of constraints */
for (con = pchanact->constraints.first, i=0; con; con=con->next, i++){
@@ -723,32 +808,46 @@ void pose_copy_menu(void)
/* now build a new listbase from the options selected */
for (i=0, con=const_copy.first; con; i++) {
+ /* if not selected, free/remove it from the list */
if (!const_toggle[i]) {
con_back= con->next;
BLI_freelinkN(&const_copy, con);
con= con_back;
- } else {
+ }
+ else
con= con->next;
- }
}
/* Copy the temo listbase to the selected posebones */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if( (arm->layer & pchan->bone->layer) &&
- (pchan->bone->flag & BONE_SELECTED) &&
- (pchan!=pchanact)
- ) {
- free_constraints(&pchan->constraints);
- copy_constraints(&pchan->constraints, &const_copy);
- pchan->constflag = pchanact->constflag;
+ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if ( (arm->layer & pchan->bone->layer) &&
+ (pchan->bone->flag & BONE_SELECTED) &&
+ (pchan!=pchanact) )
+ {
+ ListBase tmp_constraints = {NULL, NULL};
+
+ /* copy constraints to tmpbase and apply 'local' tags before
+ * appending to list of constraints for this channel
+ */
+ copy_constraints(&tmp_constraints, &const_copy);
+ if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) {
+ bConstraint *con;
+
+ /* add proxy-local tags */
+ for (con= tmp_constraints.first; con; con= con->next)
+ con->flag |= CONSTRAINT_PROXY_LOCAL;
+ }
+ addlisttolist(&pchan->constraints, &tmp_constraints);
+
+ /* update flags (need to add here, not just copy) */
+ pchan->constflag |= pchanact->constflag;
}
}
BLI_freelistN(&const_copy);
update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */
- if (ob->pose) {
+ if (ob->pose)
ob->pose->flag |= POSE_RECALC;
- }
}
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations
@@ -808,7 +907,7 @@ void paste_posebuf (int flip)
/*
// disabled until protected bones in proxies follow the rules everywhere else!
- if(pose_has_protected_selected(ob, 1))
+ if(pose_has_protected_selected(ob, 1, 1))
return;
*/
@@ -1249,7 +1348,7 @@ void pose_flip_names(void)
if(!ob && !ob->pose) return;
if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
- if(pose_has_protected_selected(ob, 0))
+ if(pose_has_protected_selected(ob, 0, 1))
return;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -1282,7 +1381,7 @@ void pose_autoside_names(short axis)
if (ELEM(NULL, ob, ob->pose)) return;
if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
- if (pose_has_protected_selected(ob, 0))
+ if (pose_has_protected_selected(ob, 0, 1))
return;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -1415,7 +1514,7 @@ void pose_movetolayer(void)
/* pose-channel layers */
bPoseChannel *pchan;
- if (pose_has_protected_selected(ob, 0))
+ if (pose_has_protected_selected(ob, 0, 1))
return;
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c
index 0be63197dd1..1730bb890bc 100644
--- a/source/blender/src/previewrender.c
+++ b/source/blender/src/previewrender.c
@@ -97,6 +97,8 @@
#include "RE_pipeline.h"
#include "BLO_readfile.h"
+#include "GPU_material.h"
+
#include "blendef.h" /* CLAMP */
#include "interface.h" /* ui_graphics_to_window(), SOLVE! (ton) */
#include "mydevice.h"
@@ -221,6 +223,36 @@ void BIF_preview_changed(short id_code)
}
}
}
+
+ if(ELEM4(id_code, ID_MA, ID_TE, ID_LA, ID_WO)) {
+ Object *ob;
+ Material *ma;
+
+ if(id_code == ID_WO) {
+ for(ma=G.main->mat.first; ma; ma=ma->id.next) {
+ if(ma->gpumaterial.first) {
+ GPU_material_free(ma);
+ allqueue(REDRAWVIEW3D, 0);
+ }
+ }
+ }
+ else if(id_code == ID_LA) {
+ for(ob=G.main->object.first; ob; ob=ob->id.next) {
+ if(ob->gpulamp.first) {
+ GPU_lamp_free(ob);
+ allqueue(REDRAWVIEW3D, 0);
+ }
+ }
+ } else if(OBACT) {
+ Object *ob = OBACT;
+
+ ma= give_current_material(ob, ob->actcol);
+ if(ma && ma->gpumaterial.first) {
+ GPU_material_free(ma);
+ allqueue(REDRAWVIEW3D, 0);
+ }
+ }
+ }
}
/* *************************** Preview for buttons *********************** */
diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c
index 6c150f3d30f..33484500328 100644
--- a/source/blender/src/renderwin.c
+++ b/source/blender/src/renderwin.c
@@ -100,6 +100,8 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+#include "GPU_draw.h"
+
#include "blendef.h"
#include "mydevice.h"
#include "winlay.h"
@@ -674,7 +676,7 @@ static void open_renderwin(int winpos[2], int winsize[2], int imagesize[2])
/* mywindow has to know about it too */
mywindow_build_and_set_renderwin(winpos[0], winpos[1], winsize[0], winsize[1]+RW_HEADERY);
/* and we should be able to draw 3d in it */
- init_gl_stuff();
+ GPU_state_init();
renderwin_draw(render_win, 1);
renderwin_draw(render_win, 1);
@@ -901,10 +903,13 @@ static void renderwin_progress_display_cb(RenderResult *rr, volatile rcti *rect)
void make_renderinfo_string(RenderStats *rs, char *str)
{
extern char info_time_str[32]; // header_info.c
- extern unsigned long mem_in_use, mmap_in_use;
+ uintptr_t mem_in_use, mmap_in_use;
float megs_used_memory, mmap_used_memory;
char *spos= str;
+ mem_in_use= MEM_get_memory_in_use();
+ mmap_in_use= MEM_get_mapped_memory_in_use();
+
megs_used_memory= (mem_in_use-mmap_in_use)/(1024.0*1024.0);
mmap_used_memory= (mmap_in_use)/(1024.0*1024.0);
@@ -1302,10 +1307,10 @@ void do_ogl_view3d_render(Render *re, View3D *v3d, int winx, int winy)
if(v3d->persp==V3D_CAMOB && v3d->camera) {
/* in camera view, use actual render winmat */
RE_GetCameraWindow(re, v3d->camera, CFRA, winmat);
- drawview3d_render(v3d, winx, winy, winmat);
+ drawview3d_render(v3d, NULL, winx, winy, winmat, 0);
}
else
- drawview3d_render(v3d, winx, winy, NULL);
+ drawview3d_render(v3d, NULL, winx, winy, NULL, 0);
}
/* set up display, render the current area view in an image */
@@ -1334,7 +1339,7 @@ void BIF_do_ogl_render(View3D *v3d, int anim)
if(render_win)
render_win->flags &= ~RW_FLAGS_ESCAPE;
- init_gl_stuff();
+ GPU_state_init();
waitcursor(1);
diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c
index f47f14a605c..1bef10d0415 100644
--- a/source/blender/src/resources.c
+++ b/source/blender/src/resources.c
@@ -313,7 +313,15 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
cp= ts->transition; break;
case TH_SEQ_META:
cp= ts->meta; break;
-
+ case TH_HANDLE_VERTEX:
+ cp= ts->handle_vertex;
+ break;
+ case TH_HANDLE_VERTEX_SELECT:
+ cp= ts->handle_vertex_select;
+ break;
+ case TH_HANDLE_VERTEX_SIZE:
+ cp= &ts->handle_vertex_size;
+ break;
}
}
@@ -493,6 +501,10 @@ void BIF_InitTheme(void)
SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255);
btheme->tipo.vertex_size= 3;
+ SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255);
+ SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255);
+ btheme->tipo.handle_vertex_size= 3;
+
/* space file */
/* to have something initialized */
btheme->tfile= btheme->tv3d;
@@ -684,7 +696,10 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "Vertex %%x%d|", TH_VERTEX);
str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT);
str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE);
- str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
+ str += sprintf(str, "Current Frame %%x%d|", TH_CFRAME);
+ str += sprintf(str, "Handle Vertex %%x%d|", TH_HANDLE_VERTEX);
+ str += sprintf(str, "Handle Vertex Selected %%x%d|", TH_HANDLE_VERTEX_SELECT);
+ str += sprintf(str, "Handle Vertex Size %%x%d", TH_HANDLE_VERTEX_SIZE);
break;
case SPACE_FILE:
str += sprintf(str, "Selected file %%x%d", TH_HILITE);
@@ -738,6 +753,8 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "Transition Strip %%x%d|", TH_SEQ_TRANSITION);
str += sprintf(str, "Meta Strip %%x%d|", TH_SEQ_META);
str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
+ str += sprintf(str, "Keyframe %%x%d|", TH_VERTEX_SELECT);
+ str += sprintf(str, "Draw Action %%x%d|", TH_BONE_POSE);
break;
case SPACE_SOUND:
str += sprintf(str, "Grid %%x%d|", TH_GRID);
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
index 24f4100efdb..31d5ae4610d 100644
--- a/source/blender/src/sculptmode.c
+++ b/source/blender/src/sculptmode.c
@@ -82,7 +82,6 @@
#include "BIF_space.h"
#include "BIF_toolbox.h"
-#include "BDR_drawobject.h"
#include "BDR_sculptmode.h"
#include "BSE_drawview.h"
@@ -98,6 +97,8 @@
#include "RE_render_ext.h"
#include "RE_shader_ext.h" /*for multitex_ext*/
+#include "GPU_draw.h"
+
#include <math.h>
#include <stdlib.h>
#include <string.h>
@@ -1514,7 +1515,7 @@ void sculptmode_draw_mesh(int only_damaged)
mymultmatrix(OBACT->obmat);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
- init_gl_materials(OBACT, 0);
+ GPU_set_object_materials(G.scene, OBACT, 0, NULL);
glEnable(GL_CULL_FACE);
glShadeModel(GL_SMOOTH);
@@ -1532,7 +1533,7 @@ void sculptmode_draw_mesh(int only_damaged)
int new_matnr= f->mat_nr + 1;
if(new_matnr != matnr)
- drawCurrentMat= set_gl_material(matnr = new_matnr);
+ drawCurrentMat= GPU_enable_material(matnr = new_matnr, NULL);
/* If only_damaged!=0, only draw faces that are partially
inside the area(s) modified by the brush */
diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c
index 9426548dc38..bf24c02e723 100644
--- a/source/blender/src/sequence.c
+++ b/source/blender/src/sequence.c
@@ -1473,8 +1473,8 @@ static void input_preprocess(Sequence * seq, TStripElem* se, int cfra)
dy = sy;
if (seq->flag & SEQ_USE_TRANSFORM) {
- dx = seqrectx;
- dy = seqrecty;
+ dx = G.scene->r.xsch;
+ dy = G.scene->r.ysch;
}
if (c.top + c.bottom >= se->ibuf->y ||
@@ -2949,12 +2949,16 @@ void do_render_seq(RenderResult *rr, int cfra)
(schlaile)
*/
{
- extern int mem_in_use;
- extern int mmap_in_use;
+ uintptr_t mem_in_use;
+ uintptr_t mmap_in_use;
+ uintptr_t max;
+
+ mem_in_use= MEM_get_memory_in_use();
+ mmap_in_use= MEM_get_mapped_memory_in_use();
+ max = MEM_CacheLimiter_get_maximum();
- int max = MEM_CacheLimiter_get_maximum();
if (max != 0 && mem_in_use + mmap_in_use > max) {
- fprintf(stderr, "mem_in_use = %d, max = %d\n",
+ fprintf(stderr, "mem_in_use = %lu, max = %lu\n",
mem_in_use + mmap_in_use, max);
fprintf(stderr, "Cleaning up, please wait...\n"
"If this happens very often,\n"
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 92efb477095..749b097a21b 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -182,6 +182,11 @@
#include "SYS_System.h" /* for the user def menu ... should move elsewhere. */
+#include "GPU_extensions.h"
+#include "GPU_draw.h"
+
+#include "BLO_sys_types.h" // for intptr_t support
+
/* maybe we need this defined somewhere else */
extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);
extern void StartKetsjiShellSimulation(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);/*rcruiz*/
@@ -384,7 +389,7 @@ void space_set_commmandline_options(void) {
SYS_WriteCommandLineInt(syshandle, "noaudio", a);
a= (U.gameflags & USER_DISABLE_MIPMAP);
- set_mipmap(!a);
+ GPU_set_mipmap(!a);
SYS_WriteCommandLineInt(syshandle, "nomipmap", a);
/* File specific settings: */
@@ -413,7 +418,9 @@ void space_set_commmandline_options(void) {
a=(G.fileflags & G_FILE_GAME_MAT);
SYS_WriteCommandLineInt(syshandle, "blender_material", a);
- a=(G.fileflags & G_FILE_DIAPLAY_LISTS);
+ a=(G.fileflags & G_FILE_GAME_MAT_GLSL);
+ SYS_WriteCommandLineInt(syshandle, "blender_glsl_material", a);
+ a=(G.fileflags & G_FILE_DISPLAY_LISTS);
SYS_WriteCommandLineInt(syshandle, "displaylists", a);
@@ -430,11 +437,10 @@ static void SaveState(void)
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
- init_realtime_GL();
- init_gl_stuff();
+ GPU_state_init();
if(G.f & G_TEXTUREPAINT)
- texpaint_enable_mipmap();
+ GPU_paint_set_mipmap(1);
waitcursor(1);
}
@@ -442,7 +448,7 @@ static void SaveState(void)
static void RestoreState(void)
{
if(G.f & G_TEXTUREPAINT)
- texpaint_disable_mipmap();
+ GPU_paint_set_mipmap(0);
curarea->win_swap = 0;
curarea->head_swap=0;
@@ -460,7 +466,7 @@ static LinkNode *save_and_reset_all_scene_cfra(void)
Scene *sc;
for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- BLI_linklist_prepend(&storelist, (void*) (long) sc->r.cfra);
+ BLI_linklist_prepend(&storelist, (void*) (intptr_t) sc->r.cfra);
/* why is this reset to 1 ?*/
/* sc->r.cfra= 1;*/
@@ -478,7 +484,7 @@ static void restore_all_scene_cfra(LinkNode *storelist) {
Scene *sc;
for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- int stored_cfra= (long) sc_store->link;
+ int stored_cfra= (intptr_t) sc_store->link;
sc->r.cfra= stored_cfra;
set_scene_bg(sc);
@@ -1022,9 +1028,9 @@ void BIF_undo(void)
}
else {
if(G.f & G_TEXTUREPAINT)
- imagepaint_undo();
+ undo_imagepaint_step(1);
else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL))
- imagepaint_undo();
+ undo_imagepaint_step(1);
else if(G.f & G_PARTICLEEDIT)
PE_undo();
else {
@@ -1046,9 +1052,9 @@ void BIF_redo(void)
}
else {
if(G.f & G_TEXTUREPAINT)
- imagepaint_undo();
+ undo_imagepaint_step(-1);
else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL))
- imagepaint_undo();
+ undo_imagepaint_step(-1);
else if(G.f & G_PARTICLEEDIT)
PE_redo();
else {
@@ -1205,9 +1211,12 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
return; /* return if event was processed (swallowed) by handler(s) */
}
- if(gpencil_do_paint(sa)) return;
+ if(gpencil_do_paint(sa, L_MOUSE)) return;
if(BIF_do_manipulator(sa)) return;
}
+ else if(event==RIGHTMOUSE) {
+ if(gpencil_do_paint(sa, R_MOUSE)) return;
+ }
/* swap mouse buttons based on user preference */
if (U.flag & USER_LMOUSESELECT) {
@@ -1901,6 +1910,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else
copy_attr_menu();
}
+ else if(G.qual==(LR_ALTKEY|LR_SHIFTKEY))
+ gpencil_convert_menu(); /* gpencil.c */
else if(G.qual==LR_ALTKEY) {
if(ob && (ob->flag & OB_POSEMODE))
pose_clear_constraints(); /* poseobject.c */
@@ -1959,7 +1970,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
G.vd->drawtype= pupval;
doredraw= 1;
}
- }
+ }
break;
case EKEY:
@@ -2051,6 +2062,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)){
G.f ^= G_FACESELECT;
allqueue(REDRAWVIEW3D, 1);
+ allqueue(REDRAWBUTSEDIT, 1);
}
else if(G.f & G_PARTICLEEDIT) {
PE_radialcontrol_start(RADIALCONTROL_SIZE);
@@ -2425,7 +2437,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else if(G.qual==LR_ALTKEY && G.obedit->type==OB_ARMATURE)
clear_bone_parent();
else if((G.qual==0) && (G.obedit->type==OB_ARMATURE))
- select_bone_parent();
+ armature_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection
else if((G.qual==(LR_CTRLKEY|LR_ALTKEY)) && (G.obedit->type==OB_ARMATURE))
separate_armature();
else if((G.qual==0) && G.obedit->type==OB_MESH)
@@ -2455,7 +2467,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
start_RBSimulation();
}
else if((G.qual==0) && (OBACT) && (OBACT->type==OB_ARMATURE) && (OBACT->flag & OB_POSEMODE))
- select_bone_parent();
+ pose_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection
else if((G.qual==0)) {
start_game();
}
@@ -2636,10 +2648,9 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else if(G.f & G_VERTEXPAINT)
BIF_undo();
else if(G.f & G_TEXTUREPAINT)
- imagepaint_undo();
- else {
+ undo_imagepaint_step(1);
+ else
single_user();
- }
}
break;
@@ -2711,6 +2722,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case DELKEY:
if(G.qual==0 || G.qual==LR_SHIFTKEY)
delete_context_selected();
+ if(G.qual==LR_ALTKEY)
+ gpencil_delete_menu();
break;
case YKEY:
if((G.qual==0) && (G.obedit)) {
@@ -2756,6 +2769,19 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
scrarea_queue_winredraw(curarea);
break;
+ case LEFTBRACKETKEY:
+ if ((G.obedit) && (G.obedit->type == OB_ARMATURE))
+ armature_select_hierarchy(BONE_SELECT_PARENT, (G.qual == LR_SHIFTKEY));
+ else if ((ob) && (ob->flag & OB_POSEMODE))
+ pose_select_hierarchy(BONE_SELECT_PARENT, (G.qual == LR_SHIFTKEY));
+ break;
+ case RIGHTBRACKETKEY:
+ if ((G.obedit) && (G.obedit->type == OB_ARMATURE))
+ armature_select_hierarchy(BONE_SELECT_CHILD, (G.qual == LR_SHIFTKEY));
+ if ((ob) && (ob->flag & OB_POSEMODE))
+ pose_select_hierarchy(BONE_SELECT_CHILD, (G.qual == LR_SHIFTKEY));
+ break;
+
case PADSLASHKEY:
if(G.qual==0) {
if(G.vd->localview) {
@@ -3237,7 +3263,7 @@ void initipo(ScrArea *sa)
/* ******************** SPACE: INFO ********************** */
void space_mipmap_button_function(int event) {
- set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
+ GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
allqueue(REDRAWVIEW3D, 0);
}
@@ -3472,6 +3498,9 @@ static void info_user_themebuts(uiBlock *block, short y1, short y2, short y3, sh
uiButSetFunc(but, set_userdef_iconfile_cb, &iconfileindex, NULL);
}
+ else if(th_curcol==TH_HANDLE_VERTEX_SIZE) {
+ uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Handle size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
+ }
else {
uiBlockBeginAlign(block);
if ELEM9(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, TH_EDITMESH_ACTIVE, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM, TH_NODE) {
@@ -3710,6 +3739,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
"Snap objects and sub-objects to grid units when scaling");
uiBlockEndAlign(block);
+ uiDefButBitI(block, TOG, USER_ORBIT_ZBUF, B_DRAWINFO, "Auto Depth",
+ (xpos+edgsp+mpref+spref+(2*midsp)),y2,spref,buth,
+ &(U.uiflag), 0, 0, 0, 0,
+ "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
+
uiDefButBitI(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
(xpos+edgsp+mpref+spref+(2*midsp)),y1,spref,buth,
&(U.uiflag), 0, 0, 0, 0,
@@ -3924,20 +3958,23 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiDefBut(block, LABEL,0,"Transform:",
- (xpos+(2*edgsp)+mpref),y5label, mpref,buth,
+ (xpos+(2*edgsp)+mpref),y6label, mpref,buth,
0, 0, 0, 0, 0, "");
uiDefButBitI(block, TOG, USER_DRAGIMMEDIATE, B_DRAWINFO, "Drag Immediately",
- (xpos+edgsp+mpref+midsp),y4,mpref,buth,
+ (xpos+edgsp+mpref+midsp),y5,mpref,buth,
&(U.flag), 0, 0, 0, 0, "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users)");
uiBlockEndAlign(block);
uiDefBut(block, LABEL,0,"Undo:",
- (xpos+(2*edgsp)+mpref),y3label, mpref,buth,
+ (xpos+(2*edgsp)+mpref),y4label, mpref,buth,
0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButS(block, NUMSLI, B_DRAWINFO, "Steps: ",
- (xpos+edgsp+mpref+midsp),y2,mpref,buth,
+ (xpos+edgsp+mpref+midsp),y3,mpref,buth,
&(U.undosteps), 0, 64, 0, 0, "Number of undo steps available (smaller values conserve memory)");
+ uiDefButS(block, NUM, B_DRAWINFO, "Memory Limit: ",
+ (xpos+edgsp+mpref+midsp),y2,mpref,buth,
+ &(U.undomemory), 0, 32767, -1, 0, "Maximum memory usage in megabytes (0 means unlimited)");
uiDefButBitI(block, TOG, USER_GLOBALUNDO, B_DRAWINFO, "Global Undo",
(xpos+edgsp+mpref+midsp),y1,mpref,buth,
@@ -4272,6 +4309,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiDefButI(block, NUM, 0, "Collect Rate ",
(xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth,
&U.texcollectrate, 1.0, 3600.0, 30, 2, "Number of seconds between each run of the GL texture garbage collector.");
+ uiBlockEndAlign(block);
/* *** */
uiDefBut(block, LABEL,0,"Color range for weight paint",
@@ -4508,7 +4546,7 @@ static void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0)
U.light[0].flag= 1;
- default_gl_light();
+ GPU_default_lights();
addqueue(sa->win, REDRAW, 1);
allqueue(REDRAWVIEW3D, 0);
}
@@ -4823,8 +4861,11 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
/* grease-pencil defaults to leftmouse */
- if(event==LEFTMOUSE) {
- if(gpencil_do_paint(sa)) return;
+ if (event == LEFTMOUSE) {
+ if(gpencil_do_paint(sa, L_MOUSE)) return;
+ }
+ else if (event == RIGHTMOUSE) {
+ if(gpencil_do_paint(sa, R_MOUSE)) return;
}
/* swap mouse buttons based on user preference */
@@ -5099,6 +5140,10 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if((G.qual==0))
del_seq();
}
+ else if(G.qual==LR_ALTKEY) {
+ if(sseq->mainb)
+ gpencil_delete_menu();
+ }
break;
case PAD1: case PAD2: case PAD4: case PAD8:
seq_viewzoom(event, (G.qual & LR_SHIFTKEY)==0);
@@ -5107,7 +5152,10 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
}
- if(doredraw) scrarea_queue_winredraw(curarea);
+ if(doredraw) {
+ scrarea_queue_winredraw(curarea);
+ scrarea_queue_headredraw(curarea);
+ }
}
@@ -5138,8 +5186,8 @@ static void init_seqspace(ScrArea *sa)
sseq->v2d.max[0]= MAXFRAMEF;
sseq->v2d.max[1]= MAXSEQ;
- sseq->v2d.minzoom= 0.1f;
- sseq->v2d.maxzoom= 10.0;
+ sseq->v2d.minzoom= 0.01f;
+ sseq->v2d.maxzoom= 100.0;
sseq->v2d.scroll= L_SCROLL+B_SCROLL;
sseq->v2d.keepaspect= 0;
@@ -5294,7 +5342,15 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if(val==0) return;
if(uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
+
+ /* grease-pencil drawing before draw-tool */
+ if (event == LEFTMOUSE) {
+ if (gpencil_do_paint(sa, L_MOUSE)) return;
+ }
+ else if (event == RIGHTMOUSE) {
+ if (gpencil_do_paint(sa, R_MOUSE)) return;
+ }
+
if (sima->image && (sima->flag & SI_DRAWTOOL)) {
switch(event) {
case CKEY:
@@ -5317,7 +5373,7 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
event = LEFTMOUSE;
}
}
-
+
/* Draw tool is inactive, editmode is enabled and the image is not a render or composite */
if (EM_texFaceCheck() && (G.sima->image==0 || (G.sima->image->type != IMA_TYPE_R_RESULT && G.sima->image->type != IMA_TYPE_COMPOSITE))) {
switch(event) {
@@ -5954,7 +6010,7 @@ static void init_oopsspace(ScrArea *sa)
soops= MEM_callocN(sizeof(SpaceOops), "initoopsspace");
BLI_addhead(&sa->spacedata, soops);
- soops->visiflag= OOPS_OB+OOPS_MA+OOPS_ME+OOPS_TE+OOPS_CU+OOPS_IP;
+ soops->visiflag= OOPS_OB|OOPS_MA|OOPS_ME|OOPS_TE|OOPS_CU|OOPS_IP;
/* new oops is default an outliner */
soops->type= SO_OUTLINER;
@@ -6025,6 +6081,10 @@ static void init_textspace(ScrArea *sa)
st->lheight= 12;
st->showlinenrs= 0;
st->tabnumber = 4;
+ st->showsyntax= 0;
+ st->doplugins= 0;
+ st->overwrite= 0;
+ st->wordwrap= 0;
st->currtab_set = 0;
st->top= 0;
@@ -6294,6 +6354,8 @@ void freespacelist(ScrArea *sa)
SpaceImage *sima= (SpaceImage *)sl;
if(sima->cumap)
curvemapping_free(sima->cumap);
+ if(sima->gpd)
+ free_gpencil_data(sima->gpd);
}
else if(sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;
@@ -6361,6 +6423,10 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2)
SpaceSeq *sseq= (SpaceSeq *)sl;
sseq->gpd= gpencil_data_duplicate(sseq->gpd);
}
+ else if(sl->spacetype==SPACE_IMAGE) {
+ SpaceImage *sima= (SpaceImage *)sl;
+ sima->gpd= gpencil_data_duplicate(sima->gpd);
+ }
sl= sl->next;
}
diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c
index 2431ff5de22..ecd63166792 100644
--- a/source/blender/src/splash.jpg.c
+++ b/source/blender/src/splash.jpg.c
@@ -1,2990 +1,1590 @@
/* DataToC output of file <splash_jpg> */
-int datatoc_splash_jpg_size= 95515;
+int datatoc_splash_jpg_size= 50665;
char datatoc_splash_jpg[]= {
-255,216,255,224, 0, 16, 74, 70, 73, 70, 0, 1, 2, 0, 0,100, 0,100, 0, 0,255,236, 0, 17, 68,117, 99,
-107,121, 0, 1, 0, 4, 0, 0, 0, 95, 0, 0,255,238, 0, 14, 65,100,111, 98,101, 0,100,192, 0, 0, 0, 1,255,219, 0,132,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 1, 1, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 4, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5,255,192, 0, 17, 8, 1, 26, 1,245, 3, 1, 17, 0, 2, 17, 1, 3, 17, 1,255,196, 0,230, 0, 0, 0, 6, 3, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 8, 0, 2, 9, 1, 10, 11, 1, 0, 0, 7, 1, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 0, 1, 3, 3, 3, 1, 4, 4, 9, 8, 5, 8, 5,
- 8, 5, 13, 1, 2, 3, 4, 17, 5, 6, 0, 18, 7, 33, 49, 65, 19, 8, 81, 97, 34, 20,113,129,145, 50, 35, 51, 52, 21, 9,240,
-161,177,193, 66, 82, 98, 53,225,149,213, 22, 54,209,241,114, 36,212, 69, 85, 24,194, 67, 83, 99,148,130,162,179, 37,117,181, 23,
- 55,115,195, 68,133, 10,146,178,210,131,147,211,116,196,165,197, 38, 70, 71, 17, 0, 1, 3, 2, 4, 2, 6, 5, 8, 8, 5, 4,
- 2, 1, 5, 1, 1, 17, 2, 3, 0, 4, 33, 49, 18, 5, 65, 6, 81, 97,113, 34, 19, 7,129,145,161, 50, 20,240,177,193,209, 66,
-146, 83,211,225,114, 35, 51, 67, 21, 23, 8,241, 82, 98,130,210,178, 36, 52, 22,194,115,162,226, 99, 68,116, 9, 53,255,218, 0,
- 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,251,244,208,161, 89,161, 66,136, 93,149,114, 77,174,228,171, 50, 34,185,119, 76, 9,
-106,181, 55, 57, 74, 76, 37,220, 67,106,240, 3,197, 21, 88, 65,114,155,138,122,211,179, 81,175, 76,194, 25, 62, 31, 79,139,164,
-232,212,186,117, 39,117, 83, 20, 84, 84,225, 82,172, 68, 38,104,254, 32,184, 69,168,107,210,154,180,175,123, 74,224,168,168,188,
-107,147,184, 15,158, 62, 82,226,238, 69,187,224, 62,105,236,206, 52,193,184, 58,148,222, 45,214, 86,160,203,199,208,226,190,140,
-161,168,200, 67,115,225,148,252,215, 81,185,116,235, 85,158,131,197, 92,181,253,196,239, 60,147,187, 75,181,115,188, 37,163, 81,
- 73, 26,192, 11, 1,201, 3, 64, 18, 68,120, 57,170,239,214,225,237,206,102,254,220,118, 94,120,218, 34,221,185, 26, 96,227,164,
- 44,110,121, 34, 66, 51, 82,226, 76,114,142, 45,114, 55,169,185,158,172, 99,217, 21,139, 44,179,192,200, 49,171,180, 27,221,150,
-230,194, 36,193,185, 91,100,166, 84, 73, 44,172, 84, 20,173, 4,142,157,132,118,131,208,245,215,180, 54,221,202,223,120,129,151,
- 54,178, 54, 72,158, 21,174,105, 5,164, 30, 32,138,241, 62,229,182, 92,108,211,190,214,238, 55, 71, 43, 10, 57,174, 4, 56, 17,
-192,131, 75, 58,157, 80,107, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40,
- 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,
-179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,
-154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,
-208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,
-133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,174,110,249,156,129,231,110, 79, 36, 72, 95, 16,221,151, 15,143,125,198, 10,
-108,173, 88, 38, 67,132,250, 94,240,211,239, 30,251,239, 32, 58,183, 11,251,138, 72, 37, 59,118,210,134,186,242,199,155, 27, 63,
-152,251,134,236,231,114,252,205,109,142,150,232, 12,124,108, 42,157,237,122,241, 46,212,168,138, 17, 19, 21,175, 86,121, 75,188,
-249,109,183,109, 45,111, 48,194,231, 95,106,118,178,246, 72,240,139,221,209,163, 0,221, 40,170,133, 87,130, 85, 2,207,249,239,
-205,223, 25,222, 14, 61,151,114,205,222, 29,241,180,133,201,181,196,188, 65,185, 75,130, 20, 1, 72,144,150, 16,224,101, 74, 6,
-161, 43, 32,211,173, 41, 77,121,119,156,124,195,231,206, 68,185,248, 77,195,116, 34,100,197,140,146, 57, 11,122, 53,105, 7, 73,
- 60, 1,197, 49, 74,245, 63, 38,121,115,200, 60,251,109,241,155,118,212, 12, 11,131,223, 28,177,135,116,232,214, 65,112, 28, 72,
- 8,184, 45, 35,189,138,121,171,243, 47, 2,219,114,187, 65,190,230,112, 34,120,143, 90,110,183,166,162, 91,213,177,225, 69,120,
- 47, 56,150, 93, 90, 23, 65,208, 18,146,122,246,232, 14, 78,243, 3,206,107,104,167,184,142, 73,161, 29,232,223, 41,142, 53, 7,
-139, 11,180,184,180,245,119, 77, 25,231, 63, 47,124,150,186,150,222,222, 72,224,156,163,100,100, 34, 73, 16,142, 15, 13,212,208,
-225,215,222, 25, 83,135,142,185, 19,204, 39,146,204,138, 51, 57, 22, 57,118,143,136,221,229,149, 92,113,123,194,183,216,174,229,
- 0, 7, 23, 14, 74, 11,141,177, 33, 40,235,185, 7,175, 77,201, 34,154,149,203, 60,199,205,191,219,133,211, 89,127,108,241,103,
- 35,187,209,184,131, 27,207, 19, 27,219,169,173,122,116,103,246,129, 25, 68,230,126, 91,229, 15,238, 82,213,239,219,238, 88,111,
- 35,111,118, 86,130, 36, 96,224, 36, 99,131, 92,230, 47, 72,195,236,184, 28,251, 71,135,249,130,192,243,126, 29,188,115, 61,133,
-201,147, 44, 56,238, 59,124,191, 95,173, 44,182,131,124,183, 61,142, 68, 92,185,112,148,218,214,134,252,100,161, 20, 69, 86, 18,
-170,130, 21,180,215, 95, 70,124,189,230,219, 47, 50,236,224,189,219, 94,172,149,193,136,112, 44,126, 0,177,227, 20, 45, 36, 42,
- 42,132, 33, 65, 21,243,115,204, 94, 82,189,242,194,242,226,203,115, 98, 62, 38,151,171,113, 15, 96, 4,135,176,148, 80,224, 10,
- 42, 33, 80, 80,131, 81,199,147,111, 59,124, 23,231,171,141, 37,242,151, 5, 92,114, 9, 22, 91, 93,229,204,118,251,108,202,108,
- 46, 99,247,203, 37,245,150, 24,144,184,238,182, 84,235, 46,237,106, 66, 15,136,195,171, 65,173, 2,170, 14,186,119, 54,242,133,
-231, 37,220,139, 91,208,208,242,221, 64,180,168, 45, 82, 23,167,129,192,128,107,149,242,103, 59, 88,243,221,161,188,176, 46, 44,
- 14,210, 67,155,164,135, 32, 40,120, 28, 8,196, 18, 58,234,102,230,206,105,227,159, 47, 28, 97,149,243, 31, 45, 95, 85,140,241,
-238, 19, 14, 60,252,146,248,155,116,155,178,160, 69,148,251, 81,144,175,119,136,211,242, 28,220,243,200, 77, 16,131,219, 83,210,
-186,170,217,246,139,141,250,229,150,150,173,213, 43,202, 52, 40, 11,130,230, 80,100, 42,231,123,222,237,185,118,214, 75,219,183,
-105,133,129, 92, 80,148, 10,153, 0, 78,102,139,112, 87, 58,241,135,153, 62, 47,198,121,147,135, 50, 63,239, 95, 30,229,237,220,
- 29,176, 94,205,186, 77,161,115, 17,108,150,252, 39,137,141, 49,150, 36,181,182, 68,103, 18, 55,160, 86,149, 21, 4, 18,123,206,
-205,113,203,247, 47,179,187,110,153, 88,154,130,130,138, 1, 24,130, 70, 68, 81,108, 91,229,183, 50, 90, 71,123,102,253,112,189,
-116,185, 8, 84, 37,167, 2, 1,204, 30, 21, 46,234,174,173,171, 52, 40, 86,104, 80,172,208,161, 84,163,130,252,254,121,126,243,
- 25,207,252,215,229,203,139,166,229, 55, 76,219,128,164,201,182,242, 5,202,227,143, 42,207,141,181,124,129,113,145,108,147, 10,
- 27,207,184,153, 18,151, 30, 84, 85,133, 56, 24, 13,145, 66,133,170,186,215,111,124,147,125,203,214, 54,215,247, 65,162, 59,140,
- 88, 1, 87, 38,144,224, 74, 96, 20, 17,130,175, 72,172, 86,193,207,187,127, 50,223,221,109,214,133,230, 75, 98,146, 18,212,106,
-135, 22,144, 9,196,161, 7, 20, 78,131, 87, 95, 89, 26,218,214,104, 80,166,150,125,157, 98,188, 97,131,230, 28,145,157, 93,216,
-199,240,188, 7, 24,190,102, 57,101,242, 74, 22,235, 22,156,119, 27,140,236,201,146, 20,134,146,183, 92,240,163,178,165,108, 66,
- 74,141, 40,144, 73, 3, 82,172,108,165,220,166,142,222, 22,234,145,238, 13,104,233,115,138, 1,233, 38,162,110, 23,241,109,112,
- 73,115, 59,180,199, 27, 75,220,122, 26,208,164,244,224, 7, 12,107,231, 85,127,143, 87, 55,242,157,198,249,126,242,157,248,110,
-243, 47, 52,241, 6, 61,113,145, 13,204,234, 69,202,226,205,198,240, 34,237, 82,208, 34,217,177,235,212, 72, 79, 6,250,150, 83,
- 46, 66,192, 82, 74,146, 59, 15,120,119,146,214, 27, 72,108,123,174,239, 4, 23, 14, 11,163,186,129,122,220,246, 18, 58,244,180,
-117,215,157,155,231,190,225,188,151,203,179,236,151, 23, 22,205, 41,173, 92,165, 56, 35, 35,120, 5, 56,106,113,196, 97, 93, 31,
-252, 60,255, 0, 20,110, 28,252, 64, 96,101, 22, 91, 30, 57,127,226,190, 97,192, 67,107,206,120,151, 45,125, 19, 46, 22,248,142,
- 57,224,251,228, 9,136,109,129, 62, 50, 36,253, 3,165,108,180,235,110, 10, 56,202, 2,155, 82,240, 28,249,229,197,223, 34, 58,
- 55, 72,246,203, 4,158,228,141,200,241, 66, 49, 66,152,140, 72, 35, 34, 80,167, 72,242,239,205, 11, 47, 48,217, 35, 35, 99,162,
-184,139,223,137,248,144, 50, 80,112,212, 23, 3,128, 32,230,208,160,158,156,107,158, 87, 76,172,208,161, 84, 31,206, 95,226, 19,
-195,254, 77,114,110, 15,227,188,153,137, 25,135, 41,115,215, 34, 98, 56,102, 41,129,217,174, 45, 66,184, 91, 49,252,134,230,197,
-186, 86, 67,113,113,104,119,221,161,195, 91,219, 90, 27, 10,159,116,120,109,128,148,186,227, 91,110, 83,228, 91,190,108,138,230,
-226, 51,162, 24, 35,115,220,242, 20, 18,214,151, 6, 55,165,197, 49,255, 0, 40,196,230, 1,192,243,151,152, 86,124,157, 53,173,
-172,160,190,123,137, 88,198,176, 16, 8, 14,112,105,123,186, 26, 23, 12, 21,199, 1,145, 34,242,191,121,182,195,180, 73,190,220,
-167, 68,182, 90, 32,193,145,115,184, 92,174, 50, 81, 10, 5,190,223, 17, 5,215,159,125,231, 20,150,218,109,166,210, 84,181,172,
-128, 0, 36,154, 13, 99, 35,141,210,184, 53,160,146, 74, 0, 49, 36,156,128, 29, 53,187,146, 70,194,210,247,144, 26, 2,146,112,
- 0, 12,201, 60, 0,174, 61,240,191,227, 31,199,222,102,188,224,163,203,135,150,238, 20,228, 30, 89,226,251, 68, 91,136,205,252,
-197,193,148,197,151, 23,199,165, 50, 8,141, 45,171,124,198,218,113,251,115,238,161, 76,165,247,164, 52,251,138,169, 98, 51,201,
- 77, 87,213,119,191, 42,102,229,141,167,249,134,227,113, 28, 83, 56,141, 16, 21, 46,119, 72, 80,168,224, 49, 64, 11, 64,247,156,
- 9,195,143,236, 30,112,193,205,155,207,242,205,174,218, 73,160,104, 58,231, 8, 26,222,131,164,162,176,156, 20,144,226,125,214,
- 56, 12,123, 44,149,110, 74, 84, 59, 20, 1,235,219,215, 92,158,187, 29,123,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20,
- 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161,
- 89,161, 66,179, 66,133,102,133, 10,205, 10, 20,147,115,200, 44, 54, 69, 50,155,205,238,209,105, 84,128,181, 71, 77,206,228,204,
- 5, 62,150,232, 20, 80, 29, 90, 55,109,168,173, 52,236,112,190, 95,117,164,246, 5,164,151, 6,230,104,172, 92,183, 21,157,144,
- 79,196,161,100,216,252,204,170,215,111,137,118,185,227, 49,111, 49,164,100, 22,235, 84,243, 70, 36,191, 9, 14, 25, 44,180,249,
-250,183, 22,128,149,119, 19,163,117,180,140, 96,144,181,193,132,160, 40, 80,145,152, 7, 37, 20, 3,193, 40,161,105,193,166,105,
- 84,131,145,229,120,190, 31, 5,155,166, 91,146, 88, 49,107,108,137,240,237,113,238, 57, 29,226, 61,146, 11,247, 59,130,182, 71,
-140,135,164,184,211,106,117,245,251, 45,182, 14,229, 30,128, 29, 61, 5,188,151, 39, 76,109,115,138, 42, 0, 73, 65,153,195,128,
-164,185,225,152,146,148,189,166,105, 84,141, 55, 35,199,173,178,219,183,220,111,214, 91,124,247, 67,106,106, 20,219,163, 17,101,
-186,151,137, 74, 10, 91,113,196,173, 91,148, 8, 20, 29, 78,157,100, 15,144,106,107, 73, 29, 32, 26, 73,112, 24, 19, 75, 58,106,
-149, 89,161, 66,147, 87,122,179,183,120,143,142,185,118,182, 35, 32,153,108,155,122,137, 98, 92,246,147,120,149,103,183, 58,195,
- 18, 37,183, 20,175,199, 91, 44, 63, 41,150,220,117, 41,218,149, 45, 9, 36, 21, 36, 23, 4, 78, 45, 47, 67,164, 20, 84,193, 74,
-144, 23, 37, 32, 28, 58,141, 22,160,169,198,142, 73,147, 26, 20,119,165,204,144,196, 72,177,219, 83,210, 36,201,117, 44, 71, 97,
-164, 10,169, 75, 90,136, 74, 64, 29,164,157, 33,173, 46, 40, 2,154, 50, 82,134,209, 80,172,208,161, 89,161, 66,162,142, 65,229,
-236, 87, 1,180, 92,174,183, 27,132, 88,240,109, 15, 46, 61,239, 32,184,151, 34,226, 88,191,130,130,227,174,220,238, 1, 10,101,
-132,176,210, 74,150,128, 74,135, 64, 66,119, 3,163,107, 75,138, 12,232, 18,149,199,110,102,252, 84,237,138,189, 92, 48,142, 2,
-192,185, 19,154,114,148,186,109,176,179,171,149,238,225,198,152, 7,191,184,176,211,178,161,219,109,202,137,114,155, 18, 58,138,
-150,143, 21, 64,169, 9,250,211, 80,181,109,236,249, 49,198, 49, 45,203,244, 14,128,210, 83,180,229,234, 94,140,234,150, 93,224,
-106,211, 27, 84,246,253, 31, 90, 82,187,191,137, 3, 54,219, 37,162,213,253,207,190,103,119,152, 54,139,106, 46,249,108, 62,103,
-185, 91,108, 87, 91,170, 88, 64,144,244, 51,109,139, 24, 63, 28,185, 95, 13,206,129, 67,218, 27,129,220,103,193,200, 34, 81,168,
-204, 67, 78, 93,220, 83,130,247,176,168,239,223,116,224, 25,143,111,232,171,243,228,211,205, 53,183,204,213,131, 53,145, 18,223,
-119,183,203,194,239, 22,200, 18,154,184, 60,221,218, 42, 81,116,143,226, 4, 49,115,101,182, 81, 48, 52,251, 79, 54, 67,141,135,
- 19,182,139, 42, 39,113,203,111,219, 19,182, 71,129,172, 57,174, 84, 60,112, 69, 81,233,233,171, 75, 27,209,122, 9, 66, 8,206,
-174,134,168,106,117, 4,251,236, 69, 97,233, 50, 94,106, 52,104,237, 45,231,228, 62,224,101,134, 25,104, 21, 41,107, 90,136, 74,
- 82,144, 42, 73, 61, 52,137,101,108, 45, 47,121, 1,160, 41, 39, 0, 0,204,147,192, 82,226,137,211,184, 49,128,151, 18,128, 0,
-164,147,144, 0,102,107,147,254,104,124,253,120, 78,207,227,158, 2,147,239,151, 7, 22,253,178,235,200, 17,219, 18, 27, 67,171,
-250, 50,213,153, 52, 80,121, 68,146, 4,154, 83,254,204, 30,139, 30, 36,243,143,251,155, 33,206,218, 57, 92,235,144,146,199, 78,
- 2,226,112,211, 8,199, 81, 63,231,251,128,224,234,247, 23,147, 63,218,248, 44,102,241,205, 35, 68, 96, 7,182,220,148,192, 99,
-170,115,134,144, 51,209,159,249,200,197,181,205, 78, 40,199,198,113,204,248,141,131, 45, 92,153, 42,189,229,141,181,126, 55, 39,
- 22,185,114,164, 5,173,199,144,250,150,119,149, 58,226, 10, 87, 83, 90,157,121, 91,203, 45,145,188,207,205,118, 86, 91,162,184,
- 62,227,246,161,234,174, 45, 87, 57,174, 92, 85,196,105, 43,142, 53,234,239, 51,247,199,114,191, 41,222,222,237,101,173, 49,219,
-126,200,177, 17,161,200,214,185,169,130, 52, 59, 80, 76, 48,174, 63,126, 51,190,110,252,197,187,231, 47,147,120, 22,221,152,102,
-124, 97,197, 28, 37, 50,211,137,225, 56, 38, 45,120,151,139, 91, 46, 49, 4, 24,146, 77,230, 82, 34,173,143,125,114,226,183,188,
- 86,156, 93, 66, 91,216,148, 80, 2, 79,233,159,201, 94, 73,218,236, 54, 59,123,134, 67, 27,228,145,170, 92, 90, 14,148, 36, 6,
- 55,252,161,160, 34, 4,198,191, 45,190,124,115,230,239,184,111,247, 54,178, 77, 43, 34,137,200,214,135, 56,106, 80, 28, 94,236,
-123,197,196,170,149,193, 18,175, 71,224,153,230, 31,152,124,206,241,135,153,239, 45, 60,239,145,228, 92,149,199,152, 39, 30, 51,
-200, 28,127,152,229,243, 92,189,221,184,243, 35, 99,222, 18,136,109, 92,100,120,143,150,159, 13,120,237,180,183, 8, 64, 67,161,
- 35,106,212, 53,231,143,239, 83,203, 45,151,115,216, 36,115,163,100,110,146, 57, 73, 0, 0,142,141,133,237,148, 12,129,105,192,
-145,152, 40,107,210,159,216,191,154,155,230,221,191,199, 24,150, 73, 27, 28,145, 0, 92, 73,238,200,253, 15,136,156,200,120,196,
- 2,112, 33, 69,116, 11,202,174,117,114,179, 88, 60,195,225, 94, 59,202,179,100,220, 19,201, 19,215, 23,121, 44, 55,114,181, 90,
-228,165, 14, 4,246, 36,169,167,148, 9,239,160, 29,195, 95, 42,191,177,254, 98,150,219,152,228,218,201, 38, 41, 67, 36, 3,128,
-123, 36,104, 84,224,173,113, 4,241, 65,213, 95, 91,127,190,174, 93,134,231,150,153,186, 0, 4,177, 23,198,188, 75, 36,141,229,
- 23,138, 57,160,129,193, 79, 77,113,175,240,122,242, 79,230, 67,205,255, 0, 14,114, 35, 56, 63,155,222, 71,242,229,197,120,182,
-117, 37,184,246, 14, 49,144,236, 59,133,251, 57,153, 6, 26,223,155,112,114, 52,219,123,139,105,136,201,142,134,155, 90,213, 83,
-191,111,135,212,175,238, 71,155,124,233, 97,202,119,241, 9, 54,248,174, 39,124, 96,151, 73,147, 88, 28, 81,173, 80,236, 73, 82,
- 78, 28, 21,120,124, 21,242, 95,145, 55, 30,114,219,166, 49,238, 82,218,219,178, 82, 3, 98,205,210, 22,181, 92,228, 45,192, 13,
- 32, 12,120,162,113, 77,207,188,217,121,171,227,206, 58,252, 69,191, 13, 47, 50,252,165, 63,157, 34,113,254, 19,117,115, 16,207,
-239, 50, 92,186, 94,237,183, 44, 30,253, 99, 90,144, 38,190, 87, 49,200,183, 24, 15,248,158, 12,151, 22,166, 92, 1, 41, 85, 10,
-171, 38,203,150,118,203,235,141,167,152,182,232, 68, 6, 73, 0,115, 6, 0,135,177,252, 6, 10,215, 4, 80, 2,140, 82,162, 95,
-243, 94,235,183,219,111, 60,177,185,206,110, 4, 81,146,201, 14, 36, 22, 61,156, 78, 40,230,149, 66, 78,147,130,212, 2,143, 60,
-220,217,142,121,122,242, 75,228,227, 7,207,185, 43,138,248,153,236, 74,110, 97,202, 23,158, 22,101,229,242,158, 94,230, 79,150,
-228,105, 92,104,126, 3,209,221,121,184, 80, 98,130,204,116, 56,148,173,213,168,185,184, 33, 0, 92, 14, 75,180,150,255, 0,116,
-222, 38,142, 41,103,241, 52,198, 37, 79, 13,186, 98,143, 18,160,162,147,137, 76, 0, 9,153,170, 71,115,221,236, 59,118,211,178,
- 67, 44,177, 91,248,122,164, 48,130,101,126,169,100,193,168, 65, 32, 52, 96, 20, 41, 37, 85, 5, 77,182,207, 53,156,173,229,103,
-153,248,143,145,188,151,103, 94,127, 51,188, 77, 23, 20,199,230,110, 57,243, 49,135,220, 47, 24,221,246,214,183,152, 14, 38, 58,
- 91,114, 83, 43, 50,163, 41,224, 23,225, 33,198, 86,148, 45, 11, 53, 32, 83, 30, 92,182,230, 91, 41,237,247,166,109,236,145, 22,
- 39,219,184, 2, 10, 28,213, 14, 5, 56,144, 65, 32,138,188,111, 52, 93,114,173,253,189,206,196,253,202, 72,149, 38,142,229,142,
- 45,112, 81,146, 40,196, 47, 0, 90, 64, 32,213,228,226,190, 84,252, 65,127, 17, 15, 59, 62,115,124,172, 90, 60,227,102,220, 67,
-193, 56, 23, 37,242, 10,212,172, 90,199,110,131,154, 90,241, 59, 94, 69, 58, 13,166,207,108,157, 25,136, 83,226,163,192,162,100,
- 58,169, 4,148,182, 2,130,201,214, 51,118,179,216,249, 7,101,219,119, 51,183,178,107,169, 99,103,188,231,104, 46, 49,135, 57,
-206, 4,144,113,200, 39, 30, 21,187,217,175,185,131,204,125,247,116,218, 70,229, 36, 22,144,202,255, 0,117,173,214, 26, 36,115,
- 88,198,144, 1, 24,102, 87, 33,198,162,252, 3,204,167,154,159,194,175,206,215,154, 95, 47, 89, 63, 58,102, 94,101, 48, 12, 23,
-128,242,238, 70,178, 65,228,171,196,219,179, 15, 95, 99, 88, 99,222,236,178, 3,114, 37, 74,118, 26,219,144,248,141, 48, 71,120,
- 37,198,234,170, 2, 19,182,214,255, 0, 96,219,124,203,217,172,111,227,182,101,180,210, 92, 54, 55,120, 96, 12, 11,203, 92, 48,
- 1,112, 10,213, 10, 14, 29,180,251,111, 49,238,158, 85,111,187,134,219, 37,212,151, 80,199,108,249, 27,226, 18,123,193,129,236,
- 56,146,152,157, 46, 66,132, 99,208,143,143, 35, 62, 92,124,255, 0,126, 38,216, 30, 71,230,227, 48,252, 66,249,143,139,175, 23,
-124,174,253, 19, 6,176,225, 87, 73, 76,227,150,217,182, 39,118,238,118,223, 18,227, 6, 20, 72,232,144, 60, 54,226,180,205,118,
- 13,202, 81,221, 67, 3,157,185,151,101,242,238,233,187, 69,190,213, 12,173,107, 26, 94,231,166,163,168,112, 37,164,146,152,151,
- 19,159, 10,177,228, 46, 85,223,188,206,180,118,245,115,188, 79, 11,156,247, 8,218,194,116,130,211,153,104,115, 64, 11,128,104,
- 25, 98,181,205,206, 17,243, 63,230, 7,201, 77,207,241, 54,228, 69,100, 48,231,121,150,145,156,219,120,150,247,159, 67,141, 26,
-124, 40, 92,143,144,228,215,212,222,239,172, 54, 25, 76, 69,146,168, 18,215, 28,248, 65, 1,197,161, 91, 40, 54,235,161,111,124,
-181, 97,206, 71,101,131, 65, 22,130, 55, 72, 24, 84, 18,198,198,205, 44, 56,175,218, 11,138,160, 56,215, 51,216, 57,171,112,228,
- 97,190,220,107, 6,244,200,216,139,192, 4, 9, 29, 36,154,222, 48, 79,178,226, 48, 69, 35, 14, 21,174, 51,202,247,187,255, 0,
- 6,185,201,114,188,194,126, 39, 51,188,222, 79,183,203,201,108, 55,252,122, 5,210,231,196, 82,111, 69,213, 59, 18, 32,146,155,
-135,189,185, 29,214,130, 82,169, 45,154, 2, 74,131, 69, 41,216, 74,231,111, 16, 95,252, 55,195,109, 98,192, 16,210,215, 22,137,
- 81, 49, 40,136, 10,240,232,226,184,209,218,238,102,227,110,248,175,138,221,142,228, 65,112,115, 67,140, 58,149, 64, 85, 82,210,
- 62,208,227,138, 38, 21,102, 57, 79,241, 98,252, 72,111,220,113,228,142,193,140,114, 62, 79,196,220,183,151, 76,204,248,187, 58,
- 93,207, 13,131, 0,242, 6, 67,108,187,217,226, 89,239, 18,152,185,218,220, 45,151,162,220,144,135,203, 41, 8, 82,195,132, 14,
-180, 20, 27, 95,150,156,189, 5,198,229, 36,145, 54,107,120,195,100, 98, 56,157, 13, 44,113,115, 65,107,184, 22,148, 92, 81, 43,
- 73,187,249,171,204,215, 22,219, 84,113, 74,248,110, 36, 47,137,234,192, 53,184, 61,141, 99,200,115,112, 80,224,169,130,173,125,
- 78,126, 31,126, 86, 57, 51,203, 87, 13,101, 88,151, 51,115,158, 87,230, 43, 38,228,156,206,227,200,185, 6, 81,156,151,100,201,
-143, 59, 34,182, 90,224,202,183,176,153, 50,166,175,221, 16,171,113,113,180, 21,129,244,138,246, 70,188,207,206,156,207, 15, 51,
-221,178,123,107,102, 91, 70,200,195, 26,198,116, 53,206, 33,197, 0,239,119,144,246, 12,107,213,220,137,202,115,242,157,147,237,
-238,238,159,117, 36,146, 25, 28,247,244,185,173,105,104, 82,123,163, 74,142,211,133, 91,156, 31,138,248,207,137,177, 88,120,190,
- 17,138, 99,120, 86, 27,143, 67,121,187,117,146,205,110, 98,203, 96,178, 91,210,165,188,224,105,150,146,219, 44, 32, 41, 74, 90,
-136, 0, 84,146,123, 78,179, 23,119,115,110, 82,186,105,158,231,200,227,139,156, 73,113, 57, 98, 78, 39,162,181,118,118, 80,109,
- 80,182, 24, 24,216,226, 96,193,173, 1,173,104,207, 0, 48, 29, 53,242,201,248, 81, 71,111,158,191, 23, 95, 60, 30,105,184,194,
- 55,186,240,195,119, 46, 71,179, 90,174,214,214,203, 22,204,149,220,239, 33,138,245,185,209, 77,169,112, 92, 34,217, 95,184,186,
-145, 82,149, 45,178,174,170, 4,250, 75,205, 87,255, 0, 34,229, 93,175,106,184, 43,113,220,113, 7, 54,134, 48,135,122,139,195,
- 7, 80, 41,149,121,107,201,246,127,236, 60,223,187,111, 22,193, 45,191,104,208, 70, 78, 50, 72, 11, 79, 94,160,194,243,208, 72,
- 92,235,235,151, 94, 99,175, 88,213, 55,243,209,231, 91,139,124,136,240, 61,251,153,121, 29,244,207,184,168,185,100,227,188, 22,
- 44,128,205,231,144,179,137, 13, 56,228,107,124,115,181,126, 11, 73, 8, 46,202,146,164,148,180,210, 84,170, 41,101, 8, 94,183,
-146,249, 62,231,157,175,155,103,110, 16,102,247,240, 99, 56,184,244,158, 0,113, 61, 74, 70, 51,158,249,222,211,144,172, 31,123,
-114, 84,228,198, 12,222,244,193,163,160,113,113,224, 49,196,160, 63, 22,156,219,199,126,102,238,126,101, 60,141,121,198,243, 99,
-118,144,142, 78,243,137,230, 26,223,145,219,112,103,225,174, 26, 48, 12, 7, 6,190, 97,159,114,195,105,167, 30,113,112,155, 84,
-107,230,214, 96,168,111,101,180, 32,188,165, 72,113,208,159, 89,237, 27,174,219,252,183,117,218, 54,166,254,194,206,216,180,189,
- 87, 91,222,201,117,156,177, 66,204, 93,147,137, 58, 70,144, 23,198,123,222,207,186,141,211,104,222,183,135,127,220, 95, 93, 7,
- 8,209, 60, 56,216,248,116, 4, 92, 20, 63, 6,230,208, 6,162, 92, 92,157,166,252,126,252,224,100, 88,119, 28,112,239,145,254,
- 56,200, 96, 99, 89, 31,152,182, 34, 94,121, 66,255, 0, 62,246,140,126, 37,171,140, 12,228,219,160,194,149, 45,194,150,226,196,
-189, 92,208,249,154,250,214,148,165,152,174, 54,176,166,221, 93, 57, 39,144,252,171, 29,212,179,239, 87, 12, 46,101,190, 17,180,
- 13, 68,200,154,137, 3,139,154,212,210, 17, 75,156, 8,196, 10,237, 31,220, 71, 56, 75,105, 13,190,195,108,240,199,220,227, 35,
-139,180,129, 30,173, 32, 19,193,175,114,234, 42,129,172, 32,168, 38,164, 31,195, 19,204,199,225, 51,229,123, 5,198, 60,188,113,
-207,153,188, 26, 95, 36,220,165, 68,123, 50,203, 50, 76,110,253,134,219,243,190, 64,154,134,217,122, 72,189, 94,109, 80,237, 30,
- 26,150, 3, 48,216, 68,178,148, 54, 18,144, 84,178,165,174,171,204, 46, 88,230,174,102,184,126,231,121,102,241, 16, 7, 67, 26,
-230, 60,198,193,136, 26, 90,226,229,226,227,167, 18,167, 0,128, 92,121,105,205,156,161,202,150,209,237, 54, 87,209,153, 73, 26,
-222,230,189,130, 73, 14, 4,235,123, 67, 83,131, 64,114, 0,131, 18,164,253, 20, 52,235, 79,182,135, 88,113, 14,180,226, 66,219,
-113,181, 5,161,104, 80,168, 32,142,132, 17,174, 31,149,119,252,232, 77, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,
-161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205,
- 10, 21,154, 20, 43, 52, 40, 86,104, 80,175,158,111,198,119,138,239,252,141,206,126, 86, 29,111, 24,202,238, 24,116, 46, 52,243,
- 31,107,200,178,123, 31, 6,221, 57,230,223,142, 92,175,118,150,153,181,165,219, 69,180,182, 68,137, 51,139,104,134,250,157, 79,
-187,186, 83, 42,139, 12, 20,158,209,229,126,224,203, 43, 75,177,169,161,230, 72,136, 6, 65, 17, 32, 59,189,222, 60, 0, 85, 9,
-222, 29,220, 22,179,187,212, 70, 73, 35,192,162, 59,134,174, 29, 31, 36,206,168,198, 29, 99,243,239,198,248, 90, 47,156,117,196,
- 92,217,198,217, 99,126, 95,124,171,224,156,150,229,131, 25,186, 74,228, 11,119, 20, 99,119,124,149,155,131,246,183, 21,111,147,
- 57,139,131,177,154,182, 74,147, 30, 51, 11,145, 17,167,150,157,128, 54,105,172,186,155,103,190,151, 68,243, 68,246,120,211, 57,
-138, 91,164,188,181,137,171, 16, 11, 87, 80, 4,144, 28, 64,199, 26,175, 99,110, 34, 10,214,184, 29, 45, 7, 2,168,167,219,151,
-101, 77,220,111,115,252, 65, 57, 58,227,150,225,151,190,121,243,117,103,194,177, 14, 8,231,236,243, 4,205, 44, 88, 45,247, 5,
-187,229,121, 22, 28,168,210,241,219, 84,201,249, 38, 51, 10,229,119, 90,229,202,126, 50,222,109,134, 94,144,150,252, 38,202,124,
- 50, 69, 93,244,123, 53,131, 89, 43, 45,237,139,221, 52, 77,115, 75,154,224,208,229, 15,112, 12,121, 13,192, 2,138, 64, 85, 57,
-212,136,205,196,164,180,189,232, 26,226, 10, 16,169,144,196, 99, 76, 12,223, 34,243,115,205, 22,220, 42, 23, 61, 69,243,125,119,
-205, 88,202, 60,141, 95,112, 92, 34,221,197,183, 88,124, 37,112,197,163,192,180, 73,203, 47,247,179, 22,209,224, 11,147, 23,224,
-255, 0,142,185, 14,182, 91,112,148, 37, 37, 0,161,169,118,144,109,187, 91,158,108,205,176,102,155,144,231, 23,183,196, 14, 87,
- 6, 53,170,229,210, 90,136,128,168,199, 60, 75, 82, 58,105,192,241, 53,170,177, 2, 20, 76, 20,156, 51, 90, 78,200, 57,127,241,
- 86,179, 53,200,183, 59,174, 85,230,106,213,202,234,111,146, 98,230,188,121, 3,138,242,107,254, 45,110, 17,101, 7,236,215, 12,
- 94, 67, 24,223,247,102,213, 21,178,211, 44, 50,244, 89,207, 25, 41, 89, 73, 72,241, 1, 83,144,237,188,189, 47,134,214,178, 3,
- 15,115, 75,203,216, 28,112, 71, 7,130,253,110, 57,146, 11, 70,148,234,160,233,174,198,162, 75,181, 98,161, 15,161, 48, 65,235,
-198,186, 69,143,121, 89,231, 23,121,139,158, 50, 87,114,120, 28,189,155,216, 60,187,121,126,201,113,156,191,204,135, 3,217,249,
- 10,243,151,103, 50, 31,228, 75,136,178,217, 46, 42, 54, 91,101,129, 86,233, 38, 51, 14,150, 35,184, 80, 28,142,167, 80, 54, 39,
-126, 30,110, 96,180, 22,214,241,232, 49, 70,233,229, 5,176,202,230, 6,181, 34, 26,156, 59,197,202, 20,133, 35, 34,153,225,100,
-219, 73, 53,184,174,162, 26,220, 92,208, 84,247,176, 25, 39,248, 81, 30, 60,230, 14,113,193,185,123,131, 50, 65,121,243,135,150,
-121,120,139, 19, 15,143,230, 70, 79, 37,113, 54, 85,125,190, 90,185,158,247,136,114, 27,119, 11,116, 91,113,199,209,122,114, 34,
- 47,200,177,123,202, 45,209,156,131, 30, 71,187,165,165,163,196, 90, 84,171,221,182,210,238,218,118,105,182,109,202,187,193,208,
-246, 0, 99, 18, 68,132,157, 90, 87, 78,180,212, 67,220, 21, 65, 74, 40,230,145,143,105, 87,150, 97,169, 65,205, 29,212,185,166,
- 88, 81, 60, 63, 32,243,109,148,224,215,188,246,245,150,249,140,181,100,252,123,198,222, 77,178,124, 58,194,152,115,236,208,178,
- 12,175, 53,207,114,120,153,114, 46,214,199, 32, 3,119, 83,118, 8,112,209, 50, 35,224,165,150,212, 22,180, 36,148, 44, 46,230,
- 29,182,222,102,194,198, 64, 88,247,220, 7, 28, 9, 13,108, 76, 49,233,114,247,123,196,161, 25,156, 1,204, 81, 49,211, 61,165,
-196,185, 64,106,118,151, 21, 81,199, 10,134,213,148,115,170,114,172, 51, 62,187, 90,252,209,223,249,126,225,229,219, 56,193,188,
-192,223,174,118, 76,231, 22,199,184,111, 53,200,185, 75,141,126,241, 69,129,235, 93,130, 66,204, 11,125,190, 12,135, 23, 27, 28,
- 74,220,122, 26, 3,193,196,111, 47,139, 63,135,180,240,223, 11, 77,184,132, 78,215, 68, 1,141,198, 70,136,102, 77, 74,225,222,
- 36,140,100, 64, 29,130, 28,169,157,114, 40,113,214, 93,164,135,103,129,212,220,144,101,217,194,153,249, 53,187,157,178,108, 75,
-147, 50,156,237, 94, 96,243,123,219,158, 89, 60,220,113,127, 20, 61,112,226,140,165,219, 78,114,245,135, 37,106,229, 98,182,222,
-173, 55,123, 76,235,139,137,149,106,146,185, 17,217,191,168,174, 66, 99,182,135, 84,234,155, 82, 21, 42, 7,218, 65, 36, 81,195,
-224,177,190, 60, 15,122, 61,138,213, 98, 56,181,205,112, 24, 56, 33, 49,224,221, 68,132, 85,164, 56, 72,224,226,237, 71,186,224,
- 48, 56,227,128, 32,143,159,162,172, 14,121,152,121,184,113,185,108, 98,185, 63,154,152, 60,179, 51, 53,228,203, 87,152, 59, 81,
-196,110,140,113,230, 1,133,191,156,194,139,136,200,195,100,200,180,174,196, 28, 93,157,198,189,213,219, 76,137, 5,232,190,242,
-236,205,202, 66,148,154,107, 59,109,180, 33,145,182,230, 16,198, 24,142,166,235,115,188, 50,100, 18, 0,237, 94,242,168,120,106,
- 59, 72,110,117, 34, 71,205,192,191, 82,157, 88, 20, 1,112, 76, 19, 46,133,193, 86,186,121,229, 82, 62,119,102,123,204,102, 27,
-152,222,115,252,134,201,130,249,138,187,227,220, 97,121,228,121,178,175, 55,233,220,123, 47, 19,196, 46,169, 45,220,166, 36, 63,
-115,142,221,234,229,113,109,167,202,150, 19,180,180, 21,244, 84, 24, 46, 97,116, 50,252, 52,177, 53,141,115,224, 5,225,128, 0,
- 31,174, 70,228, 48, 7, 72,106,143, 79, 26,181,180,212,221,109,113, 36, 7, 96,189, 8, 15,206,181, 55,114,142, 75, 51, 23,196,
-102,204,182,193,188, 92,238,114, 94,141, 10, 45,187, 30,136, 39, 95,228, 48,226,194,166, 42, 27, 74,113,164,169,230, 96,165,231,
- 27, 42, 88, 1, 73, 21,244, 28,232, 11,133, 75,168, 23,142,177,183, 57,119, 37,189,100,153,133,153,171,118, 17,129,221,239,120,
- 86, 15,198,147,217, 68,168,176, 62,128, 51, 58,227,114, 65, 83,172, 75,153,115, 98, 83,136,223, 85,165, 17,214, 82,149,169, 79,
-190, 76,194,225,107,238,251,221, 61, 29,127, 85, 33, 53,224,114,169,133,188, 75,141,120,139, 27,114,223,133, 96, 24,157,133, 55,
- 4,253,213,109,176,227,246, 40,150,161,122,153, 33, 59, 27, 97, 97, 8,111,196, 74,186,111, 42, 39,167,164,208, 22,238,111,102,
-188, 58,165,123,156,122,201, 52, 81,194,200, 66, 53,160,118, 87, 1, 60,193,240,151,150, 91, 87, 42,228, 77,218,113, 75,222, 65,
-114, 98, 67, 75,200,226,219,178,132, 91,120,230,223,151,164,169,115,155,181, 91,145, 9,192, 25,109,229,108, 37, 37, 21, 80, 81,
- 0, 3,174,171,177, 27,169, 45,152,102,112, 94, 10, 9, 41,193,113, 69,244,118,227, 89,155,209, 16,144,232, 7,208, 80,124,223,
- 77, 93,127,195,167,145,240,220, 91, 42,189,240, 94, 51,137,218,113, 40, 25, 12, 25,249,188, 72,150,167,164,190,210,110,182,228,
-176,194,247,153, 14,188,166,204,184,232, 90,210,132,148,160,248, 43, 82, 82, 20, 86, 85,157,230,253,185,253,219,141, 90,128, 8,
- 70, 1, 49,193, 17, 6, 38,167,237, 51,180, 44,104,156,123,107,176, 26,193,213,221, 81,143, 61,248, 87, 52,231,156,121,143, 88,
-248,160, 73,151,105,126,237, 45, 25,213,150,223, 44, 66,184, 93, 33,173, 45, 24,117, 82,150,218, 92, 97,167, 18,233,121,186,245,
- 37, 6,132, 36,235,206,223,220,119, 42,243, 31, 55,237,144, 90,108, 61,230, 25, 15,142,192,224,199, 61,168, 52, 98, 72, 5,128,
-234,212,213,196,150,148, 41, 94,142,254,219,121,175,150,249, 63,116,158,243,127,238,200, 35, 30, 3,203, 75,218,199, 41,215,128,
- 4,135,144, 91,165,201,128, 14, 10, 22,163,143, 42,222, 72,109,216, 40,135,154,114, 51, 44, 92,242,170, 33,232,145, 10,119,196,
-179,149, 15,154,208, 87,206, 95, 94,174, 17,234, 77, 7, 83, 15,201,111,237,234,211,203,182,182,255, 0,112,211, 54,224, 66,131,
-155, 33, 81,147, 23, 55,116,188,142,166,160,196,204,243,183,251,137,187,243, 25,206,219,246,237, 80,237,192,161, 25, 62,100, 57,
-189, 50,111, 67, 1,235,114,156, 5, 7,243,103,197, 57, 31, 0,115,188,220,138,198,153, 80, 44,151,251,227,185,174, 17,123,101,
-170, 49, 26, 91,143,123,195,177,146,163, 84,239,133, 33, 84,218,127, 96,164,210,135, 94, 69,243,195,147,111,124,172,230,135,110,
- 54,154,153, 20,178,153,224,144, 12, 3,245,106,115, 87, 37, 99,142, 71, 54,145,211, 94,192,242, 47,156,236,124,214,229,102,237,
-215,122, 95, 44, 81, 11,121,227, 39, 18,205, 58, 90,244,205, 30,209,152,201,192,227,133, 55,121,182,203,248,126,121,235, 77,135,
- 36,243,129,196,185, 13,151,151, 49,251, 52, 75, 27,156,141,199,178,164, 64,147,124,183, 65,169,109,167,151, 13,246,157,113, 41,
- 82,149,177, 15,180,189,149, 33, 43,161,215,178, 60,166,255, 0,253, 1, 28,181,102, 32,188, 50, 65, 38,110, 13, 96,150, 39, 57,
- 49,115, 71,188,194,120,132, 78,179, 94, 43,243,131,255, 0,243,188,115, 93,231,196, 90, 54, 43,134,100,210,100, 48,204,214,174,
- 13,113, 29,215,129,192,170,245, 10, 68,129,145,121,112,242,239,197, 25, 15, 5,249, 50,227, 57,120, 22, 47,151,185, 76,223, 53,
-190, 56,167,114,156,166, 57, 71,134,182,212,227,143,201,146,224,117,191,163, 43,121,222,136,220,132,161, 33, 68,235,141,127,113,
- 31,222, 61,223,155, 48, 73, 99,102,101,209, 35,116, 62, 89, 0,105,208,115,100,113,180,163, 67,190,209, 56,144,161, 56,215,106,
-254,219,255, 0,178,219, 47, 39,231,142,250,236, 68, 31, 27,181,178, 40,201,112,241, 6, 79,146, 71, 5,113,111,217, 3, 0, 80,
-175, 10,181, 30, 72,188,187,222,115, 76, 87,147,178, 57,199,238,120,217,166, 11,147, 96, 88,244,249, 49,148,239,130,221,250, 43,
-177,220,153,178,168,241, 16, 29, 90, 54,128,161, 93,135,168, 4, 29,104, 63,179,110, 70,155, 97,215,204,215, 76, 65, 33,107, 33,
- 7, 2, 88,215, 7, 61,221,142,112, 13,105,255, 0, 73, 57, 34,208,127,122, 60,245, 15, 48, 6,114,189,171,212,198, 28,249,156,
- 49, 13,123,152, 88,198,254,179, 90,231, 57,195,253, 64,102,169, 72,184, 47,240, 89,252, 65, 60,157,217,242, 52,249, 83,243,231,
-108,194,174, 57,116,173,153, 85,165,252, 24,183,140, 93, 99, 70, 64, 68,105, 77,179, 33,203,168,106, 83, 33, 78, 39,196, 13, 3,
-180,129,184, 1, 77,125, 88,222,252,225,217,121,178, 70,157,211,106, 47, 12, 29,210, 31,222, 29, 32,144, 26,173, 56, 96,181,242,
- 63, 96,242, 71,126,228,216,158,221,167,120, 17,185,231,190, 12,125,194,131, 2, 1, 46, 71, 12,113, 78,140,105,239,199,159,128,
-142, 68,199, 20,249,156,145,202,124,244,188,243,204,199,153, 75, 27,182,171,175, 46, 95,108,207,220,226,216,205,202,235, 18,239,
-114,115,194,118, 95,189,205,122,229, 42, 40, 47,200,113,212,168,128, 0, 72, 27,130,160, 95,249,221,227, 94, 89, 27,123, 95, 14,
-206,217,202, 34, 14, 0,184,134,150,183, 16, 16, 6,131,128, 0,250,112, 75, 29,187,200, 47, 2,202,248, 92,221,153,111,174,219,
-165,211, 57,164,134,130,224,247, 32, 37, 92, 92, 70, 36,145,195, 1,138,137,125,252, 3, 47, 31,252, 22,242,220,190, 62,231, 86,
-184,251,205, 79,150,166, 46, 86,235, 31, 45, 90,241,247, 13,135, 44,180, 46,247,113,189,219,218,147, 4,202, 91,145,156,183, 72,
-184,184, 27,121, 43, 94,228,169,105, 90, 22,146,144,130,183,243,183,254,238,247,226,109,124, 75, 43,162, 9,136,187, 22,157, 13,
- 99,145,201,142,160,208,161, 7, 4, 32,170,157,207,144,127,246, 86, 31, 11,119,225, 95,218, 2, 27, 48,110, 14, 26,220,246,130,
-213, 81,164,184,161, 83,153, 4, 16,137, 97, 56, 15,200, 95,226, 56,199, 62, 96,188,185,230,103,207, 35,185, 54, 61,129,198,118,
-222,158, 58,227, 92, 94, 54, 55,139,101,246,215,212,218,220, 98,237, 29, 81, 24,132,242, 94,113,148, 23, 92, 49, 20,245, 18, 3,
-110,182,125,161,158,223,121,207, 97,146,198, 75, 61,183,107, 12,115,202,248,146, 56,185,205, 61, 45,196,156, 49, 78,242,116,131,
- 90,110, 94,228, 94, 99,143,112,138,247,117,221,203,219, 24, 35,195,137,161,173,120, 60, 30, 8, 3, 18, 2,157, 37,221, 14, 25,
-212,197,228,223,240,217,201,188,172,249,207,243, 97,230,110,119, 36, 90,114,203, 39,153, 12,171, 41,201, 96, 99, 80,177,231, 45,
- 18,177, 84,228,119,217,151,132,176,227,235,148,250,100,248, 41,148, 26,220,148, 38,164,110,160,236,213,127, 55,115,251, 57,155,
-107,176,219,155, 9, 97,182, 99, 90, 93,169,117, 35, 3, 85, 16, 38, 75,153,171, 46, 75,242,221,252,167,187,238, 59,155,167, 15,
- 23,111,115,131, 67, 83, 74,188,189, 9, 82,185,166, 66,152,188,191,248, 74,142, 98,252, 66,243, 79, 55, 89,134,115,104,188,241,
-127, 35,241,132,238, 47,202,248,161,118, 55,163, 93, 30,180, 93,113,164,227,210, 20,155,154,101,237, 73, 41,171,201, 33,144, 82,
-105, 67, 81, 93, 78,176,243, 61,219,102,195, 22,211, 4, 69,179, 71, 40,145,178,234, 8, 8,126,177,221, 79, 70,117, 95,184,249,
- 74,205,219,152,165,222,110, 37, 14,134, 88, 76, 78,139, 73, 82, 29, 31,134,123,203,233,202,169,255, 0, 29,126, 15,191,136, 87,
-149, 25,121,110, 1,228,243,207,219,152, 31, 5,229,247,169, 87, 23,109, 55,124, 88, 75,201,109, 40,152, 3, 74,121,148,150,223,
-138,137, 98, 58, 82,149, 72,140,182, 10,202, 65, 33, 36, 10,106,247, 47, 54,118, 78,101,209,113,186,237, 94, 37,203, 26, 2,135,
- 35, 74,112, 57, 29, 43,192,234, 74,199,237,126, 77,111,252,171,174,219,103,222, 60, 43, 71,184,157, 46, 98,184, 47, 17,152,212,
-156, 70,149,165, 31, 47,255, 0,254, 31,136,152, 86, 59,230,115,143,249,159,153,221,228,108, 83,204, 14, 63,106,139,110,190,193,
-176,155,102,101,137,101, 56,253,193,235,148, 27,202,223,145, 42, 99, 82,164, 34, 67,128,186, 10, 64, 88, 43, 73, 52, 89,211, 27,
-239,158,114,223,205,101,113,105,108, 34,125,185, 42, 11,149,174,107,154, 26, 88,128, 2, 2, 12, 58, 48,232,167,249,127,251,124,
-135,110,130,254,218,242,232,205, 29,203, 64, 4, 55, 75,216,230,184,185,175, 82, 72, 37, 78, 61, 56,142, 52,131,102,252, 43,127,
- 18,174, 31,227, 38,184, 35, 21,252, 68,172, 56, 95,151, 75, 3,233, 84, 59,220, 92, 91,238, 12,227, 30,178,166, 72,144, 24, 98,
-232,165,166, 92, 38,131,166,129, 8,185, 37, 52, 59, 64, 8, 59,116,237,199,153, 92,189,186,221, 27,233, 54,114,251,183,102, 53,
- 43, 28, 81, 20,181, 16,148,255, 0, 66,241,207, 26,102,219,202,190,101,217,237, 6,223, 22,248, 35,178,102, 68, 51, 75,218,213,
- 84, 14, 85, 1,127,214, 7, 12,176,171, 61,230,195,240,142,228,111, 50, 25,135,146,220,229,254,126,110,101,239,202,236, 91, 83,
- 57, 61,223, 45,197,145,112,201, 57, 54, 92, 11,181,190,230,185,143,191, 9,232, 81,163,186,240,132, 80,104,201,237, 4,214,134,
-185,206, 87,243, 62, 46, 93,182,220, 45,197,160, 2,233, 80, 49,200,216,193,107,154,128, 16, 73, 1,122,107, 81,205,190, 82,205,
-204,247, 91,101,203,175, 9, 54,122,117, 23,181, 93, 33, 15,107,148,144, 90, 1, 58,122, 43,186,182,246, 23, 26, 12, 72,235,166,
-246, 35,180,210,169,217,185, 0, 3,174, 65, 93,178,190,127,191, 28, 31, 59,121, 70, 47,141,227, 62, 64, 60,184,170, 69,251,204,
- 95,154, 4, 68,199,178, 88,214, 7,247, 93, 49, 78, 53,201, 28, 49, 61,204,169, 36, 38, 60,140,145, 91,216, 42, 90,168,220, 68,
-190,226,246, 5,180,230,187,167,147,156,161, 20,239,126,253,184,163,109, 45, 85,192,156,156,246,226,189, 97,153,225,155,244,128,
-168, 69,121,239,207, 14,117,154, 8,227,229,221,173, 93,123,118,141,112,110,109,141,197, 19,168,201,136,199, 38, 7, 18,138, 13,
-116, 23,240,222,242, 91,139,249, 41,242,229,136,113,157,169, 12, 77,201, 28,103,239,252,247, 36, 67, 37,167,114,140,230,234,219,
-126,253, 46,135,218, 75, 77,236, 68,120,200, 61, 82,203,109,131, 85,110, 81,231, 92,243,205,179,115,166,227, 37,236,152, 55,221,
- 99,127,202,193,238,142,222, 46,233,113, 60, 48,174,157,229,247, 38, 67,200,155,100, 86, 17, 33,120,239, 72,239,243,200,125,227,
-217,193,163,131, 64,226,166,186, 12,163,180, 21, 30,192, 9,249, 53,144,173,181,124, 60,242,111, 54,121,183,231,255, 0, 60,177,
- 60,211,121,157,252, 57,124,223,242, 87, 31,113,147,207,181,192, 62, 95, 35,241,134, 79, 97,198, 48,102, 99,200, 75,145, 36,220,
-140,140,114,106, 39,201, 37,164, 73,150, 82,210, 67,207,134,247,125, 3, 45,177,175, 96,218,237, 59, 78,203,178, 29,171,109,222,
- 44,226,150, 95,223, 76,100,140,185,248, 98, 26,146, 13, 35,128,196,163, 85, 59,206, 46,175, 18, 94,111, 27,206,253,191,141,227,
-117,217, 47,166,134, 47,220, 64, 34,145,173,102, 56, 23, 44,110,212,126,211,176, 26,156,139,221,104,109, 55, 63, 18,191, 60,220,
-165,230, 11,151, 60,135,228, 89, 79,145,206,115,242,247, 59,132,121, 31, 35,190,226,216,167, 32,219,238,113,238,252,199, 58,227,
-117,195, 36,174, 5,149, 50,177,251, 99,142, 60,195,150,134, 89, 80,101,183,142,233, 45,251, 32,144, 21, 39,203,158, 74,179,216,
-172,183, 72, 96,220,173,238, 27, 52, 65,174,115, 11, 72,136, 6,202, 53, 61, 30,228, 7, 81, 56,145,131, 78, 61, 17,124,208,231,
-203,238, 97,191,218,102,159,106,185,182,116, 19, 57,205,100,129,192,204, 75,161, 58, 88,177,181, 72,210, 6, 1,216,184, 97,210,
- 15,153, 43, 92,239, 62,191,138,159,148,216, 60,225,197,249,183, 12, 89,185,155,142,184,233,119,174, 41,205, 23, 38,215,150, 89,
-113,108, 90, 70, 72,100, 91,223, 83,177, 45,210,227,253,232,237,165,250, 43,193,109, 97, 46,238, 65, 7,106,180,158, 94,185,111,
- 34,242,165,251,172, 39,100,206,130, 71,134,200,196, 45, 46,112,141, 28, 49,112, 58,117, 14, 36, 40,199,136,165,115, 45,171,188,
-194,231, 29,185,155,141,188,144, 50,120,152, 93, 19,212, 60, 53,166, 66, 90, 84, 52,141, 69,135,128, 40,229, 28, 13,118,239,241,
- 20,252, 41,124,156,181,228, 79,154,242,156, 3,134,248,247,139,243,174, 22,226,108,179,148,177, 92,199, 11,198,227, 99,151,167,
-159,227,203,115,215, 71, 97,207,145, 21, 13,187,117, 69,198, 44, 87, 35, 31,124, 83,132, 41, 97,192, 66,210, 21,174, 61,229,231,
-153, 59,195,119,171,102, 92, 92,203, 44,115, 74,216,220,215,184,184,119,220, 26,173, 7, 6,233, 36, 30,234,100,153, 87,110,243,
- 55,202,205,145,251, 13,212,150,214,145, 67, 44, 16,190, 70, 61,141, 13,119,236,218, 92,142, 33, 11,131,128, 35,188,185,174, 98,
-166, 79,192,179,154,243, 46,100,242, 1,198, 74,206,110, 82,175, 87,140, 6,227,147,241,196,107,196,233, 10,147, 54,125,135, 20,
-150,164, 91, 3,170, 87, 82, 98, 91,221,102, 40, 36,146, 82,216, 36,146, 78,170,252,230,218, 33,217,249,130,225,176, 0, 26,240,
-217, 16,100, 11,135,123,214,229,119,166,173,252,140,222,166,222,249,110,217,211,184,185,241,151, 70,167, 50,214, 30,234,246, 52,
-134,250, 43,178, 58,229,149,215,171, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43,
- 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,
-161, 66,179, 66,133, 87,159, 48,190, 99,241, 63, 45,214,188, 90,251,155, 89,114, 41,246, 44,162,102,105,107,106,231, 98, 97,153,
- 72,183,221,241, 44, 94,247,148,181, 17,214,214,235,110,173,219,180,123, 12,136,144,146,210, 84, 86,250,155, 65,166,240,117,117,
-178,236,114,111,142,123, 34,115, 67,154, 26, 80,241, 14,123, 88,189,141, 46, 4,175, 5, 60, 42, 61,197,200,182, 0,184, 96, 87,
-216, 9,246,165, 85, 25,255, 0,138,111, 6, 91,236,151, 60,149,204, 63,147, 31,176,194,198,219,189,192,155, 14,202,196,185,119,
-219,171, 48,120,218,124,235, 52, 88, 77,201, 84,213, 79,181,179,201,144,196,166, 20,208, 40, 84, 89,160,253, 79,181,162,103,151,
-247,111,120,143, 92,122,139,144,226,112, 11, 48, 14, 37, 19, 75,188, 18,133,113,212,222,154,136,119, 88,192, 84, 40,159,241,195,
-183,189,236, 52,185, 39,241, 46,225,139,125,241,139,101,207, 22,206,226,218,111, 25,221,191, 13,196, 50,166, 34,195,184,216,178,
-251,114,179, 12,175, 16,185, 95, 33,169,137, 75,116,192,179, 47, 16,153,116,148,230,202,136, 74, 67,193, 39,218, 74, 89,111, 34,
-221, 61,154,154,246, 40, 97,115,155,136, 45, 62, 27, 36, 13, 42, 61,231,120,129,160,127,153, 69, 25,220,216, 10, 16, 81, 80, 30,
-156, 72, 94,192,139,217, 75,153, 55,155,156,198,241,102,242,101,155,112,247, 28,204,201,108,254,102,115, 76,186, 15,247, 46,243,
- 54, 5,155, 36,185,226, 48, 48,220,166,255, 0,110,151, 26,123,243, 81,110,132, 29, 93,162, 52,229, 56,165, 56, 85, 28,169, 8,
- 66,157, 82, 70,154,131,150,226,137,215,177, 92,202, 26,232, 26,211,168, 2, 64,113,145,141, 32,128, 20,251,197,188, 59,216,146,
-148,167,222, 56,136,220,198,174,162,112,234, 66,126,133,236,170,177, 96,252, 92,236, 63,122,114, 34,239,156,119,123,121,182,242,
-137, 76, 96,216,140,137,214,188, 66,235, 98,178,224,184, 86, 25,117,202,160,220,110,115,238, 6,223,114,185, 49,147,228,139,135,
- 5,136,100,248,201, 41, 85, 80,132,248,138,208, 77,229,187,244,199,162, 65,238,247,156,142,112, 37,210, 72,214, 16, 0, 80,210,
-198, 43,137,203,172,225, 81, 27,188, 5, 42, 56,224, 50,200, 2,113,233, 83,133, 76,109,254, 39,248, 90,241,248,185,211,156, 37,
-202,113,248,235, 34,191,114,222, 23,199,249, 27,211,172,105,187,230,249,231, 20,203, 48,205,181,187, 71,222, 94,247,111, 77,218,
- 64, 44,197,126, 97,111,107,137, 80,121, 45,163,107,138,172, 60,131, 46,179, 15,143, 31,136,208,199, 56, 35,145,173,120, 85,212,
-136,116,140, 72, 11,134, 74,112,167,191,154,181, 53,105, 58, 74,129,150, 36,117,117,211, 2,249,248,157, 94,184,167,145,121,175,
- 7,230, 94, 31,153,110,191, 97,153, 59,207,227,248, 77,159, 47,177, 34,229,105,193,177,236, 51, 9,190, 79,109,203,156,139,139,
-112,239,183, 75,132,252,168, 46,221, 10, 26, 82, 84,130, 91, 90,144,166,138,151, 50, 46, 66,102,227, 4, 18,218,204, 11, 92,220,
- 92, 90,228, 46, 50, 72,209,221, 1, 90,208, 25,222,113,227,136, 85,193,183,110,134, 39, 57,175,110, 32,228,163, 36, 7, 62, 39,
- 28, 5, 88,203,103,158,235, 45,247,143, 51, 62, 78,177,240,215, 37,203,197, 44,252,173,255, 0,192,236, 10,108,155,133,130, 11,
-188,179,202, 82,243, 20, 97, 80,160,219, 35,155,178,230, 64,102, 77,209,230,214,169, 55, 38, 88, 8, 70,242, 82, 74, 0, 93, 36,
-156,162,232,102,101,187,231,140, 60,199,226, 56, 35,142,134,120,126, 33, 36,233, 66, 64, 92, 26, 74,148,233,194, 72,191, 14,105,
-120,105, 69, 65,150, 37, 83,167,167,166,163,249,127,137, 85,150, 5,219,147,241,153, 94, 94,249,109,204,167,132,237, 86,249, 92,
-173,110,129,121,197,223,131,140,222,111,151,251,166, 57,106,183, 49, 37,219,220,117,220,156,188, 92, 32,199, 84, 71, 35,178, 81,
-225,200, 74,222, 44,148, 45, 34,107,121, 21,239,108, 82, 11,136,244, 74, 78,130, 67,212,128,214,189,197, 52,148,210, 9, 85, 42,
-173,193, 84, 83,103,115, 0,184,104, 42,220,242,195, 18, 7, 30, 63, 77, 91,110, 16,230,249,188,181,115,229, 92, 98,255, 0,199,
-183,142, 54,205, 56,115, 48,178,225,185,134, 63,115,190, 91,242, 72,230,118, 67, 97,181,100,113, 29,137, 54,220,235,140,190,218,
-237,183,152,229, 85, 9, 41, 94,228,208,210,167, 55,187,109, 35,110,108, 50, 50, 65, 35, 37,105,115, 72, 4, 96, 28,230, 21, 7,
- 44, 90,125, 21, 50, 9,204,197,192,132, 45, 40,120,240, 7,233,164,111, 50, 89,131,184, 85,158,203,115, 74,228,219,152,158,213,
-226,200,246, 72,133,184,220, 59, 34,167, 46, 10,192,113,196, 2,134, 21, 41, 12,173,180, 60,186, 80,110, 72, 80, 43, 0,181,180,
-196,217,102, 26,242, 1,104,238, 28, 90,220, 42,154,113, 79, 53,163, 22,178, 95,114,156,138,241,154, 69,199,243,219,194,174,152,
- 45,131, 21, 48,227, 77,186,217, 33, 50, 34,174,239, 57,233,237,174, 75, 9,184,184,208, 91, 1,146,159,103,169,170,247,210,238,
-125,153,219,164,154,163, 32, 0, 49,207,209,233,250, 18,162,182,232, 91,132, 56,209, 76,247,204, 17,190,217,238, 12,224, 71, 34,
-195,242,159,187,101, 49,104,203,114,188,193,236,145, 73,150,242, 3,126, 22,199,219,113, 17,140,166,202,227,238,105, 73, 3,196,
- 42, 31, 72,150,212,149,183,151, 62, 4,137,158,117,134,144, 75, 81, 20,125, 61,156,114,164, 58,251,198, 5,163, 2,120,215, 60,
-109,188,117,204,121, 6, 77, 51, 15,178,241, 86, 82,188,146,215, 37, 80,239,144,165,177,227,174,215, 49,190,139, 65, 16,196,189,
-193, 42, 31, 61,213, 54,146, 58,133,117,214,241,219,148, 76,140, 72, 92,208,210, 20, 18, 83,213,198,168,133,187,203,139, 64, 36,
-245, 87, 93,252,143,249, 91,189,240,204, 27,254,119,200,204, 33, 60,139,148,173,112,219,137,244, 42, 22, 75, 26, 20, 8, 64,240,
- 86,234, 82, 93, 9, 66, 66, 55,168,165, 40, 5, 68,173,107, 58,231,220,203,189,183,112, 34, 40,138,176, 98, 78, 74,126,161, 87,
-219,125,153,129, 92,236,254, 97,250,107,160,122,201,213,157,101, 43,208,245, 26, 20, 43, 52, 40, 83, 15,145,184,207, 11,229,108,
-110, 86, 41,156,216,226, 94,237, 50, 65, 41, 75,233,219, 38, 27,244, 32, 61, 29,212,209,198, 28, 77,122, 45, 10, 7, 89,254,102,
-229,109,191,156,109, 31, 99,185, 66,217, 97,119, 3,152, 61, 45, 35, 22,184,112,115, 72, 35,166,180, 60,177,205, 91,135, 38,221,
-178,251,108,157,209, 76,222, 45,200,142,135, 2,161,205, 60, 90,224, 65,232,174,106,101,191,133,253,177,249,206, 61,134,114, 52,
-219,108, 5,169, 74, 68, 43,205,165, 23, 87, 89, 73,236, 72,117, 15,197, 38,158,176,117,229, 45,231,251, 53,219,110,165, 46,177,
-220, 37,133,135,236,190, 49, 42,118, 16,248,207,173,123,107,214,123, 39,247,163,185, 90, 68, 25,127,183, 69, 51,199,218,100,142,
-137,123, 65,100,131,212,148,233,227,127,195,103, 16,199,238, 49,174, 57,190, 67, 35, 44, 49, 93, 67,169,132, 24, 16,109,174,169,
- 6,163,123, 73, 91,138, 88,175,236,169,100, 30,240,117,166,228,239,237, 59, 97,229,233, 91, 61,252,178, 93,189,165, 67, 92, 3,
- 35, 81,210,192, 92, 93,216, 92, 65,226, 13,102, 57,207,251,183,223,249,138, 23, 91,237,241, 71,102,199, 4, 46,105, 47,145, 14,
-104,242, 26, 27,218, 26, 8,224, 69,116,146,193,143, 90,113,155,100,107, 69,154, 27, 48,160,197,105, 13, 52,203, 13,134,208, 18,
-216, 0,116, 20, 2,128,107,212,112,194,203,118, 8,227, 1,173,104, 0, 0, 16, 0, 50, 0,112, 2,188,173, 52,207,184,121,146,
- 71, 23, 57,196,146, 73, 82, 73,204,146,115, 38,150,180,229, 55, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 42,130,
-121,182,227, 63, 52, 57, 87, 36,113, 12,254, 4,228, 43,238, 51,199,249, 99,172,241,231,152, 24,144,178,117, 89,228, 98,120, 69,
-178,237,111,201, 27,200,241,244,110, 74,152,185,204,141,108,159,141, 56,236,112,167, 54, 92,153,124,141,176,130,147,179,229,189,
-207,110,180,182,156, 94,196,215, 74,206,252, 61,213,212,242,215, 51, 67,250, 88, 11,155, 40, 7, 5,140,183,237,214, 23,154,118,
-173,206,246,234,220,216, 76,230, 66,254,228,232,228, 45, 96,115,100,241, 35,232,121, 13,124, 36,140, 82, 86,187, 38, 87, 57,167,
-240,247,226,163,117,186,243, 43, 23, 62, 73,229,232,146,239, 57,214, 51, 26, 58,177,156,150,199,101,196,114, 12, 46,127, 43, 99,
- 55, 5,207,196,110,199, 61,122,225,143,174,197,199, 49,110, 49,100, 69, 94, 55,111,247,132, 56,182,212, 38, 72, 8,113,205,203,
-119,174, 91,137,182,250, 97,136,129, 27,189,230,188,185,175, 22,242, 13, 50, 55,193, 13,126,185,203, 8, 34, 89, 52,160, 61,198,
-168, 28,249,251, 23, 52,204,235,157,115,204, 11,164,104,238,185,129,142, 97,186,141,218,162,119,142, 92,194,203,112,246,150,152,
- 98,212, 9, 29,247, 33, 47,190,116,225, 15, 58, 87, 60,131,204,111, 31,224, 80,249,199, 55,227, 76,139,137,177, 91,127, 25,100,
- 92,131,204,214,214,162, 91,242,220, 78, 86, 28,252,107,125,149,149,229,211, 28,187, 34,121,183,220, 29,184, 78,191,218,160,202,
- 10, 47, 54,169,115,217,146,132, 51, 7,101,223, 54,152,163,179,158,224,194,201,155, 43,140,141,100, 78,197,174, 18,130,231, 31,
- 12,105, 69,104,107, 99,123,218,136, 67, 35, 45, 37,211,247,237,131,121,154, 75,219,123, 97, 60,144, 58, 22,136,221, 36,205, 64,
-230,152,136,107, 7,138, 75,131,180,188,189,210,178, 55,174,160, 95, 35, 92, 3, 77,115, 6, 13,248,146,205,205,185,249,124,117,
- 63,148,154,151,122,198,124,205,183,133,228, 49,121, 74,193,108,226,171,150, 37,127,193, 38,194,227, 75, 30, 45,102, 85,205,139,
-141,135, 35,181,102,107,133, 38,109,218,100, 56,237,209, 15,168,206,117,183, 80,219,105,218, 55, 14, 95,142, 27, 81,112, 35, 64,
-235,125,109,240,222,100, 14, 19, 3, 59,228,118,146,215,196,232,181, 6,177,174,113,197,163, 64, 32,146,189,235,109,230, 73,103,
-188, 54,198, 85,115,110,116, 59,196,140, 68, 90,232, 28, 45,217, 27, 53, 7, 50,102,205,164,186, 71, 53,163, 7, 31, 16,130, 0,
-181,222, 94,173,190,107,184, 99, 20,243, 64,206, 87,104,228, 30,106,251,142,225,103,201,124,184, 99,217,191, 36,218,175, 57, 86,
-106,185, 24, 38, 60,253,206,210,111,147,167, 39,220, 88, 94,118, 46,113,219, 85,201,196, 6,145,237, 52, 12,127, 11,118,111,122,
-159,109,222, 37,179, 49,186, 56,117, 2,217,220,198, 56, 53,159,182,120,107,180, 1,137,240,116, 19,160, 21, 57,247,150,181, 91,
- 21,190,233,178, 67,124, 36,108,147,233,112,117,187, 95, 35, 75,159,251, 8,203,155,172,187,186, 60,125, 96,107, 33, 6, 93,212,
-175,153,156, 59,202,239,227, 93,132,249,176,205,188,229, 75,242,179,136,231, 92,231,152,204,190,201,118,239,200, 57,214, 29,144,
-218,177,197,223, 54, 52, 83,106,142,198,109, 20, 69, 76, 91,123, 98, 4, 97,189, 65,184,245,105, 52, 7, 94,135,220,121,167,146,
-183, 13,170, 61,159,227,100,101,179, 19, 6, 50, 86,151,105,199,188, 76, 37, 85,221,227,210,236,107,204,187,103, 40,115,230,217,
-187,203,190,124, 4,114, 93, 73,171, 25, 36,133,193,186,176,238, 1, 48, 68,111,112,116, 55, 1, 93, 50,192,185,235,255, 0,196,
- 41,125,202,108, 88,246, 95,229,215,130,176,140, 90,235, 33, 86,203,174, 92,211,152,236,195,139, 71,150,218,219, 68,242,204,124,
-226,230,251,162, 35,138, 75,138, 67,112,221, 36, 2, 3,107,249,167,158, 95,109,156,129,111, 11,159, 5,221,196,143, 1, 67, 82,
- 65,169, 62,202,152, 90, 2,229,139,135,104,174,155,183,238,190, 99,220,204,200,238, 44,237,163,141,197, 11,214, 51,165,126,210,
- 9,220, 74, 28, 80, 53,221,134,166, 63,193,227, 6,252, 79, 48,108,175,157, 17,231,175, 39,206,111,120,165,214,225,110, 86, 29,
- 3,146,115,214, 57, 14,244,140,153,167,228,153,242,173, 50, 24,153, 60, 65,182,173,146,218, 83, 29, 46, 33,170,237, 44,180,144,
- 22, 77, 87,155, 27,151, 45,223,182,215,249, 19, 24, 30, 1,214, 88,194,193,165, 6,144,224, 64, 87,170,226,132,244,147,133, 91,
-249, 55,181,115, 78,220,251,179,204, 50, 61,204, 36,104, 18, 72, 36,118,165, 58,139, 72, 46,210,196, 76, 20, 15,242,129,141,119,
-145,118,203,123,138, 43,114, 27, 11, 82,186,149, 41,176, 73,215, 24,174,235, 92, 40,252, 95, 60,158,115,223,152,158,116,252, 59,
- 51, 78, 13,227, 95,239,126, 47,194, 60,173,149,100, 92,175,114, 99, 36,179, 99,255, 0,221,139, 53,202,241,130, 74,142,241, 98,
-231,113,133, 34,110,248,246,105,170,219, 17,183, 84, 54, 80,128, 86,128,174,203,229,127, 53,216,114,237,134,237, 13,228,186, 31,
- 60, 45,108, 99, 75,221,168,134, 76, 17, 90,210, 6, 46,111,188, 64,199,168,215, 13,243,111,147,183, 46,103,220,118,105,236, 97,
-215, 29,188,238,116,167, 83, 27,165,165,240, 16, 81,206,105,118, 12,118, 13, 4,225,214, 21, 87,241, 77,252, 60,185,123,158,166,
-112, 71,154,159, 41,183, 27,109,139,205, 63,150,247,162,185, 99,182, 92,100,179,110,139,155,227,240,101,139,140, 88,130, 68,159,
-245, 70,223,129, 56,186,166,155,146, 82,195,168,125,230,222, 80, 27,116,199,150, 60,245,105,176,199,115,181,238,173, 46,177,185,
- 29,226, 1, 37,142, 35, 73, 40, 49, 66, 17, 72, 87, 2,214,144, 51,167,252,216,242,246,247,152,165,181,221,246,119, 6,223,218,
-158,232, 36, 0,246,131,168, 5, 56, 43, 74,160,114, 52,135, 56, 56,229, 84, 47,157, 57, 91,241,178,243,191,198, 18,188,163, 93,
-252,164,226, 28, 5,101,205,147, 23, 30,229,142, 79, 85,197,112, 45,179,236, 17,220,108,190,203, 82, 30,186, 92, 76,120,146, 86,
-223,250,202, 33, 55, 41,231, 81,236, 33, 65, 5, 97,123,125,150,207,146,249, 38,224,110,140,191,125,195,153,140,113,162,149,224,
-163, 75, 85,195,129,113, 96, 7, 19,138, 38, 7,125,189,231,190,125,182, 59, 67,246,248,237,155, 39,118, 89,117, 32, 45,226, 1,
- 46,114, 52,241, 13, 15,113, 24, 12, 21,123,251,228, 75,202,205,147,201,231,150,238, 58,224,235, 52,147,113,254,233, 90, 28, 23,
-107,202,216,247,103,111,217, 37,221,247,103, 92,230,169, 27,150, 91, 18,103, 72,117, 77,182, 84,173,136,218,138,144,144,117,195,
-121,183,152,228,230,205,198,109,194, 80,134, 71, 96, 63,202,208, 0,107,125, 13, 1, 79, 18,167,141,122, 7,147, 57, 94, 46, 77,
-219, 32,219, 98, 42, 35,110, 46,203, 83,137, 46,115,189, 46, 37, 6, 40, 16,112,171,143,172,229,106, 43, 52, 40, 86,104, 80,172,
-208,161, 89,161, 66,179, 66,133,102,133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133,102,
-133, 10,205, 10, 21,154, 20, 43, 52, 40, 86,104, 80,172,208,161, 89,161, 66,179, 66,133, 70,124,167,195,252,125,205, 22,107, 6,
- 63,200,246, 22,242, 27, 70, 51,156,225,188,141,104,134,235,238, 48,219, 57, 86, 7, 53,185,246,231,151,225,169, 62, 42, 18,251,
-116,113,165,213, 14, 32,169, 11, 5, 42, 35, 83,246,253,206,109,173,206,124, 14,210, 92,199, 48,254,171,130, 31,208,115, 7, 26,
-106, 88, 91, 56, 1,193, 80,131,233, 21, 21,219,252,154,249,116,182,203,197,165,199,227,200, 75, 56,111, 40,114,135, 48,216, 99,
- 74,152,252,187,124,108,223,152, 99,205,139,124,117,113,220,113, 76,186,203,204, 78, 82, 25,140,164,150,218,216,215,134,148,248,
-104,165,131,249,158,245,225,224,200,123,209,178, 51,146,233,140,130,220,122, 84, 98,115, 42, 87, 58,104, 89, 70, 19, 12,137, 62,
-147,157, 36, 55,228,111,203, 67,120,214, 15,137,255, 0,240,252, 59,102,227,190, 32,228, 78, 12,197,219,145,121,153, 34, 84, 94,
- 59,229, 70,153,106,245, 29,215,214,242,157,125,233, 41,104,148,201,112,151, 16, 86,225, 66,129,113, 85,112,243,101,249,124,146,
-120,157,231,202,201, 29,128,247,217,238,148,224, 7, 70, 69, 2,229, 73,248, 24,144, 4,192, 52,129,216,115,163,151,239, 38,188,
- 49,125,137,136, 67, 75,156,145,142,163,143,164, 99,178, 48, 39,240,206, 88,200,112,233,184, 74,177,140,101,236, 66, 50, 45, 47,
-219,174, 17,221,183,182,187, 11,238, 48,251,108,169, 41,116,169, 74,112, 41, 74, 81, 41,135,153,238,161, 47, 63,179,118,181,213,
-169,140,118,165,127,136,117, 2, 10,247,130,133,203,133, 27,172,152,228,204, 38, 72, 72, 68, 9,135,162,155, 54,191,195,255, 0,
-203, 54, 56,226, 37,225,120,222, 99,199,215,150, 31,105,200,153, 63, 31,114,158, 75,133,101,209, 35,155, 21,159, 29,147, 24, 93,
-109,215, 70, 46, 14, 51,112,183, 88, 96,170, 98, 29,117, 94, 43,237, 38, 82,235, 32,120,186,145, 39, 57, 95,207,132,174,107,219,
-208,246, 49,205,247,156,240,116,150,144,160,185,200,131, 0,116,142,238, 20,145,183,196,223,116, 16,122, 65, 32,228, 7,208, 62,
-124,233,102, 87,145,191, 45,179,176,155,103, 29,206,194,238,115,177, 27, 61,247,149, 50, 91,125,186,110, 99,119,151, 41,155,223,
- 50,153,106,189,201, 51, 92,154,169,235,113,110, 77,113,200,238,169,226,182, 87,181,109,168, 45, 33, 65,166,243,101,243, 37, 51,
-135,128,242, 24, 9, 13,110, 81,166,144,136,137,134, 33, 16,140, 14, 20,102,194, 34,221, 36, 96,164,230,120,231, 73,145,252,135,
-240, 52, 59,157,203, 35,133, 47,153,160,230,151,171,133,202,125,235,144,224,121,129,205, 96,114, 45,229, 23,187,109,154,211, 58,
- 44,171,227, 55,196, 92,159,141, 42, 38, 61,110,172,117,188, 80,218,152,109, 76,134,202, 19, 69,187,155,175, 28,208,194, 34, 44,
- 0, 0,195, 20,101,129, 11,156, 8,110,148, 4, 23, 59, 20, 82,165, 86,136, 88, 70, 10,247,151,167, 81, 94, 3, 53,234, 20,190,
-143, 37,188, 4,140, 90,245,132,139, 30, 83,253,214,190,204,201, 46,242,109, 3,145, 47,168,110, 38, 69,147,101, 13,230, 46, 93,
-226,186,155,128,145, 26,225, 19, 33,105, 18, 98, 78,109,192,243, 52,218,133,132,146, 11, 39,154,111, 12,141,151, 83,117,128, 2,
-232,110, 65,158, 30,147,130, 22,150, 96, 91,145,226, 41, 95, 3, 26, 22,161, 78,211,210,171,218,188,105,175,114,242, 47,194,144,
-112,174, 95,178, 97,216,235,106,201,249,127, 0, 56,110, 79,127,228, 92,143, 33,206, 19,146,204,137,118,187,228, 17,110, 23,119,
-197,234, 37,226, 76,148,222,175, 82, 36, 42, 91, 19,154,125, 63, 70,150,220, 74, 89,109, 41,144,206,109,186,124,176,190, 87,119,
- 98,126,166,134, 6, 53, 59,173,105, 13, 26, 75, 64,210,208, 16,180,140,212, 98,105, 6,193,129,174, 13, 24,184, 33, 85, 60, 73,
-199, 21,204,244,211,151,202,151,150,251,191,151,187, 87, 38, 74,202,243,217,156,137,155,114,206,126,214,119,147,222,164, 73,187,
-205,143, 17, 86,235, 61,174,199, 10, 35, 50, 47,247,139,245,230, 87,133, 10,212,218,150,236,153,202,246,148, 82,218, 26,105, 45,
-182,150, 57,135,124,110,242,232,132,113,134, 71, 27, 52,180,119,120,184,184,148,107, 90,209,139,178, 13,237, 36,169,165,218, 91,
- 27,112,229, 42, 73, 94, 61, 9,196,147,195,166,173, 13,202,215,110,188, 68,114, 5,214, 12, 91,132, 39,169,226, 70,150,202, 95,
-105, 68,118, 26, 40, 26, 17,220, 71, 81,221,170, 8,228,116, 71, 83, 73, 6,165, 16, 29,129,174,109,243,183,148,126, 65,123, 44,
- 85,243,135,149,110,184, 99,119, 38,155,221,138, 93, 3, 73, 86, 45, 37,160,119,162, 27,175,220, 33, 36,197,121, 71,196, 75, 68,
-168,161,101, 64, 81, 5, 32,108, 54,141,253,145, 71,162, 98,135,165, 9, 95, 87, 26,171,186,179,115,138,179, 26,105,113,127,146,
-158, 68,188,229,144,103,115, 25,129,110,198, 45, 15,162,115,118,187, 91,145,247, 77,125,191,154,144, 25,157, 61, 69,117,236,117,
- 78, 36, 32, 84,161, 27,232,177, 34,251,153, 34, 99, 63,100,117, 63,134, 4, 1,215,142,125, 84,136,108, 92, 79,124, 32,174,170,
-195,133, 14,223, 29,168,144, 99, 51, 22, 51, 13, 50,195, 76,176,216,109, 8,105,132,132, 33, 61, 63,117, 9, 0,122,181,134,115,
-203,202,146,166,173,192, 76,168,214,147, 71, 89,161, 66,185,251,255, 0, 53,124,143,255, 0, 5,194,191,171,167,127,105,107,209,
-191,210, 45,179,241,103,251,204,252,186,224, 95,213, 45,203,240,225,251,175,255, 0,157,120,124,214,114, 63,252, 23, 10,254,174,
-157,253,165,161,253, 34,219, 63, 22,127,188,207,203,164,159, 53, 55, 33,252, 56, 62,235,255, 0, 50,181, 62,107,121, 35,254, 11,
-133,127, 86,207,254,210,209,255, 0, 72,118,191,197,159,239, 51,242,232,127, 85, 55, 47,195,131,238,191,243, 43, 63,230,183,145,
-255, 0,224,184, 87,245,108,255, 0,237, 45, 15,233, 14,217,248,179,253,230,126, 93, 23,245, 83,114,252, 56, 62,235,255, 0, 50,
-189,255, 0,154,222, 71,255, 0,130,225,127,213,179,191,180,180, 63,164, 59,103,226,207,247,153,249,116,127,213, 77,203,240,224,
-251,175,252,202,243,254,107,121, 31,254, 9,133,255, 0, 86,206,254,210,208,254,144,237,159,139, 63,222,103,229,208,254,170,110,
- 95,135, 7,221,127,230, 86,127,205,111, 36,127,193,112,175,234,217,223,218, 90, 31,210, 29,175,241,103,251,204,252,186, 47,234,
-166,229,248,112,125,215,254,101,103,252,214,242, 71,252, 23, 10,254,173,157,253,165,165,127, 72, 54,191,197,159,239, 51,242,232,
-127, 85, 55, 47,195,131,238,191,243, 43, 63,230,183,146, 63,224,184, 87,245,108,239,237, 45, 31,244,127,107,252, 89,254,243, 63,
- 46,135,245, 87,114,252, 56, 62,235,255, 0, 50,179,254,107,121, 35,254, 11,133,127, 86,206,254,210,208,254,143,237,127,139, 63,
-222,103,229,209,127, 85,119, 47,195,131,238,191,243, 43, 63,230,183,146, 63,224,184, 87,245,108,239,237, 45, 15,232,254,215,248,
-179,253,230,126, 93, 31,245, 87,114,252, 40,126,235,255, 0, 50,188,255, 0,154,222, 72,255, 0,130,225, 95,213,179,255, 0,180,
-180, 63,163,251, 95,226,207,247,153,249,116, 95,213, 93,203,240,224,251,175,252,202,207,249,173,228,131,254,229,194, 79,255, 0,
-118,206,254,210,208, 62, 79,237,127,139, 63,222,103,229,208,254,170,238, 95,135, 7,221,127,230, 86,233,243, 79,200,170, 32,155,
- 30, 16, 79,167,238,201,213,255, 0,222, 58, 65,242,135,107, 31,197,159,239, 51,242,233,109,243, 75,114, 63,195,135,238,191,243,
- 40,227,126,103,185, 13,206,166,199,133,215,255, 0,102, 77,175,254,241,211, 47,242,155,108,111,241,103,251,204,252,186,144,223,
- 51,119, 23,127, 14, 31,186,255, 0,249,209,228,249,148,228, 21, 82,182, 92, 55,119,254,204,154, 79,254,241,212,115,229,102,216,
- 63,137, 63,222,103,229,211,195,204,141,196,255, 0, 14, 31,186,255, 0,249,209,232,126, 97,185, 38,115,201,143, 22,193,137, 58,
-234,250, 4, 34,217, 52,147,255, 0,245, 13, 70,184,242,219,105,181,105,124,147, 76, 7,235, 51,242,234, 68, 30, 96,110,119, 14,
-210,200,162, 39,245, 95,255, 0, 58,115, 57,202,188,184,212,114,250,241,156, 52, 81, 59,138, 62,237,150, 86, 7,193,247,134,179,
-237,229,190, 95,123,244, 11,137,190,243, 63, 46,175,206,249,190, 6,107,240, 34,245, 59,254,116,203,149,230, 55,145, 98, 44,161,
-220,127, 13,109, 73, 36, 81,118,169,128,212,127,247,128,214,162,223,202,253,166,224, 43,102,152,255, 0,185,159,151, 89,185,252,
-196,220,237,202, 58, 40,129,253, 87,255, 0,206,146,156,243, 69,200,172,146, 81, 99,194, 18,122,245,251,178,104, 63,154,229,169,
-236,242,139,107,119,241,103,251,204,252,186,128,255, 0, 52,119, 38,255, 0, 14, 31,186,255, 0,204,162,139,243, 95,201, 41, 52,
- 22, 92, 35,227,182,207,254,211,212,134,249, 57,181, 31,226,220,125,230,126, 93, 70,119,155, 27,155,127,133, 7,221,127,230, 80,
-127,243, 95,201, 43,232,171, 30, 14,125, 21,181,206, 63,255, 0,115,210,191,163,123, 87,226,220,125,230,126, 93, 32,121,181,185,
-254, 20, 31,117,255, 0,153, 67,167,205, 95, 36,168, 83,238, 76, 34,158,143,187, 39, 83,255, 0,121,105,179,228,246,212, 63,139,
-113,247,153,249,116,224,243, 95,115, 63,195,131,238,191,243, 43, 67,230,131,144, 82,173,255, 0,221,252, 19,119,239, 11, 84,218,
-255, 0,239, 45, 36,121, 63,181, 31,226,220,125,230,126, 93, 47,250,169,185,126, 28, 31,117,255, 0,153, 94,171,205,119, 37, 39,
-178,203,132,127, 86,207,254,211,210,199,147,187, 81,254, 45,199,222,103,229,210, 15,154,251,152,254, 20, 31,117,255, 0,153, 65,
- 31, 54, 92,150, 63,220,152, 71,245,108,255, 0,237, 61, 44,121, 53,181, 31,226,220,125,230,126, 93, 50,239, 54,247, 54,255, 0,
- 10, 15,186,255, 0,204,175, 7,155, 62, 75, 63,238, 76, 35,250,182,127,246,158,140,249, 53,181,126, 45,199,222,103,229,210, 63,
-171,187,159,225, 65,247, 95,249,149,184,243, 99,201, 63,240, 92, 35,250,182,127,246,158,146,124,155,218,191, 22,227,239, 51,242,
-232,127, 87,183, 63,194,131,238,191,243, 40, 79,249,174,228,131,254,229,194,127,171,103,127,105,105, 63,209,221,175,241,110, 62,
-243, 63, 46,135,245,119,115,252, 40, 62,235,255, 0, 50,132, 30,106,249, 28,143,228,216, 87,245,108,239,237, 45, 32,249, 61,181,
-254, 44,255, 0,121,159,151, 71,253, 93,220,255, 0, 10, 15,186,255, 0,204,173,191,230,175,145,191,224,184, 95,245,116,239,237,
- 45, 15,232,246,215,248,179,253,230,126, 93, 15,234,238,231,248,112,125,215,254,101,122, 60,213,114, 49,255, 0,115, 97,117,255,
- 0,217,211,191,180,180, 71,201,253,172,127, 22,127,188,207,203,161,253, 93,220,255, 0, 10, 15,186,255, 0,204,161, 7,154,126,
- 69,239,179,225,127,213,211,191,180,116,131,229, 14,217,248,179,253,230,126, 93, 31,245,115,115,252, 40, 62,235,255, 0, 50,182,
- 30,105,185, 22,191,201,176,207,234,233,223,218, 58, 31,210, 29,175,241,103,251,204,252,186, 31,213,205,207,240,160,251,175,252,
-202,219,254,105, 57, 23,254, 13,134,127, 87,205,254,209,209,127, 72,182,207,197,159,239, 51,242,232,255, 0,171,155,159,225, 65,
-247, 95,249,149,231,252,210,242, 39,125,155, 12,254,175,157,253,163,161,253, 34,219, 63, 22,127,188,207,203,164,255, 0, 87, 55,
- 63,194,131,238,191,243, 40, 65,230,139,145, 15,251,159, 13,254,174,155,253,163,164,255, 0, 72,246,207,197,159,239, 51,242,232,
-255, 0,171,155,159,225, 65,247, 95,249,149,176,243, 65,200,103,253,205,134,255, 0, 87,205,254,209,210, 79,148,155, 96,254, 44,
-255, 0,121,159,151, 71,253, 92,220,255, 0, 10, 15,186,255, 0,204,161,147,230,119,144,143,109,159, 15,254,175,155,253,161,164,
- 31, 41,182,193,252, 89,254,243, 63, 46,149,253, 91,220,191, 10, 15,186,255, 0,204,161, 7,153,190, 64, 63,238,140, 67,255, 0,
- 1, 55,251, 67, 73, 62, 84,109,191,137, 63,222,103,229,209,143, 54,183, 47,195,131,238,191,243, 40, 81,230, 95, 62, 61,182,156,
- 67,250,190,111,246,134,144,124,169,219,127, 18,127,188,207,203,163, 30,108,238, 71,248,112,125,215,254,101, 8, 60,202,231,167,
-253,211,136,255, 0,224, 38, 15,255, 0,159,210, 79,149,123,119,226, 77,247,153,255, 0, 10, 87,245, 99,114,252, 56, 62,235,255,
- 0, 50,132,255, 0,153, 44,243,254, 19,137,127,224, 38,127,183,233, 63,210,205,187,241, 38,251,204,255, 0,133, 31,245, 95,114,
-252, 56, 62,235,255, 0, 50,176,121,146,207, 79,251,167, 18,255, 0,192, 76,255, 0,111,209,127, 75,118,239,196,155,239, 51,254,
- 20, 63,170,251,143,225,193,247, 95,255, 0, 58,216,121,144,207, 59,237, 56,151,254, 6,103,251,126,139,250, 93,183,126, 36,223,
-121,159,240,163,254,171,110, 63,135, 7,221,127,230, 86,195,204,134,118, 77, 62,234,196,255, 0,240, 51, 63,219,244, 95,210,237,
-187,241, 38,251,204,255, 0,133, 31,245, 91,113,252, 56, 62,235,255, 0, 50,183,255, 0,152,220,239,254, 21,137,255, 0,224, 38,
-127,183,232,191,165,251,119,226, 77,247,153,255, 0, 10, 63,234,174,227,248,112,253,215,255, 0,206,183, 79,152,188,236,255, 0,
-186,177, 79,252, 12,207,246,253, 36,249, 99,183, 15,226, 77,247,153,255, 0, 10, 49,230,166,227,248,112,253,215,255, 0,206,135,
- 79,152,124,225, 93,182,188, 87,255, 0, 3, 47,253,187, 77,159, 44,246,241,252, 73,190,243, 63,225, 78, 15, 52,183, 19,252, 56,
-126,235,255, 0,231, 70, 19,230, 7, 54, 63,238,188, 95,175,162, 20,191,246,221, 52,124,182,176, 31,196,155,214,223,248, 83,173,
-243, 59,112, 63,195,135,238,191,254,116, 97, 60,249,154, 30,219,102, 51,255, 0,130,149,254,219,166,207,151, 54, 3,248,146,250,
-219,255, 0, 10,117,190,101,238, 7,248,112,253,215,127,206,141, 35,157,115, 37,118,219,113,175,138, 28,175,246,221, 50,239, 47,
-108, 71,219,151,214,223,248, 83,236,243, 26,253,223, 98, 47, 83,191,231, 70,145,205,249,114,187,109,248,231,197, 18, 79,251,102,
-154, 60,129,100, 62,220,190,182,255, 0,194,164,179,204, 11,215,125,136,189, 78,255, 0,157, 63,113, 94, 64,201,239,169,117,233,
- 81, 44,204,176,217, 9, 30, 4,103,210,165, 40,255, 0,165, 37, 67, 88,238,101,217,173, 54, 93, 45,141,207, 46, 61, 36, 34,122,
- 26, 43,160,242,173,253,206,248,215, 73, 48,104,104,195,186, 8,249,201,167,191,247,146, 90, 71,182,220, 90,143, 66, 20, 7,254,
-147, 88,179, 47, 69,109,155,183,135,100,191, 47, 69, 1,253,233,156,165, 81,182, 34,158,180,161, 66,201,255, 0,210,105, 38, 99,
- 82, 70,210,192, 21,196,251, 62,170, 51,247,245,201, 37, 37, 77, 67, 9, 35,175,176,189,223,250, 77, 23,140,105,159,129,136,228,
- 92,190,143,170,132, 85,254, 88, 65, 41, 68, 85, 43,208, 16,163,215,255, 0,203,210,155, 41,113,166,254, 5,171,199,229,232,173,
- 17,144,204,237,117,168,201, 7,176, 4, 42,191,254,126,157, 14, 83, 65,214, 13,224, 79,203,209, 67, 34,251, 41,192, 74, 91,143,
- 78,239,101, 95,254,158,144,247,233, 56, 82, 13,147, 91,153, 52, 32,187, 79, 63,177, 23,255, 0,217,174,191,250, 77, 35,198, 52,
- 95, 13, 31, 95,179,234,162, 15,223, 47,104, 39,194, 98,222,180,211,181, 77, 56, 15,254,151, 70, 37,169, 12,179,129,195, 18,239,
-103,213, 68,255, 0,188, 57, 29,105,238,214,186, 82,181,240,156,255, 0,247,218, 95,136, 41,207,128,131,165,222,207,170,185,129,
-238,107,244,126, 95, 46,189,169,227,138,241,119,129, 94,123,162,143,119,229,242,232,252, 97, 69,240,235, 94, 24, 74,253,223,203,
-229,208, 19,138, 47,134,173,125,197, 95,186,127, 47,143, 74,248,138, 47,133,175, 68, 21, 1,243,127,203,250,116, 95, 16, 40,254,
- 26,182, 76, 51, 95,155,250,180, 70,122, 31, 12,181,183,185, 31, 64,249,116,159, 30,129,182, 90, 12,195, 61,201,252,218, 88,159,
-174,139,225,235,195, 12,142,239,205,253, 58, 87,143,215, 68,109,235,193, 19,175,103,230,209,252, 69, 23,195, 80,158,231, 95,217,
-166,135,143,215, 71,240,233, 90,152, 68,254,206,143,199,162,248,106,221, 48,127,135,252,186, 35,113, 70, 45,169, 65,152, 3,189,
- 63,151,203,168,210, 92, 84,134, 91, 83,219, 31,198, 30,185, 60,132, 37,162, 80, 84, 55, 31, 87,203,172,214,241,189,178,193,132,
-147,141, 95,237,155, 59,175, 28, 0, 21, 63,218,184,222,217, 21, 13,173,200,233,121, 68, 2, 67,130,191,175, 92,115,115,231,169,
-229, 36, 53,201,217, 93, 95,109,228,184, 88, 1,112, 90,121,194,197,236,214,233, 9,151, 30, 11, 76, 60,148,211,114, 19,215,244,
-235, 37,119,205, 23, 55,108, 49,190, 66, 91, 90,171, 94, 88,130,221,225,236, 96, 14,161,103,173, 7,125, 69, 1, 20,165, 59,181,
- 85,109, 43,156, 85,107, 69, 37,168, 99, 18,163, 12,131, 26,181, 92,227, 63,226, 36, 54,250,129, 40,113, 3,218, 7,229,215, 71,
-216,121,150,226,198, 70,161, 86,244, 87, 61,223,121,102, 27,214, 59, 4, 61, 53, 94,175,118, 47,112,125, 77, 87,122,122,209, 93,
-159,175, 93,203,105,221,190, 53,154,178,174, 37,186,109, 63, 4,253, 52,211,122, 0,175,103,235,253,122,208, 50,230,179,242, 90,
-208, 41,134, 18,123, 52,179, 58,211, 34,217, 40,198, 71,204,126, 88,240, 38,172,150,174, 81, 95, 32, 96, 55, 73, 81,155, 66,178,
- 68, 88,223,200,113, 27,188,148,116, 90,219,149, 17, 18,125,212,147,243,154,125,180, 20,247, 21, 39,218, 60,127,153,183,190, 99,
-217,174, 30,232, 60, 23,194, 73,210,163, 20,224, 15,121,165, 71,167,166,187, 63, 41,114,142,205,204,118,237,253,231,140, 0, 15,
- 1,216,175, 74, 16,112, 60, 8,236,206,145, 91,231, 15, 39, 55,249,140, 90,241, 62,121,199, 29,186,201,115,194,139, 14,249,118,
-110,198,252,149,168, 80, 37, 8,150,203, 5, 71,119,112, 61,117,147,103,154, 27,245,171,150,123,104,156,209,154, 7, 15,104,115,
-147,213, 90,233,252,154,178,115, 22, 51, 59,122, 9, 66, 63,233, 31, 61, 45, 92,162,196,130, 82,181,205,136,184,206,145,238,211,
- 82,250, 12, 73, 40, 89,162, 74, 28, 10, 45,157,221,195,117,117,208, 57,123,205,109,191,119, 70, 76,176,201,208,239,119,208,225,
-135,222, 13,174,109,191,121, 93,127,181, 43,162, 2,102,127,167,222, 29,173, 56,253,213,162,138,137,215,176,252, 98,159,175, 93,
- 50, 59,145, 32, 14,105, 4, 28,136,174, 99, 53,169, 97, 33,193, 8,204, 86,162, 31,171, 75, 51,212, 99, 5, 10,152, 93,123, 59,
- 52,131, 61, 39,192,163, 2, 23,164,124,154,108,220, 82,190, 30,183, 16,199,163,243, 83, 73,241,232,120, 21,239,185,250,191, 47,
-151, 69,227,208,240, 43,207,116,245,126, 95, 46,143,198,164,248, 20, 42, 98,215,187, 72, 51, 80,240,104,100,196, 62,141, 32,205,
- 74,240, 40, 81, 18,189,223,151,203,164,120,212,161, 13, 8, 32,122, 71,229,242,233, 63, 17, 71,240,244, 39,185,143, 71,229,242,
-233, 30, 61, 31,195,208,137,136, 7,119,230,210, 76,203, 69,224,165, 8, 35, 83,187, 73, 50,209,248, 85,184,142, 43,217,164,248,
-180, 60, 42,220, 71,167,113,249, 52, 94, 37, 23,133, 66, 37,143, 85, 52,131, 37, 15, 10,140, 33,129,222, 63, 94,154, 50, 83,130,
- 42, 20, 69,235,217,164,248,180,126, 13, 10, 34,250,180,131, 53, 40, 67, 66, 38, 39, 94,163, 73, 51, 82,132, 20, 39,186,159, 71,
-233,210, 60,106, 63, 0,208,168,139, 78,237, 33,210,211,141,134,140, 34, 55,171, 77,186, 90,117,176,209,198,227, 83,187, 76, 58,
- 85,167,219, 21, 29, 67, 30,173, 48,233, 42, 75, 99,163,173,177,217,211, 76, 58, 74,146,198, 82,196, 8, 94, 60,134, 90, 35,162,
-148, 63, 54,171,238,238,124, 22, 57,221, 2,175,118,123, 47,140,157,145,244,154,159,236, 81,217,183, 91,210,211, 66,132,141,235,
-245,168,252,122,225,155,229,227,175,230, 50, 56,245, 10,244,150,209,183,182,194, 38,196,192,157, 52,162,148, 61, 41, 85, 72, 33,
- 62,158,237, 80,184,214,132, 57,176, 12,115,165,104,177, 81, 28,133,172,138,129,217,249, 29, 32,154,133, 60,230, 92, 5, 3, 45,
-255, 0, 17, 69, 45,246,246,116,209,128,180,168, 35,208, 20,208,109,125, 21, 10,213, 82,107,219,167, 64,225, 78, 63,246,153, 86,
-202, 5,245,123, 53, 9, 29, 9,255, 0, 38,150,186, 5, 33,164, 70, 49,165, 4,169,182, 80, 7,163,167,199,166,115,168,197,166,
- 82,180, 39,188,166,157,160,124, 99,252,186, 26,105, 30, 9,175, 60,118,143, 66,160,107,210,181,208, 67, 69,160,138,247,198,103,
-178,190,174,223,233,209, 33,163,208,107,157,194, 1, 35,179,245,126,189,122,255, 0,226,171,201,230,214,179,220, 15,163,242,249,
-116,127, 21, 69,240,213,239,184, 31, 64,252,190, 61, 31,196,208,248,122,207,112, 62,129,249,124,122, 31, 19, 67,225,235, 67, 4,
-246,109,252,190, 93, 24,184,162, 54,245,231,185, 83,187,242,249,116,126, 61, 16,182, 74,244,194, 63,187,249,191,167, 69,227,209,
-252, 61,104, 97, 30,225,249,124,186, 80,158,147,240,203, 90, 24, 42, 61,160,104,197,197, 23,195,214,233,183,159,221,252,190, 93,
- 17,185,160, 45,232, 97,111, 80,236, 79, 79, 94,145,241, 93,116,127, 15, 88, 96,245,249,186, 88,186,164,252, 61,120, 33,144,170,
- 4,232, 27,129, 67,192, 74, 84,183,219,149, 33,244, 50, 19, 66,162, 7, 93, 65,187,188, 16,180,187,162,165, 91, 90, 25,156, 27,
-211, 86,131, 16,198,153,183,197, 97, 75,108, 21,148,133, 18, 71, 82, 78,184, 7, 52,115, 3,174,228,112, 7, 10,237,124,187,177,
-182,213,128,145,141, 72,161, 8, 0, 0, 59, 7,167, 88, 23,202, 93,153,173,164,108,211, 68,101,188,132, 36,128, 58,211, 69, 24,
-213, 82,152,116,227, 77, 9,175, 5,110, 20,244,234,242,210,220,132, 53, 26,230,240, 16,148,221,122,138,168, 34,160,215,167,167,
- 87,241, 52,177, 8,170, 41, 37, 15,192,211, 54,239,141, 68,156,135, 92,236,116, 2, 82, 61,127, 46,182, 59, 71, 50,203,102,224,
-211,149,100,119,142, 94,138,245,165,195, 58,136, 39,218, 87, 25,213,182,180,118, 18, 18,125, 32,124,122,235,118, 59,139,110,152,
- 28,211, 92,150,251,110,117,171,139, 92, 41, 40,192,239,218, 70,172,133,197, 86, 24, 41, 11, 35,195,236, 89, 85,170, 69,155, 33,
-181, 68,186,219,100,164,135, 35, 75,104, 56,144,174,229, 39,189, 36,122, 70,152,185,142, 59,214, 24,228, 10,211, 82,236, 46,166,
-219, 37, 19, 64,226,215,142, 35,229,141,113,227,205,151,148,116,227, 62, 29,226,210,145, 46,195, 50, 81,102, 26,146,216, 15, 68,
-121,117, 80, 97,193,184,168,251, 32,209, 67,161,245, 30,154,227, 60,201,176, 73,177, 63,196,140,151, 68,238, 60, 65,232, 63, 65,
-175, 85,249,113,230, 68,123,203, 60, 9,198,153, 90, 49, 28, 8,233, 31, 72,174,119,171,144,185,143,132,102,152,152,118,119,152,
- 89,237,168, 52,114,198,169,238, 76,176,184, 19,208,167,220,228, 23, 35,164, 40,116,170, 82, 15,175, 89,216,227,142,243,247,140,
-105,235,227,235,206,186,205,196, 22,151,227, 86,144, 29,210, 43,163,190, 83,188,224,100,151, 23,113,216,121,132,230, 37,227, 87,
-139,188,107, 37,221,183,211,177,252,102,237,112,246, 24,125,175,106,141, 48,235,164,111, 64,246, 71, 85, 0, 13,107,177,229,141,
-221,219, 28,226, 18,227,224,187,129, 56, 14,177,208,156,122, 71,162,184, 39,153, 60,145, 22,227, 11,230,137,169, 51, 1, 32,143,
-180,156, 15, 74,140,171,177,141,198, 73,238,168, 61,126, 29,118, 55, 77, 94, 94, 17, 45, 27, 76, 33,220, 63,203,250,116,209,158,
-148, 32,161,132, 47, 86,155,241,232, 24, 43,111,115,245,126, 95, 46,139,199,160, 32,173,132, 32,123,191, 94,139,199,163,248,122,
-223,220, 64,238,252,190, 93, 39,226, 40, 27,106,217, 48,127,135,242,249,116, 70,226,147,240,212, 40,133, 78,239,203,229,210, 76,
-244, 62, 30,183, 17, 7,163, 73, 51, 82,188, 10, 24, 68,245,126, 95, 46,155,241,168,252, 10,247,221, 61, 90, 30, 53, 3, 5,103,
-186,127, 14,135,141, 69,224, 86,194, 47,168,126,141, 23,141, 67,225,235,223,117, 31,151,249,244, 94, 53, 15,135,173,132, 79, 87,
-229,242,232,188,106, 30, 5,108, 34,211,187,242,249,116, 70,101,161,224, 80,232,140, 61, 26,108,203, 74, 16, 81,132, 71,245,124,
- 90,105,210,211,162, 10, 24, 70,245,126,125, 35,197,165, 11,122, 21, 49,135,112,210, 12,180,177,111, 67, 38, 48,244,126,189, 32,
-203, 75, 22,244, 58, 98,252,154,108,205, 75, 22,244, 97, 49, 41,221,166,140,212,224,183,163, 9,139,234,211,102,106,116, 91,209,
-148,196,167,118,154, 51, 83,130, 10, 50,220, 99,232,211, 46,150,158,100, 20,179,110,109, 77,201,101, 73, 2,187,192,165, 43,219,
-170,251,210, 36,141,192,228,149,160,217, 3,160,184,141,205,205,106,104,180, 54, 93,162, 9,233,181, 53, 21,248, 53,195,111,220,
-143, 34,189, 36,199, 6, 70, 29,197, 41,220,150, 3, 77,208, 80, 83,184,119,106,180,149,168,134,109, 71, 26, 79,124,171,175, 83,
-242,232,192,169, 49,184, 26,214, 51, 96,239, 81,234,174,208, 52,170, 19,191, 42,211,193, 37,100,172,119,158,132,210,154,116, 20,
-165, 9, 64, 8, 43,103, 36, 54,194,118,212,116,232, 58,233, 40,166,156,100, 70, 82,180,156,237,197,190,194,177, 80, 9,237,233,
-250,116,227, 99, 53, 36, 91,150,210, 52,203,178,144,217, 82, 22,147, 78,225,219,250,116,235, 99,233,167,197,186,240,164, 84,228,
- 75,109,105, 10, 38,149,234,107,253, 58,115,193, 90, 89,181, 6,140,127,121, 71,137, 90,154,122, 43,223,242,233, 62, 1,161,240,
- 99, 74, 85,105, 16,207,163,243,107,210,134,122,242,119,129, 91,251,159,168,124,186, 30, 61, 23,129, 91,123,167,240,143,151, 71,
-241, 20, 62, 28, 87,134, 39,240,254,157, 24,154,139,192,160,204, 90,254,206,150, 38,162,240, 43, 67, 19,213,249,124,186, 87,141,
- 73, 48, 86,158,235,214,148,232, 59,116, 12,233, 67,192,173,189,208, 17,217,250,191, 94,136, 76,104, 24,107,116,194, 21,236,253,
-122, 35, 61, 23,195,209,198,109,171,117, 65, 40, 73, 42, 52,236, 21,237,211, 18,222, 8,194,147, 78, 50,200,200, 80, 10, 95,111,
- 16,184, 56,128,189,128, 3,217, 94,223,211,170, 41, 57,162,222, 50,139, 87, 49,114,204,210,133, 2,188,119, 14,185,182,128,231,
-130,149,167,175, 97,235,250,116,136,249,190,209,238,211,173, 13, 56,254, 81,186, 13,213,161, 69, 35, 57,103,117,179, 71, 25, 90,
- 77,125, 21,253,122,186,139,114,100,161, 90,224,106,166, 93,170, 72, 74, 57,166,156,216,140, 8,233,186, 50,169, 1, 37, 9, 32,
-251, 94,159,151, 84, 60,205,118,255, 0,134,118,140,234,227, 96,177,105,156,106,171, 32,198,192,129,183,230, 1,236,211,178,154,
-243,220,239, 46,113, 92,235,180, 69, 16, 96, 0, 86,235,114,157, 65,248,117, 24,154,146,214, 82,100,164, 21, 36,168, 26,158,189,
- 53, 38, 7, 33,164,203,146, 83,106, 67, 11,169,170, 78,175,225,156, 37, 84,190, 34, 77, 34,188,201, 4,250, 14,173, 33,156, 58,
-161, 75,110, 90,104,169,142, 87,210,149,211,230,112,220,105,182,192, 93, 73, 83,241,116, 92, 91,246,210, 16,160,106, 22, 7, 81,
-249,245,111,182,115, 67,246,215, 97,136,232,170,189,203,150,153,184, 55, 28, 15, 77, 32,200,192,218, 13,130,212,132,151, 8,249,
-167,211,242,235, 73,111,207,250,157,222,110, 21,154,159,145, 16,119, 78, 52,207,159,141, 74,137,187,114, 9, 72, 52,220, 59, 63,
- 78,181,150, 28,209, 5,230, 1,216,214,106,251,149,230,180,196,133, 20,196,201, 49, 11, 70, 77,107,151, 99,191,219,163,220,173,
-147, 91, 83,111,197,146,138,142,163,162,146,160, 66,155, 82,123, 82,180,144, 65,234, 8, 58,190,123,227,188, 97, 99,192,115, 79,
- 3,136,170,104, 91, 54,221, 32,146, 39, 22,188,100, 70, 21,204,174,126,242, 89,103,183,219,174, 25, 13,145,185,119,123, 28, 84,
- 42, 76,132, 73,172,187,197,153,132, 2, 86,167, 84, 19, 89, 44, 34,149, 46,252,244, 14,171, 10, 1, 75, 28,199,152,249, 78, 75,
- 32,110, 44,113, 96,197,204,226, 58,199, 72,234,206,187,167, 37,121,146, 46, 8,181,191, 64,243,131, 95,147, 73,235, 28, 15,176,
-245, 87, 56, 25,198,162,225, 87,207,115,113, 62, 21,146,244,164, 91, 95,144,210,186, 71,121,242, 3, 15, 2, 15,253, 91,148, 53,
-214, 30, 27,215, 60,167, 28,235,176, 94, 64, 47, 96, 36,123,192,122,197,119,219,203,182,104,188,239,140,236,111,220,100,182,254,
- 79,143,182, 49,188,169,160,163,227, 55,118,182, 0,148,186,176,123,166, 71,240,223, 4,116,246,136,237, 4, 14,225,203,123,200,
-221, 45, 90, 87,188,222,233,244,100,125, 35,218,181,227,190,110,216, 63,148,222,188, 1,220,121,212,222,195,152,244, 21, 21, 96,
- 17, 20, 16, 58,106,225,210,165,103, 69,189, 14,152,189, 58,141, 52,102,165,124, 61,109,238,163,209,162,241,168,124, 58, 86,233,
-141,234,252,212,209, 25,104,252, 10, 25, 49,107,221,250,244,131, 53, 44, 91,208,130, 32,244, 13, 35,198,162, 54,245,239,186, 87,
-187,228,208,241,169, 38,222,189, 16,253, 95,151,203,162,241,232,190, 30,182,247, 95, 86,139,198,162,248,122,195, 23,213,161,226,
-208,248,122,207,117,248,180, 60, 90, 30, 5,103,186,232,120,180, 60, 10,216, 70, 30,141, 23,139, 67,193,175, 68, 97,232,252,218,
- 47, 22,135,129, 94,251,183,171,243,104,120,180, 12, 21,178, 99,250,191, 86,146,100,160, 33, 74, 48,150, 61, 95, 23,102,155, 50,
- 83,130, 26, 48,152,254,173, 54,100,167, 4, 52, 40,141,234,252,250, 71,139, 78, 8, 40, 68,199,245,124, 93,250, 65,150,148, 45,
-232,210, 35,122,180,211,165,167, 4, 20,109, 17,189, 90,101,210,211,173,130,140,162, 48,238, 26,100,203, 78,139,122, 50,136,195,
-209,166,140,180,232,183,163,104,138, 59,134,153,116,212,251, 45,233, 90, 4, 21, 56,242, 54,130, 40, 65,168,245,106,186,254,236,
- 67, 27,137,232,173, 6,201, 96,103,153,169,192,212,169,102,100,179,237,171,162,182,247,235,143,110, 14, 14,121, 34,187, 87,137,
-173,129,180,184,235,245, 73, 0,252,125,154,129, 73,142, 36, 42,105, 56,188,197, 61,181, 41, 74,169,175, 94,159,167, 78, 5,169,
- 58, 29,194,138, 61,113, 98, 57, 27, 14,222,132, 30,191,211,167, 89, 25, 52,177, 3,159,157, 32,200,189, 29,228,165,103,175,117,
-127,167, 83, 89, 14, 21, 37,150,224, 96,105, 57,219,154,221,237, 95, 79, 89,254,157, 16,141, 42,198, 56, 67,105, 14, 69,200, 2,
-175,111,188,247,255, 0, 78,158, 12,169, 13, 20,140,253,211,161,246,171,241,250,126, 61, 44, 70,180,251, 89, 72, 82, 46, 21, 36,
-133, 83,213, 95,233,211,237,142,156, 17,208, 30,255, 0,244,117,221,215,183,231,117,160,248,244,175, 14,143,195,164,132,198,233,
-211,244,107,181, 25,107,201,255, 0, 15, 91,251,169,252,191,207,162,241,169, 95, 14, 43,223,118,245,126,127,233,208,241,168,190,
- 30,188, 49,107,251, 63,159, 67,198,235,162,248,106,212,196,245,126,141, 40, 79, 68,109,232, 51, 19,213,242,105,127, 17, 73,248,
-122, 11,221, 63,135,244,104,252,106, 35,111, 91,136,167,247,116, 12,244, 5,181, 57,236,120,232,184,186, 3,149, 75, 96,251, 68,
-127,159, 89,237,235,125,254, 92,197, 25,213,198,217,179,124, 99,177,202,164,184, 24,188, 24, 10, 42,109, 1,117,253,165, 10,144,
-117,205,183, 14,106,154,240, 33, 41, 91,107, 46, 95,138,216,170, 82,210,163, 54,132, 82,128, 10,116,233, 79,215,172,196,151,238,
-113, 85,173, 28, 86,161,161, 41, 34, 64,111,105, 77, 71,192, 14,152, 23, 68,149,171, 24,225,193, 41, 41, 49, 99,169, 68, 56,210,
- 87, 95, 72,244,234,197,187,212,204, 64,215, 17, 77, 73,180,195, 38, 46,104,175, 27,199,216,247,132,188,203,123,106,106, 64, 61,
- 7,231,214,130, 46,107,124,177,120,114, 28,107, 55, 63, 46, 50, 25, 53,198, 48,169, 42, 27, 65, 49,208,133,117,162, 64,237,214,
- 38,226, 79, 17,228,213,195, 86, 48, 5,122,182,105,215,187, 81,137,169, 13,145,104,131,131,184,116,244, 87, 82, 98, 52,204,174,
- 52, 81,104, 29, 74,147, 93, 77, 99,170, 51,137,164,135,155, 73, 39,217,165,117, 53,146,105,166,204,101,245,171, 81, 82, 8, 81,
- 20,169,174,138, 75,181,194,157,142,220,138,221,245,181, 29, 7,122,106, 72,233,232,253, 58, 96, 74, 94,105,225, 18,211, 50,100,
-173,171, 42, 77, 65,169,165, 59,191, 62,173, 32,198,150, 97, 90, 75,126, 66,222, 70,213,209, 64,250, 71,244,234,214,217,222, 17,
- 81, 85,215, 54,193,225, 8,166,212,219, 98, 93, 37, 64, 1, 95, 64,239,249,117,185,218,183,243, 8, 13, 53,134,221,182, 1, 42,
-184, 96,105,187, 38,215,182,160,167,114, 72, 32,244,173, 65,214,218,211,116,109,192,172, 37,230,216,235,115, 92,138,243,211,229,
- 18,253,253,217,200, 57, 31,136,215,107,129, 15,196,110, 77,239, 29,154,232,183, 69,181, 92, 30, 62,195,214,226,150,195, 97, 50,
- 22,154,173,130, 65, 10,170,145,236,213, 41,231, 92,233, 97,109,183, 61,151, 77, 33,165,238, 77, 35,137,205, 64, 30,223,211, 93,
-163,203, 78,113,153,192,217,220,130,230,181,165, 29,158, 25,105,119,208,106, 63,242,185,200,124,161,198,115,226,100,249, 22, 49,
- 62,237,103,189,227, 22,155, 94,111,107,182, 52,178,182,174,144, 5, 99,205,109, 74, 73, 70,246,130,150,130, 55, 81, 73, 87,111,
- 68,234,171, 97,230, 38,236,115, 56,156, 88,236,192,246, 31, 71,211, 67,155,182, 72,119,232,244, 49,192, 61,174, 37,164,244, 28,
-199, 97,250, 43,176, 56, 86,113,139,103, 86,214, 46, 24,245,201,153, 37,196, 36,189,111,116,134, 46,144,157, 61,173,191, 28,159,
- 17,181, 10,118, 17,215,180, 18, 53,212,236,247,187,109,201,186,161,145,167,164, 46, 35,180,103, 92, 94,247,100,184,219,157,166,
- 86, 16, 56, 28,193,236, 57, 84,210,206, 32,221,190, 7,223,121,149,238,209,133, 88, 82,144,234,230,223,101,162, 60,133,181, 74,
-213,182, 10,130,201,167,102,226, 62, 61,102, 55,110,125,178,177, 37,145, 59,197,127, 67,113, 11,214,114,245, 45, 94,109,124,151,
-119,126,142,120,208,206,151,103,232, 31, 90, 85, 88,228,159,196, 67,201,151, 13,205,147,104,199,154,186,242,230, 79, 1, 74,109,
-198,173, 44,125,227, 12, 72, 64,234, 20,226,202, 33, 3, 94,229, 80,235, 15,117,204,187,158,229,246,188, 54,158, 3,187,237,247,
-189,181,210,246,190, 65,182,136, 7,104,213,214,236,125,153,123, 42, 31,181,126, 46, 60, 75,154, 75, 98,205,150,112,102, 79,138,
-218, 30,123,194, 69,238, 10,224,206, 92, 4, 19, 64,226,152,105,207, 22,128, 30,161,176, 79,160, 29, 82, 58, 75,251, 71,248,176,
- 92,184, 59,180,161,237, 14, 86,159, 72,173, 43,185, 66,218,118,120,114, 68,194, 58, 16, 4,236, 32, 2, 61,117,107,113,222, 76,
-227,140,214,214,221,251, 13,201,173,217, 13,161,228,239,241,173,143,248,146,225,129, 90,165,248,171, 62, 59,106, 65, 20, 87,105,
-245,106,234,195,204,123,203, 67,162,246, 32,241,210,222,235,189, 88,180,250, 18,177, 27,175,150,208, 5,248,119,185,135,161,221,
-225,235,192,143,109, 59,173,147,237,183,118,148,245,178,100,121,173,182,181, 54,225,101,117, 45,184,158,208,161,209, 73, 62,162,
- 53,212,118,205,234, 13,226, 63, 22, 7, 40,226, 14, 4, 30,130, 62, 64,240, 53,204,183, 45,150,125,170, 79, 14,102,167, 65,204,
- 30,176,105, 88, 69,175,119,229,242,234,121,153, 42,188, 65, 91,123,175,171,244,105, 62, 53, 15, 2,188,247, 95, 86,143,198,164,
-152, 43, 4,111, 86,135,139, 73, 48,215,190,236, 61, 3, 67,197,162,240, 43,207,117,252,171,161,226,209,120, 21,158,237,234, 26,
- 30, 45, 23,129, 94,251,175,171, 69,227, 80,240,107,223,116,245,126, 95, 46,135,141, 67,192,175, 68, 63, 87,229,242,232,188,122,
- 49,110,180, 50, 98,250,180,131, 53, 44, 91,209,132,198,167,118,155, 50,211,130, 10, 25, 49,189, 3, 77,153,105,209, 13, 12,152,
-222,173, 32,203, 75, 16,209,148, 70,245,105,163, 45, 56, 33,163, 9,143,234,211, 70, 74,112, 67, 70, 80,199,171, 77, 58, 74,112,
- 66,148,109,184,197,100, 37, 41, 42, 36,208, 1,218, 78,153,116,169, 79, 50, 18,112, 20,241,181, 99,192,209,201,105, 4, 16, 8,
- 65,238, 7,211,215, 89,109,219,127, 22,225, 35, 56,214,171,105,216, 12,197,100,202,157,204,219, 98, 48,154,182,202, 17,211,161,
- 3,175,233,214, 22,243,119,154,235, 7, 56,165,111, 44,118,200,172,207,113,161,104, 39, 29, 75, 10, 41, 6,132, 15, 77, 53, 90,
-165,213,126,216,117,129, 69,189,232,172,237,221,240,144,123,180, 3,105,211, 22,145, 73,119, 25,233,105, 52, 74,128,233,220,122,
-254,157, 74,141,139, 78, 65, 14,172, 77, 51, 37, 92, 74,215,213,100, 26, 26, 84,246,254,125, 77,100,105, 86, 34, 36,164,119, 46,
- 59, 84, 66,143, 94,226, 15, 74,124,186,154,214, 97, 73,208,166,139,185,116, 72, 73,246,253, 53,235,253, 58, 54,219,151, 83,193,
-225,185,211,114, 93,211,218, 59, 84,105,212,214,181,253,122,152,203, 94,154, 2, 69,202,145,156,184,172,214,135,175,166,167,252,
-186,124, 90,138,121,178, 17, 68, 76,197, 43,180,246,250,244,102,220,112,167,155, 50,103, 91,123,223,179,182,191, 21,116,223,130,
-105,223, 24, 83,196, 49,217,219,242,107,165, 25,171,204,190, 18, 80,158, 0,252,142,147,226,208,240,235,209, 28,104,252, 90, 63,
- 14,179,221,198,135,137, 67,195,173, 76,113,220, 52, 98, 74, 47, 10,188, 17,253, 95, 41,209,248,148,159, 14,179,221,235,221,241,
-232,188, 90, 30, 10,209,134, 97,239, 80, 0, 31,147,211,166,101,184,208, 22,156,100, 26,141, 73,150, 24, 30, 3, 9,165,106, 69,
- 77, 70,185,151, 49,223,248,206, 43, 91, 61,162,219,194, 24, 83,157, 8, 9, 29,189,135, 88,137,102, 90,210,180, 81, 57,142, 37,
- 41, 32,119,124,186,138, 94,181, 38, 54,173, 52,100,191,181, 71,183, 70, 29, 86, 49,177,107, 35, 44,173, 96, 14,181,166,140,189,
- 40,220, 18,157,112,210, 70,210, 71,194, 15,126,139, 90,212, 57, 41,125,181,122, 52, 22,160, 60, 80,170,236,169,236,244,105, 75,
- 77,182,136,184,144,123,123,186,211, 78, 49,233, 74, 45, 90, 79,112,245,219, 78,149,244,106, 67,100,163, 16,173, 6,152,219,186,
-148,254,109, 44,205, 68, 24,148, 28,165, 37,150,207,239, 1,208, 15, 78,152, 14,212,106,194, 40,181, 10,102,206,156, 66,137,116,
- 21, 0, 58, 1,217,250,117, 99, 27, 58, 40,252, 30,138,105, 75,152, 30, 87,176,222,222,189,255, 0,231,213,140, 24,113,167, 12,
- 58, 69, 23, 66,213,249,245,105, 27,170, 4,177, 81,147, 69, 1, 81,215,179, 83, 98,145, 42,158,230,222,150, 44, 56,164,140,146,
-114, 35, 35,232, 34,165, 73, 50,101,169, 4,165,164, 18, 58, 39,247,148,123,135,198,122,105,249, 57,140,108,237,212, 74,147,144,
-233, 63, 87, 73,170, 57,182, 81,122, 81, 48,226,107,222, 73,188,240,182, 42,152,216,197,205,219, 91,183, 8, 5, 47, 37,171,140,
-134,228, 54,101, 46,159, 72,180, 45, 91, 22,237, 9, 21, 9,168, 21, 9,160,168,214, 55,114,220,101,221,101,241,230,118,167,100,
- 58, 26, 58, 26, 56, 14,158, 39,141, 89,218,216,178,194, 63, 10, 38,160,204,244,158,211,242, 78, 21, 94, 47, 23,107, 61,250, 52,
-177,105,133,111,251,191,192, 83, 65,148, 52,219, 94, 50,128,246, 84, 0,165, 83,180,132,138,117,213,103,138, 22,148, 99, 34,185,
-235,102,195,231,183,203,153, 53,254,217,122,185, 99, 8,199, 98, 46, 68,100,219,159, 92,116, 38,235, 32,157,138, 9, 10,218, 82,
-148, 36,212, 31, 72, 58,149, 51,155, 52,122, 92, 21,106,104,156,194,193,210,181, 90, 94,242,221,230, 99,205,119, 38,229,150,219,
-167,152,147, 15,141,236,175, 91,159,116,220,220,149, 51, 36,152,197,192, 44,169,165, 66,105,198,219,115,193, 40,217,188,188, 16,
-122, 26, 3,236,235,109,203, 59, 27, 55, 6, 31, 15, 75, 52,231,196,246,129, 81,183, 46,103,139,102, 99, 92,248,156,247,185, 83,
- 28, 48,235,171,205,199,191,134,135,151,188, 70, 12, 54,175,169,202,179,123,131, 45,163,222,101, 92,111, 78, 89,225, 72,124, 80,
-149, 37,136, 5,133,160, 19,251, 42,117, 94,178,117,185,135,150,109, 98,247,213,199,172,253, 2,177,247, 92,255, 0,184,220,147,
-225,150,198,222, 0, 5,249,254,170,146, 38,121, 6,242,225, 41,228,187, 27, 20,188,218,219, 73, 10,247,123,126, 89,113, 44,149,
- 14,195, 87,223,125, 98,135,184, 42,158,173, 56,253,130,205,223, 97, 61, 38,162,199,206, 59,147, 51,145, 79, 73,104,250,168,178,
-188,139,241,229,170, 66, 46,120, 38, 89,158, 97,119,166, 20, 21, 30,108,107,170, 46, 12, 2, 59,150,218,218,109,213,130, 71, 81,
-226,138,247,215, 85,183, 60,163,105, 48, 70,234, 30,149, 30,163, 86,176,121,129,124, 48,153,172,123,123, 16,250,193,250, 40, 9,
-152,239, 52,113, 69,222, 5,225, 13, 59,155, 52,133,178,204,139,174, 59,111,117, 95,123, 67,169, 11,106,229, 9, 21, 45,172, 10,
- 41, 47, 34,163,224,214,112,108, 87,155, 4,162, 75, 83,168,117,124,196,116,124,150,173, 91,187, 88,115, 20, 70, 41,198,131,154,
- 56,228,122, 90,106,238, 90, 28,114,231,110,133, 57,118,249,118,245,203,140,203,234,131, 44,127,172,198, 83,137, 4,165,126,202,
-104, 65,238, 32, 29,116, 8,103,115,152,211, 34, 7, 17,136,232, 53,205,231,180, 17,200,230,176,171, 65,192,244,210,169,138,177,
-218,217, 31, 22,150, 38, 7,141, 32,219, 17,152,173, 61,223,184,138,124, 90, 63, 22,155, 48, 86, 8,227,209,242, 13, 15, 18,144,
- 96,172,240, 7,238,157, 15, 18,144, 97,175,125,220,122, 41,241,232,120,180, 94, 13,103,187,143,200,157, 15, 22,135,131, 91, 8,
-195,184,126,106,232,188, 90, 30, 13,110, 35,143, 65,253, 3, 73, 50,209,248, 34,183,247,113,232,210,124, 90, 49, 13,108, 35, 87,
-187,244,232,140,180,161, 13, 8, 35,122,191, 54,146,101,165,248, 84, 50, 99,250,191, 94,144,101,165, 8,168,100,177,221, 79,151,
-166,155, 50, 82,252, 58, 25, 44,129,164, 23,210,196,116, 58, 99,174,149, 13,170,158,157,186,108,200, 58,105,193, 9,232,161, 18,
-216,237,167, 93, 32,186,140, 50,151, 44,113,252, 89,200,233, 80,128,165, 31, 85, 53, 81,188,220,252, 60, 14, 53,111,179,218,248,
-211, 0, 42, 66, 74, 82, 40,158,243,174, 89, 61,193,148,170,215, 78,134, 17, 8,192, 86,178, 29, 13,167,167, 95, 64,212,106,159,
- 3, 53,211,118, 84,145,237,110, 72, 63, 23, 93, 58,209, 86,241,194,131, 10, 67,118,127,128,186, 5, 87,112,233,234,212,134, 49,
-105,215, 69,172, 83,110,124,208,165, 31,104,159,132,154, 10,106, 84, 97, 42, 68, 81, 32,166,164,217,137,234, 73, 33, 93, 64,167,
-249,245, 41,133, 42, 83, 98, 90, 66,149, 60,132, 14,181, 52,232,174,250,124,186,153, 11, 60, 67, 71, 32, 17, 12, 41, 25,115,212,
-170,167,113,168,238,169,166,173, 24,208,218,132, 89,170,136,185, 37, 71,191,245,233,209, 78, 53,148, 92,184,165, 30,154, 88,165,
-158,237,123,180,246,215,228,209, 23, 1, 76, 57,233, 65,110, 86,239,205,166,181,227, 73,241, 42, 96, 12,127, 15,203,173,137,146,
-184, 55,135, 91,248, 3,208,126, 77, 39,196,161,162,189,240, 71,160,252,159,209,163,241, 40,105,172,240, 71,160,252,159,209,161,
-226,154, 26,107, 60, 17,251,167,228,254,141, 31,139, 69,162,188,240, 1,253,147,242,127, 70,135,139, 67, 69,122, 24, 21,165, 63,
- 94,139,197,163,211, 74, 16, 89, 79,138, 43,233, 29,105,168, 23,210,157, 6,164, 91, 48, 23, 84,147, 15,195,110, 50, 66, 64, 29,
- 62, 61,114, 61,214,103, 58, 82,181,186,178,137, 24, 18,183, 81,167, 65,223,219,170, 87,190,172, 26, 41,189, 61,101, 42,237, 52,
-210, 53, 84,216, 66,211,114, 67,161, 68,128,123,255, 0, 62,134,164,171, 6, 52,138, 22, 19,190, 26,251,187,116, 9,162,145,139,
- 78,232,114, 82,160, 42,122,244,248,116, 75, 80,159, 25,165,166,220,167,233,210,129,168,175, 98,209,143, 20, 30,213,105, 75, 77,
-104, 74, 1,197,164,214,157, 63, 94,140, 58,150,216,232,181, 1, 21,233,211, 74, 15, 74,112,178,182, 75,148, 20, 20, 31,175, 67,
- 90,208,240,146,144,110,175, 33, 4, 16,170,147,218, 52,252, 33, 77, 77,137, 81, 41,141,113,115,122,137,244,158,205, 89,177,233,
- 78, 53,137, 77,242, 13,122, 80,106, 92,111,167, 11, 86,140,176,194,158, 82, 27, 66, 84,183, 22,160,148, 33, 9,220,165,169, 70,
-128, 0, 5, 73, 39, 83, 27, 62,145, 80,165,134,165,156,123,141,100,200, 40,149,124, 38, 52,125,169, 90, 33,182,175,245,151,107,
-214,139, 52,250, 49,233, 3,175,193,219,170,251,189,220,176, 36,121,252,213, 85, 51,219,144,198,157,153, 13,162,227,108,178, 75,
- 70, 60,218, 25,125, 49, 94,110, 34, 99, 39,104,140,165, 15,156,144,126,114,137,239, 38,167,211,172,117,225,153,206,241, 94, 73,
- 53, 42,217,241,188,104, 24, 87, 18,167,223,172,152,215, 44,228, 51,249, 14,194,171,221,253,137, 87, 20,185,119,228,139,227,152,
-237,134,192,212, 48, 92,250, 6, 17, 6,121,113,213, 55, 87, 18, 20, 18, 10, 61,164,173, 94,214,210,117,244,211,144,198, 96,212,
-197, 51,250, 42,233,155,116, 12,128,200,231, 28,209, 26, 1, 61,167, 31,145,166,255, 0,148,223, 54,124,127,230,210,233,146, 76,
-192, 45,144,227,217,177,171,197,206,209,120,189, 91, 17, 40, 89,158, 54,228, 33,192,244,119,166,193,183, 73, 90, 72,116, 35,233,
- 35,160,133, 5, 10,116,169,150, 9,131, 7, 28, 77, 87,239, 59, 71,192,134,184,170, 17,197, 20,122,137, 21, 0,249,129,229,219,
-118, 43,200,179,172, 56,245,213,183,205,201,215, 30,187, 45,158,174,236, 65, 8, 74, 18,148,142,180, 69, 63, 62,174,108,129,149,
-170, 70, 85, 83, 21,151,136,221, 71, 46, 20,241,224,158, 72, 77,167,147,176, 9,118, 25, 45,188,155,253,222, 22, 47,121,140,219,
-137, 72,186, 91,114, 55, 91,100, 21, 84,212,152,210, 10, 93, 20, 4,251, 52,236,214,183,150,111, 95,183,221, 48,240,119,116,142,
-163,245,103, 89,221,246,196, 93,192,246,184, 98,208,163,168,143,172, 97, 93,151,106, 57, 52,246,127, 54,186,203,238,219,211, 92,
-234, 43, 71,116, 81,228,197, 36,118, 31,147,250, 52,207,196,142,154,145,240,164,112,161, 4, 66, 77, 2,122,252, 29,116,102,112,
- 2,173, 39,192, 39, 1, 78,107, 78, 62, 95, 33,110, 39,167,109, 8,233, 79,147, 89,141,219,152, 5,183,117,167, 26,186,176,217,
-204,184,184, 83,230, 61,154, 36,116,132,248, 13,168,211,247, 69, 71,230,215, 61,188,230, 9,230,118, 14, 32, 86,202,211,103,134,
- 54,226,208,180, 94, 77,166, 59,181, 1,176, 7, 94,148, 31,228,210,237,185,142,104, 72,198,159,151,100,138, 81,149, 51,174, 22,
-176,202,206,192, 40, 61, 95,209,173,222,213,191, 54,236, 35,142, 53,151,220,185,120,194, 53, 52, 82, 42,154,161, 34,159,145,214,
-145,178,106, 11, 89,121, 32,210, 80,215,129,154,247,124,154, 87,137, 81,204, 85,239,128,125, 31, 41,209,120,148,147, 29,123,224,
-122,134,139,196,162,240,171,112,205,116,147, 37, 15, 14,183,240, 7,163,243,232,188, 74, 26, 43,111, 7,212, 63, 47,139, 69,174,
-143, 69, 8, 26, 31, 14,146, 95, 74, 17,214,254, 24,244,126,109, 39, 85, 44, 49,104,220, 88,107,144,176,148,166,137,175,180,170,
-118, 13, 70,185,187,109,179,117, 56,212,155,107, 55, 92, 57, 26, 41,216,197,146, 7, 77,232, 81,238, 36,171, 88,235,174, 99,149,
-139,164,138,213, 91,242,244,110,247,133, 6,254, 54,208,123,123,110, 17, 30,149,219, 90,168, 31,147, 76,199,206, 68, 70,142,111,
-127,217, 79,255, 0,234,141,115,253,227,167,162,143, 39,221, 99,161, 45, 41,180,148, 82,132,144, 42,127, 54,168,238, 55,217, 38,
-118,160, 72, 53,127,111,176, 49,141,210, 70, 20, 15,187, 90,214,149, 0,148, 38,189, 65, 29,160,252,154, 31,251, 5,214,160,237,
- 70,143,249, 44, 13, 26,116, 10, 51,110,110,222,195,142,166, 51,168, 91,195,104,116,110, 10, 90, 55,117, 21, 29,162,186,107,112,
-222,230,191, 96,107,242, 20,155, 77,166, 43, 71,151, 48, 99, 74,229, 91, 71,136,179,181, 41, 53,248,117, 75,170,173,218,117, 96,
- 41, 6,116,237,196,236, 80,167,229,234,210,193,171,123, 91, 84,206,155,207,202, 53, 53, 63, 30,164,199, 86, 65,154,105,187, 58,
- 66, 77, 74, 85,211,209, 78,205, 76,105,160,214,211, 62,100,221,164,141,221,127, 47, 86,158,110, 53, 45,173, 74,108,202,150, 58,
-245,169,235,240,234, 92,108, 46,165, 25, 67, 41, 13,217, 42, 85,122,252, 0,255, 0,155, 86, 49, 13, 2,161,203, 54,179, 69, 70,
-229,117,175,231,212,150,189, 41,191, 17, 40, 68,164,158,157,126, 30,193,163, 50,165, 56,199,106,163, 13,164, 39,231, 0,116,109,
-159, 85, 38, 96, 90, 21,105, 70, 42, 96,137, 12,153,200,148,168, 97, 95, 78,152,101, 9,146,164,122, 16, 86, 10, 1,248, 70,163,
-222,186, 83, 27,188, 13, 62, 34, 97,169,116,175, 90, 98,157,149, 85, 36,218,106, 62, 57,238, 54,121, 77,188, 49,171, 78, 84,187,
- 74, 44, 78,220,102,200,251,176,166,108,107,203,142,160, 69,128, 30,219,238,107, 15,196, 68,137, 6, 72, 86,196,236,216, 70,229,
- 13,114,143,253,199,125, 15,254, 92,108,160,248,242,252, 63,110, 60, 35, 8,247,166,203,196, 26, 73,107,124, 52,212, 75,148, 96,
- 13, 83,157,230, 49,114, 45,212,234,208, 93,145,224, 64, 69,203,138,213,160, 12,142,159,163, 94,133, 50,215, 54,211, 91, 22,135,
-171, 69,226, 81,105,172, 12,250,191, 94,135,137, 67, 72,161, 17, 21,110, 29,168, 77, 73,233,208,105,169,110,155, 8, 87, 26, 92,
-112,153, 10, 54,148, 81,101,125, 67,170, 64,248,127,205,170, 57,121,154, 8,202, 45, 90, 71,179, 72,240,169, 70,209,100, 71, 98,
-136, 42,167, 95,135,228,213, 76,220,219,142, 25, 85,148, 91, 0, 76,107, 85, 89, 18, 23,243,186, 15, 64,254,141, 3,206, 1,161,
- 17, 77, 27,121,111, 89, 85,194,141, 55, 99,232, 20,147, 79, 95,127,232,212,115,205,186,253,225, 74,118,194,216,242, 52,187, 29,
-129, 29,176,149,144, 72, 29, 63, 42,107, 41,185, 95, 54,237,218,128, 74,182,181,183, 48,132, 90, 13,213,142,164, 30,237, 84,151,
- 84,246,178,154,151, 23, 79, 80, 59,180, 69,213, 99,110,202,102, 72,148,164,172,245,167, 90,232,193,171,102, 70, 18,183,143, 47,
-114,135, 90,154,143,203,179, 68,180,151, 49, 41,235,107,127,160, 36,122, 14,140, 26,131, 43, 41,208,219,213,161,210,193,168, 47,
-141, 40,111, 20, 1, 93, 24, 52,214,138, 1,201, 53,233, 64, 15,231,210,129, 90,113,145,105,160, 20,232, 29, 43,211,183, 69,141,
- 58, 26,181,171,143,141,166,157, 5, 52,182,138, 1,152,211, 98,115,133,100,247,141, 78,140,233,169, 45,109, 55,166, 10,138,119,
-211,167,175, 78,248,148,243, 89, 64,219,108,151, 11,179,225,152, 81,214,232,173, 92,122,155, 88,101, 29,234, 90,207,178,144, 61,
-122, 83,174,132, 33, 73,162,148,182, 48,174, 53, 63,226,184,117,182,194,219,114, 92, 64,153,115, 82, 82,125,225,196,213, 12, 30,
-255, 0, 5, 37, 34,157,127,104,138,252, 29,154,132,251,231, 79,150, 85,159,186,185,116,197, 6, 13,249,103, 79, 87,159,240,134,
-229,251, 9, 0,146,163,217,250, 52,209, 36, 84, 38, 48, 58,161,204,219,151,177,187, 3, 79, 69,147, 61,134,151,181,105, 90,156,
-112, 34,135,208, 43,164, 72,243, 32, 74,113,141, 13, 56,103, 84,167, 54,224,156, 27,205, 36,143,118,156,207,190, 32, 37,196, 25,
-140,246, 41,149,144, 74, 84,237, 10, 84,131, 64, 75,106, 5, 36,129, 80,105,168, 14,107,163,193,153,154,157,107,116,251,103, 40,
- 36, 38,116,164,199,150,158, 16,242,181,192,153,157,163, 2,183,192,180,220,100,219,174,204, 46,117,177,152, 81, 82,139,170, 16,
-176,176, 27,138,211, 44, 5,161,127, 57, 33, 27,171,218, 53, 26, 56,156, 30, 11,220,175, 95, 69, 78,220, 47, 95,184, 5,145, 75,
- 83, 50,171,237,225, 95, 33,156,187,158,114,206, 59,205,209,223,199,113, 88, 55,152,138,185,222,165,101,185,253,202,124,217,178,
-109,209,227, 32, 59, 22,221, 14,218,195,233,136, 83, 35,117, 92, 83,236, 41,106, 82,246,182,226, 2,119, 39,121, 3, 68,141, 3,
- 32,153, 97,235, 90,176,178,182, 99,225, 85, 4,101,167,143,105, 40,163,181, 64, 29,121, 87, 74,191, 12, 46, 4,228,174, 66,229,
-219,255, 0, 43,102, 23, 55,161,241,214, 7,146,139,205,146,218,226,188,103, 37,223,167, 3, 38, 36, 38,149, 80, 2, 33,165,105,
-117,213,208,246, 33, 35,231, 18,155, 59,187,198, 91, 53,154, 71,123,234,170,121,237, 27, 62,166,240,200,215,210, 36,102, 83,210,
-191,151,230,208,111, 49, 74, 6, 53, 89,255, 0,175,196,180,230,138,204, 69, 36, 37, 73,235,223,211,183,243,105, 13,223, 37,212,
-164,209, 77,177,176, 4, 0, 82,163, 22,200, 75, 80, 90, 69, 21,220, 8,233,250, 53, 37,252,203, 43,134,147, 85, 78,229,230,176,
-234, 74, 91,105, 40,142,138, 14,131,190,131,183, 84,119,119,102,224,173, 88, 91, 90, 8,194, 86,202,152, 0, 61,105,211,242,238,
-213,105, 10,106,201,145, 81, 7, 38,160, 18, 66,250,254,143,205,160,134,167, 71, 10,138, 67,155, 45, 46,171,175, 83,223, 79,243,
-106,206,194,119, 91,185, 69, 46,107, 70,200,196, 52,138,180,165, 74,170,123,255, 0, 47, 70,186,126,215,125,226,176, 7, 28,107,
-152,111, 59,119,134,242, 90, 48,175, 3,126,174,186,184, 46,172,211,162,161, 60, 49,232,210, 53, 83,126, 29,108, 26,175,112,248,
-198,139, 93, 22,138,219,194, 26, 45,116,157, 21,239,132, 61,122, 26,232,104,175,124, 49,232,209,106,161,225,214,219, 7,163, 69,
-170,149,225,209,136,241, 28,144,180,132,161, 69, 21,246,149, 78,128,106, 29,229,243, 44,152, 92,243,232,169,150,118, 47,187,120,
-107, 69, 38,229,121, 35,248, 75, 48,102, 55,102,118,125,160,188,242,175,247, 70,228,161,180,216, 32, 50,130,175, 29, 77, 16, 92,
-126,170,162,118,182, 43,223,172, 6,231,189, 11,236, 9, 68,246,214,230,199,107,254, 94, 53, 16,173,226,122, 7, 77, 58,172,217,
- 61,155, 33,177,195,190,218, 38,183, 46,221, 53,175, 25,153, 65, 10,101, 42,111,210, 66,210,149, 38,158,177,172,147, 47, 91,114,
-166, 55, 7, 5, 35, 2,185,118, 85,221,163,226,187, 26,227, 32,183,164, 80,119,108,134,217,101, 66, 93,188, 93,109,246,216,142,
-120, 68, 74,155, 57,168,241, 10, 93, 32, 37, 94, 42,148, 27, 9, 59,135,181, 90,106, 4,155,156, 49,199,226,151,119,113,246, 42,
-132,205,112,202,149,127,186,218,237, 90, 62, 34, 70,176,189,193,173, 82,138, 79, 0,181,205, 14,107,243,155, 18,193,203,118,203,
- 61,151, 56,139,108,198, 48,235,155, 72,206,237,139,137, 9,246, 47,113,218,121, 72,144,212,123,130,159, 41, 66,144,144, 10, 8,
-232, 73,167,110,139,151,247,121, 55,152,155, 60,112, 17, 27,193,210, 92,161,221, 71, 74, 98, 15, 70, 24, 99, 92, 79,112,243,123,
- 78,230,109,163,238,197, 27,136,120, 40, 75,144,161,210, 65, 67,213, 80,197,199,241,130,226,100,220, 36,218,237, 24,101,246,101,
-201,230, 97, 61,101,182,155,147, 43, 47,111,125, 77,200,110, 84,128,128,196, 85, 33,160, 28,111,121,162,171, 74,141,109,108,182,
- 59,147, 27,164,184, 1,160, 56,133, 10,132,112, 32,102,122, 8, 11, 82,207,156,246,236, 99,156,232, 92,113,195, 28,194,241,232,
- 32,112,168,107, 59,252, 67,133,230,253,108,188,217, 50,108,199, 8, 93,155, 42, 97,215,228,166, 29,177,184,151, 92,113,215, 7,
-139,111,144,235, 83, 28,105,229,199, 31, 49, 74, 20, 61,227, 80,223,103,120, 36,115, 96,100, 82, 53,204,238,174,176,224,228,192,
-144,153, 46,117,131,220,188,220,184,184,187, 75, 83,220, 92, 48, 67,143, 7, 98,132, 14,154,185, 79,126, 42, 92, 44,255, 0, 37,
-227, 60,103, 8, 75,186,195,151, 96,129, 47, 32,204,219,149, 29, 86,248, 23,121,202,109, 9,140,218, 90, 90,210,225, 74,156, 1,
-197,238, 0, 26,247, 13, 87,218,236,219,133,189,185,146,241,141, 18,107,210, 3, 20,168, 69, 84, 33, 71,101,116,253,167,205, 56,
- 96,154, 56, 46, 25,169,216, 7, 57,152,180, 19,208, 62,122,185,112,185,171,142,238, 25,157,195, 0, 70, 75, 9,156,170,221,111,
-141,118, 93,186, 98,189,208, 74,183, 75, 64,113, 47, 71,113,202, 55, 33, 33, 42, 5, 69, 4,211,191, 72,108,110,115, 60, 65,139,
- 85, 48,224,122,250, 43,177,218,115, 37,141,221,195,237, 25, 43,124, 86, 0, 72, 56, 96, 66,225,192,245,244, 83,233,201,173, 58,
-210, 93,101,198,222, 66,211, 84, 45,165,133,161,105,244,130, 42, 14,148,199, 17, 90, 0, 67,130,138,108, 78,146,176, 9, 73,235,
-232, 3, 83, 24,229,163, 0, 12,105,137,117,185, 34, 27, 78,202,150,180,177, 29,176, 75,143, 58,118, 54, 13, 9,165, 77, 58,144,
- 13, 6,167,194,139,137,168,243,220,136,193,197, 42,156,220,188,220,225,234,188, 99, 12, 89, 45,207,220,241,156,186, 30, 92, 45,
- 57,124,233, 77,217, 44,142, 94,177, 68,168,173,130,244,130,150,144,149,173, 5,186,184,164,154,210,137, 32,215, 84,187,151, 58,
-216,109,130,225,154,203,167,128,179, 92, 77,107,139,192,121,192,160, 4,144,115, 86,168,233, 34,177,119, 28,223,111, 27,154, 23,
-222, 84, 36,128, 20,117,213, 88,135,248,128,100,153, 85,246,239, 99,193,241,124,102,229,112,110,220,187,133,148, 79,186,185, 26,
-215, 49,232, 5,209, 49,130,234,208,195,165, 44,161, 27,139,129, 52,175, 64, 72,235,168,155,167, 51,221,109, 48,182,226,233,158,
- 20, 69,233,145,115,195, 72, 26, 9, 0,144,174, 39, 44,211, 49, 89,103,249,130,178,104,107, 90, 71,110, 29,139,244,210, 79, 27,
-126, 36, 13, 95,222,202,221,207,109, 31,112, 61, 99,183, 78,103, 24, 70, 63, 0,187,138,229, 55,212, 26,183, 30, 76,219,131,236,
- 24, 36,161,183, 10, 94, 10, 40, 61,148,173, 1, 61,219,114,221,246,201,173, 95, 0,138,104,158,225,226,176,148,150, 56,206,111,
-104, 96,118,178, 9, 29,212, 7,137,195, 38,109,249,241,243,191, 84,157,208,214,158,232, 11,168,240, 10, 72,210,157, 56,213,159,
-227,111, 59, 60,105,149, 93, 34, 99,153,179,176,184,227, 37,186, 75,141, 22,201, 2,237,122,143, 54, 61,220, 74,105, 46,165, 72,
-125,146, 91,106,137, 88, 7,196, 35,175,126,182, 91, 94,227, 22,243, 19,165,135, 82, 49,117, 43, 72, 68, 36,113, 24,226, 43, 81,
-182,115,140, 55,100,178, 78,227,213, 16,145,243,213,209,183,202,135,113,140,204,200, 50,163, 77,137, 33, 1,198, 37, 68,125, 50,
- 99, 62,217,236, 82, 22,130,164, 40, 31, 72, 58,156,169, 90, 95,140, 18,181, 65, 90, 71,204,242,171,254, 25,102, 77,254,198,196,
-103,149,111,146, 22,235,179,172,114,111,214,200, 74,117, 42, 74, 28,146,212, 70,221,121, 45,239,160, 43,216,105,172, 7,153, 59,
-131,182,205,181,239,141,117,184,128,141,145,145,188,183, 51,160,188,128, 79, 72, 4, 20,202,179,155,206,231,240, 81,153, 21, 19,
-138, 40,244,165, 50,221,229, 62, 67, 23,152, 18,150,246, 18, 57, 89, 88, 69,223, 47,141, 5, 48,231, 12,121,120, 90, 30,130,151,
-218, 92, 95,112, 14,170, 82, 95, 83, 65, 13,109, 42, 9, 42, 59,197,104,124,174,207, 49,121,124,216, 62,251,225,102,248,209,116,
-203,127, 19, 80, 85, 45,145, 28, 31,226,166,148, 5, 78, 69,201,221, 41,134, 75,249,187,124, 95, 27, 15, 27, 70,164,239, 38,156,
-147, 37, 94,175,109, 92,240,208, 58,250, 20,100, 74,137,166,183, 12,110, 52, 29, 79,193,164, 25,147, 26, 2, 50,105, 89,139, 73,
- 90, 55, 40,210,189,159,149, 53,158,188,230, 6,219,185, 5, 90,219,237, 70, 80,166,149, 89,136,212, 68,123, 35,218,237,169, 21,
- 39,243,107, 29,185,111,111,189, 37, 78, 21,161,178,219, 91, 0, 65, 90,169,192, 79, 85, 31, 71,102,168, 76,149,118, 26, 27,194,
-189, 78,206,227, 93, 22,186, 10, 77, 10,148,246,158,218,104,107, 90, 11, 94,169,107, 2,189, 0, 3,179,179, 68, 93, 72,210, 13,
- 34,201,184,236, 81, 27,187, 63, 47, 70,144, 93, 82, 25, 2,210,113,187, 82,166,181,245,126, 67, 73, 46,167,133,189, 34,220, 39,
- 33,208, 74,122, 30,254,191,209,164, 45, 76,130, 18,218,102,201,115,114,137,175,126,157,107,170,205,140,161,225,118,131,235,209,
-151, 82, 36,109, 62,237,135,216, 29,105,217,162, 14,170,249, 91, 78,118,151, 64, 58,247,105,107, 81, 28,213,175, 20,233, 39,183,
-166,148, 13, 35, 69, 2,181,250, 14,157, 24,210,218,218, 4,169, 68, 26, 29, 24,198,143, 42, 5,110, 41, 34,132,131,165, 12, 40,
- 96,227, 73, 50, 13, 66,169,211,209,167, 67,169,230,210,141,191, 27, 47, 52, 46, 87,167, 13,186,214,145,189, 42, 85, 4,153, 96,
-119, 54,138, 19,212,126,209, 20,212,121,239, 27, 0,166,164,186, 12,238,183, 23,123, 7,111,201,105,245,141, 73,142,237, 91,129,
- 28, 70,181,178,176, 99,178,158,190,247, 36,208, 7, 28, 36, 13,199,167,193,232, 20, 26,169,109,195,174, 95,142, 93, 21, 2, 96,
- 93,139,142, 63, 69, 73,237, 32, 54,217,112,154,157,165, 74, 81,236,232, 62, 13,105,173,173,195, 89,175,141, 82, 72,253, 69, 56,
- 85,114,230, 30, 86, 70, 53,109,148,220, 69, 37, 82, 3, 75, 29, 59, 19, 81,222, 72,237,248,245, 26, 66, 73,198,150, 8, 29,214,
-215, 11,121,171, 47,204, 57, 63, 34,126, 19,183, 7,162, 88, 24,144, 85, 41, 12,186,166,220,150,178,122, 32,169, 38,180, 61,244,
-237,210,227, 1,129,106,238,204, 54, 0, 9,196,215, 73, 60,133,102,248,230, 25,196,151,156,118,241,114,247,140,131, 27,203,239,
-150,247, 27,152,245,103, 51,111,144,164,202,136,128, 20, 2,182, 6, 31, 27, 59,169,211,187, 80,173,229,212,243, 32, 11,250, 41,
-123,204, 96, 57,160,224, 28, 1,237, 81,245,213,102,243, 81,202, 86,217, 55, 94,106, 79, 27,100,152,173,135, 25,146,221,138, 86,
-123,239,205,189,114,136,247, 45, 72,109,104,255, 0,213,236,176,243, 40,247,167,173,200,142,171,134,245, 80, 4,176,105,185, 75,
- 37,153,173,204,178,181,200,125, 31, 46,218,155, 97,127, 29,189,177,108,205,212, 73, 70, 3,254, 81,153, 39, 48,133, 17, 58,235,
-143,113,108,248,237,250,229,114,148,236,152, 87,183,193,109,171,132,167, 98, 34, 57,126,225, 25,180,133,188,218, 5,124, 48,225,
-233,182,167,179,180,235, 71, 4,142, 99, 64, 53, 65,113,114,230, 59,186, 52,142,129, 87,227,201,191, 42, 91, 56,135, 35,190, 99,
-215, 39, 3, 24,198, 72,109,107,125, 72, 63, 71,108,184,182, 84,211, 78,237,238, 11, 11, 8, 95,254, 78,159,120,241,154,167,133,
- 21,181,225, 99,187,217, 26,236,189,182,237, 30,108,118,101,197,121,183,227, 72,109, 46,178,243, 74, 11, 67,141,168, 84, 16, 71,
-110,153, 0, 10,183,212,180,226,143, 50,180,162,168,125, 63,144,208, 45,165, 7, 83,142, 44,205,201,234,122,142,255, 0, 79,230,
-211,101,180,135, 49,104,202,167,157,164, 87,210, 43,249, 13, 36, 49,105,135, 66,133,105, 38, 77,193, 77,214,138,175,109,127, 42,
-105,198,198,180,244,113,131,141, 33,187,112, 82,137, 85,123,251,191,205,167,155, 24, 21, 53,161, 40,153,154,189,244, 29, 71,102,
-164, 70,193, 76,206,252, 40,251, 47,110, 0,252,116, 58,184,183,184,116, 57, 26,161,184,183,108,217,209,148,186, 43, 67,249,126,
-109,105,109,119,124,129,172,173,230,204, 10,145, 70, 82,186,211,211,171,232,222, 37, 10, 43, 47, 60, 38, 7, 33,161,211,215, 70,
-112,166, 18,182, 3,242, 58, 73, 52, 97,171, 66,132, 15, 64,249, 52,141, 84, 90, 43, 10, 7,163,243,104,106,163,209, 65,237,169,
-160,244,233, 69,225,161, 77, 40, 71,168,160,164,252,219, 36,141,136, 98,146,230,174,231, 10,206,250,208, 90,139, 50,106,219, 75,
- 66, 82,129, 32, 4,186, 82,151, 9,165, 2,107,174, 73,204,187,169,123,222,224,224,141, 5, 23, 1, 91,187, 56, 99,219,173,188,
- 73, 28, 27,214, 83, 63, 77,115,219,144,188,250,221, 98,226, 55, 54, 48, 75, 13,178, 30, 87,106, 17, 25,202,100,101,211, 91, 77,
-158, 28, 55,228, 52,194,148,218,218, 67,172, 43,122, 86, 87,237, 45, 52, 3,174,185,110,227,123,105,190, 58,217,146,120,132,185,
-235, 27,153,128,212,208, 85, 84,130,133, 19, 35,157, 98,183, 95, 52,153, 30,136,109,162, 37,238, 41,168,145,164,124,134, 53, 83,
-121, 47,207,189,151,140,108, 10,180,216,110, 18,165,101,209,219,203,159,185,206,134,194,133,142,241, 98,190, 53, 29,108, 73, 75,
- 97,199, 89,125,209, 35,120,100, 39,230,131,211,161,214, 95,147,249, 83,124, 27,132,243, 50, 66,216,102, 44, 30, 25, 32,232,112,
- 36, 57, 26,128, 53,186,120,130, 9, 57,227, 88,189,195,159, 78,202, 31, 28, 8, 30,117,174, 96, 16,228, 66,153,102,168,107,151,
-188,197,248,135,102,249,238, 39,143,241, 99,118,247,173,184,107,145, 39, 61,117,109,111,169,235,157,193, 83, 93, 90,221, 65,116,
- 20, 45,182, 82, 2, 72, 73,235, 94,135,166,189, 25,177,114, 7,242,224,101,184,148, 72,232,220,177,224,154,114,237, 82, 74,215,
- 31,223,185,138, 77,230, 8, 89,114,237, 94, 11,137,105,232, 39,167,165, 56, 87, 63,159,230,187,253,183, 32,187,146,139, 52,168,
- 76, 20,197,110,219, 62, 48,125,198,218,120, 81,183, 80,167, 18,224, 20,173, 77, 1,239,215, 68,254, 83, 13,196, 45,197,192,230,
-163,218, 48, 74,204, 77, 43, 94,141,199, 28, 84, 84,108,215, 39, 74,201,126,251,159, 54,117,195, 29,176, 68, 68, 72, 51,101, 90,
-163,120,240,213, 33,211, 68, 41,247,146,134,246,151, 18,213, 16, 7,109, 41, 77, 77,146,201,150, 5,140,104,107,228, 42, 64,113,
- 66,131, 52, 4,156,151, 30,218, 83,174, 30,198,119, 59,192,102,122, 22,152,233,231, 9,247, 24, 99, 31,184,189, 21,232, 86,249,
-175,190,212,167,223,116, 61, 33,192, 78,197, 47,111, 66, 64,165, 42, 53,100,118,145, 3,252,102,170,144,136, 0, 65, 72, 23, 1,
-167, 80, 56,154, 63,103,229,251,152,184,197,118,117,214, 84, 22, 34, 60,195,145,137,132, 36,167,194, 65, 81,220,148, 44, 2,177,
-212,142,221, 57, 54,212,192,195,225,180, 18, 65, 92, 83,218, 50,169,240,223, 22,128, 9,174,131, 98, 62,110,216,178, 69,199, 16,
-187,222,111,150,198,188,202,125,156,181, 23,139,188, 53,173, 79,248, 73, 98, 59,150, 69,190,135, 93,136, 3, 97, 40,121, 14,130,
- 13, 40, 58,107,153, 93,242, 92,151,210, 75, 32, 17,198,246,180,104, 45, 14,201, 84,137, 17, 3,186, 65, 30,154,156,237,201,197,
-193,250,203, 95,142, 33,125,184,226, 15,162,167,222, 57,243,149,202, 60,113,147,170,123,124,191,126, 79, 30,177, 21, 89, 5,178,
-203, 47, 35,105,246, 60, 22, 93,218, 34,182,151, 26,117,148,173, 46,146, 11, 41, 69, 10,122,210,154,143,117,182,190,120, 24,198,
- 68,179,131,164,247, 73, 25,102,113, 5, 19,138,224,107,109,179,249,141,185,109,218, 4, 83,188,233,251, 36,171,125, 68,229, 83,
- 22, 63,248,178,115,118, 79, 58,228,194,239, 86, 43, 20,104, 11,102, 68, 36, 92,177,136,114,238, 23,152,207,190,150,246, 32, 52,
-235, 77, 13,169, 53, 83,128,251, 34,164,141, 61,184,236, 76,218,152,215,185,154,149, 65, 32,184, 6,144, 23,136, 39,176,113,173,
-247,245,147,121,126,146,209, 17, 43,142, 9,135,166,152,252,185,231,247,145, 50,249, 23,152,207,242,221,166, 87, 29,230,143,218,
- 97,220,120,225,168,201, 68,187, 93,203, 23, 37,211, 54, 35,232, 71,134, 16, 95, 72, 10,163,129, 74,238,168,214, 74,126, 75,139,
-127,150, 25,231,134, 70, 92, 66, 28, 99,144, 56,134,233,144, 38,151, 55, 5, 41,210, 8, 29, 70,169,183, 63, 50,183, 29,193,178,
-182, 98, 64,195,186, 48,110,121, 97,143,166,170,229,207,156,108,249, 69,198,254,132,114, 13,146, 28,107, 10, 44, 46, 98, 86, 8,
-152,202,221,189,228, 87,112,166,214,168,170,114, 25,240, 35,199, 62, 25,222,242,201, 79,239,244,213,108,188,171, 54,196,216,157,
- 29,179,220,231,151,248,143, 50, 13, 12,106, 30,250, 63, 23, 59,253, 35, 30,138,171,183,223, 33,184, 14,153,239,210, 66, 16,215,
- 13, 74,122, 58,129,233,225,198,151,175,188,155,109,103, 60,132,152, 89, 70, 33,111, 98,231, 18,217,110,200,238,104, 67, 47,221,
-108,246,171,245, 87,113,110,222,210,200, 75, 74,100,141,138,121,110,251, 84,246, 69, 14,170, 99,219,231,221,236,139,229,142, 71,
-190, 53,115, 65,118,150,189,204,253,217,122, 1,129, 31,100, 55, 14, 38,163,110, 91,172, 87,174, 93, 77, 76, 23, 20,199,171,178,
-151, 25,205,108, 83,177,220,147,152,243, 86, 37,220, 45,106,184, 28,103, 20,131, 49, 47,200,133,159, 88, 45, 46, 58,143, 10,230,
-155,124,136,206,192, 5, 9, 74,217,117,180,172, 21,116, 39, 73,181,181,115,223, 14,197,103,166, 25,195, 76,210, 72, 51,137,206,
- 0,143, 12,189,174,107,202,168, 33,201,134, 34,173,236,111, 98, 16, 27,137,156, 73, 82,139,136,127,106,100,156, 18,171,146, 46,
- 86,156,154, 78, 77,148,202,200,236, 56,129,177,218,156,190,219,112,235,188,167,110, 87, 41,238,248,155,154,136,220,137, 36,184,
- 14,212,212,135, 29, 53, 29, 0,214,237,155,149,198,213,224, 91, 54, 41, 39,241, 36, 13,116,205, 1,173, 24, 98,226, 27,135,169,
-163, 30, 53, 87,107,189, 9,245, 61,231, 73, 82, 64,205,122, 22,175,143,146, 63, 58,249,158, 27,119,199, 45, 89,167, 36,109,227,
-164, 90,231, 90,161,227,146, 44,181,177,218, 47, 50, 36,132, 91,225,174, 96, 66, 76, 70,126,144,173,111, 85,123, 19,221, 65,161,
-204,215,142,216, 68,239,183,133,207,127,188, 70,165,115,128, 97, 46,115, 24, 78,106, 16, 52, 38,163, 91,238, 94,231, 87,192,230,
-137,100,253,154, 16,136,128, 21,192, 19,209,215,192, 87, 74,252,199,230,188,136,246, 31, 43, 53,195,185, 1,135,120,230,240,204,
-184, 57, 20,140,118, 99,217, 75,118, 75,147, 75, 66, 21, 17,180,194,117,150,165, 70,115,105,220,181,170,157,157, 5,117,202, 71,
- 47,127,238,246,150,187,134,225, 44,211, 68,215, 7,134,152,153, 25, 97,114,227,160,130,246,150,100, 74,246, 85,191, 48,222, 92,
- 92,199,227, 71, 33, 49, 28, 28,152,227,209,134, 99,165,107,140, 46,114,223, 47,158, 83,132, 21,203, 16,149,110, 78, 59,115,200,
- 26,123, 99,222,232,212,101,202,136,135, 33,123,167,189,120,254, 35,136, 74, 21,224,120,244,246,105,234,212,182,242,198,197,240,
-206,255, 0,181,122,120,205,140,185, 6,163,131,146, 69,210,152, 99,222,211,153,174, 99,252,242, 95,137, 93,103,212,126,101, 84,
- 78, 11, 95,105,233, 79, 81,211,167,230,215,123,115,171,182,165, 40,197, 98,170, 10, 40,168, 30,174,159,163, 84,251,141,216,141,
-164, 46, 53, 58,210, 13, 69, 82,151,183,237, 0, 10, 10, 14,202,107,155, 93,200, 75,142, 53,173,133,129, 5, 20,144,248,167, 93,
- 65,115,170, 91, 27, 73,170,125,180,159,108,246,250, 6,145,170,164, 54, 50,107, 84,202,100, 42,181, 58, 26,233,207, 8,209,193,
- 57,160,138, 36,129,233,252,169,161,170,155,240,122,104,147,210, 67,181, 74, 85,221, 93, 13, 84,243, 99, 13,166,172,247, 10, 10,
-189, 58, 34,234,177,138, 53,166,179,243, 84, 42, 1, 58, 25,212,214, 66,180, 68, 74, 46, 18, 13, 65,233,161, 79,182, 36,173, 54,
-149, 30,202,130,116,107, 78,229, 74,240,218, 29, 42,105,215,209,219,160,181, 26, 74,116,196, 80, 64, 29,123, 41,165, 10,131, 32,
-165,198, 93,175,193,232,211,130,163, 56, 80,197, 93, 61, 26, 88,194,155, 74, 44,167,168,106, 58,252, 90,117,162,148, 90,162,188,
- 75,164,215,165, 43,221, 77, 60, 27, 76, 60, 1, 90, 56,195,135,214, 85, 64, 18, 58,147, 95, 64,209,101, 74,108,131, 42,117,219,
-236,209,109, 17,126,243,189,180,195,203, 90, 55,177, 5,246,201, 13, 14,208,181,215,161, 62,132, 17,240,234, 29,205,207,133,150,
-117, 26, 91,131, 47,117,133, 7, 79,208, 62,186,136,243, 92,219,223,174,113,160, 33,224,144,252,150, 88,101,180,171,102,225,217,
-213, 33, 52, 74, 82,159,131,228,214,126, 73,117,149, 52,184,163, 13, 21, 40,227, 50,152,101,248,144, 88,112, 60,166,219, 74,157,
-117, 41, 0, 21, 47,180,164, 1, 64, 40, 40, 14,165,217,142,240, 2,152,152,174, 52,243,202,111,133,136,107,141, 29, 91, 81,225,
-213,213,237, 37, 84,167, 64, 6,221,107, 12,189,208,209,149, 83, 22,105,199,141,115,155,157,110, 82, 39,181, 33,152,202,241, 10,
-142,213, 10, 19,209, 93, 43,209, 58,135, 35,177,163,129,138,106,157,185,133, 46, 57,102, 66,224,188,182,210,180, 63, 33, 97, 36,
-130, 65, 4,213, 95, 6,137,210, 32,169,236, 92,170,156,249,218,227,238, 44,201,167, 98,220,141,141,115,109,215,133,249, 83, 22,
-178,207,179, 95, 44,102,227, 62,219,137,242,134, 55, 47,115,204,183, 41,184, 82,162, 23, 94,183, 72,117,239, 1, 85, 81, 27,212,
- 8,161, 26,168,219,175, 46, 54,153, 30,211, 31,137, 27,138,225,192,250,141,116,123,104, 32,222,237, 88, 21,160,176, 6,146, 81,
- 66,118,166, 4,113,174, 84, 89,243, 94, 77,147, 22, 55, 24, 89,114,120,183,156, 66, 21,226,235,119,132,152,112,158, 10,135, 46,
-240,224,118, 66,203,206,184,226,164, 41,199,138,148, 20,233,220, 1, 3,168, 26,216, 68,241, 48,214,230,105, 39,174,179, 59,180,
- 48, 64,240, 68,154,156,208,132,162, 12, 50, 76,126,110,218,186,124,109,199, 23, 75, 14, 61, 29,218,189, 38, 66,155, 47,203,125,
-234,184,242,150,225,169, 82,141, 58,144,123,116,220,151, 1,107, 19,123,122, 30,250,121,193,102, 67, 79,221, 90,125, 84, 47, 54,
- 90,222,158,196,182,160,162,131, 74,126,201, 0,254,125, 73,138,112, 82,145, 28,224,165, 92, 15, 43,222,111,102, 98,238, 39, 19,
-203, 36, 61,118,181, 52,191,118,100,151, 0,145, 16,167,160,216, 84, 40,125, 96,145,167,229,181,208, 65,201,167,210,157,117,116,
-217,252, 54,224, 23,160, 87, 72, 33,249,155,226,242,227, 13, 73,184,206,134,183,138, 1,247,136, 43, 72,103,120,173, 84,125, 30,
-189,110, 45,124,178,220,239,225, 23, 22,193,146, 70, 66,130,215, 2,191,167,170,177,119, 30,103,109,150,115,120, 19,248,140,120,
- 40, 67,154,112,253, 29,116,183, 55,205, 31, 21,218,146,246,203,195,211,156,105,178,180, 38, 44, 85, 41, 46,170,134,137, 4,129,
-169, 54,126, 81,239, 55,100, 44, 65,160,158, 36, 97, 76,221,249,183,179, 91, 3,166, 66,226, 6, 8, 14, 53, 16,191,231,118,212,
-148,202,174, 48,254,240,229, 35,210, 88,218,182,235,251, 94,205, 65,166,183, 99,200, 73, 73,111,253,192, 68,199, 10,196,143, 61,
- 24, 65,255, 0,182,197,112,239,124,244,230,199,252,224,113,181,245, 76,177,115,114,117,138, 83,138, 8, 88,146,215,141, 29, 4,
-255, 0, 26,123,189,116,213, 22,231,228,158,235, 96,174,135, 76,141, 29, 5, 15,168,214,167,105,243,139,109,188, 65, 48,116,110,
-235, 10, 61, 98,167,107,110,113,136,222, 26,109,251,126, 71,104,146,203,136,222,146,153,205,131, 79, 88, 42, 4,107,156, 93,242,
-229,245,139,139,101,130, 64,127, 84,215, 71,182,230, 43, 27,214,135, 71, 60,100,126,176,165, 39,114, 76,114, 50, 3,175,223, 45,
-109,165, 95, 53, 74,158,216, 7,255, 0, 59, 71,109,179, 93, 76, 81,177, 60,159,213, 63, 85, 70,189,223, 45,162, 10,101, 98,126,
-176,166,213,215,152,120,238,193, 29,199,230,229, 22,197, 6,234, 11, 81,159, 18, 94, 37, 61,193, 41,169,214,150,199,145,247, 59,
-247, 6,178, 7,246,144,131,219, 89, 75,238,121,219,108, 26, 92,249,154,122,129, 83,236,168,139, 52,243, 91,133,219,237,138,254,
-233,188,229,222,236,237, 18,210, 86,202,154, 97,138,138,238, 81, 35,173, 61, 26,221,236, 30, 83, 94,205, 40,248,192, 25, 24,235,
- 82,107, 13,191,249,175,105, 20, 68, 89,171,164, 61, 33, 0,169,191,141,185, 42,211,154,227, 86,171,170,167,219,218,184, 73, 97,
- 30,249, 9, 50, 82, 28,102, 71, 97, 78,210,119,117, 62,173, 67,220,118, 57, 54, 43,151,193,165,197,128,224, 83, 49, 78, 88,111,
-177,239,182,204,152,185,161,228, 98, 20, 96,106, 90,101, 65,194, 5,122, 26, 83, 85,183, 18, 8, 66,212,235,104,140,197, 41,122,
- 44,118, 20,176,149,170,189, 43,249,116,214, 47,112,230, 7,198, 81,149,174,179,216, 90,230,106,118,116,162,226, 98,162,168,216,
- 5, 59, 21,219, 95,205,170, 33,190,204, 28,164,213,195, 54, 72,222,220, 0,162, 1,132, 58,231,179,214,157,104, 63,205,171,152,
-249,160, 53,136,236,234,186,126, 89, 33,218,129,238,208, 83,164,219,236,177,132,187,138,210,211,107,125,136,232, 52,170,212,244,
-133,132, 33, 41, 29,164,149, 30,193,170, 77,199,152,164,156,163, 14, 2,165, 91,237, 49, 90,183, 83,250,107,155,254,115,121,171,
- 27,178,218,115, 52,228,246,171,114,191,248,115, 62,212,140, 62, 27,217, 66, 20, 46,121, 53,241,148,248, 11,185, 66, 98,142,169,
-131,237,144,216, 33, 64, 10,214,167,167, 0,187,190,221, 57,179,113,100, 54,242, 65,240,205,113,241, 3,154, 73,123, 66,133,140,
-156, 11,154,161,115,106,246, 86, 7,157,119,102,188, 62, 57, 24,211, 20,100, 34,184, 98,243,210,220,200, 78, 24, 87,207, 55,154,
- 31, 48, 22,140,231,145,229, 95,240,100, 92,113,252, 58, 28,171, 80,205,176, 28,126,208,139, 5,166,253,116,132,173,146,157, 67,
- 45, 56,179, 36,173, 84, 8,113,194, 85,235, 7, 93, 51,147,246, 25,182, 43, 31,131,186,120,153,238, 46, 49, 77, 35,181,150,135,
- 12, 56, 0,192, 63,202,220, 18,184,111, 48,243, 28,114,220, 15, 5, 4, 99, 18, 0, 0, 19,210,156,122,171,157,217, 55, 34,220,
-228, 95,175, 63,221,251,171,237, 64,118, 84,192,222, 43,116,148,224,149,106,130,228,133, 22,153,241,158, 10, 10, 81, 64,170,232,
-174,193, 67,174,173,177, 89,182, 48,209, 35, 70,173, 35,246,141, 1, 28, 64,196,128, 50, 11,151,178,185,238,239,126,217, 59,224,
-230, 78, 28, 71, 70, 60,126,138,132, 50,188,183, 45,207, 93,155, 14,215, 29,171,124, 11, 12, 20, 51,112,153, 13, 6, 35, 66, 59,
- 71,105, 11, 90, 0, 73,162,151,237,123, 93,117,185,181,100, 27, 99, 67,164, 42,231, 28, 1,196,173, 82, 54, 64,206, 42,180,222,
-183,220,222,179,196, 15, 99,241,225, 94,103, 76,142,251, 50, 83, 46, 90,103,182,219,172, 16,128,241, 65, 77, 18, 61,162, 69, 79,
-193, 93, 59, 60,127, 24,228,144,150,180, 16, 66, 4,244, 84, 55,221,146, 81,216, 5,168,202, 12,251,164,184,119,171,122,165,200,
- 48, 26,152,220,187,180, 97, 32, 70,182,200,145, 28,168, 35,113,166,210, 82, 86,173,130,157,250,181,185,100,113,201, 27,208,107,
- 68,105, 69, 32, 28,253,105,141, 43,226,220,194,139,129,225,210,148,222,201,102, 65,114, 86,251, 51, 98, 42, 95, 87,138,236,118,
-156, 50, 16,218,128, 30,205,118, 2, 79, 74,146, 5, 53,105, 6,160, 59,249, 81,155,128,231, 20, 9, 78,187, 5,254, 42,172,178,
-158,118,200,228,151, 25,140,235, 98, 74,174, 75,171, 82, 40,118, 56,202, 74, 84,148,237, 52, 42, 73, 7, 85,183, 54,242, 54, 78,
-228,136, 9,201, 7,168,210,133,208, 14, 1,212,123, 18,203,109,136,142,181, 94,156,140,220,184,138,241, 16,229, 22,153, 43, 41,
- 21, 0,237, 29, 78,234, 80,233,201,217, 34,164, 96,161,163,125,203,212, 34,209,236,123,145,152, 76,245,187,124,140,235,182,117,
- 58,183, 90,240, 2,158, 68, 87, 1,232,162,132, 41, 36, 14,189,149,211,211, 66,232,155,251, 50, 3,211,143, 31,101, 91, 50,244,
-198, 20, 28,106, 84,182, 93, 32,207,177, 69,200,167,230,208, 93,137, 10, 35,232,251,146, 81,147, 30, 66,253,229,223, 9,184,241,
-130, 3,145,247,144,162,225, 14,148,138, 87,169,214, 39,114,222, 37,101,193,181,138,213,250,139,135,124,105, 32, 32, 82,231, 42,
- 20,225,221, 83, 87,214,215, 3, 75,159,226, 5, 76,142, 10, 73,224,126,180,167,198, 67,127,196,103,241, 46, 39,118,123, 20,131,
-105,122,221, 43,238,167,175,141, 56,152,119,103,228,180,235,139,110,141,182,226, 76,198,212,144,106,224, 69, 83,211,218,214, 94,
-218, 75,200,183,137,216,201,220,246,184,106, 12, 56,176, 96, 1,196,142,225,255, 0, 74,227,209, 66,109,204,150, 0,231, 2,225,
-129, 8, 20, 99,154,253,170,126,112,126, 81,124,179,114, 21,227,147,184,174,199,122,200,172,248,246, 19,114,128, 96,207,181,177,
-121,148,211, 19, 34, 58,212,133, 20, 20,183,244,109,188,165, 44,185,212,129, 78,218,234,131,153,119,239,129,183,138,210,250, 88,
-226,158, 73, 81, 85, 27,158, 25,234, 26,139,112, 78, 37,106,101,133,251,173,166,116,182,173,212,192,211,129, 71, 21, 35, 21,195,
- 33, 81, 70, 33,203, 23,108, 62,229,116,207,103,227,109, 95,175,215, 41, 83, 49,129,109,184, 91, 66,236,198, 37,217,144,151, 16,
- 61,148,169, 43, 3,112,246, 84, 10, 69, 14,173,247, 61,142, 13,193,177,218, 53,225,173,106, 72,113,199,186,112, 62,188,106,146,
- 59,199,192,124, 80, 51, 40, 71, 2, 15, 10,151, 98,191,198,145,236,241, 89,228,108,231, 56, 93,130, 56,124,221,177,172,127,221,
-220, 86, 58,252,244, 40, 66,247, 86,158, 43, 68,146,219,169, 35,122, 87,223,212, 10, 29, 70,180,240,190, 38, 55, 91,198,211, 35,
-149, 94,132, 96,220,212,165, 90, 91,207,105, 10, 9,100,121, 24,168, 31,103,161, 56, 26,103, 60,238, 31,144,113,132, 38,237,119,
- 43,133,166,255, 0, 23, 41, 68, 86,160,223, 10, 31,189, 95,109,146, 92, 80,251,201, 96,184,146,223,187,178, 2, 11,109,165, 67,
-190,189,117, 99,252,198,107, 91,151, 48, 70,195, 3, 88,174,123, 79,218,224,192, 19,233,244, 83,191,204, 99, 54,202,215, 16, 67,
-184,230, 66,231,234,161,230,114,102, 93,142, 93, 12, 6,111,246,121,246,137,141, 91, 46, 23, 24, 54,134, 89,251,146,115, 86, 69,
- 4, 55,227, 50,160,210, 20,235,136, 69, 28,222, 42, 65,165,117, 6, 75,123, 93,244,120,242, 68,230,200,197, 99, 28, 65, 15, 26,
-135, 2, 20,160, 56,142,186,156,119,199,135, 1,169,174,110, 5, 56, 97,210, 48,196,140,235,160, 71, 55,230,107,103, 13,100,252,
-141,134,101, 86,220, 2,195,102,177,174,126,107,199,216,101,253,118, 8, 88,220,105,165, 17,154, 66, 97,221, 30,122, 52,163, 53,
- 14, 7, 84,212, 37,173,105, 61, 66, 64,215, 24,218, 57,165,155, 70,235, 22,212,100,158, 83, 43,139, 35,150, 86,248,130, 76,220,
-229, 49,180,105,210, 66,106,145,173, 7,166,180, 55, 27,253,211,226,123,237,136,136,180, 43,152,210,128, 14,160, 74, 21,232, 11,
- 92,247,254,246,226,135, 61, 51,213, 47, 51, 86, 14,152,105,190, 53, 52,221, 83,253,224,106,226,184,133, 78, 37, 63,234,251, 60,
- 7, 46, 41, 67,138, 37,157,222,200,161,237,215, 82,209,119,240, 72,144,252, 94,189, 30,233,209,167, 86, 24,106,247,131, 20,102,
-138,114,172,151,243, 39,106,213,168,228,170,191,163,166,191, 69,244, 32, 84, 15, 78,181, 50,200,129,107,214,140, 98,154,112,176,
-128,219, 99,176,247,235,157,238,183,102, 87,154,211,217,219,134, 52, 86,142,172,124, 20,233,172,236,146, 41,171, 86, 49, 41, 38,
- 67,201, 21,220,122,117,212,119, 58,166,199, 29, 32,190,253, 73, 41, 63, 6,147,170,172, 34,138,147, 23, 37, 66,164, 31,205,163,
- 14,169, 2, 32,104, 31,126, 90, 79, 85, 29, 41,104, 24, 1,173,189,252,158,194, 65,244,254, 67, 68, 77, 6,219,209, 9,114, 10,
-146, 74,149, 93, 16, 53, 45,145, 37, 55, 31,113, 36,158,163,228,211,162,164, 53,169, 69, 7, 83, 81,220,116,161, 78,229, 74, 13,
- 36,146, 63, 46,186, 61, 52,219,136, 20,166,209, 32,246,143, 94,148, 27, 81,158,105, 89,135, 84, 59,244,227, 91, 81, 30,148,175,
- 30, 66,137, 21, 58,119, 74, 84,103, 1, 74, 33,194, 71,110,150, 27, 77,225, 64, 45,246,217, 5,111, 45, 8, 66,106, 74,156, 80,
- 74, 64, 30,179,169, 49,194,100, 40,208, 73,234,166, 38,149,177,133,113, 0,116,154,108,220,179,236, 70,207, 26, 68,201,151,171,
-126,214, 1,220,211, 47,165,231,148,161,220, 18,154,146,117,161,177,229, 77,194,253,237,141,144,187, 30, 36, 16, 61,117,151,220,
- 57,174,194,197,133,239,157,165, 56, 2, 9,245, 83,199,136, 47, 7, 55,183, 74,203,156,181, 57, 22,208,212,215,162,217, 4,157,
-222, 44,245, 71,166,231,202,104, 0, 66, 15, 65,219, 83, 95, 71, 86,249,179, 99,111, 45,200,219,119, 73,174, 93, 42,224, 50,106,
-240, 90,135,176,243, 3,185,134, 55, 72,214,105,141, 80, 19,153, 20,173,158, 77,124, 52,248,109,117,125, 64,150,193, 37, 72,170,
-170, 58,146, 54,142,167, 92,234,233,197,199,174,180,241, 52, 55, 10,160,185,142, 80,140,119, 40,142,151,159,105,215, 86,232, 0,
-151,104,191, 25,202, 85, 41, 4, 3, 78,190,144, 15, 67,211, 80,116, 45, 78, 99,148, 85,143,225, 44,149,119,121,183, 98,243,137,
-241, 26,117, 13, 36, 5, 10, 54, 10, 71, 79,132,234,195,110,247,170, 29,214, 21, 50,103, 55,102,163,219,214,132,148,111, 40,160,
- 42,234,170, 1,212,142,159,159, 90,114, 16, 85, 68,134,169, 6, 72,219,119, 59,129, 96,211,115,210, 82, 2, 74,171,184,147,216,
-122, 87, 81,230, 8, 22,151,111,137, 74,155,167,241,197,158, 38, 13,244,141,180,169, 10,141, 83,177, 32, 45, 74,167,101, 72, 39,
-191, 80, 11, 75,177,169,178, 63,195, 21,195, 63, 58,156, 81,104,156,151,214,243,167,194,142, 74,154,138,164,238, 45,186, 77, 0,
- 61, 61,125,163, 78, 90, 93, 24,156,134,158,134,237, 70, 21, 82,248,151,139,109,150,171,123, 82, 24,183,161, 11, 90,183,239, 13,
-118, 45, 70,159,187, 94,193,171, 67, 57,144,170,213,101,253,201, 37, 42,227,217,224, 51, 14,210,168,238,160, 0,227, 69, 21,236,
- 61,148,233,211,209,210,186,106,103,113,172,172,242, 43,170, 2,205,228,166,199,113,125,164, 80, 63, 42, 33, 1, 13,138,149,128,
-146, 7, 74,119,210,186, 93,164,139, 78,193, 34,212, 43,199,140,174,125,241,111,133, 57,185,231,119, 41, 52,219,181,100,158,180,
-245,235, 98, 30, 28,192, 42,221,215, 69,162,174,236, 47,121, 16, 60, 25, 77, 45,217, 44,178, 28,142,241,170, 86,244,118,250,169,
- 52,161,169, 72,234, 62, 77,116,143, 44, 57,189,220,187,118,219,105,157,255, 0,109, 35,144,174, 77,113,201,221, 64,228,125,117,
-204, 60,197,229,214,239,246,198,226, 22,255, 0,220, 48, 40,255, 0, 80, 28, 59,122, 41, 37,251,251, 8, 72, 74, 86, 21, 81,210,
-159,230,215,177,160,180,215,141,121, 89,247, 68, 96,105,187, 38,242,143,219, 52,173, 79, 67,211,244,106,206, 59, 58, 64,190, 67,
- 73, 42,189, 50,151, 2,194,171,215,176,127,155, 79,252, 17, 53, 38, 59,244,165,136,249, 91,136, 20,106, 83,173, 3,211,217,112,
-167,244,106, 59,246,176,236,218, 42, 99, 55, 36,200,210,203,121, 27,239, 36,120,183, 25, 14, 37, 34,160, 41,229, 40, 15,128, 29,
- 49,252,181,173,201,131,213, 73,126,230, 79, 19,235,160,191,188, 41, 4,238,117, 75, 30,178, 78,157, 27,127, 85, 68,146,249,120,
-209,200,249, 36, 68, 13,213,246,129, 31, 15,232,210, 95,183,184,212, 83,118,180,236,181,102, 74,140,180, 59, 14, 99,209, 92, 66,
-146,164,169,151, 75,106, 10, 79, 80,122, 83,191, 85,151, 59, 80,120, 71, 0,123, 69, 57, 21,251,163, 42,210, 69, 88, 91, 23,154,
- 30, 74,183,198,143, 13,156,129, 47, 54,192, 74, 16,169, 44, 33,231, 74, 83, 74, 2,162,154,157, 96,247, 15, 47,108, 46,137, 46,
-143, 62,130, 69,108, 44,185,255, 0,113,179,104,107, 37,203,164, 3, 79,147,230,231,146,148,180, 20, 76,183, 55,183,105, 86,200,
-137, 33,123, 69, 58,214,189,189,186,202, 63,202, 29,169,202, 92,215, 31, 77,105, 7,155,187,176, 64, 30,208,157, 66,164,172,103,
-206,156,246, 33,134, 50, 59, 27, 23, 73, 73,112,147, 46, 43,222,236, 11, 71,210,157,164, 84,107, 27,187,249, 33, 20,207, 46,181,
-148,177,169,145, 11,143,109,107, 54,143, 60, 39,182,102,155,152,131,220,185,130,152,118, 84,191, 98,243,131,198,119, 2,148, 92,
- 85, 58,199, 32,169, 41, 1,246,188,118,212, 79,161, 72,244,124, 26,192,238,126, 76,110,182,216,197,166, 65,212, 80,251,107,160,
-237,158,117,109,119, 65, 39, 15,140,246, 40,246, 82, 7,155,124,239, 16,185,112, 20,235,231,222, 86,121,241, 92,153, 2,109,150,
- 73,156,235, 82,154,185, 67, 87,138,211,145,124, 6,220, 89,121,178, 43,180,211,229,215,159,249,220, 95,242,238,155,111, 5,193,
-239,126,135, 97,131, 65,204,156, 70, 5, 17,106,195,159, 57,138,206, 77,163,198,129,193,225,238, 26, 72, 56,131,158, 9,198,190,
- 97, 57,143,152,100,223, 49,151, 50, 27,149,242, 83,185, 93,166,248,221,202, 83,242, 39, 40, 75,202, 99, 23, 93, 74, 27,113,169,
- 37, 43,120,194,112,132,237, 80, 36,118, 17,164,236,156,188, 54,251,195, 12, 81, 1, 3,216, 64, 0, 97, 25, 64,164, 16,169,172,
- 99,215, 94,103,220, 55, 67, 57, 39, 81, 46,226,167,229,149, 82, 76,207, 46,200, 48,121,207,202,106,247, 98,186,220,114, 8, 49,
-239, 55,184,108, 41,187,132,235, 34, 28, 5,239, 17, 11, 0,198,108, 56,224,249,169, 93,123,138,117,175,178,182,139,152, 25,160,
-199, 35, 25, 27,139, 88, 74,180, 63,130, 17,239, 18, 7, 82,117,214, 47,117,104,105, 82,236,122,170, 7,147,204,246, 41,184,142,
- 87,105,119, 24, 74, 50,171,204,230,165, 68,201,209, 9, 47,136,112,208,165, 21,167,110,194,225,113,213,168, 0,170,128, 58,252,
- 26,214, 89,242,140,209, 95, 91,204,110, 8,133,141, 32,179, 82, 41,225,212,128,103,196,214,106,228,185,232,153, 14, 31, 46,138,
-138,147,114, 85,170,206,229,158,222,253,202, 85,234,237, 39,197,155,108, 40, 42,139,112, 83,201, 3,113, 35,170,105,182,164, 29,
-116, 71, 64, 46, 36, 18, 60, 52, 49,163, 3,196, 37, 68,124,165,167, 81, 32, 55,166,154,121, 53,170,116, 11, 76,155,171,118,118,
-109, 37,151,218,110, 65,133, 41, 76, 46,171, 3,216,217,216, 2,149,237, 84,234,210,202,225,143,112,102,189, 93, 11, 74,130, 65,
-113,145, 90,139, 93,185,200, 68, 82,212,116, 58,195, 15, 20, 23,146, 20, 8,113,226,123, 85,211,218,167,164,234,244, 64,215,157,
- 68,101, 74,115, 0,118, 56,208, 16, 74,161,169,169, 82,208,153, 8, 73, 82,203, 75, 86,210,165, 40, 26, 1,232, 7, 75,115,151,
- 1, 72,115,195,206, 20,118, 61,238, 99,211, 39, 45,165,152, 45,190,149,173,150, 99, 43,107, 9, 43, 0,109,160, 20, 30,207, 77,
- 54, 96,106, 13, 65,105, 18, 56, 70, 1,245,210, 58, 29,241,220, 42, 74,138,125,157,164,168, 84,158,159,181,208,247,234, 67,134,
-138,144, 31,162,140,120,190,238,242, 16,167, 8, 65, 9,173, 62,173, 74,236,168,233, 67, 74,234, 43,228,241, 66,129,141, 24,144,
-191, 10,155,172, 23,152, 22,124, 78,235,136,185,112,180, 72, 57, 68,140,122,236,204,228, 91,155,157, 54, 28,152,206,108, 83, 30,
-240,178,147, 21,173,139,222,186, 14,164, 14,237, 97,110,217, 60,247,140,189,108,111, 2, 32,246,150,234, 32, 16, 66,170,125,167,
- 40, 65, 82,137,110,157, 10,157,117, 54,251,177,229, 69,101, 80, 50,222, 90,198,226, 90,112, 60, 86, 61,206, 35,183, 56,205,198,
-118,224,171, 43,110, 54,220,104, 11, 78,226,234,212, 85,182,136, 85, 13, 69, 70,185,251,238,127,245,167, 65, 45,165,132,134, 73,
-229, 45, 33,164,144, 53,144, 75,158, 56, 14, 56,142, 20,119,183,143, 96,208, 9,112, 80,184, 98, 61, 61, 21, 13,113,246,121, 19,
- 19,157, 25,121, 3, 89, 44,108, 66,247,239, 17,174, 42,196,167,136, 55, 59,133,189, 59,155, 90, 2,214, 75,123, 86,177,244,129,
- 95, 22,180,220,199,176,191,122,107,190, 31,194, 55, 17,161,111,136, 21,173,118,106,131, 21, 3, 36,169, 22,210, 27,126,243,137,
- 13, 32,228,106, 91, 70, 81, 53,236, 2,237, 17, 28,134,204,251, 22, 85,123,139,122, 71, 30, 50,243,232,186, 91,228, 90, 20, 89,
-143, 34, 64,110, 59, 81, 87, 37,108, 37, 41, 10, 77, 74,135, 93,101,157,181,177,251,147,103,146,212,182,120, 99, 44,241,200, 26,
- 92, 29,139,154,213, 37,218, 87,129, 68,171,105,183, 43,137, 45,140,109,148, 24,222, 65, 49,142,172, 1, 32,113,249,234, 36,188,
-223,172,115,239,176,237,246,155,117,201,184,140,220,130, 55, 79,185,110,147, 61,197, 4,132, 33,237,141,182, 62,137,208,162, 13,
- 59, 15,167, 90,235, 43,121,161,182,115,230,115,117, 22,253,150,160, 3,171, 19,152, 74,167,150, 72,217,251,182, 16, 65,196,147,
- 78,185,140, 93, 98, 73, 78, 67,110,159, 14,240,222, 44,221,185,119,134,164,211,223,237,206, 56,181, 35,195,240,158, 0,190,148,
-158,158,197,123,142,168,224,154, 55, 15,135,145,133,134, 82,237, 9,238,185, 2,170,140,143,109, 56,158, 48, 15, 99,149, 6, 53,
-182, 67,126, 68,224,213,237,139, 83,115, 45,115,224,248,147,227,173, 38, 35,238,203,108,123,107,119,194,160,170,148,119, 4,160,
-142,238,205, 61,183,217, 58, 16, 97, 50, 22,200,215, 96,115, 9,192, 5,232,201, 77, 60,251,189,110,107,208, 34, 39, 70, 61,125,
-116,191,144,243,146,243,110, 63,178,241,186,240,203,101,190,124, 91,236, 39,237,185, 36, 59,188,232,139,131, 1,182,146,199,186,
- 72,138,167,140, 23,146,181, 36, 57,226,173,191, 17, 38,180, 81, 26,172,219,249, 44,236,123,132,155,144,185,123,163, 49,184, 58,
- 50,198, 16, 92,171,169,174, 77, 96,240,210, 14,147,209, 86, 15,222,153,119, 1,131,193, 26,245, 2, 36, 87, 42,100, 90, 70, 73,
-199,170,157,238,114,214, 68,236, 72, 92, 62,172,163, 22, 30,227,134, 92,248,237,139,242, 97,219,147,108,114,197,116,155, 18,232,
-238,251,168,136, 36,169,104,126, 27,108,163,114,138,128, 42, 72, 80, 74,148, 13, 3,121, 82,213,143,118,244, 45,229,239, 78,217,
-203, 22, 77, 90,218,199, 70, 18, 61, 90, 80,181,229,197, 2, 18, 1, 32,144, 8,148,119, 73, 10, 90,107,102,144,194,213, 65,145,
- 33,199, 20, 85, 80, 7, 78, 99,141,126,144, 45, 57,212,124, 95, 30,182,119, 56, 54,189,159, 8, 83, 75,173,185,244,117,175, 95,
-209,174,111,185,187,190, 64,173, 93,155, 59,184,209, 41, 50, 54,164,215,169,255, 0, 46,168,158, 42,201,152,211,106, 84,163,214,
-181,211, 68, 26,177,138,146, 29,145, 80,127,205,164,233, 53, 57,180,156,227,189,123,126, 45, 44, 54,158, 20, 77,110,245,239,211,
-129,139, 74, 90, 8,200, 35,160,174,150, 35,165, 7, 81, 41, 18, 10,186, 18,116,161, 29, 56, 30,148,152,226,199, 94,190,186,159,
- 70,158,100, 36,208,241, 82,139,183,113,134,157,234, 84,184,224, 54, 9,112,151,147, 68, 1,218, 79, 93, 88, 55,106,157,200, 4,
-110,199, 44, 14, 53, 5,251,180, 13, 4,153, 25,134,120,140, 43,213,228,214, 24,205,120,239, 93,161, 33,190,208,175,120, 73, 4,
-124, 93,117, 62, 30, 89,190,153,250, 27, 3,245,126,169,170,169,249,166,194, 6,107,117,196, 97,191,172, 41,188,239, 46, 97,209,
-217,148,234,103,151,215, 21, 91, 18,203, 72, 37,114, 9,253,206,157,158,189,106,237,124,173,221,103,123, 26, 99,210, 29,196,240,
-237,172,101,231,155, 59, 69,187, 36,112,151, 81,110, 64, 15,123,178,163,105,252,235,121,114, 90,151,107,131, 17,136,105,249,168,
-147, 87, 29, 95,172,145, 74,107,168,109,254, 76,218,199, 18, 92, 72,226,254,145,128, 21,200, 55, 79, 60,238,223, 50,219, 70,193,
- 31, 67,177, 38,138,127,204, 6, 82,210, 19, 88,246,212,169, 36,213, 69,162,119, 3,217,211,187, 86, 13,242,107,110, 95,122, 68,
-237,170,119,249,229,185,162, 6,198,189,148, 5,195,159,243, 41,176,214,196, 99, 6, 27,139, 66,146, 95, 97,175,164, 27,187,197,
-107, 77, 75,180,242,131,109,182,144, 61,218,220, 7, 2,112,168, 23,158,117,238,151, 81,150, 55, 67, 73,226, 6, 53, 22, 94, 51,
-204,186,254,218, 90,184,223,103, 60,134,211,179,194, 75,165,180, 17,235, 9,165,117,182,219,185, 78,195,104, 37,208,192,208,122,
- 81, 77, 97,247, 30,114,220,119,116, 19,206,242, 7, 5, 74, 85,227, 44, 42,103, 32,102, 22,140,117, 42,146,150,165,201, 74,231,
-201,109, 30, 41,137, 1,175,105,231, 72, 61, 61,148,131, 74,158,218,106, 55, 53,239,177,242,213,140,183, 78, 78,232,192,116,187,
-128,169, 60,171,182,203,191,222, 71,110,213,239, 28, 79, 64,226,107,176,182,120, 16,236,118,104,246,104, 44,162, 61,178,215, 1,
-152,113, 88, 39,216,101,136,233,160,170,168, 74,148,123, 84,125, 58,241, 29,237,244,155,148,178, 79, 49, 87, 56,146,123, 77,123,
- 34,206,198, 61,190, 38, 67, 24, 70,180, 32,170,249,201,247,103,204,103,132,109,136, 82,144,229,124, 83,225,178,134, 80, 9, 53,
-168,253, 31,175, 84,114, 53, 77, 79,214,149,198,174,123,205,221,178,223,219,152,100, 45, 75,142,250,138,158,105,101,181, 33,229,
- 26,215,113, 73,219, 82, 43, 95,136,118,106, 77,189,169,148, 84,184, 30,184, 85,147,242,197,203,182,189,141,123,179,232,121,217,
- 81, 26,147, 40,151, 74,202, 94, 80, 35,169, 35,243,159,211,164,193, 17,137,229,105,155,204, 5, 91,124,187, 51, 98,116, 7, 92,
-247,128,162, 27, 7,161,165, 18, 69, 71, 78,222,181,252,142,175,227, 26,133, 81, 72,234,164,185,215, 36, 59,143, 60,185,172, 58,
- 75,205,170,173,164,246, 35,101, 61,163,208,210,154, 83,217,168, 37, 63,107,157, 52, 37,121,216,113, 80,152,129, 62, 99,173,150,
- 27,109, 5, 43, 27, 27,241, 13, 59, 59,143,203,166, 77,169, 13,169, 83,196, 95,149, 84,142, 68,204, 81,203,215, 97, 14, 43,254,
-240,183,164,175,113,108,238,165, 13, 13,105,233,169,166,170,159, 9,137,203, 81, 67,204, 1, 77, 63,177,108, 29,139, 93,173,134,
- 75, 69, 30, 11,116, 1, 66,181, 9, 61,135,167,117, 63, 42,234, 76,110, 35, 58,166,187,186,215, 65,228,208,221,139,107,125, 76,
- 39,105,105, 85, 2,157, 77, 69, 61, 30,141, 9, 38,170,114, 84,215, 60,185, 15, 40,152,214, 78,219, 46,186,169, 18,146,249,140,
-148, 87,219,110,189,135,211, 77,180,249, 53, 50,213,186,155,135, 26,155, 11, 48,169,191,136,240,151, 23, 38, 60,244,161, 74, 80,
-117, 46,110,240,234, 20,149,131,210,187, 64,232,117,125,227,248,109, 13,164,203, 45, 90, 44,134, 26, 45,141,177, 64,219,106, 66,
-208, 22,182,233, 68,111, 30,201,246, 83, 90,247, 30,221, 63,107, 62,186,140, 30,106, 25,203,236,202,128,227,119, 88,201, 66, 45,
-211,149,179,232,148, 84,150, 38, 4,213,105, 34,131,104, 95, 85, 39,227, 29,218,246,175,147,156,241,252,254,207,224,231,114,207,
- 8, 69, 63,105,156, 15, 89, 25, 31, 71, 77,121,123,205, 14, 88, 59, 61,215,197, 66,212,138, 66,184,112,119, 17,233,204, 84, 99,
-114,148,173,132, 33,213, 86,157,180,215,116,183,119, 72,174, 79,172,210, 27,115, 20, 5, 9, 91,138,173, 71,229, 77, 78,160,102,
- 34,150, 35,186,235,137, 21, 74,146, 79,113, 29,159,155, 72, 36, 10, 31, 22, 69, 42,199,241,145, 82, 86,162, 61, 3,187, 77, 61,
-193,220, 40,141,217, 60,107,199, 94,120, 26, 32,145, 95, 86,141,168,148,217,185, 60,107,120,225,110,246,184,160, 79,196, 52,151,
-188, 55,133, 23,196,154, 80,106, 75,177,142,208,225, 32,119,234, 36,132, 59,133, 41,183, 38,148, 99,222, 20,210,130,222,146, 24,
-108, 41, 32,173, 74,218,145,184,208,124, 21, 58,169,190,150, 43,102, 25, 36, 32, 52,102, 73, 64, 61, 38,164,178,228,187, 1, 78,
-171,150, 64,140,127,197,110,238,226,161, 60,212, 22, 39,210,228,251, 86,196, 63, 26, 87,213,169,149, 72, 91, 97,224,178, 41, 84,
- 86,157,250,226, 27,191,158, 28,181, 96,255, 0, 13,183, 30, 43,181, 57,169, 19, 92,244,115,115, 14,210, 14,147,208,169,211,149,
- 91,218,217, 79,114, 11,130, 0, 58, 72, 31, 61, 50,114,254,112,196,113,249,152,235,152,219, 57, 30,109, 59, 31, 91,147,121, 10,
-201, 96, 97, 50, 96, 74,182,203, 12, 22, 98,176,242, 91, 81,105,228, 44,148, 45,197, 81, 34,166,134,180,215,157, 55,191, 58, 55,
-254, 96,184,184,100, 14,142,194,217,224,182,217,242, 15,218,106, 11,223,123, 92, 80,180,132, 33,161, 79,109,105, 44,163,181,180,
- 45,241,129,144,230,228, 56, 17,208, 58,250,233,151,111,230,172,114,250,205,165,187, 85,129,201,119, 91,173,222,251,118,182,195,
-191,201,144,238, 73, 96,134,166,217, 82, 4,135, 17, 32, 54, 83, 1,198,214,218, 15,187,157,201, 39,173,123,112,214,222, 99,115,
- 46,203,184,182,235,113,189,116,177, 65,225,234,107,116,136,165,112,212, 59,163, 78, 26,193, 4,247,176, 32, 97,209,101, 45,197,
-156,150,238, 17,177,161,196,187,134, 45,110, 7, 53,225,217,136,166,119, 42,115, 14, 66,244,196,218, 49,236,139, 27,189, 89,101,
- 74,143,107, 92,119,110, 78, 77,183, 89,174,228,120,107,144,182,219,171,227, 98,150, 65, 1,161,211,183, 90, 14,105,231, 81,206,
-183, 14,187, 49, 79, 28,110,136,105,141,218, 91,222, 76,116, 47,116,245, 18,236,241,168, 77,149,246,205, 17, 50, 65,165,115, 11,
-199,170,185,141,157, 53,121,206,121, 14,247, 3, 55,204, 18,219, 31,120, 79,110, 70, 96, 24, 38,215, 5,152, 44,149,186, 17,109,
-105, 13,186,132,149,128, 18,189,131,182,166,167, 81,101,221,227,218,237, 27, 45,156, 4,188,181,191,179, 41,169,196,148, 11, 38,
- 45, 41,143, 19,213, 84, 59,173,236,178, 75,226, 60,234,225,130, 3, 85,229,252, 85,188,135,141,166,101,205, 94, 37, 33,155,125,
-206,117,173, 45,190,210, 3, 87,119,160, 46,137, 83,105,109, 33,214,155, 40, 80,220, 94, 61,189, 6,165, 55,118, 54,155,152,180,
-115, 26,165,129,216, 47,117, 70, 42, 78, 4,168,251, 53, 95, 35,131,163,105, 39, 30, 11, 81,214, 47, 20,220,173, 55,103, 25,184,
- 90,161,185, 25, 45,181,115,102,115,187, 94, 84, 71, 73, 63,234,205,169, 14, 23,105,179,105, 32,141,106,100, 99,124,104,218,230,
-184,140,218, 71, 79, 94, 73, 85, 83, 75,221,192, 98,112,255, 0, 26, 59,112,202,230, 98,183,137,119,204, 98, 68,123,147,204,227,
-178,108,209,247,176,137,126, 16, 90, 72, 47, 33,208,216, 73, 83, 68,252, 62,189, 91,199,182, 55,113,137,177, 76, 11, 70,176,227,
-138,122, 19,174,169, 91, 0,187, 5,146, 12, 21,106, 34,157, 42,255, 0,122,177, 59, 46,226,183, 92,247,117, 44, 62,235,181, 43,
- 42, 52, 36,170,163,182,186,210,193, 4, 86,207,210,192, 42, 88, 12,129,232, 48, 6,153, 66, 29,216, 67,115, 98, 82,136,201,250,
- 77,206, 81, 75, 75,106,253,154,145, 94,148,175, 77, 88,153, 3, 8, 90,124,189,139,215, 72,110,180,235,104, 75,174, 62, 23,188,
- 83,110,234,208,246, 39,226,233,167,195,131,176, 20,224,112, 57, 10, 42,148,185,179,216, 89, 59, 72, 90,138,122, 3,234,210,193,
-233,163, 80,184,138, 51, 41,106,100, 33, 73, 4,149,128,119, 38,181, 71,103,119,249,116,128, 23, 42, 40,209,234, 40,234,148, 95,
-247, 97, 33, 11, 8, 90,146,149, 37,190,213, 33, 94,131, 78,154,134,233, 11, 28,116,162,165, 28, 77, 12, 5, 51,169, 99, 16,203,
-241, 76, 91, 29,188,219,156,197,163, 78,201, 47,196,219, 88,200,111, 10, 84,152,152,236, 34,226, 8,125,134, 90,218, 86,224, 72,
- 32,238,233,234, 58,204,238,187, 53,222,237, 44,114,137,220, 34,103,123, 67,112, 47, 41,145, 39, 33, 79, 49,192,148,112,194,159,
- 16,113, 28,159, 34,121, 57,110, 59,143,217, 50, 59, 70, 47,108, 66,110,192,178,126,238, 75,146,247,108,113,246,137,108,171,170,
-183,109,238,244,107, 48,119, 75,125,189,142,180,185,150, 72,164,145,253,220,123,216,102, 26,113,236, 90,144,231,113, 64,131, 10,
-108,227, 25, 4,167,230, 93, 97, 94, 34, 65, 16,174,171,126,223,109,117,183,125,218,199,141,220, 37,186,126,153, 8, 0,163, 98,
-122,212,118, 83, 83, 55,139, 40,227,100,111,132,187, 91, 0,115,176, 87,200, 0,200,156,214,155, 23, 37,174, 76,232,205,186,231,
- 35, 21,186, 41,139, 85,199,222,229,216,101, 74,122, 36,219, 83,228, 69, 67,205,116,109,214,214, 18, 21,245,134,169,219,168,243,
- 68,221,222, 32,110, 25,221,144, 0, 90,225,138, 28,193, 29,153,209, 50, 99, 27,181,176,161, 28,105,163, 54, 84,187,133,197,235,
-198, 64,244,207,189,102, 92, 28,154,229,201,226,165,169,231, 86,165, 41, 74, 80,219, 82,165, 19, 94,221, 88,197, 19, 45,227, 16,
-192, 6,128,212, 13, 28, 7, 1,217, 68,233, 29, 51,139,156, 85,113, 61,180, 28,169, 15, 70,247,185,109, 93, 81, 45,110,190,134,
-154, 10, 74,154,148,170, 18,173,197, 6,187,133, 7, 90,233,200,155,226,105,105, 98, 97,232,245,211, 1,161,184,181,104,229,247,
- 45,151,124,102,219, 28, 8,204, 27,125,189,182, 84,220, 72,169,136, 30, 82, 9, 82,137, 41,249,234, 85, 42,165,119,250, 52,157,
-191,108,109,158,179,137,212,226,113, 43,254, 3,160, 82,137,210,135,133, 60,101, 92,160,218,224,162, 94, 44,110, 15,253,237, 99,
- 49,242, 22,167,198, 67,222, 18,222, 78,215, 66, 10,219, 40, 80, 87,106,104, 42, 59,142,168,237,173,228,187,144,199,122, 26, 52,
-200,172, 45, 36,101,150, 71,244, 26,122, 43,147,108, 8,102,100, 17,232,168,195,100,127, 20, 57,225, 43,193, 41, 39,221,188, 78,
-165, 34,157, 55,108,237, 30,141,106, 21,201,167,138,210, 23,141,126,156, 24,199, 42, 66, 17,145, 30,252,226,219,146,130, 18,153,
- 8,111,122, 28, 71,165, 84, 29, 14,149,189,114,140,142, 37,214,225, 65,225, 94,170,229,207, 48,225, 12, 12,188, 36, 56,113, 3,
- 62,218,117,191,204, 56,188, 96,148, 33,233, 47,238, 7,171, 76,244, 73, 30,154,211,183, 92,246, 95, 45,183, 11,183, 18,141, 29,
-166,183, 7,205, 93,174,212, 0, 11,157,216, 40,131,188,183,140,186,219,138, 14, 73, 74,208,146,160,133,179, 66,225, 3,176, 31,
- 73,212, 25, 60,174,220, 67,128, 70,161, 57,174, 85, 46, 47, 54,118,167, 2, 85,192,129,146,103, 77,233, 92,175,143,135,154, 66,
-139,225,167, 25, 11, 83,161,189,193,167, 15,236,145,219,165, 15, 42,247, 7, 49,206, 26, 84, 20, 1,115, 29, 34,164,197,230,246,
-212,217, 26,211,171, 73, 10, 74,100,122, 13, 33,204,229,252,109,149, 16,129, 45,238,159,178,213, 43,242,233,235,111, 40,183, 25,
-189,226,198,250,105,249,188,231,218, 97,247, 67,221,216, 41,155,117,230,230,146, 74,109,118,226,175, 67,146,151, 79,252,208, 53,
-169,219, 60,150, 92,110,166,244, 55,235, 53,153,221,124,246,107,112,180,129,122,220,126,129, 77,135,185,194,236,165,251, 17, 33,
- 55,210,155, 72, 42,235,173, 28, 62, 76,216, 52,119,164,121,245, 86,114,111, 60,183, 7,158,236,113,129,233,164,231,121,163, 33,
-169, 82, 4, 48, 9,249,190, 13,104, 53, 61,158, 79,109,128, 33,215,235,168, 78,243,183,117, 85, 30, 26,118, 82, 28,222, 98,200,
-221, 90, 92, 76,136,237, 37, 0,251, 45,178, 0, 85,125, 58,159,109,229, 46,213, 16, 45, 44,113, 94,147, 80,238, 60,230,221,230,
-112, 33,237, 9,208, 48,166,180,158, 69,200,103, 23, 82,237,210, 74, 80,237,106,132, 43, 98,104,123,133, 0,214,150,207,144,246,
-203, 45, 37,144, 49, 71, 18, 22,179, 87,222, 99,110,183,161,193,247, 15, 67,192, 20,166,163,183,169, 1,106, 1,247,143,137,209,
- 95, 72,125,170,250,125, 58,213, 55,111,143, 14,232,195, 44, 5,100, 31,187,200, 87,190,113,207, 19,141, 39,174,107,235, 53,113,
-106, 8, 31, 52, 87,166,165,182,221,163, 32, 22,160, 73,184, 20, 69,162,130,230,150,149,178,133, 68,158,209,233, 63, 22,164, 11,
-117,168, 82, 94,245,208,114, 47,107,101, 91,118,158,193,215,242, 26,122, 59, 80,234,131, 37,245, 18,122,246, 94, 27,104,123, 63,
- 46,237, 60,219, 96,218,140,235,197,163, 49, 39,211,162,138,138,143, 96,175,119,201,164, 73, 24,162, 19,151, 83,142, 16,241,246,
-251, 10,234,106, 72, 29,159,155, 85,119, 18, 6, 85,140, 0,186,186, 41,229,159, 16,143,142,227, 71, 44,145,226,162,126, 85, 33,
- 80, 99, 5,251, 40, 22,120, 11,234,164,128, 42, 75,175, 36,252, 73, 4,107,201,222,115,115, 33,190,188,101,131, 8,209, 22, 39,
-245,136,250, 7,207, 94,167,242,111,151,133,165,171,175,222, 14,169, 48,111,234,142, 62,147,243, 85,178, 83,209, 68, 55,222,120,
-161, 40, 9,240,146,216,232, 18, 19, 83,215,160,161,235,215, 92,134, 36,112, 36,215,101,126, 6,170, 87, 48, 93,216,105,167, 35,
- 68, 10, 83,142, 52,165, 2, 9,216, 2,255, 0,201,211, 81,221, 24, 38,153,115,235,141,158, 98,113,201, 50, 90,155, 32, 54,165,
- 62,181, 44, 36, 87,113,218,107,220, 71,168,118,106,210,207, 3, 75,134,109, 38,170, 39, 0,114,118, 99,142,114, 83,216,196, 11,
- 37,246,252,171,145, 74, 34, 64,176,217,164,222,110, 65,109, 47,104,163, 12, 54,226,138,106,105, 93,189, 15,110,172,110, 44, 90,
-224, 30, 42,117,193,241, 89, 93, 86,185,179,205,214,188, 38,225,152,222, 56,199, 58,181,217,225,193,114,116,217,119,155, 19,246,
-145, 6, 43, 73,220, 84,235, 82,146,211,192, 4,246,146,142,157,253,154,142,217,226,137, 3,156,139,134, 69, 61,104,149, 72,235,
-119, 60,224,158,177, 92,239,205, 57,222,217,124, 90,143,191, 33,105,116, 16,149, 21, 2,149, 10,244,244,244,213,147,173, 73,167,
- 33,140,199, 80, 69,207, 36,180, 78,144,143, 21,246,220,241, 42,154,165, 67,180,142,148,253, 58, 79,130, 90, 48,169, 65,198,164,
-174, 60,200,108, 22, 9, 45, 63, 86,211, 78,174, 40, 16, 9, 36,250,105,221, 93, 65,158, 18,120, 84, 11,176,100, 21, 97,164,114,
-181,165, 13,151, 83, 49,162,132,161, 73, 82, 80, 71, 85, 30,149, 35,215,219,170,185, 24, 69, 81, 62, 2,106,187,243, 15,153, 91,
- 54, 59, 96,148,191,122,142, 36, 46, 45, 22,146,174,136,121,173,167,243,154,215,224,211, 76,182,116,206, 74, 56,236, 12,135, 42,
-167, 28, 83,110,189,114, 94, 68,238,123,118,222,211, 51,222, 83,150,248,110, 36,143,245,116,212, 5, 16, 71,120,249,189, 59, 53,
-161,142, 33,110,208, 58, 42, 76,236, 16, 13, 34,186,119,142, 93,109, 56,173,186, 35, 13,173,148, 61,225, 35,112, 4, 84,184,160,
- 8,233, 79, 94,171,102,156,185,216, 85, 65, 5,212,165,125,184,253,225, 24, 72, 39,196, 47,168,146,164,138,182, 8, 6,128,138,
-122, 8,212,235, 57, 80,165, 22,138,214,221,107,103, 33, 98, 86, 39, 53,214,152, 55,214,146,139,124,153, 40, 10,102, 37,221,170,
-169,149, 41, 84, 10, 72, 82,189,149, 31, 65, 58,232,252,151,204,238,229,109,194, 27,214,169,107, 74, 56, 14, 44, 56, 56,125, 35,
-172, 10,206,115, 94,196, 55,235, 25, 45,202, 41, 29,211,208,225,149, 87,203,222, 39,112,182,207,153,106,156,202,227,220, 45,210,
-159,133, 49,133,123, 69,169, 17,212, 80,177, 81, 80,104,161,218, 53,239,203, 13,238, 59,232,153, 52, 68, 22, 61,161,192,244,130,
- 20, 87,141,238,236,159,106,247, 70,240,142,105, 32,246,138, 72,110,200,184,224, 40,160,149, 3,218, 83,223,242,106,209,183,225,
-213, 87, 35, 13, 31,109,133,145,213, 6,163,248,105,250,180,102,228, 84, 98, 8,161, 18,230,192,170, 36,147, 95, 70,140,204, 13,
- 17, 6,188, 73,241,212, 19,180,164, 14,210, 7,110,146,110, 52,210,113,175,102, 61, 18,209, 25,201,179,204,132, 71,104,178, 22,
- 90,140,183,220, 72,125, 65, 41, 86,212, 36,171,104,175, 83, 77, 66,159,116,100, 77, 47,115,130, 12,207, 71,109, 17, 4, 80,229,
-112,203, 45, 75, 18,153,247, 89, 3,116,119,157,112, 50,219,225, 68,164,108, 43,218, 23,185, 64,129, 78,211,211, 85,108,230, 91,
- 73,227, 50, 50, 86, 22,135,105, 36, 31,181,209,219, 78,104,115,113, 76,233, 53,190, 60,202,111,214,172,171,144,229,223,112,252,
- 27, 17,178,217, 46, 38,194,223, 42, 71,114,223, 2,255, 0,145,194, 12, 21, 48,128,219,110, 56, 28,122, 43,187,163, 7, 40,133,
-172, 1, 90,246,124,241,243,215,207,136,239,247,177,179,218,124, 84,138,246,198,246,219, 59, 16,197,119,121,205, 36, 2, 3,194,
- 56,133,112, 24,229, 91,237,135, 97, 59,133,172,147,181,236,107, 88, 11,181, 59, 45, 65, 21,128,128, 78,163,193, 80, 30,154,173,
- 60,165,204, 88,221,170,215, 26,209,155,227,185, 30, 87,105,137, 14, 69,139, 20,200,226,205,102,218,221,189,219,210,155,148,230,
-224,218, 10,110, 9,108, 33, 65,146, 74, 67,117, 29,224,235,156,237,187, 93,222,227,116,235,171, 89,227,142,119, 16,249, 90, 65,
-113,112, 96,210, 10,147,220, 39, 13, 89,234, 78,138, 31,204, 96,115, 11, 12,106, 17, 1, 56, 56, 21,197, 80, 98, 58, 58, 42, 23,
-184,227, 48,237, 57,213,142,205,113,203,114, 28, 74,102, 66,212, 17,149,221,239, 86,229,218,154,134,137, 40, 15,182,235,239, 70,
-113, 74,150,132, 33, 45,157,205,181,183,190,186,209, 75,230, 28,151,219,100,143,101,188,115, 54, 50,124, 48,215,107, 46, 67,165,
- 26, 28, 59,139,142, 5,203,194,171,226,128,153,124, 39, 63, 66,166, 39, 16, 61, 84,215,155,125,141,142, 92,227,199,151,105,180,
-222,242, 5,201, 46, 48,229,218,227, 33,248,183,108,116, 56,165,123,110,160, 50,252,114,250, 91, 14, 52,164,154,168, 26, 83, 80,
-101,220,164,221, 33,212,201, 31, 28, 73,147, 90,208, 91, 34,112, 5, 67,131, 85, 28, 14, 84,248,119,133, 46,135, 35,135,206, 58,
-184,245,209,185,217,246, 9,201, 56,113,182,179,136,225,216,207, 49, 92, 46, 45, 39, 11,200,172,247,121, 54, 40,151,183, 38,169,
- 44, 34, 58,226, 45,149,197, 75,190,242,216, 10, 14,184, 42, 61,186,212,157,103,133,166,229,203, 55,130, 87, 92,207, 38,220, 26,
-124,102, 57,173,121, 98, 41,213,168, 16,237, 58, 78, 26, 65,232,169,143,255, 0,186, 65, 26,120,132,128, 2,167, 80, 29,171,211,
- 85,183, 55,227, 92,223, 5,184, 59,101,206,175, 15,194,207,172,215, 18,156,167, 25,183, 92,155,158,236,243,113,246,148,211,146,
-147,189, 13,186,148,109, 30, 31, 84,237, 32,131,174,159,181,111,155,127, 52, 88,182,239,107,102,168, 28, 14,151,184, 35, 90, 27,
-147,131,112, 37,167, 28,115, 81, 85,123,133,132,246,146, 24,165, 9, 40, 24,254,154,141, 38,228, 54,200, 88,166, 91,102,198,241,
-204,134, 1, 88,178, 92,174, 48,159,201, 91,126,204,153,113,150,231,189, 46, 67, 69,162,181, 23, 10, 82, 16,132,145, 78,253, 20,
- 86, 18,220, 93,193, 61,204,177,148,214,208, 67, 8,114, 16, 52,128, 87,134, 42,113,170,127, 12, 1,223, 66,229,195,170,161,252,
- 25,219,115,185, 51,114,103,183, 29,152,113,226, 74,145, 61,165,196, 91,130, 83,143,149, 20,180, 67,101, 32,245, 34,137, 36, 13,
-111,102,137,222, 22,144, 73,113, 35, 78, 57, 1,199, 26,166,221,166,146, 56,207,134, 10,156, 58, 40,214, 81,155, 62,172,118,124,
- 72,120,211,112,172,146,223,114, 3,114, 19,110, 75, 33,130, 84,170,236,112, 2, 14,240, 0, 32,245, 26,189,178,219, 71,138,215,
-189,228,184, 5,207, 62,222,202,106,214, 23,184, 53, 93,136, 20,216,195,217,197, 36, 92, 11, 23,150,238, 14, 67, 93,186,105,109,
-180,187, 70,125,243,106, 75,110, 56,145, 82, 42, 82,161, 94,186,176,189, 51,180, 3, 26, 42,143, 85, 74,149,206, 67,128, 80,106,
- 52,201, 89,145, 26, 75, 44, 55, 45,199, 34, 59,226,172, 84,123, 8, 81, 36, 82,137, 3,160, 29,149,213,228, 97, 27,136,198,151,
-109, 35,102, 82, 70, 52,213, 84,100,184,202,147,227,125, 43, 64,172, 36,252,199, 18, 63, 71,168,105,229, 11, 82, 11,244, 59, 1,
-133,100, 72,207, 16, 73, 66,219,109, 67,161,165,104, 71,197, 77, 37,239, 12,206,138, 71, 10,221, 77, 58,180,182,141,213, 53, 85,
- 67,168,234, 79,163,167,235,210, 53, 33,164, 53,200, 73, 74, 85,183,197,113, 59,222, 95,209,248, 27, 84,144,161,226, 52, 0,244,
- 10,106,186,250, 97, 25, 12, 69, 39, 58, 14,126,172,169,255, 0,122,205,165,222,177,188,127, 27,110,217,142, 37,156, 98, 66,229,
- 71, 82, 45,233,102,229,123,126, 90,144,146,135, 84, 6,231,128, 61,137,233,211, 89,221,191,104,109,157,196,183, 14,124,131,197,
- 8,123,216, 48, 14,129,195,182,166, 7,151,128, 7, 4, 53, 35,242, 13,182,241,199,120,180, 12, 46,109,150,251,129,228,178, 90,
- 98,241,153,218,101, 76, 45, 69,185, 11,194, 84,184,133,166, 90,113, 99,104, 97, 64,209,116, 32,116,214,107, 98,187,143,125,187,
-117,236, 82,199, 60, 0,150,196,224, 49,110,156, 28,164,140,215,162,173, 47, 29,225, 70, 34,210, 67,179, 35,133, 49,177, 75, 5,
-166,250,251, 81, 36,222,125,202,221,105,183, 46,241,123,241, 31, 68,105,142, 70,138,164,133, 55, 25, 11, 27, 28,113, 65,126,192,
-173,125, 58,178,222,247, 41,172,135,136, 35,212,247,187, 75, 16, 40, 83,197,196, 98, 6, 24,154,168,100,109, 37, 69, 20,185, 90,
- 45, 86, 59,220,247,217,126, 67,214,181, 62, 92,199,150,167, 4,134,102, 70,221, 90, 58,243, 96, 13,233, 73, 1, 65, 61, 43, 93,
- 57,101,119, 37,244, 45, 4, 1, 34, 35,198, 72,122,129,225,209, 68,247, 55, 20,175,111, 51,174,153, 58,151,113, 93,186, 44,123,
-125,185,136,177,150,220, 22,195, 81, 89, 9, 59, 18,181,146, 55, 21, 44,154,168,232, 91, 67, 22,219,251, 61,100,189,196,156,113,
- 61, 56, 81, 52,174, 13,246,211,102,116,117, 73,154,210, 22,227, 37, 45, 4,160, 56,208,163, 73, 80, 20,165, 64,174,172, 98,127,
-134,195,215, 72,215,160, 18, 5, 25,135, 14, 3,119, 24,236,221,102, 42, 20, 47, 13, 78, 61, 34, 59, 69,231, 0,108, 31,154,130,
- 58,149, 30,154,106, 73,164,240,203,162,106,185,112, 7, 1, 66, 41, 60, 78,202,240, 61, 62,224,133, 49, 10, 68,167,163,196, 91,
-206,150,146,106,182,227,119,157,169,244, 39,174,140,248,112,157, 79, 0, 19,130,245,255, 0,141, 44,141, 37, 14, 84, 68,187, 8,
-173, 41,247,199,124, 52,182,180,143,163, 59,188, 85, 41, 38,148,236,173, 7,110,159, 71,162,233, 11, 75, 66,169,194,191, 66,196,
-228, 5,212, 80,168, 39,215,249, 13,117,131, 2, 26,216,182,101,173, 21,119, 7,181,206,131,208,127,163, 69,225,117, 82,196,212,
- 18,175, 64,118, 56,163,241,255, 0, 70,135,129,213, 74,241,232,147,215,125,245,162,141,127, 47, 86,156,108, 32, 81,252, 71, 93,
- 39, 42,106, 85,218,178, 62, 45, 62, 26,148, 60,122, 74,145, 41, 32,154, 57, 74, 86,159,149, 53, 33,128,116, 83, 78,184,164, 41,
- 10,112,146,226, 87,211,210, 13, 58,124,154,150,194, 50,166, 77,201,173, 26,152,146,146,133,184,191, 64,244,233,194,212,225, 77,
-155,147, 68,150, 84,162, 66, 20,174,181,167,175,243,105,208,224, 41, 6,224,154,241,181, 58, 74, 65, 89, 61, 71,200, 62, 45, 43,
- 88,166, 93, 59,168,250,253,164,138, 14,190,154,117,209, 7,129, 77, 58, 98,104,187,200, 90,146,145,184,128, 15,181,233,253, 26,
-113,178,180, 83, 46,121,160, 21, 29, 11,161, 74,136, 80, 61, 15,167,243,105,193, 58, 83, 69, 77, 2,229,185,231, 9, 90,220,233,
-217, 90,119,124,154,112, 93, 52, 83,102, 50,104,187,214,181,246,182,162,163, 78,239,243,105, 66,240, 82, 12, 38,140, 65,130,241,
-113, 40, 59,170,122, 2, 71,120,248,181, 26,226,237,160, 84,168, 45,201, 53, 47,224, 88,220,219,246, 65,100,199,153, 4, 57,120,
-185,194,183,165,106, 77,124, 63,122,112, 32,171,179,177, 32,212,235, 27,191,239, 12,219,173,229,184,118, 76, 97,119,168, 45,108,
- 54, 61,169,251,133,196, 80, 55, 55,184, 55,214,107,174,242,237,145,237, 17,162, 70,138,192, 98,223,102,183,177, 14, 35, 72, 77,
- 17, 30, 44, 84, 4, 33, 35,165, 43, 64, 58,235,194, 27,133,204,151,178,190,121, 10,185,206, 46, 39,172,227, 94,236,176,180,101,
-140, 49,193, 24, 70,181,160, 15, 64, 74,169, 28,167,207, 54,172,102,223,112,128, 39,178,135,208,226,183, 39,197,246,182,164, 26,
-145,223,211,169,166,160, 70,231, 56,160,169,190, 22,170,164,210,188,197,127,124,249, 10,219,136, 89, 25,145,125,159,117,101,166,
- 33, 69,183, 52,169,179,101, 73,112,172, 6,218,105, 8, 82,148,119, 2, 79,162,158,141, 91,178, 2, 35, 46,118, 9, 81,164,182,
-112, 11, 86, 44,121, 93,178, 53,111,147,200, 94, 99, 46,167, 20,194, 45,237, 34, 82,177,187,108,144,237,226,232,146, 55,169, 18,
- 94,105, 43,247,100, 20,244, 82, 26, 37,195,215,218,108,128, 76,139, 87, 53,168, 92, 78, 57,116,154,134, 65, 92, 51,170,219,158,
-254, 44, 62, 78, 60,170,160,226, 28, 37,129, 88,162,183, 57,228, 37,225,139,218,155, 98,109,218, 91, 3,106, 23, 41,109,164,200,
-148,233, 6,129,111, 45,107,245,234,228,120,142, 29,208,159, 46,154,153, 6,215, 45,215,121,197, 7, 73,250, 5, 85, 31, 51,159,
-137,159,154, 94, 89,225,140,158, 62, 27,229,155,152, 49,172, 79, 32,199,238, 15, 28,191, 40,193, 39,227,120,195,182, 93,138,222,
-243,115,238, 49,226, 67,112, 40, 3,177, 41, 89, 42,253,144, 77, 53, 3, 92, 82, 60, 54, 73,153,158, 64,169, 94,193, 86, 81,236,
-177, 71,139,220, 79, 80, 8, 42,187,126, 14, 60,165,229, 46,227,137,114,108,158,125,198,113, 28,231,149,236,183, 91,122, 49,136,
-153,244,118,110,150,219,102, 46,204, 96, 74,227, 66,153,190, 42,156, 84,160,189,206,120,101, 96, 4,138,129,219,103,189,153, 32,
- 68, 4,176,181, 48, 36, 99,214,159, 77, 1,104,235,163,220, 41, 86, 63,155,191, 20,126, 44,177,221,166,241,127, 13,241,134, 21,
- 50,239, 38,236,155, 37,190,211,139,226, 17, 31,147,113,153, 57,104,106, 59, 17,163, 69,138, 75,203,117,197, 4, 33, 8, 73, 36,
-244, 2,186,206,195,179,190, 81,173,225, 27,214, 77, 79,118,212, 64,239, 76,157,128, 85,170,225,111, 39, 87,251,184,135,200,222,
-106,240,110, 55,227,172,102,124, 69,220,152,227,136, 86, 24,242,121, 54,245, 38, 83, 96,161, 50,133,185,182,190,239, 8,174,239,
- 12, 56,227,181,246, 86,134,205,117, 22,242, 65, 19,116,198,247,131,211,168,167,160, 19,243,165, 82,189,140, 99,136, 7, 88, 28,
- 83, 63, 78,103,209,235,169,255, 0, 37,242, 71,229,147,146,177, 41,109,217, 56,223, 33,226,242,181, 58,197,174,248, 23, 54,205,
-124, 42,108,109, 15,248, 19, 29, 88, 82, 15,112,117,179, 81,214,154,165,117,220,208,149,108,133,221,184,143,151,101, 41,208,199,
- 32,239, 48, 55,216,107,231,203,205,207,225,201,203, 60,111,151, 75,190, 90, 50,100,242,158, 9, 4,170,122,173,140,197, 48,178,
-104,241,218, 53,162,152, 78,230,230,164, 36, 84,248, 68, 40,246, 6,207,110,180, 59,110,240,199,163,101,110,135,116,240,253, 31,
- 44,106, 35,100,133,189,208,113,168,183, 11,228, 59, 70, 47, 2, 58,158,113,184,190,236,200,103,193, 63, 70, 90, 40,246, 74,104,
- 64,166,218,122, 53,117, 42,187, 1, 85,183,118,133,198,155,177,188,194,203,203, 51,185, 86,139, 3, 51,110, 76,199, 17, 91, 83,
-144,218, 83,205,182,226,170,163, 82, 6,196,148,165, 95,180,116,236, 59,119,119, 91,170, 24,178, 13, 10,107,165,156,121,126,114,
-233,104,131, 6,101,150, 83, 13,162, 58, 82,167, 93, 66, 95, 90,212, 69, 9, 81, 29,149,245,106, 36,145,248, 69, 65,168,143,141,
-173,169,101,204,124,161, 41,149, 29, 94, 12,150, 22,137, 12, 21,167,161,216,170,211,168,245,106, 68, 55,137, 76, 57,171, 78,158,
-109,195,226,222,113, 60,107,150, 45,145,194, 31,144,227,120,198,100, 25,103,107, 98,235, 29,178, 98, 74, 85, 5, 1,144,211,106,
-109, 71,167, 84, 36,245, 36,157,122,115,201,126,113, 55, 16,191,109,149,202, 99,239, 49,127,202, 78, 35,208,113, 29,189, 85,231,
- 79, 52,185,104, 91, 78, 46,227, 24, 63, 7,126,176,227,233, 31, 53, 84,153,109,148,145,181, 53, 29,253, 63,163, 94,129,134,253,
-166,184,173,197,177, 28, 41, 37,210,160, 74, 82,154, 31,131, 83,155,122,211, 85,174,132,142, 20, 9,104, 43,187,175,125, 19,253,
- 26, 95,199, 10,111,193, 52,199,203,179, 27, 77,133,147,110,138,181, 73,186, 58,212,143,125, 49, 36,198,109,118,120,229,179,177,
-210, 28, 88,222,189,196, 81,178, 7, 78,181,214, 35,152,185,246, 13,142,224, 91,202, 29,139, 53,106, 24,161, 84, 68,246,212, 59,
-155,134, 90,144,210,170,122, 2,225, 85,162,201,207, 23, 12, 82, 92,182,114,135, 69,250,203, 30,100,200,241,229,217,215, 38, 84,
-185, 11,109,141,201,113,233, 7,198,105,182,208,165,167,114,146, 8, 20, 52, 26,231, 51,243, 14,235, 13,187,197,172,177, 31, 17,
-217,189, 48, 81,138, 55, 5, 32, 98,135,141, 70,115,229,113, 58, 72, 33, 83, 19,151,101, 54, 99,242,221,250, 62, 81, 46, 67, 25,
-132, 86,221,185, 89,219,184, 98,214,136,145, 35, 38, 66,173, 44,173, 79,237,125,233,108,134, 20,181, 45,197,109, 1,176,127,123,
- 92,199,152,121,178,226,254,216, 67,164,152,154,246,135, 20, 13, 26,219,145, 13,143, 16,132, 41,196,209, 58,119, 34, 18,122, 21,
- 50, 52,205,127,204,210, 47,217, 36,227,200,143,221,114,153, 23,120, 14,191, 49, 40, 68, 75, 20,104,236, 41,126, 35, 77,184,228,
- 38, 82,204,182,227,148,132,150,125,148, 16, 77,106, 69,117,204,183, 46, 75, 26, 60,107, 68, 99,131,213, 73,115,201, 60, 72,212,
- 85,165,217,234,196,213,163, 47, 36,130, 51, 28, 88, 14, 41,199,182,164,219,135, 55,113, 21,203, 22,188,225,249,206, 56,187,141,
-191, 17,114,195, 3, 3,133,142,173,171,209,147, 10, 70,229, 50,202, 36,205, 74,219,183,197, 18, 31,250,112,202,247,109, 27, 71,
-118,185,101,239, 37,238,194,238, 27,203, 9,244, 62, 77, 70, 98,253, 77, 3,164,150,179, 23,189, 7,119, 80, 69, 42,106,118,213,
-127, 27, 75,196,154,139, 72, 40,128,106,212,152,103,193,106,177,115,111, 46,101,173,102, 86,203,176,141,109,111, 19,186, 91,173,
-176,112, 77,185, 35,115,216,183, 78,177, 53, 29,151,124, 85, 60, 36, 41, 72, 82,154,232,203,167, 96, 73,233, 67, 93,104,185, 99,
-148,237, 91,107, 36, 1,207, 50, 53,206, 51, 43, 8, 46, 15, 46, 33, 52,233,199, 31,121,189,229, 21,109, 14,228, 38,112,152, 49,
-161,232, 6, 28, 8,204,144, 87, 63, 85, 48,184,175, 39, 94, 93,200,248,229,223, 41,138, 57, 3, 36, 19, 36,191, 38,205, 5,132,
- 55,100,183, 69,140, 92, 81, 50,195,108,180,221, 90,162,148,216, 77, 83, 64, 7,171, 82, 57,194,197,219, 94,217, 52, 54,174,248,
-104, 67, 64, 14,113, 37,238, 37, 61,213, 36,227,128, 42,133,106, 86,218,225, 61,192,123,128,113, 85, 56, 96, 61, 85, 44,226,188,
-101,100,228,142, 69,207, 49,215,230,203,199,242, 11, 44, 89,215,188, 14,110, 17,141,165, 80,242,233,140, 34,140,194,141, 24,177,
- 25, 13, 25, 73,113, 73, 91,251,105, 81,213, 34,186,201,238, 92,213, 55, 46,109,182,183, 8, 36,137,228, 50,102,204,243,170, 32,
- 78, 46,115,149,196,233, 69, 13, 92,184,213,132,118, 44,184,154, 80,160, 56,123,186, 70, 7,161, 21, 51,233,166,102, 69,193, 60,
-143,137,217,102,222,243, 58, 96, 18,109,153, 50,109,246,172,107, 44, 63,118,228,247,201,209, 83,226,169, 81,210, 16, 17, 35,194,
-218,144,241, 10,239,233,211, 93, 14, 63, 49,118,189,194, 54, 67,182, 22,220,120,145, 43,228,139,188,198, 52,225,222,197, 90,184,
-233, 81, 76,110,118,242,237,218, 93, 36,111, 4,168, 5, 51, 76,194,250,106,182,103,119,155, 62, 64,126,243,187, 91, 90,180,170,
-100,103, 91, 91,246, 68, 37,185, 50, 92,140,214,212, 54,182,212, 82,218, 7,140,146,162,162, 9,169, 58,190,217,173,167,181,253,
-156, 78,212,132, 96,236,130,156, 72, 57,146,152,116, 86, 82, 34,208,221, 37,125,227,137,196,227,244, 83, 71, 11,200, 88,199,108,
-242, 16,187, 56,150,197,214,228,212, 98,110, 11, 83,234, 67, 14, 20,161, 78,130,132,165, 10, 82, 5, 72, 26,220,186,208,222, 57,
- 67,144,181,167, 44, 63, 77,103,183,107,119, 92, 76,214,146,128, 99,133, 5,202, 86,171,101,190,117,179, 31,176,228,208,242,134,
- 28,101,251,191,185,198,219, 18,223,101, 68,178, 3, 91,234, 18, 86,226,144, 9, 80,213,158,205,119, 36,140,116,179, 70, 88,152,
- 41,196,187,167,209, 79,219, 60,181,186,139,116,240,235, 63,162,152,214,121, 24,197,161,160,236,164, 51,117,187, 62,218,208,210,
- 55,148, 51, 8,128, 7,204, 82, 71,137,216, 77, 41, 67,171, 91,129, 53,202,105, 58, 90, 61,191, 85, 78, 58,158, 48,192, 84,125,
- 42,209, 36,200,113,126,226,191, 10, 67, 14,190,218,221,120,161,167,146,205, 74,188, 52,132,212, 4,246, 1,171,134, 79,169,184,
-156, 70, 20, 78,210,161, 13, 53,211, 21,242,133, 58,211, 46, 60,211, 10, 81,124,182,217,218,216, 2,181, 81, 35,160, 21,161, 39,
- 83, 3,154,211,141, 60,224,189,181,179, 82,210,150,211, 13,245,237, 65, 90,220, 91, 85, 4,238, 88, 20,246,169,211,224,211, 82,
-176,162,183, 58, 32,173,236,165, 73, 80, 96, 71,132, 36,199, 74,139,239, 36, 2, 28, 41, 82, 89, 74, 72,216,164,169, 43, 59,138,
-186,212, 20,244,213,100, 55,178,107, 12,112,192,118,211,132, 40, 61,116,154,194,157, 9, 91,106,117, 94, 9, 66,150,180,132,146,
-135, 20,105,236,130, 7,237,106, 69,204,109,121, 4,102,190,145, 76, 49, 69, 59,108,178,237, 22,213, 52,140,143, 27,150,243,114,
-223,109,112,238, 16,101,169,135, 34,180,210, 13, 80,218, 54,148,169, 94, 34,146,162, 73,236, 20,214,122,250,222, 91,134,147,109,
- 56, 5,161, 11, 92, 1, 82, 78,100,244, 34,138,178,135, 67, 61,224, 74,158,154,120,231, 16,177,187,150, 81,104,122, 61,207, 41,
-122, 13,209,152, 34,237, 58,242, 69,194,238,135, 84,148,164,148, 33, 75, 82,150,148, 36, 0,157,202,245,106,143,100,188,186,181,
-179,123, 95, 28, 65,204, 39, 64,103,117,189, 56,225,129, 60, 80, 81, 78,224,233, 21, 78, 92,126,186, 43,122,143, 2,215, 10,204,
-221,157,249,109, 72,118,205, 33, 23,103,222,141,238, 1,246,202,220, 73, 64, 81,221, 83,225,132,212,122,244,229,157,195,175,100,
-121,156, 2, 3,198,144, 10,166, 88,250,232, 73, 27, 24, 1,106,229,143,109, 33,198,176,221, 29,181,195,184, 72,144,203,150,198,
-196,151, 32,199, 51, 67,143, 50,219, 95, 89, 70,189,162,144,123,170, 53, 46, 75,232,153, 51,163, 96, 58,240,212, 83, 12,114,199,
-141, 67,115,245, 28,104, 7, 66, 88, 27,163, 92, 26, 45, 77,142, 92,247, 85, 56,162,144, 80,104, 55,165, 52, 21, 39,179,166,157,
-208,167,188,220, 65,206,137,239,211,128, 5, 41, 42, 94,246,194, 75,133, 37, 73,117, 41,116, 35,176,146, 59, 77, 7,126,165, 64,
-117, 96, 7,101, 40,145,144,232,160,223,121,167,136, 75,200,115,199, 1, 72, 73, 65,220,217, 71,104,221,210,181,174,150,214,152,
-242, 74, 76, 96,140,178,175,109,210,158,183, 45,197, 68,150,244, 69,202,109,200,210, 93,105, 32,164,197,115,162,146,104, 10,141,
- 72,210, 39,141,183, 33, 30,208, 80,168, 7,166,156, 36, 56, 33,173,141,199,253, 96, 57,177,157,161,165, 70, 15,123,175,107,106,
-160,223,178,149,175, 77, 35,224,194, 34,156,215, 63,101, 35,194,224,188,107,239,120, 75, 82, 83,181, 39,227, 61,218,235, 63, 17,
- 90,109, 85,232,125, 68, 84,184,106,116,161,113, 71,168,209,212, 73, 73, 77, 73,167,167,175,244,105, 38,106, 48,243, 68,223,153,
- 74,132,244,244, 30,255, 0,209,165,137,186,104,157, 37, 38, 56,243,198,167,121,235,217, 79,243,105,209,114, 41, 6, 67, 64, 85,
-127,182, 73, 31,151,171, 75, 23,116,157, 70,182, 36,168, 0,146,105,223,165, 11,186, 34,234,196,177,191,166,211,211,191, 78, 11,
-218, 20,164,204, 36,148,238,161, 20,244,247,254,109, 54,235,211, 65, 40, 64,195, 3,218, 20, 7,243,254,141, 15,140, 52, 90,104,
- 95, 9,181, 0, 65, 72,166,143,227, 13, 26, 81, 23,144,128,149,251, 98,189,212,210,133,217, 52,217,109, 38, 40, 26, 38,138, 53,
- 79,163,166,158,248,186, 78,148,163, 41,241, 92, 78,223, 16, 0, 71, 90,143,242, 13, 23,197, 1, 71,166,134, 67, 78,161, 73, 72,
- 80, 34,159,151,118,144,235,192,148,166,178,149,161,239, 75,136, 5, 9, 52, 53,174,222,237, 87, 92,222, 97, 86, 86,204,198,174,
-143,149, 12, 97, 57, 7, 32,253,237, 33, 9, 49,241, 75,107,215, 20,138, 84, 57, 62, 93, 99,178, 15, 79,217, 11, 90,199,173, 35,
- 92,143,204,141,212,178,207,225,219,156,174, 67,250,163, 19,243, 1,233,174,203,229,110,214, 46,239,252,103, 12, 34,110,175,247,
- 28, 7,206, 79,162,186, 77, 62, 36,105, 17, 94,101,230,144,227,110, 32,165,105, 41,168, 80, 58,224, 55,150,236, 99, 16, 10,244,
-156, 50, 59, 80,198,185, 93,230,211,203,222, 53,149,195,152,171, 53,170, 68, 43,162,219,127,195,147,105, 11,101,240,235,149,236,
- 9,160, 85, 77,122, 17,172,160,186,117,171,240,202,180,214,238, 74,149,252,140,249, 34,176,121,111,198, 87,150,229,129, 57, 39,
- 48,229, 72,121,219,149,246,114, 3,175, 98,214, 9,100, 41,171, 68, 74,141,173,144, 40,169,110,160, 2,226,201, 77, 75,104, 78,
-182,113, 90,155,192,215, 74, 16,102,130,169,247, 13,195,197,113,108,126,232,249, 47,213, 86, 11,204, 23, 47,113, 71, 22, 99,232,
-123,149, 34,219,166, 88,158, 74,214,228,107,172, 6,231,219,202, 91, 4,251,109,184,149,160,212, 10, 0, 70,152,191,141,178,200,
- 24,214,130,149, 22,219, 87, 2, 84,244, 85,118,227,140,223, 19,229,164,197,123,132, 60,176, 90,162, 99,238, 56,146,206,119,116,
-192, 97, 97, 24,179,109,189, 80,167,163,202,126, 35, 14,205, 9, 4,212,195,109,195,221,168,115,109,143,187,238,150,132,234,250,
- 77, 76,248,167,219, 98,231, 21,235, 63, 69,115,135,206,181,191, 13,189, 92,115, 30, 36,228,168,145,236,242,211, 29,231, 27, 22,
- 75,196,155,109,162, 96, 88, 86,199, 89,216,166, 18,230,213, 1,185, 43, 69, 71,120,161, 7, 81, 54,235, 49,111, 38,166, 96,230,
-148,224,105,231,222, 72,208, 10, 40, 60,107,227,211, 54,192,102, 97,188,175,145,227,184,132,217,243, 81, 22,244,236, 75,107,144,
-212,167,230, 74, 18, 72, 41, 66, 11, 2,171, 36,171,109, 18, 58,250, 53,211, 33,152, 58, 48,231,166, 88,212,160,242,236, 70, 6,
-190,166, 63, 3,223, 34,118,222, 55,179, 79,243,193,230, 58,200,187, 29,232,220,164, 99, 28, 47,104,203, 45,226, 19,150, 54, 92,
- 80,141, 63, 35,117,137, 45, 7,153,125,215, 84,184,176,214,170, 20,160, 58,186, 16,227,106, 25,237,214,245,151, 8,216,200, 44,
- 4, 41, 24,175,103, 12, 62,126,202,133,117, 35,151, 66,226,122, 79,179,211, 93,218,229,175, 50,124, 91,198, 49,231,221,254,240,
-183, 38, 67,169, 30,249,115,146,226, 11,129, 41, 52, 5, 78,184,119, 33, 0,158,130,180,244, 13, 98,239,238, 97,183,126,152,154,
- 92,227,211,141, 63,107,182, 92,220, 16, 15,116,124,184, 87, 51,243,239,196,195,143,164,123,229,154,197,120,181, 95,239,171,184,
-123,164, 56, 86,183, 5,215,107,170, 35,171,142, 36,169,182,130, 59, 84, 84,122,119,234,188,252, 84,128, 29, 26, 71,101, 91,197,
-202,109,184,112, 87, 19,210,166,154,217,127,153,187,117,210,217,108,153,117,137, 10,227, 29,212,210, 83,236,182, 19, 38, 59,106,
- 2,187,118,128,149, 4, 30,180,212,109, 79,121, 71, 82, 55, 14, 78,141, 8,140,233,120, 24,116, 31,170,185,175,230, 83,202,223,
- 28,114, 62, 89,103,228, 92,122,237,117,179, 89,242, 96, 21,127,183, 88, 20,220,123,116,155,138,170,180, 75, 40,240,202,219, 47,
-245, 75,219, 72, 5, 64, 42,149, 82,137,187,178,221,102,181, 97, 96, 0,166, 75,209, 89,107, 73,204, 4,193, 62, 99,232,225,245,
- 81,220, 15,202,134, 41,135,176,204,203, 19,239, 45, 32,133,128,157,169, 82,149, 81, 85, 40,132,110, 53, 61,164,234, 96,223, 37,
-151, 7, 83, 23, 50, 2,112,171,193,131,226,136,143,110, 74,233, 84,161,176, 9,217, 85,168,166,160,215,167,167,213,168,239,187,
- 47,170,135,156,106, 76, 77,173,185,177, 12,117, 20, 7,130, 86,150,138, 83, 85, 84,142,206,206,218, 82,186,104, 93, 22, 21,166,
- 78, 20,232,158,217,129,192,188,177,101,185,161,182, 88, 76,108, 98,231, 29, 82,122, 37,181,166,235, 21,178,180,158,148, 41,223,
- 65,234,248,117,214, 60,167,188,115,247,120,132,106, 73, 14, 8, 56,247, 77,115,175, 50, 35, 18,109,228,167,218,109,115, 55, 34,
-205,237, 22,199, 36,198,142,135,102, 73,105, 11,240,118, 55, 86, 22,232,236, 27,169,217,235,215,183, 54,189,154,230,235, 75,159,
-221,105, 56,244,165,121,178,226, 12, 42, 59,139,200,119, 64,255, 0,137, 62,208,195,145,148, 64,218,201,240,220, 79,164,212,131,
- 93,108, 36,229,168,203, 82, 57, 8, 61,117, 73, 43, 7, 10,242,102,107, 50,226,167,225,197,101, 48,153,116,109, 72,105, 59,164,
- 4,244,253,170,119,250,181, 46,219, 98,138,212, 7,188,234,112,233,202,162,146, 27, 84,243,150, 44,247,182,239,179,102, 90,158,
- 92, 38,110,150,249, 41,186,251,147,139, 93,206,250,252, 52,237, 97,165,150,193, 2,189, 8, 10,161,245,235,207, 30, 99, 94, 56,
- 93,203, 36,145,196,198,233,110, 15, 44,112,205, 9,111, 17,219,134, 53, 71,117, 49, 46, 39, 72, 7, 12,211, 37,170,174,231, 32,
-140, 66, 37,150,199,146,218, 47,175, 49, 14, 76,133, 93,161,193, 83,150,203,146,229,205,221,225, 23,214,133, 41,175, 12,208, 37,
- 72, 32, 26,107,142,223, 69, 45,203,229,117,172,205, 4,129,164,168,115, 16, 1,169, 58,211,136,168,205,179, 36,184,130, 19,135,
-232,235,168,101,236,194,209, 50, 85,230,231, 50, 52, 75, 26,152,132,236,235, 84, 24,119,167, 64, 91,137,116, 2,133,164,239,121,
- 10, 66,133, 64, 73, 3,226,210,159, 20,172,107, 35, 97, 47, 4,128,226, 90, 58, 51,232, 67,233,169,177,219, 57,128, 1,138,116,
-209, 8, 28,203, 14,227,107, 85,134,249,100,182, 55,113,153,225,125,223,145,251,243,230, 44, 23,119,238, 91,174,182, 84,164,109,
- 40, 0, 20,167,167,125, 53, 10,227,151,101,100,190, 52, 50,184,176, 46,166, 32, 82, 19, 0, 15, 79, 89,162, 22,197,135, 83, 79,
-161, 42, 80,195,243,184, 81,113,123,150, 19, 42, 28, 43,205,238,228, 87,115,111, 44, 84,181,201,129,109,182, 66, 5,231, 19, 13,
-176,166,129, 82,138, 83,181, 69, 68,142,202,107, 49,186,237, 50, 73,112,219,192,226,200,219,221,240,208, 2,231, 28, 6,162,135,
- 14,145, 72,124, 78, 99,245, 14,140,169, 91,141, 45, 88,182,115,151,220, 45,185,158, 39,117,200,177, 89,150,187,156,184, 87,104,
- 23,133,199,106,201, 33,212, 5,135,219, 70,208,165, 45,132,168, 41,108,212,212, 5, 16, 14,168,185,186,226,239,106,178,108,182,
- 83, 50, 57,154,230,130,215, 53,117,133,200,246,228, 15,102, 85,103,100,230,177,200,236, 79,163,229,233,171, 29,131,225,158, 92,
-177, 24,182,214,109, 57, 5,230, 23, 37,218,151,126, 77,198,215,126,131,114,103, 29,206,236,236, 41, 30,233, 15,196, 96, 68,151,
-111,121,228,189,226, 52,226, 84, 64, 41,170,136, 73,161,227,123,254,233,204,155,211,158,100,137,142,178,126,141, 46, 97,143,196,
-133,216,234,122, 59, 83, 94,208,136,225,130,170, 12, 69,107,237,157,107,183,133,152, 35,218, 14, 5, 81,223,229, 24, 98, 48,227,
- 81, 91, 60,201,121,226,252,213,220,133,219,211, 76,100, 56,116,153,240, 44,241,156, 64,189, 74,183,182,192,113,144,183, 29,148,
-153, 97, 72,121, 47, 20, 45,160,158,162,135,215,173,115,249, 38, 14,101,177, 22,229,132,199, 40, 5,201,220, 14, 37, 14, 1,186,
-113, 8,160,174, 24,213,127,243, 23, 57, 31, 24, 3,175, 60, 58, 49,237, 74, 83,228, 47, 48, 57, 87,155, 78, 90,198,102,102, 22,
- 59, 74,227,227,214,233,145,113,251, 46, 29,141,219,177,137,111,205, 91, 12,188,235,146, 75,169,109,231, 27, 42,140,119, 15, 22,
-128,159,101, 32, 26,106, 55, 44,121,121,107,229, 30,215, 51,108,229,122,202,224, 94,233,100,124,129, 20,128, 26,138, 1,239,127,
-151,180,148,171, 75,173,242, 77,212,136,158, 26,140, 84, 70,134,144,160, 47, 90, 97,211,157, 71,190,104, 49,190, 48,183,228, 88,
-116, 94, 38,195,242, 43, 71,255, 0,226,240,175, 89, 93,171, 40,186, 50,184,179,239,142,130,183,221,109, 13,169, 97,182, 80,170,
-209, 41, 87, 94,241,173, 15,150, 91,150,231,115, 5,195,247,107,136,222,124,103, 50, 55, 70,210, 11, 89,144, 4,144, 20,244,148,
-244,213, 13,241,136, 57, 97,111,106,241, 53, 93, 51,156,159, 27,106,202,150,225,198,136,185,202, 83, 5, 41,135, 24, 22, 32, 17,
- 66,224,105, 52,246,170,161, 74,145,217,174,229,177, 89,202,226, 28,226, 81, 14,124,122, 22,176,194, 23,252, 73,120, 36, 51,160,
-209,108,154,237,132, 93,176,156, 41,139, 14, 52,212, 44,141,249, 73,126,235,149,204, 99,194,121,254,138,107,193, 81, 77, 17,181,
- 42, 88, 93,118,250, 53, 62,214,218,226, 25,230,116,207, 38, 52,238,176, 31, 74,211,209,197, 51, 37,145,206,114,179,128,232,168,
-246,248,213,146,212,133, 34, 10, 88,184,220,100,192, 90, 92,117,129,226, 34, 27,141, 16, 2,212,226,168, 86,165, 82,190,200, 26,
-157,106,249,102,112,212,173,104, 56, 14,159, 69, 79,135, 91,129,224, 22,146, 45, 89,196,123, 38, 53,145, 71,153,102,102,235,147,
- 94, 18,136,214,155,188,186, 60,221,174,216,224, 41,121, 41, 79, 64,130, 15,205,160,237, 38,186,153,121,181, 62,242,104,203, 30,
- 91, 27,113,115, 71, 19,194,166, 51, 75, 70, 34,152,177, 36, 93, 39, 71,122,205, 12, 37,126, 59, 79, 73,146,164, 81, 14,169, 1,
- 59,212,130,162, 43, 79,103,176,106,213,237,100, 68, 61,220, 50,166, 94, 67, 14,178,122,169,172,233,101,196,149,165,138, 60, 66,
- 16,148, 10,212,132, 83,218, 61, 43, 93, 72,214, 87, 26,125,152, 97, 70,163,200,117,191, 29,166,218,109,110, 50,199,182,219,201,
- 43,104,120,132, 2,170,247, 20,146, 53, 18,230, 54,220, 22,151, 40, 11, 78,232,210, 23,166,131,134,185,110, 23, 67,161, 46, 33,
-165, 35,109, 58, 4,237,238, 79,119, 81,164, 92, 66,198, 4, 5, 13, 17,115, 80, 32,167,173,166, 68, 63, 13,199,102,198,151, 41,
-182, 17, 33, 73,109,149,164, 56,218,202, 84, 17,237,168, 20,143,164,166,228,237,169, 26,204,222,198,246, 16, 24, 64, 37, 51,226,
- 56,229,213,215, 71, 27, 1, 82,106, 75,157,109,189,221, 35, 38, 37,223,238,198,100, 66,143,109, 83,115,124, 84,132, 64,183,186,
-193,113,180,173, 72,232,129,233,233,243,187,117,155,138,234, 11, 82,177,135, 16,226,236, 19, 50, 10, 28,243,250,169,233,152,241,
-221, 40,169,194,144,134, 83,115,188, 91,163, 99,151, 71,215,120, 77,190, 56,182,227,142,182,218, 35,181, 13,149,172,169,192,144,
- 91, 78,245, 57, 90,111, 89, 38,131, 83, 29,180,195, 99, 41,185,136,104, 46, 58,158, 49, 36,148,195,142, 0,116, 12, 40,155, 54,
- 8,152,211,101, 78,185,110,105,198, 98,190,244,118,148,165,176,247,138,148, 57,225,239,173, 69,118,146, 43, 74,118,234,215, 64,
-148,171,128, 39,134,117, 20,188,184,162, 97, 73,101,246,212,148, 37,164, 5, 81, 30, 19,235, 4, 37, 14,117,238,232, 8, 26,144,
- 35,113,207,209, 70, 16,112,162,158, 2, 22, 36,111,144,230,209,185,198,213, 65, 85, 20,244,161,168,235,167,181,232, 68, 24,209,
- 58, 69, 68, 20, 18, 28, 92,101, 5,208, 17, 66,186, 17,232,248,136,235,162, 35,196,195,141, 26,107,192, 86,235,145,227,143, 25,
-198, 82,132, 40,108,250, 38,192, 27,171,251, 95,229,210, 91, 31,134, 80, 28,122,232, 53,129,133, 43, 79,102,191, 53,205,158, 23,
-206,238,222, 59,171, 74,105,220, 40, 87,222,242,122,167,218, 35,187,179, 91, 15, 31,162,181, 40, 40,116,109, 34,128,138,250, 52,
- 98,122, 48, 5, 25,109,186,158,222,238,186, 95,196,245,208, 0, 26,245,198, 16, 69, 73, 29, 52, 62, 38,129,104,162, 10,216, 13,
- 7, 83,217,167, 60,117,160,128,208,169,110,169,249,160,215,213,160, 46, 58,233, 36, 14,138,215, 99,109,246,142,158,141, 44, 92,
-117,208, 13,109,110,151, 18,163, 68, 2, 15,112,209,248,244, 16, 82,129,113,196,178, 18, 26, 38,163,180,127,155, 68, 38, 83,157,
- 25, 2,139, 34, 51,175,251, 99,217,235, 66, 15, 79,213,167, 62, 33, 56,210,116,131, 67,162, 11,133, 84, 61, 5, 59,125, 58, 51,
-114,156,104, 8,197,110,108,174,174,171,175,102,139,227, 40,196, 66,189, 69,169,180,138,184, 59, 59,105,223,249,180, 13,223, 93,
- 24,137,180,113, 54,214, 85, 74, 36, 0, 59,254, 15,139, 73,248,179,211, 74,240,218,107,101,218,210, 8, 80, 20,167,229,232,210,
- 77,221, 40, 68,218, 53, 18,222,234,220,232,157,194,189,221,148,249, 53, 95,113,115,215, 86, 86,209,138,191,222, 77,218, 49,103,
-102,168, 82, 0,241, 32,217, 86,165,158,212,150,215, 32, 4,246,119,238, 39,226,215, 29,243, 14, 96, 77,187,137,203, 95,204,218,
-239, 62, 82,181, 29,114, 0,224,207,157,213,118,221,152,211,168, 32, 30,129,123, 77, 58,212,245, 30,142,189, 70,185, 20,243,248,
-129, 13,119, 72,225, 44, 43, 76,135,173,205, 73,201, 45, 97,196,181,225, 53, 39,222, 22,157,128,169,199, 25, 27,144, 59, 58, 13,
-244, 39,224,167,126,170, 35,128, 73, 59, 1,201,106,124,146, 17, 25, 78,138,146,220,121,150, 82, 86,235,136,109, 41, 21, 42, 90,
-130, 64, 3,225,214,236,200,214,241, 21, 66,132,212, 39,157,242,103, 17,227,143, 34,225,151,174,196,235,182,255, 0,245,136,243,
- 46,113,152,124,197,113,174,197, 52,167, 65, 40, 34,157,169,235,170,217, 93, 19,158, 92, 90, 9,235,167, 88,247,123,173, 39,209,
- 92,175,243, 79,248,196,241,151, 15, 70,159, 3, 19,122, 53,214,232, 25,125, 16, 54, 44,169, 18, 93, 72,160,240,246,165,107, 89,
- 10,167, 96,160,233, 82, 6,149, 9,154,232,233,136, 96, 61, 0, 85,132, 91,113, 35, 84,164, 48,122,220,125, 21,242,211,230,251,
-207, 23, 39,121,159,202, 33, 95,150, 94,198,153,128,185,239, 15, 1,208,236,219,139,243,130, 1, 83,190,201, 74, 16,202, 17,181,
-180, 36,158,213, 18, 77, 64, 76,237,191,101,109,137,123,228, 58,156,239, 80,171, 15,137,108, 64, 50, 44, 26, 7, 20, 83, 80,111,
-150,222, 97,186,112,127, 40,199,228,149,194,110,233,121, 17, 37,195,251,198,108, 95,126,147,108, 92,242,128,185,109, 36,165, 68,
-173, 41, 73, 73, 41,235,180,154,105, 59,222,222, 55, 72,124, 16, 80, 42,167, 74,112,169,155,117,212,108,145,101,200,251, 43,173,
-121, 47,226,209,149, 47,142, 19,129, 92,239,120,246, 87,143, 60, 30, 42,140,167,149,110,186,132,201, 39,123, 74,162, 86,217, 73,
- 82,141, 73, 0,143, 65,213, 36, 27, 91,217, 23,130, 1,106,113,171, 59,157,146,222,105, 68,204,152, 39, 65, 35, 10,169, 23,222,
- 92,143,200,238, 11,148,204,161, 83,241,201,142, 71, 76,187, 50, 47,110,206,129,105, 46,237,240, 8,109,199, 21,245, 36, 20,168,
-145,222, 14,155,248,103, 91,230, 59,221, 36, 99, 90,155, 8,226,141,168,210, 9, 28,122,104,107, 63, 27,216, 34,100, 17, 46,145,
- 29, 99,221,230, 41, 38, 67,105, 32, 2, 77, 54,186,158,234,143, 72,212, 87,221, 61,205, 45, 53,103,220,140,235, 2,174, 18,166,
- 65,181,217, 17, 1,203,131, 78, 52,182, 54, 71,105, 74, 10,123,121, 2,131,214, 53, 70, 90, 75,149, 42, 21,235,219,164,187,162,
-159,156,101,120, 76,155,106,236,247, 85,169,113, 65,116, 69, 11,114,129,128, 85, 90, 80,244, 0,215,224,212,227, 30,144, 8,206,
-184,167, 49, 74, 36,156,200,206, 53, 59,218,102, 35,238,196, 66,142,250, 91, 29,119, 20, 0, 73, 73, 42,218,154,129, 80, 58, 14,
-223,207,166, 92, 0, 42,149,158,248,135, 3, 82,110, 41,144,174, 20, 7,155, 32, 56, 18,183, 3,244, 27, 66, 74, 9, 20,235, 74,
-130, 58,138,122,117, 30, 67,141, 25,118,163, 82, 77,134,233, 21,197,162, 74,202, 18, 86,177,176,164,210,170,168,237, 4,127,147,
- 81,222,227, 68,227,194,164,174,112,129,107,155,229,163,145,174,200, 91,104,122, 53,186,204,219,234,105, 85, 21, 85,230,220, 90,
-169,167,237, 10,116,215, 90,242, 54,119,197,204,118,169,254,176,123, 60, 55, 86, 27,158, 83,249,116,164,240,211,255, 0, 80,174,
- 35,221,102, 66,109,213,148, 0, 86, 1, 27,143, 90,126,109,125, 28,179,123,136,198,188,191,184, 93, 38, 85, 18,101, 92,129,110,
-198, 27, 68,153,236, 76,149, 29,213,169,144,168,140,151, 26,142,178, 13, 22,234,128,246, 18,147,212,234, 47, 53,110,178,237, 22,
-134, 72,148, 57, 70, 32, 2,131, 50, 80,144,184, 86, 86,230,233,196, 20, 41, 85,207, 32,230, 67,104,147, 98,188,174,235, 38,225,
-144,195,102, 99,172,253,213, 36,219,173,232,113,247, 82, 97, 45,232,228,178,167, 29,142, 18, 9,220,146,149, 10,131,175, 61,238,
-124,235,123,191, 67,225,137, 30,198, 49,231, 83,245,123,236, 57,181, 2,166,120, 98, 18,163,155,189, 88,143,144,168, 74,255, 0,
-205,217, 46, 85,145,228,151,171,142,106, 32,100, 86,233, 78, 92, 83,112,155,109,142,213,145,245,186,221, 95, 74,155,140,141,137,
- 46,182, 66, 83,236,208,158,240,117,204,183,123, 23, 88,178, 59,103, 48,201, 25, 5,164, 7, 18,228, 37, 70, 36,149, 67,137,199,
- 10, 96, 91,178, 65,222,244,117,213, 64,186,114, 13,218,251, 51, 47,149,107,110,227,113,153, 62, 33,113,251,128,148,224,240,155,
- 96,237,117,244,160, 10,169, 42,160,160, 61,154,183,143,109,109,163, 97,107,203, 90, 1,201, 7, 28,135,109, 72,101,184,104, 1,
-201,133, 66,146,103,166,227,113,155, 42,107,139,128,255, 0,186, 23,150,183, 27, 43, 18,223, 66, 83,208, 84, 10, 21,245, 58,188,
-210, 96, 96,107, 2,133,245, 10,127,222,194,142,219,174, 81, 90, 84,216,140,198,118, 91,115,151, 29,134, 39, 74, 6, 35, 44, 45,
-116,169, 41,219,216,146,123,126, 93, 53, 52,110, 40, 84, 2, 49, 32, 98, 77, 37,236,203, 28,106, 80,180, 93,173,112, 99, 55,143,
- 72,104, 72,157, 18, 98,148,110, 17,165, 55,238,165, 15,123, 33, 30, 16, 72, 81, 9, 81,170,136, 93, 53,157,186,181,154,105, 12,
-193,200,194, 50, 32,174, 29,127, 54, 20,195,227,212,117,138,182,124, 99,158,113,157,183, 26,114, 45,210, 68,235,125,253,139,164,
- 59,123, 48,109, 54,165, 95, 22,235, 9,142,234, 31,185, 7,220, 33, 12,130,225, 74, 11, 36,130, 65, 52, 52,215, 34,230,189,131,
-115,188,186,253,136,107,161, 44, 36,151, 59, 64, 93, 65, 24,128, 41,195, 29, 67,211, 82,236,236,225,209,226, 73, 43,154, 75,189,
-208, 23, 15,155, 58,125,243, 99,143, 99,152,246, 47,151, 98,247, 60, 49, 45,229,246,149,187, 24, 69,180,169,140,138, 36,136,141,
- 24,164, 7, 27, 11, 97, 42,125,106, 42,240,210,181, 44, 30,222,154,204,242, 91, 13,204,211,217, 93, 50, 85,133,232, 73,114,176,
-135, 29, 89, 20, 40,209,196,128, 42,210,230,102, 78, 26,246,241, 40,152,224,128, 99,233,170, 86,140,186, 51,146, 18,171,212, 95,
-191, 22,252,181, 7,109,110, 45, 81, 18,221,197, 41,218,167, 84,232, 72, 81, 32, 10,209, 67,169,237,215, 94,126,208, 90,207,216,
-187, 66, 15,120, 99,134,104,159, 85, 68,195, 87,123, 26, 84,228,236,251, 25,127, 63,114,233,198, 6,235, 6,197, 30,215,107, 22,
-243,125, 88, 50,173,242,210,211,105,144, 82, 90,216,163,181,221,192, 56, 61,165, 14,186,135,203,123, 37,203,108, 4, 91,166,151,
- 74, 92,229,209,145, 10,116,231,134, 73,134, 66,151,112,230,120,186,226,203,167,141, 56, 78, 61,150, 95,113, 88,156,153,123,155,
-101,198,236, 55, 81,122,178, 89,100,136,242, 37, 72,200,174, 86,182,210,181, 37,196, 5, 41,212,161,223, 18,158, 42,200, 0,244,
-166,163, 91,221,219, 90, 94,127, 45,129,174,146, 70,150,185,224,144, 3, 26,226,152,112, 36, 38, 67, 19, 78,207, 23,236,252, 87,
- 20, 9,130, 98, 79,213, 80,126, 76, 35, 42, 51, 13,187, 37,199,140, 56,238,137,114,161,183,238, 73, 68,133,245, 1,107, 80, 59,
-186, 86,128, 13,117,123, 32, 88,112, 25,228, 14, 56,117,116, 86, 81,142, 33,199, 12,206, 71, 28, 41,189,101,184,199,186,202, 98,
-195, 14, 35,118,246, 91, 82, 4, 9,142, 73, 83,170,241,251,202,214,176, 18,128,174,222,131, 86, 19, 68, 96,105,149,228,187,164,
- 39, 10,149,164,198, 53, 56,169,236,167, 6, 93,142, 11,109,157,121, 1,191, 67, 84,246,110,126, 28,107, 50,107, 49, 79, 22,156,
- 9, 89, 83,162,129, 99,165, 77, 5, 59,180,213,157,203,101,127,134, 24, 64, 35, 60,147, 14,138,145,110,243,145, 24, 37, 48, 87,
-107,148,227, 45, 92,174, 78, 80, 60,151,118, 68,167,186,169, 41,119,170, 84, 18, 41,236,165, 68,106,195,197,214,116,197,195,141,
- 57, 36,128, 20, 35, 26,108,166,124,235, 60,169, 12,196,144,143, 20, 3,185,212, 13,199,219, 20,173, 8,239, 73, 34,154,148,232,
-219, 48,239, 12, 40,157, 11,102, 0,145, 67,155,194, 25,240,214,227,113,157, 49,154, 90, 1, 45,237, 11, 42, 79, 74,208,118,212,
-233,163, 14,160,129,113,160,216, 9, 40, 48,164,166,214,169, 33,201, 97,194,163, 37, 74, 42,108,116, 52,233,208,244,236,212,159,
- 8, 32, 20,243,222, 98, 58, 72,202,134,145, 14,108, 22,162, 58,233, 44,123,202, 22,235,109,147, 71, 20,216, 52,173, 5, 79,192,
-116,202, 49,196,140,248, 26, 70,176,229,161,109,138,148,220,173,155,138,140,144,218,220, 75,181, 72, 41, 66,133, 13, 70,152,185,
-179, 19,181, 6, 9,149, 19,228, 13, 11,192, 84,187, 97,111, 33,202,174, 72,183, 89,220,138,110, 23, 84,125,216,150, 28,163, 13,
-190,180, 26,165,189,235, 77, 42,118,238,169, 87,118,176,155,131, 45,246,150,234,156, 20, 97, 85,205, 58,240,165,192,215, 72,123,
-188,105, 10, 45,169,214,238,235,133,113,109,105, 16,222,116, 72,247,113,188, 37,109,146,133,109, 34,128,208,138,130, 14,165, 92,
-220,254,200, 73, 25, 5, 70, 20,135, 18, 10,113,164,119, 98,180,236,135,140, 98,167, 24, 67,207,109, 83,228, 13,237,166,189, 86,
-123, 43,240, 13, 75,141,238,115, 70,172, 28,159, 36,164,185,229,184, 28,235,214,156,101,164, 36, 56,202,124, 48,178, 5,125,175,
-106,157,189, 19, 83, 65,217,160,230,185,199, 60, 41, 39, 83,171, 79, 1, 42,140,243,142,173,170,165, 72, 33, 85,250, 68,110,236,
- 1, 36, 84,215, 74,212, 87, 1, 64,184,130, 52,209,112,180,123,187,140, 46, 56,112, 44, 31, 13,242,104,164,154,245,211,140, 7,
- 60,169, 72, 87, 80, 53,137,137, 37,134,144,242,153, 80, 97,196, 41,117, 32, 16, 61, 99,160, 58, 79,136,215, 18, 23, 26, 35, 32,
-118, 0,227, 67,110, 62, 15,137,181,223, 4, 35,111,137,179,232,246, 31,218,173, 59,107,210,186,109, 10,162,133,162, 94, 24, 45,
-125,230,184,232,108,116,234,125, 26,191, 18,214,184,132,162, 30,254,148, 40,238, 5, 39,214, 15,249, 52,191, 21, 41, 39, 10, 62,
-197,200, 31,155, 83,240,247,126,109, 15, 22,148,180, 43,146,202,146,122, 17, 94,167, 70, 38, 2,130,208, 13,168,169, 64,128, 79,
- 93, 44, 77, 68,220,233,192,202,155, 9, 27,145, 94,154, 79,141, 75, 74,220, 55, 29,205,219,134,223, 81, 35,252,154, 80,152,209,
- 37, 39, 41,128,219,132,164,251, 53,167,196,116,231,196, 81,105,165,120,235, 5, 59, 59,104, 43, 93, 39,198,163, 2,135, 66, 8,
- 82,130,123, 15, 80, 59,235,165,120,244, 52,208,111, 41,246,233, 74, 82,190,142,186, 49, 48,162, 66, 40, 70, 38, 20, 43,233,156,
- 74, 69, 13, 1, 35, 64,200,185, 81,180,209,105, 87, 86, 16, 72, 75,136, 80,239,246,133, 6,148, 28,122, 40, 23, 1,149, 38,140,
-138, 10, 8,221, 37,132,138,211,235,135,104,211,190, 27,206, 77, 62,170, 72,144, 81,214,175,209,230, 16, 24,117,183,135, 78,168,
- 88, 87, 79,139, 76,200, 29, 23,188, 8,167, 26,240,114,167,124, 11,131, 17,208, 22,178,144,125,126,191,139, 85, 87, 18, 45, 90,
-218,184, 10,183, 62, 91,115,107, 77,165,121,130, 95,150,219, 15, 75,137,104,240,183, 26, 85,182,215, 33, 43, 80,255, 0, 69, 78,
-166,191, 14,185, 7,152,238,112, 16, 59,130,184,122,195, 83,230, 53,223,124,158,153,161,247, 45, 57,150,176,143, 65,114,252,226,
-174, 5,147, 42,181,204,133,239, 94,240,130,144,183, 5, 58, 43,196, 88, 62,130, 59, 53,203,181,142, 53,221,154,224, 69, 70, 25,
- 71, 41,218,109, 87,150,212,220,196, 33,244,120,132,110,120, 32,120,102,160, 80, 30,242,107, 93, 54,208, 75,181, 10,106, 89,128,
-194,170,231, 49,121,180,143,135,217,103, 78,145, 49, 15, 60,148, 56,152,236, 7, 65, 75,138,235, 74,247,211, 86,145,135, 56, 83,
- 17, 68,111,100, 12, 5, 7, 26,224, 39,152,143, 53, 55,142, 85,186, 92,159,186, 78, 45, 91, 45,233,117,110, 55,227, 22, 98, 54,
-219, 0,158,192, 64, 3,182,164,157, 27,173,221, 25, 24,247,141,108, 45, 97,138,201,133, 6, 3,137,204,252,186, 43,133, 57,199,
- 35,127,126,115,105,179,219,125, 75,132,135,149, 26, 10,214, 54,149, 68,105, 71,219, 9,167,179,188,213, 65, 52,232, 40, 59,117,
-184,181,183,248, 72,131,120,241,172,221,196,198, 82,166,149, 96,199,106, 82, 91,246, 65, 42, 72,232, 7, 90, 87,178,189,250,139,
- 43,234, 35,164, 74, 94,106,206,119,120,155, 8,236, 77, 2,125,160, 41,240,122,181, 20,201, 73,241,105,187,144, 90,156, 83, 59,
-131,106, 20, 66,195,128,142,128, 30,254,205, 59, 28,169, 70, 38,168,166, 74,102, 91, 93,117,200,175, 73,138,227,173,134,212,228,
-103,148,194,214,209,165, 65, 41,160, 80,245, 26,141, 62,228,148, 33,198,159,130,250, 75,114,172,113, 6,151,236, 92,231,156, 98,
- 13, 55, 17,219,140,155,205,189,144,164,178,220,167,212,153,208,211, 74,125, 27,148,162,168, 59, 1,167,199,168,114,109,145, 72,
- 85, 16,213,171,121,146,224, 55, 65, 42, 42,193,113,151,154,155, 13,206,226,194,175,183, 9,174, 74,138,180, 36, 71,185, 72, 59,
-155, 80, 29,194,128, 31,135, 80,166,217, 90, 2,180, 83, 55, 92,193, 61,195, 11, 23, 10,190, 92,125,230, 38,195,119,184, 52,196,
-121, 12, 33, 46, 40,128, 1,246, 40, 40,122, 26,117,221, 67,217,170,155,141,188,198, 43, 39,112,194,224,166,175,118, 11,147,181,
-120,139, 41, 45, 20, 37, 15,161,183, 84,180,144, 0,104, 13,181, 4,251, 74, 61, 61, 21,214,122,224,104, 53, 75, 33,210,105,232,
-140,139,193, 43,183, 48,249,220,226,148,162,162,122,132, 42,155,137,160,160,235, 78,167, 76,150,174, 52,235, 94,152,212,163,143,
- 95,213, 6, 10, 37, 73,113, 42,109,128, 86,195, 77,164, 41,215, 29,114,161, 29,160, 26,146,170, 13, 71,115, 20,165, 7, 61,105,
- 71,204,119, 53, 90,113, 62, 2,127,139, 87, 45, 18,115,156,254,227,102,185,223, 33,183,243,108,152,252, 7, 19, 45,176,178, 5,
- 55,188,252,118,253,142,225, 82, 71,102,189, 51,253,191,114, 76,210, 94,127, 54,149,169, 19, 3,131, 23,237, 18, 19,212, 1, 56,
-215, 23,243, 55,153,163,108, 95, 5, 25, 87, 18, 11,186,128,200,122,235,145, 87, 75,170, 86,165,123, 84, 36,168, 31, 88, 63, 22,
-189,177,109, 32,111, 26,243,181,229,198,165,168,251, 45,184, 55,110,199, 38, 94, 92,178, 71,200, 99,195,106, 75,178,109,239, 54,
-167,104,216, 77, 16, 86,144,130, 54,169,100, 2,123,187,117,207,252,210,220, 35,125,147,173,222,197, 46, 77, 14, 36, 4,118, 62,
-232, 85, 46, 3,130, 86,114,114, 28, 64, 36, 2,114, 90,230,111, 39,228,201,203,100,220,238, 44,177, 2,192,168,150,246, 37, 72,
-134,166, 21, 29,249,114, 91,116,182, 4,125,192,111, 40, 79, 66, 66, 64,245,107,207, 59, 96, 22, 95,179, 66,224,231, 16, 49, 80,
-220, 23, 26,145, 20,126, 18, 12, 79, 14,202,174, 34,225, 46,230,210,132,118,230,186,211, 9, 72,188,188, 30, 83, 13,166, 2, 22,
- 42, 20,180,208, 43,112, 87, 93,195,166,174,230, 99, 99, 61,228, 95,178, 19,138, 84,144,208, 23, 0,188, 40,220,124,129,120,216,
-150, 44,113, 17,118, 76, 21, 73,183,201,241, 1,145,110,126,217, 53,181,108, 66,212,144,133,149, 52, 84, 72, 63, 46,160,207,102,
- 47,147,197, 58, 73, 67,134, 5, 65,199,215, 74, 0,188, 5, 80, 77, 48,132,198, 28,150,209,247, 22, 36, 48,164,183, 27,194,148,
-250,214,149, 56, 82,122,133, 84,108,161, 53, 2,186,181,240,157,167,222, 32,245, 10,113, 67, 65,162,172,170, 91, 91,235, 41, 14,
- 44, 85,176,138,151, 18, 5, 78,222,193, 65, 77, 41,237,107,147, 10, 44, 31,152,167, 77,190, 97,101, 78, 37,201, 34, 50,228,192,
-240, 29,145, 29,164,201, 84,132, 40,209, 73, 36,161, 68, 18, 71,111,110,160, 78,193, 38, 65, 81,202,135, 4,160,192, 27,158, 84,
- 98, 43,178, 33, 73, 76, 91, 4,169, 20,157, 38, 60, 71, 23, 37, 9,109,228,205,120,138, 32,144,106, 64, 38,181,236,212, 87, 1,
- 43, 75,238, 26, 59,160,156, 58, 7, 26,116,198, 30,129,165, 86,186, 41,201, 31,118,177,128,225,184, 10,243, 59, 36,235,254, 7,
-113,143, 21, 83, 18,147, 91,181,182,114, 67,128,180,218, 93,117,168,190, 2,182,133, 45, 68, 21,118,244,236,215,156,185,114, 89,
- 39,220, 46, 55, 15,134,123, 98,157,164,167,249, 92, 48,196,160, 46, 94,129,149, 89,221,219,139,102,248,100,168, 30,233,233,233,
- 95,162,169, 73,145, 2, 4,137,114, 46,214, 89,111, 51, 18,228,169,205,184,201, 95,135,122,103,199, 1,109, 41,240, 8, 66, 84,
-208, 80, 10, 77,104, 78,187, 1,108,147,181,173,134, 64, 9,106, 99,246, 74, 96, 83,138, 30, 6,161,120,109,141, 11,130,229,242,
- 52, 46,127,144,227, 82, 38, 74,145,132, 98,241, 49,168,153, 25,145, 41,156,120,169,119, 39,108,209, 86,170,248, 30,240,241, 82,
-158, 74, 13, 40,174,135,183,166,156,217, 54,171,168,154,214,222, 76,101,116,104, 53,251,161,197, 51, 65,145,234,164,220,200,217,
-100, 37,129, 26,185, 83,219,143,173,162, 5,167, 31,185,102,127,119,100,216,205,226, 45,241, 17, 44,227, 32,117, 11,198, 36, 50,
-189,165,229,176, 22,148, 49,189,196,130, 1, 7,112, 29,154,172,221, 26,251,251,137, 34,179,213, 20,172, 44,212,253, 1, 30, 8,
-203, 82, 98,131,163, 42,143,115,126, 45,163, 56, 2,120, 2,190,202,133,242,187,142, 63, 59, 35,149,110,180,176,242,226,174, 73,
- 96,201,132,175, 18, 18, 3,139,170,201, 27,104, 65, 20, 30,201,236,239,215, 74,219,173,165,130, 22,153, 14, 32,100,115,170,200,
- 91, 43,155,226,200,128,156, 83,163,170,151,240,188, 98,216,205,249, 87, 27,133,185, 79, 91,151,114, 84,107,115,165,183,209, 98,
-124,199,105,106, 87,135, 32,167,194,113, 65,192, 1, 71,118,145,127,120,231,199,161,174,239, 38, 57,106, 11,210, 51, 20,236,178,
- 56, 65,169,160,135, 81, 62, 67,155,106,125,187,115, 81, 4,134,110, 12,187, 33,151,195,113, 16, 96, 55, 21,195,188, 20, 16, 7,
- 80,123, 58,118,105, 91,116, 14,141, 74,171,112,227,138,245,208,178,150, 84,113,144, 14,170,102,149, 88,156,182,188,102,203,121,
- 83,203,141, 34, 62,246,212,212,117, 45, 3,169,220, 42, 5,107,210,190,141, 90, 53,242, 7, 0, 7,119,219, 68,246,200, 92, 28,
-209,135, 26,107,190,221,132, 90,247, 54, 86,110,166, 86,212, 60,149,213,160, 18, 58,130,154,119,250,117, 33,134, 71, 61, 15,186,
-149, 58, 50,224,113,202,147, 62,235,120,198, 83,175,164, 37,181,133,123, 41, 2,138, 61,128,215,176, 26,233,253, 96, 59, 10, 64,
-184, 26,176,204, 80, 80, 98,198, 76, 69,248,203, 13,248, 70,136, 74, 15,182,227,158,179,234,209,202,231, 18,141,167,167,113,123,
-148,210,143,143, 51,217,122, 74,125,233,150,218, 67, 72, 82,147,185, 76,182,128,118,164,124, 58, 13,136, 0, 80, 84, 55,163,240,
- 5, 13, 2,202,204,162,165, 48, 22,209, 7,104, 90,168, 66, 18,105,211,178,189,250, 55, 73,165,186,141, 25,102,146, 1,169, 30,
- 4, 11,155, 48,162, 66,135, 16,184,234,153, 69,208,205,105,223, 5,255, 0, 13,186,237, 29,118,208,164,212,138,117,235,172,117,
-211, 69,209, 47, 41, 82,131, 72,203, 58, 55,104,104, 33,171,146, 37, 93, 91,137,112,148,211,236,125,214,251, 46,174, 76,164,163,
-106,146,148, 45, 41, 52, 46, 21, 84, 1,232,235,170,187,167,119,218, 4,100,176, 16,117, 4, 65,218, 58,168,203, 29,198,154,233,
- 76,118,218, 13,190,195,136, 91, 37,192,165, 26, 80,144, 79,117, 58, 83,215,171, 18, 93,169, 65,194,152,121, 82,162,139, 71, 38,
-169, 37, 5, 84, 91,139, 74,123,150, 73,233,214,159,171, 78, 63, 17, 75,127, 85,122,251, 34, 67,137,125,207,163,115,171, 99,122,
-126,136, 20,118, 38,160,117,167,167, 74, 46, 17, 4, 24,209,120,129,131, 72,173, 67, 14, 45, 40, 11, 90, 60, 64,167, 20, 91, 41,
-232, 20, 59, 54,244,165, 41,161,169,163, 17, 77,131,167, 44,168,210,238, 14,248,110,161,109, 54,165,161, 59, 18, 21,212,134,200,
-236, 74,105,211,111,175, 77,136,134,160, 69, 1, 16,233,162,254,242,159,115, 13,117,219,237, 43,194,175, 77,221, 13, 59, 61, 29,
-116,239,134,117,234,193,104,120,125,234,251,203, 90, 41,219,232,237,211,198,117,173,163,153, 69, 23, 16, 43,169, 21, 31, 6,148,
- 46, 40,180, 86,161, 13, 48, 42, 84,148,142,242,165, 0, 6,148, 38, 38,134,138,247,223, 32, 52,157,207,202, 97, 9,236,170,221,
- 0,105,246, 9, 31,131, 90, 77, 17, 1,180, 10,242, 11, 20, 52,110, 92,232,212,175, 74, 43,113,175,196, 53, 38, 59, 75,137, 48,
- 12, 52,157,109, 20, 95,251,243, 97, 0, 35,222,129,169,166,224,133, 80,126,109, 75, 27, 69,206,122, 40,188, 86,208,202,202,108,
- 74, 70,241,112, 20,255, 0, 68,215,244,105, 63,203,110, 85, 52, 80,241, 27,211, 73,255, 0,223,187, 10, 86,164,123,217, 33,177,
- 95,171, 62,213, 61, 29, 52,240,217,238,112,238,231,215, 72,241,133, 35,202,229,120, 81,164, 45, 17,162, 45,212,166,129, 46, 19,
-177, 43, 7,213, 77, 89,193,203,175,123, 65,123,128, 61, 20,147,112,153, 81, 83,204, 40, 15,182,159,115, 9, 74,190,125, 87,216,
- 61, 93, 41,169, 63,250,206, 7,191,236,162, 55, 7,162,134,185,242,176,113,144,155,108,116,135,122,110, 91,202, 10, 9, 30,160,
- 52, 45,121,117, 15,237, 93,135, 85, 19,238, 73, 24, 84, 83,115,202,111, 83, 36,120,206, 77,125, 73, 42, 39, 98, 87,177,180,239,
-238, 0,122, 53,170,181,182,183,182,106, 53,162,162,184,151,103, 73,110,220,174, 42, 11, 38, 99,233, 10, 30,213, 29, 52,212,144,
-232,129, 29,209,234,164, 98, 41, 53,213,184,166,247, 9, 36, 16,176,122, 57,214,167, 79,139,166,142, 20, 64, 82,133,170,255, 0,
-118,177, 57,227, 68,148,176,149,128,151, 18,163,184, 20,142,189,148,212, 11,232,224,191, 9, 35,105,248,201, 97,194,164,248,188,
-197, 12,165, 13, 75,101, 69,212,160, 2, 91, 87,178,165, 15, 85, 58,107, 19,121,203, 69, 86, 55, 96,188,106,218, 9,201,165, 72,
-156,167,121, 90,156, 54,165, 8, 73, 40, 83,106, 83, 46, 31, 17,104, 89,170,122,250,136, 7,225,214,119,122,228,187,125,202, 7,
- 69, 43,137, 60, 15, 65,233,173,199, 43,243, 4,187, 29,195,103,143,161, 8,233, 29, 21, 56,113,143,154, 73,182,171, 93,219, 30,
-203,214, 96, 93,224,179,239,112, 36,190,178,152,215, 56,137,220,159, 17,165,118, 21, 2,148,239, 79,104,175,163,174,188,225,204,
-252,169, 54,193, 62,151, 5, 97,201,220, 15,233,175, 82,114,238,255, 0, 14,255, 0, 7,137, 9,199,237, 55,139, 79,213,208,106,
-180,243, 79,156,204,122, 59,207,174, 29,213,149,200,137,185, 18,154, 83,161, 14,238, 62,209,165,105,184, 21,117,232,117, 95,109,
-102,120,214,137,150, 47,155,133,113,239,204, 79,157, 73,121, 75,175, 50,204,247, 99, 50,201, 83,123, 80,178,132, 45,191, 80,235,
- 94,164,244,213,220, 54,173,104,171, 75,107, 35,105,136,206,168,173,251, 52,206,115,155, 68,150,227,177, 58,223,142,188,162,211,
-210,159,109, 77,191,121, 83,255, 0,178,129,180, 29,135,188,247,252,186,145, 20, 17,177,250,142,116,139,151,190, 92, 28,112,232,
-168,234,215,198,215,127,126,101,230,218,116,135,148,162,159,163, 33, 64, 36,245, 52,245, 83,191,187, 83,223, 56, 34,171, 36,171,
- 19,142,113,245,201, 8,175,132,226,159, 65, 72, 65, 41, 42,160, 34,157, 5, 59, 9, 26,172,150, 64,106, 35,141, 62, 92,195,110,
- 49,138, 66,153,170,232, 82, 70,222,149, 29,157,218,140, 94, 41, 45,198,147,151,131, 75,154,167,155,121,151, 0, 88, 32, 39,103,
- 65, 83,240,122,116,131, 40,109, 58, 24,180,210,187,113, 3,169,112,248,140,187,180,164,237, 33,163, 65, 79,136,246,106, 67, 46,
- 1, 24, 81, 0,149, 95, 51,110, 40,188, 69, 47, 42, 60,117,144, 43, 74,167,184,246,119, 13, 77,138, 96,234, 5,181, 85,114,124,
- 39, 37,136,249,125,168,238,178,243, 71,114, 92,104, 22,212, 41,217,221, 67,169,172, 34,144,230,210,134, 21,204,185,142, 7, 45,
-164,220, 89,148,164, 70,117, 46, 37,228,161, 74, 89,216,107, 66, 0,233,215,209,166,230,182,108,194,153,115, 86,186, 99,195,126,
-124, 44, 16, 89, 97, 55,155,211,113, 86,132, 32,236,121,229, 50,232, 61,125,133, 21, 13,212, 31,151,167, 89,139,237,141,207,247,
- 69, 65,154,215, 94, 85,109, 99,249,235,192, 36,169,151, 93,190,192,105,132, 4,168,169, 47,133,188,226,143,205, 74, 91, 66, 84,
-234,201,237,160, 31, 13, 53, 81,252,138, 81,192,212, 97,100,234,153,240,175, 55,140,102, 51, 90,137, 97,131, 39, 98, 25,113, 86,
-201,147, 40,193,247,243,236,180,232,109, 85, 73, 9, 73, 59, 66,143, 78,132,138,244, 23, 91, 6,217,107, 97,119, 27,239,155,170,
- 61, 67, 80,232, 31, 79, 93, 85,111,155,125,195,173,100, 22,238,211, 38,146,148,143,125,186,222,242, 43,188,219,133,226, 76,153,
- 19,228,200,121,201, 78, 73, 81, 91,203,117, 68,215,113, 53,236, 58,247,222,209, 61,180, 54,241,139, 96, 4,122, 70,148,201, 19,
- 4,175, 19,110,179,200, 38,120,153,117,130, 85,115, 94, 52,220,157,101,120,128,232, 94,225, 74,169, 9,234, 81,249,181,117, 29,
-243, 69, 80, 73, 40,117, 66,252,155, 7, 41, 69,130,230,113,219, 99,210,100, 45,150, 35, 42,122, 38,182,203, 76, 67,144,163,226,
-165,214, 92, 30,216, 77, 1, 73, 29,154,227, 94,106, 62, 75,249,237,152,230,183,194,105, 36, 21, 58,139,128,203, 52, 1, 56,250,
- 42, 19,154,215, 16, 74, 32,199,211, 92,237,228,187, 52,108,138,241,154, 55, 2, 18,125,225,135,109, 43,251,218,108,160,153,108,
-199,128,200,247,134,209,225,164,182,162,243,157, 69, 6,178,219,113,104,136,177,177, 53,132, 98, 70,162, 64, 76, 16, 97,153,171,
- 8, 94,216,144, 5, 29, 85, 90, 37,205,150, 44,223,117, 41, 73,139, 17,153, 42,240,155,143, 24, 38,108,181, 45,103,119,140,224,
- 21, 88, 71,112, 86,141,144,180, 75,226,102,228,226,112, 29,130,158,115,123,227,166,144,213,119, 54,232,139,137, 17, 78, 63, 10,
- 75,229,201,108,173,205,190, 36,164,167,110,226, 83, 69, 16,144,122, 3,211, 78,252, 47,138,224,231,102, 6, 4,116, 81,161, 46,
-199,162,147, 34,195, 92,215, 31,113, 33, 45,180,203,107,117,198, 82,186, 57,180,119,161, 10,237, 32,106, 68,146,248, 96, 46, 38,
-137, 83, 10,123, 99,150,217, 16, 38, 91,223,134,237,186,226,151, 92,143, 53,152,199,106,165,175,104, 36,143, 13, 73, 39,232,194,
- 78,234,244,213, 69,244,205,153,142,107,193,110, 97,120,122,250,233, 50,157, 96,140,104, 9,115, 61,222,236,165,194,107,123,243,
- 31,115,199, 96,175,198,108, 54,229, 74,145,183,104, 72, 32,158,128,105,113,198, 12,104,227,128, 25,253, 52,157, 37,193, 14, 66,
-182,139, 2,215,238,178, 39, 92,102,169,150, 94,124,197,136, 18,149, 37,216,179,137,173, 93, 72, 21, 74, 64, 29,167, 73,124,178,
- 23, 6, 49,185, 5, 61, 99,170,157, 7,162,166, 14, 51,230, 7,241,236, 3,144,184,169, 56,142, 23,122,127, 58,157,100,146,142,
- 64,190,194, 18,175,216,172, 43, 10,150, 84,152,107, 33, 37, 45,201,222, 55,147,214,157,131, 88,190,101,228,177,186,110, 54,155,
-167,196, 77, 27, 96,107,199,130,194,140,144,189, 49,112,233,106, 97, 86,208,238,226,218,218, 72, 93, 19, 92, 92, 66, 56,230, 19,
-128,166,195, 50,164,125,223, 50,223, 30,234,223,128,152, 83, 84, 91, 15, 23, 99,172,178,122,236, 74,144, 84,144,225,234,158,205,
- 76,185,182,107,100,108,166, 60, 84, 12,177,244,246, 85,107, 65,148,231,250, 41,179, 32, 67, 75,246, 89, 55, 73, 78,184,136,205,
- 39,116, 86, 1, 98, 72,104,146,162,154,144, 59, 73,213,164, 23, 18,134, 73, 27, 26, 49,226,113, 11,211, 77, 2, 99, 46, 0,103,
- 75,120,236, 36,228, 77, 95, 68, 54,238, 81, 32,180, 10,160, 91, 82,250,158,104, 40, 31,109, 78,184, 80,161,209, 61,128, 83,174,
-164, 77, 28,182, 38, 34, 75, 93,210,236,189, 67,166,153,186,146, 59,124, 93,153,200,225, 73,214, 44, 23, 47,186,100,240,113,204,
- 62,221, 38,109,214,224,234, 83,224,183,109, 15, 92,144,190,165, 65, 9,234, 72, 41, 29, 9,167,126,173, 46,247, 75,123, 88, 29,
- 61,203,131, 88,222, 36,225, 76,248,204,149,170,236,122, 49,169, 31, 34,190,228,246, 75, 91,220, 95,147,179, 22, 19,246, 83, 37,
-168,145,158, 97,180,182,210,129, 46, 46,142, 54,165, 36, 45, 75,234,174,189,123, 43,170,155,102, 67,114, 69,236, 4,185,175, 69,
- 63,160,240,167,152, 9, 33,222,138, 66,137, 98,198,227, 89,225,165,110, 78,185,100,215,104,242,209, 58, 59, 17,253,230, 52, 22,
- 18,226,106,224, 4, 13,132,244, 0,245,233,167, 95,123, 55,136,226, 0, 17,181, 17,112, 36,210, 37, 38, 65,193, 1,244,211, 43,
- 37,141, 97, 68,214,226, 91,163, 75,240, 35,186,210, 89,182,165,126, 55,189,184, 19,181,199, 74,182, 2,129, 81,243, 73,213,134,
-221, 44,206,110,185, 8, 83,199,163,160, 83,141, 61,197, 21, 27, 79,180,200,109, 79,220, 76, 7,162,194,143, 33, 45, 29,201, 33,
- 8,117, 68,208, 26,142,211, 67,171,232,222,215,160,212, 9, 34,157,107,215,186, 14, 41, 69,157,150,251,241,220, 66,194,148,132,
-138, 54,130, 74, 70,239, 78,208, 59,116, 65,129,165, 1,164,178, 17, 25, 81, 64, 70, 67, 8, 72,113,242, 73, 41, 5, 34,181, 78,
-227,216, 59, 53, 37, 16, 97, 75,145,197,197, 5, 24,118, 75,197, 27, 67,231, 98,255, 0, 97, 32, 4,251,127,194, 6,144,154,105,
-161,158, 84,189, 96,181,202,184, 73, 48,217,138,244,135, 20,195,206,169, 1, 6,131,192, 73, 89,232, 7,238,130,123,117, 81,186,
-203,225,176, 16,120,211,129,186,148,138,121, 70,156,166,161,161,183, 28,154,176,211,109,170, 60, 1, 44,166, 42,131,102,181, 52,
- 73, 39,253, 26,234,133,210, 22,168, 30,186, 6, 83,198,129,186, 93,156,186, 23,174, 73,140,150,159,101, 81,146,228,136,234,216,
-243, 30, 16,160,160,167, 82, 64,234,116,166, 51,252,220,125, 84,235,228, 47, 82,152,154,110, 94,100,132,199, 50,124, 36, 81, 65,
- 10, 14, 1,181,231,208, 71,180, 10,105, 78,158,157, 88,109,176,248,142, 32,240, 30,129, 72,181,140,189,196, 31,208, 40,130,202,
-216, 67, 10,101,101,183,222, 66, 2, 20,165,110, 8, 90,171,219,208,129,180,106, 85,180, 77,123, 30,247,133,104,192, 83,209,180,
- 56, 56,184, 96, 41, 82, 44,103, 95,106,148, 47, 6, 9,113,245,164,119,126,210,137, 52, 31, 46,170,164,239, 21, 1, 13, 70, 13,
- 47,113,211, 66, 22,194, 81, 70,146,173,164,109,109,213,160,239,116, 47,211,242,244,210, 89,130,175,170,144, 9,227, 90,169, 1,
-151,215,177, 43, 42,113,176,157,219,119, 39,112,237,238,235, 90,105, 44,113, 3,174,146, 9, 33,107, 61,214,103,128, 38,248, 10,
-247,127,120, 45, 7,188, 63, 99,119, 65,217, 74, 86,157,105, 77, 56,162,158,240,156,139,194,190,234, 36,228,246,216,160,165, 79,
-182,251,128,116,109,181, 5, 40,157, 51,111,111, 45,193,201, 7, 93,108, 12,128, 83,110,241,155,173,248,139,106, 26, 27,136, 74,
- 74,124, 69, 44, 23,125, 31, 22,175,173, 54,182, 70, 67,158, 86,152,124,184, 84, 81, 50,250,219, 72, 87,188,220,212,163, 82, 74,
- 75,229, 68,159,151, 90, 22, 57,163, 38,143, 85, 66,124,237,110,110,164, 7,114,203, 66,106, 28,121,215,232,123, 18,119, 14,154,
-151, 28,165,185, 32,166, 29,125, 27,120,209, 39,179,155, 26,202, 82, 27,123,217, 62,128, 69, 71,197,167,219, 51,186,105,167,110,
- 12,224, 40, 23,179,187,122, 88, 90,155,138,238,212, 2,162,225, 73, 89,160,254, 16, 9, 63, 22,132,183,159, 14,210,247, 18,131,
-160, 18,125, 0, 2, 79,160, 81, 54,252, 72, 67, 90, 49,235, 32,123, 78, 20,217, 95, 42, 88,146,175, 5,235,205,186, 51,128,244,
-106, 92,196, 68,112,159,244, 93,216,117,148,186,243, 23,106,177, 41, 60,207,103,235, 69, 51, 71,172,198, 5, 88,178,206,238, 80,
-172,141,123, 11, 79,204,107, 72,249,156,121,174,127,171,204,137, 33, 10, 61, 28,143, 37,185, 9,235,235, 65, 58,126,207,204, 93,
-142,248,233,138,250, 2,122, 12,141, 7,212, 72, 52,196,214,247,112,123,209, 60,127,180,209,201, 23,194,157,128,109, 89,170, 77,
- 82,170,212,124,154,214, 67,126,201, 91,169,174, 4, 30, 32,168,245,213, 91,239, 92,220, 13, 15, 34,244,153, 49,118, 84,111, 52,
- 9, 41, 72, 10, 66,180,243, 47, 0, 57,210, 62, 45,206,227, 69,226, 62,232, 11, 46, 56,160, 16, 18, 42, 21, 69, 18,125, 58, 55,
- 95,138, 2,229,195, 21,162,146,175,211, 34,133, 33, 53,113, 33, 64,141,194,134,135, 73, 23, 65,220,105,127, 30, 91, 72,143,100,
-215, 23,150, 18,178, 27,108,215,217, 73, 2,186,113,183,140,101, 48,251,183,203,198,146, 46,183,249,113,219,104, 55,191,115,149,
- 27,183,118, 83,191,215,165,124,120,162,141,238, 60,104, 8,121, 28,165, 41, 45, 59, 41, 74, 73, 29, 84, 87, 90,122,181, 26, 91,
-192,114,171, 11,107,146,210,134,156,104,187, 65,101, 33,197, 41, 36,146, 9, 37, 93,105,168, 47,191, 39,141, 92,178, 96, 56,211,
-170, 6, 74,203, 15, 54,228,103,155, 35,161, 88,223,221,170,171,139,165, 24,154,187,180,185, 38,186, 11,229,223,139,113,254, 85,
-227,158, 64,200,242,236,126, 45,206,200,252,100,227,214,133, 74, 20,116,205, 4, 60,251,204, 41, 37, 43,105, 77, 4,160, 7, 19,
- 67, 83, 64,123,117,231,143, 55,249,128,180,195,107, 19,187,192,235,114,122,128,249,235,210, 94, 77,237,174, 38, 91,183, 12, 19,
- 72,235,226,106,134,242,127,225,249,197, 19, 39,221,110, 23, 11,175, 33, 56,219,238, 60, 24,134,197,253,182, 24,142, 28, 86,212,
-237, 89,140,227,170, 13,215,246,148,117,201,217,204,119, 13, 65,221,245, 87,161, 34,148,129,128, 21, 9,171,200,215,151,204, 77,
-215,239, 54, 12, 66,231,145, 92, 98,244,131, 55, 45,187,187,125,240,222, 82,192, 83,201, 97,123, 99,213,176,154,131,225,244, 21,
-235,215, 82,217,189,207, 54, 14,114, 14,172, 41, 15,145,239,192,165, 67,217, 63, 8,251,227,210, 80,139, 94,196, 68, 37, 17, 97,
- 71, 97, 40, 67,105, 73, 64, 10,160,232,144, 10,246,128, 59, 40,107,223,171,123,123,228, 25,212, 57, 99,161,109,188, 15, 14, 52,
-198,216,106, 58, 74,219,222,203,139,113,177,183,196, 81, 21,216, 0,235, 68,212,116,212,230,222,168,170,137,152,106, 84,180,240,
-200, 76,150,182, 65, 0, 46, 57,116, 20,160,108, 66, 0, 10,168, 61,254,205,122,141, 37,211,173, 87,185,166,156,144, 56, 15,239,
- 23, 80,167, 33, 42,138,218,181, 85, 0, 81, 46, 31,205, 74,106, 59,231, 74, 49,221,167, 31,252,182,165,176, 28, 68, 74, 40, 44,
-164, 40,164,109,165,122,212,252, 99, 81,157,112,105, 97,244,155, 59,129, 55,179,225,189, 14,189, 59,146, 55, 54,162, 9, 4,126,
-141, 37,183, 5,166,131,158,181, 21,221,188,182, 55, 40,184, 85, 24,173,186, 43,114, 86,218,122, 10,210,131,227,212,182,223, 17,
- 77, 23,145, 80,110, 91,229, 46, 26,195,142,139,118,208, 55, 5,149, 54, 1, 73, 77,122,145, 74, 83,167,110,164, 51,115, 35, 10,
- 47, 18,171, 22, 85,228,250, 11,174, 58,166,173,169, 42, 21, 86,221,137, 35,113,238, 34,130,155,191, 46,154,150,205,215,174,155,
- 50, 84, 29,121,242,140,195, 42,220,213,191,101, 84,166,202, 20,223,176,151, 5,125,146,105, 84,250, 58,233,246,238,171, 73,241,
- 5,109,143,121, 97, 80,144, 26,106, 25,106, 75, 42, 74,219, 37,176,164,154,119, 30,241,160,253,204, 10, 6, 80, 42,236,241,143,
- 31, 73,199,152,101,169, 16, 92,143, 34, 50,208,122,142,169, 87,164, 26,118, 29, 84,220,220,137, 50, 53, 18,103,135,213,223,127,
- 11,251,231, 27,139,152, 48,149,248,209,212,213,190,246,202, 16,144, 18,173,180,105,250,128, 15,182, 1, 74,137,239, 0,247,235,
-181,249, 81,206,174,210,118,217,221,238,226,195,213,196,122, 56, 87,153,124,222,229, 97, 11,197,252, 67,222,193,253,189, 62,158,
- 52,204, 85,151,122,136, 9, 9,104,213, 36,154, 84,141,119, 33,186, 14,154,224, 79, 96,164,219,230, 61,107,143,103,184,201,145,
- 1, 87, 47,119,133, 37,212, 50,130,132, 61, 93,133, 37, 72, 42, 4, 18,132,146, 64, 61,186,203,243, 84, 13,221, 98, 29,221, 69,
- 80,156,209,185,146, 2,128,184, 97,198,162,200,193, 33, 67, 92,205, 28, 93,153, 74,141,127,228,235,230, 61,101,183, 98,183, 25,
-202, 69,146,243,147, 76, 85,176,195,136, 30, 75, 76, 62,251, 49, 19, 87, 82,232, 61, 3,130,157,228,141, 81,178,201,210,196,230,
-105,238, 22,224,226, 80,143, 64,167,138, 15,217,142,140, 72,170,179,203, 88, 84, 11, 38, 73,119,182, 66,185,226,151,215,226,219,
-211,113,149,247, 23,136,212, 40, 82,103, 4,168, 6, 74,141, 28, 89,221,243, 65, 58,174,248,118,217, 53,154, 37, 47, 4,128,163,
- 21,255, 0, 10,126, 16,112,196,167, 93, 87, 87,109,114,109,233,126, 60,152,105,222,125,151, 18,227, 59,222,100,172, 87,208, 54,
-144, 53,100,215,120,216,133,194,164, 7,234, 56,101, 71, 44, 22, 69, 56,125,245, 17,101, 56,164,169,212, 56, 93, 74, 84,216,118,
- 61, 10,145,212,165, 61, 91,235, 66,117, 14,250,225, 63,102, 72, 7,218,159,227, 69, 33, 45,234, 20,142,185, 45, 9, 78,186,234,
- 95,102, 74,131,225,183,155,120, 71, 41, 74, 79, 64, 10,122, 17,183,166,158,240,156,214,128, 16,140, 48, 69,163, 37, 6, 20,145,
- 38, 91,174, 60,183,193, 41,220,119, 5,147, 85,181,235,169,235,221,169,140,136, 6,162, 82, 88, 58,104,205,174, 74, 84,242,147,
- 40, 72,149, 16, 31, 25,216,226, 70,209, 38, 66, 71,179, 90,252, 61, 78,152,157,154, 64,211,129,236,202,150,225,162,149, 13,182,
- 66,136,148,166,196, 86, 20, 29,117,130,106,170,248,102,190, 24, 34,166,157,123, 78,153, 51,128,116,140, 78, 11,245,210, 26,117,
- 96,181, 50, 99, 62, 54, 57,112,199, 32, 72,141,100, 47, 92,109,223,124, 74,185, 55, 36, 92, 30,145, 30, 74,252,120,237, 60,132,
-173, 73,105, 77,148, 10,160, 0,170, 30,163, 88,221,218, 54,238, 81,202,246,185,232,199,105, 13, 77, 32, 16, 16,144, 83, 16, 87,
- 60, 71, 69, 73,122,196,208, 0, 69, 30,181,202,147,115,230, 34,206,200, 37,220,147, 9,230,151,116,121, 82, 18,193, 97, 76,161,
-157,196,251, 96, 41, 8, 72, 74,192,220,154, 10,117,208,216,100,116,113, 54, 45, 65, 27,130,168, 43,243,229,149, 50,248,221, 8,
- 67,237,161,109,106,190, 74,183, 73,133,100,109,184,214,248, 50, 89,102, 91,237,201, 73,144, 93,116, 18, 54,182, 8, 10, 35,106,
-170,186, 26,107, 64,199, 69, 27,154, 36,247,136, 36, 96, 83,215,195,178,161, 92,218,177,163,197,113, 80, 41, 38, 5,239, 41,197,
-111, 17,242, 12,118, 85,210,217,121,183,189, 34, 67, 87,135, 30,217,182,169, 83,100, 54,154, 18,225, 33, 68, 2,163,240, 13, 76,
-185,177,183,220, 34, 48,204,214,185,142, 64,158,223, 69, 51, 28,141,140,224,157, 9, 70,109,200,133,125,183, 93,157,157, 14,100,
-220,150,225, 25,229,192,158,166,215, 33,214,231, 41,196,157,229,199, 10, 82,162,163,184, 40,250,244,212,250,237, 92,208,210, 4,
- 77, 56,140,130, 37, 9,140,130, 70,185,174, 26, 23, 17, 82, 46, 17,105,201,237,230,241, 98,135, 42, 42, 87, 39, 27,151,116,121,
-249,113,131, 51,153,183,198,167,136,208, 81,170,145,226, 40,142,180,235,233,213, 38,233,121,111, 54,137, 92, 9, 73, 0, 64,112,
- 36,228,125, 20, 12,172, 35, 83,129, 69, 74,132,174, 44,187,108, 82,110,141,190, 99,153, 10, 91, 12,172,109, 81,222,154, 21, 42,
-190,209,173, 58, 87, 90,152,156, 39, 62, 25, 21, 42, 57, 90,226, 91,194,155,138,186, 78,145, 5, 54,160,233,158, 12,145, 39,193,
- 9, 11, 83,142,162,180,170,187,122,110, 39, 83,220,193, 25, 14,201, 5, 41,177, 2,226,241,129,164, 87,101, 4,202,123,199,100,
- 23,119,109, 90, 65, 73,240,150,154, 10, 84, 10,116, 3,174,159,107, 67,154, 18,157, 44, 45, 20, 73, 10,105,110,168, 58,130,166,
- 66, 79,213,168,111,169,244,246,233,194, 75, 70, 20, 67,187,158,116,109,164, 37,135, 18,165,199, 83,141,250, 20,118,147, 95, 71,
-103,102,155, 83, 46, 88, 80, 15, 25, 26, 91,145, 33, 40,109, 11,183, 61, 41, 47, 58,216,247,138, 44,182,176, 20, 5, 71,197, 82,
- 14,146,157, 32, 26,102, 54,185,142, 61, 20,177,141, 77, 16, 25,144,137,240, 85, 54, 36,144,134,156, 4,133, 52,132, 3, 93,192,
-208,148,145,214,148, 58,133,115, 19,110,189,210, 1,246,212,168, 95,225,189, 72, 86,165, 79,208,112, 59, 19,205, 49, 38, 36, 34,
-227, 83, 26, 98, 88, 10,120,171,195, 4, 3, 69, 0,123, 5,122,131,172,219,223,224,146, 28,120,213,196,118,113, 17,169, 13, 67,
- 92,153, 25,166,114,101,219,216,141, 25, 13, 90,209, 25,135, 91,102,137,105,116,246,213,243,122,119,211, 90,109,158, 49, 53,182,
-161,246,150,145, 38,149, 64, 16, 82,215, 29,241,231,247,165,201,151, 11,159,139, 22,219, 26, 27,207, 91,235, 65,239,146, 55,117,
- 34,191,178, 18, 8, 7,191, 85,251,213,251,108,152,216, 99,199, 20, 61, 84,108,183, 14,110, 57, 83,249,156, 18,200,202, 95,119,
-199,150,181, 72, 89, 67,177,247, 33, 17,214,192,234, 18, 64, 77, 72,233,218,117, 82,217, 28, 13, 45,155,107, 90,229, 82,157, 20,
-180,213,142,208,219, 34, 42, 32,176,150, 54,236,161, 72, 81, 0,250,207, 93, 40, 26,148,203, 72,227, 8, 26, 40,253,182,205,143,
- 66,169, 54,232,235,117,160, 82,192, 83, 65, 73,234,122,146, 77,123,180,146,213, 43,198,155,248, 54, 52,130,214,129, 74, 94,239,
-104,168,255, 0, 82, 79,135,226, 18, 91,216,159, 11,196, 52,161,165, 41,217, 81,163,167,124, 60, 19, 10,250, 19,155,200, 50,131,
-132,178, 67,116,236, 32,214,191,159, 87, 34,253,163,141, 85, 62,236,156,169, 37,204,238,100,129,177,205,238,147,210,161,101, 41,
- 31,159, 78,141,205,162,161,189,197,249,147, 73,239,222, 18,232,250, 80,226, 43,212,209, 91,141,126, 93, 44,110,160,113,168,197,
-128,209,101, 72, 82,213, 84,110, 75,123,126,112, 52, 36,124,186, 31,205,177,206,147,160, 10,213, 1, 34,164,184, 79, 94,128,143,
-106,167,227,210,191,154,245,208, 44,105,165,216,169,126,149,240,194,144, 71, 66, 85, 66,127, 62,135,243, 90, 73, 96,162,183, 9,
- 73, 66, 28,142,168, 97,213, 47,217, 82, 87, 69,166,135,225, 52,209, 59,116, 14,192,210,217, 24, 24,138,105,206,176, 99, 83, 91,
- 2, 78, 57, 9, 46,169, 39,233,209, 29, 12, 58, 8, 29,161,214,246,184, 62, 35,170, 91,235, 29,191,115, 9,113,109, 19,255, 0,
- 89,141, 62,212, 90,177,131,112,184,182,253,220,175, 30,147,243,101, 77, 17,103,200,109,177,131, 86,185,102, 44,101, 5, 40, 65,
- 99, 53,151, 37,166,215, 94,133, 8,153,111,146, 83,240, 37,105,248,117,203,247, 46, 64,138, 41, 76,219,108, 94, 3,248, 24,110,
-101,136,250, 70,135,176,246, 17, 90,120,119,232,165, 26,110, 28, 94, 63,213, 19, 15,180, 61,166,155,206,101, 92,193,141, 57,226,
-162,210,140,130, 18, 87,243, 93,110, 51,142,165, 3,247, 75, 50, 82,250,201, 29,229, 31, 22,161,127, 62,231, 46, 95, 61,214,124,
- 68, 99,131,139, 28,239,188,221, 14, 61,165,181, 45,187,126,199,184,229, 47,132,238,199, 1,234, 32,129,235,160, 45,158,102,173,
- 16,229, 42, 30,105,109,185, 96, 19,150,170, 41, 89, 67, 10,135,108, 74,143, 68,255, 0,172,172, 37,144, 20,122, 15,104,250,206,
-180,219,119,156, 97,175,108, 59,157,172,182,239, 60,116,151, 55,230, 14, 31,116,246,212, 75,158, 70,149,205, 50, 90, 72,201,155,
-254,146, 23,213, 82, 67,153, 65,185,236,148,139,139, 14, 69,146,210, 94, 97,230, 28, 14, 50,243, 75, 21, 10, 74,146, 72, 32,142,
-194, 53,211, 45,185,134, 59,182, 9, 34,120,115, 78, 68, 21, 21,143,150,212,194, 75, 92,210, 8,204, 28,232,144,190, 33, 36,146,
-246,228,215,189,202,118,124,122,123,249,207, 93, 23,128, 13, 23,159,146,153, 37, 1, 30, 18, 82,208,160,175, 82,163,242,232,127,
- 57,235,165, 54,220, 10, 70, 57, 1,100,168, 56,211, 73, 43,236, 93,105, 66,126, 61, 36,239, 43,153,167, 91, 8, 52, 24,200,252,
- 66, 91, 66,201, 61,155,186,237,175,203,166, 95,187,213,141,188, 1, 69, 58,172,210, 31,113,104, 41,113, 74, 82,138, 69, 9,232,
-107,241,234,170,227,118,206,181,123,124, 77, 9, 95, 76,158, 94,184,237,172, 43,203,142, 9,101, 32,170,117,218,206,222, 77,118,
- 82,211,180,153,215,208, 31,219, 79, 67,109, 20, 32, 87,209,241,107,203,252,213,184, 29,226,246, 89, 78, 65,218, 71, 99,112,246,
-226,107,218, 28,143,183, 13,175,109,133,131, 50, 53, 30,211, 77, 12,227, 1,131,120,142,152,204,199, 74,164,200,113, 45, 32,246,
- 6,218, 6,171, 89,167, 94,163,160,245, 87, 89,119, 53, 43,109, 27,210,161, 59,199, 15,219,160,130,194, 99,183,225,188,210,193,
- 5, 32,236,108, 36, 2,146, 43,234, 53,249, 59,244,252, 79, 34,148, 92, 77, 64,119, 78, 42,128,202,231,161, 49,143,138,249, 97,
-128,225, 77, 18,164,117, 90,251,201,173, 77,107,235, 62,173, 89, 69, 49,164, 56, 19, 76, 69,241,116,104,183, 32,234,218, 62, 35,
-104, 90,188, 50, 54,161, 78,169, 65,196,158,222,190,210,250,254,189, 88,199, 49, 74,135, 43, 22,157, 48,240,196, 52,233,121,113,
-144,203,109,110,101,164, 4,245, 64,238, 20,175,237, 81, 32,252, 26,146,217, 86,160,190, 33, 79,187, 38, 53, 29,218,165, 13, 36,
-213, 13,169,181,109,162, 75,132,164, 26,252, 20,232, 61,122, 39, 61,105,131, 18, 83,162,110, 54, 26,106,136, 72,250, 80,130,164,
-145, 82, 28, 41, 30,191,218, 4, 87, 77, 23, 82, 52, 45, 51,100,227, 9, 73, 11,240, 59,104,151,104, 59, 43,223,219,210,128,105,
- 5,233, 64,178,146, 23,138,199, 91,195,253, 88, 0,162, 10,147,180, 84, 18, 5,122,122,193,236,210, 12,180,211,163,164,155,223,
- 29, 69,121, 18, 9,140, 28, 11,109, 42, 62,192, 42, 64, 89,167, 78,180, 34,189, 14,155, 51, 83, 69,149, 4, 93,120,154, 40,125,
-239,160, 71,213,168, 33, 69, 52, 11, 10, 59,146, 21,212,254,199,101, 61,122, 87,196, 26,143, 35,106, 58,184,112,253,182, 67,128,
- 59, 13,176,181,212, 40, 20,239, 65,221,233, 21, 59,135,171,228,166,135,197, 17, 80, 94,226,218,106, 47,134, 24,183, 62,137,173,
-176,141,205, 42,128, 20,254,197, 77, 5,107, 82, 59,171,163,248,162,236, 41,147, 42,210,133,203, 10,140,235, 44,190,136,222, 19,
-137, 40,109, 84, 0, 5,164,244,165, 65,166,144,217,200,162,105, 43, 86, 43,139, 48,103,102,216,175, 56,196,138, 54,155,213,166,
- 83, 17,100, 6,131,219,101, 50,146,235, 21, 77, 65, 62,218, 0, 52,235, 74,208,106,199, 98,221,255, 0,150,223,197, 56,224,224,
-189,135, 3, 89,126,113,219, 70,233, 97, 52,103,252,164,250, 69, 85,153,240,157,247,167, 35, 37,175,109,165,173, 7,111, 68, 21,
- 32,145,208,215,213,175, 87,197,186,135,128, 69,120,202,226,207,195, 36, 26, 44,187,116,178, 2, 87, 20,169,170, 80,168, 40, 42,
-167,208, 71,126,164,141,206,171, 95, 2, 84, 47,201,124, 19, 23,146, 26, 48,221,202,114,156,122,223, 37,216,194,237,109,182,203,
- 90, 97,203,131, 28,125, 75,109,149,134,217, 10, 63, 56,132,159,131, 81, 11,129, 36,234,114, 30, 11,128,236,232,166, 52,105, 43,
- 81,126, 13,228,175, 12,199,110, 25,122,174,104, 57, 61,182,240,245,172,217,147, 45,186,220,160,162, 27, 59, 86,183, 30,160,246,
-139,157, 64, 29, 41,168,174,179,134, 71,181,197,123,185, 0, 80,122,104,222, 76,128,112, 74,153,109,222, 88,248,210,217,122,186,
-100,174, 97, 86,233,179,111, 81,124, 9,205, 92, 24, 19, 99,185, 78,190,202, 28,170, 27, 43,160, 10, 32,106,217,151,109, 97, 80,
- 5, 14,246, 85,197,127, 48,188,115,200, 92,115,113,185, 99, 87, 11, 77,178, 20,124,178,249,127,204, 32,218, 44,165,147, 46,201,
- 13,231,156,109, 13,190,148, 18,233, 74,163, 39,122,104, 0, 0,246,247,106,174,107, 72, 46, 39, 23, 14, 31,180, 1, 1,234, 85,
-171, 8,229, 64,130,169,229,194, 12,148, 37, 66,173,168,178, 2, 40,165, 21,159, 24,143,101, 41, 31, 59,168,212,200,202, 57,105,
- 24, 30,154,108,165,114, 82,242,208,227, 65,100,164,133,130, 54,169, 46,142,148, 61,105, 64,123,181, 98,219,114,113, 53, 49,182,
-160,142,143,170,140, 90, 94,105,233, 47,195,146,133,164,181,180,199,121,165,133,165, 78, 82,190,215, 97, 29,117, 26,242, 55, 70,
- 53, 4,164,220, 91,120, 96, 56, 28,234, 75, 76, 68, 8,254,230, 26, 67,202,157, 12, 8,211,165,201,117,166,152,144,250,168,151,
- 2, 82, 65,168, 41,167, 90,141,103,223, 54,167,107, 84,210,113, 1, 49,234,168,108, 24,130,148,158,204, 59,229,150,234,211, 74,
- 84,180, 75,101, 74,113, 18,216,121,101, 74, 43, 20, 11,108,208,116, 80,236,233,169, 13,124, 59,140,125,212,210,112, 67,243, 84,
-150,188,198, 66,103, 83,164, 22,242,108,133, 41,112,166, 93,217,201, 12,179, 15,124,240, 21, 40,164, 13,161,180,239, 4, 4,128,
-122, 17, 77,103,223,178, 65,102, 75,154,208,198,180,151, 97,151,111,109, 88, 27,121, 46,193, 40, 78, 21, 46,175,143,236,184,174,
- 49, 46, 76,131, 26, 29,221,113, 82, 87,238, 15, 41,231,226,174,160,149, 60,165, 16,216, 61,169, 74, 82,159,135, 71,101,113, 37,
-244,141, 44, 87, 48,158, 57, 30,207,157,107, 37,121, 28,238,152, 52,180,162,228, 66,122, 0,207,210,106,184,228, 78,221, 85, 33,
- 81,227, 60,153,211, 29,111,199,121,110,237, 45,194,100,143,101, 29,201, 78,212,245, 62,189,107,237,237, 27,239, 16,141, 5, 7,
- 93, 61, 29,152,247,156, 16, 15,111, 93, 1, 14,237, 38, 98,109,182, 47, 6, 37,177,198, 22,219,177, 39, 58,232,105,249, 53, 40,
- 9, 74, 20,158,242,229, 85,219,168, 87, 86,130, 29, 82, 41,112, 57,142, 3,228, 40,131, 68, 42,224,164,147,234,169, 30,246,254,
- 21, 6,218,192, 85,254, 74,114,134,197,201,169,162,212,253, 89,143, 9,164,161, 72,105, 75, 73,220,227,146, 92, 36, 43,122,136,
-167,118,168,173, 69,204,146, 31,217,143, 11, 2, 20,113,199, 30,160, 7, 70, 52,213,175,137, 63,188,212,111, 95, 26,174, 87, 55,
-163,220, 34, 41,111,202, 33,216,174, 40, 51, 30, 59,101,207, 13,135,205, 70,227,216, 40, 15, 90,107, 91, 2,177,200, 6,125, 53,
-102,130, 60, 0,206,155,145, 31,102,215,112, 92,150,203,175,199,105, 37,173,237, 2,149, 37,197, 39,188,252, 58,153, 43,124,102,
-233,165,144, 92, 19, 35, 73,253, 30, 81,121, 53, 90,214,226,150,176, 87, 68,251, 71,187,175,203,165, 17,164, 32,163, 36,180,161,
-172,138,149, 61, 49,245,198, 82, 16,152, 72, 66,157, 59,124, 68,151,148,122, 38,149,161, 29, 52, 65,202,221, 36,103, 71, 39,236,
-218, 11,179, 39, 10,117,205,185,155,220, 86,209, 38, 44,113, 58, 58, 10, 61,237,132,251,186,138, 43, 84,157,128,129,236,246, 29,
- 71,142, 33,108,123,164,167, 69, 33,211, 12, 1, 20,144,216,144,228,132, 43,197, 42,241, 6,197,165, 39,160, 2,128,157, 60,196,
- 74, 67,158, 8,169, 67, 13,178,220,174, 23, 24, 81, 90,136, 84,210,100, 23, 29, 91,233, 9,105,207,119, 5,123, 66,150, 67,123,
-138, 65, 32, 19,215, 84,219,141,220,118,205, 37,113,234,207,235,163,183, 46,241, 3,149, 71, 69, 89, 88,141, 74, 90, 29, 76,102,
- 55, 66, 97,178,209, 74, 15,187, 36,164, 15, 81,175, 78,241, 93,102,101,149,184,106, 61,227,233,173, 88, 64, 2,224,106,172,242,
- 28,117,196,190, 92,151,214,146,131,114,251,122,148, 44, 81, 93,107,234, 58,222,109, 82,106,128, 1,195, 10,135, 59, 18, 76,106,
-199, 91,153, 67, 86, 56, 18, 35,175,221,227, 57, 10, 42, 98,176,144,104,182,182,142,128,131, 74, 83,183, 88,185, 29,170, 82,210,
- 20,169, 83, 83,218,153, 86,170, 9, 81,170, 73,167, 74,212, 83,174,156, 24, 83,130,181, 74,106,105,220, 59, 72, 21, 26, 82,165,
- 29, 12, 90,220, 9,111,105, 9, 74, 73, 4,209, 68,159, 71,167, 69,169, 41, 53,174,215,104, 90,161,234,160,173,149,234, 84, 1,
-235,249,244,165,163, 78, 53,219,134,148, 18, 2,156,113, 37, 93,251,151, 82, 15,203,172,127,243, 74,207,150, 10,221,217,109,176,
- 55, 84, 45, 61,190,201,175, 95,151, 64,110,137,198,146, 99, 20,155, 39, 36,115,114, 89, 97,164,133, 30,213, 47,169,167,203,161,
-252,212,209,136, 0,163, 48,111,178,214,164,182,183, 83, 82,126,106,187,193,248,244,109,220,143, 77, 7, 66, 13, 58,125,241, 1,
-180,174,137, 11,165, 2, 73, 0, 19,242,233,223,230,102,154,240, 22,149,163, 94,149,224,132, 45, 45,213, 61,128, 40, 19,250,116,
- 99,116,235,162,248,112,104,155,242, 93,121,210,225, 82, 69, 79,237, 47,187,229,208,254,100,105, 66,220, 81, 87,220, 83,169, 13,
- 54,180,215,188,248,148,167,193,215, 64,238, 75, 78, 54,216, 10,109,204, 75,241, 84,135, 91, 86,231, 82,174,128,175,122, 77,125,
- 61,116,217,220, 8,167,124, 17,149, 17,149,113,120,165, 75,150,178, 18,132,149, 16, 58, 84,250, 5, 77, 58,232, 29,202,128,128,
- 84,117,118,203,172, 18, 24, 16,238,241,140, 86,100,128,209,106,255, 0, 19,192,136,250,221,233,176, 45,208, 99, 56, 79,102,212,
-172,234,182,227,122,133,227, 68,195, 15,245, 12, 61,103, 15,109, 88,197,182,204,195,174, 18,164,113, 97,196,122, 1,212, 61, 85,
- 77, 57, 62,227,147,121,125,191,218,114,236, 94,237,119,131,195,119,185,232,139,149, 88, 32, 41, 19,109,248,109,198,114,168,137,
-177, 98,190,151, 88, 68,119, 9,170,219, 9,160, 53,218, 82, 74,117,131,221,246,182,216,220,139,203, 87,190, 48,227,137, 97, 68,
-237, 25, 22,158,130,163,209, 93, 15, 98,188,143,153, 32,117,165,203, 24,251,134,142,225,112,197,192,112, 39, 61, 67,167, 63,109,
- 79, 77,231, 51,153,137,110,151,122, 84, 9,182, 11,155,108, 59,110,204,241,245, 47,238,133,183, 44, 36,176,101,199, 82,221,118,
- 48,122,160, 7,144,181,183, 82, 55,120, 99, 90, 6,115, 13,222,214,192,251,146, 37,139,241, 24, 17,192,116,185,185, 30,189, 40,
-157, 4,214, 81,251, 60, 23, 79,116,112, 43, 37, 24, 24,222,115, 35, 48,215,113,236, 56,211,193, 18,165,188,194, 95, 97,196, 41,
-178,141,201, 90, 28,222,149,143, 72, 32,208,235, 77,111,188,178,234, 49, 36, 78, 5,174, 10, 8, 56, 17, 84,111,128, 68,226,199,
- 96, 71, 10, 1, 19, 37, 41,198,204,165,111,103,112, 42, 2,181,160,248,244,231,243, 19,211, 70, 34,111, 10,121, 67,157, 12,169,
-189,141, 18,222,224,107,183,160,252,250, 14,220,169,216, 33, 67,157, 75,120,188,168,110,220,237,205,208, 54,135, 37,198,109, 75,
- 34,129, 41, 82,192, 39,183,184,106, 5,198,226,141, 53,171,218, 97, 14,123, 65, 60, 69,125, 33,242, 87,154,158, 0,242,237,199,
-252,121,255, 0,197,108,242,221,137,127,120, 49,203, 64,199,172, 34, 59,247,156,130,100, 6,163,180,143, 21, 48,160,183, 38, 64,
-105,191,154,183,148,144,141,195,110,226,174,135,132,201, 32,110,167, 60,241, 63, 61,123, 98,202,226, 56, 32,137,171,246, 2, 14,
- 57, 83,179, 15,204, 48,206, 70,176, 90,115,156, 34,243, 23, 37,197,239, 76,174, 77,154,243, 13, 46, 55, 26,114, 18,181, 33, 65,
- 33,228,182,224, 40,113, 37, 10, 10, 72, 33, 73, 32,245, 4,106, 62,160,238,240,198,174,160,144, 72, 21,180, 79, 47,179,180,181,
- 38, 90,134,208, 6,210,142,228,165, 32,128, 79, 94,242,170,232,136, 67, 83, 35,198,161,169, 48, 96, 62,235,232, 45, 81,197,186,
-226, 80,118,215,234,118,142,157,123,194,105,169, 17, 58,156,116,102,152,215,124,125,135, 54,203, 75,105,250, 63, 17, 32,132,215,
-115,109, 36,144,159,140,184, 63, 55,163, 86, 17,185,106, 51,216,148,213,154,150,217,109,224,118,160,168,169, 71,119,106,156,111,
-105, 6,181,248,245, 49,133, 42, 19,217, 74,152,164,116,172, 47,104, 72,109, 33, 99,211,211, 96,245,247,168,105,101,212,195,219,
- 82, 50, 45,172,190, 16, 28,216,165,184,181, 44, 44,118, 36,142,207,151,105,211, 46,117, 39, 69, 12,237,130, 50,219,108,134,144,
- 86,160, 80,180,208, 0, 18,217, 32,143,132,164,212,105,146,250, 73,142,145,151,136,180, 10,210,132, 81, 77, 44,251, 4,244, 61,
- 1, 20, 63, 6,153,116,148,219,152,148,135,119,177,248, 33,106, 66, 42,150,210,179, 94,212,173, 3,180, 30,189,104,127, 94,153,
-115,234, 59,153, 81,125,198,218,194,150,255, 0,176,147,225,123, 73, 77, 43, 84,215,176,245,253,147,217,164,137, 42, 44,141,166,
- 20,251, 36, 70,192,115,106, 78,213, 33,197, 30,193, 66, 73, 35,183,165, 6,149,169,106,182, 97, 77, 11,228,102,217, 97,194,104,
-170,173, 40, 36,116, 4,252,190,201,236,248,244, 26,106, 38,149, 52,211,181,196,140,250,151, 25,109, 37,230,157, 81, 66,211, 65,
-208, 56,123,186,244, 53, 33, 73,249, 52,153, 93,167, 26,119, 74, 85,143,193,109,169,180, 75,132, 20,216, 83,105,121,130,146, 69,
- 82, 77,126, 30,197, 15,202,186,134, 37, 33,192,241, 21, 26,230, 49, 43, 11, 78, 68, 85, 54,207,236,209,237,153,134, 79,108, 75,
-204,152,240, 47, 23, 38, 99, 56,149,130,181, 52,135, 87,178,167,165, 78,222,218,247,235,209,251,110,234,102,129,142, 92, 75, 71,
-205, 94, 53,223, 44, 69,188,242, 55,161,199,231,168,226, 58,214, 29, 20, 85, 80,149,145,208,212, 19,242,234,218, 61,193,120,214,
- 74,104,192, 57,210,179, 14, 45,215,130, 86,148, 43,169,173, 71, 65,167,155,185, 26,130,230,117,210,211, 97, 0,144, 26,217,180,
-118,138, 0, 72,211,191,204, 9,227, 67, 64, 52, 28,203,237,190,203, 2, 93,210,243, 41,152, 86,216, 12,169,231,223,144,104,132,
- 33, 31,164,158,224, 52, 62, 61, 2,147, 68,228, 96, 82,107,148, 94,109,121, 63,141,121,130, 75, 86, 75, 6, 56,220,183,225, 4,
- 46,126, 74, 97, 8,183, 39, 0,170, 91, 67,110,164,248,193,176,154,212, 19,241,105, 63, 19, 36,142,107,195,136, 1,112,233, 53,
- 13,247, 14,105, 5,167, 10,167,107,196,120,234, 4,139, 12,139,133,166,224,244, 59, 69,198,223,117,158,203,225, 14,220,174,168,
- 96, 2,182, 67,244,234,218,182,128, 19,219, 65,167,163,186,121,120, 45, 56, 28, 19,128,244, 81, 71,112,231, 59, 4, 76,191, 77,
- 80,156,182, 67,111, 93,175, 82,217, 99,221, 89,149,113,184, 75,102, 56,233,238,237, 62,234,148,148,127,228,131, 77,116, 88,143,
-116,118, 86,197,140, 66,148,238,227, 28, 81,139,176,185,195,144,200, 18,153, 85,181,240,253, 10,157,219, 32, 21, 16, 58,246, 40,
-122,117,159,222,110, 68, 32, 60,156, 16,212,151,217,120,132,181,213, 98,156,198, 45,145,132,107, 60,246,158,144,155, 96,115, 97,
-247,143, 17,144,242,186,128,118,154, 16, 1,166,185,164, 87,211,110, 79,241,173, 64,240,158, 70, 39, 5, 3, 2,156, 65,167, 89,
-180,194,204, 74,173, 72,150, 38,173,182,251, 29,198, 28,123,100, 71, 38, 92,148,211, 42,157, 34, 40,125,246, 98,180, 58, 54,211,
-138, 63, 70, 7,203,166,174,182,249, 31,185, 91, 73,168,233,105, 61,208,228,196,253,162,223,181,243, 85,133,189,147, 2,160,167,
-158, 47, 96,146,185, 81, 68, 68, 43,222, 11,136, 75, 1, 9,169,222,174,130,130,186,232,119, 49, 49,209, 56, 73,238,166, 53,105,
- 28, 66, 32, 94,236, 0,198,186,209,228,235,240,230,159,230, 27, 43,196, 47, 25,173,178,225,116,224, 65,152, 93,177,222, 71,202,
- 44, 83,162,137, 2,253, 10,206,228,230, 45, 49, 18,249,113,126, 44,135, 94,142,201,144, 90, 40, 66,150, 1, 59,168, 53, 85,181,
-110, 14,141,102, 99, 90,210,214, 29, 12,114,226, 1, 13, 47, 32,125,145,137,205, 78,147, 91,175, 41,185, 30,227,157,239, 34,220,
-230,138, 49,100,215, 72,221, 15,247,156, 90,208, 53,185,169,238, 43,148, 98,170,211,134, 85,203,254,120,242,183, 39,128,185,203,
-151,248, 74,117,178,117,226, 54, 7,152,228,120,235,215,249, 12,120, 73,153,106,130,251,138,183,204,115,160, 1, 50,160,150, 95,
- 9, 31,189,171,123,141,231,226, 88,201, 67,131, 92, 64, 45,111, 28, 64,195,182,184,207, 62,237,110,229,219,249,237, 73, 66,201,
- 8, 96,226, 90,113,105,237, 45, 34,168,162,109,118,107,150, 79, 2,222,233, 84,123, 76, 7, 29,141, 34,227, 37, 36, 58, 67, 1,
- 75, 7,169, 1, 0,237,162, 82, 59, 6,167,110, 6,107, 88, 28,224, 21,231, 20, 29,127,227, 88,221,197,146,218, 70,231, 39,124,
-226,149, 25, 95,172, 15,137, 75,185, 68, 43,110, 4,217,210, 26,131, 69, 16,183, 91, 71,125, 1, 39, 82,173,110, 1,110,135,123,
-192, 5,165, 91, 92, 32,209,246,128, 11, 76,137, 77,207,182,201, 8,241, 29,109,194,144, 84,146, 73, 14, 3,217, 81,223,171, 40,
-180, 76,213, 65, 86, 17,145, 48,167, 13,128,148,203, 8,155, 21,231, 26,112,165, 82,163,200, 65, 8, 90, 86, 71,180,107, 74,118,
-246,234, 13,211,155,165, 88,225,212, 65,167,159, 25, 35, 10,121,101,220,125, 92,113,121, 70, 58,165,165,184,238,186,151,163,211,
-232,220, 64,161, 88, 20, 61, 10, 43,170,123, 77,219,246,222, 12,156, 69, 95,237,150, 70,230,220,204,246,226, 10,118,211, 71,133,
-173,240,111,121,186, 44, 55,116, 47,221,110, 17,158,121, 65, 43,216,175, 22, 0,223, 78,222,187,147, 81,170,191, 49, 57,142, 94,
- 85,219, 93,123, 11,117, 57,164, 14,161,171, 5, 61, 66,151, 30,222,203,243,165,252, 49, 21,106, 87,194, 56,250, 46, 87, 0, 26,
-150,220, 9, 80,155, 84, 37,169,226,124, 23,150,122,208,215,229, 26,231,158, 95,121,141,125,205, 50, 72,219,134,181, 35, 28, 6,
-107,149, 71,190,218,161,134, 48,230, 28, 73,245, 37, 74,152,239,149,155, 17,178, 49,119,187, 51, 50, 56, 92,130,212, 85, 34, 82,
-155,117, 81,157, 72, 9,121,193,212, 83,119, 80, 53,146,187,243,178,111,230,151, 59,124,122, 72, 97, 58, 48,207, 78,109,237,165,
-187, 99,143,194,107,241,199, 63, 77, 57,242,206, 47, 24,244, 43,124, 43, 4, 95,122, 92, 86, 74, 86,164,182, 11,196,188, 0, 82,
-234,154, 5, 26, 14,218,106, 79, 42,249,143, 6,244, 95, 53,219,131, 59,201,137, 65,212, 16,229, 75,142,193,182,238, 13, 3, 42,
-140, 22,212,248,172,136,178, 18,251,102,133,207,119, 36,132,184,149, 84, 14,158,154,235,164, 13,198,218, 87,130,215, 52,147,145,
-169, 90, 20,173, 87,142, 93,136,234, 47, 16,156, 92,115, 24, 63,107, 80, 13,144, 69, 67,106, 61,122,250,107,173,215, 46, 78,217,
- 98,118,151,106,199, 58,131,116,212, 32,212,155,128, 92,228, 93,112,251, 17,222,218, 69,189,151, 96, 40, 41, 96,157,236, 40,130,
- 72, 38,189, 64, 20,213, 30,229, 19,109,231,126,120,149,169, 81,128, 66,244,211,150, 66, 17,236,169, 5,123,150,176,149, 36,160,
- 0, 22,179, 68,129, 78,221,221,195, 81,161,148, 60,166, 31, 44,233,110,120,132, 43,136, 2,138,181, 45,182,151, 37,150,228, 32,
- 58,193, 45,202,106,160, 45,146,149,109,246,135,119,181,211, 82, 95,110,226, 3,136,195,133, 69,102,225, 12,197, 3,133, 12, 86,
-178, 66,171, 69, 14,160,142,134,186,105, 42,110,154,247,114,255, 0,125, 93,181,173,122,215, 73,212, 21, 56,209,233,174,197, 72,
-107,195, 72,113,153,105, 4,132,246,188, 8, 81, 53,232, 58,250, 6,184, 37,223, 55, 89,217, 5,124,131,215,242,232,164,193,178,
-220, 92, 96, 35, 52, 78, 66,100, 52, 69,101,138,168,110, 4, 56, 20, 8,236,244,250,117, 62,211,124,142,245,130, 72,220, 8, 52,
-196,187,123,237,221,165,205,198,136,169,183, 84,173,229,218,171,183,112, 61,223, 46,165,182,255, 0, 94, 68, 83, 70,217,195, 54,
-214, 42, 60,226, 66,227,188,231,136, 15, 78,191,211,165,139,211,194,141,176,245, 82,131, 81,238,142, 83,198,121,222,157, 42, 87,
-253, 58,115,227, 9,160, 97,234,167, 44, 91, 68,221,187,209, 45,104, 89, 29, 1, 85, 71,233,210,133,217,164,120,125, 84, 93,228,
-222, 34,184,166,158, 94,244,171,230,184,159,157,250,116, 13,227,169,225, 8, 60, 41, 22, 75,179, 16,165, 85,247,135,101, 61,163,
-254, 93, 54,111,136,167,155, 23, 85, 36, 73,187, 92,155,162, 67,196, 54,154, 16, 84,106, 79,231,209,139,226, 41, 98, 6,158, 20,
- 11,215,217, 50,227, 6,158,100,215,160,223, 74, 2, 6,148, 47,150,147,240,205, 24,165, 33, 93, 46,142,187, 28,197, 12,178,166,
-214, 11,110,135, 80, 22,149,160,247, 16,106, 8, 58, 73,189,213,129, 20,203, 98,208, 84,103, 80,222, 73,132,170,227,105,185, 91,
-237,102, 44,171,109,214, 43,209,110,248, 85,213,103,251,191,117,136,240, 33,104,142,125,163,109,118,134,173,173,177,176, 42,133,
- 72,175,180, 43,101,143, 72, 34, 60, 1,205,191,100,250, 56, 30,177, 87, 54,187,150,153, 26,233, 65,212,211,132,131,222, 7,175,
-252,195,164, 28, 83, 35, 85,147,203,143, 35,177,134,229,217, 39,150,108,215,222, 83, 30,179,191,184, 43,201, 26, 72,150,213,178,
- 72, 82,157,181, 62,159, 16,182,165, 4, 18,166,136, 42, 73, 27,182,213, 37, 26,207, 54, 73,164, 91, 95, 21,209,181,115, 1,164,
-254,175,120, 16,135,171,233,173,183, 49,237,205,186,133,155,188, 44,107,156,131, 90, 18,138, 50,120, 68, 56,117,250,114,165,108,
-235,204, 52,223, 46, 25,226,176,140,191, 28,151,121,196,238,141, 53,117,178, 93,109,242,150, 37,139,123,196, 52,165, 39,198,113,
-239, 24,160,160,151,129, 80, 37,123,136, 32, 30,174,109, 34,110, 95, 38, 16,237,113, 42,133,192,133,232, 76, 61, 9,195,174,163,
-195,176,195,206, 48,124, 84,110,209, 48,193,193, 48, 81,237,236, 61, 21,121, 44,114,109,185, 13,178,217,117,181, 56,153, 16,174,
-240, 98,220, 97, 59,216, 87, 18, 98, 18,226, 9, 4,244,246, 84, 42, 53,176,109,238,161,133,115,121,224,125,179,220,199, 4, 45,
- 36, 31, 69, 57, 25,181, 33,167,144,133, 56,176, 9, 30,202, 77, 5,116, 78,187, 74,145,111,143, 10,151, 99,225,249, 45,155, 21,
-123, 61,147, 22, 44, 44,106,219,111,186,222,211, 62,237,122,129,102, 92,200, 22, 22,158,126, 67,177,217,153, 41,135,164, 33, 34,
- 59,137, 10,109, 4, 41,105, 40, 73, 43,246,117, 91,115,185, 8,195,179, 32,102,128,159,104,174,153,203,124,159,185,110,177,139,
-152, 32, 38, 63,243, 18, 0,195, 50, 53, 16, 72, 29, 75,146,103, 84,251,128,145,201, 30,124, 60,223, 98, 54, 44,230,247,117,157,
- 27, 38,185, 54,229,250,226,151,138,213,140,241,158, 30,194,156, 92,104,219,170,220,112,204, 24,226, 59, 21, 20, 46,173, 37, 91,
-148,163, 94, 97, 51,219,118,242,153, 41,175, 76,237,118,157,214,181, 73, 32, 0, 79,101,125,151, 91, 91,177,227,216,254, 55, 99,
-199, 33, 68,179,216, 49,200, 16,108,246,123, 92, 84,120, 81,109,246,251, 99, 65,166, 91, 66,107,243, 90, 66, 82,145, 95, 71, 94,
-186,112,185, 17, 43,101, 4, 90, 66, 80,217, 11,158,245, 21,151, 20, 64, 76,160,216, 53, 85, 18, 19, 66, 71,127,168,104,206, 53,
- 54, 32,134,161,121,173,182,195,242, 83,188, 23, 16,151, 85,208,154, 0,178, 74, 79,111,236,233,216,194, 84,163,136,166,109,210,
-229,238, 17,159, 74,213, 86,219, 4,163,113, 29, 64, 66,135,166,189,164, 15,139, 86, 49, 5,168, 51, 84, 51,147,220,202,212,151,
- 83, 93,143, 54, 28,108, 37, 84,232,234,208, 59, 43,208, 80,234,198, 38,213,123,141, 40,226,215,230,182, 46, 34, 29,240,212,223,
-142, 10, 73,234, 84, 85, 79, 79,238,233,199,178,163, 57,220,106, 96,182,222,154,113,230,146,163,185, 78, 4, 26, 87,165,105,211,
-191,248,181, 21,237, 74, 32,234,115, 34,119,136,218, 30, 65,170, 3,136, 80, 79, 74,215,109,105,219,233, 21,212, 71,138, 88, 34,
-182,114, 90,131,200, 86,239,162,222,227, 75, 77,122,168, 44,146, 15,111,160,234, 51,169, 46, 66, 41,171,122,185,160, 54,166, 40,
- 64, 7,104, 4,246, 5,131, 81,219,233,169,248,180,219,141, 66,147, 10,136,238,206,180,210,220, 94,237,141,186, 86, 21, 67,212,
- 33,164,212,119,247,154,233, 34,161, 61,213, 20, 92,110,141, 49, 37,197,151, 71,128,240, 41, 82, 66,170,148, 56, 27, 7,211,208,
- 21, 36, 83, 79,129, 85,243, 21,166, 13,238,240,135,144, 16, 84, 75, 78,165, 59,200,234, 80, 19,209, 68,122,104,160,126, 77, 45,
-173,168,128, 99, 77,108, 81,249, 31,127, 58,149,149, 6,148,180,148, 36,154,215, 98,169, 74,215,184,211,175,199,164, 92, 14,237,
- 73,193, 42,238,227,203,103,116, 52,169,180, 56,180, 70, 14,172, 41, 65, 33,192,138,168, 84,214,128,138,117, 58,167,107,195, 9,
-115,138, 1,153,170,235,199, 22, 70,242, 56, 3, 84, 91, 41,192,178,183, 46,215, 43,132,248,109, 36,207,153, 38, 86,233, 51, 90,
-109,192,135,220, 81, 0,239,118,181,235, 77,111,225,243, 43, 99,180, 96,105,189,135, 12, 48,114,229,217, 94, 82,222, 54,219,153,
-229,115,188, 55, 98, 73,166,236, 44, 9, 98, 67, 77, 74,153, 5,149, 72, 80, 2,183,104,233, 67, 99,248,168,233,219,241,232,228,
-243,135,151,237,129, 46,187,105, 79,242,135, 31,152, 99, 89,137,118, 27,151, 28, 99, 79, 72,165,197,113,204,246,230, 24,240,238,
- 22,121, 64,167,196,109, 98,249, 16,161,226,154, 85, 8, 88,127,106,148, 61, 0,232,219,231, 87, 46,150,135,139,176,132,166, 45,
-120, 35,180, 22,168, 29,102,163, 30, 92,185, 46,210, 35,199,180,125,116,227,103, 10,188,176,218,203,214,246,227,182,218, 65,121,
-229,204,142,182,129,236,249,193,210, 15,197,171, 59,111, 55,121,122,225, 3,111,225,199,253, 73,151,109, 71,118,193,116,213,253,
-145,170,203,230,123,141,121, 43, 40,198,162,227,216, 28, 75, 59,193,244, 61, 58,238,101,228, 48,237,201, 91, 17,232, 16,218, 75,
-175, 36, 21, 18,107, 74,215, 80, 47,188,234,229,171, 89, 24, 31,119,172, 23,125,134,185,233,219,164,101, 81,230,229,187,185,208,
- 8,208,103,137, 2,185,198,175, 39,188,170,211,139, 76,172,135, 6,176, 38,224, 99,190,243, 79,228,254,254, 91, 81, 86,197, 50,
-178,202, 30, 81, 40, 29, 73,173, 61, 7, 66,235,251,129,216, 66, 24, 89,113, 42, 46, 81,145,195, 62,241, 25,210,191,245, 41,221,
-139,139, 71,166,154,247,127, 42,153,132, 75, 96,102,227,153,225, 30,240,220,226,132, 60,221,205,233, 81,197,188, 21, 10,149,120,
- 73, 88,219, 90, 10,252, 90,122,219,207,125,182,119,172,118,215, 30,239, 22,128, 87,163, 58,114, 30, 83,124,114, 52,189,205,208,
-184,166,117, 70,115,207, 42,249,108, 25,147, 94, 57, 14, 45, 49,141,225, 77, 24, 50,221,113, 14,165,125,125,146, 91, 0,144, 59,
-181,212,246,159, 56,172,111, 88, 27,224,204,211,214, 7,215, 87,243,217, 6, 57, 90, 69, 21,193, 44,139,195,111,254,245,150, 43,
-117,158,117,173,187,108,183,109, 43,219, 38, 60,187,122, 74, 89,116, 33, 84, 83,137, 61,139, 2,158,157, 51,204,219,228,155,205,
-153,102,218,158, 48,114,128,241,129, 7, 48,163, 35,209, 79,135,181,228, 23,116, 84,203, 13,206, 50,143, 62,216,227,217, 68,201,
-108,188,165,185, 57,183, 45,206, 50, 90, 36,157,181, 39,169,245,211, 92,218,219,255, 0,108, 12,116,113,197, 24,104,192, 33,106,
-122, 42,198, 6,197, 32, 58,134, 53, 51, 34, 47, 27,170,212,243,176,175,137,153, 41, 76, 32,192,140,203, 74,104, 38, 65, 85, 9,
-119,114, 69, 61,158,186,184,217, 54,109,214,125,202, 11,171,182,150,232,119,120,170,141, 41,128, 24,250, 42,194,206, 18,133,169,
-157, 72, 60,113,139,191,145, 93,163, 91,236,208,167,221,165, 4, 46, 67,145,237, 80,221,153, 33,168,237, 83,123,139, 75, 73, 90,
-155, 66, 42, 55, 44,138, 14,243,174,215, 44,134,232,104,140, 18, 74, 12,186, 74, 86,143,109,216,230,220,222, 33,130, 50,247, 20,
- 8, 1, 57,148, 82,156, 58,235,238, 47,203,255, 0, 7,224,222, 93,184,171, 13,192,113, 95, 29,188,121, 55,219, 10,243,151, 17,
- 41, 50, 33,171,145,161,251,155, 46, 93,146, 21, 87, 25,106,124,219,106, 33, 45,148,154, 85, 77, 40, 36, 31, 21,107,202,238, 23,
-179, 94, 92, 56,134, 0,241, 11,132, 96, 4, 38, 50,195,129,224, 92, 26,239, 19, 87,235,117, 1,235,251, 29,177,219, 88,109,188,
- 17,181,169, 9,210, 26, 52,247,116, 41,203, 55, 6,157, 68,226,112, 32,240,175,153,127,197,202,126, 46, 60,249,114,253,169,167,
-227,123,188,200,220,100,206, 66,150, 39, 8,161, 55, 52, 99,214,173,254, 33,220, 17, 80,217, 65, 88, 61,253,189,107,170,230,109,
-211,221, 89,178, 72,166, 44,144, 52,233,192, 30, 37, 56, 46, 33, 61, 25, 87,150, 60,205,218,109,239,183, 93,111,141,165,250, 91,
-137,233, 35, 3,247, 83,209, 92,127,243, 15,199,252, 43, 19, 22,200,238, 88,158, 69,143, 92, 47,208, 24,138,166, 88,137, 36, 25,
-243,102, 73, 41, 73, 75, 65, 36,120,138, 66,107,186,154,215,114,198,231, 53,172,113, 65,114, 73,195, 18,125,100,159, 78, 85,142,
-223,246, 59, 49, 17,240,222,194,230,180, 46, 88,245, 10,160, 24, 85,198,125,183, 45,177, 34,249, 25,231,172, 41, 76,155,108,176,
-166,247,166, 28,123,144,219,226,147, 83, 66,218,168,107,220, 53,111,189, 79, 4,246,239, 48, 60, 7,230, 49,204,142, 21,205,101,
-218,216,240,244, 8, 93,198,165,247,120,251, 21, 99, 44,220,253,206,217, 46, 51,143, 70, 17,165, 42, 66, 92,136,203, 46,169, 36,
- 58, 78,239,216, 29,163, 89, 27, 78,111,150,125,189,210,186, 50,215,183, 82,179,137, 45, 81,135,111, 10, 59, 13,163,225, 48,115,
-181,116, 97, 86,165,142, 48,226, 73, 51, 45,242,215,153, 99,179,218,105,160,205,201,199,230,180, 95,125, 64, 10,165, 7,120,218,
-154,107,202,187,247, 57,243, 37,244,132, 54, 9, 98,141, 85,173,107, 72, 3,172,244,154,210, 50, 56,180, 16, 64, 90,100,114,204,
- 60, 25,150,238, 54,236,114,101,183,238,193,110,121,192,136, 15,180,180, 73,150,240,235, 64,149, 16,123, 5, 78,186,247,150,147,
- 94,195,102,199, 95, 23,120,133,231,222, 85, 13,225,158, 85,121,106,216,219,108, 26,226, 6, 4,250,234,133,241,117,142,225,108,
-229,108, 46,235, 57,149,194,182, 28,133,177,114,150,234,118,177, 22,220,241, 83,107, 83,166,180, 72,216,173,117,126,125,158, 29,
-215,101,186,129,132, 57,230, 62,232, 25,151, 12, 66,122,107, 44,192, 99,118,161,215, 93, 2,201, 50, 28, 70, 37,220,196,129,147,
- 91,238,113,218,217,244,241,148,162,202,106,105, 65,211,173, 7,105, 26,229,126, 88, 88,187,102,177,149,247, 44, 44,149,231, 35,
-154, 1,133, 68,153,175,153, 48,192, 84,242,247, 52,113,148,107, 59, 22,213,222, 85,112,115,220,153,142,168,208, 33,187, 33,244,
-148,164, 38,180,218, 58, 36,247,215, 94,114,119, 33,111,147,110, 46,189,100, 90, 63,106, 92, 11,156, 0, 56,175, 79, 17, 90, 33,
- 36,126, 30,131,209, 77,216, 60,175, 96,155,111, 67, 48,237, 25, 12,249,236, 63,182, 59,237, 90, 86,134,228,177,212, 83,122,202,
- 82, 9, 71,175, 90,253,199,146,222,219,135,191,196,141,145, 72,195,168,106, 10,215,116,160,232, 53, 93, 11, 30,222,208,112,166,
-115,104,183, 92,224,190,202,112,204,213,233, 43,146,144,204,144,134, 88,172, 84, 21, 43,106,220, 46,157,148, 81,169,233,171,152,
-117,237,143,137,194,230, 3,162, 48,210,186,142, 61, 32, 38, 56, 82,244, 60,188,185, 48, 37,106, 42,201,248, 15, 55,228,171,133,
-185,199,229, 68,180,177, 27,197,136,202,174, 18,146,165, 48,219,202, 27, 75,138, 30,129,240,235,164,237,190,108,237,252,178,199,
- 54, 54, 23, 40, 24, 52,102,153,167,109, 54,253,189,211,165, 63,112,239, 43, 87,220, 1,169, 76,222, 50, 28,121,248, 49,215, 34,
- 98, 95, 46, 41,229,184,250,246,165, 9,101,162, 91, 75,129, 74,246,190,118,179,187,191,158,145,239, 9,240,208,188, 56,160, 76,
- 48, 28, 84,226,157, 25, 84,150,109,133,129, 9,169, 54,197,194,182,203,171,173,220, 37,100,111, 66, 22,199, 75,168,113,171,123,
- 48,225,153, 40,175,181,185, 69,210, 10,123, 82, 79,126,178,247, 30,110, 93,237,142,119,135, 19, 92, 94, 56,146, 72, 29, 67, 15,
- 77, 38,109,141,151,141,211, 34,165, 45, 39,135,184, 22,221, 29, 13,220,172,217, 45,254,243, 62, 66, 80,244,166,174,133, 44,186,
- 84,165, 56,165, 57,225,208, 44,168,154,147,219,170,185,252,218,230,107,183, 19, 28,209, 71, 24, 25,104, 10, 59, 22,132, 60,187,
-107, 16, 29,197,167,213,187, 28,227,187, 82,238,176, 99,113,189,161, 5, 17,255, 0,245,107,215, 24,206, 94,238, 97,138,124,242,
-218,148,150,232, 9,237,173,117,149,188,231, 77,226,240, 50, 71,223,201,159,120, 52,134, 53,123, 70, 53,115, 21,139, 27,128,109,
- 53, 82,168, 30,236,235,127,220,219, 0,180,155,147, 13,151,127,185, 73,220,167,194, 92, 72,123,195,241,124, 74, 36, 18, 43, 90,
-117,236,239,212,147,189, 93,120,129,255, 0, 25, 47,137,164,255, 0, 24,228,163, 5, 68,250,104,124, 39, 86, 29,149,103,103,113,
-228, 89,109,205, 93,138,253, 46, 75, 81,100,161,184,205, 72,117, 49,228, 60,212,161,226,161,197, 0, 13, 66, 90, 27,134,218, 15,
-105, 34,186,243, 20,124,217, 59,147,226, 7,206, 71, 71,203,211, 93,168,109,172, 11,160,125, 21, 2, 78,202,101,202,180,139,173,
-134,237, 10,247,105,148,227, 49,224,220, 45,147, 27,184, 69, 91,177,253,135,146,151,153, 91,141,170,143, 84, 18, 21, 65,217,221,
-174,133,105,187,220, 91,159, 11,196,123, 10, 98, 20,131,234, 40,106, 29,230,198, 32,144,178,120,136,120,204, 57,168, 71,104, 56,
-214,136,229, 27,253,186,169,149, 2, 44,135,144, 80,166, 66,130,155, 11,107,102,250, 86,134,167,106,147, 74,122,251,245,119,183,
-243, 5,222,216, 16, 78,116,144,185,175, 31,209, 85, 55, 59, 28, 19,144, 92,207, 85, 61,241,254, 90,182, 78,147, 8,207,182,188,
-211,104, 75,110,251,224,109, 73,105,147, 43,123, 96,171,168,239, 6,149,238, 53,238,213,246,193,230, 13,237,153, 6,225,193,236,
-213,143, 74,103, 84,251,135, 43, 71, 43, 92, 34, 26, 77, 75, 80,179,124, 65,110,168,174,247, 24,183, 41,214,132, 86, 84, 54, 16,
-144,216, 39,111,237, 40, 19, 83, 93,117, 22,121,141,183,185,186,181,160, 29, 85,141,127, 43,221, 40,104,102, 63,166,158, 63,125,
-218,144,178, 73,127,192, 74,210,217,127,194, 40,100, 85, 69, 39,169,167,101, 43,172,214,227,231, 54,223,106, 72,132, 57,231,171,
- 10,181,179,228, 43,153,211, 89, 13,163,176,175, 56,253,193,137,143, 19,189,184, 72, 82,150, 92, 52,112,108, 80, 77, 2, 65,170,
-143, 94,237, 85,193,231, 92, 90,218,217, 96,112, 7,143, 69, 79,127, 32,200,209,221,120, 90, 21,216,120,179,184,237,215, 43,145,
- 57,171,109,138,201, 4,220, 46,215, 41,132,134, 97,178, 84,148, 33, 52, 27,150,181,188,234,210,219, 72, 72, 37, 74, 32, 1,218,
- 71, 85,216,249,138, 30, 97,107, 77,185, 87, 30, 28, 71,111,215, 85,150,124,155,123,127,115,240,177, 55, 28,203,143,186, 7, 73,
- 61, 29,129, 73,192, 10,131, 36,243,247,147,120,216, 29,250,116,172,251, 41,189,242,180,230,236,241,176,140, 22,223,106,141,110,
-178,177, 57,201,177,140,227,120,184,161,251,147,177,139,118,194,249,105,181, 71,111,233, 0, 5,100,123, 42,180,112,153,183, 77,
-129,205, 0, 98, 78, 32,187,208,210,132,142,197,174,179,182,249, 39, 20, 81,234,189,186, 14,123,135,117,145,144, 15, 89, 37,192,
-224, 7, 4, 28,104,227, 89, 22, 41,125,178, 34, 85,137, 15, 54,243, 72,140,137,172,123,250,110, 76,165,249, 33,101, 32, 44,197,
-132,235, 36,108,161,105,104, 39,191,118,169,111,185,154,215,111,186,117,164,143,210,241,193,193, 48, 64, 87, 62,190,129, 92,235,
-155,185, 42, 29,161,229,182,142,149,200, 80,135, 0,153, 42,135, 2, 15,160,180,118,210, 43, 80, 90,150,173,175, 13,187,168,118,
-254,208, 30,158,221, 79,143,116,142, 95,117,205, 62,154,231,114, 91,190, 44,193,168,159,144,111, 77,113,197,210,203,144,251,234,
-102, 98,119, 11,212, 12,107, 44,142,167, 67,231, 31,145,121, 90, 88,133, 61, 36,168,150, 80,153, 59, 90,125, 7,161, 10, 10, 3,
-112, 53, 55,110, 44, 15, 13, 14, 11,208,184,213,165,134,218,237,198, 55, 51, 65, 15, 13, 46,105, 76, 28,152,150,245,225,136, 61,
- 73, 85,183,207, 47, 22,135, 56,233,190,100,176,180,187,102,113,198, 55, 27, 77,214, 37,214, 41,240,228,191,107, 84,150,208,166,
-150, 69, 10,188, 39, 86,135, 17, 83,210,138, 29,250,106,237,205,144, 47, 17, 90, 30, 68,220, 76, 87, 6,205,229, 98,148, 16,157,
-105,244,228,106,142,249,154,229, 40,124,183,133,240, 15, 34,176,243, 94,251,115,179,229, 22,139,244, 52, 42,166,221,125,180,187,
- 19,222, 26,165,122, 37, 74,115,196, 69,127,101, 67, 73,146, 99, 59, 65, 57,140, 13,109,121,111,103, 59, 60,247, 80,125,157, 77,
- 45,236, 42,159, 85,116,235,202, 30, 65, 63, 42,225, 44, 46, 96,112,173,203,100,121, 54, 39, 86, 13, 72, 93,169,213, 54,144, 79,
-167,194, 40,212,136, 46,136,104,174,119,205, 91,127,131,127, 34,113, 67,235, 21,120, 44,118,199,154,118, 37,202, 91, 17, 46, 38,
- 51,237, 62,171,116,240,231,185,203, 13,154,248,110,248, 78,178,233, 74,187, 8, 74,193, 62,157, 56,249,203,198,117, 89,101, 24,
-130, 70,188,176, 56, 2,186, 74,161,234, 40, 65, 78,194, 42, 4,243,171,230, 3, 52,141,129,179,129, 92,110, 48,156,115, 55,113,
-182, 28,134,205,189,150, 13,191, 31,179,184,211,148, 96,165, 62, 35, 41, 90,208,219, 8, 0,211,102,228,129, 78,202, 29,222,232,
-197, 17,107,120,225, 94,139,228,206,108,220,247,189,113, 74,246,139,118,180, 52, 49,172,107, 64,201, 0, 32, 46, 0,116,229, 86,
- 55,240, 60,141,100, 28,131,204, 57, 52,218, 28,141, 24,101,162,205,141,213, 21,255, 0,212,238, 79, 67,215, 85,130, 79,105,117,
-136,105,233,235,248,241,176, 18,199, 87, 97,218, 97,104, 7,167, 15,111,248, 87,210, 20,153, 79, 37,208,195,117, 40, 86,208,129,
- 82, 5, 28,166,238,254,191, 54,186,156, 74,214,134, 24,233,101, 87, 49, 46, 9,106,181, 49,194,123,235,183,195, 77, 7,127,166,
-186,144,194,162,157,209,164,173, 67,119, 91,163, 72, 84,135,139,131,114, 95,108, 56,130,105, 90,131, 65, 74,247,168, 84,234, 68,
- 66,149, 33, 65, 81, 21,219, 32,106, 82,149, 21,194,124, 69, 71, 94,246,212,122,151,125,131,233,239, 14, 83, 86,112,178,171,102,
-114, 84,127,121,158, 28, 4, 36, 20,238,105,212, 32, 40,116, 30, 26,194, 18, 59,125, 53, 58,177,140, 85, 84,175, 74,141,224,228,
- 47, 90, 46, 62, 35,132,169, 91,208, 84, 43,218,203,170,105, 74,233, 94,224, 53, 47, 66,138,142,101, 90,151,241,188,229,135, 22,
-194, 20,242,124,112,159, 19,183,254,174,130,189,253,202, 61, 53, 22, 72,233, 58,234, 83,183,100,227,114, 18, 92, 74, 91, 72, 37,
-116, 85, 70,229, 0, 43,219,220, 72,212, 9, 25, 67,197,165,161,148, 69,162, 25, 82,170,176,221, 10,137,236, 82, 10,123,122,246,
-209, 64,141, 67,123,105, 46,146,145,238,247, 24,239, 36,186,133,110, 64, 75, 32,154,246, 44,154,131,219,232, 78,152,115,106, 44,
-146, 84, 49,147,221,195,109, 45, 33, 97, 68,173,105, 6,181,174,240, 69, 59,127,120,104,152,218,131, 36,139, 80, 92,214,229,188,
-151, 10, 20,118,182,226,146, 40,231,183, 32, 41, 36,165, 32,215,165, 21,169,109,194,162, 73, 40, 52,131, 37,231,125,205, 53,216,
- 82,195, 74, 46,212, 81,123,156, 21, 53,235, 64, 52,121, 26,141,171, 26, 89,195,156, 75,147, 18,249, 1, 34,187, 55,171,246, 77,
- 74, 73, 29,127,122,154,137,113,149, 58,100,194,166,236,139, 33,141,105,227,252,222,238,252,181,196, 68, 28, 74,243,225,200, 75,
-133,181,178,235,236,173, 9, 9, 32,244, 40, 90,128, 79,249, 53, 73, 59, 60, 70,185,169,152,170,125,210,109, 16, 60,158,138,224,
- 93,239,145,243, 91,140,185,222,237,119,188,186,153, 30, 48,142,219,206, 58,149,166, 18,214,170,186,146, 73, 90,212, 8,220, 74,
- 85,170,120, 54,139, 40,144,189,140, 81,153, 9,159, 65,232,244,138,224,247,206, 46, 39, 19, 77, 20,230,249, 4, 54,204,159,127,
-156,251,177,155, 75, 63, 57,199,149,213,125, 10,214, 87,184,169,106,236, 3,174,167,255, 0, 47,183,144,233,210,208, 15, 96,245,
- 97,149,103,229,105,167, 50,249, 66,232,242, 34,198,126,230,234,136, 45, 5, 53, 46,226, 98,111,146,158,165, 73, 74,143,179, 69,
-126,193, 61,105,170,191,228,145,198, 92,240,209,199, 38,174, 31, 46, 52,218, 23, 97, 89, 27,150,242,198, 25,144,201,200,151, 49,
- 82, 36,186,164,182,151, 16, 75, 17,199,204,216, 28, 89, 77, 82,163,214,131,215,164,201,203,214,175,112,112,136, 52, 1,215,137,
-235, 74, 32,215,112, 52,147, 35,145,114,123,129,126,209,239,145,220, 80,109, 82, 61,228, 2,251,178, 2,137, 73,108,213,192, 1,
- 87,171,179, 82,226,218,173,173,210, 93, 39,161, 50, 78,188,169, 38, 55, 59,187, 72,239,223,175,210, 17, 34, 35,182,200,246,215,
- 88,113, 15, 52,244,247, 92,109, 46,182,215,122,182,186,165,162,168, 81,246,169, 77, 75, 99, 32,105, 15, 15, 46, 94, 1, 48,246,
- 33,198,146, 96, 32,161, 20,215,184, 94,227, 6, 28,110, 19,143,200, 68,230,169, 88,175,189, 46, 43, 41,141,210,136, 83,197, 43,
- 85, 20,122, 26,106,206,217,142, 5,100, 65,164,241, 64, 74,245, 12, 41, 47,132, 84, 17,126,190,190, 18,250, 38, 60,164,161,210,
- 29, 44, 71,144,148, 50, 18,148,236,220, 74,104,180,168,145, 95, 86,183,155,124, 45, 36, 22,103,210, 70, 61, 61,137, 77,152, 20,
-227, 85,254,232,251,114,101, 56,208,118, 97,113,106, 80, 64,123,233, 84,194, 85,235,253,170,252, 26,234, 59, 99, 72, 0,160,244,
-113,165, 71,102,180,102,199,108, 89, 11, 46, 46, 92,133, 39,163, 77,248, 27, 20,164,168,158,160,154,158,154,219,219,129,134, 0,
-122,106,246,203,108, 94, 21,124,188,153,249, 90,207,252,214,115, 14, 45,196, 56, 51, 75,183,200,188, 45,249,183,220,146,225, 29,
-201, 22,140, 75, 27,183,164,174, 93,198,113,107,105, 75, 76, 38,137, 77, 72,220,181, 33, 0,238, 80,211,247, 55, 49,194, 11,158,
-112, 3,128, 83,212, 0,226, 73,192,125, 66,186, 15, 45,114,183,243,137,219, 10,233, 8, 73, 40,168,131,128,193, 73, 40,208, 20,
- 98,122, 43,236,183,200,119,144,110, 34,242, 84,254, 67,113,199,179,155,175, 35,101,188,139, 21,204, 38,231,123,186,196,133, 6,
-207, 58, 14, 62, 85, 46, 83,118,200,137, 67,146, 81,185,198,221,105,214,253,225,221,229,176, 77, 54,157,102, 55,169,165,185,141,
- 25, 27,152, 24, 25, 35,148,171,129, 36,181,138,128, 6,142,240,118, 40,138, 6, 56, 87,127,217, 57, 62, 61,130, 57, 29,110, 30,
-160, 49,207, 46, 56,130,164, 53, 80, 0,208,174, 92,114, 80, 49, 53,106,101, 94,177, 78, 61,133,200,182,235,244,180, 67,177,241,
-252,172,119, 44,187, 78,185, 79,247,132, 70,176, 92,110, 45, 93,164, 58,241, 87, 82, 96,165, 46,186, 5, 59, 0,213,149,216,155,
-117,101,181,235, 81,101,100,141,192,105, 0,199, 25, 98,245, 7, 4, 83, 93, 70, 77,182, 73,237,109, 47, 98, 56, 76,217,193, 39,
- 0,215, 70,199, 2, 84,228,211,135, 28, 49,175,131, 79, 51,156,143,124,231, 78,105,229,190, 89,158,211,226, 71, 32,231,121, 30,
- 80,195, 15,185,181,200, 54,219,164,167, 12, 56,181, 10,219, 72,209,124, 54, 71, 94,196,233,135,110, 48,219,128,214,145,165,160,
- 1,216,208,131,175, 33, 94, 35,230,235,129,186,222,205,112,223,116,185, 27,250,141,238,179,255, 0,196, 10,169,211,184,207, 34,
-186,190,239,186, 37,231,150,154,123,194, 99,208,174, 49, 36,159,104,168,237,232, 58,211,174,178,155,167, 58,219, 91, 14,249, 3,
-161,120,215, 58,185,181,212,112,160,226,112, 77,214, 68,173,239, 93, 22,212, 98,148,151, 38, 61, 25, 73, 97, 33, 84, 10, 4,165,
- 35,244,107, 31,115,230, 44, 81,140, 24, 9,232, 6,160,124, 10,212,167, 3,202,251,104,131, 22,124,171,191,190,219,228,178,167,
-146,243, 49,159, 97,207, 21,133, 16, 80,148, 47,218, 95, 65, 84,168, 80, 29,100,110, 60,217, 37,238, 99, 99,210,224, 83, 18, 14,
-124, 84,101,217, 79, 29,184,129,213, 66,159, 47,118, 54,252, 69,206,118, 82, 92,241, 27,110, 52,118,166, 54, 39, 41,151, 21, 90,
-173,178,173,169, 59, 5,104, 52,207,245, 54,119,167,134,137,196,144, 81,122,143,109, 15,128,234,162,236,240, 53,137,114,165,179,
- 29,188,138, 99, 16,183, 56,152,238,120, 77,175,194, 81,218, 9, 82, 86, 77, 43, 67,219,161, 39,153, 23, 13,107, 75,140, 96,158,
- 56,231,233,163, 22, 35,162,151, 45,188, 25,137, 42,124, 86,157,137, 37,146, 82,149,188,185, 1,199,218,113, 71,173, 84, 70,224,
-144, 59, 40, 53, 95,115,230, 53,222,135, 16,224,122, 17, 1,165, 54,197, 78, 85, 35,195,227, 14, 62,109, 99,198,133,105, 92,146,
-182,227,161, 2, 48,134,226,130,168, 55,123, 78, 4, 0,160,147,243,135,195,172,212,220,231,184, 56, 96,247,134,231,154,253, 21,
- 37,182, 35,143,205, 82, 51, 92,103,128, 69,117,217, 22,107, 51, 77, 20,248, 79,214, 67, 72, 92,130,148, 15,154,151,153, 94,221,
-170, 41, 53,166,179,111,231, 11,249, 90, 27, 52,132,230, 48, 37, 61, 71,141, 60,108, 7, 1, 68, 3,204, 90, 47, 6, 52, 23,216,
-182,173,180,123,233, 76,246, 83,185, 8, 72, 59, 67,100,130,132,132,147,218, 72,168,209,186,232,221, 69,169,224,184,101,129,249,
-233, 66,219, 73,235,161,163, 94, 30,185,181,114,146,245,230, 3,175, 17, 29,244,193,132,235, 69,132,150, 1, 11, 33,107,162,247,
-174,190,215,118,153,148,178,220,181,161,142, 3, 16,165, 87,171,169, 61,180,182,219,168,196,208,113,242,123,100, 83,238,242, 97,
-219, 85, 30, 70,231, 36, 73, 84,214,220,146,226,146, 54,236, 90, 82, 83, 68,147,218, 6,153,150, 57, 36,239, 53,206, 81,144, 76,
- 61, 29,116,227,109,211,128,165, 40,215,150, 18,176,151, 38,217,110, 8,108,133,193,180, 8,136, 76, 56,204, 3, 82,135, 22,239,
- 85,116,235,243,181, 18,103, 19,238,181,237, 92,220,184,158,196,250,169,239, 1, 41,190,237,230,207,115,121,166,166,206,178, 65,
-110, 33,156,227,150,200,146, 91, 82, 95, 11, 36,149, 41,150,214,164, 43, 97, 61, 58, 84,233,245,150,221,164,198, 30, 73, 68,113,
- 92, 61, 39, 28,105, 98, 45, 71, 26, 58,222, 95, 97,102,218,249,247,233, 34, 18, 90,113,166,220, 92, 68,196,139,112,120,210,161,
- 41,108,172,178,148,129,218, 64, 36,106, 44,150,247, 15,144,119, 70,172,243, 82, 7,167, 51, 78,248, 77, 74,139, 47, 25,237,182,
-221, 33,215,227,100,108, 45, 46,146,212,132, 55, 33,106,116,161, 65, 42, 9, 15, 23, 18,180, 1,216, 5, 41,234,214,134,215,110,
-146,225,161,174,136,225,136,192,124,200,134,147,225, 14,154,103,255, 0,126, 25, 11,223,253,245,111,196, 84,207,127, 16,188,119,
- 60,111, 5, 41,161,111,198,241, 60, 61,213, 52,174,222,205, 88,252, 9, 79,220,112, 69, 64,157,168,139,237,164,248, 99,166,187,
-233,111,227,190, 61,184,218,164,193,138,226,228, 51, 34, 52,168, 50, 30, 21,140,252,185,239,176,251,238, 4,138, 37, 68,132, 6,
- 86,158,228, 37, 77,163,183,169,249,225, 46,255, 0,123, 19,195,147, 47,119,161, 2, 5,244,227,218, 84,215,166, 63,148,179, 72,
- 57, 46, 39,208, 50, 21,241,181,192,185,103, 39,121,114,243, 35,158,241,221,177,231, 39, 97,214, 44,219, 43,196,115,171, 53,239,
-199,254,237, 59,110,199,228,190,132, 93,146,180, 7, 17, 17,225, 25,132,188,135,194, 78,228,208, 40, 41, 61,158,250,230, 54,216,
-115, 54,207, 5,236,206,209, 43,227, 99,152,230,133,118,167, 52, 29, 8, 49, 32,146,132,112,204, 37,123, 87,150, 60,136,185,254,
-227,217, 4, 22, 44, 13,152,198, 31,227,187, 8,226,110,157, 78,116,175,200, 70,220, 73, 83,130, 97,142, 7,166,156,209,231,183,
-203,167, 22,227, 22,203,157,157,156,147,146,114, 12,165,147, 38,209,100,180, 91, 23, 96,122, 44, 70, 16,132,123,220,167,174, 41,
- 97, 44, 71,113, 69,192,194,217, 75,158, 39,206, 78,228,128,173, 96, 57, 99,203,205,235,153,100, 12, 12, 17, 70,198,163,158,226,
-161, 84,224, 19, 18, 64, 69, 5, 19,217, 94,115,231,127,237,235,112,242,250,103,195,188, 79, 4,122, 73, 17, 58, 55, 9, 77,192,
-212, 82, 88,216, 52,189,177, 56, 98,215,202, 35,212, 19, 75, 93,138, 93, 94, 40,200, 48,220,255, 0,142,112,140,222,199, 22,108,
- 23,249, 95, 28,179,223,226, 90, 47, 16,218,113,251,108, 11,179, 32,165,133,108, 5,173,204,168,147,185, 61, 14,202,131, 67,174,
-103,189, 65,119,177,220,207,105, 33,111,236,100,115, 9,105, 56,144,113, 62,159,165, 43,131, 93, 89, 54,222, 87, 70,226,165,164,
-133,224, 83, 10,138,114, 76,103, 62,137,150,166, 28,124, 77,247, 32, 66, 19,204, 73, 16, 34, 37,199,220,112,173,166, 81,185, 64,
-253, 26, 80,181,170,169, 52,173, 15, 81,173,134,223,185,217, 58, 16, 36,144, 41, 3, 18, 72, 66,132,245,168,203,133, 65,108, 26,
-129, 26,113, 60,122, 62, 93,126,202,112, 73,187,242,107,121, 13,187, 31,183, 95,113, 92,218,230,136,151,169,153, 14, 41,143,223,
-195, 25, 30, 40, 45,146, 60, 22, 35,221,146,235, 14, 67, 68,137, 59, 30,117,150, 80,241, 62, 27,106, 43, 13,238, 69,109,127,146,
-216,193, 98,219,201, 85,141,144, 52,180,150,168, 43,197, 84, 35, 78, 29,101, 66, 42, 26,210,127,235,207,182,182,101,196,142,247,
-198, 13,204,132, 57,158,128,115,226, 82,186, 43,229,227, 22,227,222, 60,186,241,218,252,193,113,109,230,126,117,147, 94, 84,237,
-227,143,121, 7, 36,182,241,230, 35,142,226,138, 74,228,178,181, 73,149,115,133, 22,225,114,126, 51, 5,214,224,200,146,223,178,
-226, 74,218, 81,240,210,229,238,217,203,246,113, 61,142,185,113,120,112,118, 8,141, 96, 0, 29, 82, 18, 65, 0,240, 0, 21,232,
- 64,226, 55,123, 63, 37,218,219, 91,124, 85,252,141, 14, 67,165,142, 32, 41,236, 57,156,137, 10, 8, 7, 17,146,179,188,205, 92,
-177, 76,195, 42,206, 98,241,138,241,107, 46, 11, 62,107,146, 49, 91, 11, 86,216, 88,220, 76, 81,168, 42, 44,164, 78,132,133, 56,
-137, 6, 43, 37,198,216,152,162,160,232, 81,162,146, 84,164, 7, 89,187,142, 82,221, 97,185,183,157,174,177,115,251,205,183, 66,
- 74, 52,163, 30, 23, 86,103, 18, 74, 38, 35, 16,131, 55,125,126, 54,187,161, 36,110,107, 98,255, 0, 64,104, 82, 6, 68, 12,248,
-162,225,141,114,147, 33,227, 12, 3, 17,228,136, 89,245,162, 20, 52, 94,146,197,213,114, 91,182, 52,251,243,175, 78, 16,194, 67,
-133,180,125, 8, 45,181,189, 40, 44, 54,104, 23, 66, 73,165, 45,119, 79, 48, 47, 57,133,229,209, 44, 57, 0, 67,144,129,142,110,
- 81,143,171, 42,206,110,188,209,113,186, 75,226,196,223, 12,140, 3,154,160,166, 88,144,131,171, 0, 61, 53, 12, 92, 60,203,225,
-118,151,229,194,200,227,229,216,157,197,171,164,248,246,235,220,139, 90,162,219,152, 75, 78,161,230, 90,114, 66, 20,184,238, 36,
-180,233, 43,105,125,127,105, 73, 73,162,181, 42,243,106,220,121,133,205,154, 89,153, 51,155, 27, 91,152, 82, 2,244, 0, 85, 85,
- 29,237, 53, 85,118,203,157,192,137, 28,142, 40, 59,126,143, 95, 26,156,241, 78, 72,203, 50,139,114, 30,176, 60,205,217,108,217,
-197,217,187,133,150,123, 46,177,115,183,189, 79,245,152,170, 47,215,194, 71, 79, 27,123, 75, 13,158,138,168, 41, 82,170,109,180,
-108,215, 81, 25,228, 49,141, 72,224,240,226, 7, 81, 3, 53, 30,234, 57,164,230, 8, 66,148,151, 91,108, 45, 8,230, 3,211,212,
-122, 50,166,194,178, 27,231, 42, 98, 25,230, 33,155,219,177,233,110, 95,237, 23,118,108, 87, 86, 44,232,176, 94,161,188,235,111,
-185, 6, 81, 73, 91,201,116, 45,246, 80,242, 29,105,208,163,218, 90, 66,123, 58, 63, 49, 54,210,194,214, 29,218,196,190, 54,151,
-128, 90,231,120,204,122, 56, 7, 52, 61, 3,227,145,141, 40, 88,246,161,106, 36,142,113,197,136,246,216,237,228,107,162, 36, 6,
-230, 1,195,172, 38, 68, 82,229,255, 0,151,173,188,213,228,213,251,213,225,168,140,100,215, 30, 63,186,216,178,100,178,150,161,
-197,145,145,226,209,233,227,134, 25,109,180,182,185, 82, 98,251, 67,247,206,234,128,118,142,115, 14,235,186,236, 27,179,172, 76,
-174,146,212,200, 11,117, 43,156, 24,226,169,168,146, 72,104, 56, 42,148,195,133, 70,118,203,107,111,120,217, 24,192,215, 2,184,
- 96, 61, 93,135,133,112, 87, 37,131, 51, 26,201, 47, 56,114,101,188,245,166,203,144,202,147,106,109,106, 62, 31,129,115, 67, 43,
- 67,161, 53, 32, 23,163,165,162,126, 1,174,231, 97,112, 46,161, 18,166, 36, 99,218, 20, 31,109,110, 0,107,192,122, 98, 70, 62,
-138,236,231,225,201,200,176,160, 98,185,126, 33,123,120, 34, 61,174, 67,153, 69,190,190,210,202, 84,148, 55, 37, 9, 72,234,174,
-137, 66,168, 61,122,201,243, 31, 48,205,176,201, 17, 99, 53, 53,229, 8,232, 63,167,232,172,118,249,203,237,221,101, 15, 5, 28,
-137,219, 95, 69,248,172, 79, 35,184,119, 6,219,185, 39,158,121,186,209,130, 73,190, 38,245, 2,195, 99,185,229,108, 55,201, 23,
-169,150,149,120, 42,155, 10,211, 20, 74, 91,145,213, 45, 46, 54,218, 21, 24,164,109,171,146, 0, 34,182, 59, 71, 50, 13,246, 49,
- 44, 10,208, 73, 93, 64, 0, 0,244,253, 62,170,221,108,190, 90,108,183, 22,141,154,225,211, 2,229, 11,169,173, 82, 48, 58, 71,
-120,105, 4,113, 83,219, 95, 54, 30,111, 57,119, 16,229,238,120,201,239,220,117, 14, 92, 14, 62,180,183,111,197,240,230,229,203,
-118, 76,171,133,182,196,202, 89,118,226,224,117,106, 83, 74,186,203, 14,203,240,129,163, 97, 97, 3,162,107,163,191,115,158,228,
-113, 84,226, 48, 21,101,103, 97,103,180, 61,208,216,131,225, 3,129,113, 82, 74, 0, 73,237, 76, 7, 1, 93,231,242, 53,196,216,
- 63,150,139, 55, 22,242,196,174, 97,199,178, 22,242,254, 51,131, 2,233,100,198,225,135,161, 89,111, 57, 22,219,181,193,155,172,
-231,229,178,150,157,134,230,216,237,165,150,156,221,225, 41, 68,163,160,213, 92,205, 16, 70, 38,123,152,214, 18, 0, 37,195,188,
-236,112, 28, 21, 56, 45,116,173,159,100,116, 4,206,249,219,223, 32,180,112, 35, 72, 26, 84,145,136, 43,146,215, 99,177,110, 75,
-176,101,129,185, 54,137,209,231, 53,238,168,152,203,145,221, 14,161, 77,182, 75,100,130,146,106, 14,211,215, 70,217, 2, 40,173,
- 24,136,179, 3, 79,152,143, 45, 46,168,132,159,167,142, 31, 40,253,228,172, 18, 0,235,219, 78,221, 75,129,234,104, 72, 48,168,
- 63, 53,120,180,226,157, 13,148,133,110, 42, 64, 62,202,156, 96, 2, 43,215,190,167, 86, 49, 26,143, 33,168, 15, 47,184, 72,105,
-230,166,181, 84,185,225,253, 47, 80,146, 28, 62, 24,165, 43,220, 6,173, 32,198,170,102,114, 84, 79,121,206, 22, 98, 54,158,215,
-148,165, 16, 65,175, 78,210,123,122, 83,166,173, 33,141,106,142,225,232,105,139, 43, 46, 98, 92,160, 92, 90, 83,224,181,181,210,
- 85,212,237,218, 7, 90,245,246, 70,167, 54, 44, 42,184,202,149,228, 12,160,198,113, 18,218,144, 10,146,166,154, 90,119,246,212,
-158,206,189,131,191, 72,146, 26, 88,184,169,211, 30,204, 83, 50, 33,144,151,168,227,137, 86,207,164,246,118,130, 1,239,244, 13,
- 85,205, 18, 80, 51,165, 58,142, 74,149, 54,248,241,193,119,196,162,150, 21, 66, 20,148, 3,233,248, 41,170,249, 35,162, 55, 20,
- 96,229, 59, 26, 88, 91,128,162, 72, 83,116,221,209, 62, 16, 2,189,189, 15, 77, 69,123, 18,162,203, 61, 71, 87, 43,137,148,251,
-136, 74,193, 65, 41, 41, 5, 94,209,246,138,106, 58,247,154,252,154,108, 4,168, 47,154,152,242,103,150,150, 80,160,176, 55, 52,
- 70,213,123, 59, 28,170,210, 59,125, 37, 67,228,211,194,163, 57,235, 69, 36,248, 78, 41,198,200,160,148,159,104,246,128, 72,236,
- 61,123,200, 26,108,185, 41,189,117,237,178, 79,187,200, 17,154,246, 66,141, 20, 71,206,161,234,107,215,210,116,196,165,104,204,
-149, 29,121,194,228, 79,238,239, 12, 71,198,161, 76, 98, 61,195, 56,186, 71,134,249,113,210, 28,106,217, 18,174,173, 91, 16,164,
-173, 65, 78,165, 3,167,111, 81,170,153,165, 16,227,138,142,138,200,243, 85,247,133, 14,129,155,141,113,143,251,197,121,183, 38,
-106, 74,203,197,249, 10, 2, 67,168, 90,223,106, 39,134,170,165,176, 84,118,214,181, 2,186,140,248,225,184, 32,140, 48,200, 34,
- 18,188,107,149, 76,226,104,139, 23,185, 55, 9,132,162,237,107, 67, 80,223, 65, 13, 75,104, 37,229, 50,174,213,171,103, 93,201,
- 61,134,154, 18, 49,176, 55, 22, 59, 17,192,241,232,168, 62, 25,119, 69, 52,175,147, 24,102,122,132,155,178,158,240,101, 25, 17,
-131,110, 41,132, 59,214,189, 40,162,167, 40, 61, 35,224,213,149,164,133,204,193,136,161, 14, 69, 62,170,108,192,153, 86,240,242,
- 43, 52,165, 57, 16,173,212, 75,247,215,147, 9, 78, 74, 80, 80,102, 69, 2,210,143,104, 18,107, 90, 21,130,116, 82,193, 36, 99,
- 88, 56, 38, 56,113, 25,124,133, 44, 69,213, 78, 43,117,198, 45,157,130,197,149,168,242, 38,169,111, 9,114,166, 63,239,101, 5,
- 67,161,220, 77, 69, 41,237, 13, 87, 92, 57,247,101,102, 36, 55, 4, 3, 10, 91,109,200, 24, 10,218,233,145,221,110,113,228, 58,
-135,109,141,157,202, 43,117,229, 37, 42,116,167,104, 80, 9,170,139,105, 36,116, 4, 31, 86,138,214, 24,173,200, 29,239,151,206,
-104,205,171,223,157, 20, 51,218,188,219,219,128,237,222,217, 30, 83, 5,182,154, 68,102,130, 22, 85,208,211,110,208,170,158,250,
-211,211,167,132,134,210, 67, 32, 99,136, 56,149, 63, 33, 68,109, 75,176, 74,111, 74,195, 35, 62,227,242,110,151, 21,191, 30, 91,
-170,142,136,145,208,106,195,145,168, 1, 35,168,165, 77, 73, 73,213,189,175, 49, 22,163, 98,104, 4, 98,167,138,209,252, 11,186,
- 40,252, 14, 38,198,101, 76, 50, 62,242, 92,133, 16,202, 75, 43,144,164, 20, 45, 84,219,181, 67,118,234,246, 82,157, 53,172,219,
-249,186,118, 52, 2,212,235, 65, 83,237,246,226, 14, 85,106,120, 67,202, 20,206, 98,228, 11,111, 28, 97,214, 25, 55,204,174,249,
- 87, 97, 55, 10,230, 45,176,160,219,163,182,167, 94,147, 45,247, 82, 17, 25,152,237,130,183,157, 81, 0, 15, 73, 32, 29,110,207,
-204, 87,187,187,219, 29,185, 0,102,226,224,160, 5, 1,112, 82,113, 32, 0, 1, 36,144, 6, 38,183, 92,187,203,178,238,146,136,
-163, 3,164,147,144, 29, 61, 39,168, 12, 73,192, 87,211,223,148,174, 56,227,111, 42,220, 88,199, 17,223, 51, 62, 56,200, 46, 22,
-134,166, 71,200,100,113,245,150, 83, 17, 38,220,102,201,118, 93,110,151, 85, 60,195,151,201, 44,151,146,210, 20,234, 82,218, 27,
- 67, 97, 45,130, 9, 62,144,111, 46,223, 77, 4, 82,219,218,190, 55, 4,239,191, 75, 92,228,104, 4,134, 16,227, 24, 56,184,144,
-117, 18,226, 10, 4, 21,238, 14, 70,228,155,155,187, 86,179,109,180, 3,195,210, 11,244,180, 56,144,208, 14, 36, 61, 53, 98,226,
-157,229, 56,160, 65, 76,238, 83,228,107,188,107,110, 13,103,189,100,183, 91, 52, 14, 58,104,192,196,115, 91, 36,165, 89,226,200,
-136,194, 82,212, 85,191, 34, 51,169, 16,103,150,129, 75,187,212,150,223,168, 45, 43,113, 91, 45,233,182,219, 8, 54,223,136,241,
- 88, 9,153,193,207, 80,186,142, 42, 10,230,222,129, 94,141,228,158, 88,179,229,182,220, 69, 60, 44,120,153, 28,237,109,212,164,
- 2,173, 32,140, 70, 56, 97,210,163,166,135,249,191,243, 69,139, 88,236, 54,143, 47, 88,222, 83,112,201,179,110, 80,147,247,238,
-100,243,151,175,127,190, 95, 96, 33,183, 98,199,138,252,135, 95, 75,155, 95,220,226,158, 42, 87, 68,248,105,249,187,169,131,243,
- 66,107,219,139,102, 91,109,113,180, 52,176,130, 64, 1,172, 98,130, 64, 29, 47, 32, 12, 6, 13, 14, 7,222, 21,196, 63,184,141,
-254, 86, 91, 55,109,177, 99, 24, 31, 25, 97, 13, 1,173,142, 34,224, 72,104, 24, 3, 33,106, 96, 48, 99, 94,190,240,174, 74,229,
-247,120, 54, 49,113,198, 95,135,138,165,248,183, 4, 52, 17, 14,230, 50, 40,209,125,145,226,132,205, 72, 91, 18, 9, 88, 81, 14,
- 50,178,142,192, 10,169,185, 94, 77,220,217,113,101, 57, 19, 61,250,154, 49,200, 47, 17,128,203, 2, 51,253, 21,243,223,121,219,
- 62, 25,230, 54,149, 35, 3,209,232,168,241, 23,242,202,202,228, 55, 25,171,106,143,128,204,132, 60,169, 5,245,208,144,144,205,
- 18, 42,123,205,117,207,247, 73,132,196,134,146, 95,153, 25, 39,166,178,114, 89, 61,216,165,104,254, 96,195,136,122,179,203, 14,
- 36, 41,182,224,192,109, 81,155,171,164,143,105, 10, 35,173, 61,125, 53, 70,219,125, 36,119, 87,172,226,125,117, 28,217, 59,211,
- 66,193,185, 6, 38,197,158,185, 22,247, 93,109,181,123,202,100, 41,213,184,136,235,253,144,143,105,180,146, 79, 82,145,168,247,
- 50,135,180,176, 7, 1,193, 19, 62,220,253,116,227,118,199,102,162,128,147,151,200,247,182, 28, 16, 34,197,147,187,194,104,161,
-198,221, 14, 71,108,244, 80, 82,170, 82, 79,193, 93, 19, 34,102,146, 53, 18,220,248,140,105, 67,110,114,240,175,102,242, 34, 74,
-140,105, 50,226, 45,213, 6,209, 57,233, 14, 52,162,232, 73, 73, 8, 79,182, 15, 81,234,235,166, 98,176,251, 77, 5, 56, 0,184,
- 83,159,203,201, 56,154,143,174,153,116, 87,222, 41,135, 33,216,204, 52,235,139, 66,140,253,158, 26,154, 59,168,141,138, 8,167,
-168,234,226,222, 23, 49,189,224, 9, 35,163,235,198,136,216,180, 20, 21,164, 78, 85,180, 90,152, 2, 68,133,175,197,220,243,209,
- 82,235, 94, 36,167, 24, 72, 41, 20,249,221,107,215,218,209, 77,180,203,112,123,163,168, 28,112, 95,101, 59, 29,171, 25,154,209,
-116,121,153,130,195,111,199,139,110,125,134,130,254,145,195, 48, 37, 10, 85, 40, 18, 16,214,227, 74,244, 59,142,146,254, 74,146,
- 66, 28,231,130,123, 62,191,162,156,211, 24,200, 26,142,239, 28,229, 14,115,134, 82, 36, 17, 50,160,248, 42,115,112, 81, 7,167,
-179, 84,138, 31, 65,213,197,183, 45, 62, 33,167,236,210, 12, 76,205, 41, 9,254,114,185, 78, 64,141,224,197,140,219, 65, 45,175,
-192,140, 24, 46, 33,186,245, 43, 74,168, 43, 95,104,234, 75,121,101,144,247,181, 18, 79, 73, 90,112, 48, 30, 1, 41,169,255, 0,
-197, 41,104,149, 21,101,233,101, 73, 81, 67, 78, 34, 73,105,164, 34,163,183,181, 71,225, 58,154,118, 86,185,174, 24, 39,102, 52,
-108,140, 45,121,113,228,103,158,148,149, 49, 42, 75,234,105,126, 49,105, 72, 50, 84,243,166,165, 99,169, 35,191,183, 66, 29,173,
-172,110, 32, 14, 29, 9, 75, 49,210, 51, 57,212,230, 84,101, 70, 83,176,148, 94, 33, 76,182,160,135,139, 99,176,208,117, 77,107,
-212, 13, 72,125,139, 28, 52,187, 28, 51,164,136, 58,168,220,254, 65,186, 62,173,210, 38, 75,144, 22, 91, 9,142,153, 59, 82,218,
- 54,154,166,135,167,103, 67,166, 98,219, 99,140, 96, 0,235, 74, 51, 0, 60, 41,165, 43, 34,146,219,238,188,219,114, 28, 15,169,
- 37, 46,118,132, 22,232, 74, 42,144, 63, 54,167, 50, 54,144, 1, 35, 10, 64,132, 28, 64,164,115,151, 92,140,182,201, 79,250,171,
-126, 48,109, 30, 34, 60, 96, 94,113, 11, 95, 90,120,159, 57,180,254,213,127, 62,164,139, 88,195, 73,251, 94,204, 21, 58,184,158,
- 20,225,212, 90, 25,192,112,237, 79,170,190,151,241,190, 76,181, 92, 49,233,238, 51,118,118, 12, 57,107,151, 73, 6, 82,162,184,
- 97,251,176,139,226,120,137, 80, 90,214,236, 86,128, 80, 61,129, 93,190,143,155,119,155, 60,182,243, 6,134, 41,203, 37,226,190,
-160,126,154,245, 12, 81,124, 75, 67, 2,151, 21, 24,102, 87, 12, 58, 73,250,107,229,235,206,167, 41,218,111, 60,209,204,150, 62,
- 58,188, 49,149,226, 23, 12,134,204,185,137,199, 26, 65,181,185,150, 89,237,144, 45,239, 79,185,205,101, 5, 19,137,157, 29,242,
-196,109,251, 43, 69,172,159,152,175,107,249, 75,200, 51,110, 27,125,163,239,131,163,238,185, 53, 30,246,146,231, 16, 24,211,238,
-247, 72, 87,102, 50, 29, 53,238,142, 95,243,226,127, 40, 57, 46, 14, 93,110,151, 93,247,137,132, 52, 0,213,121,115, 13,219,179,
-144,180, 16, 89,110,186, 70, 6, 92, 70,138,152,127, 15, 31, 32,184,255, 0,153, 7, 30,231,143, 49, 57, 13,214,225,199, 86,124,
-233,252,127,251,145, 18, 75,140, 93,115,137, 86, 70, 34,201,144,228,219,143,138, 31, 98, 26, 82,248, 97, 73, 96, 37,106, 32,165,
- 43,108, 1, 86,252,241,243,114,227,203,141, 59, 14,199, 19, 91,112,232,131,140,132, 40,140, 56,184, 13, 45,200,201,130,171,148,
- 5, 4,181,220, 60, 85,206, 60,221,127,191, 79, 45,253,220,142,150,121, 10,185,238, 42, 84,253, 3,128,200, 4, 2,190,138,155,
-103, 16,141, 13,213, 99,150,139, 60, 72, 24,251, 17, 45,118,236, 34, 55,129, 7, 39,137, 29,189,200, 91, 54,155,122, 92, 40,146,
-219, 46, 21,199, 96, 32,161, 52, 79,206, 72, 4,107,196,172, 55, 82,185,166,103,184,151, 59, 83,165, 42, 88, 84,130, 53,184,226,
- 28,125,231,102,113,200,215, 47, 22, 94, 51,156,229, 82,170,153,149, 42,184,103,158, 21, 3, 51,202,182, 43,222, 77, 47, 13,194,
- 50, 27, 41,143,115,109,144,205,247, 34,152, 45, 47,162,248, 23,227, 55,103,150, 36,133, 57, 26,107,126,238,183, 23, 25,104,220,
- 81, 85,132,168, 7, 18,222,247,249, 52,182,173,109,221,244, 79, 45, 4, 43, 35, 10,172,200,189,165,184, 22,149, 0, 56, 96, 14,
- 10, 21,164,155, 26, 45,156,165,170, 1, 4,234,195, 0, 70, 7, 35,192,245,212, 21,150, 57,133,112,162,242, 78,109,176,113,254,
- 65,140, 99,151,252,132,219,243, 91,222, 55, 58,126, 71, 98,187, 71,185, 77,117, 6,112,122, 75,200,114, 50, 96, 63, 53,196, 53,
- 49,176, 10,202,188, 42, 16,176,180,244, 59, 93,194,231,152, 47, 5,155, 46, 35,241, 27,251, 72,162,120,104, 44, 32,106,107, 52,
-129,165,216, 52,119, 72,193, 53, 28,136, 50, 63,156, 75,188, 74,233, 52,144,213, 37,189, 1, 50, 24,231,233, 95, 94, 21, 96,121,
- 87, 32,201,185,187,139, 56,221,153,184,202, 51,188,106,240,152,188,127,131,221,108,174,162, 19, 25, 28, 44,230, 98, 19,104,140,
-251,209, 3, 83,101,120,151,121, 73, 67, 82, 2,131,137, 46, 26, 41, 91,105,167, 45,121,162, 89,164,102,217, 51,201,188,138, 66,
-245, 42,100,192,119,154, 65,238,184,128,164, 42,225,221,193,106, 91,238, 47,183, 70, 55, 88,196, 42, 56,133,113,224, 7, 94, 57,
- 47,170,184,221,159,115,239, 46, 88,110, 17,111,151,251, 28,204, 22,253,198,217, 12, 28, 31,146,248,174,100,181, 38,197, 50,207,
-126,140,103, 89, 93, 68, 9, 42, 46, 39,223,109, 77,184,133, 75, 74, 55,159,163,116, 44, 21, 39, 93, 86,223,148,237,162,116,150,
-174,239, 9, 26, 95, 28,132, 35,218,224, 81,234, 66,100,226, 28, 26,112, 69, 8, 69, 64,188,219, 77,155,139, 36,105, 36, 98,174,
- 24,133,225,213,210, 56, 82,191, 48,249,170,227,152, 55, 44,115, 42,131,128,221,178,126, 57,106,242,179,102, 15,228, 46, 38,125,
-170, 56,133,109,113,216,207,198,119,199, 97,230,218,145, 37, 41, 33,231, 20,165, 40, 20,169,100,109, 2,135, 99,228,171,167,198,
-251,119, 78, 25,113,167,188,116,132,113, 87, 33, 4, 33, 4,129,192, 96, 49, 0, 26,175, 7,196,214,192, 0, 36, 4,207, 15,105,
- 92,141, 84,223, 48,185,174, 59,152,113,172,252,209, 45,191,107,189,231,156,153, 1,231, 44, 54,123,175,185,226,176,224,227,182,
-133,161,199,219,183,123,186,201,122, 67,210, 80,175, 24, 74, 74, 82, 9, 64,104,215,120,221,242,197,143,242,185,190, 17, 92,227,
- 19, 48,123,128, 42, 28,243,129,114,169, 68,201, 56,102,105,203,105,219, 35, 81,203,226,132,199,130, 21,193, 58,112, 24,225,217,
- 72,151,156,167, 12,227, 12,111, 15,229,110, 1,205,178, 28, 18,245,116,251,202,215,148,240,212,247,151,144, 88, 44,247, 56,140,
-196, 82,239, 22,235,131,239,120,136,106,228,225,175,187,150,141, 8,167,138,164,130,218,103, 90,237,242,110,222, 45,174,232,198,
-202, 90,243,166, 64, 3,117, 48,169, 0,129,147,152,168,113,199, 52, 21,101,188, 73,105,122, 24, 98, 97, 14, 62,243,115,210, 70,
- 24, 59,142,172,192,225,211, 83,159,150,255, 0, 54,188, 97,123, 76,155,151, 46,228,119,121,183,137, 19, 81, 26, 93,225, 16,219,
- 15,174,122,153,127,194, 98, 60, 40, 81,203,174,163,196, 73,218,224, 4,213, 73, 81,165, 84, 17, 65,205,156,177,184, 65, 15,129,
-183, 53,162, 32,164, 49,112,197, 3,137, 46, 40,164, 1,232, 8, 50,199, 47,113,183,186, 7,144,198,160, 35,228,171, 73, 7, 55,
-182,217,236,188,221,199,118,228,201,133, 5,254, 77,145,144,227,145,100, 67,145, 30, 84, 91, 14, 90, 4,134,216,117, 46, 36, 6,
-194, 26, 64, 82, 66,191,120,250,116,236,123,123,238,190, 22,234, 66, 11,132, 33,174, 66, 19, 83,112, 36,118,159,154,171,238,161,
-241, 36,142, 70,166, 71,141, 85,222,104, 68, 57,185,229,130,235,111,143,224,177,119,227,254, 48,114, 74,211,237, 52,237,218, 21,
-130,219, 26, 98,130,129, 41, 81, 50, 25, 81, 36,122,117,172,229,205,113,219, 61,143, 56,137,165, 79,213, 47,113,111,176,213,187,
- 28, 11,112,224, 79,207, 83, 39, 20,100,121,110, 41,100,200, 36,225, 18, 31,143,145, 79, 44, 88, 98, 46, 43, 97,201,101,187,209,
-216, 67, 32,252,213,146,221, 18,160, 42, 15, 81, 67,215, 81, 55,171,120, 46,157, 31,196, 38,128, 75,138,229,134, 56,245,117, 83,
- 80, 0,233, 6,172,146,186, 35,102,226, 11, 23, 16,112, 78, 79,201,247,103,217,201,249, 38,229, 22, 45,138, 29,234,242,204,139,
-146,166,230, 25, 41, 10, 83, 86,167, 86,211,209,148,171,100, 66,167,223,117,199, 82,179,211,247,130, 70, 42, 25,110,185,154, 83,
- 48, 34, 27, 8,158, 59,184,183, 88, 31,103, 1,137, 41,136,200, 3, 86,138,235,150, 58, 64, 81,141, 32,118,158,143,164,142,138,
-175, 28, 67,199, 49, 47,185,166, 61, 31, 48,187,219,236, 86, 55, 46,109, 63,116,155, 53,213,150, 26,183, 67, 10,125,245, 56, 89,
- 67,206, 36, 41, 13,148,130, 16, 77, 79,102,166,243, 7, 49, 58, 27,121, 29,108,199, 61,233,130,116,156, 6,105,196,208,180, 38,
- 87,134, 40, 11,196,229, 93, 38,195,242, 91, 69,203, 48,202, 14, 7,145, 63,125,181, 61,105,176, 90, 30,184,217,242, 1, 19, 29,
- 79,185, 57, 49,246,246,182,252, 98,234,222,241, 84,119,154, 80, 0,128, 59,104, 57, 84,198,242,214,220, 69, 46,168,218,242, 75,
-154, 65, 83,139,115, 1,201,129, 1, 56,231, 91, 43, 66,219, 40, 91, 28,174,112, 58,137, 65,136, 35, 15,103,181, 86,186,117,248,
-108, 47,148,178, 41,220,131,120,186,192,157, 23, 21,198,239,163, 20, 49,238,170,241,148,101,204,105, 18,212, 35,184,154, 54,226,
- 27, 10, 10, 36, 36,116,112,107,167,108, 23, 58,224,107, 23, 80, 1, 87,232,237,233,174,147,103, 59,100,183,104, 93, 93, 7,170,
-187,120,213,164,123,167,222, 11,246, 10,216, 45,160, 30,129, 45,138,154,246,244,162,105,173,125,187, 14,116,204,146,240,170,227,
-200,197,186,171,194, 0, 33, 1,225, 69,124,227,189, 61, 85, 74,247,141, 89,196, 42, 51,223, 85, 71, 35,153,227,188,246,231, 23,
- 82,181,149,161, 75,246,126,114, 77, 7, 94,250, 83, 87, 22,226,170, 46, 94,149, 90,242, 23, 95,136, 92,219, 66, 27, 90,212,176,
- 79, 78,211,243,122,245,232,147,171,200, 27, 89,251,137, 22,162,161,124,132,243,207,120,143,248, 42, 9, 90,150,146,174,213,171,
-104, 3,183,212,117,100, 24,149, 92,247, 26, 40,171,219, 42,144,150, 99, 74, 9, 1, 9,117, 68, 46,168,222,138, 39,182,189,224,
-154,104, 57,148,141, 68, 83,222,207,154,202,128,133, 71, 14,109, 72, 72, 3,114,232, 2, 70,250,211,175,121,212, 25,161, 6,144,
- 95, 79, 88,153,219,111, 85, 66, 66,149,237, 37,123,183,209, 39,194,232,174,254,224,117, 87, 44, 73, 77, 58, 83, 75,199, 50, 14,
- 66,118,142,168, 37,181,186,176, 86,107, 80, 71, 78,255, 0,218, 7, 85,242, 51, 26,142,233, 13, 22,115, 52,132,195,137, 10,124,
- 45,197,129,225, 36, 46,189, 81, 78,149,175,164,157, 68,115, 13, 48,231, 19, 73,103, 33,143, 45,105, 66, 94, 14, 19, 82, 10, 85,
- 94,237,169, 29,190,189, 17, 4, 81, 45, 45,198,150,169, 5,196,164,213, 73, 66, 10, 83, 94,242, 20, 1,237,244,211, 76,184,165,
- 17, 41, 78,104,205, 51, 29, 46, 72,117,196, 33,107,105, 18, 30,113,102,141,176,202, 65, 83,132,245,232, 2, 81,168,146,201,164,
- 41,200, 83,111,114, 10,228,103,152,252,211, 42,229,110, 70,185, 57,143, 93,154,143,101,177,173, 54,219, 20,117, 20,169, 77, 70,
- 96, 20,151, 18, 79, 68, 45,213, 18,175,143, 88,251,158,103,180,133,197,178, 52,145,143,178,185,222,244,201, 47,165, 46, 7, 1,
-149, 85,197, 91,114, 27, 37,193,193,119,135, 38,252,181, 60,168,174, 60,220,128,180,135,247, 26, 83,176, 30,206,205, 24,223,237,
-111, 25,251, 39, 6, 39, 4,172,244,155,115,216,113, 11, 91, 57, 7, 35,154,242,227,195,196,190,238,106, 65,241,220,151, 35,235,
- 29,109, 38,135,218, 9, 52, 77, 7,167, 74, 27,165,180, 35, 83,231,213,212, 56,123,105,161,102,254, 45,166,204,197,100, 54,103,
-215, 42, 86, 57, 54, 67, 85,117,136, 82, 89, 37,228, 70, 6,173,133, 36, 32,239, 3,161,238,212,203,107,219,107,246,134,178,102,
-131,196, 28, 23,215,133, 17,180,124, 95,102,146,219,190, 74,145, 53, 78, 71,177,135, 29,117, 45,183, 41,201, 54,197,184,226, 28,
- 74,147, 69, 37, 78,246, 5, 40, 14,180,212,153, 3, 24,196,116,168,153, 35,135,209, 73, 13,119, 6,251, 41,193, 34, 92,247,182,
-181, 45,168,209,223, 66, 10, 60, 4, 69, 84,127, 10,189, 70,237,165, 33, 66,189,130,186,174,101,204, 77, 5,204, 36,133,205, 86,
-148, 99,144,226, 91, 94, 34, 42,252, 85, 72, 68, 70,229, 42, 66, 27,162,192, 91,141,180,229, 5, 81,176,144, 6,254,228,250,116,
-159,230, 77, 68, 46, 32, 14,207,159,170,128,142, 79,242,209, 55,175, 57, 61,190, 66,219,102,195,224,180,219,136,113,209,224,165,
-148,169,180, 17,182,138, 1, 94,201,175, 94,253, 63, 24,182,185,106,248,170,123,126,138, 82, 61,185,138, 45,253,232,149,119,125,
-184, 76,193,114, 12,133, 77, 75,104,105,153, 43,111,194, 82,202, 18, 77,105, 78,170, 61, 6,166,195, 20,118, 96,200,231,130, 0,
-204,140,243,167, 35,100,146,101, 82,180, 28,123, 42,134,192,145,247,136,251,177,151, 99,123,219,136,105, 79,169,130,224,170,148,
- 66, 66,214,176,158,149, 0,119,234,251,151,183,189,191,113,184,142, 57,220, 35, 4,161,113, 5, 0, 29, 77, 4,147,154, 97, 87,
-214, 54, 62, 36,141,107,221,165,164,226, 80,148, 29,128, 19,236,174,248,121, 41,243,253,228,143,203,215, 26, 63,102,206,248,159,
- 49,137,149,253,221,111,182,222, 21,136, 98,145,114,116,101,172,219, 17,189,217,183, 59,133,194,237, 26,227, 40,207,144,143, 20,
- 64,113, 2, 51, 4, 0,210, 59, 78,189, 47,113,184,108,214, 16, 71, 38,201,117, 12, 67, 21,121,215,227, 18,114, 0, 54, 51,165,
- 49,239, 40, 37,115, 1, 43,209,123,118,235,180,109,208,180,109,239,142, 16, 85, 94,224,231, 74,122, 27,131, 28,224,152,171,145,
-170,185,129, 80, 63,153, 79,198, 63, 7,207,174,210, 97, 96, 60, 77,116,180, 52,202, 37, 28,106,215,113, 76, 60,110, 97, 13, 54,
-165,178,211,176,173,190, 42, 22,162, 40, 20,231,190, 13,190,189,160,107,101,203, 62,102,218,237, 81,136, 26,215,184, 56,254,210,
-105, 94, 93,136, 11,221,104,212,113, 40,152,132, 85,233,174,211,202,158,122,219,242, 69,159,133,183, 90,186, 82,228, 15,150,121,
- 10, 47, 18,214, 13, 69, 58, 6,161,237, 53,199, 62, 99,243,239,230,251, 50,193,242,104,119, 22, 29,227,220,118,226,249,140,221,
-211, 20,185, 36,221,109,214,229,173, 64,199,113,207,124,159, 49,133,201,240,206,208,243,168,233,237, 37, 36, 26,107, 93,111,191,
- 91,115, 19,137,182,145,174, 3, 62, 30,195,143,209, 75,223, 60,241,185,223, 37,107,173,231,104, 96,105,212,198,179, 72, 36,229,
-222, 35, 80, 78,163,219, 80, 71, 8,113,151, 34,242, 93,249,222, 78,205,239, 86,214, 56,215,141, 48,249,185, 53,251, 41,190,186,
-231,184,181,113,190,219, 87, 42, 21,172, 55, 21, 81,222,188, 75,151, 17,106,113,200,108,138,116, 33,245,161,163, 93,100,118,110,
-116,182,222,111,103,128, 65, 32,100, 46,116,122,220, 17,165,237,118,146, 0,205, 20, 18, 15, 64, 84, 10, 43,152,115,255, 0, 51,
-220, 62,214, 54,202,246,151,201,164,128, 49, 41,129, 85, 32,140, 20,116, 98,115,171,115,151, 95,177,248,188,102,203, 40,202, 98,
-221,242, 38,155, 66,237,215, 27, 93,134, 76, 55, 82, 86,122,178,235,108, 38, 75, 9, 64, 38,158, 24,114,169,253,154,107,146,115,
-160,216,183,153,220,201,166,137,146,244,135, 52,159,247, 1,137, 29,190,138,243,238,237, 35, 47, 28, 73, 40,122,106,153, 71,200,
-179,251,170,218, 75,168, 65,109, 82,156, 98, 43,142, 54,164,109,122,180,175,180, 82,161,219,240,235,131,238, 31, 3,108,247, 6,
-185, 83,136,200,129,198,177,111, 99,129,166,125,203,145, 51, 27, 67,254,224,234, 35, 5,138,188, 93, 97,149, 41, 75,121,181, 16,
- 10,170, 84,170,116,248, 52,236, 59,117,173,203,117,133,245,252,213, 28,175, 69, 16, 57,254, 93, 44,135, 91,152,248, 83,138, 76,
-122, 71,100,162,170,119,186,162,157,253,130,149,210,190, 6,214, 48,132, 12, 49,196,209,104,115,138,241,173,230,202,228, 56,108,
-165, 79,139,146,158,145,181,208,146,203,142, 20,178,241,246, 8, 79, 82, 10,128, 61,189,218,106, 9,236,167, 36,183, 74, 12, 21,
- 70,116,224,183,144,133,210,105,161,114,185,100, 10,117, 34, 82,110, 66, 72, 9,116,238, 97, 91,200, 95,101, 72,174,223,155,223,
-232,213,148, 70, 16, 21,186,116,158,186, 2, 7,160, 36,103, 94, 75, 70, 65, 29, 17, 94,152,244,143, 10, 75, 78, 56, 2, 86,106,
- 10, 84,164,168,159,132,164,244, 26, 30, 52, 77, 80, 17,105,201, 44,158,208, 9,227, 68,211, 14,233,116, 78,216,236,202, 90,219,
- 88, 21,109,165,165,192,149, 0, 5, 58,247,215, 72, 59,140,118,229, 92, 69, 55, 29,161, 38,156, 8,194,179, 87, 99,134,161, 88,
-239, 19, 29, 1, 63, 68, 33, 41, 52, 81, 21, 63, 73, 66, 79, 78,189,186,134,237,250,212, 57, 95, 35, 64,237,250, 41,109,180, 43,
- 94, 91,248,183, 55, 90,226,184,229,134,116,121, 47,189,224, 54,151,219, 80,220,163,215,174,227,216, 13, 43,164, 92,115, 61,163,
- 65, 2, 80, 69, 27,172, 92,112,163,183,174, 36,207,108,223,235, 55, 91,100,198, 99,123,187,147, 31,218,175, 17,180, 50,149,134,
-202,246,160,246, 5, 16, 15,163, 77, 90,243, 93,165,208, 34, 55,130, 65, 3,214,189, 61,134,157, 22,101,185, 86,184,239, 29,228,
- 23,119,253,213,152,142,253, 8, 14,120,142,199,163, 65,165,143,101, 94,209, 36, 87,173, 52,157,195,152, 33,180,102,178,236, 15,
- 65,232,167,126, 8,132, 38,141, 92, 56,235, 42,176, 50,235,210, 35, 62,202,144,176, 11,130, 50,212,201,241, 85,210,187, 82,127,
-100,247,106, 60, 60,199,111,120, 64,107,129,244,254,154, 49,110,120, 82, 51, 56,109,246, 83, 47, 62,213,178, 68,146,135,168,145,
- 17, 11,241, 9,221,212,132,142,167,175,113, 26,144,253,246, 40,200,105,120, 24,113, 74, 31, 10,106, 83,198,120, 94,255, 0,116,
-132,183,174, 73,118,209,182, 59,202,109,115,213,238,206,120,155,119, 37, 42,169,165, 20, 71,110,179,247,220,223, 20, 15,210,194,
- 31,143, 12,105,211,109,167, 2,105, 14,227,199, 25,148, 87,144,212,139, 20,167, 99,161, 45,248,111,192, 95,140,216, 14, 15, 74,
- 77, 85, 95,131, 82,109,249,146,218, 92, 91, 32, 4,244,225, 65,176,112,164,209,198, 57, 25,136,187,151,187, 17, 21,185,109,219,
- 68, 93,227,223,212,227,202, 82, 8,167,206,246, 94, 64, 71,103,105,212,191,253,130, 33, 47,129,171,189,167, 82,240,203, 87,204,
-105,239,131, 58,180,174, 40,190,197,171, 92,231, 36, 53,153,224, 42,181,220,165, 62,230, 34,133,206,180, 93,100,196,184, 57, 1,
-203,149,218,254, 93, 83,137,140,244,103,154,118,140,192, 74, 80,118,168, 31,109, 36,208, 44,211,144, 79,203,241,237,247,203, 1,
- 14, 45, 26,129, 45,224, 14,100, 16,113, 39, 32,122, 15, 69,117,237,143,153,174,182,123,136,239, 45,158, 99,150, 55, 43, 92, 51,
- 14,233, 29,157, 52, 70,217,145,113,235,188, 97,126,227,219,126, 61,104,181, 97, 19,173,210, 49,118,236,182, 38, 90,183,181, 42,
- 76,217,159, 66,250, 92, 74, 14,249, 13, 40, 23, 67,235, 74,148,165, 39,114,138,181, 29,176,222,219,110,177,110, 62, 35,157, 60,
-111, 15, 5,202, 80, 1,139, 81,125,210, 48, 45, 8, 16,160, 74,151, 38,243, 37,214,169,100,113, 47,113, 85, 56,226,120,154, 53,
-193, 28,155, 31,140,237,215,206, 27, 84,201, 24,252, 11, 20,139,165,235, 13,151,142, 75, 67,174, 92,229, 95,101, 37,135,222, 11,
-155, 30, 66, 94, 38, 68, 80, 93,170, 2, 54,146,146,138, 39,173,247,154, 91, 19, 57,133,214,219,244, 32, 72,233,192,100,173,120,
- 77, 46,141,170, 2, 52,132, 8, 80, 98,170, 23, 81, 92, 32,151, 9,194,202,226,238,142, 3,213,245,173, 74, 57,183,154, 12,154,
-222, 96,221,161, 71,140,155,149,150,234,213,194,209,200, 24,108,102,236,249, 77,137,216,202,240,144, 37,196, 10, 54,187,156,117,
-164,165,183, 91,163,104, 95,237, 50, 10, 16, 83,206,118,206, 65,130,109,113,200, 78,135, 4,116,111, 58,152,238, 39, 73,247,216,
-225,137, 7, 18, 56, 59, 18, 10,254, 55,192, 26,116,140, 14, 99, 3,234, 24, 17,195,231, 21, 31,101,222, 98,184,207, 61, 76, 60,
-187, 42,141,128, 96,252,213,108,137,112,131,247,235,108,176,182, 85, 31, 36, 97, 13,179,122,143,186, 91, 42,152,193,124,184,228,
-155,121, 89,126, 50,151, 33, 52, 83,149, 83,151, 91, 39, 42, 94,242,241,125,180, 15,150, 91, 55, 22,163, 73, 63,100,226,195,221,
- 33,164, 4, 13,122,105,120, 12, 56, 0, 0,147,186,237,147,239, 13,137, 97,115, 26,224, 94,227,164,226,213,210,160,241,110,166,
-149, 60, 8, 35, 53,162, 78,254, 35,156,133,105,225, 60,231,202,215, 62,224,184,174,112,214, 87,199,183,140, 23, 22,228,251, 3,
-205,217, 37, 70,183,221, 97,183,112,177, 92, 30,182,166, 26,216,144,225,121,108,169,183,144,166, 84, 26, 36, 82,187,203,189, 55,
-151,249, 59,108,219,124, 75,221,166, 36,123,229,212,237, 88,184, 56, 59, 75,209,206, 14,112, 0, 7, 13, 32,129,137,200,161,108,
-200,247,198, 88,218,186,205,208,181,116,144, 30, 61,228,224, 8,196, 32,236, 7,233, 43,228,127,205, 69,195, 16,242,233,200,252,
- 41,145,196,181,220,177,248, 60,211,229,214,255, 0,141,100, 55, 69,200,151,122,195, 24,187,103, 54, 71,230,177,103, 67,110, 52,
-211, 43,121, 80, 22,189,202,116, 80, 45,208,145, 85,149, 6,183, 46, 89,180,119, 50,217, 95,178, 16,110,166,107,227,214, 74, 6,
-232,105, 33,200, 51,113, 80,210,113,238,128, 48,226,173,135,120,100, 77, 45,145,161,205, 14,107,143, 98,133, 3,181, 42,138,121,
-183,181,227,120,247, 55,205, 24,230,101,145,231, 17,114, 76, 38, 26,238, 87,140,158, 43, 49, 38, 11,174, 53, 62,125,158, 51, 44,
-134,165, 75,113,198,154,131,102,138, 16,167,148, 23, 82,164,237, 8, 9,175, 72, 51, 58,229,210, 49,207,212,248,229, 45, 36, 0,
- 7, 3,246, 64, 24, 7, 34,160,244,230,107,121,170,230, 9,229,107,237,218,230,180,183, 39, 21,253, 40,137,159, 21,224,148,195,
-200,109, 13, 53,229,223,145,152,184,200,146,236,188,125, 56,186,161,198, 64, 90,153,131,123,203, 46,214,229,173, 42,250, 96,132,
-127,169,219, 22,149, 16,217, 37, 84, 4,209, 35, 85, 2,241,223,204, 45,163, 99, 90,142, 50, 18, 80,106, 45,107, 8,205, 21, 53,
- 16,152,225,143, 73,172,117,148,198,114, 79, 6,159,159, 12,126,138,170,217, 78, 75, 18,103, 31,224, 88,243, 18, 37,185,114,179,
-202,201,159,186, 52,230,239, 1, 63,120, 46, 42, 35,120,125,104, 79,132,193,173, 53,162,182,180,123, 46,166,148,129,165,193,128,
-116,225,169, 87,210,106, 84, 67,190, 74, 10,151,240,155, 79, 28,231, 92,181, 38,203,123,126,126, 61,198,152,254, 43,156,228,136,
-138,228,149, 63, 53, 34,201,109,146,229,182, 50,164, 38,136,111,125,192,178, 10,156, 33, 59, 70,210,170,145, 90,141,214,123,205,
-186,201,174,128, 7,220, 58, 72,218, 78, 67,188,225,173,201,212,213,203, 30, 41, 76,106,208,199, 60,156,120,117,149,200, 84, 41,
-123,131,148, 96, 25,158, 45,149, 77,179, 99,214, 59, 46, 97, 9,158, 69,179, 66,183, 56,166,236,139,199,175,179,101,182,210, 91,
- 75,197, 78,167,196,247, 85,169, 45,213, 74, 74, 74, 65,165, 54,139,203, 75,136,119, 40,100,134, 55,185,198, 55, 24,156, 78,122,
-154,208, 73,195,180, 99,130,156,170, 75,154, 38, 97,106,146, 70, 29,120, 10,178,118,159,117, 13, 94, 47, 47,220,190,238,180,228,
-119,153,210,108,138,184, 45,233, 55, 55, 49,219,107, 78,199,182,164, 52,161,227, 44, 54,202,148,144,174,136,246, 69, 20, 5, 14,
-168,110, 53,105,108, 96, 2,246,180,106, 68, 3, 81, 32,187, 28,177, 56,244,227,149, 81,206,143,112, 13,196,143,151,203,141,121,
-157,222, 33,218,242,187,125,173, 22,123, 76,247, 44,248,166, 35, 1,251,180,185,139,156,194, 67, 86,232,207, 4,152,168, 91,108,
- 50,235, 69,226,135,131,161,202, 40, 16,133, 20,128, 75,219,109,164,134, 18, 92, 92,221, 79,113, 68, 0,226,226, 1, 92, 73, 4,
- 0, 66, 38, 4, 40, 92, 41,214,219, 62, 0, 67,142, 36,170,118,227,242,202,174,223,146, 27, 12, 91,223, 50,241,167,223,179,113,
-107, 86, 59,155, 94,174,184,224,186, 63,141,181,148, 65,182,200,145,108,184, 71, 83,242,237,143, 4, 54,166,163,170, 82, 20,167,
-145, 69, 53, 69, 58,133,161,109,161, 98,135,126,185,142, 14,228,132, 4, 33, 76,128,150,119,138, 5, 66, 14,125, 99, 49,158, 85,
-123,177,197, 3,110,227,109,211,127,102, 84, 30, 56, 16,156, 65, 24, 19,208,163, 48,135, 26,184, 31,136,109,235, 29,193,249, 35,
- 18,224,252, 43, 49, 98,235,142,227, 88,197,151, 36,190, 89,113, 40,178,226,224,120,222, 97,123,109,197, 59, 18,223, 26,233, 54,
-117,207,123,108, 40, 41,247,164, 77,112,169, 75,160,160, 64, 26,114, 72, 90, 34, 48, 70,229, 99, 28, 91,167,128,115,125,236, 83,
-188, 84,149, 61, 56,112, 65,113,204, 80, 91,217,191,225,237, 92,124, 33,138,125,144,113,201,113, 94,146, 73,205, 1,194,154,158,
- 84,110, 28, 91,143, 93,175,153, 63, 37,195,254,247, 75, 76,120, 22,124, 11, 11,134,196,155,141,195, 34,200, 38, 60,133, 60, 83,
-111,140,159,120,146, 35,182, 16, 8, 82,131,100,172, 5, 21, 86,135,158,243,166,207,184,238,145,197,109,183,146,192, 92, 76,143,
-195, 0, 2, 0, 9,200,146,120, 2,112,193, 51,170, 59, 59, 23,206, 85,161,122, 59,112,195,182,186, 3,196,120, 15, 61,121,141,
-202, 50, 11, 79, 11,240, 20, 59, 5,166,219, 49,155,125,206, 62, 63,132,226,188, 86,197,141,168,204, 70,121,213, 78,113,111,199,
-147,188,151, 9,109, 79, 56, 74,194,194, 65,221,208, 84, 91,114,139, 45,166,109,147,166,146, 75,141, 58,207,137, 36,178, 20, 84,
- 94,247,117,163, 12,130, 86,153,187,116,179,200, 24,184,129,138,174, 31, 64,175,161,126, 30,133, 31,139,112,155, 62, 3,114,225,
-220,207,143,162,218,227,176,137, 23,121,179,236,217,108, 27,213,229,198,208,151,164, 56,229,142,233,112,148,219,143,169, 37,110,
- 56,244,100, 54, 63,127, 93, 67,111,176,110,222,193, 24,105, 0,113,207,230,199,217, 91,187,116,129,129,131, 32, 42,108,202,110,
-232,137, 4,136,251, 61,223,192,218,128,149,116, 85, 5, 21, 79,131,178,191, 14,180,172,106, 82,181,213, 51,204,114,232, 15, 59,
- 41, 47,190,148, 59,226, 0, 66,151, 77,224, 5, 80, 14,189, 59,126, 77, 79,134, 58,102, 87,225, 85,147, 46,186,197,138, 36,190,
- 92, 69, 20, 82,150,202, 79, 64, 90,162, 73,167,117, 22,173, 92, 64,202,163,187,153,106,188, 95,174,105,156,202,214,131, 74, 52,
-105,215,113, 46,146,165,117,235,251, 61, 7,199,171,136,176,172,244,210,227, 85, 67, 50,118, 69,169,114,166,165,208,208,112,248,
-161, 27,170, 42, 42,144, 59, 71,164, 19,235,213,132, 82,106, 41, 72, 99,195,170, 26, 99,147,210,135, 28,101,197, 46,161,196, 2,
- 16,125,183, 22,146,163, 74,215,176,246,106,121,135, 10,123,195, 90,150,113,236,253,171,139, 75,101, 82, 82,148, 4, 53,185, 75,
- 80,222,149,169,117,219,209, 93, 61,125,117, 95, 60,122,106, 44,140,211, 78,175,239, 64,134, 75,198, 82,124, 63, 9, 33,162, 86,
- 18,133, 41,197, 0, 79,111,104, 29,117, 83, 48,168,206, 11, 76, 12,143,157,204, 7,215,111,135, 35,114, 89,109, 12, 56,160,189,
-222, 32,105, 34,135,183,247,199, 93, 70, 22,218,177,165, 8, 22,144, 49,254, 73,191,100,115,144,136,234,117,109,135,212,226,157,
-169,246, 16,225,160,235, 90, 14,205, 38, 75, 96,193, 74,116, 33,181,104,112,182,230,165, 45, 59, 33,213,169,127, 68, 84, 10,186,
- 2,231,205, 3,175,160, 87, 85,119, 8, 48,168,178, 17, 83,213,141,192,157,239, 40,123,107, 27, 0,175, 85, 81,125, 40, 43,235,
-213, 92,142,166, 77, 69,222, 97,179,203,182, 53,137,203,180,227,240,228,204,189, 94, 33, 41, 50,147, 25, 27,196, 59,120, 67,170,
- 33, 74,173, 16, 94, 45,169, 34,189,213,214, 27,154,247,216,182,248,252, 34,240,215, 59,175,133, 87,223, 23, 6,163, 66,147, 92,
-206,153,142,228, 13,205,184, 42, 36, 89, 81,101, 43,124,183, 28,117,181, 41,151,100,120, 77,186,174,170, 36,209, 9, 81,233, 94,
-209,232,215, 46,110,229, 21,210, 23, 56, 18, 75, 64,245,167,182,168,157,102,247,185, 52,149,196, 82, 53,145,199,219, 44,187,112,
-110, 84,161, 38, 90,174,178,183,178,160,233,136, 67, 94,193, 77, 69, 62,149,146,145,214,181,212,219,231, 49,174,208, 8, 9,130,
-143, 79,203,213, 85,243, 66,240,226, 58, 48,245, 26,118,194,149,121,144,176,207,221, 18, 23,111,159, 33,244, 9, 30, 25, 82, 25,
-137, 13, 13,165, 96,117, 39,113, 81, 36,211,176, 10,247,138,211, 43, 65,197,248,129,151,105, 36,125, 93,116, 70,220,184, 40, 24,
-209,171,181,190,244,219,209,213, 22,208,242, 30,125,247,231,134,219, 20, 76, 70, 67,173,165,162, 82, 20, 80, 18, 84,179,186,157,
- 58,143, 71, 73, 62, 43, 24,170,240,132, 97,242,235, 69, 29, 84,236,182,143,182, 13,212, 61,230,175, 96, 82, 62,143, 85, 51,242,
-155, 69,241,200,119,196, 93,162,204,134,213,211,221,211, 17,168, 17,189,218,229,107,119,223, 10, 12,134,150,138, 20,146,146, 0,
- 73,253,180,138,118,168,106,235,108,220,163, 88, 68, 1,158, 35, 23,188, 80,181,193, 9, 33,205, 42, 15,111, 6,250, 13, 57, 24,
- 5,204,111,134, 11,129, 42,170,135,168,246,117, 80,110,219,228, 91,236,232,185, 59, 26,227, 41,104,118, 51, 94,245, 57, 41, 10,
-121, 48, 66, 67,206,169,192,132, 37, 74, 21,170,128, 3,182,180,235,168, 50, 76,110,100, 37,160, 53,174,114,163, 85, 1, 56,160,
- 82,112, 10, 6,103, 10,136,230, 41, 82, 56, 26,114, 91,167, 66,180, 41,152,183, 4, 68, 66,223, 64,146,166,168, 18,166,154, 40,
- 74,131,174, 10, 84,146,149,165, 94,173,180,237, 52,213,104,100,151, 1, 3,142,100,122,138,125, 20,151, 56, 38, 84,118, 77,230,
- 11,209,229, 33, 17,210, 81, 32,176,200,147, 37,164,183, 28, 85, 21,114,160,209, 52, 42, 34,162,189,148,239,210,225,133,241,226,
- 9, 65,215,232,164,171, 78, 6,152,215,139, 36, 9, 57, 59, 50,109, 69,152, 73,142,228,120,140,196,106, 26,124,121,178, 38,149,
-150,156, 42, 21, 0,181,210,160,119,252, 90,185,181,220,158, 45,244,185, 79, 21, 92,128,204,122,105,230,194,208, 16, 12, 79, 26,
- 90,251,159, 53,131,104,156,213,157, 74, 80, 84, 80,160, 29,123, 96, 1, 78,180, 87,184,172, 84, 29,135,175,171,166,172, 44,119,
-107, 89, 8,214,113, 95,154,157,100, 79,140,246, 83,137,104,228,137,142,196,142,161, 96,183, 70, 43, 75,142,201,122, 55,191, 75,
-247, 38, 2, 90, 13, 37,170,161, 27,138,207, 90,171,211,173, 61,158,251,101,108,211,239,185,201,146,160, 92,243,236,171, 8,130,
- 0,185,210, 86, 43,110,241,242,107,205,203, 62,181,227, 83, 36, 90, 22,197,183, 24,159, 5,183, 16,135, 12,230,211, 37,217, 62,
- 19,197, 65,165,120,110, 50,223,176,178, 7, 90,116,173,108,111,249,151,246, 12,142,209,239, 1,192,151, 2,122,208, 5, 25,226,
- 9,199,170,172,141,216,141,161,141, 36, 3,157, 94, 76,178,255, 0,199, 95,242,255, 0,130, 96, 24,251,118, 88,249,197,253, 19,
-165, 57,238,246,196, 41, 56, 69,142, 92,181,185,113,191,173, 52, 45, 72,187, 95,148,244,123,116, 55,150,119, 48,196, 55,170, 66,
- 28, 74, 23,213,118, 15, 50, 71, 33,236,144,206,238,252,242,106,210,197,247,136,115,128, 47, 57,136,216,153, 12, 92, 72, 3, 34,
- 68,217, 46,131, 33,106, 28, 79,205,250,126,138,169, 92,175, 46,233,144,185, 30, 38, 37, 35,238,236,126,114, 89,178,189, 21,137,
-142, 73,179,227,182,139, 19,109,178,130,195, 15, 56, 84,175, 1,151, 54, 19,188,173,117, 37, 68,169, 91,180,177,231,228, 60,195,
-180,221,193,122,195, 21,201,141,193,160, 41,107,220,224,136, 8, 10,210, 87,142, 0,125,163, 84,243, 13, 78,198,162,171, 52,216,
-109, 89, 89,154,152,119, 59,227,175,202,130,139,148, 8, 49,155,113,248,114, 38,171,231, 52,211,171,108, 44, 33, 37, 15, 2, 72,
- 37, 7,120, 29,218,243,142,224,247, 62,233,204,115,219, 30, 5, 11,137, 67,167,129, 32, 20, 82, 8,232, 7, 12,177,170,201,109,
-206,162,220,147,232,165, 39,177,187, 82,102,186,183,237,114, 30, 66, 20,185, 11, 64, 80,109,104,117,123,144,104,145, 74,123,100,
-138,145,218, 65,214,121,219,140,163, 39,140, 69, 67, 17,132,202,135,119, 26,193, 36,184, 29, 56,221,177,115, 12, 74, 34, 68,134,
-129,119,197,140,165, 20,165, 39,188,133, 32,143, 94,138, 45,222,237,173, 45, 18,185, 7, 71, 93, 37,204, 3, 4,199,133,104,140,
- 99, 15,111,220,132,136,118,136,175,173, 44, 92, 11,104,101,180, 52,153, 45, 54,238,208, 59,194,137,220,160, 7,104, 26, 75, 55,
- 43,199,130, 26,231,144,132, 28, 78, 74, 23,232,169,113,218,235, 90,116, 90,216,177, 50,242, 86,244,136, 78, 23,225, 6,221,125,
-214, 66,209,243, 26,117, 72, 64, 30,200, 82, 66,232, 15,162,163,187, 80, 95,115, 54,131, 24, 5, 3,151, 62, 39,141, 61,240,164,
-224, 15, 93, 16,115, 20,180,202, 77,214, 91,112, 98, 50, 67, 10, 68,118,166, 50,194,155,121,113, 42,176,224,116, 35,196, 73, 88,
- 80, 73, 73,236, 3,227, 51,100,221, 29,166, 56,195,157,129,196,133, 84, 57,132, 84,192,226, 15, 26, 84,150,192, 32,192,245,253,
- 30,138, 33,115,177,218,150,162,149, 99,182,249,208,144, 16,220, 86, 68, 70,220,113,165, 37, 38,171, 10, 31, 56,145,176, 17,221,
-217,218,116,150,110, 50,146,130, 71, 7, 98,165, 78, 92, 62,158,218,140,232, 74,101,141, 49, 39,217, 31,127, 27, 39, 29,139,109,
- 19, 95,144, 23,102,158, 24, 48,216,114, 68, 39, 79,134,151,220, 74, 10,195, 96,251, 11, 20,174,222,192, 72,214,147,109,187,134,
- 43,192,219,242,237, 8, 67,128, 42,113,110, 99, 60,120,245,244,133, 90, 92, 17, 6,201,251, 80, 67,120,166, 96,117,117,211,246,
-204,140,181,166, 83, 13,102, 11,146,163,198,105,249, 30, 19,193, 97,165, 26, 5, 84,144,146,104,148,130, 21, 78,160,246, 87, 84,
-155,180, 16, 91, 72, 76,122,140,100,157, 46, 33, 20, 46,105,243,245,211, 76,135, 94, 45,202,129,187, 69,203,205,166, 60,135, 45,
-202,250, 52, 59, 38,115,170,121, 0, 66, 15, 2, 74, 20, 83,216, 66,215, 66, 64,248, 43, 67,164, 89,199,107, 45,203, 97,124,136,
-194,224, 20, 5, 40, 74, 40, 4,180,122,220, 7, 73, 20,227,109,136,120, 7, 34, 81,105, 22,195,114,202,242,118,163,201,185, 88,
-158,199,219, 91, 15, 55, 42,217,127, 97, 2,125,189,173,168, 15, 54,234, 1, 80, 32, 63, 29, 75, 10, 38,138, 10, 4, 83,179, 86,
- 28,193,182,193,177,205,225, 71, 51,100, 4, 2, 28,194,160,230, 70, 32,145,169,160,150,184, 2, 64,115, 74, 56,132, 37,203,235,
- 19,101, 33,137,174,107,192, 62,243,114, 61, 97, 83,178,159,108,197,181,201,131, 54, 43,111,219, 66,157,138,151,247,180,207,129,
-225, 52,210, 14,234,168,126,203,126, 32,248,129,248,178,205,146,103, 57,160, 7, 21, 56, 5, 92,248, 84,127,135,115,144, 87,177,
- 26,130,202, 97,152,174,198,153, 9,251,124,133,161,199, 93, 75,196,180,221, 42, 64, 85,119,148,171,179,166,132,229,250,156, 8,
- 32,180,208,240, 12,101, 58, 40,152,199, 45,118,196, 11,205,189,225, 37,111, 58,245, 97,178, 82,218, 91,240, 66, 21,237,171,160,
-237, 81, 29,189,105,162, 55,115, 92,141, 14, 9,215, 73, 48, 28,233, 75,223,160, 93, 61,250, 37,198,207, 12, 90,154,142,200, 83,
-242, 28,250, 87,140,135,148,144,147,214,135, 99,109,154,158,254,193,223,167,237, 98, 54,174,100,141,121,215,171, 46,128, 0,199,
-210,184, 83,177,198,168,163,141, 15,108,186,216,172,175,196,109, 81,173,178, 96, 66, 67,111,220, 11,228,169,253,236, 41,198, 28,
- 42, 5, 69, 66,170, 64, 80, 21, 29,167,178,154, 57, 44,229,191,113,210, 92, 28,247, 16,208, 50, 10, 65, 31, 57, 30,138,115,194,
- 18,191, 1,153,192, 82, 15,247,106,218,165,155,246,214,183,181, 1, 50,203,126,215,134,111, 79,147, 32, 43,195,221,180, 80,182,
-122, 87,183,229,212,191,139,151,196,210,135,247,154, 87,253, 57,124,176,200, 83,159, 14, 11,151,236,135, 34,240,199,244, 3,232,
-174, 55,204,229, 79, 7, 26,198,240,200,247, 7, 13,163, 23,141,112,155, 33,108,171,104,186,100, 87,133, 21,202,121, 74, 77, 10,
-146,218, 16,211,105,175,238,129,217,174,193,117,179,134,204, 75, 70, 46, 69, 61, 77,200,124,254,179, 90, 40,148,231,232, 20,233,
-177,231,235,129, 10, 43,105, 82,157,106,220,159,123,139, 28,175,168,154,242, 18,151, 28, 89,173, 62,133, 9, 32, 87,190,189,221,
-176,101,219, 60, 82, 92, 66,106,195,209,250,126,106,144,247, 17,130,208,145,178, 5,207,186, 63,122,122,227, 75,179,246,230,113,
-187, 43,109,172,248,144,173,168,117, 43,147, 40,138,144, 22,253, 18,134,147,218,106,178,105, 81, 91,203,128,200,237,163,181,107,
-123,173,113,123,143, 75,220,131,212, 5, 47,226, 52,160, 21,231, 35,101,153,109,133,172,222,209,142,223, 90,181, 91,160, 49,110,
-176,182, 94, 81, 76,152,179,158,101, 42,125,230,100, 56,162,211, 75, 46,184,224, 74,187,129, 36, 0,163, 81, 81,183, 90, 65,115,
-225, 58, 86,106,115,156,227,218,139,152,226, 16, 10,220,242,205,165,173,228,176,176,202,207, 21,206, 24, 61, 67, 7,105,232, 24,
-122, 78, 88, 85, 61,203, 51,204,162, 45,134,193, 50,225,225,189, 36, 42,230,150,227,201,142,135,163, 72, 97,242, 10,221, 83, 97,
- 75, 72, 76,134,155, 43,170, 21, 64,180,239, 77, 9,233,172,179,219,161,153,238,208,163, 36, 56,140, 70, 67,215,235, 24, 86,198,
-243,118,220,185,126, 67,180,187, 68,182,145,137,158,198,247,100,208, 36, 26,101,240,228,247,187,164,106, 10,123,164,185,195,222,
-113,114,171, 89, 59, 82,242,127,187, 4, 55, 89,251,181, 78, 88,155, 97, 51, 76,155,116,137, 54,197, 60,252, 89, 76, 52,227,138,
-118, 41, 12,180,234, 94, 66,125,130,165,110, 79,206, 90, 69,149,189,187,153, 31,136,160,135,119,149, 49,197, 1, 7,129,199, 35,
-159, 3,194,185, 78,253,185,187,116, 99,110,100,210, 29,164, 3,165,186,125,105,129, 80, 70, 57,168,239, 41,196,207,220, 43, 36,
-221, 36, 68,194,166, 53, 56,194,205,249,111,141, 99,200,122, 44,145, 17,164, 71,193,141,206,241, 37, 46,172,161, 99,234, 25,241,
- 18, 42, 58,167,191, 88,254,108, 6,217,166,230, 50,143,138, 9, 83,165, 95,161,128,132, 35, 21, 62,218, 78,194, 4,161,203,196,
-143,152,147, 81,254,107,151, 68,203, 57, 66, 94, 66,134, 74, 32, 49,110,139,117,102, 49,148,103,109, 93,249,111,221,195,101,194,
- 7,136,161, 34,230, 66,141, 58,144,122,119,106,235,100,177,117,149,152, 99,138,184,146, 9, 57,146, 17,139,234,106,213,103, 48,
- 78, 94,228,111, 64, 3,211,141, 51,179,108,206,239,253,220,127, 20, 15,165, 17, 50,139,181,170,253,122,108,167,115,206, 72,198,
-209, 37, 17,211,186,189, 18,149, 92, 86, 84,158,242, 18,123,181,105,109, 99, 25,147,199, 35,188,198,150, 55,177,197,164,255, 0,
-208, 61,189, 53, 83, 97, 33,141,175,104,200,145,236, 84,168, 94,211,109,149,124,201,109,246,187,124,101,204,150,236,134, 81, 22,
- 35, 67,114,223,150,226,210,150,144, 63,210,117,105, 7, 86, 82,204,219,118, 23,188,160, 1, 73,169,197,222, 27, 9, 53, 96,243,
-187,253,147,135, 36, 99,248, 5,142, 29,167, 38,186,219,238,214,108,183,149,100, 72, 73,151, 7, 38,149,104,117, 18, 27,177,184,
- 18,182,214, 97,144,130,135, 27, 10, 78,228,146,163,213, 93, 51, 27,125,188,188,194,201, 46, 36,115,152,215, 53,204,137, 48, 45,
- 14, 9,226, 15,245,113, 7,133, 71,219,158,100,120,184,120,238,131,221, 7, 46,178,123,107, 95, 49,252,145, 99,200,175,174,230,
- 86,171, 37,183, 34, 86, 55,150,230, 54,203, 78, 76, 22,240,198,220, 78,105,116,184, 94, 32,248, 22,151,159,148,220, 6,173,241,
- 92,217, 30, 10, 30, 83, 77,154,168,238, 90,214,116,199, 37,108,146,109,150,226, 9, 94, 90, 94,200,201,102, 26,155,161,140,141,
-218,158, 0, 47,115,156, 21,207, 32, 56,168, 24, 0, 42,226,254, 86,221, 72, 88,210,153,146, 71, 16,188, 58, 6, 40,149, 26,227,
-185, 20,235,237,170, 29,206,233,113, 68,217, 96, 74,106, 95,136,234,140,231, 29,102,165, 43,114,162,134,168, 81, 9, 32,244, 2,
-158,141,104,174,173,132, 5,193,173, 64, 81, 58, 61, 21, 75, 44, 90, 28,141, 8, 5, 23,200,178,148,100, 57, 14, 67,126,151, 88,
-167, 32,186, 75,146,134, 91, 33,102, 59, 15, 44,173, 45,130,144,128, 67,104,218,129, 68,129,234, 29,154,158, 34,124, 77,107, 66,
- 18,208, 7, 86, 1, 58,234, 91,156,102,144,188,246,215, 80,120,147,156, 44, 94, 92,101,249,103,186,167, 23, 79, 34, 78,194, 56,
-131, 36,188, 35, 23,126, 75,112,163,203,206,185, 78, 78, 65, 38, 63,188,188,182,223, 67, 72,133, 2,108, 87,156, 81, 65, 41, 8,
-173, 1, 29, 56,127, 50,242,245,215, 59,199,127,110,233,221, 19, 36,185,107, 67,177, 58, 99,133,177, 7,105, 10, 49,123,195,134,
- 8, 9, 60,106, 99,110, 67, 92,221, 69, 67, 65,227,146,253, 61, 93, 53, 17,101, 60,171,120,229,126, 73,203,121, 39, 38,247, 86,
-174,217, 77,226, 85,214, 68,104,123,132, 24, 33,211, 70,227, 71, 11, 82,148, 26,140,210, 82,211, 96,146,118,164, 87,174,182,187,
-102,199, 30,195,107, 21,140, 36,150, 68,208,213, 57,158,151, 30,183, 21, 39,172,212,105, 31,226, 30,218,236, 15,146, 30, 91,192,
- 56,103, 36,192, 45, 60,105,198,150,238,105,230,236,174, 53,186,103, 37,191,119,199,102,201,131,134, 89,165,184,242,217,180, 46,
- 75,175, 69, 68, 84,150,252, 39,148,152,237, 47,198, 93, 67,139, 82, 82,134,198, 79,123,191,113,183,184,117,252, 17, 54,205,170,
- 24,100,122,153, 72, 78,243, 90,220, 0, 94, 36,234, 8, 8, 69,173,255, 0, 46,221,199,183,197,165,177, 54, 71, 63, 50, 71,168,
- 12, 58,184,103,211,146,125,116,112, 53,241, 24,198, 9, 61,198, 56, 79, 26,197,239, 57, 53,197,187,150,113, 63,138,111, 86, 75,
-196,123, 77,193, 49,208,212, 88,183,120,173,187, 2,232,137, 22,219,122, 26, 97,109,166, 51,139,170, 84,118,141,198,186, 29,142,
- 40,108,225, 18, 69, 0,110,160, 23, 65, 4,180, 98, 67, 72, 85, 80,170, 80, 98, 73,194,175,188, 64,113, 12, 13, 94,143,167,174,
-162,142, 69,228,150,124, 57,115,153,150, 81, 29,137, 18, 82, 82,254,248,175, 37,248,174, 41, 42, 67,141,185,177,105,114,169,249,
-138, 0,142,210, 41,171,219,107,136,167, 46, 67,238,231,213,210,163, 48,114,192,227,136,163, 14, 53, 78,175,190,108,215, 21,249,
- 17, 46, 42,109,200,108,180,182,168,133,130, 66, 41,236,161, 34,160, 41, 74, 29,123,105,171,118, 70, 6,158,186,120,198, 72, 90,
-172,249,103, 52, 64,200, 84,244,168, 15,133,239, 82,101,169,134,222, 79,209,236,220,175,105, 68,245, 0,129, 95, 87,195,171, 54,
-232,183, 32, 60,161, 57,117,212, 25,222, 90, 42, 33,186,114, 91,242, 97, 56,135,102, 36,164,165, 99,114,150, 78,198,212, 66,147,
- 66, 77,106, 8,237,245,106,113,184,142, 30, 61,117,155,186,126,163, 81,220,140,230, 76,102, 84,167, 28, 9,142, 74, 35,165,101,
- 64, 17,227,132,247, 87,185, 52,169,245,233,231, 94, 48, 96,184,162,213, 84,141, 90,133,115, 43,252,139,220, 89, 98,180, 75,112,
-252,117,110, 52,163, 74, 66,220,221,219,208,236, 65, 62,173, 70,126,239, 29,179,128, 39, 21, 79,104, 31, 57, 20, 35,105, 92, 42,
-149, 94, 50, 55,160, 92,215,225,213,255, 0, 13,181,188,175, 12, 18, 54,133, 39,161, 62,159,111, 87,176,111,176,189,189,226, 6,
- 41,243,253, 85,104,214, 40,164,193,205,240, 45, 17,157,123,199,240,139, 66, 56, 89, 43,161, 83,211, 89,220,142,149,235,210,134,
-186,150,233, 91, 59,131, 65,196,175,176,161,164, 62, 37,173, 89,231, 28,159, 42, 40,131,104, 98, 66,146,183, 27, 82, 28,113, 69,
- 8, 74, 70,209,233,248,116,147,183,174, 38,154,248, 97, 79,252,122,193,120,185,190,137, 87,185, 32,110, 59,150,128,189,168, 8,
-168, 38,166,181, 63, 59,174,137,214,237,140, 80,210, 27, 86,247, 8,183,192,180, 71,111,193, 83, 74,220,165, 33,224, 8,162,149,
-237, 0, 59,123,250,124, 26,166,187, 60, 42, 28,165,106,199,226,121, 8,117, 5,181,180, 2,147,185,202,143, 74, 72, 3,191,184,
-107, 63,114,218,132,248,210,166,136,247, 86,173, 17, 26,152,245, 29,144, 89,126, 66, 25, 38,136, 66, 25, 78,231, 22,163, 90, 37,
- 45,238, 5,106, 61,159, 9, 26,192,243,111, 51,193,203, 54,230,105, 78, 57, 52,113, 39,128,167,109, 44,221,118,228, 25, 82,155,
- 55, 72,209, 26,155,124,187,197,180, 63, 30,230,195, 66, 41,158,144,175, 21,249,210, 34,194, 66, 70,225,237, 37, 14, 7, 28, 73,
-173, 18,144, 73,232,189,120, 95,154, 57,134,227,154,238,100,123,222,229,212, 81, 56, 55,188,239,153, 7,248, 86,210, 61,161,150,
-205,107,144, 28, 56,246,165, 66,153, 6,119,101, 78, 8, 45,227, 27,180,170, 93,210,199, 21,163, 53, 81, 80,226, 93,184,185,111,
-106, 68,132,110,222, 21,181, 45, 72,142,149, 19,217, 95, 94,164, 89, 89, 74, 47, 27, 40,145,232,215, 42, 41, 8, 3,136, 7,183,
- 3, 80, 77,171, 99,103,184, 50,246,160,250,197, 49,172, 55,252, 6,241,132,230, 47, 74,199,160,198,187, 91, 50, 73,208, 45, 81,
- 99, 69, 67, 9, 24,156, 27,100, 39,144, 92, 63, 89, 84,220,148,160,219,131,231, 23,118, 14,206,154, 77,206,218,238,198,107,116,
-148,185,174,136, 57,196,149,253,163,158,255, 0,254, 8,163,128, 11, 85, 19,237,246,178,180,184, 4,114,251, 16,154,109,202,228,
-126, 54,197,172,127,118, 91,101, 67, 68,249,238, 66,117, 12,204,104, 72, 83, 87, 25,204,191, 37, 68,183, 90, 41, 42, 91,174, 52,
-123,136,160, 85,106,116, 29,182,110, 55,179,178, 71,131,164, 7,101,134, 0,128, 7,176, 30,172, 82,171,155,111,111,110,212, 92,
-207,207,254, 41, 76,139,190,127, 18, 23, 32,194, 22,152, 80,167, 90,165,226,166, 81, 97, 47, 9, 43,188, 61,116, 65,142,221,119,
-144,159,163, 18, 80,133,142,158,218, 66,250, 14,205, 92, 59,105,146,201,102, 46, 18, 23,181,160,255, 0,148, 53,117, 39,106, 2,
- 58,138, 83, 23, 13,136,184,224, 14, 31,162,148,239,124,177,143,221,238,248,203, 51,237,214,136,150,185, 97,187,173,194,226,182,
- 91, 90, 86,212, 22, 16,166, 88, 82,148, 64, 33,217,238, 54,224, 32,117,167,118,227,168,209,236,146, 89, 91, 78,246, 72,227, 35,
- 80, 48, 41,226,123,228,118, 52, 22,250,123, 41,136,227,134, 82,164,103,242,249,118,212, 43,112,229,236, 38,238,235,145, 36,199,
-117, 48, 45, 86,251,220,227,108,143, 49,109, 51, 34, 77,156,162, 10, 68,128,218,182,188, 10, 20,165,144,170,141,225, 42,165, 82,
- 53,115,103, 99,119, 96, 3,181, 2, 28, 64, 32,228,117,227,212,133, 80, 2, 16,128,160, 28, 77, 63,111,124,219, 88,229,183,104,
-110,137, 0,212,173,105, 61,210,161, 9, 10,222, 43,164,133,226,168, 41,181,141,114,150, 1,117,154,209,184,217,246,202, 45, 45,
- 64, 75, 8, 82, 83,107, 74, 84, 55, 56, 21, 84,144,218, 92, 74,129,237,246, 72,244, 82,109,214,217,117, 12,125,215,241, 57,116,
-245,122,106,132,193,110,171,216, 42,103,154,120,218,225, 99,101,248, 51,219, 97,249, 22, 1,119,146, 72, 77, 29,143, 32,201, 10,
- 13, 13,219,104, 86,133,164, 30,209,181, 71,165, 41,170, 8,111,111,163,213, 27,154,161,167, 79, 98, 1,245,131,215,133, 3,182,
- 64,170,185,215,183,215,176, 91, 21,173,139,142, 57, 33,181, 93,227,207,182,189, 29,153, 8, 14,195,188,196,187,196,171,109,246,
-149, 33,205,172,130,135, 16,122, 41, 84, 32,235, 95,201,183,204,151, 85,166,240,192,109,159, 27,156, 92, 59,178, 70, 91,145,107,
-179, 32,162,104, 42, 14,125,182, 54,214, 80, 61,226, 54,162,147,135,111,233,166, 37,215,157, 91,114,109,238,209,117,176, 72,181,
- 70,100,197,143,117,143, 46, 25,137,112,139, 18, 90,154,149, 33, 30, 10,210,133,182, 78,199,130,106, 58,157,180,233, 77, 87,183,
-150,190, 17,225,246,242,151, 53, 85,132,168, 92,244,147,218, 11,122,170, 69,245,179,109, 94,232,164,104, 14,165,103,185, 43, 16,
-110, 99, 76,162, 56,114, 84,155, 67,211, 38, 52,210,234,237,190,123,137,109,111, 55, 66,104, 3, 41, 90, 16,125, 36,158,211,162,
-138,214,228, 0,237, 89, 16,222,209,138,122,115, 53, 87, 45,163, 10, 6,255, 0,133, 55,211,159, 96, 83,223,178,196, 64, 67,119,
- 34,136,101,123, 20, 23, 10,217,106, 74,155, 95,138,226,129, 41, 36, 37,228,172,250, 2, 85, 94,237, 89, 8,238,216, 30,135, 14,
- 29, 36,244,123, 61,180,201,180, 11,236,253, 53, 29,221,249, 1, 44,197,149, 62,205, 49,169,129,136,242,157, 82,203,129,181, 8,
-113,159, 1,144,218,107,251, 79, 5,164,168,158,207, 88,213,197,164, 14,116,173,241,120, 39,175, 18,126,130,157, 52,243, 97, 17,
-143, 77, 65,151, 12,247, 43,131,141, 21,199, 95,142,219,183, 9, 13, 37, 40,144, 26, 30, 29,193, 8,109, 37, 35,118,227,209,165,
- 56,163,232, 41, 61, 40,117,162,134,206, 31, 24,106,195, 39,118,103,250, 41, 90, 0, 42, 78, 41, 69,172, 87,236,150,119, 32,173,
-229, 67,145, 2,203,225, 91,225,209, 23,197,150,214,139, 55,130,203,114, 29,107, 99, 73, 0, 33,141,129, 42, 89, 7,183,212, 83,
-121,162, 43, 35,142,167, 18, 93,238,133,239, 41, 32, 28, 78,103,217, 85,147, 69,171,142, 53, 56,220,179, 75, 0,133, 50,233, 30,
-238,168,106,180,123,236,251,211, 78, 36, 73,122, 84, 86,211, 29, 94, 11, 71,117, 65, 14, 56, 40,107, 78,132,118,245,214, 82, 27,
- 3,226,123,138,173, 65,213,158, 63, 46,170, 76,118,160,224,234,105, 55,159,198,187, 71, 69,209,187, 83,132, 64,143, 10, 29,169,
-213,189,177, 17,163, 67, 43, 91,207,168, 36,128,162, 7,138,186,158,157, 71,105, 26,148,109, 89,105,220,115,128, 14,118, 61,100,
-240,249,133, 58, 34,140, 59, 1,136, 20,131, 39,145,226,203,184,218,160, 42, 34,213, 39,239, 31,188, 30,105,163, 84, 2,132,186,
-148,178,107, 82, 2,147, 84, 34,134,186,183,178,176,214,201, 28,199, 14,243, 67,125,122, 92,163,135,109, 74,104,108, 99, 44,254,
-191,209, 67,218,249, 33,249, 77, 37,241, 13, 45,176,220, 73,147, 10, 65, 42, 42,184, 49, 37,230,208,129, 90,138,251,180, 69,130,
-159,135, 80,229,217, 3, 93,164,156, 73, 79, 66,125,101,105,178, 26,194,148,169, 27,150,164, 63,110,152,153,101,217,239,161, 14,
- 72,150, 97, 56, 16,154,199, 91,101,227, 85, 16, 2, 74, 75,131,169,232,148,211,225, 67,246,104,195,193,110, 3, 33,234, 79,171,
-215, 67,193, 15, 61,116,167,106,228, 59,117,193,168, 6, 21,204, 7, 46, 10, 12,176,231,138,160,210, 36,190, 90, 33,105, 73, 93,
- 66, 1, 66, 91, 35,210,149,118,130, 42,220,219, 65,136,146,225,195,235,255, 0, 31, 72,163,248,114, 50,167, 46, 25,122,157,146,
- 78, 78, 55,100, 14,222,114,107,157,254,199,141, 88,236, 34, 66,124,121,183,187,149,197, 80,154,105,160, 74, 80,162,234,222, 65,
- 77, 72, 6,157, 72,208,143,107,115,228,107, 67,115, 84,244,140, 61,184,122,106,109,181,137,148,134, 12, 73, 32, 14,178,114, 21,
-107,188,197, 94, 56,115,203,118, 43,133,226, 14, 90,237,121,247, 48,204,178, 92,231,228,119, 8, 57, 68,175,117,181, 68, 92,199,
-227,248,138,240, 23, 29,184,241, 99,173, 10,137, 29, 14,178,227,210, 92,143, 33,202,176,194,153, 82,250,229,183, 37,109,220,189,
-100,217,119,118, 25, 37,121, 8,192,226, 20,162,160, 66, 50, 4, 23, 59,134,160, 6,162,160, 92,223,109,208,237,241,177,161, 11,
-138,250,113,204,116, 5,192, 96,165, 9,192, 37,115,190,227,205, 23,191,114,126, 55,142,202,220,149, 46,210,219,200,101, 43, 76,
- 70, 23, 50, 81, 41, 33, 43,117,213,132,132,186, 43,185, 71,165, 42,117,205, 55, 11, 75,107,135,186, 88, 96, 17, 52, 52,144,208,
- 92,236,135, 18,226, 73, 42,163, 4, 24,101, 89,201, 64,113, 9,215,236,166,122,121, 91, 45,189, 76,142,211, 19, 94, 75, 83,219,
-189, 41,245,238, 41, 83,227,235, 74, 7,112,161, 73, 72,244, 14,206,193,169, 80,109, 22,164, 28, 61,220, 61, 57, 10,138,226,135,
- 17,209, 76,105,220,157,148, 66,145,107, 99,100,180,199,185,199,145, 97, 99,194,220,227,174,194,132,182,202,222, 38,181,218,234,
-150,245, 8,244,211,174,209,171,107, 11, 27,120,228, 14, 8,161,193,217,113, 92, 62, 97,234,167, 34, 1,117,244, 33,164,252,115,
-151, 51, 43, 99, 54,180,191,227,188,134, 71,184, 66,144,162,165, 39,197,162, 11,224,130,170,245, 91, 72, 31, 1, 58,122,235,105,
-181,148,185, 64,239, 28,126, 93,166,154,144, 52,147,211, 74,108,243, 38, 97, 22, 91,240,221,147, 45, 9,115,221, 3,202, 90, 10,
-156,112,204,218,161,236, 84,138,238,219, 95, 81,248, 65,174,126,203, 3, 81,186, 66,144, 61, 31, 32,105,122, 90,252,169, 78,227,
-206, 87, 0,212,152,171,120,188,175,122,247,104,229, 78, 0,134,147, 17, 42, 74, 94, 61, 73, 82, 84,227,160,118,126,247,167,161,
-127, 33,136, 60, 32,207,252,126,138, 38, 68,105, 17,124,179,118,142, 93,159,239, 43,114,225, 44, 34, 88,105, 73,241,153, 12,165,
-101,212,180,176,165, 40, 16, 74,250,212,106,105,219, 34, 82, 56,105,195,181, 6, 62,142, 29,116,152,226, 94,140,234, 67, 87, 63,
-100,191,115,179,108, 72,119,198,247, 41, 50, 29, 87,132,159,118, 62,211, 72,109, 20,165,122,123,104,161, 20,175, 65,223,168, 95,
-200, 96,214,188, 23, 46, 62,234,103,237,167, 52,157, 26, 56, 42,254,154,231, 13,211, 26, 18,111,109, 68,181,255, 0,170, 64,240,
- 99, 71,136,239, 93,162, 59,187,146, 86, 77,122,209, 40, 82,137,214,246, 25,192,112,212,123,125, 20,236, 55, 58, 26, 92,236,215,
- 26, 89,185, 49,247, 99,233,154,251,138,251,182, 67,237, 50,136,205,146, 94,159, 66, 84, 64, 0,213, 69,229,144,154,127,165,163,
-157,205,153,200,209,195,229,236,160,203,147, 33, 65,158,116,145, 6,116,219, 85,225,169, 79,171,103,221, 82,196,247,208, 23,185,
- 97,237,202, 83,109, 86,164, 18, 28,167,201,240, 13, 55, 42, 74, 72, 60,105,246,201,168, 40,204,224, 62,186,147, 37,222,161,100,
- 54, 27,131,211,205, 17, 38,229, 22,233, 51,173, 28,150,226,154, 82, 82,202, 73, 53, 5, 74,165, 79,114, 70,169,101,178,150,210,
- 88,204, 39, 20, 32,117, 23, 34,159, 64, 95, 74, 82,217, 46,135,147,212,158,170,171,220,195, 21,163,115,135, 42, 35,232, 90,163,
-221, 81,107,114,218,193,216,159,119, 65, 78,245,244, 36, 0,124, 71, 17, 64, 59, 1,214,227,102,115,124, 20,227,154,252,213,111,
-111,114,244, 10, 79, 28, 87,164, 87,182, 91, 75,202,202, 91,191,188,242, 4, 86,172,176,100,172, 80, 36,253,224, 34, 42, 34,210,
-122,245, 87,138, 86,175,143, 79,120,130, 56, 11, 58,207,169, 84,123, 42,174,242,229,211, 64, 34,232, 86,142,205, 69,223, 77, 63,
- 49,188,130,241,142,205,119, 34,182,151, 22,109, 78,228,102,215, 22,164, 33,251,237,234, 11,240,153,113, 34,191, 57, 45,184,164,
- 87,208,179,170,219,155, 70, 95,183, 67,135,188, 27,234, 14, 7,231,199,209, 74,176,156,218,163, 73,193, 20,250, 41, 17,133, 11,
-123,182,248, 37, 40, 91,246,155, 60, 24, 50,101, 1,246,151,224, 54, 26,100,168, 87,169, 73, 36,250,122, 13, 88, 56, 2, 9, 25,
- 23, 19, 85, 82,202,233,201,113,226, 74, 83, 98,250,211, 15, 62,237,198,229, 33, 81,173,214,200,141,137, 14,143,105,221,206,149,
- 45, 77,182, 43, 66,183, 0, 64, 79,203,216, 52,168, 87, 78,134,140, 73,169, 54,227, 75, 80,102, 77, 75, 44,219,176,188, 7, 5,
-180,115, 45,130,225, 33, 83,175,216,202, 85, 6, 3,187, 21,247, 84,229, 0,211,165, 14, 15,164, 90,202,139,130,170,245, 82,157,
- 53,158,101,196,219,141,211,236, 37,104,210,215,226,122, 64,196,125, 21, 30,224,201,112,255, 0,134, 35,142, 39,170,170,236,233,
-111,164, 90,238,139,121,199,243, 12,153,219,149,198, 99,202,115,222, 91,143,110,184,168, 52,130,242, 21, 80,146,200,105,110,133,
-118,144,164,210,148,235,175,107,116,106,104, 31,179,106, 0, 58,198,126,181, 3,208,106,244, 68, 0,211,246, 64,249,169, 65,168,
-241,238,170, 56,178,239, 30, 14, 61, 14,224,101, 58,153, 46, 21,120,242, 88, 83,161, 46, 44, 53, 85, 41, 75, 11, 85, 0, 35,183,
-208, 52,219, 35, 49,129, 49,111,237, 8,225,192, 97,133, 50,247,248,125,244,198,164,200,248,186,161,219,228,194,179,170,116,228,
-202,109, 42,143,238,216,159,186, 48,203,100,109,222, 30,241, 11,142,130, 1,173, 9,245,157, 65,117,211, 94,246,235, 32, 33,255,
- 0, 50,250, 19, 33, 80,140,133,206,212,224,158,154,101,220,112, 91,235,115, 97, 42, 60,152,114,216, 65,109,169, 17, 91, 82,145,
-113,104,188, 70,229, 6,136,162,232,154,116, 74,137,245,106,194, 43,230, 57, 87, 14,190, 30,186,145, 20,173, 32,168, 56,212,169,
-153,230,151, 28,194, 92, 57,170,128,206, 50,136,126,233,106,178,218,162, 67, 17, 30,135,103,177, 71, 68, 40,101,242, 82,149, 62,
-242,218,104,189, 33,229,245, 91,138, 82,186, 2, 0,166,219,118,230,237,234, 20,187, 50, 73, 42,174,113, 37,201,208, 50, 0,100,
- 2, 10,118, 73, 90,215,157, 32, 34, 1,135, 71,233,226,120,210,157,182,249,116, 75,118,251, 53,173, 82,174, 23, 91,139,205, 66,
-129, 20, 40,200,121,247,221, 80, 0,210,166,189,105,254,109, 59,225,177,186,166,145, 3, 70, 36,210,237, 86,225,233,236,175,165,
- 78, 8,194,236, 92, 23,193, 87,126, 16,181, 93,109,214,222, 65,228, 68, 88,209,152,115, 84, 24,134,249, 60,102,153,107,241,210,
-194,151, 25, 82, 35, 74,117,171,107, 18, 28,101,132,180,242,122, 23, 29, 66,208,234,137,215,146, 55,190, 97,184,230, 45,217,155,
-171,212,219, 70, 72,109,187,148, 55,195, 96, 43,136,192, 57,197, 28, 78, 96,128,220, 90, 43,174,108,174,139,109,208, 37, 99, 72,
- 1, 74,161,196,228,163, 17,135, 12,197,119,247, 17,243,119,142,216,177,124, 23, 25,202,175,178,249, 75,148, 49,172, 22,219,104,
-191,230, 76,217,216,183,230, 89, 42,173,176,129,149,113,148,194,150,148,192, 68,167, 91,241,156,109,111,237, 21, 85,106, 64, 42,
-233,150,156,247, 29,246,143, 2, 55, 74,245,112, 26, 83, 0,132,143,218, 56,128, 80, 96,113,224, 78, 53, 14,247,119,129,210, 57,
-182,224,191,169,184,129,218,226,128,122,235,158,124,251,230,217,171,245,191, 42,117,182,100,219,131, 45,185, 58, 50,148,227, 36,
- 54,171,194,223,121, 40, 41,109,229,186,118, 37,196, 10,237, 34,160,214,157, 42,214,219,205, 78,186, 47,115,218,154,228,210,138,
-168, 10,225,234, 3, 44, 49,236,167, 29,117,225, 38,182,161, 78,144,126,106,230,214, 81,200,119,155,181,193,248,118,251,155, 47,
-166,124, 52,220,210,250,150, 82,150, 27,121,137, 93, 92,235, 90, 52,148,165,194, 61, 31, 14,181,151,124,220,216, 35,129,193,117,
- 6, 98, 58,214, 63,159, 17, 77, 29,205,164,233, 7, 26,128,241,254,106,159, 38,243, 58,219, 12,190,135, 20,234,216,121, 41, 88,
- 91,241,219,117,101, 40,107,231,117, 41, 74,131,116, 7,231, 30,181,211, 59,151, 48,186, 41, 60, 82, 84, 53, 0,232, 46, 0, 41,
-251,216,175, 64,194,160, 75,127,226, 56,129,149, 60, 31,228,107,236,201,114, 45, 77, 52,252,135, 26,125, 54,152,190, 10,188, 70,
-140,199,136, 82,148,165,164,208,109, 8,175,250, 61,127,105, 58,169,190,230,233, 99, 44,105,114, 57,253,247,116,128, 50, 9,218,
-114,255, 0, 54, 92,106,162, 71,107, 37, 50, 24,122,105,118,203,115,201,243, 11,236,124,122, 2,158, 48, 89,118, 36,100, 92,159,
- 4,179, 37,167, 60, 68, 38, 82,148, 13, 18,151,222, 4, 53, 95,216, 21,253,147, 70, 38,231,230,217, 70,233, 36,118, 56,224, 56,
- 16,131, 79,160, 34,245,246,226,118,246,143,184,120,107, 69, 22,184,163, 33,113, 88,253,153,132,173,217,119,155,236,156, 85,223,
- 13,162,230,199,173,208,196,130,217,218,123, 95, 47, 45,161, 94,224, 15,102,153,135,157, 69,195,101,153,231,221,239, 5, 61, 36,
-124,200, 15,109, 32,218, 73,172, 52,118,122,126, 70,161,251,122,158,103, 44,202,237,211, 45, 76, 61, 58,209, 26, 91,209, 88,144,
-201,113, 51,146,225,113, 94, 42, 18, 55, 5,248, 73,142,161,215,191,225,209, 59,117,125,244, 13,149,178, 16, 30, 64, 40,114, 32,
-162,117, 42,212,105, 60, 88,222, 91,196,125, 85, 95,115, 12, 53, 57,117,210, 76,145,105, 77,180, 93, 36, 75,185, 37,184,140,248,
- 81,146,156,116, 37, 46, 54,216, 20, 72, 75,113,208,218, 64, 79,114,147,173,223, 47,243, 73,218,227, 26,164, 46, 44, 1,170, 74,
-158,254, 68,245,234, 36,149,232, 52,113,222, 60, 38,161,192,251, 41, 51, 16,184,222,241,135,210,200,178,201,185,181, 21,166,218,
- 82,226, 55,225,200, 82, 86, 81, 82, 66,169,214,138,167,166,189, 53,218,172,119,248,103,137,174, 46, 29,236, 70, 61,191, 87,171,
- 26,156,217,132,130,166,200, 60,137,145, 92, 91,103,221, 48,188,133, 41, 74, 29, 74, 15,134,148,184,242,250, 80,144, 86, 59,201,
- 63, 21,116,171,205,222,222, 19,164,200, 20, 98,122,134,127, 46,218, 73,115, 70, 4,212,149,100,229, 28,174, 41, 64,119, 27,187,
- 45,109, 33,149,165, 1,164, 7, 7,138,178, 10, 74, 67,138,175, 78,160,250,245, 76,235,248, 46, 73,210,241,250, 17,126,154, 97,
-209, 53,199, 3, 87, 59,143,242, 28,130,231,102,183,223, 27,182,120, 42,155, 57,200, 45,198,157,190, 50,194,152,240, 20,233, 41,
- 0,147,181, 46, 84,118, 86,135,174,185,111, 60,115,196, 92,174, 7,116,187, 83, 92, 65, 80,131, 78,107,236,164, 69, 98,102,118,
-149,232,246,252,141, 89, 43,143,222, 18, 19, 42,204,244,232, 22,187,188, 37,193,247,169, 14,128, 73,140, 30, 68,135,161,161, 42,
-112,166,174,199, 44,130, 58,165,127,249, 42, 35,199,220,207,205, 83,115, 92,204,186,148, 56,198, 85, 0,201,184, 16,215,122, 14,
-174,177,159, 17, 90,155, 91, 47,131, 26, 2, 2,159, 74,145,234, 74,219, 54,153,140,101,120,180, 3, 22,224,211,106, 69,150,203,
-108, 74, 17,120, 75,166,200,155, 27,241, 98, 70, 76,106,173, 5,211,224, 48,250,220, 87,237,138,147,243, 55, 28,101,171,103,176,
-149,202,220,156, 74,105, 61,229, 5,197,115, 69, 37,160, 14, 25, 12,210,172, 36, 2,229,163, 30,142, 57, 0, 80, 39,203, 26,132,
-174,241, 49,172, 85,156,107,124,167,230,197,148, 63,187,129,183,223,110,143, 61,144, 41,128,132,180, 69, 60, 21, 86, 10, 71,138,
-175,223,234, 83,180,141,108,236,205,197,251,228,121,104,105, 8,228, 3, 32,213,207,167,222, 56,117, 97,152,170,203,143, 14, 38,
-128, 14, 7, 15,151,171,219, 85,189,155,198, 25, 10,225,147,206,115, 37, 82, 96,219,237, 41,179,202, 82,158, 83,177,228, 94, 49,
-121,133,213, 50,195,132,130,176,236,148,248,200,160, 21, 69, 43, 64,105,173,184,182,186,187,208, 12, 67, 91,156,160, 0,136, 28,
-212, 10, 56, 97,129,235, 94,138,205, 79, 20, 39, 80,215,130, 99,232,232,168,145,155,166, 21,117,190, 69,146,178, 69,229,235, 84,
-207,115,101, 79,153, 13,174,105,116, 48,149, 16,165,148,133,171,222, 93, 93,105,208,129,251, 32,106,241,246,183, 86,145,227,139,
- 65,199, 15, 79,208, 5,103, 46, 99,105,201,114,160,229, 90,156,189,228, 22,231,237,121, 7,184,196,176,197,153,109,142,249,116,
-248, 18, 86,134, 67,193,197,132, 85, 69, 9,221,236,129,216, 77, 58, 83,161,178,252,162, 72,197, 56, 57, 58, 56, 1,236,250,106,
- 9,140,202, 23, 46, 31, 93, 38,222,120,231, 36,157,114,110,207,111,189, 51, 42, 37,158, 85,178, 68,217,111, 56, 16, 35,149, 74,
- 8,109,179,237, 40,130,148,161, 64,143, 74, 66, 64,246,180, 33,221,153, 44, 69,210, 52,130, 65, 0,112, 68,196,252,187,105,160,
-199, 64, 10,154, 5,206, 19,159,100,145, 50, 61,230,224,245,157, 78,196,145,118,189,220, 27, 97, 82, 69,162,212,250,140,247,163,
-161,175, 17, 42, 42,109, 10, 67, 74, 27,170, 85, 81,218, 52,254,201,186,218,110,143,128,204,242,219,114,246, 13, 73,168,128, 28,
- 26, 31,164, 17,169, 74,184, 0, 66,132,167, 99, 33,215, 13,100,167, 75, 84,106, 32,106, 32, 20, 4,162,133, 65,193, 69, 70,140,
- 59,141,223,231,230,144, 44,114,219,251,206,213,114,181,227,175, 48,211,222,240,244, 88,210,153,117,136,237,169,196, 37, 40, 6,
- 83,140, 16,154,128,107, 80, 64, 32,235,111,204, 60,190,235, 80,111,108, 28,102,219,124, 66,214,204, 1, 3, 90, 23, 35,131,131,
- 92, 48, 7, 73, 44,110,182,181, 64, 5, 90,221, 95, 56,114, 21,223, 41,150,248,160, 24,220, 65,107,154,224,239,120, 40, 14, 33,
- 16,162,224, 64, 56, 28, 1, 4, 3, 23,203,236,194,108, 88,239,188,169, 48,109,191,234,183,105,113,201, 14, 49, 96,140,183,164,
- 55, 25, 5, 59, 85,226, 44,202,112,165, 21, 53, 46, 35,224,214, 91,107,182,107,203,203,120,226, 23,237, 57, 0, 39,179, 0, 61,
- 6,178, 45,183,192, 56,156,190,186, 72,191,115, 11, 54,251, 33,201,174, 17, 23,107, 83,115, 35, 59,102,132,100, 41,109, 69,251,
-145,214, 84,135, 27,170,129, 8, 9,142,219, 77,238, 53,220, 86, 69,119, 39, 83,108,121,125,215, 82,152,181, 43, 74,234,244,140,
-189,100,158,196,232, 52,207,195, 24,156, 28,211,136,249,248,122,105,103, 33,243, 57,110,243, 31, 61, 57,141,167, 3,200, 87,146,
-189,112,199, 44,252,129,117, 97,182,155,180, 48,205,173,168,199, 99, 44,182,132,184, 84,248,140, 87,227, 18,123,198,223, 71, 66,
-222,118,155, 13,183,108,132, 62, 66,201,162,139, 75,113,106, 61, 20,133,196, 16, 83, 34, 43, 89,185,192,253,232,186,232, 4, 39,
- 49,196,101,244,226, 42, 60,127, 42, 90, 36,221, 90,134,167, 82,110, 83,215,143,165,244,186, 75,143,170, 82, 90, 18, 20, 40,106,
- 18,170, 2,154,119,171,213,174,115,109,106,247,198, 30,252,218,210,243,212,186,147,210, 2,138,207, 75, 2, 5, 7,252, 5, 74,
-246,139, 54, 59, 50,115,120,227, 87,132, 71,185,222,164,181,143, 9,142,190, 83, 21,166,222, 97,180, 45,107, 88, 52, 74, 91, 46,
-180,149,122,134,160, 58,242,226, 38,153,203, 73,104,105,114,113,193, 78, 29,160, 85,114, 72, 94, 49,195,143,174,157,183,171,126,
- 17,106,205,242,139, 4, 27,164,103,172,112,237,215,200, 54, 0,191,161,126, 83,105, 47, 8,200, 80, 39,169,113, 75, 82,130, 71,
-106,200, 26,131,183,223, 93, 92, 66,199,185,135,196, 58,117,118,144,165, 59, 21, 59, 41, 19,153, 28, 72,111,187,168,167,160,210,
-140, 30, 60,198, 50,251,155,150, 43, 29,194, 44,136,182,107,189,226, 43,147,124,100,178,196,162,175,118, 83, 72, 86,226, 54,130,
-210, 87,180,118,133, 33, 98,154, 85,247, 48, 92,217, 91, 9,165,105, 4,129,135, 16,114,249,211,215, 81,222,217,181, 6,140,206,
- 94,170, 52,156, 71, 24,241,161, 92,100,221, 27, 48, 46, 23,153, 41,117,110, 43, 97, 82, 76,105,126,236,197, 15,122, 95,128, 83,
- 64, 79, 85,166,157,244, 40, 55, 89, 30, 93, 22, 42, 26, 10,116, 33,111,206, 15,170,153, 13,145, 20,240,166,166,101,139,197,198,
-133,194, 51,172,133,187, 38,215,112,154,185, 14, 10, 33, 86,118, 36, 41,200,206, 80,245, 37,228,198,108,117, 31,180,125, 7, 83,
- 45,247, 41, 94, 66,228,112,255, 0,118, 11, 82,226, 87, 96,105,178,140,125,231,242, 53,217,144,234,225,217,159,140,132, 69,101,
- 35,195, 75,208, 46,203, 74, 5, 58,154, 2,217, 93,123,122, 31, 94,172,111, 46,225,117,156, 50,224,100,241, 92, 79, 72, 45, 33,
-163,212, 71,207, 82, 1, 17,198,212,247,138,147,236,167, 30, 63,130,217,213, 42,232,167, 94, 96,161, 94, 21,206,203, 49, 85, 15,
-120, 54,199, 88,105,150,220, 61,190, 35,136,117,194, 62, 13, 84,221,111,114, 90,152,155, 31,219,114, 17,209,220, 46, 94,192,128,
- 80,151,190,164,112, 31, 47,157,105,122, 46, 47,143,218,173,185, 29,185, 30,236,243, 56,236,155,236,119,101,120,137, 75,166, 91,
- 98, 50,169,237, 40, 85, 64,191, 41, 52,237,170,145,233, 26,120, 95,205,114, 3,194,171,138,142,207,169, 16,250,233,146,215, 59,
-182,153,113,113, 6,151,198, 87,251,164, 65, 21,148, 93, 39, 49, 96,137,251,111, 77,102,104,117, 50,222,165,126,106, 54,238, 36,
-246,104,155,185,201, 5,206,156, 78,152,203,143, 82, 17,135,105, 20,236, 49,146, 67,137,226,158,202, 78,149,196,177,237,216,110,
- 55,123,131,117,104, 92, 47,146,165,185,112,132,221, 82,238, 56,237,189,214, 12,102, 64, 81,171,133,216,205,248,132,143,103,233,
- 7,125,117,113, 14,245, 36,142,144, 61,157,208,128,127,168, 34,147,235, 41,211,133, 62, 36, 17,128, 6, 38,166,191, 44,214, 46,
- 16,199,249, 74, 31, 39,242,183, 44, 99, 28,105,128, 96,215,124, 70,233, 14, 94, 85,113, 83,111,228,179, 49,255, 0, 2, 75,141,
-177, 25,149,137, 46, 40,251,171,174,184,166,210,173,187,118,128,183, 92,109, 11,219,242, 45,141,231, 49,110, 30, 28, 45, 95, 9,
-190, 33,233,205, 24, 0,195, 50, 49, 42, 0,204,144, 43, 69,178,134,205, 43, 95, 41, 1,173, 32,145,196,230,112,244,125, 1, 9,
- 52,195,243, 29,147,218, 51, 14, 97,228,142,106,197, 35,201,191,224,220,167, 37,219,237,238,233,116,183,170,204,253,186,224, 22,
-208,102,104,183,200,113, 83, 34,181, 37, 74,171,173,132,141,170,246,148,148,133, 42,151, 92,253,185,217,110,114, 65, 20, 23, 26,
-174, 33,238, 22,133,208,173,192,134,185, 0, 36,226,152,144,120, 18,162,163,110,119, 34,246, 87, 22,184,230, 83,164,130, 87, 19,
-149, 70,217, 94, 7,111,180, 76,194,177,203,106, 17, 50, 76,188,109,140,179, 53,186,161,123,226,198, 18,219,113,248,240,155, 88,
- 59, 92, 40,109,157,203, 82, 9, 21, 86,208, 78,218,235,149,237,155,188,151,113, 58,103,132,106,150,176, 28,220,152, 23, 17,192,
- 18,112, 7, 20,196,162,165, 87,205, 16,136,106, 37, 79, 1,209, 67,227, 56,203,108,221,178,120, 22,167, 45,235,131,100,198, 34,
-198,114, 93,210, 2,167,199,114,116,179,225,169,242,148, 61, 25,244, 39,222,164, 41, 77,134,222,108,148, 36, 32,170,155,181, 34,
-231,122,248, 0,198, 32, 71,184, 2, 16, 98,157,226, 1, 32,161, 64,138, 16,130,112, 53, 35,111,185,138,202, 65, 44,240,182,102,
- 33, 5,132,185,160,168, 64, 85,164, 56, 22,148,112,197, 9, 8,224, 90, 72, 40,241,172, 74,149,158,164, 71,105,177, 10,219,104,
-247, 75, 96,152,144,152,236,188,146,176,215, 64,165,251, 1, 79,111,237,169, 73, 0,245,235,167,228,220,226,123, 60, 88,245, 33,
- 10, 1, 69, 10, 50, 36,102,153,112,236,170,249, 67, 90, 15,109, 54,165,227, 17, 45,247, 86,163,163, 99,209,225, 76,152, 18,180,
-245, 67, 10, 93, 0,119,169,161, 42, 42,220, 65,209, 67,185, 25,194,244,212,115, 26,140,115, 52,189, 47, 11,241,173,143, 76,182,
-199,140,185,119, 23, 89,183, 61, 50, 66,131,138, 75,179,148,167, 60, 81, 83, 68,128, 18,132, 5,119, 13,221,199,164,120,183, 71,
-106,124,146, 18,129, 64, 29, 8,163,214, 83,230, 20,141, 32, 16,211,144, 79,151,162,163, 24, 88, 59, 83,178,119, 45,238, 50,144,
-244,152,205,173,196,169,170,136, 54,102, 80,219,232,113, 36,144, 42,226, 80,176,165,119,215,248,181, 62, 61,224,197, 16, 45,197,
- 48,237, 35, 49,235,250,106, 78,167, 34,129, 75,109,224,176,208,151, 30, 13,248,136,147, 18,202,166, 16,186,214,178, 18, 10,106,
-127,106,158,211,170, 30,138,122,180,111,221, 30,204, 92,114, 95,156,212,125,110, 39, 14, 11, 71,255, 0,186,237,166, 56,140, 80,
- 68,135,159, 84,228,183, 67,227,169,136,192, 72, 40,237,174,240,135, 64,255, 0, 72,246,233, 31,204,158,171,242, 95,170,155,212,
- 87,209, 80,166, 69,139, 49,100,182,219, 99,186,202,190,244,147,142, 54, 88,102,159, 72, 28,115,180,122,106,119, 80, 15, 89,214,
-194,214, 99, 44,135,162,163,192,243, 33, 61, 26,169,142,197,150, 75, 50, 74, 37, 49,226,174,194,110,119, 95,120,113, 59,154,140,
-136,172,159, 13, 32, 86,128,151, 85,219,242,106,218, 59,166,135, 56,183,136, 69,169, 58,198, 36,113, 65, 81, 52,171, 76,192, 35,
- 62,148, 56,234, 36, 7,166, 72, 83,132,130,165,167,122,170,106,122, 86,157, 62, 29, 57,108,224,231, 16,122, 22,172,152,230,144,
-125, 84,179, 61, 37, 54,187,101,185,167, 3,106,119, 99,202, 64,250,199, 2,235,189, 99,213,210,131, 78, 49,170,231, 23,116, 39,
- 96,253, 52,152,202, 43,141, 69,147, 25,251,202,233, 33,226,200, 13, 49, 37,197,182,143,156,165,200,114,170, 39,173,106, 84, 62,
- 64, 53, 50, 47,217, 53, 23,160,122, 6, 66,172, 76,136,209, 71,217,181, 75, 92,152, 77, 72, 34, 51,111,167,223,158,223, 84,178,
-203, 78,213, 73,168, 6,170, 62, 31, 80, 7,121,211,236,153,179, 2, 1,233, 4,246, 83, 78,115, 88, 48,169, 22, 59, 16, 45, 38,
- 68,187,138,144,134,153, 41, 22,248, 67,105,121, 36, 29,234,120,130,118,133, 17, 74, 19,217,242, 2,220, 75, 51,139, 91,131, 70,
- 4,253, 21, 12,172,184, 14, 57,211, 79,221, 89,184, 62,220,134, 67,109,189,112,121, 13,178,202, 86, 75,113, 33,133, 19,189,107,
- 39,169, 53, 36,168,255, 0,154,193,206,210,208,193,157, 17,140, 51,209, 76,139,253,174, 45,244,222, 88,142,226,197,150, 35,255,
- 0, 73, 38,187, 87, 49,208, 3,117, 72,173, 42, 80, 61,145,220, 7, 94,164,232,221,120,216, 28,198,143,146, 99, 82, 34, 6, 36,
-114, 98,152, 10, 25,197, 11,213,159, 30,197,229, 91,227, 59,141,219, 18,244,132, 67, 91,239, 48, 34, 91,225, 37, 75, 74, 80,166,
-157, 69, 74,138, 64, 37,117,169, 58,102,204,126,221,243,170, 56,241,255, 0, 26, 48,223, 8,151,175,123,235,164,187,231,191, 74,
-177, 34,205,105, 2, 12,112,249, 15, 56,128,159, 24,182, 27, 82,130, 10,194, 3,138,249,194,149, 61,154,145, 4,129,210, 23, 28,
-210,138, 18,143,212,236,112,164, 75,118, 47,111,176,182,110, 50,231,221, 89, 83, 49, 76,160,228, 93,145,214,243,171, 95,135, 68,
-168,168,172,147,217,211,174,165,190,236, 76, 52, 4, 34,148,100,116,199, 33,233,167, 49,121,246, 34, 67,186,180,229,222, 18, 31,
- 75,165,160,228,198, 93,184, 72, 91, 5, 61, 86,183, 9,217, 95, 16, 30,134,190,189, 53, 28,113,184,162, 3,232,194,163,185,197,
-116,224,126,106, 94,128,230, 75, 53,201, 77,200,155,121,143, 14, 35, 14, 60,240, 55, 39, 20,220,133,213, 45,180,130, 2,130,126,
-177,123,168, 59,129,211,178, 69, 12,106,116,181, 70, 88, 10, 40,131, 85, 80, 82, 28,102, 87, 40,199,142, 93, 47, 92, 35, 37,184,
-169, 91,139,170,166,145, 64,178, 43,251, 72,236,169, 61, 69,123,199, 84, 74,124, 49,212,125,148,165,214,174,225,244, 84,213,197,
- 48, 85,143,223,149,150,205,184,192,183,181, 29, 47,218, 99, 77,151, 5, 87, 37,176,137,105, 13, 62,168,200,241,152, 64, 95,134,
-225, 73, 90,137, 0, 26, 1, 83, 81,147,223,174, 70,226,207,132,141,164,228,226, 1, 69, 42,173, 92, 14, 10, 21, 7, 70,117, 58,
-202,111,135, 89, 61, 85,208,140, 91,204,127, 35,228,237, 95, 28,179,101,136,183, 53, 52,187, 49,235,139, 22,148,219, 50, 11,148,
- 91, 99, 33,150, 99,137, 49,151,226, 67, 67,161, 37,180, 37,128,149,251, 94,211,128,212, 14,101,117,201,118,150,186, 60, 88,148,
-183, 0,221, 74,208,167, 18, 65,193,196,102, 75,148,116, 55,141, 91, 58,253,247,143, 14,152,168, 57,142, 1, 50, 84,205,114,169,
- 62, 23, 54, 38,203, 21,203, 68, 37,198, 38, 68,104,234,159, 37,253,174,173,219,132,212,183,239, 4,184,186,173,213,161,181, 45,
- 27,202,183, 21, 84,215, 85, 71,110,150, 41, 26,224, 72, 69,203,128,199,212, 49,236, 74,208,195,184, 49,163, 72, 64, 18,159, 55,
- 30, 66,181,220, 65, 76, 43,186,165, 79,153,110, 55, 43,172,107,157,193,119, 24, 77,194,104,190,242, 25,109, 69,126, 43, 69,210,
-164,212, 84,138,154, 80, 83, 84,109,182,154, 53,214,212,105,127,117, 2, 21,192, 41,224, 80, 14,220, 41, 55, 55, 13,185,196, 56,
-135,116,212,123,107,186, 70,202, 46,165,187, 28,241, 2, 74,108,120,221,156,120,242,148,228,120,176,227, 72,141, 24, 58,131,184,
-169, 74,147, 26, 41, 64,223,187,161, 82,141, 41, 67,125, 43,100,108,109,115,198, 68,225,211,129, 63, 57,234,224, 43, 37,121,187,
-127, 47,145, 39,239, 3,147,155,232,204,116,167,248, 80, 24, 78, 47,138,196,206,209,125, 84,200,209, 81, 22,210,222, 95, 61,185,
- 10, 84,134, 88,152,241,115,220, 89, 82, 10,246,251, 83, 74, 94,114,167,176, 36,122, 70,170,239,239,230,101,169, 5,164,157,122,
- 64, 28,127,204,126,238, 3,174,180, 86,164, 3,169,199,130,253, 94,220,105,243,141, 95,248,238, 42, 33, 61,108,184, 60,243, 55,
- 25,151,139, 19, 83,156,125, 78, 56,171,214, 68, 17, 22,108,174,160,161, 75,139, 17,164,180,201, 64,246, 86,144, 65,237, 26,172,
-186,219,175,158,231, 62, 80, 60, 78,233, 61,141,197,173,234, 4,149, 43,154,154, 91, 39,133,128, 1,238,227,235, 57,159,170,167,
-104,220,219,199,216,134, 61,142, 49,100,179, 37,169,205,221, 39,172,174, 98, 10,156,122, 28, 4,186,152, 91,203,138,171,135,194,
-117, 53, 42, 52,234,163, 65,212,107, 33, 39, 41,222, 94, 58, 64,231,146, 8, 3, 14,149, 5,231, 12,177, 30,192, 42,221,187,220,
- 16,134, 8,128, 80,113,250, 62, 93,180, 40,231, 92,102,205,100,198, 29, 83, 22,233,210,254,248, 55,181, 72,109,132, 23,131,211,
-148,235,111,200, 10, 79, 97,247, 98, 54,168,247, 43,248,116,252, 28,183, 61,195,165, 36,185,163, 32, 20,162, 4, 65,235, 7,213,
-215, 82,153,186, 50, 48,208, 0, 60, 79,167,244, 83,158,225,146, 89, 23,149, 68,189,179, 97,137, 26, 76,184,118,148,174, 75, 45,
-210, 67, 86,251,145,142,236,170, 30,218, 34, 58,222,175, 82, 42,216, 61,186, 99,111,178,154, 24,221, 14,178, 90, 28, 79, 82,130,
- 83,214, 83,214,149, 26, 91,214, 74,226,253, 33, 79,173, 10, 47,177,106, 57,126,209,109,118,247,140,251,212, 24,150,200, 6,193,
-127, 13,165,196, 0,144,156,157,168,146, 18,146, 69, 78,224,194, 19,180,118, 5, 87,187, 87, 31,204, 30,219, 57, 94,194, 92,242,
-246,255, 0,248,184,143,159, 58,132, 26,215, 61,161,192, 1,164,159, 93, 65,242, 98,162,229,201,161,204,124,197, 54,107,141,156,
-205, 75,143,109, 67, 44, 75,121,166,230,200,113,102,161, 41,240, 82,154, 41, 71,160,246,181,184,218, 55,121,246,237,179, 92,206,
-118,168,156,198, 39, 74, 29, 32,122,120, 14,202,131, 37,185,145,197,204,226, 9,245,208, 54,120,121,100,139, 52,251,237,193, 34,
-219, 25,216,174,194,182, 73,117, 34, 48,121, 44,161, 8, 10, 1, 69, 41, 74,150,166, 29,245,208,157, 93,203,191,135,184,183, 89,
-115,138, 47, 28, 51, 35,177, 13, 84,220, 91,200, 64, 35, 36,166, 21,250,249,145,177, 27, 25,145,103,117, 99,239, 75,157,217, 17,
- 93,109, 36,174,123, 86,121, 69, 98,181, 33, 69, 37, 77, 80,215,183,174,174,246,235,231,188,205, 35,156,130, 48,213, 94,151, 15,
-211, 76,136,158, 2,140,141, 72, 16,121, 67, 62,119, 31,180,218,189,250,224,212,171, 4,165,220,161,152, 53, 18,174, 42,150,203,
- 17, 35, 48, 18, 22, 2, 74,157,107,197, 82,149,212,169, 85, 61,106, 5, 46,229, 45,190,235, 14,137,218,210,210, 8, 43,144, 4,
-130,126,106,126, 61,113, 29, 65, 87,231,160, 97, 95,121, 67, 43,188,200,117,251,197,233,200,107, 97,235,148,247,125,228,132,200,
-154,232,105,183,124, 18,218,247,248,108,165, 9, 75, 68, 2,160,132, 18,144, 72, 0,208, 77,111,183, 89,177,173,208,220,208, 14,
-172, 78, 61,103,143, 5, 32, 28,234,197,134,105, 84,234, 63, 47,151,170,141,102,183,220,215, 26,142,195, 81, 22,235,201,116, 42,
-106,226, 38,122, 15,185,193,138, 18,207, 68,251, 32, 41,253,175, 33, 45,214,180, 20, 2,170, 80,208,218,236,236,174,195,139,128,
- 85, 69, 76,201, 83,236,238,149,236, 61, 20,213,204,146,176,160, 56, 39, 79, 85, 64, 28,177,151,114, 75, 22,216, 18, 46,215, 11,
-154,101, 53,146, 56,235,137, 14,253, 3,113,226,205,101, 13,164, 16,181, 81, 74, 14, 41,117,238, 73,165, 58,212,234,118, 72,236,
-100,121, 17,177,161,165,160,118,148,249, 15, 69, 87, 78, 36, 0,106, 39,141, 48,114, 22,179,104,210,144,241, 85,193,113,100, 77,
-145,122,184, 41, 11, 42,101,185, 87, 8,235, 74, 90,216, 85,182,149,108,154,145, 66,106, 43,171,219, 73,237, 26,132, 6,234, 1,
- 7,251, 15,210, 83,209, 85,179, 54, 71, 46,105,245,212, 75, 63, 35,202,237,115, 81,121, 76,169,108, 60,194, 93,182,199,117, 46,
- 21, 82, 53,189,182,130,207,111,236,182,154,154,119,208, 14,205, 89,203,101, 13,195, 12,104, 19, 63, 89, 38,162,235, 45, 64,120,
-252,133, 60, 45,188,171,151,219,162, 64,136,236,249,150,209, 26, 45,205,201,111, 54,178,169,183, 5,220, 20, 86,234,119, 18, 74,
- 10,146,162,208,233,236,251, 68, 13,202,213, 60,188,189,110,231, 57,250, 71,120,180,117, 0, 0, 3,229,214, 6, 66,137,165, 79,
-101, 79,120,199,153, 25, 88,196, 42,220, 25,105,167, 86,182, 27, 36,182, 55, 63, 58,205,225,161,164,208,168,238, 12,150,144,160,
- 15, 64,191,140,156,190,227,202, 49,223,135,182, 44,145, 62,246, 39,214,184,211, 47,107,142, 3,167,230,175,121, 39,205,231,190,
-227,247,155,122, 26, 48,223,190,221,101, 57, 46,226,243,155,165, 61, 2, 10, 97,165,108,178,146,122, 54, 29, 66, 66,137,234, 84,
-107,222,117, 54,195,202,201,118,248, 96,145,193, 99, 13,110, 35, 37, 5,237, 10,153, 28,240,234, 29, 84,207,132,233, 28, 72,205,
-199,233, 95,154,160,235, 54,125,102, 55,201, 57,189,151, 7,139,103,186, 75,197,223,180, 92,166,218, 31,118, 44,219,197,206,107,
- 30, 12,107,172,146,167, 29, 75,174, 34,104,110, 66,210, 83, 66, 80, 72, 1,106,223,174,153,123,191,137, 44, 29,182,220, 65, 19,
-109, 93, 19, 99,115, 34, 6, 61, 82, 68, 9,142, 99,137, 30, 40, 42, 30,128, 53,237,113, 5,170, 84,109, 37,230,137,110,154,219,
-123,150,131, 19, 97,208, 26,210, 71,121,160,232,144,169, 61,224, 83, 86, 65,193, 66, 3,136, 47, 31, 55,200,217,189,216,166,185,
- 8,170, 59,183,132,100, 75,110, 83,133, 62, 35, 48, 28, 72,113,107,246,182,148,134, 88,170,186,126,202, 71,126,177,199, 98,130,
-216,234, 94,232,106, 4,235, 32,132,244,170, 86, 63,196, 80,113,234,165, 8, 25,221,145,185,111, 79,151,107,126, 93,214, 28,155,
-180,219, 12, 57,107, 46, 49, 10, 40, 97, 75,109, 65, 4,236, 74,218,117, 53,173, 42, 0, 3,176,117,133,184,237, 47,116, 70, 54,
- 59, 75, 93,131,147, 50, 78, 97,122, 19,229,141, 37,142,114,131,237,236, 52,240,196, 60,199,192,196,213, 97,227,155,102, 60,196,
-123,124,219,171,110, 93,221, 44,110,155,115,189, 92,130, 65, 37,195, 69, 40,179,227,182,148, 2,104,145, 83,219, 82,116,251,101,
-149,157,195, 45,152,251,125, 82,177,192,185,197,216, 21, 40,154, 81, 16,128,112, 57, 86,142,203,117,146, 8,139, 24,154, 93,159,
-215,245, 84,123,155,242,132,118,242, 57,109, 89,237, 72, 68,168,211,150,183, 31, 9, 30,232,196,201, 78, 52,223,188, 1, 94,210,
-250, 2,207,195,167,185,155, 99,181,109,213,200,183, 1,176,228, 0,255, 0, 78, 7,209,129, 78,218,169, 98,200, 73,113,233,165,
- 44,123, 53,188, 89,253,222, 44,152,205,200,187, 91,110,173, 16,165,167,114,252, 85,166, 84,132, 32,146,125,170,152,209,201,244,
-246, 29, 99,239,108, 98,148, 17, 25, 65,160,143,161,125,166,152,115, 65, 83,195,252, 62,186,112, 69,151, 41, 89, 4, 43,237,213,
-114,157,247, 60,118,205,119,125,166, 9, 75,168,149,113,144,241, 66, 10,201, 52, 82, 92,112, 10,247, 83,213,170,182,219, 36, 90,
- 97, 77, 65,197,184,240,224,190,128,135,174,148,161,163,181,126,138,106,216,121, 58,243, 24, 39, 31,115,198,128,245,251, 47,139,
-146,166, 96, 90,146,212, 56,150,134,166, 46, 97, 91, 64,159, 17, 9, 90, 1, 9, 61, 61,143,226,213,211, 54, 88,222,232,220, 72,
- 45,107, 11, 83,167, 36, 62,207,109, 59,165,170, 79, 64,249,124,244,233,129,158,229,159,113,155,156,217, 46, 8,208,226,228, 25,
- 44, 86,156, 86,231,133,193, 19,163, 56,203,235, 7,165, 75, 78,160, 36,118,125, 26,207,237, 29, 83,221,109,176, 71,112, 89, 27,
- 19, 0, 9,233, 46, 14,195,208, 27,143,104,232,168,238,115, 38,104, 3,131,147,235,167,165,227,148, 46,156,132,246, 75, 49, 76,
-190, 32, 70,180,220,237,214,180,183,255, 0, 87, 2,215, 18, 99, 81,138,148, 79, 93,243, 37, 10,143, 90, 70,153,143,101,101,149,
-188, 77, 46,239, 13, 42,122,120,159,152,211,110,112, 14,232,199,233,169,115, 31,200, 46,185, 69,246,200,196, 11, 52,201,151, 35,
-139, 93, 32,217,160, 66,101,115, 36,220,100, 88, 90, 76, 72,241,216,109, 1, 78, 45,110, 72,166,212,164, 18, 84,176, 70,179, 59,
-150,217,166, 38,177,135,188,233, 89,144, 79,126, 69, 56, 15,163, 60,168,218,221,101, 78,104,158,202, 49, 54, 70,119, 62, 45,158,
-193,141, 96,121,149,243, 47,201,111, 87, 75,125,130,199, 99,197,230,220, 46,115,175, 88,195,107,157,121,101,136,236,176,167,164,
- 46,207, 28,161,217, 13,161, 39,195, 74,137,112, 0, 43,169,214, 60,166,233,101,106,135, 29, 45,115, 70, 4,146,136, 10,117,160,
-199,136,165,197, 1,144,144, 1,196,252,213, 22,193,196,121,135, 36, 93,139, 24,198,112,124,226,251,116,201,151,120, 93,186, 21,
-150,193, 58,235,112,190,201,138,144, 46, 6, 59, 44, 52,227,178,220,135,224,167,222, 10, 1,216, 80,119, 82,130,154, 27,123, 18,
-100,107, 88,210,112, 40, 0, 42, 83,163,177,106, 68,125,236,129, 39,133, 63, 97, 89,115,213, 97,239, 67,141, 96,201,204, 56, 86,
-139,213,201,167, 99,218,100, 59, 16,218, 44,158,255, 0, 26, 68,182, 86,148,109, 83, 76,251,179,232,146,248,246, 82,164, 44, 40,
-130, 14,162,190,204, 49, 30,198,169,118, 42,156, 9, 10,123, 1,195,160, 37, 50, 87, 82, 39,200,103, 86,118,215,229,119,144,213,
- 7,142, 82,252, 60,141,251,111, 55,227, 88,197,235, 21,201,109, 54, 43,197,223, 23,133,115,185,178,210, 45,214,153, 18, 25,183,
- 45, 62,254,227,108, 58, 21, 26, 48,117,101, 33, 59, 2,200, 26,110,230,194,234,221,176,233,140,185,175, 13, 71, 52, 56,142,250,
-144, 48, 25,132, 82, 2,148, 33, 22,164, 24,158,192, 59,185,140,208,241,225,149, 50,224,121, 28,206,185,183,154,248,215, 10,198,
-241, 75,180,252, 10,233,200,143,241,235,124,153, 62,193,122,135,197, 49, 57, 18,100,251, 94, 63, 17, 82,231,187,108, 67,204, 50,
- 46,210, 1, 41,114, 56,116,116, 66,153,241, 9,104,239,121, 91,122,188,217,118,155,171, 91, 97,166,226,230,226, 40, 4,154, 92,
- 27,160,185,204, 46,213,165, 64, 87, 53,185,106, 26,138, 5, 20,112, 50, 87, 35, 90, 51, 40,168, 83, 52,232,162,207,240, 7, 48,
- 79,183, 55,142,220, 48, 28,163, 27,150,213,165,177,123, 86, 81, 96,153, 96,105, 54,153,206,148,195,150,164, 73,105,181, 22,230,
-132,182,136,230,132, 56, 74,182, 86,135, 92,150,241,238,218,220,101,157,175,110,157, 39, 22,144,139,145, 56, 96, 14, 40,114,194,
-153, 49,189,167, 89, 4, 12,241,194,164,104,126, 80,185,138,239,104,227,156, 61,188, 99, 32,102,254,246,125,106,225,149,101,215,
- 43, 45,210, 46, 57,136, 71,186, 92, 30,139,111,110,252,243, 80,100,136,194, 55,222, 76, 69, 11,113,123,212, 5, 67, 74, 81,166,
-172,108, 68,251,205,227,219, 20, 78, 12,238,135, 18,210, 26,217, 28, 90, 10,148,238,169,196,132,193,125,106,100,111,184,114, 6,
-156,192, 43,254, 24, 82, 78, 63,229,135,151,238,156,117,202,153, 14, 33,139,221,178, 73,204, 94,113,203, 44,219,102, 63, 97,185,
-221,239, 23,180, 79,126,253, 30, 52,139, 67, 81,224,184,153,177, 96,253,195, 40, 76,123,122,124, 53,128, 8, 39,126,216,246,219,
- 84,251,187, 31, 35, 24, 72,138, 64,208,128,146,224, 74,185,192, 1,136,212,199, 2,122, 61, 53, 44,219,184, 55, 37, 79, 94, 43,
-245, 84, 77,140,113,158, 77,144,205,199,226,218,236, 89, 52,185,153,157,162,225,120,181,189, 10,201, 46, 75,178,236,184,252,151,
-225,203,153, 20, 33,178,167,227,198,122, 51,236, 56,242, 1, 72, 91, 43, 4,213, 10, 2, 60,206,146,220,144, 35,113, 8, 75, 64,
- 4,146, 2,229,211,139, 78, 89, 16, 71, 10,173,116,110,121, 8, 15,203,244,210,173,235,203,247, 38, 73,187,199,197, 88,226,190,
- 79, 25, 54, 69,143,195,191,196,179, 55,130,221, 62,246,149,102,158,166,226,125,225, 26, 48,138, 95,122, 59,147, 28, 12, 37,212,
- 36,167,196, 82, 16, 21,184,208,206, 22,151,176, 22, 1, 11,201, 69, 77, 46, 82, 9, 69, 68, 84, 82, 49,162,137,146, 56,133,105,
-234,192,211,101,158, 45,204, 44,110,225,248, 84,236,115, 43, 77,254,252,253,213,200,150,249,118, 73, 76,220, 37,192,198, 93,152,
-221,193, 73,101, 72, 14, 47,220, 23, 25,104,144, 66,126,140,178,226, 85, 66,133, 0,212,166, 89,222,239,217,144, 1,114, 4, 42,
-116,247, 74,116,161, 15, 94,130, 58,168,165, 5, 79,116,175,203,234, 52,254,196,248, 83, 42,207, 93,181,205,177,226, 25,115,182,
-156,134,239, 27,140,151,156,194,198,229,200,199,196,217, 44, 69, 68, 59,113,156,219, 42,140, 36,151, 17,181, 45,135, 55,157,224,
- 83, 85,119,194,230,198, 19,113, 20, 79,116,122,151, 6,146, 11,220, 64, 64,122, 93,169, 64,204,240,167, 33,133,247, 26, 64, 5,
- 50,234,163,240,184,119,147, 68,143,188,209,195,220,149, 49,188,127, 30,155,145,228, 49, 85,129, 93, 86,197,155, 27,152,215,135,
-108,153, 44,136,167,221,154,125, 16,230, 22,157,112, 4,148, 36, 45, 36,138,157, 91,203,180, 93,220, 49, 76,111, 70,150,184,247,
- 93,128,207, 28, 50, 35,143,109, 52, 45,228,140,147,164,245,225,194,163, 77,214,111,126, 55, 31,119, 96,214,208, 47,197,157,200,
-241, 27, 64,144, 84, 0, 85,122,111, 4,215,167, 96,167,103, 93, 82,252, 76,218, 58,252, 68,246,212,125, 61,229, 92, 22,168, 93,
-206,235,122,200,242, 8,153, 42,208,181, 91, 44,158,237,105, 66,168,106,169,109,164,149, 40,145,208,251,106, 39, 93,113,250, 32,
- 96,141,167,188, 71,177,105,173, 13,137,154, 56,156,105,237,200,110,219,237, 16,177,188, 66, 58, 16,221,194,249, 75,182, 71, 53,
-105,162,219,133, 33, 21,105,165,117,168,217,213, 68,122, 72,209, 88, 48,198,204,242, 52,196, 44, 46,212,254,140,170, 32,147, 12,
-221, 97,202,131, 22, 63,211,175,221,163,198, 90, 5, 16,222,197, 3,185, 70,189, 2, 91, 73, 86,164,198, 94,233, 91,164,224,165,
-123, 18,167, 70, 52,149, 61, 20,130,108, 74,152,228,139,163,137,164, 88, 17,132, 86,187, 82, 60, 6,155, 45,164, 39,175,106,136,
-233,240,234, 77,230,224, 32, 33,173,205,206, 65,219,250, 6, 52,251, 74,247,125, 38,155, 54, 12,121, 50,110, 47,120,205,132, 52,
-191,122,113, 30,205,106,160,146,149, 40,117,232, 16,142,131, 82,110, 46, 60, 40,201, 25,129, 66,105, 74, 0, 43,123,117,177, 89,
- 70, 86,201, 83,169,143, 2, 69,225, 54,232,235, 80,163,113,161, 70, 5, 42,112,245,167,178,219, 93, 53, 30,204,252, 60, 45,103,
-218, 56,158,211,250, 77, 34,121,124, 22,145,197, 22,153, 89, 44,100,100, 23, 75,194,237,238, 45,168,137,151, 36, 67, 37, 70,174,
-193, 83,165,176, 65,220, 63,101,186,157,104,225,156, 64,196, 57,212,168,100,240, 26, 3,179,250,105,196, 44, 81,147, 22, 21,170,
- 33,121, 33, 48,209, 62,116,197, 44, 37,111,137, 40, 65, 67,105,161,246,122, 40,212,252, 0,118,106,183,226,220,249,117,187,221,
- 93, 32,122,212,154,143,241, 10,167,138,212,105,112,135, 61,213, 27,125,189,162,196, 56,237, 42, 67,202, 30,202, 92, 89, 4, 80,
- 10,212,236, 21,248,245, 48,200, 1, 14,118,117, 46, 57, 64, 10,236,205,107, 41,181,197, 31,119,199,109, 65, 12, 67,142,135, 86,
-174,139,125,199, 84, 10,146, 13,123, 61,145,211, 82, 99,153, 24,122,233, 33,250,251,199,166,142, 91, 32,190, 19, 14, 60,128, 84,
-251,242, 12,233, 68,116,216,220,148, 13,189, 61, 27, 72, 26,105,183, 2, 61, 78,234, 32, 83, 82, 73,137, 35,161, 5, 56, 37, 88,
- 4,187, 80, 97,214,199,142,211,247,152,228, 30,170,241,208,235, 43,104, 14,189,192,157, 70,130,227,198, 49,233,201, 62,117,164,
-137,139, 61,149,179, 56,252, 91,150, 35,101,130, 74,125,241,121, 55,186,146,123, 82,195,236, 70, 81, 29,190,150,129,213,132, 83,
-152,228,111, 69, 23,137,165,228,252,184,210,125,240,152, 23,187,211, 54,207,110, 43,215, 38,227, 4, 39,166,245,178,202,215, 94,
-222,192,227,244,213,132,147,135,187, 81, 57, 31,106, 83,145, 15,217,161,226, 41, 2, 12, 85,198,185, 70, 46, 52,164, 62,236,117,
-183, 17,183, 19, 66,149, 60,232,108,186, 65,236,220, 74,200,212, 89, 39,241,120,211,138, 52, 32,225, 79,248,207, 74,240, 98,135,
-137, 16,109,178,223, 74, 91, 6,173,189, 39,121, 85,105, 94,229,245, 63, 22,171,163,107, 99, 38, 65,153,255, 0, 10, 15,147, 64,
- 13, 29, 21, 43,224,242,167, 90, 16,171,138,157, 91, 73,113, 66, 36,117, 41,116, 66,214,170,168,244,236,162, 19, 85,124, 90,139,
- 60, 45,157,154,141, 71,150,232,146,128,246,211, 89, 25, 91,236,170, 67,110, 59, 57,231,221,155,224,194, 91,114, 66, 26, 66,208,
-149,158,181, 74,138,128, 10, 36,210,157,218,128,253,181,174, 58,184, 39,203,230,169,204,184,120, 3, 28,169,121,156,194,249, 22,
- 83,202,102,100,212, 51, 58,218,244, 81, 41,167,200, 64,125,180,109, 9, 52, 35,111,210, 13,128,142,253, 54,253,186, 34,142, 32,
- 97,138,124,186,168,155,114, 92, 16,208,184,206,123,117,137,122,154,182,110, 82, 78,201,176,208, 22,151,138, 55, 55,111,101,207,
- 13, 38,132,116, 74,220, 81,210,167,176,140, 52,224, 48, 95,105,168,119, 76,241, 67, 87,130,252,255, 0,162,148,166,114,117,229,
-203, 85,218,211, 9,249,205, 93,239, 14,198,138,137, 1, 95, 66,197,173,134,203,142, 56, 85,184, 41, 38, 61, 84,164,247, 18, 70,
-161, 91,237, 17, 61,204,123,128, 45,106,146, 58, 72,192, 15, 79,215, 86, 31, 16,230,166, 56, 37, 89,110, 48,228, 88,184, 46, 61,
-100,181, 55, 2,211, 46,229, 30,193,112,188,180,252,182,252,111,187,131,142,184,136,173,167,168, 86,245,165, 41,241, 8, 34,160,
-144,106, 13, 53, 69,189,108,255, 0, 28,237, 79,115,128,113,200,113, 63, 44,170,162,238, 71, 94,185, 28,226, 24, 6, 67,137,166,
-181,215,144,178,172,134, 82,110, 87,117, 91,221, 93,192, 92, 34,197, 74,109,209,212,166,159,113,180,208,135, 22,133,184, 3, 73,
-117, 53,162,189, 90, 77,182,215, 29,180, 90, 88,184, 20,196,156,122,106,124, 30, 28, 35,186,190,179, 77,123,182,124,109,217, 4,
-168,177,165, 59,247, 53,147,220, 26, 82,210,191,101,196, 91,234,218, 91, 0, 80,109,124,184,178,175, 85, 53, 34, 77,189,179, 18,
- 83,129, 3,180,230,106,218, 27,178,214,128,184,147,243, 85,167,107,150, 92,152,136, 67,126,197, 66,110, 76,116,163,199,219,254,
-162,184, 80,212,162,170,170,167,194, 67, 74,233,233, 93, 53,144,110,205,224, 68,226, 70,106, 87,173, 72, 9,233, 62,193, 83, 13,
-232, 35, 14,207,152,125, 20,230,182,242,100,233,247,203,140,169,115,139, 48, 30,187, 4,218,194,156, 10, 84,120,240,148,134, 98,
- 32,247, 5, 45,229, 40,154, 15,154, 62, 74,179,182, 54, 54, 6, 53,170, 88, 26, 79, 89, 42, 79,179,219, 75, 23,154,138,174,127,
- 71,233,164,120,114, 26,153, 6, 85,230,209, 40, 49, 13,153, 49,241,251,150,213, 4,181,247,108,181, 72, 15,165, 52, 80, 35,196,
-136,209,104,237,235,212,245, 4,131,171,231, 66,232, 97,108, 47, 10, 11,181,143,214, 0,103,254,236,105,231, 95, 0, 1, 29,158,
-191,209, 66, 99,185,213,210,254,213,149,171,147,226, 93,186,213, 54,231, 46, 68, 45,137, 75, 82,126,142,168, 73,108, 81, 33,180,
-169,194,162,218, 69, 42, 18, 13,105,168,167,110,100, 78,112, 24, 23, 1,143, 71,233,224,189,102,163,178,255, 0, 81, 0,244,208,
-147,115,168,247,135, 49,235,155, 76, 66,143,105,199,161,200, 75,112, 34,165, 11,118, 81,149, 85,185, 77,221,129, 68, 16,106,123,
- 43,235,212,193,103,240, 80,201, 3,151, 92,142, 14,212,114,195, 46,218,119,227,199,116, 97, 68,177,124,238, 13,213,115, 99,176,
-219,232,183,184,171,130,231, 49, 20, 37,137,211,152,182,130,143, 13,183,254,112,223, 32, 37, 64,164, 0,144,160,161, 85, 10,138,
-201,246,167,147,168,145,134, 75,146,230, 9, 31, 44, 71, 69, 25,220, 88,218, 87,153,201,239,194,196,239,201,180, 57, 26, 37,238,
-225, 58,202,101, 63, 17,177,224,218, 45,171, 66,252, 24,241,168, 70,193, 26, 38,212, 71, 64,249,181, 83,159, 61, 85, 17,134,211,
- 27,230,140,188,234, 29,236, 14,101, 51,113,237, 57,250, 6, 66,144,237,223, 67, 73,111,162,147,239,183,230, 95,180, 54,234,100,
- 36,183,102,184, 90, 46,119,103, 67,117,126,108,219,123,177,154, 68,116,146,163,236, 53, 66, 84,158,206,162,163,175, 71, 33,181,
-124,108,115,193,239, 63, 80,104,224, 3,147, 30,223,170,163, 63,113, 15, 32, 84,127,150,223, 83,144, 70,201,221,240,211, 37,119,
-204,130,210,245,165,162,208, 8, 68, 88,110, 23,149, 30,149, 52, 47, 60,182,135, 78,212,182,173, 89,109, 22,255, 0, 15,224,183,
- 32,192,229,235,193, 1,245, 47,174,144,251,241, 35,143, 95,205, 70, 45,153,116,121,146,154, 23, 71, 11,115, 39,219,237,169,140,
-219,125,166, 66,150,136,232, 80, 77,107, 86,155,121, 69, 62,178,163,167,188, 29, 1,197,188, 63,196,250,211, 26,104,222, 23, 52,
-175, 77, 9,153,226, 22, 11,138,102,204,129, 17,180,218,109, 55,149, 53,225, 14,187, 30,148,250,119, 54, 64, 81,169,241,118,162,
-135,182,135, 74,131,121,150, 41, 92,215, 59, 18,209,234, 68, 7,212, 9, 53, 8,161,113,119, 14, 20,132,254, 25,134,181,113,137,
- 31,193,118,116,232, 19, 97, 57, 37, 78, 43,127,132, 27, 71,138,224, 34,189,119, 41, 8,233,233, 62,154,233,231,239, 18,187,188,
-226,141, 63,165, 62,127,101, 48, 0, 10, 70, 84,209,201,120,209,171,140, 43, 21,193,150, 22,151, 97, 67, 98,124,196,238, 5, 79,
- 72,191, 74, 91,168, 33, 21, 21, 46,161,154,159, 66, 40,174,253, 73,135,152, 5,179,196, 45,235, 61,154, 80, 99,233, 52,235,116,
-198,213, 52,212,200,184,242,211,145, 92, 45,240, 94,134,195,150,184, 95,122, 46,123,173, 69, 87,141,247,211,236,190,252, 88, 41,
-146, 22,149, 54,133,132,178,183, 41,219,184, 16, 65, 78,180, 28,167,206,247, 92,191, 47,142, 36, 46, 99,152, 86, 39, 98,194, 10,
- 2,253, 63,230, 25, 3,212,133, 65, 74,121,215,140,108, 38, 16,208,186,135,127,136,195, 46,202,144, 44, 56, 2,109,246,152, 73,
-101,113,200,148,136,104, 50,149,185, 73,134,130,226,156,101, 14, 5, 45,100,168, 20,132,154,158,218,122,117,149,220,249,128, 93,
- 63, 81,105,110, 37,218, 87,138,144, 83, 1,128,197, 58,170, 20,172, 87, 2, 14, 11,245, 86,185, 6, 35, 10, 85,237,235, 52,106,
-188,155,101,154, 66, 25,122,148,109, 49, 25, 41,152,247, 93,223, 57,107,115,182,157, 67,116, 29,186, 84, 59,187,228,135,196,118,
- 1, 80, 15, 74,124,187,106, 41,143, 18,157,190,159,240,165, 21,113,212, 90, 53,121,153, 9, 46, 71, 99,107,142,173, 72, 9, 13,
- 59,118,247,185, 12,181, 78,210,165, 54,201,233,221, 78,189,186, 18,239, 5,160,198, 79,125,195, 87,177,173,249,200,246,209,178,
- 28, 17,112,202,153,217,111, 14,200,185,102, 18,238,214, 24,130, 60,104,240,230,221,152,157, 66,217,102,114,131, 33, 78, 36,131,
- 81,238,245, 64, 52,239, 87, 77, 73,179,223, 62, 18, 22, 55, 81, 80,229, 94, 61, 94,220,125, 84,251, 37,108, 77,160,111,220, 79,
- 50,219, 6, 59,235,142,191,124,200, 78, 48,167, 24, 82,106,239,133, 20, 38, 91,202,235,215,219,149,177,144, 63,132,233,193,204,
- 2,103,150,175,186, 10,158,212,255, 0, 26, 33, 56,203,128,167,109,199,142,238, 81,249, 10, 91,229,128, 27, 86, 64,197,202, 42,
- 84, 40,218,152,113,189,205,164,145, 80, 54,180,218,170, 79, 64, 59,117,158,219,183, 85,177,110,175,120,198,135,183,141, 34, 89,
-218,224,230,142, 43, 78,219, 13,181,167,238, 55, 88,247, 72,169,102, 53,234,230,212,246,101, 42,158, 24,131,140, 51,115, 45,198,
- 2,167,106, 86,252,230,130,136,236, 32, 10, 86,154, 63,136, 49,143,217,149, 33, 23,210, 26, 9,246,122,105,185, 30,177,128, 56,
- 82, 20, 44, 2,211, 46, 77,211, 36,188,161,182, 31,114,195,127,178,218,163, 38,137, 76, 56,150,216, 46, 9, 10, 77, 77,106,164,
- 68,113, 36,247,149,215,183, 78,217,111, 18, 91, 49,208, 52,169, 4, 41,237, 58,191,249, 15, 69, 57, 36,136, 16,113, 31, 77, 2,
-229,138,200,151,114, 87,156,113,201, 33,120,140,153,209,160,168,237,138,212, 71, 93,101,150, 91, 74,107, 66, 73,118,164,159, 71,
-193,168,247, 27,132,242,152,144, 99,226,247,143,251, 92, 79,213,233,166, 33,106, 55,163,235, 81, 79, 56,182,171,101,167, 12, 22,
-203,116, 20, 34,232,239,222,104,158,242,254,185,105,142,150,165,175,165,123, 12,166,169,240, 80,119,106,182, 75,185,159,118,255,
- 0, 17,202,192, 35, 65,192, 19,172,124,201, 65,200,230, 47, 95,213, 78, 28, 98,230,244, 8,176, 93,176, 74, 92, 59,165,166, 68,
-152,145,231, 48,178,204,168,238, 93, 74, 82, 22,218,210,160,166,212, 86, 74,234, 13, 65,161, 7, 78,204,215, 40,123,186, 99, 61,
-136, 75,189,134,144, 29,164,168,235,249,171,161, 92,153,231,242,205,146,218,178,116, 97, 60,119,116,196,115,107,174, 49, 5,238,
- 41,202, 45,230, 36, 55,184,243,147,185, 78,234, 47, 28,207,119,111,221,212, 20,132,229, 15,248,214,155,127,135,213, 48,153,142,
- 22,134,200, 40, 71, 67,186,230,214, 22, 76, 24,210,215,104, 86, 16,157,215,189, 93, 41,255, 0,113,192,127,164, 12,178,171, 95,
-230, 77,112, 40, 16,240,234, 39, 23, 31, 78, 67,170,164,158, 71,243,179,103,157, 7,146,165,113, 87, 31,207,227,251,229,163, 44,
-179,216, 56, 34,239, 11,221,163, 61,198,119, 30, 67,188, 53,155,114, 44,132,173,151, 10,222,251,235, 41,128,204,107, 97, 31, 87,
- 1, 78, 50,173,181, 9,213, 76,188,253, 21,202, 24, 24, 88,247, 71,174, 51,135,115, 83,153, 36,171,214, 92,129,157, 12, 80,105,
-185,183,118,141, 65,129, 8, 33, 58,148,171,189,163, 14,170,124,114,255, 0,155, 94, 27,185, 59,203, 56, 11,252,117,153, 96,248,
- 37,213,236,175, 26,227, 85, 98, 86,235, 85,214,102, 31,199, 89, 83,143, 95, 50, 43,114,154,145, 54, 27,107, 23, 78, 65,177,219,
-223, 97, 72,119,216,137, 50,226, 42, 86, 67,111,196,119, 56, 89,239,208, 73,108,198,190, 54,160, 12,210,133,204,105, 13,149,205,
-196,140,228, 12,236,105,127, 28, 11,147,110,172, 46, 61,210, 1, 24,101,128, 42, 79,173,192,122, 22,171,222, 33,230,143,137, 49,
- 11,126, 25,155,184,121, 70,126, 75, 3,129,120,211,129,239,248, 44,140,118,221, 27, 14,106, 46, 7,145,219, 47, 47, 93,205,192,
-100, 46,191, 49,216,238, 66,150,171,124, 53,219,217,255, 0, 89, 40,121, 79,160, 54, 91,118,206,195,127,130, 29, 5,186,202, 70,
-214, 22,160,210,141, 32,234, 7, 81, 37, 16,105, 26, 70, 56,174, 8, 91,110,228,214,244,146, 26, 1, 8, 19, 53, 37, 87, 30,172,
- 7,109, 91,174, 58,243, 47,198,209,241,140, 67,204, 28,187,131,246, 73, 88,118,105,196,217, 38, 77,103,185,223,177,235,164,254,
- 67,195, 56,219,152, 21,150, 68,177,216,109, 86,252,238,108,187, 93,234, 61,150, 98,100, 72, 84,235, 43, 72, 33,137, 1, 79, 53,
-239, 40,118, 93,249,223,225,138, 38, 93,149, 86,190, 50, 91,221, 37,205,100,250,131, 90, 4,152, 56, 3,168,171, 64, 64,113, 10,
- 53, 76, 23,204,106, 61, 81, 8, 60, 49, 1,234,128,106,205, 58, 71,167, 28,105,197,147,204, 23,151,140, 23,128,238,254, 94,177,
-124,199,155, 77,146,205,112,185,114, 20, 62,121,184,226, 54,139,223, 33,196,204,114, 75,222, 63, 41, 86, 24,214, 41, 57, 74,224,
-166,219, 29,171,100,135,146,243,119, 68,148,201,145, 33,105, 96,133, 41, 78, 80,221,111,144,238, 86,223,203,238,154,247,177,224,
-227,160, 14, 45,238,232, 18,123,168,213, 7, 89, 58,156, 84,112,168,142,221, 34, 45,240,187,200,120,166, 60, 48, 69,203,211,153,
-202,157, 94, 99, 60,248,113, 63, 33,115,207, 3,243, 37,181,206,108,198,223,226,126, 87,151, 38,203,198,240,240,251, 45,246,211,
-156, 96, 35, 51, 70, 89, 50,229, 42, 81,203,109,141,217,231, 59, 1,213,199,118, 50, 99,203, 67,178, 24,105,192,242, 80,186, 71,
-179,134,254,199,112,159,226,228, 50,177,145,144,237, 40, 59,192, 74,231,140,157,129, 37,195, 80, 66, 14,145,222,199, 0,221,206,
- 57, 94, 37, 87, 0, 14, 72, 49,239, 19,211,129, 43,142,121,103, 65,102, 94, 98,184,251,153,113, 53,219, 50,123,183, 42,112,150,
- 89,156,229,252, 96,130,190, 32,194, 45, 87,252, 63, 31, 99,203,239,223,126,224,229,162, 29,199, 41,180,201,181,153,176,175,145,
- 82,235, 41,144,230,201, 81, 29,150,151, 20,185, 42, 13,214, 77,204,182, 19, 54, 64,232,222,199, 63, 71,184, 20, 0,194,253, 41,
-251, 70,166, 14, 11,195, 82,187, 18,228, 13, 63,118,138,102, 59, 86,160,112,200,116, 42, 38, 35,135,183, 26,148,173,222,112,120,
-174, 95, 32,158,108,203, 49,206, 76,198,242,204, 71, 25,243, 21,131, 68,194,241,155, 29,163, 32,179, 57,100,229, 44,211, 60,204,
- 97, 92,228, 93,229, 94,237, 15,182,244, 88,217,202,217,154,210, 45,219, 93, 83, 41,125,181, 39,113, 97, 17, 29,205,214, 87, 91,
-156, 87, 18, 54, 86,150,199, 35, 3, 67, 90, 90,124, 71,186, 77, 69,250,129, 81,171, 73, 26, 51, 4,175,121, 42, 67,119,136,100,
-211, 33, 4, 20, 56, 4, 57,147,197, 71, 79, 69, 85,151,124,208, 99,215,110, 2,243, 27,132,202,123,144, 63,188,220,141,151,121,
-142,188,217,175,115, 81, 13,118,200,246, 94,108,203, 56, 23, 51,135, 10, 76,143,189, 85, 45,181, 67,183,113,133,246, 52,198,218,
-105,104, 15,201,103,105,113, 46, 72, 91, 50,238,249,166, 15,134,146, 29, 47, 47,148,201,167, 47,117,207,128,227,142, 72,199, 46,
-126,243,115, 82,140,191,112, 97,141,205, 66,164,185, 61, 37,135, 30,221, 39,214, 58,210,119, 62,104, 56,139, 42,198,249, 39,148,
- 57, 88,102,118,215, 39,230, 83, 48,222, 14,184, 99,114,236, 23,174,111,181,226, 92,235,142, 64,179,114,116,167, 44,110,222, 83,
- 70,146,197,137,182,109,234,151, 37,166,212,237,210, 66,219,115,127,142,131, 97,117,184, 91,220, 67, 35,229, 46,110,167, 22,176,
-141, 37,224, 72,208,217,157,165,120, 6,144, 20,162,189,199,166,158, 23,209,189,165,206,226,228, 25, 42, 17,222,193,114,195,219,
- 77,206, 30,243, 99,199, 28, 35,200, 28, 53,145,223, 71, 42, 93,115, 30, 40,226,204, 95,133,238,124,119, 96,199,237,206,241,181,
-254, 53,202,250,237,226,227,124,141, 61,251,252,121, 5,245,166,122,159,102, 2,173,161, 11,184,161,169, 38, 98, 16,173,173,195,
-131,152,109, 44, 31, 12,242,234, 72,226, 32,181, 6,157, 33,225,218,151, 82,168, 24,134,233,247,194,234, 20,139,125,197,145, 22,
-187, 21, 29,212,225,154,174,125, 28, 19, 62, 52,227,242,219,156, 66,186,240, 55, 51,221,178,188,171,238, 59,244,110, 72,243, 95,
-153, 97, 60,131,151,223,237, 47,217, 45,139,230,124, 29, 56,246, 64,114, 11,115,185,165,162,245,117, 93,192, 71,140,205,188, 53,
-110,150, 4,165,175,195, 68,181, 45,232,171,151,181,238, 81,220,219,147, 35,180,185,100,120, 46, 45, 64, 37,141, 8,115,124, 64,
-226, 72, 64, 17,174,239, 42,106,197,180, 34,187, 99,218, 84,227,222, 32,146, 62,211,113, 81,168, 18,188, 48, 56,244,226, 43,156,
- 13, 96, 8, 66,167, 60,167,158,240, 36, 98,246,169,172,171,198, 59,253,206, 27,147, 25,112,127,165,224, 62,133, 83, 92,176,238,
-131,194, 14,255, 0,247,139,125,160, 85, 33,159, 0, 23,129, 63, 49,170,169,140,127,130,215,246, 47,241,148, 30,223,170,249,195,
-235, 63,135, 91,203,143,252,230,103,251,191, 70,116, 82,123,195,178,145,185, 63,252,107, 51,234,255, 0,150,185,246,159,182,126,
- 94,143, 86,174, 97,203,143,189, 69, 7,187,254,234, 78,198,191,144,220,126,205,245,147,126,175,237,191, 82,223,230,253, 85,211,
-208,126,245,249,251,191, 79, 10,118, 79,123,209,244,211,106,103,242, 70,254,111,219, 79,217,254,163,177, 63, 89,255, 0, 71, 81,
-229,253,236,127,238,207, 60,184,117,253, 20,244, 25, 59,176, 82, 29,143,249,172,238,207,228, 78,255, 0,161,243,127,234,253,127,
-174,154,157,121,251,131,250,195,231,227,244,210,227,203,211, 77,107, 79,217,187,190,166,227,245, 31, 63,234,155,249,159,197,250,
-171,167, 99,253,235, 51,247,199,211,236,164, 59,247,135,229,198,155, 48, 62,196,223,216,126,204, 62,163,253, 23, 63, 35,235,213,
-164,249,113,247,143,209,236,163,155,222,227,157, 31,107,237,202,249,255, 0,203, 45, 93,159, 87,216,215,230,244,250,181, 16,253,
-143,214, 63, 49,166,155,145,237, 52,157, 23,237, 13,125,151,234,110, 95, 59,253, 35,243,189,126,141, 57, 55, 28,248, 81,143, 78,
- 98,144,239, 63,205, 44,223, 98,251, 60, 79,169,236,237, 79,215,250,255, 0, 86,167, 12,184,240,169, 17,123,174,206,140, 15,241,
- 99,191, 85,246,120,191, 55,234,190,177, 31, 55,248,127,119,213,164, 93,126,232,231,145,250,114,162, 31,187, 29,180,246, 87,243,
- 4,125, 87,243,155,207,111,213,253, 83,125,190,191,215, 77, 49,203,222,228,127,168,223,152,210,101,227,232,166,198, 47,219,103,
-236,255, 0, 21, 47,183,255, 0,160, 29,159,171, 86,243,228, 59,105, 82,113,236,166,123,127,205,103,246,255, 0, 53,127,235,190,
-119,206,111,242,248, 41,163,147,135,235, 31,154,164, 59,221, 29,148, 97,255, 0,230, 49,126,111,242,200,159, 85,243,254,115,191,
- 87,249,118,233,177,149, 33,153, 30,223,170,156,127,255, 0,175, 53,217,246,187,159,206,249,255, 0, 90,126,127,241,105,153,242,
-244, 81, 59,247,158,170,150,167,127,135,172,255, 0, 83,246,219,223,217,126,111,212, 53,249,255, 0,115,213, 93, 51, 15,238,153,
-158, 85, 0,123,199,209, 80,235, 63, 62,205,217,246,251,135,111,206,253,142,223,226,244,122,180,236,153,122, 42,209,217, 59,176,
- 83,238, 55,242, 43,127,212,253,130, 71,250, 95,110,127,231,255, 0, 31,167,215,168, 82,126,241,190,159,154,163,253,163,219,244,
- 10,102, 98,191, 58,231,245, 31,109,255, 0,173,251,111,236,252,207,215,167, 47, 56,126,181, 73,184,200,118, 82,155,223,111, 87,
-214,127, 36,119,230,124,254,200,255, 0,159,247,189, 90,141,105,251,191,247, 59,231, 52,163, 79,196,125,180,127, 49,255, 0, 11,
- 90, 62,175,179,230,167,255, 0, 55,211,235,211,119,249,179, 44,248,250,114,168, 71,143,105,169, 48,127, 40,195, 62,207,245,151,
-111,159,243,254,190, 55,111,241,254,247,171, 85,211,253,175,163,179,229,233,164, 59, 35,159,200, 83, 11, 35,250,155,175,242,174,
-219, 79,213,125,127,106,254,179,248,180,184,242, 29,166,166,219,251,205,247,184,212,144, 62,211, 63,237,159, 99,188,253,159,183,
-230, 53,249,191,232,237,213,109,247,254, 44,121,123,205,249,248,245,212,136,179, 25,211,157, 63,202,154,254,101,246,143,255, 0,
- 93,243,213,217,255, 0,121,251,191, 30,170, 96,253,244,190,238,109,249,135,178,165, 51, 33,217,244,212,131,128,255, 0,242,185,
-207,174,254,105, 27,253, 15,169,155,245,255, 0,197,255, 0, 74,186,141,185,254,253,249,228,207,156,229,213,211, 71, 46, 99,183,
-232,162, 22, 63,229,206,125,167,249, 94, 79,252,183,231,125, 81,250,207, 95,167,213,183, 77, 93,123,255, 0,238,103,253, 84,196,
-126,255, 0,163,232,164,184,223,225,119,126,103,217,174, 31, 85,255, 0,240,238,253, 71,240,254,239,199,167, 36,253,243,115,205,
-191, 61, 31, 17,217, 73,248,103,219, 32,127, 49,255, 0, 4,229, 31,203,251, 62,107,189,159,197,251,254,173, 72,147, 39,229,239,
- 12,254, 94,170,105,217,158,223,163,228,148, 70, 23,205,200,127,154,255, 0,138, 45,125,159,103,251, 60, 62,223,250, 30,173, 70,
- 62,252,121,123,167,183, 51,242, 61,105, 77,125,150,246, 83,202, 87,248, 54,247,246,174,219,247,111,215,125,186,213,243,255, 0,
-143,247,189, 90, 97,222,244,125,163,179,221,119,179,163,173, 40, 71,251,211, 73, 78,125,153,175,173,251,117,135,230,253, 95,217,
- 39,125, 87,253,239,163, 82,225,200,252,186, 61,148,136,114,244,210, 13,175,252,123,140,124,239,153,106,251, 71,212,253,182, 63,
-229,240, 83, 68,239,252,119,124,184, 83,199,220,119,111,209, 86, 23, 30,255, 0, 12,223,126,163,255, 0,155, 48,254,209,243, 63,
-251,119,218,127,232,127,222,109,214,107,120,255, 0,200, 31,253, 47,203, 60,134, 93,125, 29, 75, 78,143,116,250, 62, 93,148,210,
-198, 62,213,153,125,151,235,220,251, 95,243,111,170,153,243,127,233,122,246,105, 91,191,238,225,207,223,110, 89,102,223,103,233,
-168,252, 41,111, 38,254,105, 47,237, 63, 84,143,177,253,135,249,108, 47,169,255, 0,234,191,238,233,169, 27,103,251, 56,123,222,
-247,188,125,238,175,165,106, 4,156, 61,239, 77, 71,182,111,240,197,239,249,183,248,226,193,246,223,173,251, 51,159, 93,252, 94,
-143,251,189, 91,223,126,253,159,186,253,203,189,222,209,151, 87,211, 73,245,231, 78, 6,126,193,106,249,221,182,127,155,246, 95,
-180, 68,250,207,227,253,239, 86,168,167,204,255, 0,187,183, 39, 84,216,179,227,157, 28,137,254, 38,201, 62,103,248,118, 47,206,
-250,207,179, 35,183,248, 63,237,125, 91,245, 60,126,225,189,167,231,249,233,161,147,187,106, 64,187,255, 0,132,255, 0,251,111,
-248,204,252,255, 0,157,246, 57,191, 91,255, 0,212,255, 0, 13, 53, 75,117,255, 0,154,255, 0,254,184,255, 0,235,225,213,211,
-215, 75, 62,224,165,123, 15,216, 37,125,103,248, 87, 39,251,103,205,236,253,175, 95,167,248,182,104,174,253,211,255, 0,216,220,
-187, 91,242,236, 90,134,114, 30,159,166,136,103,191,227, 92,123,237, 63,205,109, 61,191,203,126,190, 79,205,254, 31,251, 63, 94,
-150,207,114,111,212, 61,190,232,249,122,168,155,145,249,116, 82,133,179,237,153,175,206,255, 0, 11, 69,254, 97,246,158,214,254,
-171,248,191,123,248,107,166, 31,238, 69,250,220, 50,255, 0, 10,100,102, 61, 52,203,189,124,245,118,125, 92,223,178,118,253,161,
-175,153,252, 63,246,190,189,154,177,176,253,217,244,118,240,207,232,167,248, 83, 82,243,246, 72,255, 0,105,254, 75,200, 93,189,
-159,108,157,243,191,139,254,211,248,107,164,217,254,246,111,215,111,253, 12,249, 10,124,230,222,193,243,210,107,159,107,185,125,
-159,252, 21,107,250,206,207,181, 68,249,223,247,127,175, 83,143,187,254,255, 0,160,123,105, 28, 6,121,211,157, 95,111,111,235,
-126,117,251,224,249,206,125,102,160, 31,223, 77,217, 31,204,126, 93,180,137, 63,116,223, 79,209, 90,226, 95,104,191,252,207,241,
- 22, 63,243,254,175,176,252,207,225,255, 0,180,248,180,245,239,184, 51,247, 79,207,242, 79, 77, 71,251, 34,178,203,246,188,119,
-235, 62,177, 31,106,237,251,106,190,119,175,247,254, 61, 51,115,155,187, 15,205, 65,156,123, 69, 89, 54,127,147,207,251, 55,255,
- 0, 49,177,239,254,151,234,209,249,253, 30,186,235, 35, 7,239,162,207,255, 0, 29,221,153,183,229,217, 80, 63,205,219,255, 0,
- 42,115,242,143,242,105,159,103,251, 62, 53,245,191,110,254, 97,114,255, 0,205,255, 0,181,255, 0,201,213, 23, 46,127,255, 0,
- 69,222,246,114,246,123,144,252,135,166,172,174,125,200,255, 0, 85,191,252,234,166,228,191, 83,156,124,239,241, 52, 95,179,252,
-207,173,147,243, 63,135,245,215, 93, 67, 98,253,204, 95,253, 67, 60,242, 25,253, 52, 67,222, 53, 31, 91,191,148,175,237,127,107,
-143,245, 29,159, 49,254,223,227,253, 90,153, 31,188, 61, 57,211,111,247,253, 31, 85, 21,119,249, 12,111,175,249,145,123,126,171,
-235,100,125,119,241,126,189, 78,147,247,199, 44,143,200, 81,125,186, 90,187,127,138,240, 95,157,252,191,254,183,179,181,127,155,
-247,180,150,254,229,253,159,252,169,159,176,106,195, 88,126,205,131,253,127,248,214,231,246,207,183,126,215,213,255, 0, 23,253,
-167,199,172,181,199,239,228,255, 0,235, 29,153,140,186,254,138, 99,236,191,179,232,164,216,255, 0,110,205,255, 0,153,255, 0,
-138, 34,127, 60,250,142,203,159,111,253,199,253,159,240,237,213,126,233,144,253, 73, 61,220,253,214,229,215, 82,160,247, 89,151,
- 14,206, 53, 17,217,255, 0,194, 19,190,179,237,255, 0,239, 31,177,125,145,239,159,252,127,246,159,195, 93,104, 63,254, 76,121,
-126,237,223, 59, 50,234,255, 0,244,211,135, 51,218, 43, 31,251, 25,249,223,204,112,175,179,127, 55,250,169, 31, 55,215,233,254,
- 61,154,155, 62,126,131,217,159,203,219, 81,190,215, 30, 63, 61, 59,115,127,254,106, 68,251,111,217,240, 31,171,250,143,170,111,
-183,213,232,245,236,213,125,215,238, 31,151,186,236,251, 71,178,157, 62,233,244,210,143,255, 0,242,187,103,215,255, 0,136,243,
-159,173,237,254,102,223,215,250,189, 31,197,166,174,127,124,127, 81,159, 33,242,202,162,203,239,143,213, 31, 53, 73,138,254, 80,
-207,218,127,193, 50,127,211,254, 94,207,230,214, 96,254,232,127,253,147,217,239,143,109, 3,239, 14,195,255, 0, 72,175,255,217,
-};
+255,216,255,224, 0, 16, 74, 70, 73,
+ 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0,255,225, 0, 22, 69,120,105,102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 0, 0,
+ 0, 0, 0,255,219, 0, 67, 0, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 4, 3, 2, 2, 2, 2, 5, 4, 4,
+ 3, 4, 6, 5, 6, 6, 6, 5, 6, 6, 6, 7, 9, 8, 6, 7, 9, 7, 6, 6, 8, 11, 8, 9, 10, 10, 10, 10, 10, 6, 8, 11,
+ 12, 11, 10, 12, 9, 10, 10, 10,255,219, 0, 67, 1, 2, 2, 2, 2, 2, 2, 5, 3, 3, 5, 10, 7, 6, 7, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,255,192, 0, 17, 8, 1, 26, 1,245, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1,
+255,196, 0, 30, 0, 0, 1, 4, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 6, 7, 2, 3, 8, 1, 9, 10,
+255,196, 0, 86, 16, 0, 1, 3, 2, 5, 1, 5, 4, 6, 6, 5, 8, 7, 6, 7, 1, 1, 2, 3, 4, 5, 17, 0, 6, 7, 18, 33,
+ 49, 8, 19, 34, 65, 81, 20, 97,113,129, 9, 21, 35, 50,145,161, 22, 66, 82, 98,177,211,130,148,193,209,240, 23, 24, 36, 51, 85,
+146,147,225, 67, 69, 83,114,162,178,241, 10, 52, 53, 99,115,131, 37, 68,100,116,132,163,210,194,255,196, 0, 28, 1, 0, 1, 5,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 4, 5, 6, 7, 8,255,196, 0, 63, 17, 0, 1, 3, 2, 4,
+ 3, 5, 6, 5, 4, 1, 4, 1, 5, 0, 0, 1, 2, 3, 17, 0, 4, 5, 18, 33, 49, 6, 65, 81, 19, 34, 97,113,145, 20,129,161,
+177,193,240, 7, 22, 50,209,225, 21, 35, 66,241, 82, 51, 67, 98,114,162, 37,130,146,178,194,255,218, 0, 12, 3, 1, 0, 2, 17,
+ 3, 17, 0, 63, 0,251,249,133,133,142,108,237, 57, 79,237,181, 43, 82, 28,115, 72,106,197,156,189,220, 32, 66, 76, 7,154, 66,
+130,172, 55,247,155,249, 42,221,123,117, 22,182, 50,177,140, 77,120, 77,167,108,150, 22,241,144, 50,182, 51, 43, 94,113, 35, 79,
+226,181,112,124, 49, 24,181,223, 96,167,219,100, 65, 57,156, 86, 84,242,210, 96,235,175,206,186, 34,174,170,144,165,201, 85, 21,
+ 13, 42, 88, 97,102, 42, 95, 36, 32,185, 99,180, 42,220,218,246,189,188,177,201,249, 7,183, 22,169,105,126,162,203,200, 61,169,
+232,202, 66, 61,160,129, 50, 60, 36,161,113, 1, 60, 89, 40, 0, 58,213,186, 40, 93, 95, 28, 85, 25,255, 0, 94,251, 94,105,157,
+ 96,229,236,221,171, 51, 25,156,145,119, 34,181, 49,151, 86,215,166,240,144,118,147,232,124,190, 88,102,246, 84,237, 87,218, 94,
+ 4,106,149, 90, 12,250,211, 13, 93, 81, 37, 77, 67,109,155, 30,187, 84, 64, 36, 30, 61, 69,241,228,152,207, 29, 95, 98, 87,136,
+ 70, 18,203,232,185,100,153,111, 40, 82, 84, 12, 72,113, 32,200,142, 71,151,153,145,235,184, 39, 1,216, 97,150, 75, 94, 46,245,
+186,237,158, 2, 28,206, 82,164,157, 96,182,162, 0, 51,204,115,242, 16,126,135,101,236,199, 66,205,116,120,249,131, 45, 85,152,
+157, 10, 82, 2,216,147, 25,192,164, 45, 39,204, 17,130, 24,249,229,167, 90,137,218, 19,177,110, 98,105,156,197,151, 37,183, 72,
+150,245,228, 82,230, 27,177, 34,221, 75,107, 23, 9, 93,188,199, 94, 46, 15, 24,237, 28,159,218, 11, 33,231,125, 30,153,173, 20,
+ 23, 94,122, 5, 58,156,252,169,241, 16,145,223,178,166, 91, 46, 56,209, 4,129,190,195,142,108,110, 57,177,190, 61, 7,133,248,
+177,142, 32, 38,217,214,203, 55, 73,253, 77,168, 16,124,196,193, 35,226, 61, 9,243,206, 41,225, 27,142, 29, 2,233,167, 3,214,
+170,253, 46,164,130, 60,149, 18, 1,248, 30, 92,192,158, 97, 98,159,236,109,219,107, 67,123,117,105,171,218,165,161, 85, 26,131,
+144,162,205, 49, 39,197,170, 64, 84,119,227, 62, 16,149,148, 40, 92,165, 92, 45, 60,164,169, 60,245,227, 19, 61,108,214,141, 57,
+236,243,166, 21,109, 99,213,170,233,166,101,234, 35, 41,118,167, 56, 71,113,238,233, 42, 90, 80, 14,198,193, 82,188, 74, 72,224,
+121,252,113,219, 46,218,229,187,159,103, 82, 8, 92,198, 88,214,122, 71, 90,225,219,188,181,118,219,218, 80,176, 91,137,205, 58,
+ 71, 89,233, 82,220, 44, 67,116, 43, 93,116,195,180,150,151, 83, 53,147, 71,115, 25,171,101,234,186, 92, 85, 62,113,142,227, 37,
+192,135, 20,218,188, 14, 37, 42, 77,148,133, 14, 64,189,189, 49, 50,192,150,133,180,178,133,136, 35, 66, 14,224,142, 70,140,219,
+141,186,216, 90, 12,164,137, 4,106, 8, 60,197, 44, 44, 44, 44, 70,167, 75, 11, 11, 20,142,134,118,251,236,253,218, 51, 95,243,
+175,103, 61, 46,155, 84,149, 91,200, 46,169,156,193, 38, 77, 60,179, 25, 47,161,245,178,182,155, 82,142,229,148,173, 10,185,218,
+ 18, 69,172, 77,240,102,237,223,117, 10, 90, 18, 72, 72,146,121, 1, 49,175,190,128,237,203, 12,184,134,214,160, 20,179, 9, 28,
+201, 2,116,247, 85,221,133,133,133,128,209,233, 97, 96, 46,126,207, 57, 87, 76, 50, 69, 99, 82, 51,213, 93,186,125, 22,131, 75,
+126,161, 86,156,234, 73, 75, 17,217,109, 78, 56,178, 18, 9, 54, 74, 73,176, 4,155,112, 13,241,243,173, 95, 79, 78,183,234,149,
+ 66,117,119,178,119,209,187,156,179,174, 80,167, 73, 83,106,174,185, 37,244,185, 35,109,137, 27, 35,198,121, 13,174,220,237, 11,
+113, 67,112,184, 29, 14,141,134, 19,127,137, 37, 74, 97, 50, 19,185, 36, 36, 9,216, 74,136, 19,225, 89,120,134, 51,135, 97,106,
+ 74,110, 23, 10, 84,192, 1, 74, 36, 13,204, 36, 19, 30, 53,244,187, 11, 28,193,244,122,125, 40,154, 57,244,129, 83,234,148, 90,
+ 30, 92,159,149,115,133, 2,198,187,148,170,238, 5,184,210, 9,219,222,180,224, 3,189,108, 47,192, 73, 74, 86,149, 11, 41, 2,
+233, 42,233,252, 86,187,180,185,177,124,178,250, 74, 84, 55, 6,173, 89,222,218,226, 22,233,126,221, 97, 72, 59, 17,247,167,145,
+214,150, 22, 22, 40, 14,217, 95, 72, 78,143,246, 54,204,217, 31, 78,243, 51, 14, 86, 51, 78,125,204, 81, 41,212,154, 12, 41, 41,
+ 67,140,199,122, 66, 89, 92,215,137, 7, 99, 72, 42,176,224,151, 20, 54,167,128,165, 33,173,237,159,187,116, 52,202,115, 40,242,
+ 30, 26,154,149,213,213,189,147, 37,215,212, 18,145,204,248,232, 61, 77, 95,248, 88,228,190,222,159, 73,158,109,236, 95,168,121,
+119, 36,101,126,199,249,207, 81,152,174,208,221,168, 59, 83,203, 72, 89,110, 34,146,239,118, 25, 94,214,151,226, 35,197,212,113,
+138, 50, 71,211,249,169, 16,226,187, 54,111,209,131,170,113,216,142,209,114, 68,135,251,196, 54,210, 0,185, 90,148,168,192, 37,
+ 32,117, 36,219, 26,150,188, 59,140, 94, 48,151,153,108, 20,171,110,242, 7,134,197, 64,214, 77,223, 19, 96,182, 47,169,151,220,
+ 33, 73,223,186,179,241, 9, 34,190,147,225, 99,152,254,141, 79,164, 82,111,210, 41,148,243, 62,123,133,160,245, 28,161, 71,160,
+ 85, 26,129, 14,124,234,171,114, 83, 81,120,183,189,208,141,136, 77,187,187,160, 30,191,124, 99,167, 49,155,121,103,113, 97,114,
+166, 31, 16,180,238, 36, 24,231,202, 69,106, 89, 94,219, 98, 54,169,185,183, 86,100, 43, 99, 4, 79, 46, 96, 26, 88, 88, 88, 88,
+173, 86,169, 97, 97, 97, 97, 82,165,133,133,133,133, 74,150, 22, 22, 22, 21, 42, 88, 88, 88, 88, 84,169, 97, 97, 97, 97, 82,165,
+133,133,133,133, 74,150, 22, 22, 22, 21, 42, 88, 88, 88, 88, 84,169, 97, 97, 97,149, 79, 48,208,104,138, 66,107, 21,168,113, 11,
+151, 45,137, 82, 82,222,224, 58,219,113, 23,194, 0,147,165, 42,123,133,129,145,115,118, 85,157,152, 36,101, 40, 89,154,158,245,
+ 86, 44,116, 63, 42,152,212,214,213, 33,150,149,247, 92, 83, 96,238, 74, 85,228,162, 44,124,176, 79, 10, 8,222,148,205, 44, 44,
+ 13,204,153,175, 43,228,248, 40,170,102,236,199, 79,165,198,114, 66, 24,110, 69, 70, 98, 24,109, 78,172,217, 13,133, 44,128, 84,
+163,192, 79, 83,130, 88, 80, 98,105, 82,194,195, 9,185,143, 47, 83, 37,166,159, 81,175, 66,143, 33, 64, 20, 48,252,164, 33,106,
+191, 2,192,155,158,111,135,248, 80,105, 82,194,194,195, 53,214,232,205, 86, 27,203,174, 85,163, 10,131,209, 87, 37,168, 42,125,
+ 61,242,217, 66,146,149,184, 16, 78,226,132,169,104, 5, 64, 88, 21,164, 30,163, 11, 90, 84,243, 11, 26,165, 74,141, 6, 58,229,
+205,144,134,154,109, 59,156,113,213, 4,165, 32,117, 36,158,152,219,133, 74,150, 22, 22, 22, 21, 42, 88, 88,136,234, 14,175,101,
+ 92,131, 72,147, 85,168, 84, 26,109,136,107, 40,157, 80,145,185, 17, 33, 88, 93, 74,121,219,109, 72, 72, 23, 35,175, 78,151,199,
+ 29,235, 55,210,169, 75, 85,106, 70, 72,208, 44,133,152,179,165, 84, 47,185, 98,187, 38,115,212,202,127,120, 78,213, 56,219, 44,
+148,186,227, 73, 55, 35,113, 4,132,253,238, 65, 39, 98,217,251,146, 67, 98, 98,160,183, 16,216,239, 26,239, 44, 44,112,195,191,
+ 73, 3, 52,218, 36, 74, 87,232,124,234,244,198, 33,182, 38, 85,217,206,143,180,195,238,236, 27,214,223,114,132,238, 69,250, 43,
+128,122,243,123,226,252,236,107,218,150,155,218,106,129, 90,145, 14,159, 46, 59,180, 89,141, 52,234, 36, 45, 46,160, 5,162,246,
+ 75,201, 0, 57,101, 37,105,228, 5, 13,188,222,247,193,158,195,239, 45,218,237, 22,152, 30, 98,160,139,134,150,172,169, 58,213,
+215,133,133,133,138, 84,106,211, 34, 75, 17, 24, 92,137, 79,161,182,219, 73, 82,220, 90,128, 74, 64,228,146, 79, 0, 99,148, 59,
+ 80,246,248, 13,187, 35, 78,116, 14, 79,125, 33, 69, 76,203,204, 13,167,112, 4,241,182, 56,231,113,253,254,159,179,251, 88,159,
+246,238,201, 90,211,158,244,246,159, 67,210,128,227,177, 23, 45, 98,187, 10, 59,193, 14, 62,139, 39,187,228,145,116, 2, 21,185,
+ 62,165, 62,152,142,118, 87,236, 67, 78,200,161,156,235,168,204,162, 85, 86,193, 76,180, 69,209, 31,220,155,245, 62,255, 0,195,
+223,231,252, 66,247, 20,226,216,153,194, 48,212, 22, 90,128, 86,249,232,121, 35,169,229,161,153,255, 0,136,212,250, 15, 14, 49,
+194,184, 70, 22, 49,140, 77, 97,231,100,132, 48, 15, 49,205,206,131,158,162, 35,254, 71, 65,201,218, 81,151,198,120,214,122, 69,
+ 3, 54,173,199, 76,218,176, 76,255, 0,105, 81, 43, 90,174, 74,130,137,230,228,139, 31,142, 56,255, 0,233,156,237,117,218, 45,
+222,217,121,159, 65,105,217,194,179,150, 50,158, 72,121,152, 20, 74, 13, 46, 99,145, 90,117, 29,203,107,246,165,132, 20,247,138,
+112,171,112, 81,224, 39,104, 22,177, 39,189,123, 89,233, 78, 99,208, 13,119,123, 49, 80,210,235, 16,170, 19,149, 82,161,206, 66,
+ 60, 40, 89, 86,245, 54, 15, 75,161, 71,167,236,145,235,129,218,219, 69,250, 63, 59,117,166, 6,100,237,127,164,213, 24, 89,186,
+159, 13, 17,149,152,242,243,171,109, 82, 91, 79, 68,168,182,160, 84, 46, 77,130,146,173,183, 32, 30,113,159,248, 49,197, 60, 57,
+248,119,142, 94,217, 99,201,202,230, 99, 10, 80, 27,105, 26,157, 58,145, 36, 72, 84,138,189,248,221,194, 92, 75,248,145,128, 89,
+ 94,240,250,179, 55,148, 18,132,147,227, 34, 4,158,128,192, 48, 81,173, 81,255, 0, 66,103,104,125, 96,237, 59,166, 26,159,217,
+167, 93,243, 29, 71, 50,229,218, 22, 94, 77, 87, 47,214, 42,239,169,247,105, 50, 70,240, 26, 75,203,186,182,171,110,240,146,120,
+ 8, 93,184, 81,199, 64,246, 85,207, 85, 42, 61, 3, 80,242, 87,126,179, 10,167,145, 42, 78,150,175,225, 14,183, 29, 96, 42,222,
+ 92, 40,252,108, 7,144,192, 24, 57,143,179,135,103,125, 40,168,104, 95, 99, 45, 51,122,131, 75,171,171,255, 0,198,235, 83,148,
+ 76,169,201,181,138, 73, 42, 82,136, 35,195,117, 30, 19,112, 0,185, 56,180,251, 17,246,120,172,231, 60,169,153,243, 28,227,236,
+109, 86,168, 82,169,116,231,221,104,157,161,214,212,130,237,184,184,185, 22, 23,231, 97,245, 24, 39, 16,113, 46, 17,198, 95,139,
+214,151,152, 18, 97,182,181, 90,192,128, 83, 16,102, 61,250,237, 42,210,135,195,124, 47,140,240, 79,224,221,221,150, 62,185,113,
+221, 16,130,100,133, 78,145, 58,244,208,234, 2,117,138,224, 15,161,235,177, 63,104,254,215,250, 57,152,153,200,253,175,115, 30,
+156,101, 90, 93,117, 65,186,126, 88,113, 72,114, 84,229, 50,217, 83,174,148, 56,217, 41, 74, 3, 96, 2, 77,252, 86,219,205,219,
+103,238,214, 93,170,180,243, 78,187, 69,253, 26, 93,165,245, 73,252,244,214, 95,162, 58,105, 25,130,107,138,117,246, 93,141, 50,
+ 49, 35,188, 85,214, 91,113,181, 95,106,201, 40, 80, 0, 30, 78, 58,103, 66,254,133,175,164, 15,177,221, 30,162,158,202,157,188,
+226,209, 36, 85,221,181, 86, 35,148, 43, 69,125, 41, 22, 67,129, 43, 46,237,112, 93, 67,117,175, 98, 57,227, 7,116,243,232, 18,
+204, 81,244,167, 83,164,106,158,189, 26,246,166,106, 76, 18,196,172,219, 58, 26,221, 68, 93,242, 27,144,242,182,169,123,220, 91,
+139, 64,220,178,160,120, 28, 14, 65,250,133,236,115, 7, 93,243,143,188,250, 22,217, 82, 74, 18, 16, 66,146, 66,129, 42, 39, 40,
+ 58,106, 78,164,158,156,171,229, 54, 56,127, 27, 70, 28,211, 12,176,182,221, 9, 88,113, 69,192, 82,164,148,144, 18, 6,114, 53,
+210, 52, 1, 61,121,215, 5, 39,183, 54,182,229,206,207, 90, 39,216,227, 35,231,236,203,149,114,154,233, 11,168,102,137,185, 45,
+ 10, 53, 90,129,122,165, 48, 22,219,218,164,149, 37, 13,160,109, 64, 32, 21,168,149, 95,106,109, 54,166,118,172,213,110,203, 90,
+205,148,117, 27,177,126,122,215,234,245, 37, 50, 66, 51,158, 92,212,202, 59,207, 70,148,214,228,220, 32, 2,164,157,200, 43,231,
+106, 84,130,148,144, 77,200, 29,131, 94,250, 3,107, 3, 69,180,221,122,125,174,168,203,218,171,166,173,186,212, 28,219, 22,158,
+174,226,123, 38, 91,210, 90, 74,218,222, 74, 20,218,158, 85,148, 9,184, 82,129, 4, 16, 5,131,160,125,130,254,145,182, 53,242,
+133,171,157,166,123,114,170,167, 78,160,180, 90, 25,115, 45, 82,219,141, 22,123, 68,130, 80,250, 10, 18,133, 2, 82,155,157,133,
+118, 72,218,164,245, 17,127, 30,192, 75,106, 83, 89, 72,254,230,100,171, 48,206, 73, 48, 99, 33,153,220, 18,161,150,167,111,195,
+188, 68, 29, 66, 93,206, 21,253,188,171, 78, 83,144, 36, 38, 68,151, 19, 25,117, 4, 4,144,174,186,215, 55,233, 94,170,125, 32,
+159, 72,135,109,157,102,236,177, 72,237,139, 91,202, 25, 18,129,153,106, 4,154, 92, 22, 27,154,196, 68, 78,117,166, 34,178,234,
+ 18,135, 16, 54,240,165, 21,155,132, 11,222,248,139,228, 14,210,157,170, 62,138,190,219, 58,165,217,235, 52,107,165,103, 82,168,
+ 20, 44,131, 46,175, 5,140,203, 49,215,146,167,211, 13, 18, 99, 47,106,214,162,217, 10, 86,197,236, 80, 10, 77,207, 22, 22,238,
+158,199, 31, 70,206,101,236,179,219, 63, 86, 59, 77,206,212,136,149,104, 90,145, 85,149, 50, 61, 49,138,114,153, 84, 16,244,199,
+ 36, 4, 21, 21,168, 46,193,123,110, 0,185, 23,247, 96, 22,175,253, 18,163, 88,190,144,170,215,107,172,227,158, 98, 76,202,217,
+143, 43,174,139, 86,202,102, 10,210,234,153, 92, 1, 17,100, 60, 23,199, 23, 80,240,220,113,233,140,177,141, 97, 30,210,235, 10,
+ 9,246,126,200, 64, 8, 2, 86, 2,103, 92,160,206,226, 73,138,214, 56, 22, 53,236,172,190,130,175,105, 14,153, 37,100,195,100,
+170, 52,204, 70, 88,202, 96, 9,174, 79,236, 51,217,199,183,247,210,107,144,170, 61,174, 51,127,210, 21,156,178,180,201,117,103,
+219,161, 64,162, 74,113, 49,153, 91, 74,181,212,211,110,161, 13,160, 43,194, 27, 74,111,180, 92,158,109,142,110,209, 30,211,253,
+160, 59, 20,213, 59, 77,234, 34,179, 11, 47,234, 91,149,198,168, 51,171,236,180,219,136,106,164,244,249, 66, 76,196,141,187, 15,
+ 45, 58, 83,225, 9,220,180,155,113,108,119, 14,157,125, 15,223, 72, 87,101, 41,117,124,129,216,239,183,218,168, 57, 22,175, 53,
+111, 46, 36,202, 86,249, 44, 5,120, 74,146, 44,164, 7,118,128, 55,160,162,251, 71, 75, 12, 57,208, 15,253,159,152,121, 39, 46,
+234,118,159,235, 62,179,171, 49,210,117, 6,158,210, 35, 78, 98, 7,117, 54, 4,166,158, 83,205, 74, 42, 90,214, 22,176,162, 47,
+192, 4, 21, 15,214, 56,211,254,183,131, 32,189,218,188,133,178,162,140,136, 74, 8, 33, 33, 96,144,123,160,108, 54, 36,204,114,
+172,163,128,227,142, 37,142,197,149,161,228, 5,231,113, 78, 2, 10,138, 8, 10, 29,226,119, 59,128, 34,121,242,225, 76,179,170,
+245,186,254,134,171, 82,229,118,132,237, 58,254,175, 63, 29,115, 32, 79,167,199,144,237, 33,111,110, 42,109,189,225,221,229, 4,
+ 88, 21,143, 82,118,216, 88,217,154,167,244,176,253, 35,245,253, 57,209, 26, 6, 88,212,122,158, 82,205,181,119,166,209, 43,170,
+149, 70,101,191,173,100, 34, 76,118,227,202, 90, 94,100,216,148, 60,144,173,160, 2, 66,143,184,116,133, 27,232,173,250, 74,180,
+127, 76,147,160,249, 83,233, 19,129, 69,211,170,122,193,102,107, 84,175,103,157, 17,158,243,126,196,190, 78,246,211,127, 32,232,
+ 22, 54,232,109,139, 63,181,135,209, 31,168,189,164, 51,134,139,103,151,245,253, 15, 78,210,230,154, 77, 82, 93, 94,150, 28,147,
+ 90, 90, 36,180,241,117, 74,109, 72, 74, 20,123,187,125,211,212,122, 97, 59,141, 96, 10,186, 73,119, 34,211, 43, 32,193, 48, 50,
+156,162, 11, 96, 65, 36,119,117,130, 1,158,116,153,192,120,137, 54,139, 12,246,141,175, 42, 1, 18,148,230, 57,129, 81, 4, 56,
+162, 72, 0,247,160,102, 4,136,229, 87,119,209,249,217,103, 83, 59, 53,104,213, 87, 41,107, 54,185,213,117, 22,167,153,107, 46,
+ 85,234, 21, 74,233, 82,148,133,189, 29,134,150,202, 66,214,179,221, 2,201, 80, 23, 3,198,120, 24,183, 50, 62,149,233,166,147,
+229, 86,114,182, 72,202,148,218, 37, 26,158,202,132,120, 80,163, 33,136,241,155,185, 81,218,148,128, 18, 57, 36,252, 79,174, 36,
+ 20,246, 23, 26, 11, 49,215,109,205,182, 18,109,235,143,159,223, 78, 7,109,188,209,149,242,221, 51,176, 7,103, 21, 57, 63, 81,
+117, 68, 34, 37, 73,170,122,238,236, 10,107,202,238,251,171,143,184,185, 7,114, 46,126,235, 73,113, 71,110,228, 43, 28, 21,163,
+ 23,152,230, 35,217,206,171, 50,163,176, 0,110,162, 4, 0, 0,159,149,122, 37,235,246, 92, 63,134,118,185,116, 64,132,141,212,
+ 73,217, 32,153, 36,168,199, 94,188,170,148,250, 40,163,183,175, 95, 75,174,184,118,166,211, 8,221,214, 75, 76,154,148,104,146,
+227, 39,107, 83, 12,169,168, 83, 42,244, 61,226, 35, 45,226, 58,130,164, 95,168,191,215, 76,115,207,209,191,216,187, 43,246, 40,
+236,229, 72,211, 42, 82, 16,245, 73, 72,246,170,253, 73, 40,177,155, 57,196,142,245,207, 80,145, 96,132,143, 36, 33, 62,119, 39,
+161, 20,118,221, 74,232, 48, 76,126,253,172, 67, 17, 43,103,244, 36, 4, 39,169, 74, 68, 2,124,247,161,240,230, 28,246, 27,133,
+165, 15,127,212, 81, 43, 84,108, 20,163, 36, 15, 45,170,154,237,207,219, 83, 75,123, 8,232, 60,253,101,212,121, 29,252,130, 76,
+108,187, 66,105,203, 61, 86,156, 82, 74, 25, 71, 93,169,224,169,107, 34,200, 74, 73,228,237, 73,248,183,173,186,119,218,114,169,
+218, 83, 67, 59, 98,246,176,171, 56, 51, 62,177,106, 27,115, 35, 80,150,201, 64,165, 64,141, 46,157,236,205, 37, 37, 68,182,157,
+146,108,150,143,137, 9, 74,119, 18,181, 44, 11, 23, 83,117,175,181,190,191,246,229,103,181, 55,105,223,163,151, 88, 51, 46, 94,
+203, 11, 82,114, 6,159, 55,150, 42, 17,226,211, 0, 88, 45,184,246,248,171, 14,185,225, 11, 93,146, 55,184, 19,127, 2, 18,222,
+ 7,253, 37, 29,186, 53, 79,180, 6,175,104, 54,101,205, 29,134,243,214,158,191,145,243, 44,137, 84,170, 78, 97,142,250, 94,204,
+ 46, 46, 77, 57,101,152,193,113,155, 37,105, 49,208,147,180, 47,153, 9,227,155, 30,235, 1,194,223,194,221, 67, 77,165, 42, 82,
+210,174,209,121,144, 99,184,114,161, 34,103,120, 42, 32,106, 99,144,175, 62,226, 44, 90,223, 23,101,199,157, 82,146,150,212,144,
+218, 50,172, 79,125, 57,156, 81,136,213, 50, 18,146,116, 19,166, 99, 95,114,104,236,184,138, 92,112, 92, 41,179, 73,184,183,187,
+ 28, 51,244,237,246,163,205,217, 7, 68,104, 93,142,244, 82,107,235,207,250,207, 83, 77, 34, 35, 80,213,103, 90,167,169,105, 67,
+199,129,113,222, 41, 73,106,255, 0,178, 92,244,199, 94,104, 22,166,213,117, 91, 67,178,246,168,230,220,139, 63, 40, 74,170, 82,
+ 91,151, 58,131, 90,186, 31,166,155, 93, 77,187,185, 40, 32,139,115,116,143,134, 62,117,246, 23, 47,253, 36,223, 75,142,127,237,
+209, 92,139,237, 25, 35, 74, 83,245, 46, 68, 75,151, 40, 91,254, 38,218,113, 60,218,251, 67,175,155,116, 83,168,199, 33,128,218,
+161,139,167,111, 46, 4,162,220,102, 35,145, 92,194, 19,167, 85,124, 1,174,215,136,174,214,253,163, 86, 86,198, 23,114,114,131,
+177, 8,137, 90,181,232,157, 58,201,174,244,236, 91,217,155, 44,118, 63,236,211,148,187, 62,101,134,208, 69, 10,152,145, 81,148,
+132,128,101,205, 88,222,251,198,221,119, 44,170,222,235, 15, 44, 90,248,199,104, 9,232, 46,122,156,101,140, 7,222,118,225,229,
+ 58,225,149, 40,146, 79,137,222,186, 59,118, 26,181, 97, 44,180, 33, 41, 0, 1,208, 13, 5, 44, 44, 44, 44, 10,141, 75, 11, 11,
+ 11, 10,149, 44, 44, 44, 44, 42, 84,176,176,176,176,169, 82,194,194,194,194,165, 75, 11, 11, 11, 10,149, 44, 44, 44, 44, 42, 84,
+176,176,176,176,169, 82,194,194,194,194,165, 75, 31, 60, 62,153,205, 43,175,234, 54,185,233, 99,173,229,138,172,138, 51, 25,107,
+ 50, 51, 81,170, 65,200,210, 43,205,196,113,216,201, 75, 1, 81,217,183,141, 78,109, 8, 89, 35,187, 81, 14,243,221,216,253, 15,
+194,197,220, 62,245, 88,125,208,121, 34, 72, 4,122,130, 60,122,244,161,186,216,117, 25,107,227,238, 78,161,246,247,211,124,150,
+154,230,157,105, 14,118,203, 85,100,233,246, 85,165,230, 85, 64,166, 72, 93, 65,154, 75, 50,102, 37,213,176, 75, 74, 90, 95, 40,
+ 76,103, 20,132, 37, 78, 50,151, 84, 45,225, 54,155,105,189, 79,233, 3,212,234,149, 95, 38, 86,245,227, 87, 97,209,105, 25, 18,
+191, 84,161, 86,160, 80,166, 65,122,116,152,229, 14, 68,142,227,179, 34, 33,201, 4,173,110, 32,168, 37, 11,112, 35,106,109,183,
+ 31, 83, 49, 92,246,132,237, 31,148,251, 55,210,233, 85,220,237, 69,168,200,131, 84,122,107, 9,147, 5, 9, 88,105,230, 41,242,
+103, 37,181, 2, 65, 42,117, 49, 92,109,176,144,110,226,146,158, 55, 99,100, 99,139,185, 89, 74, 88, 73, 81,219,159, 47, 16,118,
+141, 53,245,170,222,204, 16, 39, 49,138,249,181,157,243, 23,107,157,104,166,209, 97,107,212, 93, 95,151, 91,110,169,145,165, 80,
+168,145,242,180,132, 81, 29,138, 25,142,185,243, 36,236, 99,111,180, 9, 61,230,226,178,146,149, 18, 0, 32, 16,150,249,131, 87,
+254,149, 90, 51, 89,138,169, 84,205, 90,155, 19, 54, 20,212,145, 91,203,209,242,172,249, 17, 89,218,230,232,239, 66, 90, 98,251,
+ 51, 13,141,168, 66, 84,135, 23,222, 5,145, 97,186,231,181,167,253, 41,154, 25, 79,162, 73,204,174,100,252,204,228, 6, 41,162,
+ 75, 15, 51, 9, 11, 92,151, 67, 84,119, 93,138,134,194,247,151,155, 77,101,157,232, 34,233, 49,228,126,199, 47,164,125, 37,186,
+ 51, 79,174, 55, 77,169,229,122,243, 81, 38, 87, 91,167, 82, 42,168,105,167, 24,168, 55,245,156,234,123,210,219, 41, 89, 61,203,
+ 38,158,243,235, 85,174, 25, 82, 87,110,160, 91, 23,151, 97, 34,108,196,116,211,195, 65,167,188,141,231, 89,210,135,217,183, 63,
+245, 53,170,175, 47,246, 90,215, 23,117,139, 62,102, 71,115, 60,124,223, 92,129,167,121,126,101, 50,177,169, 25, 14, 45, 65,233,
+243,138,234,239,123, 44,103,143,114,212, 82,218,251,164, 29,169, 86,208,182,138,135,132,110,211,167,154,193,174, 57, 27, 87,178,
+ 46, 99, 21,173, 97,171,105,227, 77, 67, 78,164, 57,153,114,157, 69,247,216,173, 57, 76,171, 7, 88, 67, 62,204, 31, 45, 9, 34,
+ 14,224,202, 20,195,110,119, 65, 36,110, 80, 55, 70,102,237,115,156, 43, 20, 93, 25,206,218, 61,167, 47, 84,161,234,101,106, 91,
+ 95, 82,205,121,150,100,189, 17, 52,185,210,153,117, 14,169,192,219,119, 49,218,116,146, 85,118,201, 0, 21, 16, 49, 86, 80,126,
+151, 26, 15,214,153,137,117,205, 60,154,180,166,168,180,208,233, 14,191, 30, 27,177, 89,139, 74,167, 63, 57,151,158,117,222,237,
+233, 9,151, 48,180,218, 27,251,224,131,192, 27,141, 68, 27,251,148,168, 41,160,173, 34, 59,160,136,238,158, 90, 25, 4,142, 67,
+198, 34,136,123, 36, 17, 10,143,185,160,153, 63, 48,118,183,205, 57, 26,110,124,173,102,221, 70,137, 83,203,217,111, 38,205,163,
+192, 12,188,202, 37,203,147, 88,154,220,240,251, 37,191,244,130, 35, 54,200, 91,106,184, 66, 84, 9, 2,233, 86, 33,170,205, 26,
+234,156,213, 70,207,213,106, 94,168,212, 51,132,141, 59,157, 76,212, 9,242, 96,213,226,199,203,211, 94,204, 52,110,248, 69, 83,
+ 17,148,123,148, 52,211,138, 40,134, 10,150,202, 66,247, 39,113,115, 23,243,127, 73,246, 75, 94, 95,107, 61, 59,162, 89,169,188,
+185, 81,159, 87,166,229,250,138,223,136, 30,169, 79,130,231,119,220, 8,253,238,246,131,170,186, 80,183, 54,217, 73, 33, 65, 34,
+202, 32, 43,159, 73,205,107, 74,181, 23, 58,228,125,100,210, 7,163,207,163, 84,212,186,125, 18, 29, 94, 24,113,136, 45, 82,233,
+178, 93, 73,121,110,132, 74,146,227,147,174,211, 77,129,116,146,146, 65, 69,212, 70,205,238,117, 69,184,235, 18, 6,130, 18, 71,
+184,234,118,131,191, 67, 19,217,192,239,253,239, 84, 70,102,166,235,182,102,202, 89,151, 52,231,181,106, 13,114,106,180,203, 55,
+ 81, 50,154,228,101, 58,129,102,166,166,167,165,232,172, 73, 98, 67, 43,112,133, 50,181, 45, 41,148,119, 56, 24, 72, 81, 89, 73,
+ 6,192,207,153,195,181,187,136,117,140,171,153,245, 81,140,218,245,110,166,206,160,196,250,162, 66,105,212,168, 70,174,218, 32,
+ 46,156,181,178, 88,220, 88, 40,216,166, 20,230,246,187,229, 59,114,146, 69,251, 77,237,219, 69,174,233,229,103, 83,168, 90, 55,
+153, 94,164,195,205,127,163, 52, 7,156,145, 13,179, 94,170, 42,168, 41,173,178,202, 59,226,182,144,167,148,146, 86,242, 91,218,
+157,220,120,121,143,203,250, 74,104,176, 42,249,159, 44,202,236,247,155,149, 84,201, 49, 91,115, 53,198,143, 50,158,166,225, 60,
+236,199,225,176,194, 86,169, 9, 47, 41,215, 90,108,161, 72, 78,221,175,130,178,141,170, 2, 62,209,118,225,255, 0,160, 14, 82,
+121,167,195, 72,233,168,255, 0,238,143, 42,124,168, 3,245,111,231,247,252, 85,129,217, 86, 54,123,163, 61,168,217, 55, 56,214,
+107,245, 8, 84, 45, 69,122, 38, 88,155,152,223,113,231,221,167,170,155, 79,124, 89,231, 6,231,144, 31,122, 72, 11,185,182,210,
+155,248, 56,156,106,142,102,153,149,242,139,243, 41,144,102, 74,146,226,210,219, 81,233,205,119,146, 22,146,110,225,109, 36,139,
+168, 54, 22,161,115,107,129,240,192, 29, 16,214,249,154,181, 83,205, 89,102,189,167,211, 50,221,107, 39, 86, 24,167, 86, 41,242,
+167, 51, 37, 61,227,176,216,152,218,155,113,146, 82,164,150,164, 55,126,132, 27,143, 43,225,167,105, 44,224,238, 74,163,194,170,
+ 37,110,198, 68,132,189, 25,117, 36,169, 65, 17,183, 22,143, 36,112,146,160,146, 2,141,172, 46, 47,226,231, 1,228,173,203,152,
+ 80,130, 99,228, 53,211,174,245,109, 36, 37, 18, 40, 94,157,101,183, 53,119, 50,205,204,153,190,140,152,244, 74, 12,199,233,180,
+ 60,178,250, 2,210,215,131,107,175,188, 46, 82,227,174, 37,106, 23,241, 0,218,200, 4,151, 28, 56,152, 53,148,180,219, 72,178,
+218,160,100,172,131, 73,128, 36, 14,226, 52, 10,124, 6,218,246,149,145, 96,131, 96, 46, 58, 94,255, 0,158, 57,247, 74,117,173,
+188,173, 68,159,154,115, 21, 98,180,213, 62,189, 48,191, 66,167,210,139, 73, 91,236, 37, 59, 12,151, 84,232, 42, 72,112,164, 20,
+237,183, 30,166,248,213,159,123, 65, 26,237, 30, 67, 57, 8,212,104,245, 95,102, 90, 97,213,234,213,133, 73,241,145,109,182, 80,
+ 33, 27,134,228, 93, 36,125,242,126,240, 73, 5, 54,151, 38, 66, 71,119,225,231, 80,237, 27,220,239, 84, 79,104, 61, 18,236,203,
+ 74,213,106,139,116,156,169, 54,161, 37,183, 1,169, 53, 26,168, 26,167, 53, 51,146,234, 88,100, 54,124, 1, 70,220,109,228, 31,
+ 92, 93,127, 71, 86,163,228,220,173,154,166,232, 94, 89,202,113, 41, 12, 84, 24,114,164,203, 81, 22,226,128,117, 1, 41, 55,222,
+ 77,138,146, 20, 64, 22, 79,217, 40,128, 9, 81, 52, 29, 55, 78,245,143, 48,102,103,178,133, 23, 74,170,166,165, 21,206,238,115,
+ 47, 35,113, 97, 99,168,251, 61,215,231,205, 69, 34,222,124,227,174,251, 16,118, 92,173,232,204, 41,249,239, 81,152, 72,204,117,
+ 66, 91, 75, 94, 19,236,204, 3,211,194, 72, 23,176, 22,185,176, 72,185, 37, 74,198,197,249,183, 69,143,102,165, 73,129, 26,235,
+ 61,106,163, 33,106,123, 48, 17, 93, 9,133,133,133,142,102,180,107, 29,164,240,163,113,140,177, 65,255, 0,157, 46,162,255, 0,
+177,168,191,213,221,254,110, 49, 87,106, 77, 69,255, 0, 99,209,191,171, 59,252,220,116, 95,149,241, 94,131,214,176,127, 49,225,
+189, 79,165, 91,218,141,166,121, 47, 85,178,219,185, 83, 61, 80,218,155, 17,209,192, 88,241, 54,175,218, 66,135, 41, 87,188, 27,
+227,154,115,111,209,127, 76,126,114,158,201,154,140,252,104,234, 55, 75, 51, 98, 7, 74,125,219,130,147,253,184,155,158,212,186,
+141,215,234,122, 55,245,119,191,155,133,254,116,218,141,254,197,163,127, 87,123,249,184,194,197,255, 0, 12, 45,177,229, 5, 95,
+ 91,161,100,115,146, 12,116,148,144, 99,194,107,123, 7,252, 76,189,192, 18, 83, 97,112,180, 3,184,128, 83, 61, 97, 64,137,241,
+138,142,233,191,209,179,147,242,237, 69,186,150,119,204, 46, 85,187,165, 5, 6, 54,119,109,170,222,169, 4,147,240, 38,216,233,
+ 26, 14, 94,164,229,154, 91,116,138, 52, 36, 49, 29,164, 4,161, 13,166,195,143,134, 41, 17,218,155, 81,143,253, 77, 70,254,172,
+239,243,112,191,206,147, 81,127,216,180,111,234,206,255, 0, 55, 7,194,191, 14,134, 6,209,110,197,132, 54, 14,240,117, 62,100,
+201, 62,243, 85,241,111,196, 23,113,215,131,151,239,173,194, 54,145,160,242, 2, 0,247, 10,191,176,177, 64,255, 0,157, 38,163,
+255, 0,177,168,223,213,157,254,110, 23,249,210,234, 48,235, 71,163,127, 86,123,249,184,214,252,175,138,244, 79,173,100,254,100,
+195, 58,159, 74,191,176,177, 64, 30,212,218,143,254,199,163,127, 86,119,249,184, 95,231, 77,168,255, 0,236,106, 55,245,103,127,
+155,135,252,173,139,116, 30,180,191, 50, 97,157, 79,165, 95,248, 88,160,127,206,155, 81,191,216,212,111,234,206,255, 0, 55, 30,
+ 30,212,218,138, 63,234,106, 55,245,119,191,155,133,249, 91, 22,232, 61,105,126,100,195, 58,159, 74,243,181,166,153,246,161,205,
+ 90,145,148, 42, 26, 9,168, 83,169,153,126,172,177, 73,212, 22, 89,170, 22, 85, 2, 10, 36,181, 48, 78,136, 47,116,200, 90, 25,
+126, 9, 82, 46,171, 79,109,118,179, 23, 28,231, 63, 71,126,149, 26,173, 87, 57, 49, 83,212,156,222,203,179,107,177,144,217,166,
+ 84,162, 51, 18, 92, 37,230, 40, 78,151,160, 63,245,137,114, 33,102,150,137, 45,169,179, 18, 63,120,149,169, 39,190, 88, 10, 87,
+ 70,142,212,186,140,121, 52,106, 47,245,103,127,155,140,219,237, 57,168,142, 29,198,135, 69,248,251, 51,191,205,198,157,190, 25,
+142, 90,182, 16,150,219, 49, 27,193, 59,206,191, 1,228, 4,107,173,100, 92,221,224,215,110,169,106,113,193, 51,177, 32,106, 35,
+ 65,234,124,201,153, 6, 42,140,215, 77, 16,237,165, 83,204, 26,143,167,249, 10, 30,120,173,229,170,142, 82,136,214, 89,168,230,
+ 12,230,192, 67, 82,216,114,158,164, 51, 25, 38,106,203,225,125,212,133, 56,236,166, 88,116, 18,226, 75,178, 16,234, 82,141,218,
+193,145,190,146, 89,185,219, 63,175, 78,231,230,148, 59, 54,153,153,197, 22,160,214,105,134,213, 41,232,142,209,220,110,141, 18,
+ 12,114,234, 92,139, 61,169,229,133,174, 67,141,182,159, 11,135,190, 90, 86, 18,155,217,142,209,218,130,242,173,245, 37, 24,159,
+116,103,127,153,130,112,117,159, 84, 39,145,221,101,234, 79,196,199,119,249,152,129, 99, 22,183, 72,206,134,244, 17,175,144, 19,
+190,253,209,239,215,122,151,255, 0, 75,125, 71, 35,142,234,103, 79, 50, 96,105,183,120,248,198,147, 21, 12,236,247, 76,237, 91,
+163, 25, 83, 84, 25,205,116,140,193,157,125,134, 67, 51, 52,226,159, 92,204,145,222,151, 82, 38,143, 17, 79, 70,246,151, 92,251,
+ 36, 26,143,181, 32, 23,138,118,142, 83,224,217,127,153,153, 59,178,239,211, 93,146,123, 88,214,251,101, 74,236,177, 72,174,231,
+154,203,207,173,114,243, 5,118,151, 33,168,101,219, 38,204, 33, 51,211,176, 37,161,220,167,146, 18,221,210, 58,227,235,228, 13,
+ 65,213, 87,166, 33,153, 84, 74, 75,109,171,239, 45, 44, 56,109,255, 0,246, 96,219,217,174,190,202, 44,166, 32, 21, 91,254,193,
+ 86,255, 0,207,138,172, 98,215, 56, 82,156,254,219, 74, 46,128, 12,201,208, 8, 35, 69, 13,247, 87, 83, 86, 46,112, 43,108, 96,
+ 53,253,215, 81,217, 18, 83, 5, 35, 82,102,117, 73,253, 59, 39,160,174, 1,200, 90,245,255, 0,180, 41, 93,205, 48, 50,254,111,
+236,235,145, 40,148,169, 78, 22,101, 85,210,168, 43,246, 20,169, 36, 7,182,162,160,226,149,180,144,162, 3,106, 60, 31, 10,186,
+ 98,101,244, 60,228,127,164,243, 34,230,172,244,158,221,153,158,187, 54,147, 42, 67,102,142,198,100,175, 34,162,248,146, 22,178,
+235,140, 45, 43, 95,117, 28,167,104, 8, 4, 34,246,216,145,101, 19,212,245,237, 85,212, 74, 94,247, 34, 81,233, 14,161, 28,220,
+197,114,255, 0,147,152,143, 47,180,158,127, 96,146, 40,116,116,159,255, 0,108,239,243, 49,119, 45,246, 33,102,182,153,183,101,
+ 33,113, 37, 32,130, 32,206,132,147, 30, 62, 21, 85, 44, 89,225,247,173,186,245,203,234, 82, 38, 2,136, 32,200,141, 64, 2, 64,
+220,120,213,175, 63, 48,100,216,181,132,208,230, 76,130, 42, 14, 39,120,134,228,134,210,241, 71,237, 4, 41, 64,148,222,226,226,
+253, 14, 56,123,233,118,236,171,173,125,163,117,231,179,182,109,209, 13, 61, 21, 90,126, 72,205,146,165,230,169, 2,161, 26, 48,
+134,194,229, 83, 22,133, 89,247, 16, 93,186, 99,188,108,216, 81,240,244,241, 11,205,187, 71,178,199,104,186,116, 54,179,174, 86,
+166, 23,169,235, 38, 60,184,141,173,183,144, 15, 91, 44,172,216, 94,198,222,239,198,131,172, 84,117,235,179, 60,230,231,105,150,
+165, 84,157,136, 21,117,209,171,143,170,100, 55,147,251, 5, 46, 18, 82, 15,170, 10, 78, 49,187, 59,206, 28,189, 67,198, 51, 65,
+137, 4,164,200, 41, 58,131,208,252,171,169,102,194,203,139,172, 23,110,149,145,170,102, 32, 30,234,130,134,224,238, 71,206,187,
+ 59,183,140,126,208, 50,187, 21,102,204,165,217,135, 40,174,173,157,107,116,129, 75,165,199, 68,148, 51,236,232,127,236,221,123,
+114,184,240,182, 86, 71,190,216,140,253, 17,253,143, 43, 29,139, 59, 21,229,253, 49,207, 20,150, 98,102,170,140,135,234,185,173,
+182,150, 23,182, 83,170,176,111,120,251,219, 27, 75,105,248,131,136, 62,134,253, 36,211,115,212,117,101,201,240,163,210,115, 37,
+129, 85, 38,168,226,158,143, 32,139,220,198,123,114, 72, 38,227,236,220,189,172, 2, 72, 23, 38,204,167,246,182,207, 53, 56,254,
+213, 10,145, 71, 32, 40,165,105, 84,103,130,144,160,108, 82, 71,123,193, 24, 38, 30,221,253,254, 28,171, 6, 2, 64,204, 22,100,
+194,140, 8, 30, 5, 35,195,158,245, 75, 21,179, 99, 9,197,147,125,118, 21,152, 39, 32,210, 82, 36,201, 62, 10, 61,122,109, 93,
+ 16,163,199, 30, 88,247, 28,248,123, 84,234, 56,233, 70,162,255, 0, 87,123,249,184,201, 61,170,117, 29, 95,245, 45, 23,250,187,
+223,205,196,255, 0, 42, 98,253, 19,235, 85,255, 0, 51,225,115,185,244,174,129,194,197, 4,142,212, 90,140,175,189, 70,163,127,
+ 87,123,249,184, 59,150, 53,159, 85, 51, 27,110,212,220,129, 64,129, 76,138,146,169,181, 89,205,186,220,118, 18, 57, 36,168,187,
+107,129,229,128,191,195,184,133,179,101,110,148,128, 57,149, 81,152,199,172,110, 92, 13,180, 20, 73,228, 5, 92, 24, 88,229,236,
+247,244,181,246, 40,201, 21,165,101,101,234,115,217,146,160,209, 41,123,244, 86,150,185, 45, 21,143, 32,160, 74,127,241, 28, 54,
+163,253, 35,244,237, 70,157, 14, 30,147,233,157,113,182, 30,144, 16,236,188,195, 25, 40, 64, 4, 19,225, 75,110, 19,208, 18,110,
+ 69,135, 54, 61, 49,146,213,179,175, 56, 16,145,169, 48, 43,117,230,222, 97,146,235,137, 33, 32, 77,117, 86, 22, 40, 85,118,158,
+212, 52,159,254, 15, 71,255, 0,128,247,243,113,137,237, 69,168,160,243, 71,163, 31,255, 0,142,247,243,113,181,249, 91, 21,232,
+ 61,107,156, 60, 77,133,142,103,210,175,204, 44, 80,137,237, 67,168,157, 62,167,163,255, 0, 86,119,249,184,244,118,158,212, 77,
+215,250,154,143,207,255, 0,167,119,249,184, 95,149,241, 94,131,214,155,243, 70, 21,212,250, 85,245,133,138, 31,252,231,117, 15,
+206,145, 71,254,174,239,243,112,143,105,205, 65,255, 0, 99,209,255, 0,171,187,252,220, 47,202,248,175, 68,250,210,252,209,133,
+117, 62,149,124, 97, 98,136, 79,105,173, 67, 87, 31, 83,209,255, 0,171,187,252,204,101,254,114,250,128,122,209,168,255, 0,213,
+221,254,110, 27,242,198, 43,208,122,211,254,103,194,250,159, 74,189,112,177, 70,167,180,182,160, 30,180,138, 71,245,119,127,153,
+143, 71,105, 60,252,127,234,138, 71,252, 7,127,153,134,252,179,138,116, 30,180,191, 51,225,125, 79,165, 94, 56, 88,163,207,105,
+ 60,248, 79, 52,138, 79,252, 7,127,153,140,135,105, 12,247,229, 74,164,255, 0, 87,119,249,152,111,203, 88,167, 65,235, 75,243,
+ 62, 23,212,250, 85,221,133,138, 77, 61,163,115,201,235, 73,164,127, 87,119,249,152,244,118,140,207,127,236,186, 81,255, 0,236,
+ 59,252,204, 55,229,188, 79,160,245,167,252,205,133,245, 62,149,117,225, 98,148,255, 0, 56,140,243,254,202,165,127,192,119,249,
+152,247,252,226, 51,209,233, 76,165,255, 0,192,119,249,152, 95,151, 49, 62,131,214,151,230,108, 47,169,244,171,171, 17,109, 83,
+209,237, 63,214,138, 45, 63, 47,234, 61, 5, 53, 24,148,202,236, 58,188, 70, 86,226,146, 19, 42, 43,161,214, 86,108, 70,225,184,
+114,147,112,160, 72, 55, 7, 16, 17,218, 35, 60,249,210,169, 95,240, 29,254,102, 16,237, 13,158, 15,253, 85, 75,255, 0,128,239,
+243, 48,147,195,248,162, 20, 20,152, 4,120,210, 60, 73,133,168, 65, 39,210,138, 83,251, 27,118,116,166,203,165, 75,143,167,140,
+ 19, 70,205, 21, 76,193, 1,183, 94, 90,219, 68,234,130, 28, 68,149, 20, 19,181, 72, 41,116,132,160,141,168,218,141,160,109, 22,
+102,223, 97,206,205, 13,229,170, 30, 83,255, 0, 39,225,112,178,238, 79,168,229,154, 90, 92,154,234,148,221, 58,114, 82,153, 40,
+ 82,138,174,165, 40, 39,133,155,169, 59,214, 65, 27,141,245, 39,180, 14,120, 39,197, 76,165,127,192,115,249,152,216,141,125,206,
+134,231,234,202,103,201,151, 63,153,130,255, 0, 74,199, 7,249,255, 0,242,243,253,207,169,164, 49,252, 36,245,244,173,245,238,
+198,250, 49, 93,137, 72,134,149,230, 74,114,114,243,145,151, 65, 93, 27, 54, 77,134,186,111,115, 1, 84,244, 6, 20,203,169, 45,
+ 36,199, 82,144,164,164,128,189,196,170,228,155,140,166,118, 0,236,207,151, 22, 38,100,188,183, 88,203,243, 27,112, 22,106,121,
+127, 52,207,133, 49, 9,246, 56,241, 22,142,253,151,146,225, 75,141, 69, 96,172, 40,157,238, 54, 28, 55, 88,223,130, 9,215,124,
+228,174,180,218,105,255, 0,236,185,252,204,108, 78,184,103, 5, 11,154,101, 55,228,203,159,255, 0,188, 55,244,220,109, 2, 2,
+255, 0,249, 83,140,115, 11, 87, 95, 74,209, 43,176,231,102,233,217, 38, 46,158, 78,201,114, 95,164, 67,159, 85,153, 30, 51,245,
+153, 43, 82, 95,168,247,134, 75,157,225,115,188, 42, 37,197, 20,168,170,232, 54, 41, 32,128,112,214, 63, 96,253, 6,135, 83,147,
+152,225,203,206,108, 86,166,200,113,217,185,134, 62,160,213, 91,168,200, 14, 49, 29,135, 91, 92,148,200, 14,169,181, 34, 36,127,
+ 1, 85,146, 89, 65, 64, 78,209, 98,200,214,220,220,179,111,171,169,223,240,156,255, 0,253,225,253, 23, 84,115,109, 86, 90, 24,
+ 52,248, 1, 37, 86, 81, 75, 78,112, 63,223,192,151,103,140, 50,146,162,228, 13,127,203,222,125,106,195, 56,157,133,195,129, 8,
+ 4,147,225, 66,145,216,183, 64,209,149,166,228,145, 67,170,125, 85, 57,233, 50, 28,136, 51, 20,192, 17, 37,234,128,168,153, 40,
+ 80,119,114, 31, 68,148,133,161,208,119,162,214, 6,215, 4, 93, 75,176,198,138, 66,201,121,190,137,147,242,234, 77, 79, 55,208,
+ 62,174,170, 84, 51, 21, 74,108,225, 49,105,147, 34, 90, 30,144,175,104, 67,203,115,191,146,226,203,137,113, 43, 30, 16,149, 0,
+132,129,105, 43, 49, 76, 66, 65, 91,109,127,186,127,191, 26,142,105,158, 77,144,195, 71,228,175,239,198, 72,190,186, 79,253,195,
+188,239,207,173,109, 11, 34,173,146, 42, 11,217, 75,179,125, 99,179,221, 47, 51, 74,205,121,245,236,197, 91,205,149,241, 84,170,
+ 77,113,201, 43, 75,101, 17, 88,140,219,105, 92,167,223,121,118,109,132,146,165,184,121, 81, 9, 8, 72, 74, 69,161, 83,165,211,
+234,241, 21, 2,169, 1,169, 12,175,239, 52,242, 2,129,252,112,201,154,204,229,183,222, 56,134,135,193, 39,251,241,173, 89,146,
+ 66, 20, 91, 45,183,127,129,254,252, 9,219,149,188,225,113,103, 83, 78,155,101, 1,148, 87, 63,107,183,100,141, 65,123, 54, 26,
+222,143,174, 52,138,108,148, 11,210,165, 4,255, 0,160,168,117, 13,169, 78, 32,119,100,248,130,121, 32,147,110, 44, 0,157, 47,
+236, 85,168,149,156,216,196,237, 98, 44, 71,166, 68,112, 58,152,177, 84,143,180, 80,232, 60, 46, 44,223,247,137, 27,121,176,189,
+136,233,161, 94,152,161,184,182,221,173,208,164,255, 0,126, 49, 70, 97,154,226,251,180,180,215, 62,227,253,248,180, 49, 27,132,
+181,147,227,206,134,108,137, 84,209, 56,112,161,211,227,162, 36, 24,200,105,164, 32, 37, 8, 66,108, 0, 2,192,126, 0, 99,126,
+ 6,138,180,159, 52, 34,255, 0, 3,253,248, 70,170,248,253, 84, 19,240, 63,223,138, 57,197, 19,179, 85, 18,194,192,179, 85,152,
+ 15,133, 45,254, 7,251,240,176,179,166,151,100,186,229,193, 7,142,152, 94,195,234, 48,103,216,147,255, 0,103,143,125,132, 14,
+141,254, 88,245,223,105,175, 46,246,111, 10, 11,245,120, 62, 88, 95, 87, 15, 76, 27,246, 31,220,199,134, 8,243, 70, 23,180,210,
+246,111, 10, 10,105,224, 11, 91, 9, 48, 61,216, 48, 96, 36,155,219,242,199,158,194,144,122, 97,253,162,151,179, 80,159, 96,190,
+ 49, 84, 18, 60,176,100,195, 4, 90,216,243,216, 69,174, 83,132, 46, 41,123, 53, 6, 48,136,232, 48,132, 37, 19,131, 63, 87,164,
+244, 24,201, 52,212,158,191,195, 15,237, 49, 77,236,212, 29, 48, 21,110, 70, 23,213,202,193,191,171,147,123,243,143, 21, 79,183,
+ 79,225,134, 23, 52,189,154,131, 38,159,206, 55,179, 0, 94,214,193, 3, 79, 35, 15, 40,244,119, 38, 77, 67, 40, 70,235,158,152,
+139,151, 65, 40, 42, 39,106,146, 45,138,148, 0, 20, 67, 38,100,211, 61,196,190,227,126, 27,244,182, 44,120,148, 40,241,217, 67,
+105,104, 11, 14,160, 99, 26, 21, 25,186,116, 70,218, 74, 64, 32,114, 6, 10,112, 58,156,121,174, 43,139, 59,118,241,131,160,174,
+247, 13,195, 91,181,104, 72,212,211, 99, 28,180,158, 7, 76, 15,156,226,133,236,112,254,107,202,228, 36,241,129, 50,214,162, 72,
+190, 50,217, 10,113, 82,107, 96,169, 45,167,106, 99, 37,194, 82,164,132,131,127, 92, 66,115,101, 17, 74,120,184,204,123,115,206,
+212,226,106,234, 73, 87, 56,208,235, 40, 88, 33,104, 6,253,110, 49,210, 97,247,107,178,115, 48,212, 86, 21,253,170, 47, 81,148,
+232,106,173,118, 17, 4,164,167,228,113, 15,212,220,143, 7, 48, 81, 76, 39, 91, 64, 82, 46, 88, 36,115,111, 49,253,223, 28, 91,
+ 85,220,182,180, 41, 82, 88, 71, 23,228, 12, 71,235, 25, 90, 29,106, 10,233,245, 56,157,227, 46, 14, 69,200, 32,249, 16, 71, 32,
+143, 81,142,154,245, 22,216,221,129, 68,137,220, 30,135,239, 74,193,195,174, 46,240, 28, 68, 58,153,142,126, 34,184, 51, 84,114,
+204,204,165, 93, 53, 24,140, 45,151, 25,115,123, 74, 71, 80,160,110, 8, 62, 88,188, 52,119, 84,127, 72,218,161,231, 69,200, 40,
+ 21, 7, 5, 50,186,201,251,162, 70,223,178,118,222, 68,144, 19,127, 59,251,177, 36,213,221, 16,132,237, 57, 94,211,117,139,217,
+137, 75, 3,199,232,133,250, 43,208,244, 87,184,240,106,141, 56,202,210,232,245,154,158,155,173, 74,104, 85,153, 42,167,174,223,
+114, 75,126, 54,200,249,140,113, 12,173,252, 38,249, 57,196, 41, 7,212,115,143, 2, 43,212,111, 31,180,226, 76, 29, 80, 65,144,
+124,199,159,136,222,186,115,217,174,110, 6, 55, 53, 13, 74,253, 92, 51,200, 53,230,179,158, 83,131,152,155, 72, 75,143,178, 4,
+150,129,255, 0, 84,242,124, 46, 32,251,210,176,161,242,193,214,227, 16, 45,108,122,168,184, 75,136, 10, 73,144,107,194, 92,182,
+ 83,110,148, 40, 65, 26, 26,125,144, 50,172, 92,195,152,218,135, 82, 37, 49, 26, 66,159,152,161,228,210, 19,185, 95,141,128,249,
+227,231,239,111,190,213, 58,147,218,227, 90,157,208, 93, 62,174, 61, 7, 36, 81,164,152,233,166,211,157, 45,176,250,146,108,165,
+184, 19,247,192, 60, 11,241,197,241,218,221,167,117,113, 61,155,123, 35,230,189, 74, 66,131,117, 90,218, 5, 27, 47,243,101, 23,
+ 28, 7,122,199,184, 14,127,161,142, 15,236,167,165,115, 32,211, 14,111,168, 71, 87,180, 79, 81, 86,245, 39,144, 15,191, 30,127,
+196, 55,234,114,240,235,162, 52, 3,150,109,201,247,109, 94,179,192,248,107, 54,214, 70,229,105,239, 43,229,252,212,251, 64,251,
+ 54,100,156,152,152,172, 53, 69,109,231,200, 78,247, 86,144, 74,143,153,231, 29, 67,166,116,136,238, 64, 85, 74, 60, 52, 34, 58,
+ 20, 90,133,181,187, 93, 35,239, 44,122,220,254, 67,223,138,251, 38,210,102,213, 43,144,178,205, 46,153, 34, 82, 28,121,180,213,
+220,142,146, 19, 26, 61,193, 88, 83,157, 16,165, 38,224, 11,238,230,224, 98,249,106,156,212,118, 83, 30, 51, 41,109,180, 36, 37,
+ 13,161, 54, 9, 3,160, 3,211, 15,195, 22,110, 45,227,118,247, 47,211, 61,122,251,170,175, 27, 99, 1,214,197,163, 71,125,252,
+ 7, 79,125, 14, 84, 75,240, 83,140, 12, 37, 95,129,130,222,200, 73,231, 25, 8, 32,249, 99,186,237,226,188,180,177, 38,132, 8,
+106,244,252,177,154, 97, 19,250,159,150, 11, 38, 9,243, 24,244,194,255, 0, 22,195, 23,230,155,217,207, 74, 20,152, 74,253,156,
+102, 33,171,211, 4,196, 51,211, 25, 8,132,117, 24,137,126,144, 98,134, 38, 33, 30, 88,247,217, 13,250, 96,159,178,171,254, 88,
+240, 70, 87,248, 56,143,109, 79,216, 26, 26,152,182,234,156,101,236,195,201, 56, 37,236,167, 8, 69,244,195,118,212,187, 3, 67,
+189,152,121, 12, 33, 27,158,152, 36, 34, 31, 76, 47,101, 32,116,194,237,105,187, 10, 96,136,214,235,141,169,140, 15, 4, 97,226,
+ 35,144,108, 19,141,137,142,171,223,167,199, 16, 46,212,131, 2,153, 38, 39, 31,119,242,198, 73,137,232,140, 62, 76,110, 47,140,
+132,123, 96,101,218,152, 98,153, 38, 37,197,136,198, 66, 31,157,176,249, 49,239,229,141,137,140, 61, 49, 18,245, 76, 48, 41,130,
+ 98, 31, 76,109, 68, 80, 58,140, 62, 68, 96, 79, 9,198,212, 68,244, 78, 4,167,141, 77, 54,244,197, 17,237,209, 63,150, 54,161,
+131,233,135,169,138, 78, 54, 38, 37,240, 34,232,163, 37,131, 77,153,143,199, 3, 18,140,162,134,227,182, 22, 64,190, 3, 55, 22,
+222, 88, 55,151,154,238,219, 41, 29, 73,233,140,156, 81,204,214,138,174,135, 0,111, 45,248,145,200,212,137, 45,185, 37, 64, 2,
+109,231,135, 77,198,101,129,114,158,113,178, 3, 72, 75, 1, 71,169, 29, 49,228,149, 34,246,252, 49,196, 19, 38,187,146,228,156,
+162,181, 72,150, 66,118, 35,140,106, 13,108,251, 85,245, 61, 49,239,118, 74,174,164,254, 88,216,234,217, 45,133,173, 86,183,150,
+ 29, 52,243, 26, 10,193, 10,113, 99,109,172, 49,181,178,150,126,237,177,161, 83,163, 33, 62, 19,134, 82, 42,128, 18,111,249,226,
+112, 78,148, 68,160,174,137, 42, 89, 74,174, 85,141,107,171, 54,218,182,149,223, 1,158,171,146, 57, 35, 3,167, 79, 37, 91,146,
+187,123,175,137, 6,232,130,220, 29,234, 88,221, 85,165,139,238, 24, 88,132,166,180,235, 87, 1,207,207, 11, 15,216,154,127,101,
+ 21, 20, 16,252,237,143,125,147,221,130, 9,140,146, 63,229,140,189,157, 62,135, 30,133,219, 26,243, 94,192,208,255, 0, 98,255,
+ 0, 22,198, 38, 25,244,193, 47,102, 7,221,132, 35,123,206, 23,109, 77,236,230,134, 24,106,242,198, 38, 26,143, 54,193, 79,103,
+ 29, 13,207,203, 30, 24,188,252,112,225,243, 75,217,205, 10,246, 83,123,237,199,162, 50,137,228, 96,151,177,159, 92,100,136, 68,
+225,251,106,143, 96,104,123,112, 20,163,194, 48, 66,157,150,101,204,115,104,104,128, 58,220, 96,246, 87,163,182, 85,223,186,128,
+109,210,227, 18, 70,227,182, 60, 73,108, 15,128,198, 29,254, 54, 88, 81, 66, 6,189,107, 82,211, 9, 14,164, 41, 71, 74,140,181,
+145,226,165,171,184,155,155,115,140, 31,201,148,224,215, 1, 65, 95, 28, 74, 95, 72,109,190,152, 31, 33,244, 31, 13,177,207, 43,
+ 25,189, 42,144,179, 91,173,225,118,113, 5, 2,162,142,229, 39,138,143,112,171,252,113,157, 38,155, 38,153, 82, 66,220,142,124,
+ 39, 18, 36,125,235,131,135, 76,194,110, 66,130,150, 58, 30,184,184,140,125,213, 36,161,209, 32,138, 3,152, 27, 8, 80, 91,102,
+ 8,162,112,150,167,153, 14,132,245, 29, 49,146,202,213,193, 24,206, 34, 18,210, 54, 1,211, 25,184,216, 60,131,206, 57,229,168,
+ 41, 70, 43, 73, 58,111, 76,221, 74, 84,130, 20,145,238, 56,100,252, 48,179,225, 63, 60, 16,121, 4,117,198,149,160, 1,193,193,
+ 90, 89, 72,210,160,179, 38,132, 72,130,160,110, 58,227, 64,130,165, 42,196, 96,171,172,173,106, 38,216, 77,197, 33, 59,173,241,
+197,193,114, 82,157,232, 97,172,198, 98,152, 10, 59,107, 78,215, 16, 13,252,176,210, 76, 10,123,104, 44,174, 34,122,242,109,211,
+ 5,165,190, 26, 71,217,158,125,216, 11, 81, 91,160, 21,174,252,226, 77,220,187, 58, 42, 42, 70,221,181,254,161, 65,179, 6, 79,
+162,213,161, 61, 13,230, 80,227, 46,160,165,198,150, 46, 20, 15,145,199, 35,246,170,202,249,219, 66,170, 84,236,241,151, 40, 79,
+212,226,196,169, 33,232,207, 48,217, 90,146,128,161,118,156,253,235, 19,101,121,143,120, 56,236, 61,202,115,194, 13,207,166, 36,
+ 19,251, 63,229,252,235,149,196, 60,232,133,149,173, 65,212,180,149, 91,101,135, 0,251,249,190, 15,117,116,167, 45,225,222,241,
+ 27,117,245,233, 81,181, 79,176, 92,230,104, 64, 58, 17,200,215, 26,228,141, 80, 86,156,102,186,180,170,142, 94,152,188,189, 93,
+144,153,177,213, 25, 1, 74,135, 33, 73, 1,208, 83,127,186,171, 3,199, 66, 15,174, 47, 76,129, 83,203, 57,237,248,174,211,171,
+140,123, 35,196, 41,231, 74,192, 45,163,204,144,121, 6,223,158, 34,122,255, 0,161,104,211,138, 43,178, 40, 50,162,205, 66,110,
+ 83, 21,107, 83,106, 3,208, 27,144, 79,225,136,174,156,118,113,204,181,220,142, 51,213, 87, 57, 59, 65,139, 57, 39,217,155,105,
+238,109,234,127,134, 11,109,196, 87,140, 90,118, 72,136, 26, 9, 6, 71,199,247,172,219,156, 34,214,230,224,186,224, 51,206, 14,
+134,171, 79,164,135, 87,178,167,104, 13,118,162,104,173, 22,164,134,114,150, 72,111,188,155,177, 86, 67,178, 22, 7, 30,251, 36,
+126,103,215, 22, 38,148,232,172,154,237, 30, 42,133, 45,202, 53, 33, 44,164, 52,183, 27,219, 41,244,219,245, 16, 71,217, 15,222,
+ 80,221,232,145,194,177, 11,209,205, 38,209,109, 43,215,186,133,119, 61, 85,211, 88,168,206,144,143,170,234, 18,218,251, 22, 29,
+232, 84,160, 77,183,159, 8, 11, 35,143,113,231, 29, 96,212,114,122, 98,254, 23,134,219, 93,164, 62,242,179, 71, 47, 30,166,137,
+138, 99, 79,218,178,155, 91, 81,148, 70,170,235,229,251,208,124,185,148,104,121, 78,148,138, 46, 94,166, 55, 22, 51,100,144,134,
+199, 42, 81,234,165, 19,202,148, 79, 82,121, 56,125,236,135,200, 97,250, 99, 15, 76,101,236,188,241,127,195, 29, 80,112, 36, 64,
+218,184,213, 54,165,153, 59,208,241, 16,223,238,227, 52,196,231,145,135,193,131,210,223,150, 51, 76,101,121,225,139,213, 30,192,
+211, 20,197, 61, 54,227,207, 99,183,234,126, 24, 36, 35,127,129,140,132, 81,136,118,209, 79,236,243, 67, 61,144,126,198, 23,178,
+254,225,252,112, 76,197, 30, 71, 30, 24,163,246,112,187,106,111,103,240,161,190,203,251,167, 11,217, 71,166, 9,123, 55,238, 12,
+120, 99,126,238, 23,109, 77,236,244, 59,217, 71,166, 16,140, 61, 48, 71,217,125,216, 94,203,238,195,246,213, 30,194,135,136,182,
+ 60, 12,123,236,215, 28,140, 16,246, 65,233,143, 68, 68,245, 3, 17, 46,138,126,192,208,225, 24,143, 44,100,152,216, 33,236,131,
+246, 78, 61, 17, 71,236,225, 23,169, 6, 13, 50, 76,112, 15, 76,108, 17,248,225, 56,122,152,164,126,166, 50, 76, 99,231,108, 12,
+189, 68, 12, 83, 36,198, 62,152,216,136,164, 30,159,150, 30, 38, 41,233,141,137,141,238,196, 11,181, 48,205, 52, 68,111, 92,109,
+ 68, 96, 56,182, 29, 38, 48,242,198,105, 97, 35,203, 2, 83,180, 64,205, 55, 68,113,127,187,248,227, 98, 24,242, 3, 14, 80,192,
+193,106, 61, 21,183, 82, 36, 60, 46, 15,221, 24,172,245,202, 26, 70,101, 26,178,205,170,157, 94, 84,138, 27, 26,139, 49,240, 10,
+ 24, 54, 62,120, 51, 77,164,152,137, 79,120,158,125, 45,130,140,180,134,198,208,155, 1,233,143, 36,172, 4,157,163,159, 44,115,
+ 87,120,155,143,140,128, 64,174,166,195, 14, 69,178,179,115,172,195,233, 66, 0, 7, 26,156,124,238,220,142, 72,245,195, 55,164,
+169, 42,178,193, 30,152,214,252,228,178,201,230,247, 24,205, 2, 77,108, 6,200,173,242,106,170,104, 16,165,140, 12,147, 91, 82,
+193, 72, 86, 24, 77,158,227,138, 37, 23,192,231,103, 5,248, 9, 32,140, 89,109,177, 86, 82,200, 2,139, 46,162,163,250,223, 44,
+104,151, 80, 74, 17,247,190, 38,248, 14,186,161, 65,178,149,249,225,180,170,182,235,132,156, 88, 75, 69, 70,104,130, 19,161,162,
+ 47,213,122,248,176,201,250,157,255, 0, 91,227,206, 6, 59, 49,106,228, 43, 26, 22,241, 61, 85,243,193,195, 2,138,149, 81, 7,
+ 39, 93, 87,220,112,176, 52, 60,175,218,194,195,246, 85, 46,209, 21, 37, 75, 2,220,131,143,123,129,251, 56,116,150, 49,233,103,
+212,126, 88,223,237, 43,206,114, 26,107,220, 39,246, 70, 16, 97, 62,105, 24,118, 25, 62, 95,195, 8, 50,112,221,168,165,146,153,
+152,233,242, 24,243,217,199,161,195,222,228,227,223,103, 82,186, 36,225,118,162,156, 34,105,144,142, 47,211,243,198,232,209, 16,
+181,216,167, 27,251,130, 15, 9,198,232,173, 22,150, 20,161,198, 32,227,196, 36,197, 73, 40,214,141, 82, 33,165,168,193, 69, 28,
+ 91,211, 14,194,210, 5,128,198,152,142, 21,178, 2, 61, 49,235,132,222,216,226, 46,221, 90,158, 57,171,162, 97, 1, 40, 17, 90,
+166,202, 72, 22,192,153,110,155,149, 3,135, 85, 5,128,111,124, 12,126, 66, 84,163,115,231,138,153,171, 65,164,146, 41,204, 53,
+135, 22, 1,193,136,150, 0, 1,229,136,244,121, 40, 66,184,193,120, 18,148,176, 0, 55,190, 17, 85, 58,208, 98,139,182,177,123,
+222,216,218,165,164, 39,212,225,163,107, 54, 31,217,141,129,195,230, 48,225, 85, 80,163, 90,245,103,212, 97,187,128,168,240,113,
+181,197,169, 34,252, 88,140,107, 14, 36, 3,137, 5, 17, 78, 17, 58,215,168,105, 54,185,198,169,110, 6,208, 82,148,245,198, 97,
+210, 58,156, 53,159, 32,186, 2, 27, 77,213,127, 33,135,206, 73,169,161, 16,104,101, 65,197,182,173,201, 87, 39, 3, 75,115,167,
+ 58, 24,105, 11,117, 74,232,132, 38,228,252,177, 35,103, 42,203,154,166,215, 57,228,176,135, 62,232, 60,173, 95, 4,255, 0,126,
+ 37,180, 44,187, 76,160,178, 81, 9,146, 22,161,246,142,175,149, 28, 28, 92, 36,104, 53, 52,150,180,160, 84, 66,131,148, 19, 67,
+113, 21,154,248, 5,109, 14,241, 17,135,234,219,155,171,251,177,204,250,175,219,147,180, 20, 13, 68,153,150,242,206,148, 42,101,
+ 53,167,212,134,102,185, 52, 50, 28, 60,217,182,209, 98,167, 87,107,240,145,229,114, 70, 59, 62, 84, 56,111, 52,164, 56,216, 55,
+234,125,113, 67,107,206,139, 66,122, 74,179, 46, 86,168,136, 85, 38, 66,204,119,148,144,180, 13,214,220, 20,142, 46, 56, 7,130,
+ 15, 31, 44, 87, 93,195,169, 50,161, 63, 74,139, 97,167, 15,126,185,221,125,164,179, 46,172,187, 47, 43, 85,114,196,200, 85,104,
+ 46,150,231,211,231, 71, 82, 29, 97, 94, 64,140, 67, 53,203,180,245, 95, 74,178,116, 12,133, 81, 14,182,226, 25,190,208,171,109,
+ 10, 36,237, 0,249,243,249, 98,111,216,167,176, 6,190,100, 44,197, 95,212, 60,249,172, 21, 60,200,101,173, 69, 21, 28,196,178,
+ 86,190, 74,182, 52,146, 78,198,193, 61, 47,111, 65,142, 66,237,181,156, 53,203, 45,118,134,150,238, 88,209,252,185,155,221, 68,
+180,177, 33, 57,146, 50,164,183, 18, 55,121,227,113,150,199, 69,157,160,119,130,234, 74, 65, 0, 89, 71, 6,105,212, 56,169, 27,
+ 84,125,145, 38,227, 34,117, 20,102, 6,187,167, 56, 84,149, 78, 97,185, 77, 73, 42, 10,121, 18, 17, 98, 19,228,160,124,239,238,
+ 56,250, 77,147, 87, 50,110, 86,166,204,169, 36,135,221,128,202,223, 4,116, 89, 64, 39,243,190, 62,102,228, 76,187, 76,111, 61,
+ 39, 59, 69,160, 57, 22,151,245,138, 20,205, 61,230,202, 44,192, 80, 42, 72, 73, 0,165, 36,238,176,226,193, 93, 7, 76,125, 62,
+203, 21,122,110, 98,162,196,174, 82, 29, 14, 70,150,194, 93, 97,105,243, 73, 23, 31, 15,134, 58, 92, 46,237,155,124,210,119,138,
+200,197,236,212,234,210,148, 13,191,138,122,134, 15,149,134, 54, 8,247,198,246, 26, 66,190,254, 54,119, 9,189,146, 49,178,155,
+230, 92,216,214, 81,176,117, 35,106,107,236,222,241,143, 82,192, 7,203, 15,154,130,226,249, 74, 78, 50, 84, 23,146,109,221,159,
+142, 36, 46, 91, 81,128,170, 26,173, 92, 78,226,153, 38, 62,227,100,167,242,195,184,244, 57,143,240,219, 56, 39, 74,164,167,112,
+ 91,169,248,241,131,108,180,195, 72,240, 0, 45,231,140,187,204, 88, 48, 97, 26,154,183,109,134,151,117, 94,130,162,206,101,201,
+141, 38,235, 72,189,176,209,218,123,140,159, 26, 49, 50,125, 76,158, 20,171,224,125, 82, 51, 14, 55,116,129,138,182,248,218,148,
+168,112, 85,183, 48,100,148,202, 13, 70, 76,123,121, 99,194,201,195,231,227,132,158, 6, 53,134,136,232, 49,188,135,130,211, 34,
+177, 93,183, 83,106,130, 41,175,117,238, 56,244, 53,238,195,174,232, 30,163, 30,247, 3,211, 15,218, 80,123, 58,106, 26, 30,236,
+122, 26,227,129,249, 97,208, 99,229,140,131, 9,244,194,207, 75,179,166,189,207,184,227,208,200,244,195,158,224,122, 28,122,150,
+ 0,242,196,115,211,246,116,216, 49,230, 49,144, 96,245,218,112,232, 54, 7,150, 50,102, 58,157, 88, 64, 6,215,228,226, 37,200,
+212,212,146,212,152, 20,221, 17, 28, 87,221, 65, 63, 1,140,204, 55, 91, 23, 91, 68, 15, 82, 48,122, 12, 86,216,111,106, 44, 79,
+153,195,149, 24,206,178, 89,144,129, 99,140,135,177,118,219, 92, 1, 34,181, 90,194, 86,180,201, 48,106, 61, 14,156,228,181,109,
+ 71,226,113,185,202, 52,166, 86, 0,111,112, 62, 99, 4,102, 76,167, 82,163, 46, 75,175,182,203, 45,166,235,113,106, 9, 74, 71,
+169, 39, 12,169, 89,198,147, 90,134,153,244,122,147, 50,227,169, 68, 37,248,238,133,160,145,214,196,113,138,170,198, 22, 85, 40,
+ 78,149,109, 24, 58, 2, 97, 74,214,180,123, 35,233, 94,194,202,175,126,150,196,138, 27, 66, 52, 84, 34,220,237,192, 42,214,118,
+165,208,163,123,100,197, 34,246, 59, 91, 43, 1, 75, 3,147,180, 30,164, 14,109,133,144,117, 63, 34,106,109, 57,117, 76,151,153,
+ 99, 79,101,151, 10, 30,238, 28,185, 66,135, 80, 71, 81,138,151,119,238,220,182, 1, 76, 70,244,123,123, 54,109, 93,253, 90,158,
+ 85, 34, 46,165, 45,220,250,243,134, 18,229,130, 77,151,140,103,212,208, 9,105, 29, 48, 53,217, 4,146, 65,198,120, 50,107,113,
+150, 76, 73,173,146,101, 88, 18,174,152, 27, 38,164, 64, 41, 81,190, 50,149, 48,164, 16,122,121,224, 68,249, 91, 82, 84,149, 98,
+194, 34, 42,216, 64,175,101,212, 0, 28, 28, 13,126,161,226, 42, 81,182, 52,201,152, 72,228,224,124,169, 91, 70,247, 86, 18,145,
+230, 77,177,105,180,205, 76,173, 8, 21,190, 68,197, 94,225, 88,208,185, 69, 66,247,198,158,241, 42, 73, 88, 88,218, 47,115,126,
+ 5,177,228, 89, 49,101,178, 31,136,250, 29, 65,232,180, 40, 40, 31,152,197,196,173, 59, 10, 9,113, 19, 91, 67,164,249,227, 52,
+182,162, 46, 71, 24,241, 40, 28, 27,115,141,173,133, 19,111,126, 38, 28, 20,150,160, 19, 53,175,187, 42,251,163,240, 24, 88,145,
+229,166, 51,137,140,232,203,181, 86, 89,104, 57,101,221,214,134,229, 91,247,249,194,198, 51,248,195,108,188, 81,157,189, 58,185,
+ 7,222, 50,152,245,170,189,185,163, 9,108, 90,214,198, 93,213,255, 0, 87, 27,210,221,199, 76,102,212, 98,226,130, 66,113,210,
+169,208,145, 38,185, 48,146, 78,148,216, 51,113,194,113,190, 45, 49,114, 14,227,194,125, 78, 10, 51, 79,101, 8, 0,160, 19,239,
+198, 75, 1,177,100,129,242,198, 61,206, 46, 0, 33,189,234,251, 54, 36,153, 93, 52, 77, 46, 34, 5,148,187,227, 54,227,199, 73,
+176,111,143,134, 61,222, 66,190,237,241,234, 93, 7,128,156, 99,174,250,225,123,170,180,209,110,202, 54, 21,137,137, 29, 74,184,
+111,231,141,201,137, 20, 39,196,145,127, 76,100,148,130,157,196,219, 26,222,113,182,211,125,220,143, 76, 12,221, 60, 79,234, 52,
+253,147,100, 64, 21,180, 56,195, 9,218,142, 62,120,212,185, 13,168, 16, 15,195, 3, 37,207, 82, 84, 72,195, 69,213,148,158,119,
+ 96, 10, 89, 81,147, 71, 67, 6, 52,167, 21, 39,109,123,244,192, 73,111,132,172,237, 87, 24,115, 46,165,222,141,164,223, 3, 31,
+ 89, 90,190,120,136, 58,213,230,155, 32, 83,168,178, 84, 85,107,224,221, 45,226, 19,215,229,128, 16,129,176, 54,243,227, 6,169,
+106, 9,229, 88,124,212,156, 77, 26,101,219,142, 85,206, 54,247,196, 14, 78, 26, 52,177,110, 49,234,149,230,113, 32,106,161, 69,
+110, 91,230,252,155,227, 5, 72, 4,217, 29,113,130, 82,228,133,165,166,144, 84,162,108, 6, 36, 20,138, 12,122, 82, 68,201,190,
+ 55,237,112,157,190, 22,255, 0,188,225,249, 84, 20, 82,129,173, 50,135, 72,117,108,137, 21, 21,150, 16, 71,132, 91,196,175,151,
+150, 4,213,115,125, 58,149, 43,234,250, 28, 61,210, 13,198,240,110,175,141,207, 79,150, 48,212,156,222,170,100, 23, 28, 47,115,
+111, 14,206,167,241,197,109,145,171,238, 87,107,238,200,158,247,114,194, 13,237,123,173,195,233,238, 24,164,235,164,154,100,130,
+173, 77, 93,249, 69,165,185, 17, 51,164,158,241,247, 5,212,165, 18,118,143,119,247,225,245, 74, 90,227, 32,168,174,222,227,134,
+ 89, 34, 82,101, 66, 47, 95,195,110, 9, 56, 27,159, 51, 85, 62,154,149,239, 95,221, 28,226,227, 73,134, 65, 21, 85,102, 22,102,
+148,204,225, 30, 40, 82, 92,125, 32,158,156,224, 68, 56,185,107, 57,214, 67, 19,234, 1,101, 10, 23,104, 43,174, 41, 29, 90,215,
+152, 84,247,204,102, 25,117, 75, 42,179, 97,148,220,147,138,162,126,126,237, 79,147, 67,154,165,165,217, 1,252,206,220, 71,210,
+169,217,126, 12,132,137,142,178, 77,138,154, 11,178, 84,180,143, 22,210,161,112, 15, 56,101,129, 29,227,165, 22,221,181,188,168,
+ 27,242,174,207,214, 45, 73,139,164, 20, 4,207,157, 75,109,218, 50,155, 68,117,251, 38,229,200,101,229,171, 98, 44,210, 65, 46,
+ 37, 68,132,248,124, 64,249, 16, 73, 79,205,253,104, 38,102,185,204,170,207,203, 79, 64, 15, 62,243,109,181, 37, 73, 42, 93,182,
+ 18,171, 39,238,139,241, 99,207, 91,129,128, 29,160, 62,147, 29, 64,147,152,232,163, 84,116,203, 48,228,186,115, 85,214,214,235,
+ 25,150, 19,172,201,117,212, 40,134,124, 32, 20, 4, 7,123,181,146,149, 43,132,249,114, 48, 63, 36,206,206, 90,137, 93,115, 61,
+230, 30,249,104,117,107, 49,212,240, 32,175,113,185, 95, 62, 71,139,122,129,131,148,144,172,252,163,106,155,141,173,150,123,201,
+131,215,157, 73, 87, 1,167,146, 59,182, 82,148,142,128, 12,117, 71,100, 28,202,205, 75, 77,191, 71,156,118,238,210,228, 41, 9,
+ 4,255, 0,209,171,196, 63, 61,195, 28,226,244, 5,177, 13, 46, 6,109,199,138,231, 6,244,195, 83,102,105,148,241,152,154, 87,
+250, 56, 90, 4,182,192,251,205,238,218,109,239,228, 31,150, 44, 54,172,201,129, 85, 25,115, 43,146,107,180,218, 90, 61,127, 44,
+111,105,105, 38,226,223, 44, 70,178,198,110,165,102,154, 52,122,229, 22, 88,122, 60,134,194,144,180,255, 0, 15,142, 10,183, 47,
+204, 28, 21, 37, 93,107, 76,132,198,212,110, 44,158,236,219,139, 28, 63,143, 37, 43,177,176, 62,235, 98, 60,196,195,235,135,176,
+230, 0,174, 15, 92, 58,138,198,179, 66, 83,109,171,113, 71,146,243, 64, 93, 3,229,141,107,157,183,130,191,150, 7,174, 89, 31,
+173,110, 56,195, 89, 83,211,110,191,158, 4,115, 40,235, 80, 13, 4,152, 20, 73,250,162, 80,124, 74, 24,105, 34,164,149,139, 3,
+215, 2,156,152,165, 30, 85,127, 76,105,113,229,168, 90,231, 18, 75,122,213,144, 2, 69, 19, 83,193,195,201,199,137, 3,203, 12,
+163, 56,161,213, 95,142, 28,119,192,114, 14, 54,173, 46,148,202,114,157,171, 22,246,209, 47,156,195,122,114, 18,155,116,194,216,
+159, 76,105,106, 75,107, 36, 37, 96,144,108,108,113,189, 42, 73,231, 27, 8,115,180, 78, 97, 88, 46,180, 91, 86, 83, 72, 36, 95,
+129,143,118,156,100,146, 15,221, 24,220,152,238, 44, 92, 52,109,134, 82,146,157,205, 64, 54, 85,176,166,251, 79,166, 22,213, 94,
+214,195,133, 52, 81,247,145,140, 10, 20,162, 54,167, 8, 45, 36, 77, 46,205, 83, 17, 88,198,142,185, 46,134,210,109,234,112,241,
+ 77,199, 76,119, 33, 71,149,246,182,218, 86,130, 46,130,124,254, 56,214, 30,110,149, 13,233,210,142,212,180,217, 90,207,160, 2,
+231, 28,155,173, 29,163, 53, 3, 46,178,254,171,100,166,166,210,104, 82, 28, 49,170, 19,229, 71, 79,112,147,115,103,148,187,110,
+ 77,133,172, 64, 62,252,114,248,206, 44,150, 92, 13, 5,104, 72, 3,196,159,231, 74,190,149,219,225,236,135, 94, 4,147,200,111,
+ 21,208, 84,188,225, 94,211,172,204,114,142,104,168, 55, 84,132,152,139,117,170,146, 30,239,100,157,160,169, 93,226, 16,144, 18,
+ 0,244,235,135,210, 53,195, 79,126,183, 69, 11,235,160,185, 18, 32,251, 92, 85,182, 82, 91, 91,118,191, 38,254, 19,107, 30,113,
+243, 86,177,219,170,143,167,179, 42,121,135, 38, 86,220,145, 46, 69, 73,217, 20,250,181, 65,197,186,212,132,169,189,138,108, 43,
+130, 7,136,155, 31, 63, 76, 80,249,255, 0,180,158,170,102, 7, 42,210, 41,153,177,198, 99,189, 79,238,164,152,207, 17,184, 27,
+ 94,231,112,230,252,113,205,184,198, 21,133,190, 55,121,112,174,208, 0,142,233, 4,136, 62, 32,141,127,125,199, 74,195,186,227,
+ 36, 90,142,226,119,141,249, 14,158,117,222,253,172,126,146,109, 60,250,130,161,167, 89, 82, 60,197, 76, 15,247, 18,223,113,132,
+ 46, 43,204,169, 32,144,149, 19,125,225, 87, 29, 45,239,199, 55,102,158,223, 58,171,167,185, 86, 62, 82,210,201, 38,137, 71,101,
+ 14,188,220, 84,200,105, 13,135, 22,224, 87,123,192, 81, 74, 65, 22,218, 79, 67,142, 33,205, 90,179, 10,171, 76,106,133, 34,168,
+228,167,217,117, 37, 73,108, 43,109,137,228, 21, 94,220, 96, 46,110,204,149,136,146, 96,210, 37, 79,122, 60,105, 42,176, 75,175,
+238, 79,119,126, 46, 60,192,228,227,176,181,192, 24,100,140,234, 36,147, 39, 55,132,108, 52,143, 42,225,159,199,241, 23,238, 59,
+ 85,186,115, 64, 29, 52, 29, 58, 78,230,187,110, 63,210, 47,171, 57,202,112,133, 92,212,161, 38,160,228,177, 32,178,152, 12,187,
+ 30, 58,130, 45,118,183,130, 71, 22,184,189,186,227,110, 69,250, 78, 51,190,153,101, 60,215,151, 50, 74, 88,129, 58,168,165,150,
+106, 29,195,108,165,151, 9,251, 71, 16, 54,242,163,229,233,124,112, 46,123,207,239, 73,152, 24,162,161, 61,204, 7,212,216,155,
+ 13, 5,176,240, 61, 20, 71,151, 76, 48,111, 60,202,170,237, 97, 50, 84, 20,142,165,106, 82,247, 31, 79,118, 52,127,161,217,191,
+ 14, 56,153,219,126, 80,100,127, 29, 40, 3, 22,187,246,142,213, 75, 37, 94, 38,126, 63, 42,250,249,217,211,233, 81, 98, 70,148,
+ 72,164,103,124,217, 25,204,196,203,145,217,164, 74,170,164,247,114,148,162, 2,251,213, 32,168,166,198,231,119, 75, 91,140, 95,
+244,175,164, 35, 67, 88, 68, 72,186,129, 87, 77, 18, 75,201, 9,121,231, 22, 28,142,151,127,101, 43, 79, 36, 30,160,144, 56, 56,
+248,131,166,218,223,152,180,242,166, 12, 40, 12,199,125,212,168, 23, 4, 52, 56,226,144,160, 65, 27, 87,193, 4, 31,150, 38,116,
+ 94,208,110, 76,201,135, 43,231, 58,148,215, 41,226, 67,138,132,202,154, 79,250, 58,207,136, 42,224, 2, 65, 36,220, 95, 25,207,
+224,138, 15, 74, 63, 79,199,221,167,195,229,177,233,108,184,219, 20,181,202, 51, 5, 36, 8,131,175,198,102,121, 87,220,220,189,
+172, 90,105,159, 41,255, 0, 91,101, 76,245, 77,153, 28,172,160, 45,185,105,235,243, 56,105,153,179,238, 75,161, 82, 95,174, 86,
+179,141, 58, 44, 40,192, 25, 18,157,150,144,134,193, 54,186,141,248,199,196,218,167,105, 92,193, 43, 47,194,202,249,118,172,245,
+ 42, 12, 32, 84,149,190, 82, 82,235,155, 70,237,167,109,211,127, 43, 19,137, 14, 94,237, 18, 51, 4, 21,229, 74, 14, 82,147, 84,
+106,163, 24,125,103, 5,164,240,250, 27, 79,141, 69, 92, 21, 40,168, 92, 88,116,247,226,187,152,107,246,237,231, 87,211, 65,212,
+157, 6,218,252,205,116,237,113,234,214,220,118, 34,127,246,250, 71,194,107,233, 38,180,246,173,167,101,252,244,222, 65,201,213,
+152, 79, 69,105, 74, 21,154,219, 46,182,235,109,180,166,194,155, 91, 4,173, 41,116,146,171, 90,226,220,249,227,156,179,159,105,
+125, 78,204,249, 29,154, 37, 39, 49,202,126, 93, 33,231,227,213,167,191, 49, 40, 70,197, 93, 77, 40, 32,125,229,132,241,226, 81,
+ 3,223,142, 54,155,175,175, 10, 29, 71, 44, 12,175,220, 48,128,160,168,147, 29, 40, 49,208, 14,237,137,113,126, 62,156, 14,111,
+137,212,188,253, 47, 43,233,204,125, 86,151,146,225, 83, 40,249,138,148,168,212,104,116,234,154,148,229,218, 33, 37,231, 55, 40,
+253,173,252,237,111,118, 50,110,108,113, 22,138, 75,170,204, 52, 16, 32, 2,122,145,154,117, 4,233, 37, 58, 13,122,229,189,197,
+ 47, 93, 21,169, 68,128, 57, 14,159, 31, 10,183,179, 94,112,212, 26,254, 79,167,230, 74, 70,125,155, 18,179,245,114,100,212, 35,
+ 74,173, 41, 54, 66, 85,181, 42,109,182,205,150,226,173,114,159, 75, 96,234,251, 97,106,243, 52, 42, 85, 86,101,110,125, 58, 45,
+ 62,152,136,209,167,209,105, 97,150, 38, 58,149,130, 3,225, 73,176,122,197, 91,201, 85,185, 6,216,231, 58,110,110, 68, 28,191,
+ 68, 53,106, 90,232, 52, 60,201, 86,246,215,235, 5,244,185, 32,161,180,237, 83,125,229,138,146, 73,230,199,175,166, 52,235, 23,
+104, 38,243,198,114,122,133,150, 39,119,116,133,109, 68, 72, 84,214,150,203, 85, 5,164, 4, 37,197, 32,120, 59,203, 1,185, 65,
+ 34,231,203, 21,173,172,221, 85,194, 83, 18, 82, 84, 66,186, 9, 0,164, 17, 58,238, 34, 98, 6,189, 69, 54,241,181,165, 5, 89,
+251,219, 1,204,248,252,188,235,189,123, 58,125, 38, 25, 95, 63,206,111, 46,106,109, 7,234,135,151, 39,185,110,170,153, 8, 49,
+182,237,240,169,194, 79,133, 74, 32,244,227, 29, 61, 78,206,217, 66,167,151, 83,155, 41,249,138, 35,244,229, 35,112,154,211,193,
+ 77,145,241, 24,248,163, 63, 55, 80,234,181,234,125, 63, 44,228,134,225,138, 20, 62,242,175, 21,201,192,183, 33, 64,139,184, 9,
+ 41, 81,235,210,255, 0, 12,117,167, 99,238,212,204,228, 90, 25,211, 58,206, 81, 53,122, 13, 62, 59,107,126,165,151,221, 82,216,
+105,151, 84, 84,227,178,133,174,109,113,101, 91,139, 17,141, 91,251,183, 45, 25, 14,100,130, 99, 67, 2, 53,137, 38, 79, 80, 96,
+114, 58, 77,116, 86, 28, 72,227,131, 35,186,244, 53,209,250,213,155,114, 2,179, 93,217,205,113,102, 37,104,239, 10, 26, 76,196,
+173,133, 30, 10, 85,221,184, 18,122, 92, 16, 58, 97, 99,151,181,230,163,163, 20,236,200,212,156,141,155, 50,173,102,153, 39,122,
+152,114,169, 53, 74,146,201,184, 37, 11, 7,145,107,241,238,248, 97, 99,146,119,134,223,184,117, 78,185,112,185, 81, 39, 64, 99,
+ 94,144,168,138,205,126,253,194,242,137, 35,126, 71, 74,250,194,132,244, 55,195,200,113,136, 29,229,240,221,132,248,135,199, 4,
+ 16,176, 18, 2, 79,150, 59, 60, 66,225, 77,162, 7, 58,234,237,154,204,169, 52,150,189,157,112,222, 67,252, 95, 25, 58,231, 23,
+ 39,140, 51,147, 40, 36,220,114,113,204,169,100,154,217,109,178,107,213,204, 45,158, 45,141, 98,166, 82,163,124, 51,126, 69,239,
+124, 53,113,244,129,193,231, 16, 10,154,180,150, 68, 81,163, 87, 73, 78,210,113,173,115,144,187,133,155, 96, 33,149,180,240,113,
+232,152, 84, 57, 56,121, 53, 32,196, 83,154,131,169,231,106,133,176, 34, 67,206, 95, 14, 37, 74, 66, 82,121,231, 3,221,144, 22,
+110, 14, 28, 77, 90, 66, 0, 21,232,125,203,216,158, 49,152, 9, 81,189,252,241,165, 4, 44,216, 97,195, 97, 32,218,248,148, 19,
+ 68, 48, 41,212, 84,132,218,248, 37, 25,212,131,112, 48, 49,178,145,208,252, 48,225,151, 82,146, 2,149,111,137,196,130, 73,160,
+ 44,131, 70, 99,190, 15, 55,198,242, 73,248,224, 92,119,145,112,174,240,126, 56, 61,150, 34, 34,116,190,245,205,170,109,171, 21,
+130,122,159, 33,254, 61, 49, 34, 34,170, 44,128, 38,139,229,218, 81,132,208,155, 37,145,222,175,238, 5,113,180,122,252,113,186,
+179, 48, 50, 10,183,254,175, 0,117, 62,252,109,153, 39, 98,142,196,149,145,233,128, 21,151,223, 8,113,197,144, 9, 29, 54,224,
+ 43, 81,136,170,154,168,230, 53, 92,106,238, 98, 98, 20, 39,156,113, 59,212, 18,108, 73,251,184,165,178, 14,119,118,163, 91,113,
+142,244, 54,143,105,218, 18,165,242,171,158,113,104,107, 74,216, 52,167, 91, 97,145,189, 73, 55, 54,220, 78, 57,123, 44, 87, 14,
+ 79,213, 70,215, 60, 31,103, 83,188,238, 28,130, 79, 23,197,126,200,169, 36,209, 91, 80,218,190,130,229,247,151, 78,203, 12,173,
+147, 96, 88, 4,155,115,211, 21,126,171, 84,164, 20, 59,185,103,113,191, 67,206, 39, 57, 27, 49,181, 89,203,145,154,218, 47,220,
+131,201,247, 98, 59,169,121, 41,250,156,103, 87, 25,126, 37, 32,242, 49,117, 36, 6,196, 85, 39, 37, 74,174, 82,170,179, 90,205,
+ 90,146,221, 14, 3,123,201,243,183, 67,126, 49, 47,205,154,103,170, 25, 86,135,178,145, 95,159, 21, 98,202, 75,177, 29,216,160,
+127,187,227,137, 6, 66,200,107,203,217,241, 85, 73, 74,220,182,215,116,139, 98,198,205,217,145,170,205, 45, 81,148,194,119,116,
+196, 20,176,161, 21,105, 50,212, 20,239, 92,135,153, 6,107,204,111,171, 47,234, 68,193, 83, 75, 66,237,251,115, 9,113, 65,119,
+184, 85,200,242,182, 38, 89, 59, 79,168,201,165, 50,211,101, 4, 37, 62, 45,160,117,198,253, 67,203, 43, 69, 84,212,119,129,119,
+ 57, 36,112,110,112, 94,131,150, 93,167,195,106,107, 79, 40,165,225,123,142, 44,124,198, 34,149, 32,236, 34,162,249,113,104,149,
+ 42,106, 43,155,178,186,162,165,214,144,223, 10, 65, 9,219,231,231,138,139, 53,230, 88,212,158,246,140,235,128,180,248, 45,172,
+ 31,222, 4, 3,242, 54, 56,186, 53, 23, 49, 63, 71,140,242, 82,214,226, 18, 65,184,232, 61,113,203,217,162,162,186,174,102, 92,
+ 53,155,184,227,183, 40, 39,175, 56,179,106,231,247, 42,146, 82,102,106,230,208,205,109,206,122,111, 5, 84,232,146, 67,209, 92,
+ 30, 22,222,241, 37, 10,247,122, 95, 22,107,125,171,243,162,141,219,133, 16,123,138, 14, 40,236,159, 73,117,168,237,177, 33, 23,
+ 66,211,224, 82,189,125, 13,176, 90,116, 89, 81, 89, 83,172,166,234,108, 93,105,191, 84,250,143,134, 59,174, 26,123, 11,114,235,
+176,188,109, 36, 43,101, 30, 71,161,240, 63, 3, 88, 56,243,184,144,183,237,173, 28, 32,167,112, 57,143,220,124,170,224,111,181,
+182,118,138,221,149, 2, 35,138,234, 9, 73, 24,124,231,108,236,196, 99, 32, 70,203,113,144,224,255, 0, 88, 84,178,111,142,119,
+147,153, 20,201,220, 79, 24,214,230,106, 74,145,100,117,199,168,126, 82,193,220,130, 88, 31, 26,243,223,205,120,194, 4, 7,141,
+ 91,213,206,212,218,157, 50,172,170,147, 53,179, 28, 17,100,176,208,240, 36,124, 48,218,143,218,223, 83,232,175, 19, 34,162,137,
+141,168,220,162, 66, 47,111,158, 41,233, 53,235,164,172,185,206, 7,185,153, 16,226,138, 66,133,241,124,112,214, 22,166,242, 22,
+ 19, 30, 66,170,163,136,177, 32,230,126,217, 83,230,107,173,114,175,109, 44,191, 46, 50, 81,153,232, 78,178,231,154,227,170,233,
+ 63, 35,131,255, 0,231,127,165, 97, 10, 80, 50,247, 14,137,238,122,227,139,152,204, 14,216, 13,215, 3, 14,227,102, 54,183, 0,
+190,184,200,119,128,176,101,175, 48, 73, 30, 0,233,245,173,182,248,227, 22, 75,121, 74,129,243, 26,215, 92, 77,237,153,147, 90,
+ 73,246, 10, 36,151, 21, 99,183,122,128, 23,196,106,163,219, 39, 51,200,109,214, 41,244, 40,237,111,184,109,101, 68,148,140,115,
+155,185,132,149,120, 69,189,248, 77,230,165,180,171, 41, 67,241,197,150, 56, 55, 8,103,102,231,204,147, 84, 31,226,220, 85,223,
+251,145,229, 2,186, 47, 71, 59, 68,191,150,170,179, 31,206,111,200,146,220,197, 5,110, 74,175,177, 94,182,197,235,147, 53,115,
+ 36,103, 56,166, 69, 42,180,210, 84,159,188,219,202, 9, 80,252,113,193, 80,179,138,247,237, 82,198, 10,196,206,106,100,133, 37,
+226,159, 93,170,182, 5,127,195, 12, 60,178,180,119, 73,233,183,165, 14,207,137, 46,109,210, 16,190,242, 71, 93,253,107,232, 84,
+ 74,229, 25, 77, 7, 81, 81, 97, 66,246, 42, 14,139,127, 28, 18, 98,183, 79,148,128,152, 82,218, 89,181,236,133,131,124,124,250,
+137,159,103, 6, 59,182,106,143, 0,122,164, 58,112, 78,141,171, 57,139, 42,200,250,210,155, 95,122, 58,155, 73,187,157,233,178,
+ 71,159, 92,114, 23,156, 16,251,146,160,246,190, 35, 79,157,116,182,220,110,203,121, 82,166, 52,231, 7,248,174,241,113,254,240,
+220,163, 27, 19,220,161, 37,205,215,176,232, 49,198,212,206,216,186,139, 67,152,212, 71,234,226,114,220,104,186,152,203,103,122,
+214,129,114, 84, 2, 69,236, 45,215, 19,252,129,219,155, 43, 84,226, 45,204,249, 13,202, 96, 41, 61,219,157,218,199,139,246, 84,
+146, 46,147,142, 82,251, 1,197,173, 26, 86, 85,165, 97, 34, 72, 74,132,129,214, 55,174,146,211,137,240, 75,181, 12,210,130,127,
+228, 52,245,218,188,215, 94,215,185, 41,188,191,245, 99, 53,186,180, 57,176,171,197, 53, 10,108, 88,189,211,254,206,218,182,169,
+197,110, 7,192, 47,127, 9, 23,252,177,243,231,180,119,106,188,215,158, 21, 84,136,137,177, 95,164,102,106,194,183,179, 45, 65,
+106, 82, 26, 1, 13,148, 36, 4,134,201,183, 36, 36, 95,215, 7,251, 84,235, 58,145,168,146,245, 61,213,119, 80, 30,117, 77, 33,
+ 18,166, 5, 60,224, 42,185,111,105, 79, 59,147,250,192,121,115,142, 75,173,106, 46, 70,154,107, 47, 74,137, 37,245,169,228,253,
+ 87, 13, 42, 67, 73,105, 5, 87,185, 88, 55, 4, 92,244, 7,229,142, 38,199, 14, 91,215, 10,188,121,174,241,136,208, 18, 53,253,
+ 51,202, 12, 25,158, 94, 85,195,227, 56,219,215,107, 34, 99,246,218,136,106, 20,108,230,136, 17,114,107, 49,153,155, 13,185,174,
+251, 29, 41,165,217, 77, 41, 96, 2,178, 65,228,250, 12, 85,249,247,235,154, 53, 81,188,162,169,174,195,144,227,253,219,140,190,
+239,250,145,239, 35,203, 12, 94,212,108,195, 73,175,177, 63, 43, 86, 84,167, 97,184, 22,211,206,166,224,184, 61,198,225, 86,247,
+227, 84,250,181,126, 69, 98,161,155,171, 77, 71,126,120,251, 89, 37,100, 30,242,252,149, 90,254,167,160,233,142,223, 13,106,229,
+133,128,178,152, 35,161, 4,170,122,109,207, 94,100,239, 92, 67,239,184,162, 9,175, 39,253, 89,147,106, 46, 49, 76, 68,137,172,
+173,189,174, 75,104, 92, 18, 71, 3,159, 67,252, 49, 23,175, 78,139, 38,160,203,177, 42,171,146,234,148, 3,203,124, 27, 54,155,
+ 14, 49, 38,115, 45,206,166,165,138,142, 96,172, 38, 34,167, 54, 36, 53, 13,135,129, 40,107,201, 86, 7, 21,253, 85,205,181,169,
+ 17, 33, 77, 81,105, 75, 61,217, 88,228,143, 95,142, 58, 27, 66, 22,102,100,245,170,169,112, 57, 36, 26, 49, 82,204,241,233,189,
+245, 46,159, 41,110, 50,229,186,144, 18, 85,110,160,127,102, 6,210, 29,169, 83,222, 69, 82, 44,149,199,109, 75,218,227,163,160,
+189,250,250,224, 82,195, 45,190,165,205,120, 92,116,183, 91, 99, 25, 85, 71, 30,100, 67, 68,165,247, 73, 55, 66,124,175,235,139,
+201,108, 37, 57, 69, 60,154,147,102, 28,193, 41, 85, 72,245, 33, 84, 84,158,229, 3,187,251, 95, 18, 64, 61, 61,113,237,127, 62,
+201,175, 6, 27, 33,108,161,176, 74,148,149,220,168,159, 60, 70, 95,154,137, 8, 73,104,142, 19,181,203, 12,102,218,217, 91, 74,
+ 13,143, 16, 29, 78, 24, 54,132, 0, 99,106,116,172,136, 39,122,156,229,173, 67,221, 82,129, 2,187, 1,185,241,218, 89, 67, 96,
+ 93, 42, 81, 80,218, 7,227,108, 89,116, 71,179, 21, 31, 81, 94,165, 82, 99,179,151,153,161,197,223, 61,185,149, 0,181,168, 20,
+141,197, 4,248,183, 18, 65, 9, 7,140, 80,180, 10,173, 54, 43,203, 69, 74, 27,174, 40, 54, 67, 61,209,177, 74,252,142, 39,115,
+ 81, 88,246, 89, 82, 51, 54, 74,117, 18,229,197,109,214,139,151, 71,216,132,255, 0,172, 55, 55, 36,218,247,243,198, 22, 38,209,
+ 46,107,160, 32,141, 78,146, 72,212, 9, 0,232, 76,233,252,219,109,245,132,229,250, 81,154,254,166, 85,127, 72,170,217,121,213,
+111,139, 53,194,204,137, 18, 90, 14, 56,164, 5, 92, 40,219,139,222,220,140, 72,245, 37,186, 75,180,156,183, 71,203,154,145, 26,
+100, 88, 12,165,107,134,227, 10,105, 48,214,183, 6,224,178,174, 21,207, 36,129,211, 16,172,255, 0, 80,201,217,178, 37, 6, 86,
+157,229, 9,116, 56, 13, 67, 13, 84,170, 83, 29,220,137, 18,121,185, 7,201, 60, 88, 99, 93, 31, 57, 86, 41,236,211,114,134,161,
+209, 89,168,209, 26,150,169, 8,140,195,137,101,199,201, 77,133,222, 0,170,221, 45,229,140,146,195,138, 13,186,216, 41, 41,153,
+ 71,118, 78,132, 79, 49, 58,104, 51, 13,245, 52, 86,238, 86,161, 10,216,233,241,240,253,170,108,214,104,169,101, 12,241, 58, 46,
+105,159, 10,180,220, 39,193,167,211,216, 95,127, 17,194, 69,194,208, 83, 97,110,150,183,204, 97,228,238,208,149,202,236,216, 84,
+188,187, 22,149, 77,133, 70,154,169, 44, 73,106,158,148, 72, 36,128, 86,208,113, 41,185, 3,145,111,126, 33,153,131, 52, 84,227,
+ 81,103,102, 60,176,236, 72, 49, 95,117,182, 61,149,201,136,117,244,109, 59,129, 70,225,184,164, 90,215, 30,156,226, 63,150,115,
+ 69, 57, 16,101,203,173,255, 0,165, 43,188, 85,163,184,118,239, 42, 28,174,227,161,195,180,211,138,100,168,141, 68, 13, 58,192,
+157, 54, 7,222,124,234, 70,233,198,204, 36,192, 63, 41,235,185,171, 78, 70,100,203,153,194,109, 87, 57, 49,147, 93,105,151, 74,
+ 18, 35, 70,124, 32,178, 66, 44,108, 57,222, 9,241, 17,135, 29,158,234,129,157, 64,141, 10, 95,181,184,201, 73,118, 84, 54, 22,
+ 91, 68,176, 8,251, 37, 56,146, 10, 69,141,237,207,151, 7, 21,221, 17,232,173,215,125,147, 38,190,244,168,146, 34,131, 41,185,
+ 13, 13,237,221, 62, 32, 61,195,246,176, 41,252,207, 85,162,204, 12,208,115, 35,233,109,133,149, 89, 14,148, 16,111,197,185,247,
+ 12, 9,118,142, 62,202,217, 73,137, 2, 38,116, 31, 79,129,231, 51, 82, 69,242,144,160, 73,219,165, 93,189,165,181, 7, 38,229,
+108,252,154, 30,155, 72,169, 18,196, 80,154,187, 21,136,129,181, 71,147,114, 84,218, 10,198,245,161, 32,128, 20,176, 14, 22, 42,
+106,173,122,169,152, 39, 43, 58,106,229,102,163, 85,153, 85, 1, 76,205, 50,195,206,172, 35,194,123,194,162, 85,113,192, 23,244,
+194,196,108,173, 25,182,181, 67, 75, 73, 90,146, 32,171,121, 60,245,210, 96,233,183,157, 73,215, 74,220, 42, 26, 3,215,122,253,
+ 55,177, 33, 42, 1, 72, 87,192,131,135,168,112,119,124,168,123,206, 41,202, 30,171, 84,104,145, 83, 18, 67,105,125, 9,251,170,
+ 82,185, 24,115, 39, 92,234,132,142,226, 35, 41, 77,185, 4,223,156, 94,191,225,252, 65,245,101,108, 2, 58,205,122,189,167, 19,
+225, 73,111, 50,201, 7,164, 85,161, 46, 85,147, 96,175, 60, 13,149, 35,175,139, 21,219,154,215, 82,117,165, 5, 70,103,113, 30,
+ 21, 11,241,134, 82,117,142,164,153, 1,192,195,101,189,150, 40, 62,190,184,202,252,169,139, 40,254,145,235, 90, 72,226,236, 21,
+ 49,222, 62,149, 99,173,251,242, 78, 27,186,249,190, 43, 25,154,209, 91, 90,137,143, 29,148, 15,133,240, 18,173,170, 89,158,160,
+174,106, 5,161,251, 45,113,139, 12,112,102, 40,225,239,194, 71,156,252,170, 78,241,190, 14,218,123,153,148,124,163,231, 87, 27,
+142, 88,245, 24,192,200, 23,177,116,124, 47,138, 34, 70,160, 86,148,229,157,171,188, 72,255, 0,230, 28,105,119, 54,212, 92, 29,
+231,214, 46,159,131,135, 26, 72,224, 71,249,186, 61, 15,239, 84, 15,226, 5,176,217,147,234, 63,106,189, 37, 79, 97,181, 4, 56,
+250, 1, 61, 1, 86, 7, 75,204,180, 72,193, 69,250,163, 41,219,247,134,254,113, 71,202,205, 82,221, 59,213, 53,194, 71, 75,172,
+225,191,215, 14,173, 91,221, 93,239,234,113,117,158, 4, 72, 50,227,190,131,249,170,206,254, 33, 24,254,219, 32,121,159,226,174,
+ 33,170,185, 77,178,173,210,156,240,222,222, 14,184,212,246,182,229,166, 25,220,136,239, 41,103,245, 45,108, 83,206,203,120,168,
+ 40,116,198,181,187,179,198,165,223,231,141,102,248, 47, 8, 27,230, 62,255, 0,226,177,157,227,220, 89, 91,101, 30,239,230,173,
+ 21,235,236,181,135,147, 26,148,145,127,245, 37, 74,233,241,196,126,126,119,204, 53,153, 94,215, 46,172,232, 62, 73,109, 86, 9,
+252, 49, 12, 76,183, 2,192,108, 90,254,184,122,151,100, 5, 11, 44, 16, 71, 56,214,183,192,240,203, 19, 45, 54, 1,245,249,214,
+ 13,223, 17, 98,152,128, 9,117,210, 71, 77,190, 85, 38,107, 50, 87, 16,139, 26,172,130, 47,113,246,167, 29, 41,162, 57,106,163,
+150,178, 67, 47,214,222,113, 83, 39, 17, 33,212, 58,178, 75,105, 35,192,142,124,194,121, 62,245, 91,203, 20,223,103, 13, 34,168,
+231,250,250, 51, 37,102, 53,168,180,215, 2,157, 43, 28, 72,116,114, 27, 30,163,161, 87,187,143, 60, 92, 85,173, 77,166, 67,172,
+191, 74,113,244,165,198,239,100,147,201,199, 9,198, 23,246,225, 66,205,144, 58,168,143,128,250,159,117,118, 92, 35,103,112,164,
+155,183,137,141,146, 15,196,253, 7,190,164,181, 42,220,120, 39,126,240, 13,237,215, 17,220,207, 92, 84,132,150, 99, 58, 54,237,
+228,142, 77,206, 43,188,235,171,112, 89, 73, 83,147,146,147,126,128,244, 23,192,108,149,169,201,205,117, 31,104,102, 86,246, 82,
+178, 10, 47,192,244,199, 12, 65,203, 93,174,105, 52, 91, 57, 82,211, 38, 58,214,249, 82,148,121,235,142, 95,237, 15,145, 38,193,
+123,235, 58,115,138, 67,161,123,129, 79, 91,142, 69,142, 58,238,182,210, 38, 69, 74, 72, 35,120,184, 73,235,138,131, 88,178,114,
+171,116,245,182, 64,189,200, 73,244, 3,173,190,120, 10, 87,217,170,164,146, 66,166,188,236,149,218, 46, 22,105,161,181,150,107,
+ 83, 11, 51,225,253,155,232,113, 92,174,214, 0,140, 95,115,115,108, 7,153, 84,114,224, 55, 71, 39,169,199,206,188,219, 72,206,
+122, 81,152,218,206, 25, 85,210,151, 90, 88, 15, 32,126,186,111,200, 30,252, 92, 58, 99,218,250,133,156,224,165,167, 38,150,102,
+ 32, 4,201,140,233,241,165, 94,159,227,211, 23, 18,148,169, 50,157,170, 46,182,161,222, 78,213,208, 21, 58, 24,155, 33, 83,169,
+206,164, 27,114,112, 30,163, 2,170,180, 22,209, 98, 74,108,163,211, 1, 50,182,167, 49, 57, 14, 45, 50,197,130,111, 98,172, 57,
+149,168, 44,178, 18,148,188, 63,120,250,146, 73,254, 24,170,226, 32,233, 78,219,240, 53,175, 37,105,252, 41,112,146,186,145,222,
+ 66,175,221,143, 35,193,198,185, 45,194,140,216,105,224,148,139, 18,132,164,113,128,117,157, 75, 49, 2,251,217,169, 65, 60,139,
+ 43,200,121, 98,170,213,238,210, 52, 28,183, 74,118,108,154,178, 80,224,184, 66, 18,171,146,111,108, 2, 72,208, 84, 22,165, 58,
+ 96, 82,237, 27,168, 89,102,133, 77,146, 75,169,239,156, 96,132, 39,247,186, 99,159,180,214,139, 55, 53,215, 27,204, 51, 89, 82,
+119,120,144, 74, 72,184,190, 51,133, 31, 50,107,198,108, 69, 94,180,167, 90,166, 33,203,182,209,224,184, 79,159,195, 29, 3,144,
+244,218, 29, 38, 43, 72, 17,128, 64, 2,230,220, 28, 88,111,251, 73,215,115, 82, 82, 18,210, 35,157, 55,160,229,162,244, 61,174,
+120, 71, 80,160, 1, 3, 25,212,232, 97,182, 59,208,143, 18,122,170,216,158, 65,203,204,196,110,233,111,114, 7, 75, 14,131, 2,
+243, 37, 62, 51,108, 40,163,169,227,194, 57, 7,223,238,197,134, 46,138, 87, 84, 28,111, 74,163, 51,149, 9, 84,151, 83, 61,166,
+255, 0,209, 95, 90,130,118,255, 0,209,172,117, 65,254, 35,212, 98, 62,228,198,211,194, 83,139, 38,171, 30, 29, 69,110, 82, 38,
+168, 8,211, 83,181, 75,181,203, 15, 39,238,172, 15,196, 31, 81,124, 87,117,220,189, 62,137, 84,114,151, 53,177,189,181, 88,148,
+158, 20, 58,133, 3,230, 8,228, 31,126, 62,131,224,254, 33,111, 20,177, 13,186,175,238, 32,107,226, 57, 31,161,241,243,175, 30,
+226,140, 29, 88,125,223,104,216,254,218,246,240, 60,199,237,252, 83, 9,147,129,108,128,139,122,224,114, 29, 88, 89, 40, 23, 39,
+ 6,133, 40,173, 22, 40, 22, 35, 9,170, 10, 26,231,129,142,216, 92,182, 5,114, 93,225, 76,162, 51, 42,219,220, 80,177,232, 48,
+245,150, 6,235,168,115,141,141, 83,214,130, 44,120,198, 74, 97,212, 47,194, 46, 61,112,198,225, 39,157, 54,101, 86, 15, 54,178,
+155, 14, 49,173,182,202, 85,117, 27,227,110,201, 10, 59, 45,197,240,155,153, 76, 19, 61,128,205,103,191, 72,186,153,223,226, 2,
+221,109,136, 42,229, 8, 26,154,140,170,182, 29,136,177, 66,108,122,223, 24, 63, 82,110, 3,125,252,167, 10, 16, 60,254, 87,195,
+ 81,152,155,141,189,188,193, 29,168,197, 43, 74, 90, 91, 78,239, 75,187,151,181, 54,244,242,189,240,238, 94, 87,203, 57,138, 11,
+ 53, 61, 67,172,162, 6, 94, 14,157,201,109, 37,217, 15,184,139, 16,139, 54,163,181, 36,237, 5, 70,246,221,124,114,220, 67,197,
+118, 24, 38, 26,229,202,204,168, 76, 38, 9, 36,232, 32, 13,206,227,106, 51, 9, 46, 58,148, 76, 77, 17,137, 92,101, 25, 98,109,
+113,165, 22,215, 1,145, 37,248,175, 50,176,226,162,220, 2,242, 46, 0, 85,175,123, 92,124,113, 8,175,246,167,163, 81,105,243,
+232,172, 83,123,195, 80, 81,136,100,206,140,149,123, 59, 42,108,221,101, 0,158, 13,193, 10,191, 24,107,154, 39,211,179, 62, 98,
+171, 61,217,234,147, 50, 19,113,166, 9, 81, 62,184,125, 18,223, 41, 62, 29,140, 40, 0, 30, 70,244,216, 34,198,194,215,231, 21,
+180,202,150,113,207,185, 46,187,159,117, 50,155, 75, 93,120, 84,125,154, 75, 51, 35, 22, 30,219, 98,178,226,118,169, 33, 92,133,
+ 11,112, 5,177,225,119, 92, 99,137, 98,229, 66,249,194, 26, 86, 89,108, 16,149, 39, 52, 64, 32, 3, 35,172,168,244, 32,131, 90,
+192, 54,196,134,245, 80,231,203,220,126, 59, 84,165, 29,162,179,157, 37,164,211, 36,103, 8,213, 74,125, 45,135, 89,163, 38,147,
+189, 14,177,188, 41, 42, 78,228,237, 82,146,171,220,223,173,176, 83, 50,106,109, 70,110, 69,246,106,189, 18,189, 61, 69, 59,166,
+212,163, 70, 89, 67, 10, 74, 56, 5, 43, 23, 87, 66,110, 15, 56,170, 51, 5,114,153,151,178,100, 28,229, 71,166, 46,152,182,160,
+247,110, 3, 45, 46,183, 53,221,228, 41,208, 57, 41, 72, 30, 18,159, 94,152,101,151,117,111, 85,116,204,210,243,213, 58,171, 93,
+ 48, 21, 23,116, 50,243,170, 44,186,146,181, 5, 49,226, 4, 4,216,146, 13,143, 76, 98,151,148,153,118,204,101, 82,165, 36, 19,
+151, 57,214, 82,114,233,169,212,239, 36,201, 18, 42,201,184,116,146,151, 21, 49,175,220,235,211,253, 80, 93, 83,175, 80, 43,148,
+202,100,246,171, 79,170,170, 95,113, 79, 73,147, 35,188, 88,109, 55,219,100, 44, 0,132,250,251,241, 9,118,167,147,100,231,236,
+191, 5,186,100, 72,240,156,167,169,170,172,237,253,232,150,242,129, 55,241, 27, 54,111, 97,113,211, 19, 74,236, 45, 43,204,148,
+243,171,114,115, 12,199,171,213,153, 74, 68,156,166,251, 41, 45,181, 31,175,122,183,146, 2, 72, 85,136,216, 44,160,122,140, 65,
+159,127, 50,101,234, 42,170,121, 61,182,133, 40, 74, 72, 45, 38, 27,111, 6, 10, 93, 4, 5, 18, 9, 63,218, 49,176,211,134,226,
+216, 40,102, 7, 84,247,164, 65, 51, 48, 72,239, 1,174, 83, 25, 76, 72,229, 84,110, 51,165, 65, 70, 57,125,255, 0, 21, 12,206,
+236,192,161,231,167, 30,167,211,239, 1, 47,148,169,168,174,111, 78,192,124, 69, 39,161, 54,243,193, 9, 52,212, 85, 98, 57, 78,
+203,153,114, 91,241,230, 29,237,191, 37, 73,178,135,152, 42,176,231,225,128, 25,174, 85, 66,187,155,101, 53, 22,162,153,174, 76,
+120,237, 33, 1,161,117, 27,170,192, 88, 36, 98, 65, 91,107, 51, 35,234,252,181, 25,180,192,101,136,214, 90,158,116,144,108, 62,
+246,235,241,242,199, 67,108, 22, 16,137, 58,199,143,251,172,155,135, 14, 96,158,181, 8,173,192,168, 64,205, 97,138,221, 65,104,
+238, 89, 66, 10, 20, 73,238,145,183,132,220,121, 14,152, 19, 81,162,180,228,213, 41, 50, 74, 90, 54, 45,186,161,109,222,254,112,
+253,202,133, 77, 83,228, 63, 49, 73,144,165, 44,253,178,145,126,240, 94,220, 95, 4,179,221,101,186,189, 42, 26,234,176, 82,194,
+211, 15,187,105,104,103,104, 36,113,113,239,198,251,101,105, 82, 83,247,233, 78, 74,147, 21, 10,146,197, 53,169, 37, 13,186, 92,
+ 64, 28, 43,215, 12,247, 54, 93,224,112, 56, 73, 39, 14,123,174,228,141,200,186,135,204, 28, 35, 0, 74,146,148,199,240, 5,216,
+ 88,159, 60, 91,216, 81, 38,177, 97,148, 54,165, 39,119, 10, 28,115,231,140, 35,119,137,116,169,231,108, 45,212,244, 56,112,251,
+ 9,142,187, 44, 13,201, 22, 81, 9,190, 60,102, 34, 55, 1,191,105, 42,232,175, 63,199, 17, 42, 4, 26, 64,198,244,119, 79,232,
+121,178,177, 91,139, 31, 40,211, 4,169,137,145,222, 71,107, 98, 84, 20, 71, 60,223,203, 7, 17,154, 51, 54,101,204, 50, 63, 78,
+125,181,249,142,184, 33, 42, 96,117, 68, 52,145,225,238,236, 60, 33, 41,177, 60,122, 98, 57, 18,169, 42,137, 40, 61, 71,125,198,
+ 94, 74, 56,121,151, 8, 41,248, 17,211, 18,109, 47,145, 18,136,245, 95, 59,187,156,153,166,200,167, 68, 10,133, 78,168, 70, 83,
+202,158,242,252, 42, 9, 9,225, 36, 3,123,156, 98, 93,153, 74,150, 82, 14,128, 39, 67,154, 73,218, 68,232, 76,114,142,102,138,
+209, 10, 58,214,189, 75,203, 57,103, 45, 84, 24,202,217,103, 63, 46,174,203, 98,234, 40,220,150,219,227,158,166,196,220,158,152,
+209, 55, 53,193,145, 71, 12,213,156,126, 93, 66, 34,144,212, 57, 1, 96, 33, 44,167,245, 72,235,123,224, 83,117, 38,228, 87,100,
+ 78,137, 7,218, 84,224, 82,128, 95, 39,158,164,113,199,174, 36, 82,165,229, 37,101,136,217, 85,134, 18,203,179, 89, 75,239,204,
+124, 32,169, 47, 2, 65, 73, 87, 80,139,121,117, 56,174,232, 82, 16,218, 92,149, 30,103, 73,241, 38, 0,244,141,105, 19,222, 58,
+208,248,212,250,166,106,138,149, 83,221, 43, 68, 84, 23, 28,218,139, 4, 14, 73,249, 97,145,125, 18, 59,214,100,192, 67,164, 89,
+ 69,192,162, 56, 30,152,243,235,105, 10,101, 81, 98,184, 99, 51,110,237,192,194,136, 74,199, 67,199,166, 20,168, 81,162, 5, 52,
+196,207,104, 73,105, 37, 46, 52,155, 38,231,168,247,219, 4, 0,133, 65,247,127,186,132,211,102,234,221,197, 65, 82,105,189,226,
+ 66, 65, 66, 16,165, 27,218,214,228,140, 17,201,149,215,104,149,148,212, 83, 25,135,130,219, 83,110, 55, 36, 2,147,127,225,129,
+208,227,197, 40, 91,100,157,233,191, 32,227,199, 42,204, 55, 72, 77, 61, 20,182,251,192,233, 90,228, 90,235, 80,242, 79,195, 4,
+ 91,105,113, 5, 25,100, 29, 41, 3, 38, 41,245, 86, 89, 18, 73,102,123,102,228,221, 3,144,142,122, 15,118, 22, 52, 26, 90, 90,
+136,204,244, 62,202,196,144, 78,197, 40, 93, 22, 54,228,121, 97, 97, 32,164, 38, 5, 54,252,235,244, 4,138,226,212,129,189, 68,
+143,142, 60, 53,164, 95,149,143,134, 0,170, 65, 41, 0,227, 36,184,139, 2, 18,111,240,199, 93,157, 6,181,187, 69, 81,165, 85,
+151,212, 12,105,114,164,181,117,227,231,134, 40,148, 45,208,223, 26, 36, 62,226,142,219, 31,134, 28, 45, 0,210,237, 21, 79,213,
+ 81,109, 63,121, 64,159,121,195,103,170, 13, 40,155, 92,252, 48,201,196,168,244, 29,113,136, 66,211,200, 23, 24, 40,117, 2,163,
+218,168,214,215,130, 22, 10,193,231,210,248,212,220,149,182, 8, 83,119, 7, 30,219,127,234,219, 25,182,197,207, 32, 96,130,225,
+ 49,173, 64,173, 70,180,148, 23, 15,221,235,132,220,115,188,120, 78, 8,181, 25, 9,111,114,128,233,198, 49, 43,101, 60, 20,243,
+135,246,161, 76,115, 86,149, 37,101, 27, 74,113,225, 97, 42,176, 62, 88,112,151, 89, 80,177,242,194, 5,147,116,132,242,112,141,
+204, 83,101,147, 94,196, 97,165,144, 22,143,158, 37,186,123,167,210, 51,198,102,135,150,233,226,206, 74,116, 37, 75,181,195,104,
+ 28,169, 71,220, 5,206, 35,176, 99, 3, 97,183,242,199, 71,246, 84,200,200,203,244, 55,115,213, 73,144, 31,158, 59,168,100,142,
+ 82,200, 62, 37,123,183, 40,126, 9,247,227, 7, 26,198, 69,149,170,150, 14,187, 15, 51,247, 53,209, 96, 88, 89,196, 47, 18,212,
+105,185,242, 31,113,239,171, 45, 48,178,246,153,228,182,168,212,166, 80,196,104,108,109,109, 62,103,213, 71,212,147,201, 62,167,
+ 28, 17,218,239,180,114,178,222,116,114,161, 68,151,220,186,208, 41, 95, 60, 45, 55,199, 79,246,162,213, 70,168, 20,215, 34, 34,
+ 69,174,131,201, 54,191, 24,249,119,218,231, 80, 5, 65,217, 82,139,227,119, 54, 36,244,199,149, 1,237, 78,151, 23, 94,196,202,
+ 18,130, 26, 64,208, 81,124,229,219,133,198,225, 42, 68,138,178, 84, 92, 77,138, 66,185, 22,190, 36,189,135,187,104, 10,198,174,
+ 71,200, 83,218,113, 81,234, 69, 74,101,197,182,108, 8, 5, 71,159,128, 56,172, 59, 4,118, 33,153,218, 14,106,245, 27, 55, 37,
+102,156, 28, 62,205, 29, 98,232, 85,143,222, 32,245,254, 24,238,173, 58,236,193,166,154,105, 57, 46, 82, 50,187, 6,111, 9,246,
+197, 71, 1, 96,126,202,125, 6, 51,111,111,218, 65, 45, 33, 51,227, 91, 13,177,110,148,144,119,171,190,173, 86, 97, 40, 68,212,
+ 32,108, 45,141,188,242, 15,166, 34,249,141,166,102, 70, 11, 13, 2, 20,174,125,195, 27, 39, 10,155,174,166, 59,141,169, 13, 35,
+165,241,141, 81, 14,189, 20, 50,219,106,233,123,218,216,204, 23, 5,102,161,216, 4,138,170,179,222, 71,167, 84,227,184,243,205,
+ 5, 1,250,160,117,248, 99,156,245, 67, 66,167, 55, 81,250,251, 44,188, 97,206, 97, 91,146,227, 55,230,254, 71,212,117, 24,236,
+153,153, 82, 98,226,111,117,187, 19,200,184,233,136,126,101,201, 44,169,149, 20, 50, 3,150,176, 39,204,127,139,224,200,184, 90,
+ 12,138,100,247, 14,149,197,185,155, 87,123, 70,100, 58, 98, 96, 70,163,135,210, 31, 79,125, 33,181, 16, 74,111,211,242,196,151,
+252,240,107, 41,163, 67,166,185,151,167,174, 90,152, 30,208, 67, 68,128,174, 46, 47,243, 56,188, 51, 62,155, 48,255, 0,136,198,
+ 79, 34,234, 5, 63, 60, 86, 85, 76,145, 14, 5, 68,165,112,209,181, 74, 85,136, 79,167, 24,184,151,210,238,138, 20, 23,123, 44,
+191,166,171,250,198,168,235,126,164, 47,217, 40, 20,111, 96,101,107,186,221,148,191, 21,173,199, 3, 25,229,125, 6,172, 85,106,
+ 40,168,231,186,155,147,228, 15, 18, 19,127, 0,230,253, 15, 95, 60, 90,244, 44,174,195, 9, 74,216, 66, 74, 77,186, 11, 98, 91,
+ 73,164,178, 22,128,166, 64,177, 22, 22,233,137, 74, 83,176,170, 6,229, 64,194, 68, 83,125, 50,211,184,112, 16,218, 19, 28, 55,
+182,214,176,227,225,139, 58, 27,113,154, 72, 96, 53,247, 71, 81,208,251,240, 30,156, 35,176,218, 16,221,129,231,129,135,162,162,
+218, 89, 37,162, 55, 36, 92,223,207, 21,220, 84,212,115,147,169,162, 98, 91, 49,154, 44,128, 45,123,120,191, 86,231,174, 35, 57,
+130, 91,114, 30, 83, 77,139, 42,223,115,204, 17,249, 28, 48,171,231, 72,241, 74,146,137,105, 74,174,119, 37,125, 71,248,254,220,
+ 65,234, 26,136,219,210,220,219,177,181, 33, 94, 27,168,157,255, 0, 3,239,235,248,140, 13, 25,137,210,160,165, 72,210,135,214,
+ 36, 51, 31, 51, 45,144,176, 89,125, 65, 91, 83,250,170,189,190, 68, 28, 62,206, 25, 53, 85,186, 97,125,182,183, 75,132,201,113,
+178, 7, 46,178, 57, 82,125,229, 63,120,123,183,123,177, 90, 72,206,111,230,125, 85,133, 64,165, 74, 70,254,240,170, 69,141,236,
+142,164,227,162,161, 68,238,163, 49, 46,201,220,201, 10, 70,255, 0, 81,229,243,199, 71,134, 98,175,225, 87,109,190,217,212,111,
+226, 57,143,125,102,226,120,122, 47,173, 11, 46,127,144,244, 60,141, 81, 46, 48,211,104,251,159,150, 27,173, 37, 99,193,198, 36,
+250,131,250, 35,150, 51, 36,186, 75,211, 59,189,170, 11,109,178,147,112,133, 13,201, 31,129, 31,134, 43,204,201,159,154,140,224,
+ 69, 10, 23,120, 55,114,167, 56,191,195, 30,255, 0, 97,114,253,243,105, 91, 73, 48,160, 8, 59, 8, 58,138,241,107,171, 53, 48,
+225, 66,134,163, 74, 50,166,157,218, 0, 73,194, 76,119, 15,131,187, 39,229,136, 19,181,172,209, 46, 97,152,229, 77, 77,120,183,
+ 37,180,171,129,238,198,117,156,243, 83,141, 5, 18,235,117,116, 50,195,100, 37, 79, 18, 16,155,251,206, 54, 61,149,244,128, 74,
+199,143,133, 80, 45,164, 81,108,241,169, 52,140,153, 29, 17, 2,183, 75,152,178,203, 14,119, 91,144,202,173,247,148,110, 2,109,
+239,227, 20,222,104,207,191, 90,230,183,101, 81, 43,110,251,100,118, 86,185,110, 48,240,101,151, 72, 77,146, 85,180,144, 79, 91,
+249, 98, 83,171,148,232,211, 50, 67, 53, 25,149, 30,230, 29, 65,149, 56,196,150,156, 27, 94, 74, 79,139,197,229,233,108, 80,250,
+134, 36,100, 89,107,147, 22,169, 29,159,173, 90, 75,113, 88,109,226,151, 18,216, 23, 5, 68,113,110, 71,151, 56,243,254, 33,196,
+ 2,111, 74, 26,115, 48,210, 4,130, 9, 27,157, 54, 35, 95, 77,106,147,189,229,194,106, 91,157,181,169,186,195, 81,234,185,201,
+ 8,126, 93, 61,109,136, 44, 68,126,204, 62,155, 1,247,128, 27,194,108, 56, 81,228,223, 1,171,186,138,251,242,197, 99, 38,195,
+139, 53,118, 73,101, 14, 52,148,119,124,221,104,176, 62, 43, 27,117, 29, 6, 42,204,227,171,213,217, 18, 34,156,217, 57,180, 34,
+ 46,198,196, 40, 76,160,178,173,167,196, 8, 28, 92,142,111,231,128, 79,235, 21,118, 38,104,118,175,149, 42,242, 35,133, 56,144,
+195, 4, 13,170, 0,220, 11, 90,223, 44,114, 46, 91,190,240,152,235,164,156,190, 91,124,124,230,157, 13,168, 65, 21,211, 52, 14,
+211,249,213,202,165, 62, 91, 79,184,229, 74, 52,221,242, 35, 52,148, 52,137, 77,109, 2,214, 30, 97, 93,108, 5,240, 7, 87,181,
+134,179,168,217,114,117, 27, 52, 79, 69, 1,216,210,213, 38, 13, 54,151, 5, 45,176, 93,106,225, 8, 34,251,183, 16, 73, 36,245,
+ 38,254,236, 83,185, 87, 85, 42, 16,115, 23,233,149, 36,188,156,192,213,214,233,125,180,173,189,196,242, 80, 45,225,235,131, 82,
+171,245, 92,231, 91,101,186, 29, 71,188,152, 86,153, 11,147, 33,178,224,113,194, 46,187,133, 2, 71, 34,194,216,231,157,193,173,
+217,185, 14,150,194, 96,111,211, 89,233, 17,227,189, 17,181,184,209,128,116,160,209,115,115,243,171, 70,175, 85,141, 34,100,197,
+ 52, 1,106, 74, 18,150,155,112,171,239, 41, 32,120,147,205,252,177,117,230,246, 42, 85, 76,171, 66,113,170,188, 25,117, 74, 72,
+ 65,150,219, 79,160, 33, 76, 43,254,133, 45, 17,185,106, 74,175,207, 75, 30, 49, 42,103, 82,161,229,185, 3, 54, 61,165,244,204,
+199, 58, 69, 48,194,146,163, 8,161, 47,149,182, 54,149, 35,187,178, 84,155, 17,112,160, 73,247, 98, 5,172,153,199, 45,200,250,
+178, 69, 29,138,132, 88,136,111,186, 98,128,169,165,197,197,106,193, 72, 73,115,131,180, 40,168,132,158, 69,173,142,117,203,135,
+241, 27,198,194, 89,200, 19, 58,200, 35,104, 34, 52, 32,116,208, 3,185,212, 69,107,182,180, 54,217, 42, 50, 85,203,235, 63,102,
+174, 28,213,216,210,153,155,114,244,126,208,212,170,107, 52,140,144,136, 66, 85, 78,151, 73,134,250,222,109, 9,103,114,212, 23,
+180,221, 74, 32,155,126,175,158, 57,142,191, 80,131, 5,229, 63,147,158,168, 69,164, 73,220,166, 67,227,196, 20,146, 64, 10, 35,
+195,114, 15, 39, 10,177,171,217,234,185,148,166,101,214, 42,114,227,101,245,202, 71,181,180,196,162,134,156,178, 74,127,213,240,
+147,113,235,207, 95, 92, 88,240, 53,142,145,150, 52, 18,177,151, 98,126,141, 74, 85,110,148,202, 11, 41,162, 44,189, 21, 64,217,
+ 73, 73, 36,132, 18, 44, 74,141,129,196,237, 89,198,112,230, 2, 46, 87,219, 12,193, 41, 3, 76,169, 39,252,143,122, 84, 38,100,
+193,129,227, 82,125,198, 46, 18, 50,140,164,111,207,225, 84, 44, 20, 85,235, 21,118,106,180,250, 83,108, 49, 20, 0,167, 89, 98,
+193, 69, 35,169, 87, 36,156, 25,143,153,163, 84,242,197, 82, 14,101,202,211,107, 21, 96,226,141, 49, 77,238, 37,171,141,160, 41,
+ 62, 96,117,195,120, 57,129, 89, 78, 42,226,161,245, 77, 74,144,151, 80,216, 77,144,207, 4,216, 15, 60, 11,211,125, 93,171,229,
+156,229, 58,171, 5,113,132,137, 49,214, 90,121,203,168,161, 94, 93, 63,134, 61, 2,221,149, 56,201, 82, 83,182,218,145,241,223,
+206,176, 30, 11, 83,164,129,176,210,163,241,164, 71,165, 58,137,242, 24,118, 91,160,125,213, 35,111,118,160,109,247,124,249,198,
+ 85,233,149, 60,208, 75,213, 23, 18,195,169,108, 37, 9, 91, 99,119,185, 33, 35,204,225,235, 21,154,115, 80,229,207,152,195,143,
+ 74,125,197,222,235, 0,110, 60,130,124,250,146,112, 1,218,180,212,213,217,205, 8,146,130,184,235, 14, 54,176,143, 14,244,249,
+ 88,227, 89, 9, 42, 92,198,163,157, 25, 18,121, 86,154,238, 89,169,211,167, 70,133, 50, 59,137,117,230,130,130, 29, 78,210, 1,
+247,124, 48, 46,124, 87,104,242,148,195,142,165,197, 52,144, 72,108, 95,175,145,247,225,230, 96,205, 85,124,209, 93,127, 48,213,
+230,151, 36,190,177,180,164,216, 39,208, 15, 64, 6, 53,212, 41,114,163, 33,151,152,116,189,223,179,189,224, 7, 32,131,208,226,
+226, 51,165, 35, 62,245, 45, 6,149,141, 26,169, 17, 11, 9,148,194, 8, 31,168,180, 92, 43,240, 55,198,185,168, 83,210,148,234,
+174,110, 60, 42, 95, 0,140, 52,121,185, 44, 52,169,139, 77,130,172, 16,147,140,102,167,189, 90, 7,181, 41, 86, 9,178,119, 92,
+ 36,122, 98, 61,152, 14,102, 6,167,148, 17, 68,160,178,167, 92, 75,109, 77, 12, 20, 90,202, 60,130,161,231,111, 76, 77, 50,158,
+107,204,117,106,125, 70, 13, 90,147, 6, 98,149, 21,100,200,126, 56,222,158,121, 82, 79, 2,254,152,129,183, 41,168,219, 86,167,
+210,164,130, 55, 18, 57,196,150,150,191,110, 75,139,118,162,150,132, 54, 2,217, 12, 54,119, 56,162,176,108, 79, 83, 97,126,125,
+216,203,190,104, 45, 48,161,207,120,219,235, 83, 65, 32,105,181, 19,211,122,123,210, 42, 63, 85,192,161, 68,118,106, 17, 33, 64,
+200,112,161, 91,123,191,214, 36,132,217, 61,112, 5, 80, 97, 46,166,204, 58,187,142, 71,109,197, 18,226,208,144,171,115,250,190,
+184,123,154,227,192,138,243, 79, 71,125,215, 36, 58,119,169,237,214, 70,211,211,222, 77,186,225,180,202,178,106, 12,253, 97, 61,
+246, 86,241, 33, 10, 64,107,144, 0,181,197,184,197,102,195,138, 89,112, 29, 20, 61,224,235,231,167,184, 82, 36,101,131, 91,102,
+197,167, 83, 92, 67, 9, 67,142,176,234, 9, 38,195,112,183, 79,134, 7, 41,200,201, 64, 90,183,182, 66, 60, 40, 82,174, 15, 56,
+213,237,136, 67,247,142,141,202,189,146,160, 60, 36, 99, 23, 18,165, 32,182,232, 38,234,244,233,139, 40, 68, 1, 52, 49,214,144,
+146, 25,121,192,211,182,230,226,195,175,187, 30,169, 15, 73, 79,122, 88, 28, 30, 66, 7, 24,214,232, 97,106, 74, 80,141,170, 2,
+202, 54,228,227, 89,144,252,119, 3, 33,106, 69,254,246, 11, 19,181, 32, 58, 83,134,228, 71,108,158,250, 34, 84, 79, 34,202, 32,
+ 15,195, 11, 26, 84, 86,159, 8,177, 3,162,135,159,227,133,133,150,165, 95,124, 18, 82, 19, 98,113,155,110,160,248, 65,195,103,
+ 92, 80, 79,217,245,195,115, 45,246,205,139,119,248, 99, 72, 61, 90,154,209,134,146,131,239,199,142,150,118,220,218,248, 31, 30,
+107,202, 28, 2, 49,154,222, 90,147, 99,135, 15,107, 79, 91, 84,176, 85,100,140,109, 67, 74,219,113,134,173, 5,169, 64,129,135,
+236,188, 80,139,144, 58, 98, 93,189, 54,245,165, 65, 77,248,146,156, 98,135,148,181,109, 32, 12, 57, 76,134,110,123,192, 57,243,
+182, 52,173, 41,223,189, 39,174, 28, 63,165, 42,113,177,245,180, 2, 20, 45,140, 91,134, 28, 4,175,174, 54, 70, 89, 7, 97, 60,
+123,241,181, 41, 78,238, 21,107,249, 97,195,230,149,107,106, 19, 97, 94, 35,135,208,232,241,220, 55, 42,231, 13, 28,108,245, 75,
+167, 27, 97,214,105,176, 28, 9,149, 57, 0,223,161, 86, 34,167,148,161,165, 21,176, 38,164,249,103, 45, 57, 85,170, 69,163,196,
+108, 41,217, 47,161,166,193,245, 81, 0, 99,175,162, 81,225, 80,168,140,211,162, 54, 18,212, 88,233,109,176, 5,172,148,139, 99,
+157, 59, 44, 66,167,231, 45, 74, 68,182, 30, 11,106,149, 29, 82, 87,111,219, 62, 20, 15,196,223,250, 56,232,220,212,235,140,209,
+222, 90, 20, 5,144,109,127,134, 56,110, 35,121, 75,112, 32,255, 0,136,248,159,227,231, 94,157,194, 86,221,157,186,158,255, 0,
+145,143,112,254,126, 85,193, 95, 72, 22,175,183, 74,204, 78,210,146,224, 66, 91,108,146, 73,243,231, 31, 57,235, 53, 42,142,186,
+107, 4, 13, 57,164,190, 84,153,179, 2, 93, 82,121,178, 47,226,233,238,197,235,244,170,234,101, 82,151,158,157,132,226,246,172,
+173, 86, 32,158, 70, 43,255, 0,162,127, 79,191, 75,117, 93,121,242,174,201,117,109,174,204, 41,126, 66,252,156, 97,169, 65,139,
+ 18,191, 10,237,109,209, 29,227, 95, 82,123, 47,233, 13, 55, 78, 52,246,157,148,168,116,224,204,120,241,144,130, 66, 66,111, 97,
+207, 76, 88,163, 43, 70,114,178,151,251,164,142,230,251, 82, 71,159,175,191, 30,229,217, 40,166,211, 99,134, 0,229, 33, 40, 3,
+225,212,224,205, 49,166,101, 21,204,112,149, 39,160,231,169,199, 50, 16, 21,189, 31, 49,154,208,140,165, 30, 82,212,235,236, 2,
+ 2,120, 4,117,192, 89,249, 80, 9,214, 67, 62, 0,108, 13,188,177, 45,246,194, 18,160, 20,120, 79,136,250, 99, 38,154,105,230,
+210,167, 5,129, 55, 36,224,201,105, 39,106,137,112,212, 42,171,151, 84,251, 69, 9,111,202,247,247, 98, 25,152,242,219, 33, 91,
+144,130, 44, 69,238, 49,114, 79,134,197,192, 77,185, 24,139,102,106, 67, 15, 36,182,210, 7, 78,184, 75,106, 41, 5,205, 81,185,
+142,130,132,143,190, 73, 4,237,182, 42,140,243,149, 31,106, 74,150,211, 36,165, 87, 36,132,244, 56,233, 26,222, 82,222, 75,138,
+104,139, 90,226,216, 28,206, 70,137, 38,237,203,136,135, 15,150,225,239,192,194,148,131, 73, 64, 26,229,186,124,153,212,164,247,
+ 75,108,236, 42,227,118, 15,211,179, 76,107,165,123,188,188, 87,242,197,237,153,116, 46,131, 88,136, 82,136, 40,105,100,125,228,
+ 14,190,254, 49, 81,103, 78,207, 53,234, 83,170,145, 76,124, 4,146,109,212,131,243, 24, 50, 95, 10,208,213, 53,180, 38,104, 76,
+188,255, 0, 10,150,164,205,117,207, 5,185,231,166, 34,217,199,180, 54, 87,202,209,213, 58,101, 73, 40, 67,104,186,146, 85,107,
+240,113,167, 49,100, 90,194, 89, 93, 50,176,167,154, 31,180,132, 94,216,175,243,231,102, 12,147,159, 40,174,194,168,230, 10,138,
+ 92, 82, 78,199, 18,177,180, 18, 45,202, 72,228,124,240,100,165, 11, 58,154, 9,109, 3,122,168, 53,123,233, 29,200, 82,115, 7,
+213, 84,170,170, 59,192, 44, 86,211,128,139,252,127,199, 76, 4,157,218,226, 10,178,212,138,233,168, 13,193, 35,109,149,231,238,
+197, 11,218, 87,232,240,173,100,137, 18,106, 57, 97,197,119,141,149, 45,167, 24, 55, 75,131,202,227,203, 20, 29, 23, 50,102,104,
+213,182, 50, 77,121,110,180, 34,175,237,144,229,193, 42,191,191, 27, 76,217,219, 45, 18,131, 68, 75,109,146, 2,107,233, 39, 97,
+202,157, 71, 61,103,247,179,117, 90, 74,139,210,212, 44, 9,224, 38,252, 12,125, 14,166,101,216, 83, 40, 73,109,230,183, 2,221,
+186,242, 14, 62,108,118, 17,205, 52,138, 34, 99, 44, 73, 78,241,107,221, 88,250, 65,167,249,149,170,206, 88, 75,241,222, 71, 40,
+227,156, 83,187, 64, 66,166,165,114,137, 85,115,239,105,140,166, 96,203,143, 90, 66, 74,182, 44,197,117, 68,116, 31,121, 31,255,
+ 0,223,225,138, 82,169, 83,102, 58,131, 65, 60,164,243,198, 58,163,180, 62, 95, 85, 75, 34, 86, 94, 39,114,208,199,180,182, 71,
+146,155, 59,143,254, 29,195,231,142, 60,171, 73,113, 74, 42, 32,254, 56,246,207,195,220, 80,221, 96,129,181,157, 91, 37, 62,237,
+199,206, 61,213,228,220, 95,109,216,222, 21, 39,101, 9,250, 26,242,181, 95,150,212, 71,156,167, 52,151, 30, 66, 9, 66, 86, 72,
+ 73, 62,134,216,172,115,150,166,212,162, 68,151, 84,175, 81, 94,110, 68,196, 37,142,237,230,202,153, 27, 9, 37, 73, 79, 4, 30,
+150, 55,196,240,200,108, 33,196,189, 40, 48,165,167,107, 78,168,139, 5, 30, 1, 55,242,197, 3,173,217,199, 53,185, 85, 93, 55,
+ 53,203, 87,176,174,120, 67,107,142,187,157,169, 54, 33, 32, 14,120,243, 54,224,226,231, 22,222, 30,213,150,208,173,119, 35,156,
+120,107, 63, 10,243,181, 41, 69,200,161,217,147, 88,133, 90,165, 22,161, 62, 67, 82, 66,157, 87,181, 37,194,164,161, 32,253,209,
+215,143,144,196, 27, 54,103, 52,212,179, 10, 32,228,254,253, 81, 98,190,146,135,101,184, 28, 40, 81, 54,224,244, 9, 23, 56, 0,
+227,175, 84,234,210, 98, 80, 19,222, 52, 73, 61,242,135,250,180,223,239, 40,227, 84,121,141, 46, 67, 52, 90,105,105,233, 5, 14,
+ 50,235,155, 64, 66,145,215,117,250,252,206, 57, 5, 50,216, 94, 97,200,109,203,204,138, 32, 17,189,105,206, 76, 86,105,149,121,
+ 16,106, 50, 91,124,153, 1,199, 8, 63,126,227,239, 15,136,195, 33, 80, 74,101, 7,169,112,144,206,199,183, 54,227,203,185, 2,
+221, 44,122,227, 10,173,106,171, 37,210,197, 90,167,223, 45, 36, 14,249, 70,228,132,139, 36, 3,134,238, 60,138,131,237, 56,251,
+235,117,222,236, 39,104, 79, 34,221, 6, 44,161, 10, 8, 25,190, 31,181, 19, 97, 82, 90, 62, 98,118,146,234, 42,237,168,185, 57,
+213, 41, 47, 5,178,149,164, 3,199, 3,167, 79, 60, 78, 52,243, 86, 98,228, 28,215, 25,117,154, 74,102,182, 92,188,202, 89, 81,
+108, 57, 96,118, 89, 96, 18,142, 77,205,177, 87, 55, 30, 85, 61,148,189, 37, 14, 32, 63,101, 52, 28, 28, 56, 1,183, 24,119, 53,
+232,205,253,139,144, 18,195,171, 59,131,197,100,169, 28,117,248, 28, 81,185,179, 98,229, 5, 10, 18, 21,161,143,223,195,195, 95,
+125, 50, 66,115, 2,107,171, 52,255, 0, 56,208,181, 43, 42,230, 35, 42, 27,240, 36,193,166, 38, 67, 34,139, 60,166,239, 38,224,
+ 40,169,125, 13,143, 33, 35,155, 98,130,204, 83,164,199,169,119,146, 61,161,228, 62,162, 91, 15,187,117,130,129,107,159, 76, 76,
+ 59, 49,103, 28,165,149,232,253,204, 53,207,159,152,171, 51, 87, 13,218,100, 20,173,197,187, 29, 73, 1, 41, 74,109,109,197, 64,
+243,215,156, 70,179,116, 7,224, 87,133, 26,144,219,177, 37, 68, 46, 9, 48,234,119, 75,169, 5,118, 41, 36,142, 77,186,244,199,
+ 41,103,108,139, 44, 77,246,146,146, 19,164, 79,128,131,227, 18, 52, 60,234,202,130,202, 1, 53,141, 71, 86,235,245, 13, 51,119,
+ 79,229, 80, 34, 72, 92,185,205,201,102,112,140, 59,230, 66, 83,183,186, 73, 3,145,107, 30,122, 99, 86,155,211, 34,215,243, 58,
+242,206,116,206,239, 81, 32,119, 46, 59, 49,231,221, 32, 47,106, 10,146,132,167,204,146, 0,249,227,201, 58,137,153, 32,229,137,
+121, 38,116, 22, 26,129, 6, 75,146,226,176,203,105, 14, 54,234,194, 65, 59,199, 42, 22, 0, 88,241,136,254, 72,143, 64,172, 86,
+157,123, 55,230, 39,152, 74,226, 56,228,101, 50,144,187,189,111, 10, 77,250, 11,227, 89, 22,197, 54,206, 20,167, 40, 36,153, 79,
+120,201,136, 32, 68, 76, 70,145, 30,117, 2,224, 10, 4,235, 20,103, 48,189,151,162, 56,183,232,208,101, 54,210,216, 75, 41, 47,
+202, 82,146, 8, 79,137, 87,176,224,245,182, 33,117, 26,220,202,123,171,102,152, 80,193, 86,221,239, 54,208, 77,254,125,113, 53,
+212,221, 82,250,206,143, 14,139,246,114,166,180,210, 90, 91,169,100, 4,144, 60,207,169,247,224, 70, 85,202, 21,156,226,227, 20,
+184,148,180, 42, 82,157, 50, 95,108,172, 33,146,218,121, 36,147,202, 79,187, 27, 86, 89,154,182, 10,120, 71,190,118,231,173, 82,
+209, 78,102, 35, 66,126,244,167,153,118, 13, 6,165, 78,110,165, 90,106, 66,218, 80, 82,229, 37,166,236, 60, 41,234, 23,215,175,
+150, 34,198,159, 76,153, 86,146,234, 22,182, 41,233,116,169,134, 86,225, 42, 0,249, 15,126, 39, 85,156,221, 26,139, 5,170,108,
+152,205, 41,232,237,173,167,162, 60, 54,128, 73, 62, 99,175, 30,126,150,196, 26, 6,232,147,193,147, 75, 43, 90,212, 20, 90, 43,
+ 54,219,212,117,197,150, 84,225,149, 29,170, 72, 38, 14,148, 50,178, 96,247, 63,232,234, 81, 83,103,107, 91, 71, 84,223,207, 13,
+ 24,148,243, 55,116,173,101, 70,192, 29,223,150, 12, 76,204,176, 21, 87, 77, 68, 83,118, 36, 44,253,154,146, 10, 71, 63,158, 7,
+165, 44, 86,230,174, 82, 2, 89, 74,150, 73, 64,224,127,203, 23, 18, 76, 65, 21, 48, 97, 18,170,104,245, 65,201, 50, 91,135, 32,
+168,161, 3,129,233,135, 48, 41,205, 79,121,123,165, 37,180, 52,130,165, 95,175,252,241,166, 74, 34,179, 45, 33, 14, 11, 35,130,
+ 71, 63,158, 55,144,204,231, 54,197, 65, 66, 71, 0,250,252,113, 56,210, 5, 72,157, 1, 20,215,216, 86, 77,203, 68, 11, 92,110,
+243,193,106, 67,203,109,132, 53,223, 44,247,135,196,216, 62, 86,195, 25, 15, 73,105,105,142,165, 37,192, 63, 88,224,166, 89,130,
+135,106, 42,113, 18, 2, 31, 67,101,109,146, 69,130,188,135, 60, 96, 55, 25,123, 35,152, 84, 65, 82,168,189, 82,135, 71, 98,128,
+205, 65,154,254,233,189,250,154,122, 10,199, 45,128, 1, 11,191, 75, 27,241,134,213, 38,196, 42,108,120, 14,198, 71,122,237,156,
+222, 62,240, 7,248, 99,115,244, 73, 10, 79,183, 73,144,137, 33,165, 5,204,109,147,226, 72, 39,145,126,151,198, 53, 71,161, 73,
+105,153,180,182, 92,108, 51,116,173,185, 11, 11, 80, 87,175, 30, 94,151,198, 48, 10, 4, 2, 73,223,253, 84,212, 58,208,205,136,
+108,142,233,219,146,121, 27,120, 24,245,101,217, 9, 41, 90, 9, 67,100,155,140, 99, 34, 90, 86,164,219,106, 72, 59,137, 2,192,
+227, 36, 47,236,133,150,157,132,216,131,231,131,193,208,212, 34,176,125,108,200,123,116, 82, 85, 96, 62,208,139, 99,214,152,126,
+165, 32, 54,235,130,233, 22, 42, 35,128, 6, 60, 40,142, 92, 0, 46,197, 43,229, 32,240,172,122,118,180,217,117,167, 10, 73,242,
+ 39, 14, 34, 52,166,242,172, 95,138,236, 98, 17,183,120,230,196,116,194,199,175,187, 53,253,174, 5, 41, 64,142, 61,216, 88,112,
+ 9, 26,211,129, 59,215,222,133,160,116,183,192,227, 7, 88,109,164, 23, 29, 33, 32, 14, 73, 54, 24, 1, 35, 62,197, 65,238,225,
+166,228,126,178,207, 24, 17, 93,206,202,157, 31,186,151, 52, 37, 54,251,169, 56, 51, 77, 58,225,147,165,108, 41,104, 21, 42,118,
+185, 69,142,157,202,158,221,189,199, 26,151,156,178,252,116,243, 43,125,255, 0,100, 19,138,210,110,108,165,199, 77,155, 37,103,
+225,134, 74,207,109,183,254,170, 24, 54,243, 81,197,244, 90,181,204,154, 1,185,108,115,171, 78, 70,160,210, 35, 35,236,153,113,
+ 68,244, 1, 56,213,254, 82, 89,232, 32, 47,111,157,200,197, 84,189, 69,125,213,109, 48, 17,199, 78,112,157,206,245, 71, 99,146,
+220, 68,158, 46, 16,130, 46,127, 28, 28, 91,218,164, 73, 31, 31,218,135,237, 41, 39,122,182, 85,168, 84,194,222,229, 68, 88, 62,
+151, 24,103,254, 83,227, 37,106, 2, 26,133,135,135,197,138,121,204,253, 81, 96, 31,104,161, 79, 9, 79, 59,144,218, 23,255, 0,
+149, 68,225,130,181, 70,141, 29,219,212, 38, 59, 20, 19,255, 0,230,163, 56,223,254,100,219, 21, 13,230, 14,209,135, 9, 79,254,
+193, 73, 30,164, 1, 70, 5,213,254,145, 62, 80,126, 85,112, 77,213, 74,177,144, 76,100,165, 40,253, 91,142,113,169,237, 80,204,
+ 13,186,151, 28,112, 4,249,157,188, 28, 86,172,230,216, 53, 56,201,149, 76,170, 50,251, 87,251,232,117, 38,223, 27, 30, 48,247,
+235,135, 37,199,238,128, 42,191, 4,223,140,104, 91, 92, 97,151, 8,150, 74, 84, 58,130, 15,202,128,183,150,131, 10, 4,121,233,
+ 86, 20,189, 82,168, 84, 91, 12, 53, 37, 45,122,148,117, 56,211, 18,107,210, 93,246,146,249, 81,189,202,148,122,226, 15, 78, 88,
+ 74,202, 74,130,138,122, 39, 4, 35,212,100, 70, 89, 13,189,183,220, 85,130,149,180,210, 97,177, 20, 86, 31, 5, 90,215,104,118,
+ 23, 90, 40, 57,103, 51,102,231, 85,114,167,163,199, 73,183, 64,148,173, 71,255, 0, 50,127, 12, 93, 84,188,239, 19, 82,154,151,
+ 69,166, 76, 5,214,152, 61,227,105, 62, 36,121,115,142,113,250, 63,106,207,102,124,183,154,242,111,127,185,230,203, 50,219, 27,
+248,177, 74,144,120,254,138,121,247,140, 68, 50,127,105, 76,187,160,125,190,104,121, 75, 57,102,182,160,192,204,201,126,145, 43,
+190,115,107, 73,121, 99,115, 4,223,128, 75,168, 66, 1,253,252,121, 78, 56, 22,238, 46,232, 81,233,242, 21,237,156, 52, 59, 76,
+ 29,162,216,210, 20, 79,169,174, 43,250,106,114,190,101,201,154,181, 22,155, 83,167,188,148, 78, 22,130,242,191,233, 73, 60,255,
+ 0, 28, 90,127, 70, 70, 69,141,146,114,244, 55,222,103,106,157, 66, 74,183,121,252,126,126, 88, 61,244,226,234,134, 66,213, 45,
+ 98,200, 26,117,150,100, 49, 50,100, 25,170, 84,162,139, 29,169, 35,147,238,227, 19, 30,204,121, 89,202, 60, 42,122, 91, 99,104,
+ 75,105,238,211,253,167, 24, 23,206, 43,217,146,217,241,248, 87, 88, 16, 17,110,146, 57,138,235,250, 82, 36, 79, 97,168,105, 85,
+137, 64, 82,173,250,160,255, 0,105,196,178,154,180, 65,166,247, 41,229, 73, 0,148,143, 35,255, 0,166, 35,121, 46, 9,135, 74,
+ 75,238, 40,169,210, 55, 40,129,212,225,231,214,114,153, 75,151,178, 9, 38,254,240, 7,247,155,124,177,148,141, 53,161,196,211,
+242,239,217, 45,197,147,181, 75,218,148,250,171,251,186,124,177,154,107, 46, 46, 64, 66, 82,118,169, 55, 79,160, 31,250, 96, 68,
+117, 41,180,163,189,112,128, 65, 54,247,242, 79,231,252, 48,150,243,137,152, 81,187,192, 81,199, 62,255, 0,241,242, 24, 42, 73,
+ 21, 21, 38,164, 11,148,135, 93, 66, 10,186, 42,235, 3,211, 26,100, 64,109,229,149,173,119, 28,222,222,120, 98,204,150,131, 42,
+ 82, 85,101,110,181,201,231,211, 27,162,206, 47, 39,126,240, 8, 77,138,125, 71,248, 56, 62,244, 19,165,123, 46,145, 13,240,119,
+ 4,220,164, 31,143,150, 2,202,162, 68, 74,238,194,236,177,247,110, 60,198, 11, 84, 36,164, 54, 16,218, 73,219,192, 62,183,192,
+105, 47, 75, 65,178, 1, 38,247, 77,252,199,248, 24, 18,210, 41,130,141,122,105,200, 82,182,223,109,250, 17,208,224, 70, 98,163,
+181, 37,155,150, 47,197,207,195,142,127, 60, 60,118,180,224, 90, 83, 99,110, 6, 48,155, 82, 67,129, 71,146, 59,176,109,233,205,
+184,255, 0, 30,120,174,164,138, 98, 77, 86, 89,195, 79, 41,149, 52, 21,119, 99,113,253,145,249,226,171,205,122,116,220, 69,151,
+ 98, 36,236, 60, 41, 39,130, 49,122,212, 81,181,213,150,200, 62, 3, 97,208, 30,132, 15,195, 16,188,201, 79, 76,179,185, 23, 73,
+ 43,186,146, 71, 55,194, 74,202,104,106, 73, 21,205, 58,145,167,136,171,196, 91,111,178, 28, 83, 98,224,148,139,145,142, 5,237,
+223,217, 97, 48, 0,212,108,151, 5, 41,148,194,183, 73,105, 8,218, 86,159, 95,126, 62,168,102, 90, 25,246,142,245,230,124, 38,
+233, 38,216,231,222,213, 26,125, 79,149,150, 36,134,216,220,219,141,168,157,162,246, 62,124, 99, 66,210,233, 77,184, 40, 0,148,
+ 56, 43,231,135,101,141, 74,206, 7, 53,192,203,212,152,111, 59, 33,249, 9,101, 40, 23,240,171,223,242, 4,227,236, 7,103,154,
+ 6,111,143,146, 98,190,165, 45,205,232, 73,115,113, 54, 28, 99,132,187, 57,233,214,159,229,101,202,212,152,112, 91,250,196,202,
+ 67, 11,105, 35,194,135,124, 72, 82,199,165,193,231, 31, 78, 52, 86,167, 79, 99, 79,225, 71, 90, 82, 10,217, 77,250,115,141, 92,
+ 73, 33, 9, 19,204, 77, 90, 85,218, 46, 26,238,141, 1,143,120,222,133,103,108,143, 55, 48,229,154,133, 53,164,164, 25,112,156,
+ 97, 97,195,192,220,130, 1,249, 95, 28, 89, 95,201, 79, 83, 38, 72,164,213, 99, 41,153, 81,158, 83, 78,180,161,202, 22,147, 98,
+ 15,204, 99,232, 69,108,173,112,156,114, 42, 82, 8, 73,181,186,142, 49,203,221,164, 50,174,236,228,222, 98, 75, 59, 5, 78, 26,
+ 29,119,142, 3,168,187,106, 31, 31, 10, 85,253, 44,110,240, 54, 42,171, 43,183, 45,142,203, 18, 60,199,238, 15,194,184, 94, 47,
+180,237, 45, 82,240,229,161,247,215, 53,215,242,228,165,176,166,225,190,211, 42, 1, 65, 75,121,146,180, 90,199,168, 24,231, 61,
+ 75,165, 86,178,188,202,109, 50,107,205,151, 17, 45,247, 30,158,166, 13,137, 88,183, 59,143, 64, 58,116,199,105,185, 69,136,131,
+222, 22, 46, 71,222, 39,207, 20,102,163,232,190, 96,207,122,160,254,100,173,102, 24, 52, 26,124, 36,129, 17,199, 0,219, 45,195,
+205,246,168,216,128, 56, 56,238,113, 21, 46,230,237, 47, 3,202, 62, 62,127,126,117,228, 14,167, 35,132,215, 31,102, 74, 36,156,
+185, 84,117,168, 78,200,246, 85,183,117, 58,131,179,191, 77,249,189,141,173,124, 70,189,161, 13, 2,211, 44,109,113, 64,169, 42,
+ 72, 36,252, 49,122,234,146,114,116,248,177,233,180,202,205, 94,125,105,117, 37,178,166,123,166,187,182, 82,147,202,146, 17,112,
+ 71,165,177, 89, 87,116,231, 51, 51, 41, 21, 84, 83,228,169, 51, 36, 45,184,138,238,172,167, 20,155, 92, 91,200,220,129,108, 80,
+ 73,239,229, 84, 79,133, 32, 73,222,161,142,190,244,167, 18,154,139,197, 62, 45,167,195,200,249, 96,163, 80,169, 44, 5,191, 46,
+ 75,173,108, 82,123,151,218, 69,195,128,245,227,215, 5,149,166,121,214, 45,124, 82,235, 25, 86, 75, 18, 86,210,221, 66,100,178,
+164,168,132,125,227,207,150, 6,102, 16,168,211, 59,182, 75,110,134,145, 98,155,147, 98,121,183, 56,117,171,191,217,141, 13, 74,
+ 53,167,117,153,205,183, 78,142,218,165, 53, 35, 99, 87,104,164, 2, 81,126,108,125, 14, 26,211, 87, 18, 83,241,154,170,201, 10,
+ 27, 73, 66,130,249, 4,115,180,131,208, 96, 76,185, 33,243,100, 32, 33, 55,184, 9, 77,185,195,116,133, 23,118,145,201,251,202,
+ 35, 14,150, 97, 17, 76, 0,169, 94, 94,212, 90,198, 71,206,148,253, 69,200, 18,157,164,213,105,146, 68,136,210, 26, 0,247, 46,
+164,248, 84,159, 95,158, 10,215,243,146,243, 93, 97,252,201, 93,175, 72,169, 84,234, 14, 45,249,210,221,241, 5,188,165, 92,145,
+233,114,121,242,196, 93, 8,250,213,164,164, 72,101,164, 52,217, 13,128, 45,127, 91,251,206, 8, 80, 87, 10,147, 14,124,248,181,
+178,196,164,178, 26,138,193,104, 47,190, 10, 62, 62,122, 38,195,155,226,155,214,236, 21,118,153,123,241, 19, 26,196,232, 9,130,
+ 98, 76,244,169,133, 40,140,147,166,241, 69, 43,148,135, 41,200,122,167, 62, 4,148, 68,125, 33, 13, 56,187, 0,181,128, 55, 15,
+126, 6, 64,147, 34,178,228, 74, 20, 42,115, 97,132, 57,119, 20,148,128,181,124, 84,113, 44,152,186,141,107, 35, 50,128,200,126,
+ 59, 33, 43,222,183,145,126,241, 66,220, 39,175,145,190, 35, 48,209, 62,159, 57,168,174,159,101,113,247, 64,113,125,209, 61,218,
+ 79,159,248,244,197, 75, 87, 2,129, 74,247, 7,236,199, 88,168,168, 40,123,233,246,113,203,244,230,150,167,163, 59, 29,178,174,
+ 27, 75, 46,216,182,125, 0, 29,109,235,124, 22,127, 32, 79,211, 76,143, 75,207,159,167, 48,220,145, 85, 74,156,106, 27, 51, 20,
+167, 22,216, 54, 37, 86,233,200,192,106,174, 88,168, 68,188,134,148,212,158, 77,223,125, 86, 7,211,143,236,195, 42, 84, 90,203,
+ 85, 52,178,150,151, 44, 52,217, 82, 80,163, 96, 7, 82, 7,160,185,232, 49,120, 5, 20, 36, 37,122, 13,199, 81, 27,107,181, 85,
+ 74,199, 51, 52, 90,129, 84,163, 84,107, 42,174, 86, 98,185, 61,106,142,160, 33,184, 47,117,219,142,189,121, 3,156,110,205,175,
+201,162, 67, 92,106,221, 25,136,239,203, 9, 89,104,248,150,150,252,128, 61, 83,133, 46,148,213, 78, 68,156,216,167, 18,195,251,
+ 82, 91,110, 51,170, 42, 10, 64, 0,248,109,243,198,221, 64,166,211, 95,153, 26,213,223,107, 15,193, 75,178, 31, 82,247, 20,168,
+139,169, 55,247, 98, 0,161, 79, 36,107,254,185,116,169,133, 2, 65, 53, 14,147, 72,159, 83, 97,152,204, 48,211, 45, 62,225,238,
+155, 39,197,111, 83,129, 18, 97, 75,129, 37,232,137, 28, 50,238,197,173, 61, 47,141,239,212, 89,106, 74, 95,109,107, 10, 71, 9,
+178,188,177,140,228,203,106, 34,101,186,224,216,242,238,132,222,231,226, 78, 53, 83, 41, 0, 26, 40, 6,105,155,173,169, 82, 59,
+215, 5,211,182,201,240,245,198,106,146,210,135,119,221,148,219,165,188,241,140,137,110,188,208, 42,176,183, 66, 6, 28,195,167,
+206,159, 24,187, 26, 22,244,180, 46,183, 18,159,227,130, 72, 9,214,156,137,222,180, 70,142, 92,187,129, 28, 36,254,177,196,129,
+182, 24,131, 26, 43,143, 76,142,181, 60,218,183,178, 21,114, 44,122, 31, 75,249, 96,101, 62, 89,100, 41, 47, 71, 75,137, 64,181,
+239,107, 99, 20, 70,113,217, 65,104, 41,228,240, 48, 23, 91, 14, 1, 38, 34,155,157, 29,149, 82,159, 1, 70, 51,108,134, 91,113,
+ 32, 41,144,139,113,234,125,113,167,184,168, 46, 83,197,148,149,221, 55, 83,205,167,129,111, 92, 74,178, 59,143,214,159,114, 21,
+ 94,156,218,155,109,176, 27,113, 45,220, 36,142,130,248, 47,155,227,198,161,229, 89,146, 91,117, 8,121, 77,132,161, 8, 29,111,
+199, 54,198,113, 25, 87,144,243,171, 9,100, 45, 19, 58, 85, 80,219,193,234,139,155,200, 45,129,194,136,234,172,123, 21,165, 56,
+234,164,164, 42,200, 54, 0, 14, 62, 56,117, 68,160,206,173, 84, 5, 42, 21,183,184,119,169, 71,162, 0, 29, 78, 44,225,146,242,
+181, 50,145, 14, 19, 81, 18,234,146,208,246,130,127, 89, 64,245, 54,197,171,149,165,158,232,220,252,133, 76, 50, 84, 12, 85,117,
+236, 14,161, 77,161, 13,133,184,234,119,162,223,171,140,156,165, 78,105,210,135,226, 56, 10,147,100,133, 39,239,122,226,197,110,
+ 5, 50, 34,201,131, 5,182,193, 60,109, 78, 54,132,180,124, 75,108, 18, 58, 92, 98,158,106,113,102, 72,212,213,109, 31, 47, 86,
+228,183,185, 20,167,200, 73,176, 41, 73,182, 22, 45, 86,234,157,218, 2, 26,109, 40, 0, 90,216, 88, 89,141, 55,178, 87,120, 74,
+205,245, 7,220, 42, 18, 73,255, 0,186,113,168,102, 74,155,128, 36,185,193,243, 87, 39, 1, 90,153, 21, 0, 4,188, 15,173,177,
+227,213, 20, 35,150, 8, 87,187, 20,198, 42,122,208,202, 84, 78,180,117,202,155,202, 3,188,108, 47,225,143, 10,150,225,222,109,
+107,116,190, 34,210, 43,147,158,119,186, 15,108, 3,211, 27,169,245, 69,135,131,110, 73, 61,122,238,195,255, 0, 85, 81,231, 76,
+ 90,169, 35,106,108, 14, 16, 65, 62,252, 63,140,195,201, 72,115,189, 0, 31, 34, 48, 9,117,136,233, 64, 6, 66, 2,190, 56,115,
+ 22,190,157,157,216,150,149, 31, 44, 72, 98,167,173, 67,178, 85, 61,157, 46, 83,107, 44, 54, 81,201,228,225,187,178, 93,238,130,
+ 93,109,178, 45,201, 24,208,228,182,220, 89, 90,228,139,249,219, 26, 93,155, 21,209,221,170, 82, 82, 60,201,243,194,254,168,122,
+212,131, 74,161, 18,242,172, 55,220,222,205, 85, 37,245, 3,117, 46,158,208, 81,254,147, 97, 7,243,192,153,185, 75, 62, 80,214,
+101,229,188,222,219, 4, 31, 11, 0,184,132, 31,136, 81, 93,240,126,106, 91, 72, 11,140,232,189,248, 82,112,218, 84,151, 35,160,
+185, 33, 69, 64, 12, 99,220, 49, 97,114,231,104,160, 66,191,228, 20,160,125, 65,173, 6,238,174, 91, 25,100, 17,208,128, 71,202,
+163,208,245, 83, 86,242,164,133,126,152,100,197,205,140, 15,138,109, 25,192,234,237,234, 81,193,249, 1,137,142, 71,212,204,187,
+158, 35,125,107, 66,172,123, 82, 18, 74, 94,106,246,117,149, 14,169, 90, 15,137, 4,122, 16, 49, 17,151,154,107, 81,147,186,117,
+ 1,192,215,253,172, 69,119,192, 15,120,176, 87,224,147,138,179, 90,105, 75,101,214,181,179, 78, 29, 68,153,148,213, 3, 90,131,
+ 29,194, 61,173,129,215,112, 22, 41, 90, 71,159, 6,223, 12, 48,196, 46,236,209, 13,186, 86, 7, 37,239, 30, 6, 36,251,230,175,
+ 91, 50,197,211,161, 43, 72, 65, 59, 20,237, 61, 8,157, 39,204, 87,210,207,163, 79, 81, 90,164,246,137,107, 47, 45,219, 53, 92,
+165, 72,140, 82,163,213, 73, 1,224,127, 6,213,248,227,147,191,246,131,178, 84,236,155,218, 46,157, 92,131, 47,187,102,124,112,
+182,123,187,164,165, 96,142, 65, 30,125, 57,192,158,206,125,160,235, 57, 82,169,150,245,223, 79,234, 79, 86, 32, 65,148,220,165,
+193,121, 64,201, 66, 82,126,213,180,175,245,141,183, 36,165,119, 39,201, 94,189, 19,244,175,234,127,102,126,213, 61,140,227,235,
+118, 94,170, 70,126, 99, 45,247,108, 9, 22, 76,168,210, 44,146, 90, 82,111,112,121, 4, 90,224,130, 8, 36, 27,227, 62,238,239,
+182,188, 75,132, 65, 35,215,148,131,233,227,225, 94,169,193, 47, 54,219, 10,181, 90,181, 4,253, 57,121,131,235, 92, 69,217, 6,
+177, 35, 84, 43, 52,199,115,101, 69,201,213,120, 85, 5,162, 93, 74, 99,170,117,231,208,162, 11,119, 82,142,226, 5,202, 64,253,
+209,143,171, 58, 67,148, 35,195,163, 68,120, 55,100,132,166,192,117, 60, 99,228,119, 96,198, 51, 34,243, 58,115, 57,165, 41,186,
+ 96,144,129,237, 36,125,247, 18,187, 41, 35,224, 47,248,227,236,206,146, 71, 46,229, 88,178,100, 55,117,184,128,160, 1,232, 63,
+199,246, 99, 3, 19, 90,149,113,173,118,174,165,164,136, 65,145, 39,215,152,251,218,173,186, 27, 40,137, 73,109,231, 0, 46, 41,
+ 60,143, 33,128, 85,137,143,174, 73, 74, 65, 9, 11,220, 5,250,129,198, 11,135,123,154, 32,104, 95,114,128,221,207, 75,249, 98,
+136,237, 99,219, 63, 74,123, 45, 51, 24,102,197,189, 54,171, 53,189,208,168,144, 10,123,231, 91,185, 29,226,137,225,180, 94,227,
+113,228,155,216, 27, 27, 80, 89, 9, 76,157,170,186,119,171,122, 60,197, 4,134,158,112,130, 60, 74,191,190,220,127,143, 92, 60,
+155, 37,144,165,168, 44, 88, 40,238,248, 94,223,192,226,171,236,255, 0,218, 2,141,218, 15, 77, 98,106, 93, 23, 44,212,233,113,
+229, 60,164,180,221, 77, 8, 29,226,145,194,138, 10, 84,119,160, 16, 70,238, 57, 7,142, 49, 42,118,169, 32,151,157,144,191, 9,
+225, 34,255, 0,158, 36,217, 4, 72,169, 17, 52,112,214,246, 18,202, 5,238,120, 56, 33, 18, 91,109,181,202,252, 69, 94,103,204,
+226,191,126,182, 98,200, 8,239,137, 34,219,121,242,191,252,176,110,145,152, 91,148,195, 78,184,176, 9, 80,243,255, 0, 30, 95,
+199, 22, 6,212, 23, 4, 84,183,218,146,225, 1, 32,237,185, 10, 31, 44,104,144,250, 67,104,104,172,110,185,177,243,245,192,216,
+245, 87, 18,210,214,165, 88,155,113,124,107,122,115, 74, 90, 93,109,193,193,228,124, 78, 25, 91, 80, 57,214, 82,210,203,129, 86,
+ 90, 66,135, 33, 94,184, 17, 84,144,228,111,181, 74,128, 3,238,223,204, 28,108,149, 37,198, 31, 89,255, 0,229,128,111,234, 48,
+ 2,173, 92, 82,201, 97,103,128, 15,248,255, 0, 30,184,170,179, 72, 26,206, 92,230,221, 66,143, 4, 3, 96, 61, 48, 10,175, 25,
+ 9, 33, 65, 87,241,121,244,198, 78,213,152,103,113,121,206, 58,159,199, 2,167,215, 88,101,183, 8,115,117,206,228,243,239,192,
+ 53,154,138,148, 34,133,102, 38, 26,121, 5, 37,177,117, 19,108, 83,250,187,150,153,168,210, 92,100,253,224,146, 64,183, 10,227,
+159,203, 22,173, 78,165,223, 21, 54, 69,192, 30, 19,242, 54,196, 11, 50,151,157, 75,141, 74,177,178,141,137, 28,115,130,182, 72,
+ 53, 77,106,138,227, 93, 37,160, 75,168,235, 75,250, 77, 75, 59, 88,145, 84, 19, 31,111,205, 41, 72,182,223,129, 81, 39,250, 56,
+232, 30,219, 29,162,115, 23,101,122, 38, 77,202,116, 40,174,162, 85, 90, 80,239,100,148, 43,186,142,202, 64,251,202,232, 20,162,
+108, 1, 60,217, 71,203, 20,134, 92,149,156,116,223,182, 27,217,251, 41,229,132,213, 32, 21,161,153,241,195,201, 66,227,216,159,
+ 16,220, 69,211,240,231, 23,174,175, 84,226,235,187,245, 23,115,197, 49,167,227,212, 35,123, 57,136,180,133, 37,166,194,108, 0,
+191, 66, 58,223,200,243,142,137, 44, 61,122,180,102,253, 33, 59,252,133, 83,190,199,112,236, 41,230,130,128, 84,153, 82, 65,215,
+ 93,201,250,117,171,239,178,206,168,197,213,156,148,203,210, 42, 40,126, 91,204,248,182,171,146,109,233,128, 61,168,114,203,176,
+242,245, 41,109, 51,226, 98,161, 37,181,241,208, 41, 45,145,249,164,254,120,128,253, 17,154, 59, 92,201,121,138,177, 67,172,214,
+ 76,193, 76, 15, 54, 29,113, 68,221, 33, 68,161, 66,253, 60, 5, 60,122,223, 23, 31,108, 88,210, 41, 50,105, 49,100, 63,102, 36,
+165, 78, 1,110,170, 79,159,224,230, 3, 96,165,218,226,237,248, 79,200,210,226,212,219, 12, 49,197, 50,101, 42, 9, 35,222, 68,
+ 87, 51, 74,163,188,160, 67,111,160, 19,201, 4, 96, 62, 98,200, 20,236,207, 79, 52,250,253, 33,185, 13, 41, 36, 37, 93, 10,110,
+ 44, 74, 79,145,196,162,172, 89, 84,165, 6, 85, 97,141, 10, 83,138,218, 16,191, 43, 91, 30,130,222, 33,152,107, 94, 17,116, 59,
+213, 88,193,236,171,165,176, 43, 84,170,205, 27, 43, 8,142,210,221, 43, 71,118, 77,158, 37, 36, 13,228,245,235,124, 77, 27,210,
+138, 43,219, 86,237, 18, 25, 45,187,222,183,102,147,116,175,246,135,161,196,161,128,226,130, 80,129,186,227,158, 49,181,101,198,
+149,189, 73,218,145,202,142, 12,155,224, 12,138,167, 19, 92,187,219,127, 66, 51, 37, 98, 55,249, 83,133, 88,125,165, 83, 41,222,
+203, 2, 20, 88,203, 94,245,169, 68,172,175,109,252, 37, 55,247, 99,136,230,229,121,173,184,224,220, 29, 81, 81,222,168,227,120,
+ 71, 23, 35,142, 71,246, 99,232, 54,190,246,177, 68,118,165,228, 44,153, 76,239, 93,121, 70, 58,229,173, 93, 60,137, 72,254,252,
+115,123, 77, 83, 98,251, 75,206,209,162,153, 14, 47,237, 94, 66,172,224, 6,247, 31, 3,135,246,210,163, 49, 81,237,178,232, 43,
+155, 42,116,154,132, 64,137, 37, 46, 37, 15, 92,176,165,121,128,108,127, 60, 51,125,249, 8,148,215,116,164,173,194,161,116,108,
+189,199,166, 44,189,115,171, 53, 80,122,149, 76,129, 77,102, 52, 74, 92, 2,204,116,180, 57, 93,214,165, 21, 43,222, 73,196, 27,
+ 41, 66,113,218,236,121,225, 23, 72,154,219, 74,226,246,189,241,170,133, 36,177,156,138,209,101, 25,208, 12, 81,170, 13, 46, 84,
+246, 94,126,159, 2,206,161, 33, 68, 16, 8, 3,206,192,227, 57,217,110,117,107,125,102, 27,171,122, 91,206, 4,186,207,116, 1,
+191, 65,180, 14,184,176,152,203,180,202, 60, 34,235, 77,182, 94,120,169, 42,109, 66,231,111, 91,156, 18,161,191,245,117, 65,154,
+140, 40, 41, 74,153, 59,155,216,155, 4,155,117, 24,231, 29,191, 82, 74,150,216,208, 78,167,109, 57, 73,249,212,147,102,174,102,
+171,234, 30, 84,204,148,245,152,115,233,171,140,224, 35,114,151,193, 65,183,152,196,223, 40,101,182,105, 32,213, 43,243, 74,203,
+188, 48,203, 45,141,203, 30,132,158,128,156,123, 82,154,253, 66,107,147,100,184, 84,227,138, 42, 82,148,110, 73,193, 40,142,229,
+250, 46, 90,122,183, 83, 90,164, 77, 28, 65,134,131,192,253,229, 31, 47,112,196, 93, 90,222, 97, 14, 70,166, 54,241, 28,188, 60,
+104,119,140,182,221,185, 6, 73,216, 70,255, 0,126, 60,170,180,212, 28,199, 76,118,189, 37, 81, 88,216,234, 92,179, 45, 54, 15,
+ 43,233,127,144,192,104, 19, 43,212, 73, 46,201,102,112,246,132,160, 41,208,160,124, 35,246,112,106, 6, 90,170, 87,234,143,214,
+ 24,167,149,200,117, 95, 97,114, 54,162,254,100,156, 57,212, 42,125, 82,133,236,209, 93,166,182,169,101,190,234, 83,236,120,144,
+213,207, 79,143,169,198,139,110, 33, 11, 12,141, 79,223,223,157, 99,162, 80,160,216, 18, 99,229,244,167, 57, 51, 58,100,172,187,
+ 20, 86,107,161,201,253,226,200, 92, 55, 91,176,113, 91,120,220,120,226,246, 63, 44, 71, 51, 70,104,163,212,234, 13, 73,139, 31,
+185,107,104, 46,161,165, 15,180, 81,235,240, 24,114,252,106, 45,110,139, 6,135, 17,196,161,246,218, 91,179,159, 82,188,197,248,
+196,114,163,149,230, 67,133,237, 78, 48,164, 36,163,114, 10,211,109,201, 61, 8,197,150, 26,104,172,172,200, 39,175, 74,176,201,
+ 18, 73,153,241,173, 53, 54,163, 41, 74, 67, 16,202, 11,139, 1,178, 23,126, 62, 56,215, 45,217,132, 55, 26, 84, 91, 6, 83, 97,
+ 97,193,247,227,101, 43, 46,102, 9,145,151, 54, 37, 41,215, 88,108,128,181, 91,128, 79,166, 39, 25, 58,128,253, 93,182,105, 21,
+ 90, 58,202, 22,173,169,113, 77,155, 36, 17,230,109,131, 63,112,213,184,213, 64,199,141, 92, 67, 75, 81, 2, 55, 53, 92, 75,146,
+136,241,200, 75,128,149,240,145,111,207, 4,225, 57, 54,130,234, 92,134,251,130,195,197,207,133, 70,220,241,134,218,143,148, 93,
+202, 85,199,161, 54,178, 88, 39,115, 55, 55,176, 62, 88,184,244,231, 43,209, 51,174,151, 67,144,186,107, 10,125,214, 9, 91,197,
+ 60,133,131, 99,207,203, 25,216,182, 51,109,132,218,161,247, 18, 84,149, 24,211,202,126,149,104,217, 40,171, 40, 48, 69, 84,146,
+208,100, 61,222, 40,221, 78, 39,197,180, 90,227, 15,178,237, 6,165, 81,113, 45, 83,227, 23, 28,221, 96, 7,166, 47,252,157,163,
+ 84, 76,207, 90, 97,164, 83,216, 65, 97, 9,246,135, 54, 3,225, 29,109,239, 61, 49, 55,143,164,185, 70,133, 50, 66, 96,209,154,
+105,246,208, 67, 37,164,109, 42, 73,243,198, 62, 33,197,246, 22, 23, 6,221, 64,230, 9, 10,242,159,219, 73,161, 11, 55, 20,137,
+157, 42,147,202, 52, 25,116,154, 74, 24,117,237,207,190,162, 84, 47,247,121,181,189,227,223,141,185,242,150,165, 80, 30,132,183,
+208,225, 75, 69, 94, 17,200, 35,156, 75,179, 14, 65,172,210,228,251, 98,130, 75, 71,113,104, 19,205,147,212, 91, 1, 37,209,170,
+146, 97, 73, 97,136,228, 36,176,119,133,117,177, 30,252, 30,223, 19,180,125,105, 90, 28, 7,223,207,248,171,104,107, 34, 34,171,
+173, 38, 33,220,216,236, 46, 47, 34, 55,134,253,120, 55,196,246, 74, 2, 29, 87,116,210,138, 45,107,168,249,226,173,202, 51, 92,
+162,230,232, 50, 16,238,207,181, 45, 44,250, 5,113,139, 97,166, 47,114,218, 75,201,191, 32, 3,108,107, 95,119, 30,204,118, 34,
+147, 83,150,152,148,139,216, 99,106, 88,113,180,133, 45,179, 98, 56, 56,242, 90, 23, 14, 43,181, 7, 89, 80,101,167, 82,218,212,
+ 7,235, 30,108, 61, 77,177,174, 52,198,102, 41, 45,198,116,169, 74,108, 44, 32,117,177,192, 32,148,230,229, 78, 29,109, 74,202,
+ 14,181,180, 69, 83,156,182,229,253,111,197,142, 22, 54,162,149, 84,113, 33,104,167, 72, 80, 61, 8,101, 68, 31,203, 11, 16,237,
+ 17,255, 0, 33, 69,131, 93,119, 38, 85, 33, 69, 37,185,232, 23, 54, 0, 28,107,146, 98, 33, 64, 38, 85,253, 8, 56,207, 50,229,
+ 28,165, 15, 44, 78,204,202,124,194, 98,156,219,203,125,111,133,236,105,166,208, 84, 84, 15, 60, 93, 10, 23,228,248, 78, 42,218,
+ 70,124,162,234, 46, 95, 70,104,211, 60,214,197, 90, 11,178, 77,221,136,230,238,229, 95,176,164,158, 80,127,116,128,122, 99,193,
+ 44,248,218,241,242,165,148,119,118,233, 7,206,186,149,240,194,123, 44,233,152, 27,152,211,202,172,223,101,220,161,107,147,132,
+170, 90,221, 90, 80,133, 20,173, 95,119,212,226, 2, 51, 54,127,166,146,203, 65,213,169, 42, 36, 41, 76,222,227,158, 61,221, 48,
+123, 45,106, 54,100, 46,165,250,150, 94,117, 76, 54,132,247,171, 8,186,145,187,175, 31, 11, 99, 97,142, 47,108,173, 41,117, 49,
+212,131,181, 81,115, 1,113, 32,148, 42,106, 86,197, 14, 69,193,118,231, 4,227,229,230, 54,248,214,160,163,230, 48, 18,159,170,
+153, 91,218,195, 43,110, 64,114, 83,129, 73, 66,147,123, 13,163,240,196,145, 85,244, 48, 75,206, 83, 84, 27, 10, 0,146,174,109,
+127, 65,141, 71,184,163, 8, 97, 50,167,125, 38,106,138, 48,123,215, 21, 1, 52, 62, 69, 34,116, 71, 54,161,229, 41, 7,167, 56,
+ 97, 42, 35,205,168,221, 4,223,208,226, 67, 76,206,116,185, 81,159,121,108, 4,247,105, 37, 40, 87, 85,115,229,135,146,106, 89,
+ 94, 62, 80,151,156,171, 49,214,204,120,109,130,166, 90, 70,231, 95,113, 95,113,166,211,230,165,114,111,209, 41, 73, 39,165,140,
+236,120,138,195, 17,115,179,105,103, 55, 66, 35,210,172,127, 67,196, 2,194, 82,137, 39, 77, 42, 7, 49,115, 16,120,117, 64, 14,
+128, 99, 19, 46,170,228,109,142,130, 83,228, 78, 5, 71,237,205,217,189, 25,118,161,144,233, 58, 55, 89,169,231,186,138, 91,102,
+ 35,242,102,149,177, 73, 80, 90, 92, 90,253,157, 45,161, 78,146,218, 86,139,238, 80, 27,183, 0, 45,130,113, 53, 18,135, 95,165,
+ 8,230, 11, 17,101,165, 9, 43,186, 84,210,156, 38,225, 94, 5, 45, 64,216,129,202,108, 57,231, 26, 15, 95, 34,217, 37,110,152,
+ 0,198,189,126,158,250,189,119,195, 24,133,157,183,106,230, 95, 32,100,249,104, 34,125,244,210,163, 62,106,155, 13, 7, 72, 72,
+244,192, 90,134, 93,139, 85,120,206,135, 37,200,117, 4,166,201,152,200, 6,227,246, 92, 73,225,196,126,233,249, 17,215, 18, 72,
+173, 71,144,224, 74,246,168,168, 92, 0,111,112, 49, 11,214,106,236, 61, 63,136, 51,245, 13,194,151, 41,111, 32,213,162,148,148,
+137, 49, 73, 9,112, 11,128, 20,164, 3,188, 17,114, 54,159, 34,113, 31,111, 97,196,254,160, 71,157, 97,178,195,253,168, 74, 65,
+ 7,239,122,172, 50, 78,164, 84,251, 50,235,147,217, 43, 52, 68,246, 12,189,153,157,222,203,141, 40,247, 17,223, 38,219,218, 81,
+232,130,120, 32,242,144, 69,250, 92,186,237,103,155,107,186, 99, 85,136, 98, 70,139, 62,141, 91,109,101,166, 95,105, 42, 44, 60,
+144, 1, 40, 54,225, 86, 85,194,185,235,238,196,187,181,118,156, 82,245, 27, 64, 42,181, 68,182,133,191, 6, 15,214, 84,185, 41,
+ 28,164,164, 5,220, 31, 69, 34,255, 0,150, 57,123, 63,107, 72,213, 14,206,217, 85,202,172,189,213,154, 13,101,200, 51,183, 43,
+196,180, 22,129,109,207,152, 77,143,189, 39, 21,213,217,131, 35,126, 71,159,148,244,174,195, 5,125,215,174, 91,185, 70,132, 28,
+171,244,209, 95, 67, 93,229,216,198,155,148,209,167,121,102, 46, 91,109,207,103,144,199,124,174,248,130,181, 60,181,149, 44,168,
+143, 61,215,249, 1,143,169,154,109,177, 52, 8,155, 64,176,101, 36,219,208, 1,255, 0, 44,124,120,250, 50,115, 43,181,188,161,
+ 74,142,252,143, 13, 50,185,220,184, 84,120, 74, 20, 82,171,255, 0,226, 56,250,237,144, 43,145,216,161,162, 54,224, 11, 8, 8,
+ 87,225,198, 51,238, 28,237, 92, 10, 53,222,224,235, 89,105,214,214,100,133,159,142,181, 61,174,230,186, 93, 15, 43,204,204, 21,
+137,168, 98, 28, 24,174, 63, 41,247, 77,146,211,104, 73, 82,148,125,192, 2,113,241,102,173, 91,206,189,184,251,104,183,237, 21,
+ 39,173,154,179, 16, 66, 19,186,254,199, 79, 65, 38,201,191, 64,219, 9, 63, 18, 61,248,237,175,165,171,180,170,180,151,179,147,
+154,113, 72,168,247,117, 76,234,247,177, 4,161, 86, 82, 33,163,197, 33, 95, 48, 80,223,188, 56,125, 49,204,255, 0, 68, 22,157,
+189,153, 53, 78,187,172, 51,153,188,122, 12, 1, 10, 3,138, 28,123, 76,131,226, 80, 62,169,105, 42, 7,255, 0,170, 49, 73,211,
+218, 58,148,122,214,170,115, 5, 72,175,163, 20, 86,233, 25, 26,147, 3, 37, 80, 98, 55, 18,157, 77,136,152,208,217,104, 89, 45,
+182,148,132,128, 62, 64,227,124,186,243, 72,104,184,169, 62, 13,221, 9,196, 83, 53, 85,247, 45,111, 52,190,109,202, 65,248,255,
+ 0,207, 16,250,158,107,144,182, 16,200,144, 64, 0, 94,231,227,255, 0, 60,105, 33, 19, 78, 78, 81, 86, 13,126,189, 25,198,211,
+ 34, 59,219,148,165,146, 8,248,225,147,121,205,250,106, 84, 3,164,139,220,123,175,255, 0,166, 43, 21,102,233,136,145,181, 74,
+ 37, 9, 36,165, 63, 46,191,152,198, 43,207, 37,162,125,160,238,220,158,151,244, 22,197,160,214,149, 85,199,106,240,166,106, 63,
+180, 69,222,235,151, 85,128, 54, 62,118,181,240,245, 25,193, 41,106,251,252, 86, 6,196,249,143,253,113, 69, 80,115,160, 68,144,
+183, 29,178, 56, 35,158,188,226, 68,115,211, 5, 42, 45,187,115,199,159,203,251, 48, 23, 27, 53, 92,172, 85,160,246,116,222,173,
+174,175,147,114, 47,233,128, 53,252,194,218, 91, 15, 37, 66,206, 38,252,121, 31, 60, 66, 95,206,237, 56,246,237,228, 0, 64,235,
+228,112, 42,175,156,247,110,141,222,220, 2, 79, 94,131,174, 42,169, 6,160,167, 0,169, 44,188,196,101,120, 3,158, 29,190, 71,
+ 26, 39, 72,105, 76,141,175, 18,160, 1, 62,251,117,196, 66, 53,125,176,206,245,174,228, 90,252,245, 28,223,248,227,207,210, 34,
+149, 32, 7, 73,240,157,220,249,121, 96, 93,153,160,169,225,202,136,214, 43,142, 50,199,124,210,141,202,184, 4,254, 24,142,214,
+ 51, 20, 89, 80,214, 30, 80, 42, 90, 56, 23,243, 60,219,248,140,106,175,214, 74,183,119, 42,184,219,125,163, 21,230, 96,157, 82,
+ 51, 20,227, 43, 59, 1,220, 61,254,191,227,223,130,161,169,170,203, 89, 85, 15,203, 58,105, 84,173,103,138,157, 82,148,192, 33,
+213,248,220,113,196,161, 32,219,173,201,196,170,177,147,230,100,186, 52,186,237,110,171, 21, 17,161, 66,114, 92,146,137, 40, 81,
+ 13, 54,146,165, 40, 11,220,216, 3,211, 20,230,178,231,250,237, 47, 48, 71,162, 81, 35,160, 1, 9, 11,154,235,132, 0, 1, 36,
+130, 57,231,131,136, 36,221, 69,253, 33,132,236, 7, 91,157, 37,180,165, 77,184, 9,186, 20, 15, 4, 91,139,130, 58,226, 74,197,
+113, 70, 30, 13,160, 39, 32,142, 68,159,255, 0, 96, 60,180,175, 61,196,144,203,216,170,150,185,220, 13, 60, 34,190,132,125, 27,
+217,183, 78,106, 90, 33, 43, 84,169,181, 38, 27,155, 92,140,101, 58,135, 31, 10,113, 5,211,187,187, 63,247, 65, 8,254,142, 54,
+246,160,204, 20, 92,211,245, 74,106,153,194,159, 13,248, 97,239,178,146,237,148, 80,174,237, 9, 80, 0,116, 37,165, 99,128,123,
+ 41,103, 76,159,164,154,146,167,179, 26,170, 77, 80, 89,136,143,171,153, 47,172, 33,181,161, 32, 20,148,131,226,185, 4,244,230,
+248,123,173,122,213, 83,213,236,245, 47, 56, 70,109,230, 35,184,176,136,205, 23,126,226, 83,194, 60, 32,250, 11,155,121,147,136,
+223, 62,242, 31, 75,172, 40, 3,212,137,223,194, 71,149,117,252, 67,125,103,113,100,150,217, 50,149, 4,192, 28,128,255, 0, 85,
+127,206,153,167, 81,156, 43,157,168, 52,181, 41, 39,238, 7, 21,207,229,252,112,233,209,165,146, 33,183, 34, 22,127,130, 23,107,
+186, 2, 87,100,143,194,199, 28,119, 34, 93, 86, 36,133,137,111,168,173,106, 10,113, 65, 96, 2,175, 82,125, 49,131, 25,214,161,
+ 18, 34,189,177,229, 39,121, 42, 74,201,221,225, 23,177, 0,124,207, 56, 1,197, 49,200, 5, 15,143,255, 0, 17,175,214,188,217,
+219, 70, 9,253, 63, 26,237, 26,106,114, 66,155, 6,153,169, 52, 71,219, 39,133,151,148,146, 7,192,167, 12, 51,196,156,163, 59,
+ 43, 78,165, 83,117, 30,148,196,183,217, 45,180,234,150,163,182,252, 21, 90,220,249,227,143, 63, 77,138, 95, 69, 73,170,211,128,
+ 33,143, 15,114,149, 37, 9,191,235, 91,203,156,107,147,159,234,172, 56, 23, 30,186,123,231,141,150,128,178,173,201, 61, 79, 55,
+ 62,252, 72, 98,252, 66, 83,151,181, 79,158, 77,127,111,133, 0,216,219,159,241,248,212,154,185,217,119, 40, 46,160,243,213,125,
+127,165, 60,226, 30,187,102, 44, 37,149, 40, 31,189,114,162, 13,237,211, 2,191,205,199, 72, 96, 73,110, 75, 58,204,236,129,221,
+ 20,169,147, 13, 32,168,147,197,136, 56,102,228,236,205, 16,137, 17,167, 32,199, 82,206,229,188,160, 86,127, 43,143,225,129,242,
+106,129,146,235, 87, 84,199, 89,241,165, 70, 50, 82, 19,126,137, 42, 28,155, 97,211,138,227,138,137,186, 62,228,160,127,252,253,
+106, 63,211,237,128,140,159, 63,222,162, 26,149,217,179, 79,106,125,219, 80, 53, 22, 91,143, 55,194,208, 98,160, 95,169,224,223,
+156, 85,117, 77, 31,129,150, 20,235, 80,179, 66,138, 2,146,224, 82,146, 5,148,147,112,108, 49,106,230,170,132,167, 28, 47, 41,
+126, 11,220,180,130, 78,229,116,234, 63,134, 43,140,221, 56, 62,162,240,128, 84, 17,225,220,142, 13,253, 15,174, 58,204, 51, 21,
+196,202, 66, 92,120,168,120,132,254,194,137,217,101,216, 69, 26, 94,161,100, 71,162, 21, 85,114,195,162, 90, 99,132, 3, 21,240,
+ 16, 84, 7, 42,177,231,156, 61,164,234,230,154, 8, 72,143, 54,133, 41,181, 33, 32, 88, 88,133,144,111,235,138,166,123, 42, 83,
+194, 66,226,187,180,253,237,171,176,198,132, 66,169,202,157,181,152, 32, 3,208,220,147,111,126, 10,112,124, 57,201, 42, 82,181,
+255, 0,204,199,161, 52,161,200,138,158,214,243,182, 94,159, 86,126, 92, 40,229,134, 92, 89, 45, 52, 44,118,143, 76, 18,166,103,
+124,140,236, 6,227, 84,154, 90,146,147,226, 5,176, 65, 62,189,113, 92,251, 5, 85,130,231,114,194,212, 27, 28,217,174, 1,233,
+ 98,113,182,157, 68,157, 33, 27,149, 20,133, 40,248, 80,148,158, 79,199, 26,193,198,155,101, 45,131, 1, 48, 7,186,134,166, 86,
+173,234,200,171,234,150, 85,246, 6, 40,217,122,150,204, 86, 90,229, 78,136,254, 37, 43,251, 6, 36,185, 39, 83,116, 90, 54, 87,
+121,188,230,218,151, 61,215,236,217,141, 22,224, 35,205, 74,191,159, 94,152,169,163,105,222,103, 84,132, 54,136, 14, 45,197,167,
+120,109,171,174,223, 44, 26,164,233, 61, 94,168,165,165,216,238,130, 23,182,200,104,222,254,167,208,123,241,158,167,112,182, 97,
+ 82, 36, 25,158,115,231, 70, 97, 46, 50,176,160, 1,243,168,190,172, 66,167, 85,115,197, 74,163,146, 86,161, 77,113,123, 98,173,
+105,238,212,180,216, 94,227,203, 7,168,178, 50,245, 91, 32,198,164,230,133,134,234, 48, 64,105, 54, 27,131,205, 3,199, 62,182,
+196,190, 23,103, 89, 78, 93,153, 13,173, 79, 27, 20,134,156, 36, 91,223,232,113, 36,160,118,118,202,137,113, 76, 86, 38, 72,142,
+226, 90, 42, 14,188,164, 37,180,159, 43,146,121,249, 97,174,248,178,204,182,144, 87,170, 72, 32,141,244,250, 30,116, 37,218,246,
+170,146,145,214,130,105,189,115, 70,169,212,199,154,205, 15,184,151,148,118, 35, 99, 36,165,180,250,241,231,137, 60,141, 66,209,
+ 90,110, 87,122,147,151,234, 61,228,151, 17,224,113, 81,213,115,239,189,176,229,122, 35,147, 90,101, 43,101, 13,119, 41,178,150,
+249,241,111, 7,139, 0, 63,142, 60,151,163,121, 85,232, 75,151, 3, 41,165,196, 37,223, 11,200,113,105,178,109,233,111, 51,142,
+ 70,234,247, 10,188,191, 23, 78, 45,194,100, 24,145,148, 70,194, 15,202,106,202, 26,117, 17, 28,171,159,117,130,149, 27, 54, 84,
+216,114,134,180,119, 77,182, 67,139, 81, 35,113,242,196,219, 67,235,185,111, 38,105, 50,242,238, 98, 68,149,212, 91,154,234,217,
+ 76,102,247, 39, 98,173,107,159,141,241,103,157, 42,203,148,197,150, 85, 68,133,126,232, 20,164,172, 41, 70,252,220,223,207, 5,
+168,249,103, 39,210, 32,163,108,112,130,165, 16,234, 16,164,155,243,211,206,231,221,141, 59,254, 40,180,188,180, 75, 10, 65, 41,
+ 73, 4,121,143, 90, 75, 97,199, 86, 73,231, 81, 13, 62,213,202, 30, 88,117,249,210,169, 83,156, 14, 54, 18,142,237,159,125,252,
+206, 15, 63,172, 85,154,236,214, 42, 20, 61, 61,152,160,217,225,110, 56,148,238, 73,245,244,196,218,147, 11, 42,182,135,153,122,
+136,210,212, 72, 13,135, 80, 80,180,219,204,113,110,113,179, 48,193,133, 77,132,227,169,134,142,155,252, 68, 5, 95,160,233,215,
+225,142, 98,247, 22,176,188,196, 77,202,217,254,225,211, 85, 24,136,141,132, 84,211,106,160,222, 94, 85, 11,169, 57,168, 57,133,
+109,212, 70,157, 54, 26, 15, 18,158,250, 65,240, 31, 49,112, 45,206, 7,230, 44,137,153,115, 11,138, 92,186, 92, 26, 78,247, 62,
+208,176,181, 45, 86, 34,214, 39,143,195, 18,119, 43,109, 57, 9,184,198,177, 47,107,201, 37,246,210,209, 38,215,189,174, 62,239,
+199,174, 55,212, 51, 21, 58, 20,180,185, 22,162,216, 42, 64, 35,191, 10, 89, 73, 3,204,121,226, 13, 98,142,219, 40, 22, 82, 18,
+ 68,196,102,250,147, 62,149, 33,105, 53, 93, 80,187, 27,100,201, 11, 14, 84, 51,107,205,205, 66,194,217,105, 45,125,241,123,147,
+207, 92, 75, 81,165,249,118,142, 24,165,162,108,201,138, 0, 7, 84, 1,105, 42, 81, 62,128,121,124,112, 96,103,200,149, 56,100,
+ 79,171, 45,187,170,238, 72,138,141,165,103,208, 19,211, 26,229,234,109, 30, 28, 68, 37,140,208,219, 77, 7, 5,218, 89, 43, 85,
+192,177, 60, 15,203, 14,254, 63,142, 93, 42, 29,113, 71,195,253, 10, 34,108,208, 6,213,186, 6, 66,210,122, 43,237, 52,221, 17,
+ 51, 95, 65, 42, 84,103, 92, 83,128, 31, 62,110, 71, 56, 40,183,233,140, 42, 73,165,233,213, 26,146,226, 81,102, 28, 49,210, 13,
+135,235, 1,242,196,122, 14,114,203,108, 71,109, 84,176,236,130,226,212,161,117, 22,210, 9, 60,239,227,166, 25,230,141, 74,203,
+ 13, 49,236,242, 22, 80, 16,131,185, 73,178,238,171,249, 27,240, 6, 51,215,113,125,112,224, 11, 82,213,230, 79,202,126, 98,136,
+155, 84, 39, 97, 21, 55,155,154,106,245, 24,145, 93,222,160,148,181,100,247, 50, 18,205,255, 0,162, 7, 24, 88,166,221,212,218,
+ 88,121, 72,138,167, 94, 64, 55, 74,156, 65, 87, 7,222, 45,133,137, 11, 55,146, 32, 15,135,243, 83,236, 69,119,245,119, 44,105,
+238,116,211,250,189, 18, 69, 20, 8,114,169,146, 98,186,218,147,112,148, 37,160,133,120,135, 78, 84,180,143, 50, 82, 79, 36,223,
+ 31, 25,123, 56,175, 83,251, 58,106,213, 86,179, 50, 92,186,125, 18,151, 84,126,151,152, 22,235, 87,143, 57,108,172,167,186, 9,
+ 36,110,116,219,194, 83,226, 23,226,224,144,126,165, 59,171,121, 73, 25, 17,218,158,107,170, 53, 79,136,227, 47, 58,251,174,185,
+181, 13,139,173,106,177, 61, 0, 42, 28,250,164,123,177,242,247,180,125,127, 53,106,110,111,204,186,135,167,185,114,181, 39, 40,
+ 79,175, 72,118,157, 88,145, 5,230,225,199, 14, 57,180, 45,130,160, 6,245, 4,128, 92, 60,220,217, 54,234,120,190, 6,179,188,
+113,119, 22,145, 41,114, 1, 42,216, 25, 49, 19,204,131,231,166,198, 43,233,110, 9,252,191,106,110, 30,198, 80, 87,111,148, 66,
+ 71,249,172,108,137,208,236,100,229, 32,255, 0,228,153,204, 46,221,122,250, 75,242,158, 73,134,213, 23, 74,244,197,201,213, 57,
+ 39,188,156,154,228,180,161, 16,124,131,106, 12,169, 69,110, 16, 77,198,228,237, 6,199,158, 7, 85,105,229, 88,230,188,135,151,
+234, 78,101, 41, 84,169,217,134,148,204,218,131, 14, 19,246, 43,121,176, 75,100,158,124, 62, 33,206, 57,155,232,193,236, 71,164,
+211,242,197, 51,180,182,179, 82,197,118,123,149, 89, 70,133, 65,152, 83,236,141,162, 58,130,123,247, 27,183,218, 18,224, 80, 1,
+ 87, 72,176, 36, 19,206, 59,117,140,201, 79,170, 60,181, 64,216,237, 81, 46, 32, 39, 47,165,149, 41,201, 40, 74, 82,165, 41, 14,
+ 37, 37, 41, 5, 92,248,186, 5,139,129,126, 33,196,239, 97, 86,119, 62,195, 98,133, 41, 77, 18, 22,178, 78,170,218, 0,232,152,
+220,192,241,231, 94,123,141,123, 5,197,225, 22, 76,246,104,157, 4,149, 24,228, 9, 58,147,227,167,128,170, 62,179,165, 90,166,
+254,108,113,200, 73,105,248,109,238, 13, 20, 60, 18,150,202,150,144, 10,189,246, 6,216, 99, 79,141, 83,205, 57,215,244,107, 76,
+181, 73,154,212,202, 67,110,138,252, 89, 48,214,136,241, 31, 46, 40, 52,195,111,165,127,106, 74, 27,113, 69, 69, 32, 2, 0, 27,
+185, 34, 91, 31, 91, 50,236,252,251,254, 79,162,230, 68,208, 18,166,130,217,139, 85,140,160,243,111,164, 19,221,173,180,248,202,
+ 82, 80,175,180, 30, 2, 1, 1, 87, 28,138,213, 65, 84,210,252,175, 39, 95,105, 90, 56,195, 84,196,190,145, 80,147, 73,134,152,
+222,211, 9,199,118,151, 94,111,245,147,117, 29,151,185, 4,222,224,110, 4,182,151, 79,232,219,201, 25,149, 1, 2, 0,223,207,
+ 66,121, 0, 13,101,178,211, 40,148,169, 36,168,237,225,212,255, 0,189, 43,163,116, 98,179, 64,236,159, 47, 45, 85, 53,115, 47,
+101, 56,181,183, 84,103, 85,115, 45,114,107,147,169,200,139,185, 64, 48,207,116,211,129,165,120, 2, 76,141,171, 74, 84,165, 36,
+ 46,228,237,137,246,148,212,252,173,172,153,186,185,156,169,217,156,194,135, 86, 90,150,219, 82, 29, 46,123, 10,110, 9, 12,169,
+ 32, 36,182, 64,240, 1,202, 65, 23, 28, 92,194, 51, 22, 97,205,154,209,162,185, 99, 49,211,230,194,204, 52, 10,132,182,233, 84,
+ 55, 38,200, 10, 67, 9,150,250, 24, 75, 42, 74,206,208,128,242,211,185, 11, 54, 7,125,194, 78, 56,155, 86,117, 27, 86,114,166,
+102, 84,188,241, 81,135, 7, 57,229, 10,139, 49,166,181, 10, 66, 66, 39, 65,144,216,126, 58,130, 16, 74, 86,208, 65, 9, 34,246,
+218,234, 65,231, 27,214,121,175,219, 41,182, 1, 57, 20, 36,198,169, 88,141, 58, 29,116, 50, 14,227, 72,219, 70,229,229,173,132,
+165,166,242, 36, 70,177,172,245, 61,126,244,171,239, 62, 82,242, 69, 11, 52, 66,206, 12, 67, 97, 50,144,135,132, 87,123,150,218,
+ 14,220, 38,229, 78, 40,130,174,131,169, 29, 72, 3, 21, 70,102,237, 35, 39, 42,166,124,124,229,167,239,152, 45, 84, 10, 23, 80,
+143, 53, 43, 17, 92, 85,150,216,176,178,146,171,110,181,189, 13,137,233,129,186,185,218,210, 64,110, 46,169,229, 45, 52,164, 57,
+ 72, 76,240,181, 64,146,210,175, 17, 73,105,144,160,133,130, 2, 6,247, 44, 0, 22, 6,196, 12, 86,122,239,169,116,141, 67,210,
+231,179,229,102, 3, 14,215, 43, 89,129,164, 57, 45, 1, 73,188,118,163, 11, 0, 18,160,139,238, 34,228,160,168,159,214, 28,131,
+126,206,214,233,247, 2,175, 4,230,208,146, 76,204,237, 3,167, 94,181,142, 81,218,174, 92, 81, 36,243, 63,126,149,209,186, 95,
+170, 13,106,148, 6,217,202, 89,222, 4,224,227, 10, 49,212,236,144,133, 45,192, 9, 83,106, 22, 59, 22,145,180,145,225, 36, 92,
+164,112,108, 71, 44,230,108,221, 34, 85, 79, 39,103,186,251,175,194,168, 48,182, 85, 6,165,101, 41, 12,175,122, 46, 20, 0, 82,
+124, 60,148, 44, 18, 60,213,124,114,102,108,206, 90, 88,141, 62,162,234, 62, 72,167, 74,203, 57,234, 46,200,115, 69, 17, 97,152,
+ 51, 98,161,128,148,200, 91,118, 39,191, 42,251,196, 16, 15, 36,164,147,124, 29,236,203,219, 27, 44,208,157,117, 58,141, 73,169,
+213,222, 76,144,219,206, 58,251,143, 62,242,142,225,246, 97, 71,106, 64, 22,224,145,239, 61, 49,125, 54,151, 22,246,142,150,145,
+153, 42, 31,166, 6, 96,173,164, 29,189,226, 40, 87, 22, 72, 10, 57, 14, 97,167, 42,233, 93, 47,214, 7,115,111,101,217,121, 27,
+ 55,204,239,106, 25,121, 18, 50,235,206,188,162, 87,220,160, 45,166,193,191,236,164,167,229,199,150, 56,107, 59,210,151,151,115,
+ 90,226,199,222,136,211, 34,197,154,218, 20,120, 37,198,130,137,249, 40,168, 98,240,127, 84, 90,139,155, 51,197, 50,155, 77,114,
+ 60, 44,203, 38, 37, 86, 43, 27,154, 87,114, 84, 54,175,196,133, 16,110, 87,208, 19,247,125,216,173, 53,165,228, 85,211,148,102,
+ 71,142, 62,199, 44, 51, 21,247, 19,250,234,110, 67,246, 87,175,221, 41, 23,247, 98, 88, 91, 43,182,125, 95,241, 94,177, 58, 9,
+ 19,167, 77,100, 84,109,127,180,242,143, 90,232,143,163,115, 84, 14, 83,204,181, 12,189, 45, 68,179, 45,144,243,105, 31,246,173,
+139,139,124, 69,255, 0, 12,125, 33,203, 95, 72,206,130,100,234, 68, 70,115,142,122, 79,214,142,222, 63,212,116,182,215, 54,115,
+142, 4,164,139,180,208, 37, 36,146, 64,221,110, 65,199,199, 61, 46,153, 93,167, 68,158,188,179, 37,230,106, 5,144,152,171,142,
+171, 46,234, 10, 65, 0,142,132,238,182, 59, 11,179, 77, 17,174,202,250, 53, 84,215,106, 44, 53, 63, 95,110,154,184,237,214, 22,
+192,112, 25,242, 16, 3,108,161, 68,130,128,139,149,169, 66,247,219,207,222, 22,139,202,113,155,253, 20, 72, 87,248,244,211, 85,
+ 30,128,124,107,161,195,110, 27, 75,138, 60,213,244,231,238,161, 31, 72, 55,107, 68,118,168,215,215,115, 45, 18, 36,216,148, 90,
+ 60, 22,233,244,152,149, 6, 59,167,211,182,234,117,110, 32, 19,181,101,213, 40, 91,174,212,164, 30, 70, 59,199,232,226,201, 52,
+157, 52,236,161,151,233,155,151, 30,177, 94,239, 43, 19, 89,149, 29,108,173,192,240, 79,118, 81,188, 14,241, 33,148,181,226, 77,
+197,201,231, 31, 50,116, 55, 71,165,234,158,169,208,178, 92,218,134,247,171,149,134, 35, 44,163,196,161,222, 56, 55,172,159,112,
+ 37, 71,224,113,246,161,110, 80,232, 52,184,244, 26,115, 72,141, 14, 20,116, 71,138,210,120, 13,161, 35,106, 82, 61,192, 11,124,
+176,123, 69, 7,157, 82,135, 42,219, 67,169, 88,210,131, 86,167, 15, 18, 92, 69,184,255, 0,149,241, 1,204,146,187,148, 18,133,
+121, 29,190,238,184,146,230,106,244, 21,247,171,141, 33, 4,216,129,207,248,242,197,101, 88,204,173,165,245, 51, 37,209,112,118,
+245,233,115,124,111,176,153,170,183, 14,229, 21, 31,168,234, 52,218, 60,151, 91,113, 87, 0, 16,146,122,115,231,129, 95,229,129,
+135,228, 2,228,132,128,142,109,126,182,242,192,252,255, 0, 54, 9,136,227,140, 17,215,194,126, 56,231, 60,239,155,230,209, 42,
+238,169,185,101, 34,252, 0,120,183, 63,242,252, 49,162,210, 18,189, 43, 56, 44,184,107,172,105,250,139, 14,104, 71,250, 71,118,
+ 69,172,119,112,121,195,245,234, 11,140, 47,106, 31,178, 7, 4,223,174, 56,251, 46,235, 28,134, 2, 1,157,187,144, 84, 20,191,
+133,255, 0,134, 39, 48,245,254, 11,201, 30,218,240,177, 87,175, 62,252, 51,150,198,162,160,160,107,163,152,212, 17, 37, 9, 10,
+144, 82, 22,121, 55,247,227, 25,217,254,152,219,189,227,147,129, 32,144,177,127,125,177,206, 85, 13,117,167,196, 8,109,137, 64,
+163,101,130,138,189,127,199,231,136,156,189,108,153, 42, 98,187,169, 69, 94, 50, 65, 10,234, 47,123, 98,169,180, 81,168,101, 81,
+174,168, 86,169, 66, 91,169, 40,148, 54,158, 0,191, 67,198, 31, 83,179,175,182, 63,113,126,128, 11,121, 95,252,126,120,230,140,
+149, 95,170,215, 38,119,133,242, 83,191,129,127,134, 47,108,150,211, 41,140, 29,117,203,146, 8,254,204, 1,118,225, 52, 37, 38,
+ 42,108,250,220,116,135, 91, 55, 10, 60,243,228,112,214,101, 49,167,108, 54,220,171,167, 30,126,152, 35, 13,184,239,196, 70,231,
+ 5,246,216,139,225,218, 99, 51, 41,244, 37, 36, 29,132, 17,180,245,247, 98,170,187,162,132,107,152,251, 74,182,197, 27, 87,149,
+ 13,247,163, 52,180,192,142,164,169, 99,196,144, 91,232, 60,253,127, 28, 69,229,251, 5, 89,150,226, 52, 99, 45, 27, 1, 43,239,
+148,217, 87,175, 3,175,207, 19, 46,214,212, 40,185,147, 88,101,213, 99, 60, 99,170, 44,102, 89,222, 64, 35,114, 69,135,203,159,
+207, 20,228,172,191, 95,168,151, 82,213,116, 0,203,164, 44, 54,201, 73, 23, 6,195,223,198, 57,139,155,187,117,220, 18, 28,136,
+174, 73,235, 23,156,185, 90,128,144, 77,108,157, 71, 75, 19, 28, 46, 41,148,134,110, 90,112,173, 74, 27,135,186,221, 45,134,178,
+220,151, 76,150,220,248,178, 20,130, 25, 33, 37,196,165, 55, 36,121, 12,110, 86, 66,122, 51,136,134,107,143,135, 29, 4,238, 82,
+238,126, 62,152,209, 81,211, 90,165, 49,230,229, 49, 84, 68,199, 86,157,233, 75,174, 19,208,226,105,196,237,167, 42,156,248, 81,
+ 63,164, 92,148,204, 83, 41, 21,199,223,144,220,105,181, 57, 13,119,164,247,171, 71, 59,207, 22, 60,116,198,140,195, 38, 10,163,
+161,231, 38, 63, 36, 33, 27, 31, 37, 22, 31, 48, 58,224,155,148,124,245, 53,132, 63, 2,145, 21,160, 70,210,176,110, 83,240, 24,
+ 21, 85,201,121,198, 34,193,140,219, 15,150, 81,119, 18, 77,185,244,243,247,224,237,223, 91,149, 14,248, 30,241, 84, 93,195,221,
+108,234, 41,139, 53,244, 82, 22,193,122,140,160,215,118,164,221,108, 17,184, 30,156,115,127,158, 9,211,234,176, 88, 38,165, 22,
+ 42,123,231,145,100,187,221, 27,160,242, 5,207, 65,240,192,105, 43,207, 96,130,230, 91,125,183, 20,174,241,183, 18,202, 74, 83,
+229,239,227, 14,155, 57,165, 80,131,147,195,219, 29, 38,200, 72, 10,185,191, 55,249,224,238, 62,220,110, 61,104, 2,216,142, 70,
+138,175, 51,212,148,174,234, 77,108, 38,228,146,181, 14, 19,127,213, 30,252, 53,166,214, 87, 22, 82,227,189, 86,144,243,110, 46,
+196, 52,209, 55,252, 48,217,170, 85, 66, 81, 74, 81, 21, 75,112, 47,123, 72, 91, 28, 31, 80, 49,148,234, 94,122,109,164, 59, 76,
+130,176,155,155, 89, 54, 41, 62,182,183, 65,128,139,150, 63, 76,129, 62, 67,233, 79,236,254, 6,182,202,203, 20,138,145, 1,217,
+ 82, 2, 1, 83,169, 74,211, 98, 72,245, 7,166, 26, 59,148,178,125, 65, 1, 18,169,203, 74,138,174,144,148,238,242,235,240,195,
+ 25,181,140,225, 73, 9,129, 85,130, 8, 73, 80, 42,238,201, 85,253, 9, 39, 15,242,254, 77,159, 93,138,135,254,176, 49, 94,121,
+103,106, 81,199, 0,155,156, 20,222, 45,148,230, 83,144, 57, 65,167, 22,193, 71, 65, 94,167, 33,229, 14,225, 18,132,118, 20,150,
+222, 1, 76, 41,187, 94,254,103,155,140, 58, 99, 39,228, 40,115,187,248,180,200, 77, 43, 98,129, 74, 16,171,145,230,122,224, 28,
+252,177,155,105, 79,168, 10,123,207,169,151,118,169, 74, 73, 80, 7,212, 91,200,223,207, 1,179,102,117,205,180,102,156,126,171,
+150,221, 76,118,154, 27,159, 97,173,196, 11, 18, 73,227,243,196,197,203,207, 70, 87,102,124,126,156,234, 72,180,204,114,229,214,
+165,217,178,151, 16,181, 30, 62,150, 57, 21,169,239,255, 0,239, 13,203,225, 15,178, 8,220, 46, 77,199, 54,231,222,112,102,141,
+ 51, 46,185, 5,167, 36,209,224,186,235, 77,120,238,141,170, 30,187,118,241,138,154,139,156,166, 38, 43,117,248,244, 57, 11, 19,
+ 64, 12,169, 72,224, 55,201,218, 57,243, 28,156, 61,253, 36,206,210, 2, 95,137,151, 22, 15, 62, 20, 36,220, 39,225,228, 48, 69,
+135, 22,212, 41,126, 26,145,254,250,206,181,113, 97, 38,212, 50, 80, 52, 59,243,171,105, 25,150,146,217,246,248,153,109, 72,112,
+ 1,181,224,202, 84,164,143, 33,126,182,195, 4, 85,170, 19, 36,169,193, 33, 40,117,199, 9, 81,147, 30,201, 9,244,235,136, 91,
+212,204,225, 34, 11, 77, 83,100, 30,253, 92, 33, 41, 54,247,216,226, 56,170,126,174, 25,201, 98,119,122,222,229,148,133,128, 72,
+242,184, 39, 21, 26, 67,106,152,112, 15, 51,251,213, 99,106,157,226,174, 47,211,120,194, 50, 88, 50,150, 91, 38,206, 4, 20,144,
+181,116,224,117,199,136,175,211, 36, 41,110, 41,222,229,148,139, 37, 43, 1, 87,249, 28, 83,149,166,243,197, 30,154,154,179, 53,
+ 37,133, 4, 42,233, 8,233,107, 11,223,203, 1, 89,172,231,185,196, 33,126,218, 66,213,192, 66, 13,137,243,252,112, 68, 89,161,
+105,204,149,136,166,246,116,116,174,134,127, 57, 59, 18, 35,113, 26,172, 48,180, 37, 36, 57,222,128,146,160,121, 1, 54, 56,100,
+141, 68,102, 4,117, 75,151, 87,104,139,217, 40, 46,158, 57,243,248, 98,145,167,101,172,247, 92,101,201,173,179, 40,183, 28,144,
+189,196,220,158,150, 31, 60, 55,159,149,117, 22, 26, 28,126,125, 34,110,196,253,210,164,145,127, 46, 61,112,201,178,182, 39, 41,
+112, 79,186,166, 45,199,252,106,229,168,234,173, 38, 92,125,166,166,203,238, 41,119,222,183, 15,132,219,229,128,237,234, 61, 22,
+159, 32, 61,237,236, 43,119, 46,109, 93,173,248, 98,167,167,229, 12,219, 61,213,182,105,146,218, 1, 36,221, 77,147,205,189,223,
+135,207, 13,219,161,230, 20, 16,210,105,146, 84,164,159, 29,155, 39,140, 88, 77,165,170, 4, 5,211,150, 57,229,171,118, 95,104,
+191, 97,105, 40,165,176,203,196,155,149, 56,226,174, 79,241,192,250,191,104,201,178,211,182,162,148, 4, 18,119,132, 11, 3,249,
+226, 11, 75,210,172,231, 61,213, 61, 18,133, 37,103,161,216, 44,110,112,245,122, 1,170,114,228, 37,110, 80, 8,104,170,222, 53,
+ 2,175,158, 33,147, 7, 66,181, 80,159, 19, 83,236, 87,210,137, 43, 90,234,204,149, 57, 69,146,166,208,177, 98, 1, 2,224,245,
+195, 25,186,159, 80,152,160,169, 51, 74,220, 81, 36,238, 95, 56,115, 78,236,227,157,234,145,220, 75,105, 67,105,108,171,236,220,
+ 93,137,176, 36, 91,240,192,103,244,123, 54,211, 93, 76,101,210,221, 90,251,144,240, 91,105,186, 84,131,231,124, 21, 15,225,101,
+ 80,149, 9,167, 75, 11, 60,169,212, 45, 70,113, 49, 28, 67,200, 72,228,236, 74, 15,158, 27,187,156,106, 33,189,137,184,105,197,
+221, 69,213,143,157,134, 13,163, 66, 51, 51,176,155,115,196,151, 71,137, 81,201,241, 91, 2, 42,122, 93,155,233,242,125,149,202,
+124,148,167,114, 66, 84,166,174,130, 77,249, 7, 9, 23,150, 10, 81,202,161, 82,236, 13, 96,206,109,144,123,198, 81, 48,148,168,
+114, 67,134,228,121, 14,184,212,245,126, 84,196, 45,157,128,165, 92, 36,133, 27,147,130,148,237, 19,206,115,103,161,109, 81, 72,
+102,192,151,199, 2,223,219,137, 37, 83, 67, 94,141, 25,164, 82,170, 12,166,118,197, 23,154, 88, 34,227,200,143, 33,230, 48, 53,
+226, 54, 40, 80, 25,135,223, 90,126,192,197, 87,102,179, 86, 66,136, 12,167,142, 57, 32,244,248,225, 98, 88,141, 17,207,106, 82,
+146,238, 95, 46, 40, 30, 84,209,227, 11, 4, 24,141,153,255, 0, 33,234, 63,122,127,102, 21, 51,157,168, 20,204,215,146,160,204,
+205,172, 71,147, 73,121, 30,205, 30, 28,196, 5,165,240,130, 20,235,132, 17,107,119,138, 28,254,226,135,144,198,231,245, 38,153,
+157, 50, 42,242,221,102, 51, 79, 67,169,182,220, 54,163, 41, 59, 80, 18, 14,237,192, 38,219,118,132,131,197,173,198, 57,166,181,
+170, 70,172,204, 42, 91,106,112,195,166, 65, 68, 90,123, 23, 63,119,170,151,241, 82,202,143,204,224,205, 59, 61,191, 18, 57, 13,
+172, 30,233,189,141, 92,240,216, 63,120,252, 73,233,142,121,120, 86, 85, 2,145, 4, 25, 17,200,206,227,225,233, 93,106, 46, 93,
+ 74, 34,116,171,223, 72,117,113,156,156,196,237, 44,170,188,164,177, 4, 54,245, 0,192,144,228, 84,182,211,142, 45,101, 96, 33,
+ 98,194,232,222, 73, 36,220,243,123,242, 99, 62,246,138,207,243, 32, 70,153, 30,123,181, 24,240, 95,239,225,206, 97, 65,153,209,
+ 29,181,130,219,117, 2,203,232, 69,148,159,187,112,162,164,149, 3,206,116,138,195, 21, 58,162,220, 92,165, 42,117, 73, 77, 71,
+186, 77,187,182, 16, 78,212, 3,251, 74, 36, 95,208, 1,239,195, 77, 81,172, 87,154,139, 95,139, 73,204,111, 68,130,100,136,104,
+ 67, 64,165, 37, 41, 3,144,164,220,166,229, 36,155,122,219,165,241, 59,172, 34,210,227, 16,237, 72, 18,168, 38, 70,147, 0, 40,
+142,146,100,248,213,155,105,184,112, 54,149, 4,204,120,125,251,234,255, 0,205,189,173, 50,174,100,163, 50,189, 71,168, 49, 15,
+ 48, 51, 29,108,166,189, 14, 0, 73, 91, 15, 4,165, 82, 25,186, 13,156, 74,210,144,227, 42, 32, 21, 54,160,146, 55,224, 44, 47,
+164, 47, 95,178, 70,149,212,251, 52,234, 21,106,149,156,114,229,114,130,237, 50, 53, 97,244, 45, 83, 26,140,251, 65,198, 66, 92,
+ 75,129, 10,218,229,148, 74,146,181,120, 10,119,216, 38,220,133,154,115, 86,106,165, 83,233,178, 31,156,163, 34,202, 42, 77,194,
+129, 65,228,146, 58, 29,201, 6,252,126,168, 56,119, 26,190,169, 25,189,200, 70, 3, 13,173,167, 23, 20,169,146, 18, 30, 8,186,
+208,234,145,228,160, 18, 83,184,125,235,131,212, 18,116,172, 48, 91,107, 65,220, 72,141,122,105,255, 0,175, 48, 53,229,215,194,
+174, 94, 22,172,243, 41,162,160,189,149, 49, 6, 0, 7, 81,184,233,166,219,215, 89,118, 55,237, 49,152,180,219, 64,115,142,149,
+ 77,126, 58,232, 18,243,118, 92,152,226, 31, 96, 45,212, 43,235, 72,234, 90, 91, 89, 54,104, 40, 48,146, 77,141,237,239, 56,169,
+ 59, 87, 55,167,244,189,105, 83,122,108,213, 71,216,228,209,123,169, 95, 89, 77, 75,238, 45,246,164,190,200, 35,106, 18, 16, 2,
+ 25,105, 59, 57, 32,164,155,243, 96, 39, 70, 84,186,164,232,217, 74,124, 20, 61, 14,175,155,169,226, 66,150,226,146, 16,152,161,
+217, 42,189,148, 46, 10, 18,174,160,216,129,211, 17,220,209,154,145,153,117, 29,220,202,150, 27, 8, 76, 70,158, 67, 76,131,183,
+123,128,186, 82, 46, 77,252,110,171,240,197,139,116,118,119,110,161, 35,115,152,251,192, 30,164,130,103,122,162,237,211,159,211,
+192, 38, 71,243, 82,122,156, 42,125, 63,179,246,111,167,205, 66,158,118, 44,104,137, 69,136,179, 79,189, 37,178, 72,226,230,193,
+157,191, 50,113, 79,102, 12,208,196,157, 62,164,101, 70, 99,184, 36, 66,155, 41,215,156, 39,133,165,192,208, 64, 3,221,177, 95,
+142, 36, 25,219, 50,213, 77, 28,101,225, 45, 73,102,115,233,126, 99, 64,240,226,155, 10, 9,191,195,188, 86, 34,116,122, 84,186,
+246,104,141, 73,166,199, 47, 60,183, 0,105,161,230,171,216, 15,196,140,104, 50,214, 73, 82,204,235,152,120,105, 31,189,102,182,
+169, 64, 38,172, 13, 55,115, 35,102, 77,101,128,230,110,203,197,172,177, 75,136,244,202,140, 54,110,166,192,106, 58,212,218, 22,
+163,209, 43,120, 32, 19,251,198,195,203, 16,221, 67,203,121,183, 40, 85, 40,121,242,117, 78, 59, 44, 87, 99,187, 54, 34,144,201,
+105, 64, 55, 37,216,229, 43, 64, 31,235, 9,100,169, 92,117, 87, 60,226, 93,170,117,202,102,156,196,137,164,185, 53,230,100, 73,
+109,212, 75,204,115, 66, 2,132,167,211,202, 90, 55,224,182,147,250,167,139,117, 28,156,101,174,250,192,172,245, 38,126,162, 83,
+ 41, 16,229,186,154,146, 37,170,162,252, 68,165,109, 72,148, 20,235,131, 98, 64, 77,208,226,214,144, 45, 97,100,245, 60,224, 45,
+ 41,243,112,133,161, 61,197, 8,212,242, 27,111,177, 81, 62,100, 1,167, 73,180, 66,155,205,232, 58,209, 58, 60,184, 69,233,185,
+166,176,179, 4, 85,167, 7,218,132, 25,251, 68,181, 98,161,181, 23,225, 59,151,198,235,112,158, 47,140,179,246, 98,106,145, 82,
+164, 82,232,226, 19,130, 53, 21,133, 41,247,227,133,188,210, 92, 5,208,159, 29,211,209, 96,238, 74, 65,230,222, 92,215,185, 50,
+187, 34,175, 74, 75,245, 74,162,222,125, 15,175,114, 93,185, 82,175,206,237,223, 18,112,171,185,165, 85,106,187,213,105,253, 92,
+ 67,108, 33, 41,242, 66, 16, 16,145,242, 74, 64,193,147,108, 11,178,174, 95,232,124, 40, 1, 2, 76,239, 93, 41,217, 57, 83, 21,
+168,153, 79, 61, 74,173, 73, 68, 39,115, 84,104,165,232, 12,165,183,210,164, 58,194,220, 45, 56,160, 17,185, 40, 90, 79, 39,195,
+185, 36,216, 28,116, 15,210, 49,153,242, 38, 83,172,229, 61, 47,201, 53,217,147,158,106,147,237, 53,215, 17, 9,168, 12,149,149,
+ 20,180, 18,195, 7,186,184, 9,112,149,108, 10, 37,124,147,142,114,210, 93,111,141,160,185, 79, 76, 43, 25,114,140,220,250,133,
+ 22, 77, 66,180,168,114, 29, 9,109,201, 82,150,150,152,222,161,200, 9, 75, 13, 40,250, 1,193,244, 9,168, 58,197,156,117,155,
+ 81,167,234,110,126,125,151, 42, 19, 84,142,252,196,105, 72,101, 27, 80, 16, 18,128, 73, 33, 32, 36, 1,114, 79,169,185,198, 32,
+ 55,111, 93,175,184, 3,112, 68,206,178, 20, 68, 1,208,128, 21, 62, 67, 94, 90, 44,190, 26, 96,182, 35, 83,239,229,206,186, 19,
+177, 46,168,228,253, 48,214,120,217,226,186,221, 70,116,200,177, 29,110,133, 72,165, 83,253,162,100,169,110, 39,101,154, 70,224,
+155,132, 41,126, 37, 16, 5,193,235, 96,123,203,252,160,246,140,205, 20,148,205,111,179,189, 42,145, 29,198,247,181, 35, 54,103,
+148,184,250,193,191, 37,184,209,221, 74, 15,168,220, 49,194, 61,140,117,166,147,166,117,106, 77, 31, 75,116,193,220,205,158,106,
+ 46,247,245,249, 50,131,109, 70,165,211,139,136, 75,101, 82, 54,173, 76, 54,119, 93,100, 4,146, 84,139,220, 0, 15,123, 87, 43,
+ 26,143, 91,130,152, 85,218, 93, 22, 59,203, 78,224,196, 74,148,132,184, 82, 5,207,118,151,227,163,188, 30,240,109,240,196,109,
+ 45,108, 92,186, 46, 45, 61,225,160,145, 49,202, 82, 12,196,245, 0, 19,212,136,173,182, 18,128,192, 86,228,212, 10,169,168,185,
+222,148,234,191, 72,114,173, 33,139,220,173, 84, 90,178,157, 60, 95,146,151, 89,107,215,174,227,240,192,138,206,127,130,234, 4,
+169, 15,236, 4,146,224,191, 61, 58,126, 55, 56, 5,171, 49,231,192, 15,184, 29,113, 37,167, 54,144,179,115,126, 9, 23, 30, 92,
+142,158,184,160,245, 27, 58,214, 96, 76,118, 59, 50,150, 74, 18, 84,171, 31, 49,127,237, 54,199,109,108,219, 89, 52, 85, 1,224,
+ 86,106,209,212,173, 99,161,198,105, 9,139, 48, 43,194,119,167,229, 97,138, 3, 81,243,144,170, 33,213, 48,187,144, 70,211,248,
+226, 9, 92,206, 85,202,213, 85,200,113,150,226,156, 64,253,163, 97,254, 63,183, 12,219,151, 87,157, 5, 78, 45, 10, 45,166,201,
+223,180,155,159, 32, 61, 73,254,204, 91, 29,147, 71,245, 80, 66, 2, 40, 69, 95, 80,234, 20,169,106,111,218, 20,139,240, 8, 56,
+217, 31, 88, 42, 69, 1, 66, 97,227,160,191,150, 33,185,230, 21,102,101, 90, 64,102, 3,129,136,227,253,105, 65,241,158,122,122,
+249,159,128,192,234,102, 95,171, 76,124, 33,166, 29, 72, 1, 67,144,121, 34,192,254,103,242,197,129,112,201, 76,200,169,131, 53,
+102,177,169,149,122,137, 12, 34, 66,213,117, 2, 0, 56,159,233,117, 23, 53,102, 71,219, 84,132,169, 45,149,125,229, 14,189, 49,
+ 23,210,173, 58,102, 52,148,119,205,151, 93, 67,132, 41, 42, 79,161, 85,255, 0, 36,156,116, 46, 77,135, 10,155,220,165,164,165,
+180,160, 2,164,145,240,192,189,162,221, 70, 2,133, 50,180, 21, 57,211,202, 2,104,177,155,109,109, 18,174, 47,199,159, 31,223,
+139, 71, 46,206,106, 59, 65,183,159,178,147,233,239, 23,197, 96,198,104, 97, 91, 83,125,160, 39,168,255, 0, 31, 12, 57, 78,119,
+143, 14,110,239,110, 54, 4, 2, 71,195, 21,159, 68,138,170,164,149, 85,211, 76,156,236,199,172,204,176, 9,225, 36,158, 5,191,
+182,247,193,236,184,249,102, 98, 36, 75,124,132, 54, 55, 58, 80,174,128,117, 24,160, 99,234,211,161,194,203,115, 71, 43, 55, 80,
+234,155,159,249,226,235,209,156,221, 73,143, 67,149,152,164,237,152,236,118,194,219, 14,216,160,159, 50,175,112, 0,159,125,177,
+203, 99,151,167, 11,195,157,186,203, 57, 68,199, 83,200,122,212,153, 97, 78,172, 35,173, 82,250,153, 11, 62,230,204,217, 87,175,
+ 67,162,127,163,170, 91,142, 33,178,130, 74,133,192,184,245,185, 41,183,207, 0,233, 57, 15, 55, 71,158,168, 74,203,253,227,215,
+ 43,238, 66,109,111, 9, 5, 95, 30, 5,135,191, 29, 95,156,243, 46, 77,170,209, 34,214, 34, 48,132,166, 99,131,187, 98, 59, 34,
+238,182, 86,148,245, 61, 46,173,191,239, 12, 67, 37,186,186,212,167, 40,241, 86,150, 94,148,227,173,201,117,171, 36, 32, 41, 87,
+ 41,221,229,202, 58,143, 47,142, 60, 45, 28, 69,121,124,246,141, 0, 73, 53,214,240,223, 5,191,142, 98,205,216,180,160, 10,206,
+164,236, 0,212,168,248, 1, 39,199,106,231,164,100,234,165, 98,170, 32,204, 74, 17, 33, 47, 56,222,255, 0, 48,144, 69,128, 61,
+ 13,249,248, 97,166, 96,200,121,151, 41, 72, 93, 66,116, 87,223, 74, 90, 82, 27, 88, 28, 0, 72,233,240,176,197,238,205, 27, 43,
+105,251, 75,170,102,105,172,181, 30, 50,202, 26, 90, 0, 9, 60,241,183, 21,198,165,235,230, 80,206,181, 7,178,252, 22,131, 76,
+ 8,238, 52, 86, 20, 60,107, 59,118, 43,229,226,252,113, 80,227,183,235,117, 72,111,148,242,210,190,176,195,255, 0, 8,255, 0,
+ 13,172, 26, 67, 23, 22,203,184,152, 10,112,184,180,153, 38, 37, 41, 66,146,144, 57,193, 10,141,137, 53, 7,165, 79,159,153,148,
+191,209, 8,157,234,160, 50, 68,134, 0,241,161, 68,114, 84,158,189, 1, 56,127, 85,203, 89,133, 16,123,199, 32, 37, 46, 37, 10,
+ 75, 97,193,255, 0, 72, 84, 55, 19,238, 31,192,226, 37, 59, 50, 84, 52, 3, 82,105, 57,246,154,180,184,220,225,221, 84,163,111,
+184,121,130, 44,171,143,218, 73, 59,129,245, 22,232, 78, 44,109, 67,212,232,121,131, 37, 58,253, 18,114, 27,113,218,130, 90, 75,
+143, 34,203,105,183, 2,128, 62,235, 37, 93,125, 2, 61, 49,189,135,226, 15, 93, 20,148,160, 65,231,208,243,175,158,191, 23,191,
+ 11,237,120, 27, 25, 72,181,112,170,217,224, 84,217, 87,234, 17, 18,149, 68, 2, 83, 32,200, 0, 16, 70,147, 53, 16,145,146,115,
+181,162,185, 41,151,216,106, 52,128,158,237, 6,228,168,168,142,236,143, 49,207, 32,250,131,230, 48, 27, 42,228,233, 75, 91,242,
+163,208,164,160, 62,243,178, 31, 64,112,144, 23,117,133,109, 29, 0, 27, 79, 78,182,191, 36,226,207,174,235,141, 69,156,185, 53,
+ 17, 91,140,135,251,176,168,199,194, 72, 46,161, 41, 74,191,239, 11,110,249, 98, 33,156, 53,239, 44, 83,218, 98,143, 8,182,243,
+106,166,149,186,226, 58,149, 23, 20,213,174, 57,242,249,238,198,203, 87,151,197,176,146,141, 9,228,121,111,245,211,198,107,195,
+213,100,137,133, 47, 74, 5, 77,126, 84, 24,207, 84, 39, 36, 53,221, 60, 90, 45,164, 19,185, 92,168, 1,238,228, 3,130,232,204,
+168,144, 91, 49,161,173,106, 66,129, 95, 22, 3,207,230,122,124,240, 10,179,172,212, 10,117,105,216, 12,229,182,196, 24,234, 12,
+ 52, 57, 33, 68, 4,128, 57,228,159, 9, 23,249,226,111,151,181, 31, 78,170,240, 36,154,132, 17,222, 71, 67, 8, 72, 77,142,221,
+234, 72, 4,250,147,185, 3,220, 78, 29,215, 10, 0, 89, 65, 32,213, 85,218,119,136, 74,170, 37, 92, 91, 21,170, 74,160, 72, 11,
+ 74,223,127,107,174, 54,139,169, 9, 32, 30, 46, 60,172, 77,253,254,236,104,167,228, 42,188,168, 44,205,167,182,242, 7,117,100,
+ 41,105, 60,164, 27,124,189,126,126,252, 88, 84, 58,206,152,176,244,174,252, 38, 80, 18,208,219,206,133,219,135, 27, 32, 44, 17,
+200, 3,197,111,150, 35,117, 29, 78,204,244, 12,186,197, 66,155, 73,117,234, 66,231,123, 60,106,171,173, 0,217, 54, 32,182,181,
+ 3,109,195,106,125,198,215,193,154,117,215, 88, 61,150,138, 7,101,115, 7,167,136,137, 32,198,154,209, 81, 97,156, 25, 59,107,
+165, 71, 14, 77,212, 74,122,166,165,186,251, 45,168, 74,113,127,104,146,162,120,224, 88,249,139,254,120, 13, 95,200, 57,177,147,
+ 2, 28,172,216,103, 71, 83,233, 21,118,165, 68, 74,130,153, 36,149, 41, 36, 88,163,132,148,249,223,118, 38, 72,214,106, 43,148,
+185,179, 43,113, 80, 36,247,203, 41, 82,133,247,186,110,165,255, 0,186,157,168, 30,251,227, 26,174,176,229, 72,178, 95, 93,102,
+150,158,239,184,111,188,142,143,190,178, 65, 82, 83,238, 28, 31,199, 18, 77,205,226, 85,250, 62, 3,239,157, 12,218,229, 61,218,
+200,196,203, 85,120, 43, 84,138, 91, 37,150, 18, 21,220,119, 67,105,184, 40,181,189, 57, 63,142, 8, 59, 7, 38,198, 49,218, 48,
+ 81,223,247,101, 74, 74, 60, 55, 74, 83,207, 79,133,190, 88,139, 86, 51,197, 13,230, 91,101,151, 11, 47, 8,174, 56,243, 0, 89,
+ 45,130,171, 36,155,123,202, 85,243,196, 94,165, 87,175,205,205,105,109, 51,192, 83, 41, 82, 73, 2,192,223,119,228, 10,186,122,
+ 39, 5, 98,209,247,213, 18, 69, 36,219,105,173, 76, 28,160,229,214, 42,107, 45, 54,241,117, 13, 37,229,164, 46,200,222, 84, 82,
+ 5,255, 0,162,113,185,113,159,168, 69,113, 85, 42, 42, 89,238,101, 45, 17,214,100,133, 7,146, 15,133, 96,117, 77,211,110, 15,
+166, 43,218, 45,107, 52, 41,247, 95,144,222,246,213, 61, 8, 91,169, 38,229,180,240,144, 9,253,165, 46,223, 60, 75,227,102,232,
+ 16, 80,135,107,140,144, 94,121, 68, 54,149,130, 90, 27, 60, 55,183, 79, 13,143,198,248,182,253,147,237,142,186, 83, 46,222, 14,
+148, 93,132, 83, 32, 70,113,151,104,209,200, 12, 21, 92, 0, 65, 0, 94,231,221,207,231,140,183, 81, 36, 45,114,187,150, 4,126,
+232, 20,134,155, 2,235,221,229,242, 3,240,196, 46,161,158,211, 26,168,188,185, 77, 14, 75, 46, 50,133, 60,251,220, 2,149, 40,
+ 57,180,123,133,147,242,190, 27, 85,245, 29, 84,135,150,234,160,182,134, 88,112, 20,178,216,232,130,162, 19,248,139,159,233, 98,
+177,182,114, 96,157, 77, 68, 91,235,169,169,236, 37,101,135, 64,109,135,119, 2, 20, 20,218, 83,193, 89, 89, 10,191,194,223,150,
+ 31,201, 92, 10,228, 38,152,100, 23, 9, 9, 67,206,146, 80, 91, 4, 17,100,145,231,124, 84, 49,117, 14,170,196, 88,237, 69,130,
+ 18,227,234,154,164,133,114,123,209,114, 7,226,164,225,244,141, 71,157, 78,150,195, 78, 72, 82, 17,109,165, 8, 7,198,160, 44,
+165,126, 0,255, 0,189,137,174,201,212, 57,221, 62, 83, 69,236,144, 14,149,102,202,128,219, 47,186,204, 55,209,189,214,144, 19,
+127,190,131,200, 60,244,244,252, 48, 38,100, 89, 47, 84, 99, 54, 34, 37,181,169, 74,238,220,109,177,181, 64, 14,119, 31, 46, 45,
+107,226, 28,238,168,199,106,182,152,149,150,139, 11,117,180,186,129,123,146,109,109,222,224, 44, 72, 30,103, 27, 39,103,168, 14,
+ 67,102,111,183,109,109, 78,169,149, 33, 43,182,203, 35,133,123,199, 76, 69, 54,175,160,130,126,244,168,251, 62, 99, 20,118, 46,
+ 94,204, 12,230, 41,149,214,106,200, 98, 58,155, 5, 81, 75, 71,119,120, 7, 43,184, 54,177, 22, 22,242, 34,248,144, 53, 75,204,
+111, 56,195,194,162,210,155, 40, 42,229,203,115,107, 1,239,253,111,195, 19,206,206,180, 60,145, 42, 45, 87, 93,181, 74,183, 78,
+141,147,232, 15, 45,134,189,177, 75, 40,149, 40, 67, 47, 41, 43, 8, 33, 69, 8, 7,121, 72,241, 58, 82,150,210, 60, 74, 41,163,
+181, 71,180,119,233,125,125,233, 57,127, 45, 68,161, 83, 90, 10, 84, 72,209,225, 54,219,174, 54,171,132,149,237, 27, 82,121,190,
+212,223,109,254,242,173,124,106, 43, 13,125,251, 65,114,233, 8,210, 6,154,170, 7, 32, 58,115, 36,255, 0, 39, 85,142, 86,194,
+214,119,218,139,213, 33,234, 53, 34,182,136,145, 33, 48,227, 79, 92,203,146,137, 41, 6, 55,136, 41,190, 58,168, 42,202, 73,183,
+ 35, 5,169,232, 52,182, 90,106,173, 87, 5,199, 83,246, 73, 74, 71,221, 29, 62, 86,190, 41,202,174,171,230,105,117, 87,123,185,
+ 74, 42, 47, 39,106, 65,225, 91, 91,221,127,158,227,134, 34,191,155,100, 65,138,235, 50,214,236,135,214,243, 0,172,159, 3,118,
+ 77,205,189, 54,223,159,222,248, 98,162,172,212,251,105, 7, 42, 99,120,231,231, 85,212,210, 8, 31,115, 87,235,178,242,244,218,
+156,105, 74,156,130,236,150,138,152,191, 82, 5,148, 79,167,153, 24,241,179, 71,168,193, 98, 53, 74, 99,125,193, 54, 67,173,158,
+ 7,136,143,239,199, 46,126,153,103, 89,254,201, 61,181, 62,133,182,242,217,142,234,250, 43,112,252,184, 23,249,224,136,212, 28,
+228,186, 97,104, 23, 64,136,175, 24, 74,184,220, 54,128, 79,227,248,168,225,215,131, 28,163, 43,148,197,132, 3, 21,210, 45,190,
+221, 5,213,198,165, 50,218,208, 19,246, 69,107,186,184, 54, 39,225,111,227,141,134,173, 75, 33,151,235, 42,140,100, 54,194, 11,
+202,109, 2,201, 42, 30,126,224, 79, 31, 28,115,132, 61, 83,204,177,225,173,249, 82, 94,239, 2, 16,148, 92,241,101, 36, 95,240,
+177,190, 53, 74,213,138,173, 98, 90,131, 82, 10, 27, 61, 86, 15, 43, 9,177, 10,248,146, 63, 60, 65, 24, 74,231,245,111,206,144,
+103, 46,213,211,148,205, 85,166, 81, 97,129, 80, 83, 47, 23,142,228, 45, 12, 37, 92, 88,122,254, 63, 60, 44,114,241,213,108,207,
+ 8,132,209, 30,121,166,212,144,118,223,139,121, 17,111,158, 22, 8, 48,134, 0,213, 19,227, 36,124, 34,140,150,210, 19,168,248,
+213, 70,254, 92, 51, 51, 42,159, 39,184, 99,122, 84, 10,120, 9,108, 89, 95,194,195,231,141,243,227, 42,155, 49,167,212,146,225,
+144,224, 17,227, 35,245,136, 22, 3,241,231,228, 49, 61,206, 57,105,138, 91,162,134,195, 91,165, 57, 17,164,132,143, 46, 19,199,
+248,244,192, 4,209,165, 69,110, 67,238, 54,127,208, 88,121, 73,144, 69,252, 74, 59, 82, 6, 58,100, 63,157, 2,106, 9,116,144,
+ 42, 41, 75,159, 42,135, 84, 76,242,248, 87,177, 57,116,237, 61, 87,205,173,240,254,236, 73, 93,173, 68,170,229,242,185,201,184,
+ 50,131,187, 79,253, 42,202,122, 31,112, 38,231, 17,153, 52, 41, 76,119, 78, 54,217, 8,238,183,171,119,175,151,246, 97,229, 76,
+ 90, 44, 90,123, 75, 41, 33, 41, 94,193,212,142,164,252,240,234, 66, 93, 0,154,176, 14,162,161, 58,189, 22, 60,202,219, 50,225,
+ 60, 92,117, 51,139, 75,109, 63,116,160, 16, 47,199,173,215,141,180, 74, 82,198, 99, 57,142, 76,175, 8,134,131,180,255, 0,218,
+247,123, 8,252,119, 31,158, 55,188,195,149, 10,139,146, 84,208, 1, 14, 30,237, 32,121,245,255, 0, 7, 14, 90,163, 73,246,182,
+ 27,152,174,236, 41, 61,227,151, 28, 11,243, 96, 60,205,191,142, 47,165,216, 64, 79, 56,138, 58,213, 40,203, 60,169,206, 95,170,
+ 85,168,115, 23,152,169,138, 87,120,202,159, 68, 70,201,251,206,184,218,144, 21,111,112, 54,254,145,195,100, 58, 96,190,204, 1,
+101,123, 28, 68, 53,222,249,168,164,109, 79,225,206, 36, 45,138,117, 21,110,203,158,180,146, 5,152, 96, 17,116,142,164,251,143,
+ 78,112, 36, 70, 98,162,226,100,163,106, 92,144,176, 44, 56, 75, 72,189,255, 0,191, 14,130, 12,170, 42,186,179, 41, 32,114, 21,
+ 31,174,166, 49,117,202,157, 81,226,152,241, 90, 1, 65, 63,121, 68,220,237, 30,243,198, 37,172,126,128,101,125, 49,131,172, 84,
+ 32,227, 83,230, 83,220,111,184, 43, 27, 90, 88, 86,194, 83,197,239,194,185, 36,245,196, 98,185, 78,135, 94, 92,192,209, 34, 11,
+ 74,225, 87,229,195,211,143,125,135,200, 12, 36,149,213,169,176,114,244,136,140, 42,156,210,202,253,157,192,118,161,180,130,108,
+ 44, 69,186, 15,153,195, 56,144,178,148,131,177,215,196, 70,212,253,158,100, 1,247, 21, 21,148,244,211, 6, 61, 73,150, 92,114,
+173, 57,231, 36, 57, 37, 5, 68,180,133, 13,160, 40,244, 2,219,143,190,227,211, 25,178,197, 62,108,149,229,193, 61,105,132, 30,
+ 10,113, 38,234, 43, 32, 14, 72, 29, 73, 32,241,239,196,134,177,245,132,218, 33,162,211, 84, 99,178,167, 65, 82, 27, 81,176,184,
+ 38,220,243,134, 20,236,169, 74,162,180, 39,205, 84,175, 11,106, 94,230,221, 9,220,161,110, 56, 23,197,164,173, 4, 79,165, 27,
+ 62,154, 81,214, 50,220,104, 49,149, 22,146,220,223,182,108,108, 67,173,180,202, 45,234, 1, 80,185,231, 2, 42,122, 99,152,159,
+238,221,166,186,167, 11, 87, 46, 54,166,129,185,247, 22,212,161,135, 44,167,187,166, 34,175, 29,151,162,182,165,169, 59, 81, 48,
+ 5,170,194,254, 35,110, 48,242,153, 22,177, 82,154, 19, 37,229,165,148, 55,222,184, 68,162,162,160, 18, 8, 73,241, 27,220,144,
+ 62,120,100,118,131, 92,194,130, 20, 65,208,214,252,209,154,107, 89,130, 52,104, 53, 56,202,134,212, 6,154,137, 76,136,148,109,
+238,216,108, 29,191, 18, 86,165,172,147,212,168,249, 90,217, 66,169,205,137, 25,170,101, 47,190,126, 76,133,134,216,105, 36,169,
+ 78, 45, 92, 90,222,100,156, 12,143, 29,191, 13, 61,110, 93,198,148, 67, 43, 39,239, 40,155,148,254, 7,140, 75,116,238,148,170,
+ 53,124,102,233, 21, 36,199, 16, 13,155,120, 50, 22, 82,178,147,114,144,174, 55, 15, 83,211,142, 49, 93,226,219, 13, 24, 30, 67,
+169,229, 69, 66,165, 98,118,174,245,236,117,149,169,221,155,180,176, 81, 41,210, 10,235,121,154,130,185,213,218,212, 20,148,206,
+ 97,215, 88, 87,114,219, 74, 82, 84, 20, 27, 94,221,188, 88, 44,147,101, 95,142,160,200,249,203, 35,232,230, 66,163,118,124,143,
+170,143,102,186,141, 49, 5,134,166, 85,100, 50, 37, 60, 84,226,138, 46, 10,130, 90, 72, 10,216,144, 72, 1, 41, 72, 28, 12,124,
+222,201,218,233,157,179, 28,199,105, 52,125, 64,159, 10, 35,141, 55, 16, 73,246,102,146,248,101,180,237,178, 84,218, 80, 82,155,
+ 91,129,201,183,222, 28,131, 42,203,250,215, 59, 38,211,218,133, 73,154,134, 31,113,162,228,183, 1,176, 47, 27,218,254,167,144,
+ 77,252,241,192, 11,124, 78,209,245,184, 85,222, 89,149, 70,255, 0, 17, 2, 54, 2, 14,194,183,145,136, 21,181,217, 36,194,126,
+ 63,126,181,209, 26,203,157,153,122,168,184,210,223,120,133,247,207, 6,236,139, 5, 11, 38,215, 6,196,120,111,127,222, 7, 20,
+124,247,161,102, 7, 34, 8,110, 23, 29,152,208, 74,210,164,249,133, 35,143,153, 39,240,198,216,249,223, 45,213,226,194,109,169,
+233,106,161, 33, 5,180,169, 10,220,219, 77,141,160,146,217,240,254,169,233,111,158, 0,138,165, 6,181, 85,110, 44, 50,219, 18,
+ 99,177, 47,187,117,181,157,151, 33, 68,172,130,127, 85, 75,227,158,182,227, 23,173,113, 59,244, 5, 37, 68,147,174,227,198,102,
+169, 92, 92,169,190,244,233, 81,243, 74,166, 82,243, 67,212, 22, 92,107,189, 59, 66,158, 6,214, 74, 71, 36,124, 72, 82,254, 22,
+197,129, 79,203,116,124,189, 25, 20,216,148, 16,239,179,132,186, 17,193, 41,113,196,132,166,231,160, 60,216,126,246,239,217,192,
+230,114,190, 82,115, 57,211,204,233,109,247,158,210,227,114,156,176, 37, 76, 50, 71,120,178,125, 84, 5,133,252,175,137, 27, 90,
+145,167,236,212,170, 53,216, 42, 76,151,225, 84, 82,252,183, 46,118,184,240, 10,238,155,235,109,169,222, 85,183,223,138, 87,216,
+133,229,192,202,153, 51,191,172,127, 3,198,136,130,149,166, 84,119,173, 39, 78,227, 76,170, 71,203,112, 50,235,106,218, 84,185,
+ 14,132,130, 20,249, 82, 66,208, 61, 18,128, 66, 69,255, 0, 90,254,163, 27,243,206,144,195,202,208,234,134,149, 77,109,231, 98,
+ 41,133,161,108,177,113,177,231, 60, 71,228, 20, 45,115,228,113, 50,139,172, 25, 75, 35,101, 57,176,217,161,172, 58,167,154, 75,
+ 18,228, 52, 66,150, 8, 42, 90,238,122,146,178,163,243, 24,205, 61,162,169,143,208,234,181,103, 59,151, 36, 78,149,187,184, 9,
+ 73,229, 41, 37, 41, 30,224,181,143,247,113,138,155,236, 89, 46,130, 18,114,207, 93,246,250, 77, 89, 67,118,170, 76,102,214,171,
+156,203,148,170,153, 87, 81, 98, 81,164,211, 84,220,121, 46,148, 54,226, 27, 60,148,130,175, 46,187,129, 81, 30,226, 61,112, 62,
+114,179,140, 73,143, 70,126, 35,232,110, 60,132, 54,225, 3,145,188, 41, 41,255, 0,196,221,191,165,239,197,223, 63, 82,224,230,
+138, 13, 47, 49,162,148,202,137,142,164, 2, 64, 42, 37, 44, 41,160,125,215, 90, 27, 62,237,195, 12,243, 60,150,106,105,250,205,
+216,237, 33,137, 85, 70,212,250,199, 42, 81,100,160,252,109,117,168, 15, 80,156, 94,180,199, 47, 89, 41,204,152, 59,111,208,254,
+213, 5,178,222, 98, 80,175,191,247, 85,210, 41, 89,185,197,187, 78,167, 77,121, 78,179, 37,109, 20, 58, 45,125,138, 41,189,207,
+192,226, 83,148, 52,103, 59, 85, 18,219,245,234,170, 98,161,107, 8, 30, 27,149, 19, 99,235,233,231,141, 26,157,152,225,170,163,
+ 76,127, 46,186,159,105,143, 62,243,130, 71, 11,186, 80,174,158,119, 82,148,171,123,177, 56,163, 78,168,206,204,181, 72, 15, 84,
+210,170,117, 52,141,242,146,177,181, 14,166,192,216,251,128, 80,248,131,142,145,174, 53,184, 69,146, 10,219,212,143,145, 0,252,
+233,139,106,146, 1,162,244, 77, 13,200,244,165,183, 14,167,152,148,185, 15,188,166,201, 60, 36, 40, 27, 91,241,190, 38,142,105,
+231,249, 63,210, 90,143,212,217,157,167,145, 54,100,116,182,176,176, 74, 55, 33,194, 83,240, 41, 4,255, 0, 68,226,156,206,217,
+186, 50,114,109, 82,125, 42,114,150, 96, 77,105,194,250, 85,202,212,226,150,155, 3,240,183,225,239,198,138, 69, 94,174,184, 77,
+229, 73,117,249, 14, 49, 36, 54,200,108,146,162,133,219,104, 32,115,115,177, 0, 95,203,113,243,189,243,239,177,245,226, 86, 11,
+105,228,192, 84,143, 64, 15,212, 82,111, 58, 86, 12,213,217,149, 37, 84, 50,245, 2,153, 14,185, 81,101,111,191, 23,106, 29, 89,
+ 4,178, 18,171, 41, 64, 92,219,198,180,155,124, 79,166, 42,253, 96,205,199, 42,231, 8, 52,138, 85,119,191, 67,116,244, 9, 18,
+ 91,118,253,226,238, 65, 82,189, 14,208,158, 61, 45,136,163,185,115, 48,215,106, 68,174,185, 40,164, 84, 80,194, 73,145,225, 75,
+ 6,206,108,227,204,159, 17,183, 68,132,223,166, 7,106,206,151,214, 93,203, 47, 78,160,214, 59,186,140, 39,254,206, 42,159,191,
+181,238, 81,220,155,116, 4, 36,169, 87, 54, 3, 98, 71, 0,227,207, 21,133, 32, 40,229,112,102, 87,132, 13, 77,123, 95,225, 15,
+ 23, 97,124, 43,198, 12,222,226, 41,254,201, 74,208,163,188,102, 76, 3,238, 84, 79,132,212,190,187,153,106,186,139,166,179, 50,
+188, 41,229, 79, 54,209,117,158,243,146, 77,186, 98,133,209, 93, 46,206,203,204,117, 7,179,196,206,230, 68, 48,180,195,102,122,
+202, 88, 40, 80,182,235, 0, 20, 85,114, 72,186,128, 6,198,199,166, 29,208,234, 90,153,148,139, 53,226,241, 66, 2, 79,129,181,
+238, 4,247,202, 71, 3,206,192, 3,240, 80,245,195,172,205,172,121,255, 0, 48,100,116,215,169,212, 38,228, 74,145, 12,182,171,
+ 38,196,148,239, 74,172, 71,235, 13,183,183,191, 15,103,133, 98, 86, 97,196, 51,148,133,115, 49, 32,251,244,175,117,198,255, 0,
+ 17,120, 43, 16,188, 67,133,200, 0,157,137, 19,239, 26,250,117,170,239, 86, 53, 60,162,190,198, 71,145, 81, 76,153,109, 40,182,
+149,247,155,137, 5, 64, 1,124, 93, 57,174, 93, 26,183, 1, 84,168,210,251,159,107, 5,231,212,218,249, 66, 6,221,160, 15, 46,
+ 20, 0,247, 92,121, 99,141,169, 26, 97,169, 47,234, 76,236,233,153,225, 56,219, 12, 48, 95, 73, 32,242,171, 14,158,225,126,191,
+ 12, 78,169,181,188,242,136,178,101,123, 67,214,117,180,176,183, 86, 73, 40, 72, 95, 32,122,115,197,252,194, 72,199,107,111,128,
+ 6, 91, 78, 69,137,210,122, 73,175,159, 63, 23,248,222,207,137,125,146,221,133, 72,103, 57,235,250,242, 0, 9,235, 8,159,120,
+174,132,168,228,198,212,195, 81,233,217,152,174, 76,183, 26,142,150,186,128,146,158,188,245, 0, 15,157,149,233,141, 67, 65, 38,
+ 83,169,145,171,149, 9, 66, 64,104, 42, 51, 77,129,247,202, 20,181,172,159, 91, 93, 0, 30,151, 7,211, 16,109, 61,204,153,174,
+136,202,235,146,102,184,164,176,242,228, 57, 34, 74,188,100, 4,216,171,241,186,108, 62, 31, 25, 60,206,210, 15,101,218, 43, 19,
+221,109, 10, 98, 43, 18, 11,111, 61,254,169,180,166,224, 40,143, 51,183,120, 3,206,254,252, 64,217,223, 45,224,211, 7, 54,186,
+199,145,210,188, 17,201,229, 67,179,164,188,149,144,179, 61, 39, 38, 84,170, 42, 92,153,117, 14,237,229, 72,176, 46, 74,186,108,
+129,205,138,110,173,160,220, 88,155, 91,207, 26,151, 57,121, 86, 51,207,197,120,173,201,200, 88,105,174,133,107, 77,172,109,251,
+189,217, 87, 62, 73, 30,184,131, 49, 94,149,170,177,165,192,155, 65,135, 57, 82,231,165,109,212,165,198, 74,221, 97,123,202, 79,
+118,162, 46,144,119,157,214,235,108,108,207,180, 60,247, 62,107,213, 72,144,196, 97, 6, 19,107, 90, 11,132,165, 22, 64,104,219,
+204, 3,193,183,150,226, 60,177,180,253,173,163,140,180, 51, 4,187,254, 66, 33, 58, 8, 17,169,215, 78,241,145, 57,132, 1, 4,
+213,171,147,100,182, 91, 40, 78, 85, 0, 2,186, 19,212,122, 9,243,169, 45, 31, 57, 63, 77,140,213, 13,198,130,153,105,149, 72,
+168,204, 7,149,184,120, 41, 30,160, 38,232, 30,251,159, 46,125,202,253,174,234,206, 34, 70,137, 39, 32, 72,172,211,235, 53, 63,
+106,129, 29,173,200,109, 50,172,190,170, 3,238,221, 86,224,245, 2,248,175,148,140,194,213, 38, 16,159, 77, 46,182,200, 91, 79,
+148, 19,101, 33, 69, 74,183, 30,151, 4,252,109,235,135,113,245, 43, 52,233,132,228,231, 24,153,101, 5,244,193, 68,122,115,129,
+ 60, 71, 73, 64, 82,136,226,215, 35,119,251,222,252, 26,213,139,118, 46,130,187,164,153,212,236, 52,141,181,158,158, 85, 89,133,
+161, 46,201, 26,108,124, 69, 74,106,181, 42,188, 70, 96, 51, 95,165,174, 44,199,220,121,199,210,225, 22, 74,110,181, 40,220,112,
+120, 85,191,162, 48,247, 44,212,104,181, 24,159,164, 25,141,101, 75,147, 36,146,223, 82, 27, 64,228,252,128, 35, 0, 51,134,169,
+207,204,249, 34,155, 87,159, 74, 10,147, 37, 0,112,155, 27,157,201, 36,123,143,231,183, 2,242,157, 66,180,183, 13,122,170,148,
+ 54,201,151,236, 41,141,110, 1,222,157,195,240, 82,142, 1,119,134,134,140,149, 13, 96,233,226, 38, 7,150,158,148,238,165,181,
+ 18, 18, 52,171,170,100, 12,141, 27, 78,227,230, 22, 42, 32, 84,103, 76,116,200, 74,133,194, 24, 8,105, 40, 73,254,144, 89,249,
+140, 72, 32,197,200, 51,147, 20,195,121, 46,200,153,254,138,200, 9,190,237,204, 29,202,248,135, 20,164,255, 0,233,138,146,148,
+198, 96,206, 52,183, 27,105,135, 20,147, 18, 55,179, 33,134,138,138,212,227,224,172, 0, 60,249,199,103,253, 30,253,159,180, 86,
+145,170,249,107, 54,246,132,170,165, 66,158, 67,180,188,186, 80, 86,150,150, 86,218,125,174, 93,129,186, 82, 87,116,179, 99,117,
+ 15, 23, 23, 7, 83,135,248,122,231, 19,184, 13, 52, 73, 50,125,195,127,127, 64, 55,171,216,118, 18,246, 36,248,105,160, 73, 63,
+181, 49,200,255, 0, 71,190,177,103, 28,139, 23, 61,229, 61, 54,146,253, 29,198, 76,191,172, 29,150,196,118,212, 82,165, 36,216,
+190,226, 55, 36, 88,157,201, 4,112, 57,190, 42,236,227,167,185, 88, 83, 37,202,164,148,188,138,115, 95,233,251, 20, 8, 4,180,
+132, 1,127, 59, 2,190,125, 65,199,211,222,221, 61,180,116, 55, 34,105,107,255, 0, 84, 33,234,149, 68,199, 82,114,141, 29,149,
+150, 29,121,196,110, 6,107,220,110,110, 58,118,148, 33, 36,110, 89, 4, 36, 1,202,126,109,235,119,106,188,147,172,217, 40, 83,
+ 63,201, 59,244, 60,246,236,182, 69, 86,175, 76,168, 54, 97,212, 89, 9,222,224,113,162,216, 94,253,224, 89, 69,107, 85,183, 2,
+162, 44, 7, 75,138,240,214, 23,103,109,144, 93, 17,112,157, 84,149,136, 16,117,208,129,162,163,145,247,154,183,136,224,236, 88,
+128,217, 89, 14, 1, 36, 30, 94, 7,161,240,247, 85, 51, 94,165,185, 42, 37, 69,200, 45, 1, 33,166,208,183, 10, 7,250,164,148,
+ 20,219,243, 72,249, 99,211,147,105,178, 33,198,146,167,138,158, 73,239, 30, 82,211,112,226, 89,181,211,243, 11,255, 0,195,143,
+ 25,147, 81,131, 42,163, 25,168,133, 70,125, 45, 5, 97, 74,229, 93,218, 11,128,254, 73, 36, 96,132,250,140,186, 88,132,133, 52,
+ 18,151,105,109,186,217, 41,191,218, 45, 23, 55,249, 90,254,244,156,121,165,218,221, 66,210,218,117,212,252,135,212, 86, 1, 16,
+ 52,167,206,101,204,165, 77,168, 83,106, 40, 40, 82,221,151, 25,148, 71, 35,162,220, 74, 59,196,252,141,193, 62,182,192,202,165,
+ 22,151, 86,206,180,170, 28, 18,193,121,214, 24, 10, 88, 55, 74,110,132, 21, 47,221,250,199,231,136,130,107, 21,108,209, 85,145,
+ 91,128,218,210,219, 10,115,217, 16, 79, 63, 31,193, 36,147,251,184,219,148, 96,213, 98, 74, 85,101,240,225, 29,225,100,150,207,
+ 54, 33,106, 9, 7,203,144,127, 12, 9, 12, 56, 27, 9, 90,251,209, 77,217,166,164,233,211,188,189,153, 53,101,200,213,202,136,
+110,156,149,108,239,208,145,114, 17,112,216,255, 0,186,167, 74, 83,127,253, 48, 10,118, 79,165,196,114, 93, 50, 99,128,200,156,
+164, 52,193,191,129,176,149,163,122,189,110, 66, 65,249,156, 17,114, 4,117,102, 71,145,152,158,117, 49,220, 79,219, 58,149, 16,
+148,236,113,106, 88,248,110, 73,249,243,131, 51,226,100,217, 52,198, 43, 43,154, 84,229, 78, 43,123, 18,226,249,102, 66, 86,158,
+ 15,160, 80, 23, 7,223,137,165,197, 38, 6, 99,174,159,127,124,170, 66, 19, 17, 83,236,197,169,157,149,145,217,162, 95,101,109,
+ 56,206,242,243, 37, 94,163, 49, 51,235,143,192,165, 20, 70,132,243,109,182,148,110,121,221,138, 37, 43, 74,130, 0, 4,157,170,
+ 81, 0, 46,194,157,202, 52,116, 77,170,203, 99, 81,163, 50,227,244, 10, 27,178,212,204, 67,184, 79, 8, 72, 75,101, 38,195,194,
+ 72, 72, 85,192,218, 47,215,139,172,135,146,169,249, 18,147, 72,124,161,134,165, 77, 10, 53, 48,183, 18, 1,113,197, 45, 32,149,
+ 19,111, 9, 77,191,162, 49, 62,200,154, 31, 92,168,213,233,249,240, 86, 33, 57, 17,208,228, 69,247, 46,135, 16,166, 86,210,219,
+ 91,107, 34,246,225, 65, 68, 11,144, 82,147,198, 52,241,172, 78,217,107,236, 26, 48,211,114, 18,175,242, 49,190,191,249, 70,157,
+ 60,232,238,188, 28, 80,145,160, 21, 82,183,151, 17, 15, 45, 72,173, 87, 2, 68,247, 26,113, 77,182,148,248, 91,220,162,216, 39,
+254,234, 66,172, 61, 72, 62, 88,144,230,122, 76,136, 89,109, 13, 72,121, 78, 73, 20,205,137, 73,109, 33,105,222,157,247, 42,182,
+226, 54,173, 9,219,123, 11, 11,121,225,236,220,181, 77,171, 85,230, 50,211,128, 83, 92,150,232, 66, 90, 42, 87,217, 32,172,139,
+ 21,114,111,116,168,223,203,227,108, 44,192,227,117,140,214,234,234, 47, 36, 33,197, 8,251, 80,174, 55,130,148,148,223,220, 64,
+252, 71,174, 50,205,219,133,112,147,182,167,239,238, 42, 9, 82,144,131,227,254,254,117, 27,107, 43,199,111, 37,196, 92,199,144,
+ 22,195,131,194, 7, 59,213,201, 87,251,187, 71,204,225,157, 14,137, 8,164, 66,152,202, 46, 1, 87,116,163,194,236, 21,201,245,
+231,105,196,221,116,186, 75, 84, 95,172,170, 14,132,165,194,180,134,239, 97,100,108,177, 30,242, 71,224,112, 29,138, 13, 34,169,
+ 91,102,123, 50,194, 75, 14, 44,170,203,253, 80,129,193,249,220,219,214,216,113,116, 84,146,100,193,154, 4, 2,117,168,238,114,
+201, 50, 2,164, 48,149,160,161,134, 75,105, 75, 64,112,128, 9,113, 67,230, 21,207,191, 3,232,249, 14, 44,154, 51, 19, 92,103,
+104,125,167, 17, 30,201,251,173, 36, 47,197,248,220,124, 70, 44, 42, 99,116,215,145, 50,178,163,181,175,108, 91, 45,130,110, 10,
+119, 0,161,239, 4,113,243,193, 56,212, 90, 51, 25,109,140,202,220,132,180,218,170,166, 3, 45, 56,175, 10, 27,229,213,159,251,
+163,114, 65,194,246,213,160,132,245,164, 1, 34, 5, 86,201,201, 76, 0, 27,110, 42,188, 40, 77,212,148, 95,157,160,237,249, 2,
+ 63, 28, 44, 88, 84,220,215, 79,162,211,251,152,208,218,117, 14,202,121,196, 23, 83,117,109, 42,240,222,223,187,180,124,176,177,
+ 33,114,255, 0, 88,168,129,227, 84, 25,126,185, 94,204,137,206,111, 33, 93,195,142,123, 60,116,129,200,176,219,131, 58,153, 46,
+159, 10,108, 28,137, 21,180,161, 13, 52, 94,169, 59,183,149, 44,139,128,126, 29, 62,120, 47,149, 80,143,209,202, 50,118, 11,125,
+106, 77,173,241,196,127, 60, 37, 42,204, 82,157, 82, 65, 81,142, 46,162, 57, 60,227,109,167,115,184, 76,108, 72,248,208,180, 43,
+138,141,201,128,245,110, 19,145, 91,143,101, 41,105,241,129,194, 0,185, 36,252, 6, 24,154, 18,165,119,245,183,209,100,165, 27,
+ 80,146, 60,173, 96, 7,229,137,173, 29, 8, 25, 65,106, 8, 0,149, 44, 19,110,190, 36,224, 69, 88, 4,193,142,132,139, 36,173,
+119, 3,166, 14, 29, 80, 70,156,207,214, 40,169, 86,177, 81, 12,187,151,144,244,245,169,246,128, 66,146,181, 1,111,196,254, 28,
+ 99,202, 85, 44,230, 92,212,137, 50, 29,238,216,122,110,196,168,244, 67, 98,247, 63,128,196,142,130, 7,214,149, 17,111,187, 78,
+ 86,223,119,135, 2,160, 37, 41, 97,205,160, 11, 48,233, 22,242,225, 56, 41,112,151, 39,192,124,106, 68,146, 60,234, 45,152,226,
+181,153, 42,179, 30,132, 10, 25, 47, 40,177,239, 70,235,127, 1,130, 95, 82, 67, 49,217,164,197, 66,146,218, 25, 14,186,233, 87,
+ 43,220, 5,135,187,174, 30, 69,105,164,192, 27, 90, 72,240, 39,162,127,116,227, 20,255, 0,241, 50, 60,189,149,158, 63, 12, 89,
+113,213,104, 58, 82, 43, 51,150,162, 21, 42,125, 66, 75,191, 87,192,111,187,101,164,149, 40,129,109,199,158, 62, 88,198, 83, 46,
+197,181, 58, 59, 68, 37, 12, 13,196,245, 89, 36, 27,126, 88,152, 67,109, 30,208,201,216, 46, 82,237,205,186,225,142,101,105,164,
+202,164,148,182,145,189, 30, 43, 14,190, 47, 60, 17, 15, 28,213, 52,184, 73, 2,128,211,160,200,105, 13,177, 33, 55,113,215, 67,
+206,123,147, 99,130,203,160,247,212,231, 34,188,215,137, 18, 93, 79, 35,213, 9,219,135, 19,144,129,154,212, 2, 64, 29,217, 22,
+183,149,198, 13,190,148,253, 98,145,180,127,239,231,203,247, 14, 24,184,162,242, 81,200,254,226,162, 84,119,168,196, 74, 44,103,
+242, 83,212,183, 63,215,125, 98,210, 83,238, 5, 42, 73,198,172,200,200,165, 86,223, 98,150,124, 45,161,150,148,145,230,108, 73,
+255, 0,202, 48, 86,144,148,151, 30, 5, 35,255, 0,140,181,229,251,203,192,185,132,175, 51, 84, 55, 27,255, 0,164, 30,191, 28,
+ 90, 14, 41, 18, 41,210,117,154, 20,220, 87,225,205, 98, 67,204,144,163,191,186, 4,117, 87, 77,223,138,191, 44, 31,100, 74,238,
+ 84,195,170,187, 12, 62, 20,224, 79, 69,147, 99,111,241,233,141, 21, 4,165, 50, 89, 41, 72, 22,100,218,195,167,140, 97,252, 14,
+114,226,212,121, 37,245, 92,159, 63, 14, 32,181, 21,106,106, 89,180,163,185, 53, 83, 98,184,186,201, 81,218,131,224, 55,234,162,
+ 69,134, 25,212, 51, 42,227, 85,102,186,233,113,224,167,108,130,151,108, 46, 85,240, 62, 99,242,193,246,208,132,101, 38, 2, 16,
+ 7,250, 99, 93, 7,255, 0, 40,156, 66,223, 0,178,110, 58,207,231,240, 56,174, 82,151, 0, 36, 84, 80,181, 21, 26, 59, 23, 49,
+213,162,202,141, 53, 14,186,160,133,108,121,105, 87, 40,243, 60,121,240, 65,198,184, 57,182,162,197,115,187, 19,220, 81, 17,146,
+130,119,159, 53,130,175,198,195, 27,233,169, 79,212,105, 85,133,204,215,238,125,120, 72,192,124,174,211, 78,230, 58,143,122,218,
+ 85,181,133, 20,238, 23,177,231, 3,202,128, 9,138,121,204, 8, 53, 42,127, 84, 42,241, 37, 75, 90, 11,203,125,246, 84,220, 66,
+149,113,222, 45, 67,175,184,219,156, 76,180, 83, 59,140,139, 71,136,151,150,204,135,231,206, 81,222,240,221,180, 37, 55, 91,135,
+247,137, 81,182, 42,121,164,251, 68, 83,126,123,213,243,242, 86, 8,197,117,196,199,165,109,113, 66,205,189,107, 31,222,197,117,
+219,180,182, 20, 8,164,162, 74, 35,149, 90, 25,139, 82,243,102,104,169, 46,179, 83,150,194,217,106, 66, 82,150,209, 25,176, 2,
+ 74,200, 9, 7,111, 30,120, 7, 95,205,210, 32,187, 10,157, 10, 65, 11,246, 98,244,133,160,218,202, 95,141, 68, 91,206,214, 31,
+142, 54, 83, 90,107,244, 25,106,238,211,115, 45, 36,155,117, 33, 10,182, 5,202, 1,235,173,209,184,134, 92, 0,171,146, 5,198,
+ 42,165,134,147,221, 3, 74,118,158, 40,128, 5, 90,153, 59, 88, 11,185, 86, 12, 86,135,217,165,166,212,210,119, 88,146, 30, 77,
+191, 18,148,143,145,193,182, 53, 42,124,186,155, 9,250,195,100,104,145,146,133,217,127,174, 74,183,185,242, 0,255, 0,189,138,
+ 98,148,165, 53, 22, 2, 90, 81, 72, 9,108, 0,147,107,120,151,130,217,101,215, 28,136, 67,142, 41, 65, 68, 5, 2,111,113,115,
+140,231,236,153, 4, 71, 63,169,171,169,125,100,213,178,229,102, 54,100,173,200, 20,233, 55,145, 17,131, 33, 42,184, 60,165,162,
+ 64, 63,151,224, 48,202, 22,116,172,119,179,242,188,106,178,203, 78, 52,134,214,176,171,110, 55, 78,243,127, 85, 18,163,126,183,
+ 89,196, 63, 74, 29,119,184,172,191,222, 43,121, 91,137, 43,191, 36,119, 99,139,250, 97,218,201,110,124,197, 54,118,158,253,174,
+ 83,199,174, 2,182,144,131,147,124,191,193,250,211,174,225,193, 83,188,195,169, 15,214, 34, 76,202,144,223,106, 43,109,204, 74,
+159, 41,235,116, 1, 97,129,209,181,101,228,102, 53, 49, 79,121, 81,223,101, 41, 66, 95, 32, 18,149, 46,201,189,252,143,132, 95,
+204,238,242,177,196, 90,151,246,149,169,129,207, 22,245, 58, 87,187,157,199,127, 83,235,136,234,212,164,200,113, 73, 36, 19, 95,
+ 72, 36,121,128, 77,177, 30,193,151, 19,146, 52,253,247,167, 55, 78,164,213,215, 11, 85,254,168,174, 56,210, 17,176,176,203,237,
+193, 96,168,149, 19,180,169,110,174,253, 84,162, 83,184,254,207,132, 88, 18, 48, 51, 44,231,218,156,250,104, 19,234,234, 93, 70,
+ 89, 88,114, 75,137, 30, 6,212,160, 22, 71,225,180,124,134, 42,202,204,185, 74,206,189,234,164,184, 84,168,242, 55, 40,172,220,
+221,196,223, 6, 50, 66,214,181,160,173,100,253,156,113,201,242,239,209,198, 2,109, 25, 26,199, 79,173, 56,191,184, 3, 67, 82,
+120,185,241,183, 27,164,199, 66, 84,166,105, 17, 92,109,198,148, 62,242,192, 86,213,123,237,112,126, 8,192, 58, 22,112,118,141,
+ 73,106, 20,215, 10, 98,198,150,149,183, 99, 98, 82,164, 36, 18, 61,228,121,254,241,192,106, 59,142, 8,205,168, 56,171,170,107,
+161, 70,253, 65, 28,224,126,102, 36, 64,216, 15, 2, 67, 0, 15,119,135, 6,106,221,180,166, 60,127,127,222,138,111,159, 81,130,
+106,210,117,218, 94,106,139, 14, 52, 40,169, 50, 38,182,224, 37, 99,239,180, 28,240,139,122, 0,132,252,176, 2,152,198, 91,167,
+ 81, 26, 19,226,119,170,144, 86,148, 53,251,123, 66,249, 31, 21, 20,252,206, 8,100,175, 13, 86,158,226,120, 82, 50,188,133, 33,
+ 67,170, 78,215,185, 30,135, 13,139, 45, 43, 58, 82,153, 83, 73, 40, 69, 56, 20, 36,167,132,158,224, 30, 7,151, 60,252,112, 34,
+165, 37,194,128,116,137,249,254,213, 73,199, 20,189, 77,103, 50, 50,171, 52,151,105,222,201,181,181, 54,204,116,243, 97,117, 18,
+234,254, 67,106,148,125,195,223,136,149, 74,137, 50, 69, 1, 89,109, 12,165,201, 82, 18, 88,140,130,200, 88, 80,189,214,162, 15,
+ 81,181, 42, 32,122,145,235,137,102,164,188,244, 58, 10, 61,145,213, 53,121,210,193,238,213,183,139,161, 54,227,221,199,195,140,
+ 65, 96, 85,170,163, 85,227,182, 42,114, 2, 82, 65, 74,123,229, 88, 92, 11,219,156, 18,212,173,198,179,131, 16, 38, 60, 69, 4,
+ 62,164, 43, 77,232,214,152,101, 40, 57,109,109, 46,130,128,150,208,219,110, 33,151, 58,188,225,109, 42, 82,207,244,130,184,247,
+ 96,222, 99,156,243, 57, 77,215,229, 74, 46,189, 61,226,135,155, 72,232,148,144,176,143,154,128,192,250, 17, 40,163,184,164,155,
+ 16,211, 64, 17,229,215, 15,106,232, 65,160,196,186, 7, 53, 27,158, 58,248,159,254,225,248, 97,238, 30,122,230,247,180,117, 82,
+ 73,212,243, 53, 12,217,211, 78, 40,244, 41,174, 52,170, 60, 70, 59,192, 86,134,208,222,223,245,138,119,187, 63,193, 55, 63, 19,
+134, 89,174,141,245,254, 66, 20, 90,124, 36, 23, 99,184,118, 40,162,251, 82,164, 13,234,249, 91,241,196,183, 47, 45,104,205, 41,
+ 8, 89, 22,109,229, 11, 31, 48,226, 82, 15,198,220,124, 56,192, 60,170,227,138, 27, 20,226,136, 44, 55,112, 79, 28,145,124, 87,
+237, 8,118, 35,104, 62,253,169,167, 46,162,163,240,116,170,176,131, 37,170,154, 10, 88,130,243, 43, 59, 58, 54, 0, 42, 41, 30,
+251,165, 35,250,120,245,172,141, 81,155,146,154,158,167,183, 58, 43,206,188,251, 97, 54,185,113, 2,196, 31, 59, 40,145,242,197,
+163,168, 11, 91, 57,122, 74,154, 81, 73, 83,237,238, 41, 54,191,216,177,136,149, 41,107, 57,106,152,146,179, 98,182,137, 23,234,
+ 74,213,124, 58, 46,220, 90, 65,241, 31, 35, 81,237,148, 5, 61,133,153,179, 29, 34, 22, 93, 6, 59,125,221, 29,180, 60,182, 26,
+104, 52, 22,134,130, 77,136, 0,117, 13,131,126,167,125,249,190, 39, 57, 63, 87,243,142, 80,205, 84,170,229, 6,164,149, 74, 17,
+ 1,122, 68,129,112, 84,132,135, 20, 20, 60,199,137, 39,223,179, 0,243,139,104, 53,153,224,160, 31,180,183, 79, 34,216, 4,126,
+ 28, 98, 46,151, 93,180,223,181, 87,134, 44,205,190, 46,156, 50, 49,173,105,139, 94,164,246,200, 81, 10,153,208,243,235, 87,173,
+239,110, 27, 88, 90, 21, 7,125, 42, 97,169,122,149, 43, 53, 84,230,230, 10,213,110, 68,135,159, 12,203,146,241,115,196,164,119,
+103, 98, 61,194,193, 92, 11,117,192, 26,117, 66,155, 27, 52,174, 74,226, 37,108,182,195, 8, 89, 39,130,181, 51,189,119,245,232,
+ 71,204,226, 63, 81,241, 65,169, 37, 92,143,102, 96, 88,250,119,110,113,135,147, 64, 74,165, 16, 45,224,127,167,185,133, 91, 15,
+123,112,235,168, 82,148, 73, 36, 30,126, 0,205, 13,199,150,181, 74,140,147, 91, 13,124,198,204,169,168,204, 85,195,173,167,187,
+ 72,243, 74,129, 22,249,139, 12,107,175,202,169, 73, 37,169, 79,119,150,109,105,110,223,168, 27, 72,184, 30,235,169, 71,229,129,
+ 85,162,125,146, 18,175,200,146,205,143,167,137, 56, 41,153, 0, 69, 88,165, 34,194,243, 56, 31,253, 66, 49,146,176, 2,129,231,
+251, 85, 2,179, 88,229, 26,116,185,116, 78,237,108, 4,170, 85,101, 49,247,142, 10, 91, 86,228,168,126, 35,243, 62,184,153,101,
+236,190,244,108,169, 89,101,136, 96,189, 30,190,205,156,243,108, 50,137, 36,129,238,220,166,255, 0, 15,126, 26,105,202, 82,105,
+144, 9, 72,230,168,130,120,255, 0,233,226,111, 77, 1, 45,230, 52,164, 88,123, 68,179, 97,235,199, 56,203,186,186,113, 25,136,
+229,251,138, 65,197, 21,197, 86,149, 57,202,148, 32,208,170, 49, 3, 76, 54,194,153,144,233, 28,237, 43, 46, 42,254,242, 2,191,
+ 19,136,229,117, 77, 42,167, 13,134,128,108,180, 25, 66,210,179, 96, 28,184, 73, 63, 11,146,126, 24,153,234,235,104, 69, 94,174,
+148, 32, 0,154,250, 18, 0, 29, 6,213,113,240,197,125,154,137, 57,174, 85,205,236,165, 17,127, 35, 97,139,246,103,180,107, 56,
+211, 64,125, 96,253,105,103, 84,111, 82,170,205, 31, 79,100,211,169,243, 51, 83, 73,155, 46, 3, 41, 49, 99, 21,158,236,172, 0,
+159, 16, 29, 78,237,199,155,129,111, 50,120,121, 70,207,117, 92,179, 57, 84,124,189, 85,112,198,219, 29,229, 65, 46, 89,152,235,
+ 80, 5,194,144, 58, 27, 91,159,221,231, 16, 37, 18,170,199,136,223,236, 28, 60,250,220,115,141,212,117, 40, 72,168,172, 40,220,
+193, 93,205,249,251,131, 22, 84,214,116,128,179, 35,167,190,162,167, 20, 83, 21,179, 76,230,231,252,201, 85,122, 50, 42, 13, 51,
+ 74, 18,195, 20,213, 37,145,222,144, 92, 32,173, 68,139,131,100,147, 97,231,110,125, 95, 69,211,154,212,170, 34,234,109, 87, 36,
+ 41, 2,178,165, 45, 14,155,247,105,223,226,177,181,193, 36, 35,142,156,121, 99, 13, 40,113,104,102,159,177,100, 94,168,229,236,
+127,117,120,147,103,183, 92,143,147,229, 37,135, 20,128,115, 69,136, 65,181,193,108,146, 56,196, 46, 93, 87,108, 82,152, 30, 67,
+239, 90, 98,234,243,122, 84,123, 83,233, 21,255, 0,173,195,139,148,145, 31,111,121, 22, 59, 74, 35,112, 5, 54, 22,242, 5, 74,
+176,247, 32,225,133, 86,137, 63, 44, 40, 71, 98,104,117,228,160,170, 78,211,113,193, 73, 42, 63, 21, 92,129,233,183, 7,245, 75,
+255, 0,121,134,191, 63,110,124, 95,220, 24, 22, 31, 43,159,196,225,181, 88, 5,214, 10,150, 46, 85, 17,237,196,249,248,157,192,
+109, 84, 75, 72, 79, 40,249, 69, 73, 75, 49, 90,242,131, 50,106, 84, 41, 8, 88, 87,117, 74,166,187, 49,198,239,203,174, 56,160,
+150,211,242, 54, 81, 62,236, 55,118, 61, 99, 48,209,163, 82,153,152,190,233,137, 72, 9,106,246, 73,113,221,169, 22,248,217, 87,
+248, 39, 5,104, 11, 90,103,230,128,149,144, 63, 70,209,192, 62,232,223,222,112, 11, 36,186,239,121, 79, 29,226,185,172,193,191,
+139,247, 18,112,109,136,143,191,189,169,131,138,137,167,153,222,149, 38,137, 83, 77, 57,167, 84,144,210, 54,157,135,169, 79,132,
+159,196, 28, 44, 21,206,169, 74,179, 93, 67,114, 65,180,199, 64,184,232, 55, 30, 48,176, 16,250,128,218,132, 28, 49, 95,255,217,
+ 0};
+
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index 5f80f14d069..efd97ed9786 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -104,6 +104,8 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+#include "GPU_draw.h"
+
#include "mydevice.h"
#include "transform.h"
@@ -964,7 +966,7 @@ int blenderqread(unsigned short event, short val)
/* Reset lights
* This isn't done when reading userdef, do it now
* */
- default_gl_light();
+ GPU_default_lights();
}
return 0;
}
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
index 94d38ee1635..5b2120424f1 100644
--- a/source/blender/src/toolbox.c
+++ b/source/blender/src/toolbox.c
@@ -123,10 +123,10 @@
#include "BPY_extern.h"
#include "BPY_menus.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
void asciitoraw(int ch, unsigned short *event, unsigned short *qual)
{
- if( isalpha(ch)==0 ) return;
-
if( isupper(ch) ) {
*qual= LEFTSHIFTKEY;
ch= tolower(ch);
@@ -240,7 +240,7 @@ void error_libdata(void)
int saveover(char *file)
{
- int len= strlen(file);
+ size_t len= strlen(file);
if(len==0)
return 0;
@@ -804,7 +804,10 @@ static void tb_do_hotkey(void *arg, int event)
case 'd': key= PAGEDOWNKEY; break;
}
}
- else asciitoraw(event, &key, &qual[3]);
+ else if (isalpha(event))
+ asciitoraw(event, &key, &qual[3]);
+ else if (event == '~')
+ key = ACCENTGRAVEKEY;
for (i=0;i<4;i++)
{
@@ -1213,6 +1216,8 @@ static TBitem tb_view[]= {
{ 0, "Ortho/Perspective|NumPad 5", TB_PAD|'5', NULL},
{ 0, "Local/Global View|NumPad /", TB_PAD|'/', NULL},
{ 0, "SEPR", 0, NULL},
+{ 0, "Show All Layers|Shift ~", TB_SHIFT|'~', NULL},
+{ 0, "SEPR", 0, NULL},
{ 0, "Align View", 0, tb_view_alignview},
{ 0, "SEPR", 0, NULL},
{ 0, "View Selected|NumPad .", TB_PAD|'.', NULL},
@@ -1753,8 +1758,8 @@ static uiBlock *tb_makemenu(void *arg)
static int tb_mainx= 1234, tb_mainy= 0;
static void store_main(void *arg1, void *arg2)
{
- tb_mainx= (long)arg1;
- tb_mainy= (long)arg2;
+ tb_mainx= (intptr_t)arg1;
+ tb_mainy= (intptr_t)arg2;
}
static void do_group_addmenu(void *arg, int event)
@@ -2182,27 +2187,27 @@ void toolbox_n(void)
but=uiDefBlockBut(block, tb_makemenu, menu1, str1, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)-5);
+ uiButSetFunc(but, store_main, (void *)(intptr_t)dx, (void *)(intptr_t)-5);
but=uiDefBlockBut(block, tb_makemenu, menu2, str2, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
uiButSetFlag(but, UI_MAKE_TOP);
- uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)-5);
+ uiButSetFunc(but, store_main, (void *)(intptr_t)0, (void *)(intptr_t)-5);
but=uiDefBlockBut(block, tb_makemenu, menu3, str3, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_LEFT);
- uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)-5);
+ uiButSetFunc(but, store_main, (void *)(intptr_t)-dx, (void *)(intptr_t)-5);
but=uiDefBlockBut(block, tb_makemenu, menu4, str4, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)5);
+ uiButSetFunc(but, store_main, (void *)(intptr_t)dx, (void *)(intptr_t)5);
but=uiDefBlockBut(block, tb_makemenu, menu5, str5, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
uiButSetFlag(but, UI_MAKE_DOWN);
- uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)5);
+ uiButSetFunc(but, store_main, (void *)(intptr_t)0, (void *)(intptr_t)5);
but=uiDefBlockBut(block, tb_makemenu, menu6, str6, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_LEFT);
- uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)5);
+ uiButSetFunc(but, store_main, (void *)(intptr_t)-dx, (void *)(intptr_t)5);
} else if (tot==5 || tot==7) {
/* check if it fits, dubious */
if(mval[0]-0.25*dx+tb_mainx < 6) mval[0]= 6 + 0.25*dx -tb_mainx;
@@ -2277,9 +2282,9 @@ void toolbox_generic( TBitem *generic_menu )
uiBlock *block;
uiBut *but;
TBitem *menu;
- int dx=96;
+ int dx=96, first=1, len;
short event, mval[2];
- long ypos = -5;
+ intptr_t ypos = -5;
tb_mainx= -32;
tb_mainy= -5;
@@ -2298,11 +2303,17 @@ void toolbox_generic( TBitem *generic_menu )
/* Add the menu */
for (menu = generic_menu; menu->icon != -1; menu++) {
- if(strcmp(menu->name, "SEPR")==0) {
+ if (first && (len=strlen(menu->name)) > 2 && menu->name[len-2]=='%' && menu->name[len-1]=='t') {
+ menu->name[len-2] = '\0';
+ uiSetCurFont(block, UI_HELVB);
+ uiDefIconTextBut(block, LABEL, 0, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, 0, "");
+ uiSetCurFont(block, UI_HELV);
+ ypos-=20;
+ } else if(strcmp(menu->name, "SEPR")==0) {
uiDefBut(block, SEPR, 0, "", mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 6, NULL, 0.0, 0.0, 0, 0, "");
ypos-=6;
} else {
- if (menu->poin) {
+ if (menu->poin) {
but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
uiButSetFlag(but, UI_MAKE_RIGHT);
@@ -2313,6 +2324,7 @@ void toolbox_generic( TBitem *generic_menu )
}
ypos-=20;
}
+ first= 0;
}
uiBlockSetButmFunc(block, menu->poin, NULL);
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 706b079432c..0b43dac07cf 100644
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -144,6 +144,8 @@ extern ListBase editelems;
#include "transform.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
/* local function prototype - for Object/Bone Constraints */
static short constraints_list_needinv(TransInfo *t, ListBase *list);
/* local function prototype - for finding number of keyframes that are selected for editing */
@@ -913,8 +915,8 @@ static void createTransPose(TransInfo *t, Object *ob)
if (arm==NULL || ob->pose==NULL) return;
if (arm->flag & ARM_RESTPOS) {
- if(t->mode!=TFM_BONESIZE) {
- notice ("Pose edit not possible while Rest Position is enabled");
+ if(ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) {
+ notice("Pose edit not possible while Rest Position is enabled");
return;
}
}
@@ -1089,6 +1091,8 @@ static void createTransArmatureVerts(TransInfo *t)
VECCOPY (td->center, td->iloc);
td->loc= ebo->tail;
td->flag= TD_SELECTED;
+ if (ebo->flag & BONE_EDITMODE_LOCKED)
+ td->protectflag = OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE;
Mat3CpyMat3(td->smtx, smtx);
Mat3CpyMat3(td->mtx, mtx);
@@ -1104,6 +1108,8 @@ static void createTransArmatureVerts(TransInfo *t)
VECCOPY (td->center, td->iloc);
td->loc= ebo->head;
td->flag= TD_SELECTED;
+ if (ebo->flag & BONE_EDITMODE_LOCKED)
+ td->protectflag = OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE;
Mat3CpyMat3(td->smtx, smtx);
Mat3CpyMat3(td->mtx, mtx);
@@ -1909,7 +1915,7 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
EditVert *eve, *prev;
EditFace *efa;
float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4;
- long index= 0;
+ intptr_t index= 0;
/* two abused locations in vertices */
for(eve= em->verts.first; eve; eve= eve->next, index++) {
@@ -1921,13 +1927,13 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
for(efa= em->faces.first; efa; efa= efa->next) {
/* retrieve mapped coordinates */
- v1= mappedcos + 3*(long)(efa->v1->prev);
- v2= mappedcos + 3*(long)(efa->v2->prev);
- v3= mappedcos + 3*(long)(efa->v3->prev);
+ v1= mappedcos + 3*(intptr_t)(efa->v1->prev);
+ v2= mappedcos + 3*(intptr_t)(efa->v2->prev);
+ v3= mappedcos + 3*(intptr_t)(efa->v3->prev);
- co1= (origcos)? origcos + 3*(long)(efa->v1->prev): efa->v1->co;
- co2= (origcos)? origcos + 3*(long)(efa->v2->prev): efa->v2->co;
- co3= (origcos)? origcos + 3*(long)(efa->v3->prev): efa->v3->co;
+ co1= (origcos)? origcos + 3*(intptr_t)(efa->v1->prev): efa->v1->co;
+ co2= (origcos)? origcos + 3*(intptr_t)(efa->v2->prev): efa->v2->co;
+ co3= (origcos)? origcos + 3*(intptr_t)(efa->v3->prev): efa->v3->co;
if(efa->v2->tmp.p==NULL && efa->v2->f1) {
set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1);
@@ -1936,8 +1942,8 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
}
if(efa->v4) {
- v4= mappedcos + 3*(long)(efa->v4->prev);
- co4= (origcos)? origcos + 3*(long)(efa->v4->prev): efa->v4->co;
+ v4= mappedcos + 3*(intptr_t)(efa->v4->prev);
+ co4= (origcos)? origcos + 3*(intptr_t)(efa->v4->prev): efa->v4->co;
if(efa->v1->tmp.p==NULL && efa->v1->f1) {
set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4);
@@ -3745,6 +3751,35 @@ void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik)
insertkey_smarter(id, ID_PO, pchan->name, NULL, AC_SIZE_Z);
}
}
+ else if (IS_AUTOKEY_FLAG(AUTOMATKEY)) {
+ int matok=0;
+
+ /* check one to make sure we're not trying to set visual loc keys on
+ bones inside of a chain, which only leads to tears. */
+ matok= insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_X);
+ insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y);
+ insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z);
+
+ if (matok == 0) {
+ insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0);
+ insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0);
+ insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0);
+ }
+
+ /* check one to make sure we're not trying to set visual rot keys on
+ bones inside of a chain, which only leads to tears. */
+ matok= insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W);
+ insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X);
+ insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y);
+ insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z);
+
+ if (matok == 0) {
+ insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0);
+ insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0);
+ insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0);
+ insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0);
+ }
+ }
/* insert keyframe in any channel that's appropriate */
else {
insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0);
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c
index c332fd723eb..a1440b8cbce 100644
--- a/source/blender/src/transform_generics.c
+++ b/source/blender/src/transform_generics.c
@@ -32,6 +32,8 @@
#include "MEM_guardedalloc.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
@@ -581,39 +583,6 @@ void recalcData(TransInfo *t)
reshadeall_displist();
}
-void initTransModeFlags(TransInfo *t, int mode)
-{
- t->mode = mode;
- t->num.flag = 0;
-
- /* REMOVING RESTRICTIONS FLAGS */
- t->flag &= ~T_ALL_RESTRICTIONS;
-
- switch (mode) {
- case TFM_RESIZE:
- t->flag |= T_NULL_ONE;
- t->num.flag |= NUM_NULL_ONE;
- t->num.flag |= NUM_AFFECT_ALL;
- if (!G.obedit) {
- t->flag |= T_NO_ZERO;
- t->num.flag |= NUM_NO_ZERO;
- }
- break;
- case TFM_TOSPHERE:
- t->num.flag |= NUM_NULL_ONE;
- t->num.flag |= NUM_NO_NEGATIVE;
- t->flag |= T_NO_CONSTRAINT;
- break;
- case TFM_SHEAR:
- case TFM_CREASE:
- case TFM_BONE_ENVELOPE:
- case TFM_CURVE_SHRINKFATTEN:
- case TFM_BONE_ROLL:
- t->flag |= T_NO_CONSTRAINT;
- break;
- }
-}
-
void drawLine(float *center, float *dir, char axis, short options)
{
extern void make_axis_color(char *col, char *col2, char axis); // drawview.c
@@ -672,19 +641,10 @@ void initTrans (TransInfo *t)
t->transform = NULL;
t->handleEvent = NULL;
- t->total =
- t->num.idx =
- t->num.idx_max =
- t->num.ctrl[0] =
- t->num.ctrl[1] =
- t->num.ctrl[2] = 0;
+ t->total = 0;
t->val = 0.0f;
- t->num.val[0] =
- t->num.val[1] =
- t->num.val[2] = 0.0f;
-
t->vec[0] =
t->vec[1] =
t->vec[2] = 0.0f;
@@ -706,7 +666,8 @@ void initTrans (TransInfo *t)
t->around = V3D_CENTER;
setTransformViewMatrices(t);
- initNDofInput(&(t->ndof));
+ initNumInput(&t->num);
+ initNDofInput(&t->ndof);
}
/* Here I would suggest only TransInfo related issues, like free data & reset vars. Not redraws */
diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c
index 050360887b4..709879f142b 100644
--- a/source/blender/src/transform_manipulator.c
+++ b/source/blender/src/transform_manipulator.c
@@ -170,6 +170,13 @@ static void stats_pose(View3D *v3d, bPoseChannel *pchan)
}
}
+/* for editmode*/
+static void stats_editbone(View3D *v3d, EditBone *ebo)
+{
+ if (ebo->flag & BONE_EDITMODE_LOCKED)
+ protectflag_to_drawflags(OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE, &v3d->twdrawflag);
+}
+
/* only counts the parent selection, and tags transform flag */
/* bad call... should re-use method from transform_conversion once */
static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it)
@@ -258,6 +265,9 @@ int calc_manipulator_stats(ScrArea *sa)
calc_tw_center(ebo->head);
totsel++;
}
+ if (ebo->flag & BONE_SELECTED) {
+ stats_editbone(v3d, ebo);
+ }
}
}
}
diff --git a/source/blender/src/transform_numinput.c b/source/blender/src/transform_numinput.c
index 9b811595a9a..89a76c097e0 100644
--- a/source/blender/src/transform_numinput.c
+++ b/source/blender/src/transform_numinput.c
@@ -41,6 +41,20 @@
/* ************************** NUMINPUT **************************** */
+void initNumInput(NumInput *n)
+{
+ n->flag =
+ n->idx =
+ n->idx_max =
+ n->ctrl[0] =
+ n->ctrl[1] =
+ n->ctrl[2] = 0;
+
+ n->val[0] =
+ n->val[1] =
+ n->val[2] = 0.0f;
+}
+
void outputNumInput(NumInput *n, char *str)
{
char cur;
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index 92e49ab29fa..aa49065320b 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -34,8 +34,6 @@
#include <stdio.h>
#include <string.h>
-#include "GL/glew.h"
-
#ifdef WIN32
#include <windows.h> /* need to include windows.h so _WIN32_IE is defined */
#ifndef _WIN32_IE
@@ -69,6 +67,7 @@
#include "DNA_sound_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_text_types.h"
#include "BKE_blender.h"
#include "BKE_curve.h"
@@ -81,6 +80,7 @@
#include "BKE_mball.h"
#include "BKE_node.h"
#include "BKE_packedFile.h"
+#include "BKE_suggestions.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
#include "BKE_pointcache.h"
@@ -147,6 +147,9 @@
#include "PIL_time.h"
+#include "GPU_extensions.h"
+#include "GPU_draw.h"
+
/***/
/* define for setting colors in theme below */
@@ -477,7 +480,27 @@ static void init_userdef_file(void)
if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) {
U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE;
}
-
+ if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile < 1)) {
+ bTheme *btheme;
+ for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ char *col;
+
+ /* IPO Editor: Handles/Vertices */
+ col = btheme->tipo.vertex;
+ SETCOL(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255);
+ col = btheme->tipo.vertex_select;
+ SETCOL(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255);
+ btheme->tipo.handle_vertex_size= btheme->tipo.vertex_size;
+
+ /* Sequence/Image Editor: colors for GPencil text */
+ col = btheme->tv3d.bone_pose;
+ SETCOL(btheme->tseq.bone_pose, col[0], col[1], col[2], 255);
+ SETCOL(btheme->tima.bone_pose, col[0], col[1], col[2], 255);
+ col = btheme->tv3d.vertex_select;
+ SETCOL(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
+ }
+ }
+
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
U.texcollectrate = 60;
@@ -567,8 +590,9 @@ void BIF_read_file(char *name)
if (retval!=0) G.relbase_valid = 1;
undo_editmode_clear();
+ undo_imagepaint_clear();
BKE_reset_undo();
- BKE_write_undo("original"); /* save current state */
+ BKE_write_undo("Original"); /* save current state */
refresh_interface_font();
}
@@ -640,8 +664,9 @@ int BIF_read_homefile(int from_memory)
init_userdef_file();
undo_editmode_clear();
+ undo_imagepaint_clear();
BKE_reset_undo();
- BKE_write_undo("original"); /* save current state */
+ BKE_write_undo("Original"); /* save current state */
/* if from memory, need to refresh python scripts */
if (from_memory) {
@@ -1039,8 +1064,9 @@ void BIF_init(void)
BIF_filelist_init_icons();
- init_gl_stuff(); /* drawview.c, after homefile */
- glewInit();
+ GPU_state_init();
+ GPU_extensions_init();
+
readBlog();
BLI_strncpy(G.lib, G.sce, FILE_MAX);
}
@@ -1053,6 +1079,7 @@ extern ListBase editelems;
void exit_usiblender(void)
{
struct TmpFont *tf;
+ int totblock;
BIF_clear_tempfiles();
@@ -1098,7 +1125,7 @@ void exit_usiblender(void)
free_ipocopybuf();
free_actcopybuf();
free_vertexpaint();
- free_imagepaint();
+ free_texttools();
/* editnurb can remain to exist outside editmode */
freeNurblist(&editNurb);
@@ -1116,6 +1143,7 @@ void exit_usiblender(void)
sound_exit_audio();
if(G.listener) MEM_freeN(G.listener);
+ GPU_extensions_exit();
libtiff_exit();
@@ -1125,6 +1153,7 @@ void exit_usiblender(void)
/* undo free stuff */
undo_editmode_clear();
+ undo_imagepaint_clear();
BKE_undo_save_quit(); // saves quit.blend if global undo is on
BKE_reset_undo();
@@ -1150,6 +1179,7 @@ void exit_usiblender(void)
BLI_freelistN(&U.themes);
BIF_preview_free_dbase();
+ totblock= MEM_get_memory_blocks_in_use();
if(totblock!=0) {
printf("Error Totblock: %d\n",totblock);
MEM_printmemlist();
diff --git a/source/blender/src/verse_image.c b/source/blender/src/verse_image.c
index fe9e6137091..edb3a0a9f2c 100644
--- a/source/blender/src/verse_image.c
+++ b/source/blender/src/verse_image.c
@@ -43,6 +43,8 @@
#include "BIF_verse.h"
#include "BIF_space.h"
+#include "GPU_draw.h"
+
/*
* unsubscribe from verse bitmap
*/
@@ -327,7 +329,7 @@ void post_bitmap_tile_set(VBitmapLayer *vblayer, unsigned int xs, unsigned int y
rect[channel] = (char)vuint8[i];
}
- free_realtime_image(image);
+ GPU_free_image(image);
/* redraw preview of image ... uncommented, because rendering
* was computed too often */
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index 12450bee9de..4c56e5ce64e 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -793,6 +793,82 @@ void viewmoveNDOFfly(int mode)
BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
}
+int view_autodist( float mouse_worldloc[3] ) //, float *autodist )
+{
+ View3D *v3d = G.vd;
+
+ /* Zooms in on a border drawn by the user */
+ short mval[2];
+ rcti rect;
+
+ /* ZBuffer depth vars */
+ bglMats mats;
+ float depth, depth_close= MAXFLOAT;
+ int had_depth = 0;
+ double cent[2], p[3];
+ int xs, ys;
+
+ getmouseco_areawin(mval);
+
+ persp(PERSP_VIEW);
+
+ rect.xmax = mval[0] + 4;
+ rect.ymax = mval[1] + 4;
+
+ rect.xmin = mval[0] - 4;
+ rect.ymin = mval[1] - 4;
+
+ /* Get Z Depths, needed for perspective, nice for ortho */
+ bgl_get_mats(&mats);
+ draw_depth(curarea, (void *)v3d, NULL);
+
+ /* force updating */
+ if (v3d->depths) {
+ had_depth = 1;
+ v3d->depths->damaged = 1;
+ }
+
+ view3d_update_depths(v3d);
+
+ /* Constrain rect to depth bounds */
+ if (rect.xmin < 0) rect.xmin = 0;
+ if (rect.ymin < 0) rect.ymin = 0;
+ if (rect.xmax >= v3d->depths->w) rect.xmax = v3d->depths->w-1;
+ if (rect.ymax >= v3d->depths->h) rect.ymax = v3d->depths->h-1;
+
+ /* Find the closest Z pixel */
+ for (xs=rect.xmin; xs < rect.xmax; xs++) {
+ for (ys=rect.ymin; ys < rect.ymax; ys++) {
+ depth= v3d->depths->depths[ys*v3d->depths->w+xs];
+ if(depth < v3d->depths->depth_range[1] && depth > v3d->depths->depth_range[0]) {
+ if (depth_close > depth) {
+ depth_close = depth;
+ }
+ }
+ }
+ }
+
+ if (depth_close==MAXFLOAT)
+ return 0;
+
+ if (had_depth==0) {
+ MEM_freeN(v3d->depths->depths);
+ v3d->depths->depths = NULL;
+ }
+ v3d->depths->damaged = 1;
+
+ cent[0] = (double)mval[0];
+ cent[1] = (double)mval[1];
+
+ if (!gluUnProject(cent[0], cent[1], depth_close, mats.modelview, mats.projection, mats.viewport, &p[0], &p[1], &p[2]))
+ return 0;
+
+ mouse_worldloc[0] = (float)p[0];
+ mouse_worldloc[1] = (float)p[1];
+ mouse_worldloc[2] = (float)p[2];
+ return 1;
+}
+
void viewmove(int mode)
{
static float lastofs[3] = {0,0,0};
@@ -825,15 +901,11 @@ void viewmove(int mode)
Mat3MulVecfl(mat, upvec);
VecAddf(G.vd->ofs, G.vd->ofs, upvec);
}
-
-
/* sometimes this routine is called from headerbuttons */
areawinset(curarea->win);
- initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
-
QUATCOPY(oldquat, G.vd->viewquat);
getmouseco_areawin(mval_area); /* for zoom to mouse loc */
@@ -867,9 +939,44 @@ void viewmove(int mode)
VECCOPY(obofs, lastofs);
VecMulf(obofs, -1.0f);
}
+ else if (U.uiflag & USER_ORBIT_ZBUF) {
+ if ((use_sel=view_autodist(obofs))) {
+ if (G.vd->persp==V3D_PERSP) {
+ float my_origin[3]; /* original G.vd->ofs */
+ float my_pivot[3]; /* view */
+
+ VECCOPY(my_origin, G.vd->ofs);
+ VecMulf(my_origin, -1.0f); /* ofs is flipped */
+
+ /* Set the dist value to be the distance from this 3d point */
+ /* this means youll always be able to zoom into it and panning wont go bad when dist was zero */
+
+ /* remove dist value */
+ upvec[0] = upvec[1] = 0;
+ upvec[2] = G.vd->dist;
+ Mat3CpyMat4(mat, G.vd->viewinv);
+ Mat3MulVecfl(mat, upvec);
+ VecSubf(my_pivot, G.vd->ofs, upvec);
+ VecMulf(my_pivot, -1.0f); /* ofs is flipped */
+
+ /* find a new ofs value that is allong the view axis (rather then the mouse location) */
+ lambda_cp_line_ex(obofs, my_pivot, my_origin, dvec);
+ dist0 = G.vd->dist = VecLenf(my_pivot, dvec);
+
+ VecMulf(dvec, -1.0f);
+ VECCOPY(G.vd->ofs, dvec);
+ }
+ VecMulf(obofs, -1.0f);
+ VECCOPY(ofs, G.vd->ofs);
+ } else {
+ ofs[0] = ofs[1] = ofs[2] = 0.0f;
+ }
+ }
else
ofs[0] = ofs[1] = ofs[2] = 0.0f;
-
+
+ initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
+
reverse= 1.0f;
if (G.vd->persmat[2][1] < 0.0f)
reverse= -1.0f;
@@ -1046,9 +1153,20 @@ void viewmove(int mode)
zfac*G.vd->dist < 10.0*G.vd->far)
view_zoom_mouseloc(zfac, mval_area);
- /* these limits are in toets.c too */
- if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid;
- if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far;
+
+ if ((U.uiflag & USER_ORBIT_ZBUF) && (U.viewzoom==USER_ZOOM_CONT) && (G.vd->persp==V3D_PERSP)) {
+ /* Secret apricot feature, translate the view when in continues mode */
+ upvec[0] = upvec[1] = 0;
+ upvec[2] = (dist0 - G.vd->dist) * G.vd->grid;
+ G.vd->dist = dist0;
+ Mat3CpyMat4(mat, G.vd->viewinv);
+ Mat3MulVecfl(mat, upvec);
+ VecAddf(G.vd->ofs, G.vd->ofs, upvec);
+ } else {
+ /* these limits are in toets.c too */
+ if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid;
+ if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far;
+ }
if(G.vd->persp==V3D_ORTHO || G.vd->persp==V3D_CAMOB) preview3d_event= 0;
}
@@ -2353,3 +2471,4 @@ void smooth_view_to_camera(View3D *v3d)
v3d->persp= V3D_CAMOB;
}
}
+
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index f8bbdad5f65..f42e00daf6d 100644
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -881,7 +881,7 @@ void yafrayFileRender_t::writeShader(const string &shader_name, Material* matr,
ostr << "\t\t<input value=\"" << shader_name << "_map" << m2 << "\" />\n";
// blendtype, would have been nice if the order would have been the same as for ramps...
- const string blendtype[9] = {"mix", "mul", "add", "sub", "divide", "darken", "difference", "lighten", "screen"};
+ const string blendtype[MTEX_NUM_BLENDTYPES] = {"mix", "mul", "add", "sub", "divide", "darken", "difference", "lighten", "screen", "hue", "sat", "val", "color"};
ostr << "\t\t<mode value=\"" << blendtype[(int)mtex->blendtype] << "\" />\n";
// texture color (for use with MUL and/or no_rgb etc..)
diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp
index 6ae4a31bf50..a7d5653892f 100644
--- a/source/blender/yafray/intern/export_Plugin.cpp
+++ b/source/blender/yafray/intern/export_Plugin.cpp
@@ -74,7 +74,7 @@ extern "C" { extern char bprogname[]; }
// add drive character if not in path string, using blender executable location as reference
static void addDrive(string &path)
{
- int sp = path.find_first_of(":");
+ size_t sp = path.find_first_of(":");
if (sp==-1) {
string blpath = bprogname;
sp = blpath.find_first_of(":");
@@ -782,7 +782,7 @@ void yafrayPluginRender_t::writeShader(const string &shader_name, Material* matr
mparams["input"] = yafray::parameter_t(shader_name + temp);
// blendtype, would have been nice if the order would have been the same as for ramps...
- const string blendtype[9] = {"mix", "mul", "add", "sub", "divide", "darken", "difference", "lighten", "screen"};
+ const string blendtype[MTEX_NUM_BLENDTYPES] = {"mix", "mul", "add", "sub", "divide", "darken", "difference", "lighten", "screen", "hue", "sat", "val", "color"};
mparams["mode"] = yafray::parameter_t(blendtype[(int)mtex->blendtype]);
// texture color (for use with MUL and/or no_rgb etc..)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index d17b94c631d..04219ac5868 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -37,8 +37,10 @@ INCLUDE_DIRECTORIES(../../intern/guardedalloc
../blender/render/extern/include
../blender/python
../blender/makesdna
+ ../blender/gpu
../kernel/gen_messaging
../kernel/gen_system
+ ../../extern/glew/include
)
@@ -210,6 +212,7 @@ IF(UNIX)
blender_python
bf_blenkernel
bf_nodes
+ bf_gpu
bf_blenloader
bf_blenpluginapi
bf_imbuf
diff --git a/source/creator/Makefile b/source/creator/Makefile
index 8a0d20264ea..158aee1a647 100644
--- a/source/creator/Makefile
+++ b/source/creator/Makefile
@@ -49,9 +49,11 @@ CPPFLAGS += -I../blender/renderconverter
CPPFLAGS += -I../blender/blenkernel
CPPFLAGS += -I../blender/python
CPPFLAGS += -I../blender/blenloader
+CPPFLAGS += -I../blender/gpu
CPPFLAGS += -I../kernel/gen_system
CPPFLAGS += -I../kernel/gen_messaging
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I$(NAN_GLEW)/include
ifeq ($(WITH_QUICKTIME), true)
CPPFLAGS += -I$(NAN_QUICKTIME)/include -DWITH_QUICKTIME
diff --git a/source/creator/SConscript b/source/creator/SConscript
index cac9e895a97..a4c218f89d6 100644
--- a/source/creator/SConscript
+++ b/source/creator/SConscript
@@ -7,7 +7,7 @@ incs = '#/intern/guardedalloc ../blender/blenlib ../blender/blenkernel'
incs += ' ../blender/include ../blender/blenloader ../blender/imbuf'
incs += ' ../blender/renderconverter ../blender/render/extern/include'
incs += ' ../blender/python ../blender/makesdna ../kernel/gen_messaging'
-incs += ' ../kernel/gen_system'
+incs += ' ../kernel/gen_system #/extern/glew/include ../blender/gpu'
incs += ' ' + env['BF_OPENGL_INC']
defs = []
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 9589f1e3e94..ec87cdd8cf7 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -70,14 +70,14 @@
#include "BLO_writefile.h"
#include "BLO_readfile.h"
-#include "BDR_drawmesh.h"
-
#include "IMB_imbuf.h" // for quicktime_init
#include "BPY_extern.h"
#include "RE_pipeline.h"
+#include "GPU_draw.h"
+
#include "playanim_ext.h"
#include "mydevice.h"
#include "nla.h"
@@ -600,12 +600,12 @@ int main(int argc, char **argv)
/* doMipMap */
if (!strcmp(argv[a],"nomipmap"))
{
- set_mipmap(0); //doMipMap = 0;
+ GPU_set_mipmap(0); //doMipMap = 0;
}
/* linearMipMap */
if (!strcmp(argv[a],"linearmipmap"))
{
- set_linear_mipmap(1); //linearMipMap = 1;
+ GPU_set_linear_mipmap(1); //linearMipMap = 1;
}
@@ -618,8 +618,23 @@ int main(int argc, char **argv)
if (G.scene) {
if (a < argc) {
int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a])));
+ int slink_flag= 0;
Render *re= RE_NewRender(G.scene->id.name);
+
+ if (G.f & G_DOSCRIPTLINKS) {
+ BPY_do_all_scripts(SCRIPT_RENDER);
+ /* avoid FRAMECHANGED slink event
+ * (should only be triggered in anims): */
+ G.f &= ~G_DOSCRIPTLINKS;
+ slink_flag= 1;
+ }
+
RE_BlenderAnim(re, G.scene, frame, frame);
+
+ if (slink_flag) {
+ G.f |= G_DOSCRIPTLINKS;
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
+ }
}
} else {
printf("\nError: no blend loaded. cannot use '-f'.\n");
@@ -628,7 +643,14 @@ int main(int argc, char **argv)
case 'a':
if (G.scene) {
Render *re= RE_NewRender(G.scene->id.name);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_RENDER);
+
RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+
+ if (G.f & G_DOSCRIPTLINKS)
+ BPY_do_all_scripts(SCRIPT_POSTRENDER);
} else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index b3a3a47152a..1f66335c749 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -79,6 +79,8 @@
#include "DNA_scene_types.h"
/***/
+#include "GPU_extensions.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -90,33 +92,10 @@ void update_for_newframe();
static BlendFileData *load_game_data(char *filename) {
BlendReadError error;
- //this doesn't work anymore for relative paths, so use BLO_read_from_memory instead
- //BlendFileData *bfd= BLO_read_from_file(filename, &error);
- FILE* file = fopen(filename,"rb");
- BlendFileData *bfd = 0;
- if (file)
- {
- fseek(file, 0L, SEEK_END);
- int len= ftell(file);
- fseek(file, 0L, SEEK_SET);
- char* filebuffer= new char[len];//MEM_mallocN(len, "text_buffer");
- int sizeread = fread(filebuffer,len,1,file);
- if (sizeread==1){
- bfd = BLO_read_from_memory(filebuffer, len, &error);
- } else {
- error = BRE_UNABLE_TO_READ;
- }
- fclose(file);
- // the memory is not released in BLO_read_from_memory, must do it here
- delete filebuffer;
- } else {
- error = BRE_UNABLE_TO_OPEN;
- }
-
+ BlendFileData *bfd= BLO_read_from_file(filename, &error);
if (!bfd) {
printf("Loading %s failed: %s\n", filename, BLO_bre_as_string(error));
}
-
return bfd;
}
@@ -139,7 +118,9 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
// Acquire Python's GIL (global interpreter lock)
// so we can safely run Python code and API calls
PyGILState_STATE gilstate = PyGILState_Ensure();
-
+
+ PyObject *pyGlobalDict = PyDict_New(); /* python utility storage, spans blend file loading */
+
bgl::InitExtensions(true);
do
@@ -159,6 +140,9 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
if(GLEW_ARB_multitexture && GLEW_VERSION_1_1)
usemat = (SYS_GetCommandLineInt(syshandle, "blender_material", 0) != 0);
+ if(GPU_extensions_minimum_support())
+ useglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", 0) != 0);
+
// create the canvas, rasterizer and rendertools
RAS_ICanvas* canvas = new KX_BlenderCanvas(area);
canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE);
@@ -325,17 +309,19 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
mousedevice,
networkdevice,
audiodevice,
- startscenename);
+ startscenename,
+ blscene);
// some python things
PyObject* dictionaryobject = initGamePythonScripting("Ketsji", psl_Lowest);
ketsjiengine->SetPythonDictionary(dictionaryobject);
initRasterizer(rasterizer, canvas);
- PyObject *gameLogic = initGameLogic(startscene);
+ PyObject *gameLogic = initGameLogic(ketsjiengine, startscene);
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module.
+ PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); // Same as importing the module.
initGameKeys();
initPythonConstraintBinding();
-
+ initMathutils();
if (sceneconverter)
{
@@ -407,6 +393,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
// which allows the scene to safely delete them :)
// see: (space.c)->start_game
PyDict_Clear(PyModule_GetDict(gameLogic));
+ PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict);
ketsjiengine->StopEngine();
exitGamePythonScripting();
@@ -545,8 +532,6 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
// create the ketsjiengine
KX_KetsjiEngine* ketsjiengine = new KX_KetsjiEngine(kxsystem);
- int i;
-
Scene *blscene = NULL;
if (!bfd)
{
@@ -562,7 +547,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
} else {
blscene = bfd->curscene;
}
- int cframe,startFrame;
+ int cframe = 1, startFrame;
if (blscene)
{
cframe=blscene->r.cfra;
@@ -593,15 +578,18 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
mousedevice,
networkdevice,
audiodevice,
- startscenename);
+ startscenename,
+ blscene);
+
// some python things
PyObject* dictionaryobject = initGamePythonScripting("Ketsji", psl_Lowest);
ketsjiengine->SetPythonDictionary(dictionaryobject);
initRasterizer(rasterizer, canvas);
- PyObject *gameLogic = initGameLogic(startscene);
+ PyObject *gameLogic = initGameLogic(ketsjiengine, startscene);
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module
initGameKeys();
initPythonConstraintBinding();
+ initMathutils();
if (sceneconverter)
{
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt
index 1d72fb9cde1..340a1ae310b 100644
--- a/source/gameengine/BlenderRoutines/CMakeLists.txt
+++ b/source/gameengine/BlenderRoutines/CMakeLists.txt
@@ -31,6 +31,7 @@ SET(INC
../../../intern/SoundSystem
../../../source/blender/misc
../../../source/blender/blenloader
+ ../../../source/blender/gpu
../../../extern/bullet2/src
../../../extern/solid
../../../extern/glew/include
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
index ed6ea7c5f6a..669e7bd1b3f 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
@@ -26,7 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include "GL/glew.h"
#include "KX_BlenderGL.h"
#ifdef HAVE_CONFIG_H
@@ -93,83 +92,10 @@ void BL_SwapBuffers()
myswapbuffers();
}
-void BL_RenderText(int mode,const char* textstr,int textlen,struct MTFace* tface,
- unsigned int *col,float v1[3],float v2[3],float v3[3],float v4[3])
-{
- Image* ima;
-
- if(mode & TF_BMFONT) {
- //char string[MAX_PROPSTRING];
- int characters, index, character;
- float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance;
-
-// bProperty *prop;
-
- // string = "Frank van Beek";
-
- characters = textlen;
-
- ima = (struct Image*) tface->tpage;
- if (ima == NULL) {
- characters = 0;
- }
-
- /* When OBCOL flag is on the color is set in IndexPrimitives_3DText */
- if (tface->mode & TF_OBCOL) { /* Color has been set */
- col= NULL;
- } else {
- if(!col) glColor3f(1.0f, 1.0f, 1.0f);
- }
-
- glPushMatrix();
- for (index = 0; index < characters; index++) {
- // lets calculate offset stuff
- character = textstr[index];
-
- // space starts at offset 1
- // character = character - ' ' + 1;
-
- matrixGlyph((ImBuf *)ima->ibufs.first, character, & centerx, &centery, &sizex, &sizey, &transx, &transy, &movex, &movey, &advance);
-
- glBegin(GL_POLYGON);
- // printf(" %c %f %f %f %f\n", character, tface->uv[0][0], tface->uv[0][1], );
- // glTexCoord2f((tface->uv[0][0] - centerx) * sizex + transx, (tface->uv[0][1] - centery) * sizey + transy);
- glTexCoord2f((tface->uv[0][0] - centerx) * sizex + transx, (tface->uv[0][1] - centery) * sizey + transy);
-
- if(col) spack(col[0]);
- // glVertex3fv(v1);
- glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]);
-
- glTexCoord2f((tface->uv[1][0] - centerx) * sizex + transx, (tface->uv[1][1] - centery) * sizey + transy);
- if(col) spack(col[1]);
- // glVertex3fv(v2);
- glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]);
-
- glTexCoord2f((tface->uv[2][0] - centerx) * sizex + transx, (tface->uv[2][1] - centery) * sizey + transy);
- if(col) spack(col[2]);
- // glVertex3fv(v3);
- glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]);
-
- if(v4) {
- // glTexCoord2f((tface->uv[3][0] - centerx) * sizex + transx, 1.0 - (1.0 - tface->uv[3][1]) * sizey - transy);
- glTexCoord2f((tface->uv[3][0] - centerx) * sizex + transx, (tface->uv[3][1] - centery) * sizey + transy);
- if(col) spack(col[3]);
- // glVertex3fv(v4);
- glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]);
- }
- glEnd();
-
- glTranslatef(advance, 0.0, 0.0);
- }
- glPopMatrix();
-
- }
-}
-
-
void DisableForText()
{
if(glIsEnabled(GL_BLEND)) glDisable(GL_BLEND);
+ if(glIsEnabled(GL_ALPHA_TEST)) glDisable(GL_ALPHA_TEST);
if(glIsEnabled(GL_LIGHTING)) {
glDisable(GL_LIGHTING);
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.h b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
index c8e0d47afb6..b891a7343c2 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
@@ -46,9 +46,6 @@ void BL_HideMouse();
void BL_NormalMouse();
void BL_WaitMouse();
-void BL_RenderText(int mode,const char* textstr,int textlen,struct MTFace* tface,
- unsigned int *col,float v1[3],float v2[3],float v3[3],float v4[3]);
-
void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height);
void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int height);
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp b/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp
deleted file mode 100644
index d173b1c66d9..00000000000
--- a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "KX_BlenderPolyMaterial.h"
-#include "BKE_mesh.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#if 0
-KX_BlenderPolyMaterial::KX_BlenderPolyMaterial(const STR_String &texname,
- bool ba,
- const STR_String& matname,
- int tile,
- int tilexrep,
- int tileyrep,
- int mode,
- bool transparant,
- bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject,
- struct MTFace* tface)
- : RAS_IPolyMaterial(texname,
- false,
- matname,
- tile,
- tilexrep,
- tileyrep,
- mode,
- transparant,
- zsort,
- lightlayer,
- bIsTriangle,
- clientobject),
- m_tface(tface)
-{
-}
-
-void KX_BlenderPolyMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const
-{
-
-
- if (GetCachingInfo() != cachingInfo)
- {
- if (!cachingInfo)
- {
- set_tpage(NULL);
- }
- cachingInfo = GetCachingInfo();
-
- if ((m_drawingmode & 4)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED))
- {
- update_realtime_texture((struct MTFace*) m_tface, rasty->GetTime());
- set_tpage(m_tface);
- rasty->EnableTextures(true);
- }
- else
- {
- set_tpage(NULL);
- rasty->EnableTextures(false);
- }
-
- if(m_drawingmode & RAS_IRasterizer::KX_TWOSIDE)
- {
- rasty->SetCullFace(false);
- }
- else
- {
- rasty->SetCullFace(true);
- }
-
- if (m_drawingmode & RAS_IRasterizer::KX_LINES) {
- rasty->SetLines(true);
- }
- else {
- rasty->SetLines(false);
- }
- }
-
- rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity);
- rasty->SetShinyness(m_shininess);
- rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0);
-}
-
-
-#endif
-
-
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h b/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h
deleted file mode 100644
index 35823b2125b..00000000000
--- a/source/gameengine/BlenderRoutines/KX_BlenderPolyMaterial.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef __KX_BLENDERPOLYMATERIAL
-#define __KX_BLENDERPOLYMATERIAL
-
-#include "RAS_MaterialBucket.h"
-#include "RAS_IRasterizer.h"
-
-struct MTFace;
-extern "C" int set_tpage(MTFace* tface); /* Worst hack ever */
-
-#if 0
-class KX_BlenderPolyMaterial : public RAS_IPolyMaterial
-{
- /** Blender texture face structure. */
- MTFace* m_tface;
-
-public:
-
- KX_BlenderPolyMaterial(const STR_String &texname,
- bool ba,
- const STR_String& matname,
- int tile,
- int tilexrep,
- int tileyrep,
- int mode,
- bool transparant,
- bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject,
- struct MTFace* tface);
-
- /**
- * Returns the caching information for this material,
- * This can be used to speed up the rasterizing process.
- * @return The caching information.
- */
- virtual TCachingInfo GetCachingInfo(void) const;
-
- /**
- * Activates the material in the (OpenGL) rasterizer.
- * On entry, the cachingInfo contains info about the last activated material.
- * On exit, the cachingInfo should contain updated info about this material.
- * @param rasty The rasterizer in which the material should be active.
- * @param cachingInfo The information about the material used to speed up rasterizing.
- */
- virtual void Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const;
-
- /**
- * Returns the Blender texture face structure that is used for this material.
- * @return The material's texture face.
- */
- MTFace* GetMTFace(void) const;
-protected:
-private:
-};
-
-
-inline MTFace* KX_BlenderPolyMaterial::GetMTFace(void) const
-{
- return m_tface;
-}
-
-inline RAS_IPolyMaterial::TCachingInfo KX_BlenderPolyMaterial::GetCachingInfo(void) const
-{
- return GetMTFace();
-}
-
-#endif
-
-#endif // __KX_BLENDERPOLYMATERIAL
-
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
index 220d174d464..1797d6c1a0f 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
@@ -26,8 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include "KX_BlenderRenderTools.h"
-
#include "GL/glew.h"
#include "RAS_IRenderTools.h"
@@ -36,24 +34,22 @@
#include "RAS_ICanvas.h"
#include "RAS_GLExtensionManager.h"
-// next two includes/dependencies come from the shadow feature
-// it needs the gameobject and the sumo physics scene for a raycast
#include "KX_GameObject.h"
-
-#include "KX_BlenderPolyMaterial.h"
#include "KX_PolygonMaterial.h"
#include "KX_BlenderMaterial.h"
+#include "KX_RayCast.h"
+#include "KX_IPhysicsController.h"
-#include "Value.h"
+#include "PHY_IPhysicsEnvironment.h"
-#include "KX_BlenderGL.h" // for text printing
#include "STR_String.h"
-#include "RAS_BucketManager.h" // for polymaterial (needed for textprinting)
-#include "KX_RayCast.h"
-#include "KX_IPhysicsController.h"
-#include "PHY_IPhysicsEnvironment.h"
-#include "KX_Scene.h"
+#include "GPU_draw.h"
+
+#include "KX_BlenderGL.h" // for text printing
+#include "KX_BlenderRenderTools.h"
+
+unsigned int KX_BlenderRenderTools::m_numgllights;
KX_BlenderRenderTools::KX_BlenderRenderTools()
{
@@ -62,81 +58,98 @@ KX_BlenderRenderTools::KX_BlenderRenderTools()
m_numgllights = 8;
}
-/**
-ProcessLighting performs lighting on objects. the layer is a bitfield that contains layer information.
-There are 20 'official' layers in blender.
-A light is applied on an object only when they are in the same layer.
-OpenGL has a maximum of 8 lights (simultaneous), so 20 * 8 lights are possible in a scene.
-*/
+KX_BlenderRenderTools::~KX_BlenderRenderTools()
+{
+}
-int KX_BlenderRenderTools::ProcessLighting(int layer)
+void KX_BlenderRenderTools::BeginFrame(RAS_IRasterizer* rasty)
{
-
- int result = false;
+ m_clientobject = NULL;
+ m_lastlightlayer = -1;
+ m_lastlighting = false;
+ DisableOpenGLLights();
+}
- if (layer < 0)
- {
- DisableOpenGLLights();
- result = false;
- } else
+void KX_BlenderRenderTools::EndFrame(RAS_IRasterizer* rasty)
+{
+}
+
+/* ProcessLighting performs lighting on objects. the layer is a bitfield that
+ * contains layer information. There are 20 'official' layers in blender. A
+ * light is applied on an object only when they are in the same layer. OpenGL
+ * has a maximum of 8 lights (simultaneous), so 20 * 8 lights are possible in
+ * a scene. */
+
+void KX_BlenderRenderTools::ProcessLighting(int layer, const MT_Transform& viewmat)
+{
+ if(m_lastlightlayer == layer)
+ return;
+
+ m_lastlightlayer = layer;
+
+ bool enable = false;
+
+ if (layer >= 0)
{
if (m_clientobject)
{
if (layer == RAS_LIGHT_OBJECT_LAYER)
- {
layer = static_cast<KX_GameObject*>(m_clientobject)->GetLayer();
- }
- if (applyLights(layer))
- {
- EnableOpenGLLights();
- result = true;
- } else
- {
- DisableOpenGLLights();
- result = false;
- }
+
+ enable = applyLights(layer, viewmat);
}
}
- return result;
-
-
+
+ if(enable)
+ EnableOpenGLLights();
+ else
+ DisableOpenGLLights();
}
+void KX_BlenderRenderTools::EnableOpenGLLights()
+{
+ if(m_lastlighting == true)
+ return;
-void KX_BlenderRenderTools::BeginFrame(RAS_IRasterizer* rasty)
+ glEnable(GL_LIGHTING);
+ glEnable(GL_COLOR_MATERIAL);
+
+ glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, true);
+ if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2)
+ glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
+
+ m_lastlighting = true;
+}
+
+void KX_BlenderRenderTools::DisableOpenGLLights()
{
- m_clientobject = NULL;
- m_lastblenderobject = NULL;
- m_lastblenderlights = false;
- m_lastlayer = -1;
- m_lastlighting = false;
- m_modified = true;
- DisableOpenGLLights();
+ if(m_lastlighting == false)
+ return;
+ glDisable(GL_LIGHTING);
+ glDisable(GL_COLOR_MATERIAL);
+ m_lastlighting = false;
}
-void KX_BlenderRenderTools::SetClientObject(void* obj)
+
+void KX_BlenderRenderTools::SetClientObject(RAS_IRasterizer *rasty, void* obj)
{
if (m_clientobject != obj)
{
- if (obj == NULL || !((KX_GameObject*)obj)->IsNegativeScaling())
- {
- glFrontFace(GL_CCW);
- } else
- {
- glFrontFace(GL_CW);
- }
+ bool ccw = (obj == NULL || !((KX_GameObject*)obj)->IsNegativeScaling());
+ rasty->SetFrontFace(ccw);
+
m_clientobject = obj;
- m_modified = true;
}
}
-bool KX_BlenderRenderTools::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data)
+bool KX_BlenderRenderTools::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data)
{
double* const oglmatrix = (double* const) data;
- MT_Point3 resultpoint(hit_point);
- MT_Vector3 resultnormal(hit_normal);
+ MT_Point3 resultpoint(result->m_hitPoint);
+ MT_Vector3 resultnormal(result->m_hitNormal);
MT_Vector3 left(oglmatrix[0],oglmatrix[1],oglmatrix[2]);
MT_Vector3 dir = -(left.cross(resultnormal)).safe_normalized();
left = (dir.cross(resultnormal)).safe_normalized();
@@ -183,7 +196,7 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
MT_Vector3 dir = (campos - objpos).safe_normalized();
MT_Vector3 up(0,0,1.0);
- KX_GameObject* gameobj = (KX_GameObject*) this->m_clientobject;
+ KX_GameObject* gameobj = (KX_GameObject*)m_clientobject;
// get scaling of halo object
MT_Vector3 size = gameobj->GetSGNode()->GetLocalScale();
@@ -219,7 +232,7 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
{
// shadow must be cast to the ground, physics system needed here!
MT_Point3 frompoint(oglmatrix[12],oglmatrix[13],oglmatrix[14]);
- KX_GameObject *gameobj = (KX_GameObject*) this->m_clientobject;
+ KX_GameObject *gameobj = (KX_GameObject*)m_clientobject;
MT_Vector3 direction = MT_Vector3(0,0,-1);
direction.normalize();
@@ -237,9 +250,8 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
if (parent)
parent->Release();
- MT_Point3 resultpoint;
- MT_Vector3 resultnormal;
- if (!KX_RayCast::RayTest(physics_controller, physics_environment, frompoint, topoint, resultpoint, resultnormal, KX_RayCast::Callback<KX_BlenderRenderTools>(this, oglmatrix)))
+ KX_RayCast::Callback<KX_BlenderRenderTools> callback(this, physics_controller, oglmatrix);
+ if (!KX_RayCast::RayTest(physics_environment, frompoint, topoint, callback))
{
// couldn't find something to cast the shadow on...
glMultMatrixd(oglmatrix);
@@ -254,13 +266,29 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
}
-/**
-Render Text renders text into a (series of) polygon, using a texture font,
-Each character consists of one polygon (one quad or two triangles)
-*/
-void KX_BlenderRenderTools::RenderText(int mode,RAS_IPolyMaterial* polymat,float v1[3],float v2[3],float v3[3],float v4[3])
+void KX_BlenderRenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
+ const char* text,
+ int xco,
+ int yco,
+ int width,
+ int height)
+{
+ STR_String tmpstr(text);
+
+ if(mode == RAS_IRenderTools::RAS_TEXT_PADDED)
+ BL_print_gamedebug_line_padded(tmpstr.Ptr(), xco, yco, width, height);
+ else
+ BL_print_gamedebug_line(tmpstr.Ptr(), xco, yco, width, height);
+}
+
+/* Render Text renders text into a (series of) polygon, using a texture font,
+ * Each character consists of one polygon (one quad or two triangles) */
+
+void KX_BlenderRenderTools::RenderText(
+ int mode,
+ RAS_IPolyMaterial* polymat,
+ float v1[3], float v2[3], float v3[3], float v4[3], int glattrib)
{
-
STR_String mytext = ((CValue*)m_clientobject)->GetPropertyText("Text");
const unsigned int flag = polymat->GetFlag();
@@ -277,67 +305,9 @@ void KX_BlenderRenderTools::RenderText(int mode,RAS_IPolyMaterial* polymat,float
col = blenderpoly->GetMCol();
}
- BL_RenderText( mode,mytext,mytext.Length(),tface,col,v1,v2,v3,v4);
-
-}
-
-
-
-KX_BlenderRenderTools::~KX_BlenderRenderTools()
-{
-};
-
-
-void KX_BlenderRenderTools::EndFrame(RAS_IRasterizer* rasty)
-{
+ GPU_render_text(tface, mode, mytext, mytext.Length(), col, v1, v2, v3, v4, glattrib);
}
-
-
-void KX_BlenderRenderTools::DisableOpenGLLights()
-{
- glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
-}
-
-
-void KX_BlenderRenderTools::EnableOpenGLLights()
-{
- glEnable(GL_LIGHTING);
-
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, true);
- if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2)
- glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
-
-}
-
-
-/**
- * Rendering text using 2D bitmap functionality.
- */
-void KX_BlenderRenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
- const char* text,
- int xco,
- int yco,
- int width,
- int height)
-{
- switch (mode) {
- case RAS_IRenderTools::RAS_TEXT_PADDED: {
- STR_String tmpstr(text);
- BL_print_gamedebug_line_padded(tmpstr.Ptr(),xco,yco,width,height);
- break;
- }
- default: {
- STR_String tmpstr(text);
- BL_print_gamedebug_line(tmpstr.Ptr(),xco,yco,width,height);
- }
- }
-}
-
-
void KX_BlenderRenderTools::PushMatrix()
{
@@ -350,14 +320,13 @@ void KX_BlenderRenderTools::PopMatrix()
}
-
-int KX_BlenderRenderTools::applyLights(int objectlayer)
+int KX_BlenderRenderTools::applyLights(int objectlayer, const MT_Transform& viewmat)
{
-// taken from blender source, incompatibility between Blender Object / GameObject
-
+ // taken from blender source, incompatibility between Blender Object / GameObject
+ float glviewmat[16];
unsigned int count;
float vec[4];
-
+
vec[3]= 1.0;
for(count=0; count<m_numgllights; count++)
@@ -365,9 +334,11 @@ int KX_BlenderRenderTools::applyLights(int objectlayer)
//std::vector<struct RAS_LightObject*> m_lights;
std::vector<struct RAS_LightObject*>::iterator lit = m_lights.begin();
+
+ viewmat.getValue(glviewmat);
glPushMatrix();
- glLoadMatrixf(m_viewmat);
+ glLoadMatrixf(glviewmat);
for (lit = m_lights.begin(), count = 0; !(lit==m_lights.end()) && count < m_numgllights; ++lit)
{
RAS_LightObject* lightdata = (*lit);
@@ -435,7 +406,6 @@ int KX_BlenderRenderTools::applyLights(int objectlayer)
glEnable((GLenum)(GL_LIGHT0+count));
count++;
-
}
}
glPopMatrix();
@@ -444,22 +414,6 @@ int KX_BlenderRenderTools::applyLights(int objectlayer)
}
-
-
-RAS_IPolyMaterial* KX_BlenderRenderTools::CreateBlenderPolyMaterial(
- const STR_String &texname,
- bool ba,const STR_String& matname,int tile,int tilexrep,int tileyrep,int mode,bool transparant,bool zsort, int lightlayer
- ,bool bIsTriangle,void* clientobject,void* tface)
-{
- assert(!"Deprecated");
-/* return new KX_BlenderPolyMaterial(
-
- texname,
- ba,matname,tile,tilexrep,tileyrep,mode,transparant,zsort, lightlayer
- ,bIsTriangle,clientobject,(struct MTFace*)tface);*/
- return NULL;
-}
-
void KX_BlenderRenderTools::MotionBlur(RAS_IRasterizer* rasterizer)
{
int state = rasterizer->GetMotionBlurState();
@@ -493,4 +447,3 @@ void KX_BlenderRenderTools::Render2DFilters(RAS_ICanvas* canvas)
m_filtermanager.RenderFilters(canvas);
}
-unsigned int KX_BlenderRenderTools::m_numgllights;
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
index 8abce1b8c3e..a7618462c9b 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
@@ -26,6 +26,7 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
+
#ifndef __KX_BLENDERRENDERTOOLS
#define __KX_BLENDERRENDERTOOLS
@@ -37,67 +38,54 @@
#include "RAS_IRenderTools.h"
struct KX_ClientObjectInfo;
+class KX_RayCast;
-/**
-BlenderRenderTools are a set of tools to apply 2D/3D graphics effects, which are not
-part of the (polygon) Rasterizer.
-Effects like 2D text, 3D (polygon) text, lighting.
-*/
+/* BlenderRenderTools are a set of tools to apply 2D/3D graphics effects, which
+ * are not part of the (polygon) Rasterizer. Effects like 2D text, 3D (polygon)
+ * text, lighting.
+ *
+ * Most of this code is duplicated in GPC_RenderTools, so this should be
+ * moved to some common location to avoid duplication. */
class KX_BlenderRenderTools : public RAS_IRenderTools
{
- bool m_lastblenderlights;
- void* m_lastblenderobject;
- int m_lastlayer;
+ int m_lastlightlayer;
bool m_lastlighting;
static unsigned int m_numgllights;
-
-
+
public:
-
KX_BlenderRenderTools();
virtual ~KX_BlenderRenderTools();
- virtual void EndFrame(class RAS_IRasterizer* rasty);
- virtual void BeginFrame(class RAS_IRasterizer* rasty);
- void DisableOpenGLLights();
+ void EndFrame(RAS_IRasterizer* rasty);
+ void BeginFrame(RAS_IRasterizer* rasty);
+
void EnableOpenGLLights();
- int ProcessLighting(int layer);
+ void DisableOpenGLLights();
+ void ProcessLighting(int layer, const MT_Transform& viewmat);
- virtual void RenderText2D(RAS_TEXT_RENDER_MODE mode,
+ void RenderText2D(RAS_TEXT_RENDER_MODE mode,
const char* text,
int xco,
int yco,
int width,
int height);
- virtual void RenderText(int mode,
+ void RenderText(int mode,
class RAS_IPolyMaterial* polymat,
float v1[3],
float v2[3],
float v3[3],
- float v4[3]);
- void applyTransform(class RAS_IRasterizer* rasty,
- double* oglmatrix,
- int objectdrawmode );
- int applyLights(int objectlayer);
- virtual void PushMatrix();
- virtual void PopMatrix();
-
- virtual class RAS_IPolyMaterial* CreateBlenderPolyMaterial(const STR_String &texname,
- bool ba,
- const STR_String& matname,
- int tile,
- int tilexrep,
- int tileyrep,
- int mode,
- bool transparant,
- bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject,
- void* tface);
-
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ float v4[3],
+ int glattrib);
+
+ void applyTransform(RAS_IRasterizer* rasty, double* oglmatrix, int objectdrawmode);
+ int applyLights(int objectlayer, const MT_Transform& viewmat);
+
+ void PushMatrix();
+ void PopMatrix();
+
+ bool RayHit(KX_ClientObjectInfo* client, class KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo*) { return true; }
virtual void MotionBlur(RAS_IRasterizer* rasterizer);
@@ -105,8 +93,7 @@ public:
virtual void Render2DFilters(RAS_ICanvas* canvas);
- virtual void SetClientObject(void* obj);
-
+ virtual void SetClientObject(RAS_IRasterizer *rasty, void* obj);
};
#endif //__KX_BLENDERRENDERTOOLS
diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile
index a7394158a20..4b9a2a3af17 100644
--- a/source/gameengine/BlenderRoutines/Makefile
+++ b/source/gameengine/BlenderRoutines/Makefile
@@ -54,6 +54,7 @@ CPPFLAGS += -I../../blender/blenkernel
CPPFLAGS += -I../../blender/render/extern/include
CPPFLAGS += -I../../blender/blenloader
CPPFLAGS += -I../../blender/blenkernel
+CPPFLAGS += -I../../blender/gpu
CPPFLAGS += -I../Converter
CPPFLAGS += -I../Expressions
CPPFLAGS += -I../GameLogic
@@ -72,9 +73,5 @@ ifeq ($(OS),windows)
CPPFLAGS += -I../../blender
endif
-ifeq ($(WITH_BF_GLEXT),true)
- CPPFLAGS += -DWITH_GLEXT
-endif
-
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript
index 327f4798e04..78adbc83d9b 100644
--- a/source/gameengine/BlenderRoutines/SConscript
+++ b/source/gameengine/BlenderRoutines/SConscript
@@ -15,7 +15,7 @@ incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common'
incs += ' #source/gameengine/Physics/Bullet #source/gameengine/Physics/Sumo'
incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader'
-incs += ' #extern/glew/include'
+incs += ' #extern/glew/include #source/blender/gpu'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_SOLID_INC']
@@ -26,7 +26,4 @@ cxxflags = []
if env['OURPLATFORM']=='win32-vc':
cxxflags.append ('/GR')
-if env['WITH_BF_GLEXT'] == 1:
- env['CPPFLAGS'].append('-DWITH_GLEXT')
-
env.BlenderLib ( 'bf_bloutines', sources, Split(incs), [], libtype=['game', 'game2', 'player'], priority=[0, 0, 55] , compileflags=cxxflags)
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 5d6dd694765..119465c8726 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -50,6 +50,7 @@
#include "MT_Matrix4x4.h"
#include "BKE_utildefines.h"
#include "FloatValue.h"
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -57,24 +58,12 @@
BL_ActionActuator::~BL_ActionActuator()
{
-
- if (m_pose) {
- free_pose_channels(m_pose);
- MEM_freeN(m_pose);
- m_pose = NULL;
- };
-
- if (m_userpose){
- free_pose_channels(m_userpose);
- MEM_freeN(m_userpose);
- m_userpose=NULL;
- }
- if (m_blendpose) {
- free_pose_channels(m_blendpose);
- MEM_freeN(m_blendpose);
- m_blendpose = NULL;
- };
-
+ if (m_pose)
+ free_pose(m_pose);
+ if (m_userpose)
+ free_pose(m_userpose);
+ if (m_blendpose)
+ free_pose(m_blendpose);
}
void BL_ActionActuator::ProcessReplica(){
@@ -496,17 +485,10 @@ char BL_ActionActuator::GetAction_doc[] =
PyObject* BL_ActionActuator::PyGetAction(PyObject* self,
PyObject* args,
PyObject* kwds) {
- PyObject *result;
-
if (m_action){
- result = Py_BuildValue("s", m_action->id.name+2);
+ return PyString_FromString(m_action->id.name+2);
}
- else{
- Py_INCREF(Py_None);
- result = Py_None;
- }
-
- return result;
+ Py_RETURN_NONE;
}
/* getProperty */
@@ -652,8 +634,7 @@ PyObject* BL_ActionActuator::PySetAction(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setStart */
@@ -674,8 +655,7 @@ PyObject* BL_ActionActuator::PySetStart(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setEnd */
@@ -696,8 +676,7 @@ PyObject* BL_ActionActuator::PySetEnd(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setBlendin */
@@ -719,8 +698,7 @@ PyObject* BL_ActionActuator::PySetBlendin(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setBlendtime */
@@ -747,8 +725,7 @@ PyObject* BL_ActionActuator::PySetBlendtime(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setPriority */
@@ -771,8 +748,7 @@ PyObject* BL_ActionActuator::PySetPriority(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setFrame */
@@ -797,8 +773,7 @@ PyObject* BL_ActionActuator::PySetFrame(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setProperty */
@@ -820,8 +795,7 @@ PyObject* BL_ActionActuator::PySetProperty(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setFrameProperty */
@@ -842,8 +816,7 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*
@@ -860,8 +833,7 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
*/
@@ -946,8 +918,7 @@ PyObject* BL_ActionActuator::PySetChannel(PyObject* self,
}
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* getType */
diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp
index f73d5b42a01..bf774bf7568 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.cpp
+++ b/source/gameengine/Converter/BL_ArmatureObject.cpp
@@ -53,15 +53,20 @@ BL_ArmatureObject::BL_ArmatureObject(
: KX_GameObject(sgReplicationInfo,callbacks),
m_objArma(armature),
- m_mrdPose(NULL),
- m_lastframe(0.),
+ m_framePose(NULL),
+ m_lastframe(0.0),
m_activeAct(NULL),
- m_activePriority(999)
+ m_activePriority(999),
+ m_lastapplyframe(0.0)
{
m_armature = get_armature(m_objArma);
- m_pose = m_objArma->pose;
-}
+ /* we make a copy of blender object's pose, and then always swap it with
+ * the original pose before calling into blender functions, to deal with
+ * replica's or other objects using the same blender object */
+ m_pose = NULL;
+ copy_pose(&m_pose, m_objArma->pose, 1 /* copy_constraint_channels_hack */);
+}
CValue* BL_ArmatureObject::GetReplica()
{
@@ -78,36 +83,39 @@ void BL_ArmatureObject::ProcessReplica(BL_ArmatureObject *replica)
{
KX_GameObject::ProcessReplica(replica);
+ replica->m_pose = NULL;
+ copy_pose(&replica->m_pose, m_pose, 1 /* copy_constraint_channels_hack */);
}
BL_ArmatureObject::~BL_ArmatureObject()
{
- if (m_mrdPose){
- free_pose_channels(m_mrdPose);
- MEM_freeN(m_mrdPose);
+ if (m_pose)
+ free_pose(m_pose);
+}
+
+bool BL_ArmatureObject::VerifyPose()
+{
+ if(m_lastapplyframe != m_lastframe) {
+ extract_pose_from_pose(m_objArma->pose, m_pose);
+ where_is_pose(m_objArma);
+ m_lastapplyframe = m_lastframe;
+ extract_pose_from_pose(m_pose, m_objArma->pose);
+ return false;
}
+ else
+ return true;
}
-/* note, you can only call this for exisiting Armature objects, and not mix it with other Armatures */
-/* there is only 1 unique Pose per Armature */
void BL_ArmatureObject::ApplyPose()
{
- if (m_pose) {
- // copy to armature object
- if (m_objArma->pose != m_pose)/* This should never happen but it does - Campbell */
- extract_pose_from_pose(m_objArma->pose, m_pose);
-
- // is this needed anymore?
- //if (!m_mrdPose)
- // copy_pose (&m_mrdPose, m_pose, 0);
- //else
- // extract_pose_from_pose(m_mrdPose, m_pose);
- }
+ if(VerifyPose())
+ extract_pose_from_pose(m_objArma->pose, m_pose);
}
void BL_ArmatureObject::SetPose(bPose *pose)
{
- m_pose = pose;
+ extract_pose_from_pose(m_pose, pose);
+ m_lastapplyframe = -1.0;
}
bool BL_ArmatureObject::SetActiveAction(BL_ActionActuator *act, short priority, double curtime)
@@ -116,10 +124,15 @@ bool BL_ArmatureObject::SetActiveAction(BL_ActionActuator *act, short priority,
m_activePriority = 9999;
m_lastframe= curtime;
m_activeAct = NULL;
+ // remember the pose at the start of the frame
+ m_framePose = m_pose;
}
if (priority<=m_activePriority)
{
+ if (priority<m_activePriority)
+ // this action overwrites the previous ones, start from initial pose to cancel their effects
+ m_pose = m_framePose;
if (m_activeAct && (m_activeAct!=act))
m_activeAct->SetBlendTime(0.0); /* Reset the blend timer */
m_activeAct = act;
@@ -158,6 +171,7 @@ void BL_ArmatureObject::GetPose(bPose **pose)
if (*pose == m_pose)
// no need to copy if the pointers are the same
return;
+
extract_pose_from_pose(*pose, m_pose);
}
}
@@ -167,19 +181,16 @@ void BL_ArmatureObject::GetMRDPose(bPose **pose)
/* If the caller supplies a null pose, create a new one. */
/* Otherwise, copy the armature's pose channels into the caller-supplied pose */
- // is this needed anymore?
- //if (!m_mrdPose){
- // copy_pose (&m_mrdPose, m_pose, 0);
- //}
-
- if (!*pose)
+ if (!*pose) {
// must duplicate the constraints too otherwise we have corruption in free_pose_channels()
// because it will free the blender constraints.
// Ideally, blender should rememeber that the constraints were not copied so that
// free_pose_channels() would not free them.
- copy_pose(pose, m_objArma->pose, 1);
- else
- extract_pose_from_pose(*pose, m_objArma->pose);
+ copy_pose(pose, m_pose, 1);
+ }
+ else {
+ extract_pose_from_pose(*pose, m_pose);
+ }
}
@@ -193,16 +204,18 @@ double BL_ArmatureObject::GetLastFrame()
return m_lastframe;
}
-bool BL_ArmatureObject::GetBoneMatrix(Bone* bone, MT_Matrix4x4& matrix) const
+bool BL_ArmatureObject::GetBoneMatrix(Bone* bone, MT_Matrix4x4& matrix)
{
- Object* par_arma = m_objArma;
- where_is_pose(par_arma);
- bPoseChannel *pchan= get_pose_channel(par_arma->pose, bone->name);
+ bPoseChannel *pchan;
+
+ ApplyPose();
+ pchan = get_pose_channel(m_objArma->pose, bone->name);
if(pchan) {
matrix.setValue(&pchan->pose_mat[0][0]);
return true;
}
+
return false;
}
diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h
index 752bd5eb365..6f2c0d2f4c9 100644
--- a/source/gameengine/Converter/BL_ArmatureObject.h
+++ b/source/gameengine/Converter/BL_ArmatureObject.h
@@ -59,7 +59,10 @@ public:
void GetMRDPose(struct bPose **pose);
void GetPose(struct bPose **pose);
void SetPose (struct bPose *pose);
+
void ApplyPose();
+ bool VerifyPose();
+
bool SetActiveAction(class BL_ActionActuator *act, short priority, double curtime);
struct bArmature * GetArmature() { return m_armature; }
@@ -69,7 +72,7 @@ public:
/// Retrieve the pose matrix for the specified bone.
/// Returns true on success.
- bool GetBoneMatrix(Bone* bone, MT_Matrix4x4& matrix) const;
+ bool GetBoneMatrix(Bone* bone, MT_Matrix4x4& matrix);
/// Returns the bone length. The end of the bone is in the local y direction.
float GetBoneLength(Bone* bone) const;
@@ -79,10 +82,12 @@ protected:
Object *m_objArma;
struct bArmature *m_armature;
struct bPose *m_pose;
- struct bPose *m_mrdPose;
+ struct bPose *m_framePose;
double m_lastframe;
class BL_ActionActuator *m_activeAct;
short m_activePriority;
+
+ double m_lastapplyframe;
};
#endif
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 1f1ac6da119..05d4f45b634 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -136,8 +136,12 @@
#include "BKE_mesh.h"
#include "MT_Point3.h"
+#include "BLI_arithb.h"
+
extern "C" {
- #include "BKE_customdata.h"
+#include "BKE_customdata.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_DerivedMesh.h"
}
#include "BKE_material.h" /* give_current_material */
@@ -309,7 +313,6 @@ typedef struct MTF_localLayer
// ------------------------------------
BL_Material* ConvertMaterial(
- Mesh* mesh,
Material *mat,
MTFace* tface,
const char *tfaceName,
@@ -323,15 +326,16 @@ BL_Material* ConvertMaterial(
//this needs some type of manager
BL_Material *material = new BL_Material();
- int numchan = -1;
+ int numchan = -1, texalpha = 0;
bool validmat = (mat!=0);
- bool validface = (mesh->mtface && tface);
+ bool validface = (tface!=0);
short type = 0;
if( validmat )
type = 1; // material color
material->IdMode = DEFAULT_BLENDER;
+ material->glslmat = (validmat)? glslmat: false;
// --------------------------------
if(validmat) {
@@ -367,12 +371,13 @@ BL_Material* ConvertMaterial(
if(i==0 && facetex ) {
Image*tmp = (Image*)(tface->tpage);
+
if(tmp) {
material->img[i] = tmp;
material->texname[i] = material->img[i]->id.name;
material->flag[i] |= ( tface->transp &TF_ALPHA )?USEALPHA:0;
material->flag[i] |= ( tface->transp &TF_ADD )?CALCALPHA:0;
- material->ras_mode|= ( tface->transp &(TF_ADD | TF_ALPHA))?TRANSP:0;
+
if(material->img[i]->flag & IMA_REFLECT)
material->mapping[i].mapping |= USEREFL;
else
@@ -430,6 +435,8 @@ BL_Material* ConvertMaterial(
material->flag[i] |= ( mttmp->mapto & MAP_ALPHA )?TEXALPHA:0;
material->flag[i] |= ( mttmp->texflag& MTEX_NEGATIVE )?TEXNEG:0;
+ if(!glslmat && (material->flag[i] & TEXALPHA))
+ texalpha = 1;
}
}
else if(mttmp->tex->type == TEX_ENVMAP) {
@@ -546,17 +553,7 @@ BL_Material* ConvertMaterial(
material->ref = mat->ref;
material->amb = mat->amb;
- // set alpha testing without z-sorting
- if( ( validface && (!(tface->transp &~ TF_CLIP))) && mat->mode & MA_ZTRA) {
- // sets the RAS_IPolyMaterial::m_flag |RAS_FORCEALPHA
- // this is so we don't have the overhead of the z-sorting code
- material->ras_mode|=ALPHA_TEST;
- }
- else{
- // use regular z-sorting
- material->ras_mode |= ((mat->mode & MA_ZTRA) != 0)?ZSORT:0;
- }
- material->ras_mode |= ((mat->mode & MA_WIRE) != 0)?WIRE:0;
+ material->ras_mode |= (mat->mode & MA_WIRE)? WIRE: 0;
}
else {
int valid = 0;
@@ -574,7 +571,6 @@ BL_Material* ConvertMaterial(
material->mapping[0].mapping |= ( (material->img[0]->flag & IMA_REFLECT)!=0 )?USEREFL:0;
material->flag[0] |= ( tface->transp &TF_ALPHA )?USEALPHA:0;
material->flag[0] |= ( tface->transp &TF_ADD )?CALCALPHA:0;
- material->ras_mode|= ( tface->transp & (TF_ADD|TF_ALPHA))?TRANSP:0;
valid++;
}
}
@@ -605,12 +601,7 @@ BL_Material* ConvertMaterial(
(tface->mode & TF_INVISIBLE)
)?POLY_VIS:0;
- material->ras_mode |= ( (tface->mode & TF_DYNAMIC)!= 0 )?COLLIDER:0;
material->transp = tface->transp;
-
- if(tface->transp&~TF_CLIP)
- material->ras_mode |= TRANSP;
-
material->tile = tface->tile;
material->mode = tface->mode;
@@ -625,13 +616,28 @@ BL_Material* ConvertMaterial(
}
else {
// nothing at all
- material->ras_mode |= (COLLIDER|POLY_VIS| (validmat?0:USE_LIGHT));
+ material->ras_mode |= (POLY_VIS| (validmat?0:USE_LIGHT));
material->mode = default_face_mode;
material->transp = TF_SOLID;
material->tile = 0;
}
+ // with ztransp enabled, enforce alpha blending mode
+ if(validmat && (mat->mode & MA_ZTRA) && (material->transp == TF_SOLID))
+ material->transp = TF_ALPHA;
+
+ // always zsort alpha + add
+ if((material->transp == TF_ALPHA || texalpha) && (material->transp != TF_CLIP)) {
+ material->ras_mode |= ALPHA;
+ material->ras_mode |= (material->mode & TF_ALPHASORT)? ZSORT: 0;
+ }
+
+ // collider or not?
+ material->ras_mode |= (material->mode & TF_DYNAMIC)? COLLIDER: 0;
+ // these flags are irrelevant at this point, remove so they
+ // don't hurt material bucketing
+ material->mode &= ~(TF_DYNAMIC|TF_ALPHASORT|TF_TEX);
// get uv sets
if(validmat)
@@ -643,6 +649,7 @@ BL_Material* ConvertMaterial(
for (int vind = 0; vind<material->num_enabled; vind++)
{
BL_Mapping &map = material->mapping[vind];
+
if (map.uvCoName.IsEmpty())
isFirstSet = false;
else
@@ -672,7 +679,7 @@ BL_Material* ConvertMaterial(
isFirstSet = false;
uvName = layer.name;
}
- else
+ else if(strcmp(layer.name, uvName) != 0)
{
uv2[0] = uvSet[0]; uv2[1] = uvSet[1];
uv2[2] = uvSet[2]; uv2[3] = uvSet[3];
@@ -701,7 +708,6 @@ BL_Material* ConvertMaterial(
material->SetConversionUV(uvName, uv);
material->SetConversionUV2(uv2Name, uv2);
- material->ras_mode |= (mface->v4==0)?TRIANGLE:0;
if(validmat)
material->matname =(mat->id.name);
@@ -711,132 +717,54 @@ BL_Material* ConvertMaterial(
}
-static void BL_ComputeTriTangentSpace(const MT_Vector3 &v1, const MT_Vector3 &v2, const MT_Vector3 &v3,
- const MT_Vector2 &uv1, const MT_Vector2 &uv2, const MT_Vector2 &uv3,
- MFace* mface, MT_Vector3 *tan1, MT_Vector3 *tan2)
-{
- MT_Vector3 dx1(v2 - v1), dx2(v3 - v1);
- MT_Vector2 duv1(uv2 - uv1), duv2(uv3 - uv1);
-
- MT_Scalar r = 1.0 / (duv1.x() * duv2.y() - duv2.x() * duv1.y());
- duv1 *= r;
- duv2 *= r;
- MT_Vector3 sdir(duv2.y() * dx1 - duv1.y() * dx2);
- MT_Vector3 tdir(duv1.x() * dx2 - duv2.x() * dx1);
-
- tan1[mface->v1] += sdir;
- tan1[mface->v2] += sdir;
- tan1[mface->v3] += sdir;
-
- tan2[mface->v1] += tdir;
- tan2[mface->v2] += tdir;
- tan2[mface->v3] += tdir;
-}
-
-static MT_Vector4* BL_ComputeMeshTangentSpace(Mesh* mesh)
-{
- MFace* mface = static_cast<MFace*>(mesh->mface);
- MTFace* tface = static_cast<MTFace*>(mesh->mtface);
-
- MT_Vector3 *tan1 = new MT_Vector3[mesh->totvert];
- MT_Vector3 *tan2 = new MT_Vector3[mesh->totvert];
-
- int v;
- for (v = 0; v < mesh->totvert; v++)
- {
- tan1[v] = MT_Vector3(0.0, 0.0, 0.0);
- tan2[v] = MT_Vector3(0.0, 0.0, 0.0);
- }
-
- for (int p = 0; p < mesh->totface; p++, mface++, tface++)
- {
- MT_Vector3 v1(mesh->mvert[mface->v1].co),
- v2(mesh->mvert[mface->v2].co),
- v3(mesh->mvert[mface->v3].co);
-
- MT_Vector2 uv1(tface->uv[0]),
- uv2(tface->uv[1]),
- uv3(tface->uv[2]);
-
- BL_ComputeTriTangentSpace(v1, v2, v3, uv1, uv2, uv3, mface, tan1, tan2);
- if (mface->v4)
- {
- MT_Vector3 v4(mesh->mvert[mface->v4].co);
- MT_Vector2 uv4(tface->uv[3]);
-
- BL_ComputeTriTangentSpace(v1, v3, v4, uv1, uv3, uv4, mface, tan1, tan2);
- }
- }
-
- MT_Vector4 *tangent = new MT_Vector4[mesh->totvert];
- for (v = 0; v < mesh->totvert; v++)
- {
- const MT_Vector3 no(mesh->mvert[v].no[0]/32767.0,
- mesh->mvert[v].no[1]/32767.0,
- mesh->mvert[v].no[2]/32767.0);
- // Gram-Schmidt orthogonalize
- MT_Vector3 t(tan1[v] - no.cross(no.cross(tan1[v])));
- if (!MT_fuzzyZero(t))
- t /= t.length();
-
- tangent[v].x() = t.x();
- tangent[v].y() = t.y();
- tangent[v].z() = t.z();
- // Calculate handedness
- tangent[v].w() = no.dot(tan1[v].cross(tan2[v])) < 0.0 ? -1.0 : 1.0;
- }
-
- delete [] tan1;
- delete [] tan2;
-
- return tangent;
-}
-
RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* rendertools, KX_Scene* scene, KX_BlenderSceneConverter *converter)
{
RAS_MeshObject *meshobj;
- bool skinMesh = false;
-
+ bool skinMesh = false;
int lightlayer = blenderobj->lay;
-
- MFace* mface = static_cast<MFace*>(mesh->mface);
- MTFace* tface = static_cast<MTFace*>(mesh->mtface);
+
+ // Get DerivedMesh data
+ DerivedMesh *dm = CDDM_from_mesh(mesh, blenderobj);
+
+ MVert *mvert = dm->getVertArray(dm);
+ int totvert = dm->getNumVerts(dm);
+
+ MFace *mface = dm->getFaceArray(dm);
+ MTFace *tface = static_cast<MTFace*>(dm->getFaceDataArray(dm, CD_MTFACE));
+ MCol *mcol = static_cast<MCol*>(dm->getFaceDataArray(dm, CD_MCOL));
+ float (*tangent)[3] = NULL;
+ int totface = dm->getNumFaces(dm);
const char *tfaceName = "";
- MCol* mmcol = mesh->mcol;
- MT_assert(mface || mesh->totface == 0);
+ if(tface) {
+ DM_add_tangent_layer(dm);
+ tangent = (float(*)[3])dm->getFaceDataArray(dm, CD_TANGENT);
+ }
// Determine if we need to make a skinned mesh
- if (mesh->dvert || mesh->key){
+ if (mesh->dvert || mesh->key) {
meshobj = new BL_SkinMeshObject(mesh, lightlayer);
skinMesh = true;
}
- else {
+ else
meshobj = new RAS_MeshObject(mesh, lightlayer);
- }
- MT_Vector4 *tangent = 0;
- if (tface)
- tangent = BL_ComputeMeshTangentSpace(mesh);
-
// Extract avaiable layers
MTF_localLayer *layers = new MTF_localLayer[MAX_MTFACE];
- for (int lay=0; lay<MAX_MTFACE; lay++)
- {
+ for (int lay=0; lay<MAX_MTFACE; lay++) {
layers[lay].face = 0;
layers[lay].name = "";
}
-
int validLayers = 0;
- for (int i=0; i<mesh->fdata.totlayer; i++)
+ for (int i=0; i<dm->faceData.totlayer; i++)
{
- if (mesh->fdata.layers[i].type == CD_MTFACE)
+ if (dm->faceData.layers[i].type == CD_MTFACE)
{
assert(validLayers <= 8);
- layers[validLayers].face = (MTFace*)mesh->fdata.layers[i].data;;
- layers[validLayers].name = mesh->fdata.layers[i].name;
+ layers[validLayers].face = (MTFace*)(dm->faceData.layers[i].data);
+ layers[validLayers].name = dm->faceData.layers[i].name;
if(tface == layers[validLayers].face)
tfaceName = layers[validLayers].name;
validLayers++;
@@ -844,271 +772,240 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
}
meshobj->SetName(mesh->id.name);
- meshobj->m_xyz_index_to_vertex_index_mapping.resize(mesh->totvert);
- for (int f=0;f<mesh->totface;f++,mface++)
+ meshobj->m_sharedvertex_map.resize(totvert);
+
+ for (int f=0;f<totface;f++,mface++)
{
-
+ Material* ma = 0;
bool collider = true;
-
- // only add valid polygons
- if (mface->v3)
- {
- MT_Point2 uv0(0.0,0.0),uv1(0.0,0.0),uv2(0.0,0.0),uv3(0.0,0.0);
- MT_Point2 uv20(0.0,0.0),uv21(0.0,0.0),uv22(0.0,0.0),uv23(0.0,0.0);
- // rgb3 is set from the adjoint face in a square
- unsigned int rgb0,rgb1,rgb2,rgb3 = 0;
- MT_Vector3 no0(mesh->mvert[mface->v1].no[0], mesh->mvert[mface->v1].no[1], mesh->mvert[mface->v1].no[2]),
- no1(mesh->mvert[mface->v2].no[0], mesh->mvert[mface->v2].no[1], mesh->mvert[mface->v2].no[2]),
- no2(mesh->mvert[mface->v3].no[0], mesh->mvert[mface->v3].no[1], mesh->mvert[mface->v3].no[2]),
- no3(0.0, 0.0, 0.0);
- MT_Point3 pt0(mesh->mvert[mface->v1].co),
- pt1(mesh->mvert[mface->v2].co),
- pt2(mesh->mvert[mface->v3].co),
- pt3(0.0, 0.0, 0.0);
- MT_Vector4 tan0(0.0, 0.0, 0.0, 0.0),
- tan1(0.0, 0.0, 0.0, 0.0),
- tan2(0.0, 0.0, 0.0, 0.0),
- tan3(0.0, 0.0, 0.0, 0.0);
-
- no0 /= 32767.0;
- no1 /= 32767.0;
- no2 /= 32767.0;
- if (mface->v4)
- {
- pt3 = MT_Point3(mesh->mvert[mface->v4].co);
- no3 = MT_Vector3(mesh->mvert[mface->v4].no[0], mesh->mvert[mface->v4].no[1], mesh->mvert[mface->v4].no[2]);
- no3 /= 32767.0;
+ MT_Point2 uv0(0.0,0.0),uv1(0.0,0.0),uv2(0.0,0.0),uv3(0.0,0.0);
+ MT_Point2 uv20(0.0,0.0),uv21(0.0,0.0),uv22(0.0,0.0),uv23(0.0,0.0);
+ unsigned int rgb0,rgb1,rgb2,rgb3 = 0;
+
+ MT_Vector3 no0, no1, no2, no3;
+ MT_Point3 pt0, pt1, pt2, pt3;
+ MT_Vector4 tan0, tan1, tan2, tan3;
+
+ /* get coordinates, normals and tangents */
+ pt0 = MT_Point3(mvert[mface->v1].co);
+ pt1 = MT_Point3(mvert[mface->v2].co);
+ pt2 = MT_Point3(mvert[mface->v3].co);
+ pt3 = (mface->v4)? MT_Point3(mvert[mface->v4].co): MT_Point3(0.0, 0.0, 0.0);
+
+ if(mface->flag & ME_SMOOTH) {
+ float n0[3], n1[3], n2[3], n3[3];
+
+ NormalShortToFloat(n0, mvert[mface->v1].no);
+ NormalShortToFloat(n1, mvert[mface->v2].no);
+ NormalShortToFloat(n2, mvert[mface->v3].no);
+ no0 = n0;
+ no1 = n1;
+ no2 = n2;
+
+ if(mface->v4) {
+ NormalShortToFloat(n3, mvert[mface->v4].no);
+ no3 = n3;
}
+ else
+ no3 = MT_Vector3(0.0, 0.0, 0.0);
+ }
+ else {
+ float fno[3];
+
+ if(mface->v4)
+ CalcNormFloat4(mvert[mface->v1].co, mvert[mface->v2].co,
+ mvert[mface->v3].co, mvert[mface->v4].co, fno);
+ else
+ CalcNormFloat(mvert[mface->v1].co, mvert[mface->v2].co,
+ mvert[mface->v3].co, fno);
+
+ no0 = no1 = no2 = no3 = MT_Vector3(fno);
+ }
+
+ if(tangent) {
+ tan0 = tangent[f*4 + 0];
+ tan1 = tangent[f*4 + 1];
+ tan2 = tangent[f*4 + 2];
+
+ if (mface->v4)
+ tan3 = tangent[f*4 + 3];
+ }
+
+ /* get material */
+ ma = give_current_material(blenderobj, mface->mat_nr+1);
- if(!(mface->flag & ME_SMOOTH))
- {
- MT_Vector3 norm = ((pt1-pt0).cross(pt2-pt0)).safe_normalized();
- norm[0] = ((int) (10*norm[0]))/10.0;
- norm[1] = ((int) (10*norm[1]))/10.0;
- norm[2] = ((int) (10*norm[2]))/10.0;
- no0=no1=no2=no3= norm;
-
+ {
+ bool visible = true;
+ RAS_IPolyMaterial* polymat = NULL;
+ BL_Material *bl_mat = NULL;
+
+ if(converter->GetMaterials()) {
+ /* do Blender Multitexture and Blender GLSL materials */
+ unsigned int rgb[4];
+ MT_Point2 uv[4];
+
+ /* first is the BL_Material */
+ bl_mat = ConvertMaterial(ma, tface, tfaceName, mface, mcol,
+ lightlayer, blenderobj, layers, converter->GetGLSLMaterials());
+
+ bl_mat->material_index = (int)mface->mat_nr;
+
+ visible = ((bl_mat->ras_mode & POLY_VIS)!=0);
+ collider = ((bl_mat->ras_mode & COLLIDER)!=0);
+
+ /* vertex colors and uv's were stored in bl_mat temporarily */
+ bl_mat->GetConversionRGB(rgb);
+ rgb0 = rgb[0]; rgb1 = rgb[1];
+ rgb2 = rgb[2]; rgb3 = rgb[3];
+
+ bl_mat->GetConversionUV(uv);
+ uv0 = uv[0]; uv1 = uv[1];
+ uv2 = uv[2]; uv3 = uv[3];
+
+ bl_mat->GetConversionUV2(uv);
+ uv20 = uv[0]; uv21 = uv[1];
+ uv22 = uv[2]; uv23 = uv[3];
+
+ /* then the KX_BlenderMaterial */
+ polymat = new KX_BlenderMaterial(scene, bl_mat, skinMesh, lightlayer);
}
+ else {
+ /* do Texture Face materials */
+ Image* bima = (tface)? (Image*)tface->tpage: NULL;
+ STR_String imastr = (tface)? (bima? (bima)->id.name : "" ) : "";
- {
- Material* ma = 0;
- bool polyvisible = true;
- RAS_IPolyMaterial* polymat = NULL;
- BL_Material *bl_mat = NULL;
-
- if(converter->GetMaterials())
- {
- if(mesh->totcol > 1)
- ma = mesh->mat[mface->mat_nr];
- else
- ma = give_current_material(blenderobj, 1);
-
- bl_mat = ConvertMaterial(mesh, ma, tface, tfaceName, mface, mmcol, lightlayer, blenderobj, layers, converter->GetGLSLMaterials());
- // set the index were dealing with
- bl_mat->material_index = (int)mface->mat_nr;
-
- polyvisible = ((bl_mat->ras_mode & POLY_VIS)!=0);
- collider = ((bl_mat->ras_mode & COLLIDER)!=0);
+ char transp=0;
+ short mode=0, tile=0;
+ int tilexrep=4,tileyrep = 4;
+
+ if (bima) {
+ tilexrep = bima->xrep;
+ tileyrep = bima->yrep;
+ }
+
+ /* get tface properties if available */
+ if(tface) {
+ /* TF_DYNAMIC means the polygon is a collision face */
+ collider = ((tface->mode & TF_DYNAMIC) != 0);
+ transp = tface->transp;
+ tile = tface->tile;
+ mode = tface->mode;
- polymat = new KX_BlenderMaterial(scene, bl_mat, skinMesh, lightlayer, blenderobj );
+ visible = !((mface->flag & ME_HIDE)||(tface->mode & TF_INVISIBLE));
- unsigned int rgb[4];
- bl_mat->GetConversionRGB(rgb);
- rgb0 = rgb[0]; rgb1 = rgb[1];
- rgb2 = rgb[2]; rgb3 = rgb[3];
- MT_Point2 uv[4];
- bl_mat->GetConversionUV(uv);
- uv0 = uv[0]; uv1 = uv[1];
- uv2 = uv[2]; uv3 = uv[3];
-
- bl_mat->GetConversionUV2(uv);
- uv20 = uv[0]; uv21 = uv[1];
- uv22 = uv[2]; uv23 = uv[3];
-
- if(tangent){
- tan0 = tangent[mface->v1];
- tan1 = tangent[mface->v2];
- tan2 = tangent[mface->v3];
- if (mface->v4)
- tan3 = tangent[mface->v4];
- }
+ uv0 = MT_Point2(tface->uv[0]);
+ uv1 = MT_Point2(tface->uv[1]);
+ uv2 = MT_Point2(tface->uv[2]);
+
+ if (mface->v4)
+ uv3 = MT_Point2(tface->uv[3]);
+ }
+ else {
+ /* no texfaces, set COLLSION true and everything else FALSE */
+ mode = default_face_mode;
+ transp = TF_SOLID;
+ tile = 0;
}
- else
- {
- ma = give_current_material(blenderobj, 1);
- Image* bima = ((mesh->mtface && tface) ? (Image*) tface->tpage : NULL);
-
- STR_String imastr =
- ((mesh->mtface && tface) ?
- (bima? (bima)->id.name : "" ) : "" );
-
- char transp=0;
- short mode=0, tile=0;
- int tilexrep=4,tileyrep = 4;
+ /* get vertex colors */
+ if (mcol) {
+ /* we have vertex colors */
+ rgb0 = KX_Mcol2uint_new(mcol[0]);
+ rgb1 = KX_Mcol2uint_new(mcol[1]);
+ rgb2 = KX_Mcol2uint_new(mcol[2]);
- if (bima)
- {
- tilexrep = bima->xrep;
- tileyrep = bima->yrep;
-
- }
+ if (mface->v4)
+ rgb3 = KX_Mcol2uint_new(mcol[3]);
+ }
+ else {
+ /* no vertex colors, take from material, otherwise white */
+ unsigned int color = 0xFFFFFFFFL;
- if (mesh->mtface && tface)
+ if (ma)
{
- // Use texface colors if available
- //TF_DYNAMIC means the polygon is a collision face
- collider = ((tface->mode & TF_DYNAMIC) != 0);
- transp = tface->transp &~ TF_CLIP;
- tile = tface->tile;
- mode = tface->mode;
-
- polyvisible = !((mface->flag & ME_HIDE)||(tface->mode & TF_INVISIBLE));
+ union
+ {
+ unsigned char cp[4];
+ unsigned int integer;
+ } col_converter;
- uv0 = MT_Point2(tface->uv[0]);
- uv1 = MT_Point2(tface->uv[1]);
- uv2 = MT_Point2(tface->uv[2]);
-
- if (mface->v4)
- uv3 = MT_Point2(tface->uv[3]);
- }
- else
- {
- // no texfaces, set COLLSION true and everything else FALSE
+ col_converter.cp[3] = (unsigned char) (ma->r*255.0);
+ col_converter.cp[2] = (unsigned char) (ma->g*255.0);
+ col_converter.cp[1] = (unsigned char) (ma->b*255.0);
+ col_converter.cp[0] = (unsigned char) (ma->alpha*255.0);
- mode = default_face_mode;
- transp = TF_SOLID;
- tile = 0;
+ color = col_converter.integer;
}
- if (mmcol)
- {
- // Use vertex colors
- rgb0 = KX_Mcol2uint_new(mmcol[0]);
- rgb1 = KX_Mcol2uint_new(mmcol[1]);
- rgb2 = KX_Mcol2uint_new(mmcol[2]);
-
- if (mface->v4)
- rgb3 = KX_Mcol2uint_new(mmcol[3]);
- }
- else {
- // no vertex colors: take from material if we have one,
- // otherwise set to white
- unsigned int color = 0xFFFFFFFFL;
-
- if (ma)
- {
- union
- {
- unsigned char cp[4];
- unsigned int integer;
- } col_converter;
-
- col_converter.cp[3] = (unsigned char) (ma->r*255.0);
- col_converter.cp[2] = (unsigned char) (ma->g*255.0);
- col_converter.cp[1] = (unsigned char) (ma->b*255.0);
- col_converter.cp[0] = (unsigned char) (ma->alpha*255.0);
-
- color = col_converter.integer;
- }
-
- rgb0 = KX_rgbaint2uint_new(color);
- rgb1 = KX_rgbaint2uint_new(color);
- rgb2 = KX_rgbaint2uint_new(color);
-
- if (mface->v4)
- rgb3 = KX_rgbaint2uint_new(color);
- }
-
- bool istriangle = (mface->v4==0);
- bool zsort = ma?(ma->mode & MA_ZTRA) != 0:false;
+ rgb0 = KX_rgbaint2uint_new(color);
+ rgb1 = KX_rgbaint2uint_new(color);
+ rgb2 = KX_rgbaint2uint_new(color);
- polymat = new KX_PolygonMaterial(imastr, ma,
- tile, tilexrep, tileyrep,
- mode, transp, zsort, lightlayer, istriangle, blenderobj, tface, (unsigned int*)mmcol);
-
- if (ma)
- {
- polymat->m_specular = MT_Vector3(ma->specr, ma->specg, ma->specb)*ma->spec;
- polymat->m_shininess = (float)ma->har/4.0; // 0 < ma->har <= 512
- polymat->m_diffuse = MT_Vector3(ma->r, ma->g, ma->b)*(ma->emit + ma->ref);
-
- } else
- {
- polymat->m_specular = MT_Vector3(0.0f,0.0f,0.0f);
- polymat->m_shininess = 35.0;
- }
+ if (mface->v4)
+ rgb3 = KX_rgbaint2uint_new(color);
}
-
- // see if a bucket was reused or a new one was created
- // this way only one KX_BlenderMaterial object has to exist per bucket
- bool bucketCreated;
- RAS_MaterialBucket* bucket = scene->FindBucket(polymat, bucketCreated);
- if (bucketCreated) {
- // this is needed to free up memory afterwards
- converter->RegisterPolyMaterial(polymat);
- if(converter->GetMaterials()) {
- converter->RegisterBlenderMaterial(bl_mat);
- }
- } else {
- // delete the material objects since they are no longer needed
- // from now on, use the polygon material from the material bucket
- delete polymat;
- if(converter->GetMaterials()) {
- delete bl_mat;
- }
- polymat = bucket->GetPolyMaterial();
+
+ // only zsort alpha + add
+ bool alpha = (transp == TF_ALPHA || transp == TF_ADD);
+ bool zsort = (mode & TF_ALPHASORT)? alpha: 0;
+
+ polymat = new KX_PolygonMaterial(imastr, ma,
+ tile, tilexrep, tileyrep,
+ mode, transp, alpha, zsort, lightlayer, tface, (unsigned int*)mcol);
+
+ if (ma) {
+ polymat->m_specular = MT_Vector3(ma->specr, ma->specg, ma->specb)*ma->spec;
+ polymat->m_shininess = (float)ma->har/4.0; // 0 < ma->har <= 512
+ polymat->m_diffuse = MT_Vector3(ma->r, ma->g, ma->b)*(ma->emit + ma->ref);
}
-
- int nverts = mface->v4?4:3;
- int vtxarray = meshobj->FindVertexArray(nverts,polymat);
- RAS_Polygon* poly = new RAS_Polygon(bucket,polyvisible,nverts,vtxarray);
-
- bool flat;
-
- if (skinMesh) {
- /* If the face is set to solid, all fnors are the same */
- if (mface->flag & ME_SMOOTH)
- flat = false;
- else
- flat = true;
+ else {
+ polymat->m_specular = MT_Vector3(0.0f,0.0f,0.0f);
+ polymat->m_shininess = 35.0;
}
- else
- flat = false;
-
- poly->SetVertex(0,meshobj->FindOrAddVertex(vtxarray,pt0,uv0,uv20,tan0,rgb0,no0,flat,polymat,mface->v1));
- poly->SetVertex(1,meshobj->FindOrAddVertex(vtxarray,pt1,uv1,uv21,tan1,rgb1,no1,flat,polymat,mface->v2));
- poly->SetVertex(2,meshobj->FindOrAddVertex(vtxarray,pt2,uv2,uv22,tan2,rgb2,no2,flat,polymat,mface->v3));
- if (nverts==4)
- poly->SetVertex(3,meshobj->FindOrAddVertex(vtxarray,pt3,uv3,uv23,tan3,rgb3,no3,flat,polymat,mface->v4));
+ }
- meshobj->AddPolygon(poly);
- if (poly->IsCollider())
- {
- RAS_TriangleIndex idx;
- idx.m_index[0] = mface->v1;
- idx.m_index[1] = mface->v2;
- idx.m_index[2] = mface->v3;
- idx.m_collider = collider;
- meshobj->m_triangle_indices.push_back(idx);
- if (nverts==4)
- {
- idx.m_index[0] = mface->v1;
- idx.m_index[1] = mface->v3;
- idx.m_index[2] = mface->v4;
- idx.m_collider = collider;
- meshobj->m_triangle_indices.push_back(idx);
- }
+ /* mark face as flat, so vertices are split */
+ bool flat = (mface->flag & ME_SMOOTH) == 0;
+
+ // see if a bucket was reused or a new one was created
+ // this way only one KX_BlenderMaterial object has to exist per bucket
+ bool bucketCreated;
+ RAS_MaterialBucket* bucket = scene->FindBucket(polymat, bucketCreated);
+ if (bucketCreated) {
+ // this is needed to free up memory afterwards
+ converter->RegisterPolyMaterial(polymat);
+ if(converter->GetMaterials()) {
+ converter->RegisterBlenderMaterial(bl_mat);
}
-
-// poly->SetVisibleWireframeEdges(mface->edcode);
- poly->SetCollider(collider);
+ } else {
+ // delete the material objects since they are no longer needed
+ // from now on, use the polygon material from the material bucket
+ delete polymat;
+ if(converter->GetMaterials()) {
+ delete bl_mat;
+ }
+ polymat = bucket->GetPolyMaterial();
}
+
+ int nverts = (mface->v4)? 4: 3;
+ RAS_Polygon *poly = meshobj->AddPolygon(bucket, nverts);
+
+ poly->SetVisible(visible);
+ poly->SetCollider(collider);
+ //poly->SetEdgeCode(mface->edcode);
+
+ meshobj->AddVertex(poly,0,pt0,uv0,uv20,tan0,rgb0,no0,flat,mface->v1);
+ meshobj->AddVertex(poly,1,pt1,uv1,uv21,tan1,rgb1,no1,flat,mface->v2);
+ meshobj->AddVertex(poly,2,pt2,uv2,uv22,tan2,rgb2,no2,flat,mface->v3);
+
+ if (nverts==4)
+ meshobj->AddVertex(poly,3,pt3,uv3,uv23,tan3,rgb3,no3,flat,mface->v4);
}
+
if (tface)
tface++;
- if (mmcol)
- mmcol+=4;
+ if (mcol)
+ mcol+=4;
for (int lay=0; lay<MAX_MTFACE; lay++)
{
@@ -1118,20 +1015,18 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
layer.face++;
}
}
- meshobj->m_xyz_index_to_vertex_index_mapping.clear();
- meshobj->UpdateMaterialList();
+ meshobj->m_sharedvertex_map.clear();
// pre calculate texture generation
- for(RAS_MaterialBucket::Set::iterator mit = meshobj->GetFirstMaterial();
+ for(list<RAS_MeshMaterial>::iterator mit = meshobj->GetFirstMaterial();
mit != meshobj->GetLastMaterial(); ++ mit) {
- (*mit)->GetPolyMaterial()->OnConstruction();
+ mit->m_bucket->GetPolyMaterial()->OnConstruction();
}
- if(tangent)
- delete [] tangent;
-
if (layers)
delete []layers;
+
+ dm->release(dm);
return meshobj;
}
@@ -1570,14 +1465,9 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l
lightobj.m_type = RAS_LightObject::LIGHT_NORMAL;
}
-#ifdef BLENDER_GLSL
- if(converter->GetGLSLMaterials())
- GPU_lamp_from_blender(ob, la);
-
- gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rendertools, lightobj, ob->gpulamp);
-#else
- gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rendertools, lightobj, NULL);
-#endif
+ gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rendertools,
+ lightobj, converter->GetGLSLMaterials());
+
BL_ConvertLampIpos(la, gamelight, converter);
return gamelight;
@@ -1614,7 +1504,7 @@ static KX_GameObject *gameobject_from_blenderobject(
gamelight->AddRef();
kxscene->GetLightList()->Add(gamelight);
-
+
break;
}
@@ -1723,20 +1613,6 @@ struct parentChildLink {
SG_Node* m_gamechildnode;
};
- /**
- * Find the specified scene by name, or the first
- * scene if nothing matches (shouldn't happen).
- */
-static struct Scene *GetSceneForName(struct Main *maggie, const STR_String& scenename) {
- Scene *sce;
-
- for (sce= (Scene*) maggie->scene.first; sce; sce= (Scene*) sce->id.next)
- if (scenename == (sce->id.name+2))
- return sce;
-
- return (Scene*) maggie->scene.first;
-}
-
#include "DNA_constraint_types.h"
#include "BIF_editconstraint.h"
@@ -1819,7 +1695,7 @@ KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist){
return 0;
}
-#include "BLI_arithb.h"
+
// convert blender objects into ketsji gameobjects
void BL_ConvertBlenderObjects(struct Main* maggie,
const STR_String& scenename,
@@ -1835,7 +1711,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
)
{
- Scene *blenderscene = GetSceneForName(maggie, scenename);
+ Scene *blenderscene = converter->GetBlenderSceneForName(scenename);
// for SETLOOPER
Scene *sce;
Base *base;
@@ -1937,7 +1813,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (converter->addInitFromFrame)
if (!isInActiveLayer)
addobj=false;
-
+
if (gameobj&&addobj)
{
MT_Point3 posPrev;
@@ -1989,10 +1865,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
gameobj->NodeUpdateGS(0,true);
BL_ConvertIpos(blenderobject,gameobj,converter);
- // TODO: expand to multiple ipos per mesh
- Material *mat = give_current_material(blenderobject, 1);
- if(mat) BL_ConvertMaterialIpos(mat, gameobj, converter);
-
+ BL_ConvertMaterialIpos(blenderobject, gameobj, converter);
+
sumolist->Add(gameobj->AddRef());
BL_ConvertProperties(blenderobject,gameobj,timemgr,kxscene,isInActiveLayer);
@@ -2021,7 +1895,29 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
float* fl = (float*) blenderobject->parentinv;
MT_Transform parinvtrans(fl);
parentinversenode->SetLocalPosition(parinvtrans.getOrigin());
- parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
+ // problem here: the parent inverse transform combines scaling and rotation
+ // in the basis but the scenegraph needs separate rotation and scaling.
+ // This is not important for OpenGL (it uses 4x4 matrix) but it is important
+ // for the physic engine that needs a separate scaling
+ //parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
+
+ // Extract the rotation and the scaling from the basis
+ MT_Matrix3x3 ori(parinvtrans.getBasis());
+ MT_Vector3 x(ori.getColumn(0));
+ MT_Vector3 y(ori.getColumn(1));
+ MT_Vector3 z(ori.getColumn(2));
+ MT_Vector3 scale(x.length(), y.length(), z.length());
+ if (!MT_fuzzyZero(scale[0]))
+ x /= scale[0];
+ if (!MT_fuzzyZero(scale[1]))
+ y /= scale[1];
+ if (!MT_fuzzyZero(scale[2]))
+ z /= scale[2];
+ ori.setColumn(0, x);
+ ori.setColumn(1, y);
+ ori.setColumn(2, z);
+ parentinversenode->SetLocalOrientation(ori);
+ parentinversenode->SetLocalScale(scale);
parentinversenode->AddChild(gameobj->GetSGNode());
}
@@ -2029,8 +1925,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
// needed for python scripting
logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj);
- // needed for dynamic object morphing
- logicmgr->RegisterGameObj(gameobj, blenderobject);
+ // needed for group duplication
+ logicmgr->RegisterGameObj(blenderobject, gameobj);
for (int i = 0; i < gameobj->GetMeshCount(); i++)
logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject);
@@ -2050,10 +1946,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
//tf.Add(gameobj->GetSGNode());
gameobj->NodeUpdateGS(0,true);
- gameobj->Bucketize();
+ gameobj->AddMeshUser();
- if (gameobj->IsDupliGroup())
- grouplist.insert(blenderobject->dup_group);
}
else
{
@@ -2061,6 +1955,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
//at the end of this function if it is not a root object
inactivelist->Add(gameobj->AddRef());
}
+ if (gameobj->IsDupliGroup())
+ grouplist.insert(blenderobject->dup_group);
if (converter->addInitFromFrame){
gameobj->NodeSetLocalPosition(posPrev);
gameobj->NodeSetLocalOrientation(angor);
@@ -2111,7 +2007,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
blenderscene);
// this code is copied from above except that
- // object from groups are never is active layer
+ // object from groups are never in active layer
bool isInActiveLayer = false;
bool addobj=true;
@@ -2171,9 +2067,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
gameobj->NodeUpdateGS(0,true);
BL_ConvertIpos(blenderobject,gameobj,converter);
- // TODO: expand to multiple ipos per mesh
- Material *mat = give_current_material(blenderobject, 1);
- if(mat) BL_ConvertMaterialIpos(mat, gameobj, converter);
+ BL_ConvertMaterialIpos(blenderobject,gameobj, converter);
sumolist->Add(gameobj->AddRef());
@@ -2203,7 +2097,24 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
float* fl = (float*) blenderobject->parentinv;
MT_Transform parinvtrans(fl);
parentinversenode->SetLocalPosition(parinvtrans.getOrigin());
- parentinversenode->SetLocalOrientation(parinvtrans.getBasis());
+
+ // Extract the rotation and the scaling from the basis
+ MT_Matrix3x3 ori(parinvtrans.getBasis());
+ MT_Vector3 x(ori.getColumn(0));
+ MT_Vector3 y(ori.getColumn(1));
+ MT_Vector3 z(ori.getColumn(2));
+ MT_Vector3 scale(x.length(), y.length(), z.length());
+ if (!MT_fuzzyZero(scale[0]))
+ x /= scale[0];
+ if (!MT_fuzzyZero(scale[1]))
+ y /= scale[1];
+ if (!MT_fuzzyZero(scale[2]))
+ z /= scale[2];
+ ori.setColumn(0, x);
+ ori.setColumn(1, y);
+ ori.setColumn(2, z);
+ parentinversenode->SetLocalOrientation(ori);
+ parentinversenode->SetLocalScale(scale);
parentinversenode->AddChild(gameobj->GetSGNode());
}
@@ -2211,8 +2122,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
// needed for python scripting
logicmgr->RegisterGameObjectName(gameobj->GetName(),gameobj);
- // needed for dynamic object morphing
- logicmgr->RegisterGameObj(gameobj, blenderobject);
+ // needed for group duplication
+ logicmgr->RegisterGameObj(blenderobject, gameobj);
for (int i = 0; i < gameobj->GetMeshCount(); i++)
logicmgr->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), blenderobject);
@@ -2232,8 +2143,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
//tf.Add(gameobj->GetSGNode());
gameobj->NodeUpdateGS(0,true);
- gameobj->Bucketize();
-
+ gameobj->AddMeshUser();
}
else
{
@@ -2262,7 +2172,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
}
}
- if (blenderscene->camera) {
+ // non-camera objects not supported as camera currently
+ if (blenderscene->camera && blenderscene->camera->type == OB_CAMERA) {
KX_Camera *gamecamera= (KX_Camera*) converter->FindGameObject(blenderscene->camera);
if(gamecamera)
@@ -2297,6 +2208,41 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
{
struct Object* blenderchild = pcit->m_blenderchild;
+ struct Object* blenderparent = blenderchild->parent;
+ KX_GameObject* parentobj = converter->FindGameObject(blenderparent);
+ KX_GameObject* childobj = converter->FindGameObject(blenderchild);
+
+ assert(childobj);
+
+ if (!parentobj || objectlist->SearchValue(childobj) != objectlist->SearchValue(parentobj))
+ {
+ // special case: the parent and child object are not in the same layer.
+ // This weird situation is used in Apricot for test purposes.
+ // Resolve it by not converting the child
+ childobj->GetSGNode()->DisconnectFromParent();
+ delete pcit->m_gamechildnode;
+ // Now destroy the child object but also all its descendent that may already be linked
+ // Remove the child reference in the local list!
+ // Note: there may be descendents already if the children of the child were processed
+ // by this loop before the child. In that case, we must remove the children also
+ CListValue* childrenlist = (CListValue*)childobj->PyGetChildrenRecursive(childobj);
+ childrenlist->Add(childobj->AddRef());
+ for ( i=0;i<childrenlist->GetCount();i++)
+ {
+ KX_GameObject* obj = static_cast<KX_GameObject*>(childrenlist->GetValue(i));
+ if (templist->RemoveValue(obj))
+ obj->Release();
+ if (sumolist->RemoveValue(obj))
+ obj->Release();
+ if (logicbrick_conversionlist->RemoveValue(obj))
+ obj->Release();
+ }
+ childrenlist->Release();
+ // now destroy recursively
+ kxscene->RemoveObject(childobj);
+ continue;
+ }
+
switch (blenderchild->partype)
{
case PARVERT1:
@@ -2317,8 +2263,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
{
// parent this to a bone
Bone *parent_bone = get_named_bone(get_armature(blenderchild->parent), blenderchild->parsubstr);
- KX_BoneParentRelation *bone_parent_relation = KX_BoneParentRelation::New(parent_bone);
- pcit->m_gamechildnode->SetParentRelation(bone_parent_relation);
+
+ if(parent_bone) {
+ KX_BoneParentRelation *bone_parent_relation = KX_BoneParentRelation::New(parent_bone);
+ pcit->m_gamechildnode->SetParentRelation(bone_parent_relation);
+ }
break;
}
@@ -2333,12 +2282,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
break;
}
- struct Object* blenderparent = blenderchild->parent;
- KX_GameObject* parentobj = converter->FindGameObject(blenderparent);
- if (parentobj)
- {
- parentobj-> GetSGNode()->AddChild(pcit->m_gamechildnode);
- }
+ parentobj-> GetSGNode()->AddChild(pcit->m_gamechildnode);
}
vec_parent_child.clear();
@@ -2524,13 +2468,13 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0;
bool isInActiveLayer = (blenderobj->lay & layerMask)!=0;
BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,keydev,executePriority,layerMask,isInActiveLayer,canvas,converter);
+ // set the init state to all objects
+ gameobj->SetInitState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state);
}
- // apply the initial state to controllers
- for ( i=0;i<logicbrick_conversionlist->GetCount();i++)
+ // apply the initial state to controllers, only on the active objects as this registers the sensors
+ for ( i=0;i<objectlist->GetCount();i++)
{
- KX_GameObject* gameobj = static_cast<KX_GameObject*>(logicbrick_conversionlist->GetValue(i));
- struct Object* blenderobj = converter->FindBlenderObject(gameobj);
- gameobj->SetInitState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state);
+ KX_GameObject* gameobj = static_cast<KX_GameObject*>(objectlist->GetValue(i));
gameobj->ResetState();
}
@@ -2555,5 +2499,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
kxscene->DupliGroupRecurse(gameobj, 0);
}
}
+
+ KX_Camera *activecam = kxscene->GetActiveCamera();
+ MT_Scalar distance = (activecam)? activecam->GetCameraFar() - activecam->GetCameraNear(): 100.0f;
+ RAS_BucketManager *bucketmanager = kxscene->GetBucketManager();
+ bucketmanager->OptimizeBuckets(distance);
}
diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp
index d23274324ee..1d62a41cce9 100644
--- a/source/gameengine/Converter/BL_DeformableGameObject.cpp
+++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp
@@ -41,12 +41,14 @@ BL_DeformableGameObject::~BL_DeformableGameObject()
delete m_pDeformer; // __NLA : Temporary until we decide where to put this
}
-void BL_DeformableGameObject::ProcessReplica(KX_GameObject* replica)
+void BL_DeformableGameObject::ProcessReplica(KX_GameObject* replica)
{
+ BL_MeshDeformer *deformer;
KX_GameObject::ProcessReplica(replica);
- if (m_pDeformer){
- ((BL_DeformableGameObject*)replica)->m_pDeformer = m_pDeformer->GetReplica();
+ if (m_pDeformer) {
+ deformer = (BL_MeshDeformer*)m_pDeformer->GetReplica();
+ ((BL_DeformableGameObject*)replica)->m_pDeformer = deformer;
}
}
diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp
index 39d66a90e92..fa3b8185fe2 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.cpp
+++ b/source/gameengine/Converter/BL_MeshDeformer.cpp
@@ -50,26 +50,26 @@
bool BL_MeshDeformer::Apply(RAS_IPolyMaterial*)
{
- size_t i, j;
+ size_t i;
float *co;
// only apply once per frame if the mesh is actually modified
if(m_pMeshObject->MeshModified() &&
m_lastDeformUpdate != m_gameobj->GetLastFrame()) {
// For each material
- for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial();
+ for(list<RAS_MeshMaterial>::iterator mit= m_pMeshObject->GetFirstMaterial();
mit != m_pMeshObject->GetLastMaterial(); ++ mit) {
- RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial();
+ if(!mit->m_slots[(void*)m_gameobj])
+ continue;
- vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat);
-
- // For each array
- for (i=0; i<vertexarrays.size(); i++){
- KX_VertexArray& vertexarray = (*vertexarrays[i]);
+ RAS_MeshSlot *slot = *mit->m_slots[(void*)m_gameobj];
+ RAS_MeshSlot::iterator it;
+ // for each array
+ for(slot->begin(it); !slot->end(it); slot->next(it)) {
// For each vertex
- for (j=0; j<vertexarray.size(); j++){
- RAS_TexVert& v = vertexarray[j];
+ for(i=it.startvertex; i<it.endvertex; i++) {
+ RAS_TexVert& v = it.vertex[i];
co = m_bmesh->mvert[v.getOrigIndex()].co;
v.SetXYZ(MT_Point3(co));
}
@@ -90,7 +90,17 @@ BL_MeshDeformer::~BL_MeshDeformer()
delete [] m_transverts;
if (m_transnors)
delete [] m_transnors;
-};
+}
+
+void BL_MeshDeformer::Relink(GEN_Map<class GEN_HashedPtr, void*>*map)
+{
+ void **h_obj = (*map)[m_gameobj];
+
+ if (h_obj)
+ m_gameobj = (BL_DeformableGameObject*)(*h_obj);
+ else
+ m_gameobj = NULL;
+}
/**
* @warning This function is expensive!
@@ -101,41 +111,41 @@ void BL_MeshDeformer::RecalcNormals()
* gives area-weight normals which often look better anyway, and use
* GL_NORMALIZE so we don't have to do per vertex normalization either
* since the GPU can do it faster */
- size_t i, j;
+ list<RAS_MeshMaterial>::iterator mit;
+ RAS_MeshSlot::iterator it;
+ size_t i;
/* set vertex normals to zero */
memset(m_transnors, 0, sizeof(float)*3*m_bmesh->totvert);
/* add face normals to vertices. */
- for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial();
+ for(mit = m_pMeshObject->GetFirstMaterial();
mit != m_pMeshObject->GetLastMaterial(); ++ mit) {
- RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial();
+ if(!mit->m_slots[(void*)m_gameobj])
+ continue;
- const vecIndexArrays& indexarrays = m_pMeshObject->GetIndexCache(mat);
- vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat);
+ RAS_MeshSlot *slot = *mit->m_slots[(void*)m_gameobj];
- for (i=0; i<indexarrays.size(); i++) {
- KX_VertexArray& vertexarray = (*vertexarrays[i]);
- const KX_IndexArray& indexarray = (*indexarrays[i]);
- int nvert = mat->UsesTriangles()? 3: 4;
+ for(slot->begin(it); !slot->end(it); slot->next(it)) {
+ int nvert = (int)it.array->m_type;
- for(j=0; j<indexarray.size(); j+=nvert) {
- RAS_TexVert& v1 = vertexarray[indexarray[j]];
- RAS_TexVert& v2 = vertexarray[indexarray[j+1]];
- RAS_TexVert& v3 = vertexarray[indexarray[j+2]];
+ for(i=0; i<it.totindex; i+=nvert) {
+ RAS_TexVert& v1 = it.vertex[it.index[i]];
+ RAS_TexVert& v2 = it.vertex[it.index[i+1]];
+ RAS_TexVert& v3 = it.vertex[it.index[i+2]];
RAS_TexVert *v4 = NULL;
- const float *co1 = v1.getLocalXYZ();
- const float *co2 = v2.getLocalXYZ();
- const float *co3 = v3.getLocalXYZ();
+ const float *co1 = v1.getXYZ();
+ const float *co2 = v2.getXYZ();
+ const float *co3 = v3.getXYZ();
const float *co4 = NULL;
/* compute face normal */
float fnor[3], n1[3], n2[3];
if(nvert == 4) {
- v4 = &vertexarray[indexarray[j+3]];
- co4 = v4->getLocalXYZ();
+ v4 = &it.vertex[it.index[i+3]];
+ co4 = v4->getXYZ();
n1[0]= co1[0]-co3[0];
n1[1]= co1[1]-co3[1];
@@ -174,7 +184,7 @@ void BL_MeshDeformer::RecalcNormals()
}
/* in case of flat - just assign, the vertices are split */
- if(v1.getFlag() & TV_CALCFACENORMAL) {
+ if(v1.getFlag() & RAS_TexVert::FLAT) {
v1.SetNormal(fnor);
v2.SetNormal(fnor);
v3.SetNormal(fnor);
@@ -186,19 +196,18 @@ void BL_MeshDeformer::RecalcNormals()
}
/* assign smooth vertex normals */
- for(RAS_MaterialBucket::Set::iterator mit = m_pMeshObject->GetFirstMaterial();
+ for(mit = m_pMeshObject->GetFirstMaterial();
mit != m_pMeshObject->GetLastMaterial(); ++ mit) {
- RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial();
+ if(!mit->m_slots[(void*)m_gameobj])
+ continue;
- vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat);
+ RAS_MeshSlot *slot = *mit->m_slots[(void*)m_gameobj];
- for (i=0; i<vertexarrays.size(); i++) {
- KX_VertexArray& vertexarray = (*vertexarrays[i]);
-
- for(j=0; j<vertexarray.size(); j++) {
- RAS_TexVert& v = vertexarray[j];
+ for(slot->begin(it); !slot->end(it); slot->next(it)) {
+ for(i=it.startvertex; i<it.endvertex; i++) {
+ RAS_TexVert& v = it.vertex[i];
- if(!(v.getFlag() & TV_CALCFACENORMAL))
+ if(!(v.getFlag() & RAS_TexVert::FLAT))
v.SetNormal(m_transnors[v.getOrigIndex()]); //.safe_normalized()
}
}
@@ -219,4 +228,4 @@ void BL_MeshDeformer::VerifyStorage()
m_tvtot = m_bmesh->totvert;
}
}
-
+
diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h
index e9f7f0b192f..9d3d2e78123 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.h
+++ b/source/gameengine/Converter/BL_MeshDeformer.h
@@ -47,7 +47,7 @@ class BL_MeshDeformer : public RAS_Deformer
public:
void VerifyStorage();
void RecalcNormals();
- virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map){};
+ virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map);
BL_MeshDeformer(BL_DeformableGameObject *gameobj,
struct Object* obj,
class BL_SkinMeshObject *meshobj ):
@@ -67,6 +67,7 @@ public:
virtual RAS_Deformer* GetReplica(){return NULL;};
struct Mesh* GetMesh() { return m_bmesh; };
// virtual void InitDeform(double time){};
+
protected:
class BL_SkinMeshObject* m_pMeshObject;
struct Mesh* m_bmesh;
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
index 7196b393ed4..679b0df7ec6 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
@@ -49,6 +49,7 @@
#include "BLI_arithb.h"
#include "MT_Matrix4x4.h"
#include "BKE_utildefines.h"
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -134,7 +135,6 @@ void BL_ShapeActionActuator::BlendShape(Key* key, float srcweight)
{
vector<float>::const_iterator it;
float dstweight;
- int i;
KeyBlock *kb;
dstweight = 1.0F - srcweight;
@@ -442,15 +442,15 @@ PyMethodDef BL_ShapeActionActuator::Methods[] = {
{"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, SetProperty_doc},
{"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, SetBlendtime_doc},
- {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_VARARGS, GetAction_doc},
- {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_VARARGS, GetStart_doc},
- {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_VARARGS, GetEnd_doc},
- {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_VARARGS, GetBlendin_doc},
- {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_VARARGS, GetPriority_doc},
- {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_VARARGS, GetFrame_doc},
- {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc},
- {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_VARARGS, GetType_doc},
- {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_VARARGS, SetType_doc},
+ {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, GetAction_doc},
+ {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, GetStart_doc},
+ {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, GetEnd_doc},
+ {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, GetBlendin_doc},
+ {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, GetPriority_doc},
+ {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, GetFrame_doc},
+ {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, GetProperty_doc},
+ {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, GetType_doc},
+ {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, SetType_doc},
{NULL,NULL} //Sentinel
};
@@ -463,20 +463,11 @@ char BL_ShapeActionActuator::GetAction_doc[] =
"getAction()\n"
"\tReturns a string containing the name of the current action.\n";
-PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- PyObject *result;
-
+PyObject* BL_ShapeActionActuator::PyGetAction(PyObject* self) {
if (m_action){
- result = Py_BuildValue("s", m_action->id.name+2);
- }
- else{
- Py_INCREF(Py_None);
- result = Py_None;
+ return PyString_FromString(m_action->id.name+2);
}
-
- return result;
+ Py_RETURN_NONE;
}
/* getProperty */
@@ -484,9 +475,7 @@ char BL_ShapeActionActuator::GetProperty_doc[] =
"getProperty()\n"
"\tReturns the name of the property to be used in FromProp mode.\n";
-PyObject* BL_ShapeActionActuator::PyGetProperty(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetProperty(PyObject* self) {
PyObject *result;
result = Py_BuildValue("s", (const char *)m_propname);
@@ -499,9 +488,7 @@ char BL_ShapeActionActuator::GetFrame_doc[] =
"getFrame()\n"
"\tReturns the current frame number.\n";
-PyObject* BL_ShapeActionActuator::PyGetFrame(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetFrame(PyObject* self) {
PyObject *result;
result = Py_BuildValue("f", m_localtime);
@@ -514,9 +501,7 @@ char BL_ShapeActionActuator::GetEnd_doc[] =
"getEnd()\n"
"\tReturns the last frame of the action.\n";
-PyObject* BL_ShapeActionActuator::PyGetEnd(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetEnd(PyObject* self) {
PyObject *result;
result = Py_BuildValue("f", m_endframe);
@@ -529,9 +514,7 @@ char BL_ShapeActionActuator::GetStart_doc[] =
"getStart()\n"
"\tReturns the starting frame of the action.\n";
-PyObject* BL_ShapeActionActuator::PyGetStart(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetStart(PyObject* self) {
PyObject *result;
result = Py_BuildValue("f", m_startframe);
@@ -545,9 +528,7 @@ char BL_ShapeActionActuator::GetBlendin_doc[] =
"\tReturns the number of interpolation animation frames to be\n"
"\tgenerated when this actuator is triggered.\n";
-PyObject* BL_ShapeActionActuator::PyGetBlendin(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetBlendin(PyObject* self) {
PyObject *result;
result = Py_BuildValue("f", m_blendin);
@@ -561,9 +542,7 @@ char BL_ShapeActionActuator::GetPriority_doc[] =
"\tReturns the priority for this actuator. Actuators with lower\n"
"\tPriority numbers will override actuators with higher numbers.\n";
-PyObject* BL_ShapeActionActuator::PyGetPriority(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetPriority(PyObject* self) {
PyObject *result;
result = Py_BuildValue("i", m_priority);
@@ -608,8 +587,7 @@ PyObject* BL_ShapeActionActuator::PySetAction(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setStart */
@@ -630,8 +608,7 @@ PyObject* BL_ShapeActionActuator::PySetStart(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setEnd */
@@ -652,8 +629,7 @@ PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setBlendin */
@@ -675,8 +651,7 @@ PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setBlendtime */
@@ -703,8 +678,7 @@ PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setPriority */
@@ -727,8 +701,7 @@ PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setFrame */
@@ -753,8 +726,7 @@ PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* setProperty */
@@ -776,17 +748,14 @@ PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* getType */
char BL_ShapeActionActuator::GetType_doc[] =
"getType()\n"
"\tReturns the operation mode of the actuator.\n";
-PyObject* BL_ShapeActionActuator::PyGetType(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* BL_ShapeActionActuator::PyGetType(PyObject* self) {
return Py_BuildValue("h", m_playtype);
}
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h
index 434a62a1233..a9b9ad8fa86 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.h
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.h
@@ -87,15 +87,15 @@ public:
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetBlendtime);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetChannel);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetAction);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetBlendin);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetPriority);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetStart);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetEnd);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetFrame);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetProperty);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetPriority);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetStart);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetEnd);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrame);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetProperty);
// KX_PYMETHOD(BL_ActionActuator,GetChannel);
- KX_PYMETHOD_DOC(BL_ShapeActionActuator,GetType);
+ KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType);
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetType);
virtual PyObject* _getattr(const STR_String& attr);
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp
index b2e54539b19..236cd1a6667 100644
--- a/source/gameengine/Converter/BL_ShapeDeformer.cpp
+++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp
@@ -111,10 +111,7 @@ bool BL_ShapeDeformer::ExecuteShapeDrivers(void)
int type;
// the shape drivers use the bone matrix as input. Must
// update the matrix now
- Object* par_arma = m_armobj->GetArmatureObject();
m_armobj->ApplyPose();
- where_is_pose( par_arma );
- PoseApplied(true);
for (it=m_shapeDrivers.begin(); it!=m_shapeDrivers.end(); it++) {
// no need to set a specific time: this curve has a driver
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h
index 5f0188e3a42..1465bb01e22 100644
--- a/source/gameengine/Converter/BL_ShapeDeformer.h
+++ b/source/gameengine/Converter/BL_ShapeDeformer.h
@@ -43,17 +43,6 @@ struct IpoCurve;
class BL_ShapeDeformer : public BL_SkinDeformer
{
public:
- virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map)
- {
- void **h_obj = (*map)[m_gameobj];
- if (h_obj){
- m_gameobj = (BL_DeformableGameObject*)(*h_obj);
- }
- else
- m_gameobj=NULL;
- // relink the underlying skin deformer
- BL_SkinDeformer::Relink(map);
- };
BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
Object *bmeshobj,
BL_SkinMeshObject *mesh)
diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp
index f96c40c098f..d8e7a9cdadf 100644
--- a/source/gameengine/Converter/BL_SkinDeformer.cpp
+++ b/source/gameengine/Converter/BL_SkinDeformer.cpp
@@ -99,9 +99,26 @@ BL_SkinDeformer::~BL_SkinDeformer()
m_armobj->Release();
}
+void BL_SkinDeformer::Relink(GEN_Map<class GEN_HashedPtr, void*>*map)
+{
+ if (m_armobj) {
+ void **h_obj = (*map)[m_armobj];
+
+ if (h_obj)
+ SetArmature( (BL_ArmatureObject*)(*h_obj) );
+ else
+ m_armobj=NULL;
+ }
+
+ BL_MeshDeformer::Relink(map);
+}
+
bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat)
{
- size_t i, j;
+ RAS_MeshSlot::iterator it;
+ RAS_MeshMaterial *mmat;
+ RAS_MeshSlot *slot;
+ size_t i;
// update the vertex in m_transverts
Update();
@@ -110,16 +127,18 @@ bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat)
// Duplicated objects with more than one ploymaterial (=multiple mesh slot per object)
// share the same mesh (=the same cache). As the rendering is done per polymaterial
// cycling through the objects, the entire mesh cache cannot be updated in one shot.
- vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat);
+ mmat = m_pMeshObject->GetMeshMaterial(mat);
+ if(!mmat->m_slots[(void*)m_gameobj])
+ return true;
- // For each array
- for (i=0; i<vertexarrays.size(); i++) {
- KX_VertexArray& vertexarray = (*vertexarrays[i]);
+ slot = *mmat->m_slots[(void*)m_gameobj];
- // For each vertex
+ // for each array
+ for(slot->begin(it); !slot->end(it); slot->next(it)) {
+ // for each vertex
// copy the untransformed data from the original mvert
- for (j=0; j<vertexarray.size(); j++) {
- RAS_TexVert& v = vertexarray[j];
+ for(i=it.startvertex; i<it.endvertex; i++) {
+ RAS_TexVert& v = it.vertex[i];
v.SetXYZ(m_transverts[v.getOrigIndex()]);
}
}
@@ -147,14 +166,10 @@ bool BL_SkinDeformer::Update(void)
/* See if the armature has been updated for this frame */
if (PoseUpdated()){
float obmat[4][4]; // the original object matrice
-
+
/* XXX note: where_is_pose() (from BKE_armature.h) calculates all matrices needed to start deforming */
/* but it requires the blender object pointer... */
Object* par_arma = m_armobj->GetArmatureObject();
- if (!PoseApplied()){
- m_armobj->ApplyPose();
- where_is_pose( par_arma );
- }
/* store verts locally */
VerifyStorage();
@@ -163,6 +178,8 @@ bool BL_SkinDeformer::Update(void)
for (int v =0; v<m_bmesh->totvert; v++)
VECCOPY(m_transverts[v], m_bmesh->mvert[v].co);
+ m_armobj->ApplyPose();
+
// save matrix first
Mat4CpyMat4(obmat, m_objMesh->obmat);
// set reference matrix
@@ -179,11 +196,11 @@ bool BL_SkinDeformer::Update(void)
/* Update the current frame */
m_lastArmaUpdate=m_armobj->GetLastFrame();
- /* reset for next frame */
- PoseApplied(false);
+
/* indicate that the m_transverts and normals are up to date */
return true;
}
+
return false;
}
diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h
index d3fc5ae2a81..e08de8c478a 100644
--- a/source/gameengine/Converter/BL_SkinDeformer.h
+++ b/source/gameengine/Converter/BL_SkinDeformer.h
@@ -50,17 +50,7 @@ class BL_SkinDeformer : public BL_MeshDeformer
{
public:
// void SetArmatureController (BL_ArmatureController *cont);
- virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map)
- {
- if (m_armobj){
- void **h_obj = (*map)[m_armobj];
- if (h_obj){
- SetArmature( (BL_ArmatureObject*)(*h_obj) );
- }
- else
- m_armobj=NULL;
- }
- }
+ virtual void Relink(GEN_Map<class GEN_HashedPtr, void*>*map);
void SetArmature (class BL_ArmatureObject *armobj);
BL_SkinDeformer(BL_DeformableGameObject *gameobj,
@@ -81,10 +71,6 @@ public:
virtual ~BL_SkinDeformer();
bool Update (void);
bool Apply (class RAS_IPolyMaterial *polymat);
- bool PoseApplied()
- { return m_poseApplied; }
- void PoseApplied(bool applied)
- { m_poseApplied = applied; }
bool PoseUpdated(void)
{
if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()) {
diff --git a/source/gameengine/Converter/BL_SkinMeshObject.cpp b/source/gameengine/Converter/BL_SkinMeshObject.cpp
index fa215df1e1c..4f9f1a434b5 100644
--- a/source/gameengine/Converter/BL_SkinMeshObject.cpp
+++ b/source/gameengine/Converter/BL_SkinMeshObject.cpp
@@ -28,42 +28,69 @@
* Deformer that supports armature skinning
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
-#include "RAS_IPolygonMaterial.h"
-#include "BL_SkinMeshObject.h"
-#include "BL_DeformableGameObject.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_key_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
-#include "KX_GameObject.h"
+
#include "RAS_BucketManager.h"
+#include "RAS_IPolygonMaterial.h"
-//void BL_SkinMeshObject::Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec,RAS_BucketManager* bucketmgr)
-void BL_SkinMeshObject::Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec)
-{
+#include "KX_GameObject.h"
+
+#include "BL_SkinMeshObject.h"
+#include "BL_DeformableGameObject.h"
- KX_MeshSlot ms;
- ms.m_clientObj = clientobj;
- ms.m_mesh = this;
- ms.m_OpenGLMatrix = oglmatrix;
- ms.m_bObjectColor = useObjectColor;
- ms.m_RGBAcolor = rgbavec;
- ms.m_pDeformer = ((BL_DeformableGameObject*)clientobj)->m_pDeformer;
-
- for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();it++)
+BL_SkinMeshObject::BL_SkinMeshObject(Mesh* mesh, int lightlayer)
+ : RAS_MeshObject (mesh, lightlayer)
+{
+ m_bDeformed = true;
+
+ if (m_mesh && m_mesh->key)
{
+ KeyBlock *kb;
+ int count=0;
+ // initialize weight cache for shape objects
+ // count how many keys in this mesh
+ for(kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next)
+ count++;
+ m_cacheWeightIndex.resize(count,-1);
+ }
+}
- RAS_MaterialBucket* materialbucket = (*it);
+BL_SkinMeshObject::~BL_SkinMeshObject()
+{
+ if (m_mesh && m_mesh->key)
+ {
+ KeyBlock *kb;
+ // remove the weight cache to avoid memory leak
+ for(kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next) {
+ if(kb->weights)
+ MEM_freeN(kb->weights);
+ kb->weights= NULL;
+ }
+ }
+}
+
+void BL_SkinMeshObject::UpdateBuckets(void* clientobj,double* oglmatrix,bool useObjectColor,const MT_Vector4& rgbavec, bool visible, bool culled)
+{
+ list<RAS_MeshMaterial>::iterator it;
+ list<RAS_MeshSlot*>::iterator sit;
+
+ for(it = m_materials.begin();it!=m_materials.end();++it) {
+ if(!it->m_slots[clientobj])
+ continue;
-// KX_ArrayOptimizer* oa = GetArrayOptimizer(materialbucket->GetPolyMaterial());
- materialbucket->SetMeshSlot(ms);
+ RAS_MeshSlot *slot = *it->m_slots[clientobj];
+ slot->m_pDeformer = ((BL_DeformableGameObject*)clientobj)->m_pDeformer;
}
+ RAS_MeshObject::UpdateBuckets(clientobj, oglmatrix, useObjectColor, rgbavec, visible, culled);
}
static int get_def_index(Object* ob, const char* vgroup)
@@ -74,6 +101,7 @@ static int get_def_index(Object* ob, const char* vgroup)
for (curdef = (bDeformGroup*)ob->defbase.first; curdef; curdef=(bDeformGroup*)curdef->next, index++)
if (!strcmp(curdef->name, vgroup))
return index;
+
return -1;
}
diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h
index c21fb64204b..8544a2b958c 100644
--- a/source/gameengine/Converter/BL_SkinMeshObject.h
+++ b/source/gameengine/Converter/BL_SkinMeshObject.h
@@ -33,62 +33,27 @@
#ifdef WIN32
#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
#endif //WIN32
-#include "MEM_guardedalloc.h"
+
#include "RAS_MeshObject.h"
#include "RAS_Deformer.h"
#include "RAS_IPolygonMaterial.h"
#include "BL_MeshDeformer.h"
-#include "DNA_mesh_types.h"
-#include "DNA_key_types.h"
-#include "DNA_meshdata_types.h"
-
class BL_SkinMeshObject : public RAS_MeshObject
{
-
-// enum { BUCKET_MAX_INDICES = 16384};//2048};//8192};
-// enum { BUCKET_MAX_TRIANGLES = 4096};
-
protected:
vector<int> m_cacheWeightIndex;
public:
- void Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec);
-// void Bucketize(double* oglmatrix,void* clientobj,bool useObjectColor,const MT_Vector4& rgbavec,class RAS_BucketManager* bucketmgr);
-
- BL_SkinMeshObject(Mesh* mesh, int lightlayer) : RAS_MeshObject (mesh, lightlayer)
- {
- m_class = 1;
- if (m_mesh && m_mesh->key)
- {
- KeyBlock *kb;
- int count=0;
- // initialize weight cache for shape objects
- // count how many keys in this mesh
- for(kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next)
- count++;
- m_cacheWeightIndex.resize(count,-1);
- }
- };
+ BL_SkinMeshObject(Mesh* mesh, int lightlayer);
+ ~BL_SkinMeshObject();
- virtual ~BL_SkinMeshObject()
- {
- if (m_mesh && m_mesh->key)
- {
- KeyBlock *kb;
- // remove the weight cache to avoid memory leak
- for(kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next) {
- if(kb->weights)
- MEM_freeN(kb->weights);
- kb->weights= NULL;
- }
- }
- };
+ void UpdateBuckets(void* clientobj, double* oglmatrix,
+ bool useObjectColor, const MT_Vector4& rgbavec, bool visible, bool culled);
// for shape keys,
void CheckWeightCache(struct Object* obj);
-
};
#endif
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index adb7304b10e..217bdb30907 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -64,6 +64,7 @@ SET(INC
../../../source/gameengine/Network/LoopBackNetwork
../../../source/blender/misc
../../../source/blender/blenloader
+ ../../../source/blender/gpu
../../../extern/bullet2/src
../../../extern/solid
${PYTHON_INC}
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index de91bce2ab1..4734b84de54 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -184,20 +184,21 @@ bool KX_BlenderSceneConverter::TryAndLoadNewFile()
return result;
}
-
+Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String& name)
+{
+ Scene *sce;
/**
* Find the specified scene by name, or the first
* scene if nothing matches (shouldn't happen).
*/
-static struct Scene *GetSceneForName2(struct Main *maggie, const STR_String& scenename) {
- Scene *sce;
- for (sce= (Scene*) maggie->scene.first; sce; sce= (Scene*) sce->id.next)
- if (scenename == (sce->id.name+2))
+ for (sce= (Scene*) m_maggie->scene.first; sce; sce= (Scene*) sce->id.next)
+ if (name == (sce->id.name+2))
return sce;
- return (Scene*) maggie->scene.first;
+ return (Scene*)m_maggie->scene.first;
+
}
#include "KX_PythonInit.h"
@@ -258,7 +259,7 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
class RAS_ICanvas* canvas)
{
//find out which physics engine
- Scene *blenderscene = GetSceneForName2(m_maggie, scenename);
+ Scene *blenderscene = GetBlenderSceneForName(scenename);
e_PhysicsEngine physics_engine = UseBullet;
// hook for registration function during conversion.
@@ -495,7 +496,17 @@ void KX_BlenderSceneConverter::RegisterGameObject(
void KX_BlenderSceneConverter::UnregisterGameObject(
KX_GameObject *gameobject)
{
- m_map_gameobject_to_blender.remove(CHashedPtr(gameobject));
+ CHashedPtr gptr(gameobject);
+ struct Object **bobp= m_map_gameobject_to_blender[gptr];
+ if (bobp) {
+ CHashedPtr bptr(*bobp);
+ KX_GameObject **gobp= m_map_blender_to_gameobject[bptr];
+ if (gobp && *gobp == gameobject)
+ // also maintain m_map_blender_to_gameobject if the gameobject
+ // being removed is matching the blender object
+ m_map_blender_to_gameobject.remove(bptr);
+ m_map_gameobject_to_blender.remove(gptr);
+ }
}
@@ -818,7 +829,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
KX_GameObject* gameObj = (KX_GameObject*)parentList->GetValue(g);
if (gameObj->IsDynamic())
{
- KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
+ //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
Object* blenderObject = FindBlenderObject(gameObj);
if (blenderObject)
@@ -846,7 +857,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
- const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
+ //const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
const MT_Point3& position = gameObj->NodeGetWorldPosition();
Ipo* ipo = blenderObject->ipo;
@@ -974,7 +985,7 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
KX_GameObject* gameObj = (KX_GameObject*)parentList->GetValue(g);
if (gameObj->IsDynamic())
{
- KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
+ //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController();
Object* blenderObject = FindBlenderObject(gameObj);
if (blenderObject)
@@ -1002,8 +1013,8 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
- const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
- const MT_Point3& position = gameObj->NodeGetWorldPosition();
+ //const MT_Vector3& scale = gameObj->NodeGetWorldScaling();
+ //const MT_Point3& position = gameObj->NodeGetWorldPosition();
Ipo* ipo = blenderObject->ipo;
if (ipo)
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h
index e5d6ccc5caf..2317e952a0a 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.h
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h
@@ -45,6 +45,7 @@ class BL_Material;
struct IpoCurve;
struct Main;
struct SpaceIpo;
+struct Scene;
class KX_BlenderSceneConverter : public KX_ISceneConverter
{
@@ -151,6 +152,7 @@ public:
virtual void SetGLSLMaterials(bool val);
virtual bool GetGLSLMaterials();
+ struct Scene* GetBlenderSceneForName(const STR_String& name);
};
#endif //__KX_BLENDERSCENECONVERTER_H
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index f2ec01db839..3142f7652de 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -355,22 +355,26 @@ void BL_ConvertActuators(char* maggiename,
if (soundActuatorType != KX_SoundActuator::KX_SOUNDACT_NODEF)
{
- SND_SoundObject* sndobj = NULL;
+ SND_Scene* soundscene = scene->GetSoundScene();
+ STR_String samplename = "";
+ bool sampleisloaded = false;
- if (soundact->sound)
- {
- SND_Scene* soundscene = scene->GetSoundScene();
- STR_String samplename = soundact->sound->name;
+ if (soundact->sound) {
+ /* Need to convert the samplename into absolute path
+ * before checking if its loaded */
+ char fullpath[sizeof(soundact->sound->name)];
- bool sampleisloaded = false;
+ /* dont modify soundact->sound->name, only change a copy */
+ BLI_strncpy(fullpath, soundact->sound->name, sizeof(fullpath));
+ BLI_convertstringcode(fullpath, maggiename);
+ samplename = fullpath;
/* let's see if the sample was already loaded */
if (soundscene->IsSampleLoaded(samplename))
{
sampleisloaded = true;
}
- else
- {
+ else {
/* if not, make it so */
PackedFile* pf = soundact->sound->newpackedfile;
@@ -383,21 +387,33 @@ void BL_ConvertActuators(char* maggiename,
/* or else load it from disk */
else
{
- /* but we need to convert the samplename into absolute pathname first */
- BLI_convertstringcode(soundact->sound->name, maggiename);
- samplename = soundact->sound->name;
-
- /* and now we can load it */
- if (soundscene->LoadSample(samplename, NULL, 0) > -1)
+ if (soundscene->LoadSample(samplename, NULL, 0) > -1) {
sampleisloaded = true;
+ }
+ else {
+ std::cout << "WARNING: Sound actuator \"" << bact->name <<
+ "\" from object \"" << blenderobject->id.name+2 <<
+ "\" failed to load sample." << std::endl;
+ }
}
}
-
- if (sampleisloaded)
- {
- sndobj = new SND_SoundObject();
- sndobj->SetSampleName(samplename.Ptr());
- sndobj->SetObjectName(bact->name);
+ } else {
+ std::cout << "WARNING: Sound actuator \"" << bact->name <<
+ "\" from object \"" << blenderobject->id.name+2 <<
+ "\" has no sound datablock." << std::endl;
+ }
+
+ /* Note, allowing actuators for sounds that are not there was added since 2.47
+ * This is because python may expect the actuator and raise an exception if it dosnt find it
+ * better just to add a dummy sound actuator. */
+ SND_SoundObject* sndobj = NULL;
+ if (sampleisloaded)
+ {
+ /* setup the SND_SoundObject */
+ sndobj = new SND_SoundObject();
+ sndobj->SetSampleName(samplename.Ptr());
+ sndobj->SetObjectName(bact->name);
+ if (soundact->sound) {
sndobj->SetRollOffFactor(soundact->sound->attenuation);
sndobj->SetGain(soundact->sound->volume);
sndobj->SetPitch(exp((soundact->sound->pitch / 12.0) * log(2.0)));
@@ -410,8 +426,9 @@ void BL_ConvertActuators(char* maggiename,
else
sndobj->SetLoopMode(SND_LOOP_NORMAL);
}
- else
+ else {
sndobj->SetLoopMode(SND_LOOP_OFF);
+ }
if (soundact->sound->flags & SOUND_FLAGS_PRIORITY)
sndobj->SetHighPriority(true);
@@ -422,22 +439,30 @@ void BL_ConvertActuators(char* maggiename,
sndobj->Set3D(true);
else
sndobj->Set3D(false);
-
- KX_SoundActuator* tmpsoundact =
- new KX_SoundActuator(gameobj,
- sndobj,
- scene->GetSoundScene(), // needed for replication!
- soundActuatorType,
- startFrame,
- stopFrame);
-
- tmpsoundact->SetName(bact->name);
- baseact = tmpsoundact;
- soundscene->AddObject(sndobj);
- } else {
- std::cout << "WARNING: Sound actuator " << bact->name << " failed to load sample." << std::endl;
+ }
+ else {
+ /* dummy values for a NULL sound
+ * see editsound.c - defaults are unlikely to change soon */
+ sndobj->SetRollOffFactor(1.0);
+ sndobj->SetGain(1.0);
+ sndobj->SetPitch(1.0);
+ sndobj->SetLoopMode(SND_LOOP_OFF);
+ sndobj->SetHighPriority(false);
+ sndobj->Set3D(false);
}
}
+ KX_SoundActuator* tmpsoundact =
+ new KX_SoundActuator(gameobj,
+ sndobj,
+ scene->GetSoundScene(), // needed for replication!
+ soundActuatorType,
+ startFrame,
+ stopFrame);
+
+ tmpsoundact->SetName(bact->name);
+ baseact = tmpsoundact;
+ if (sndobj)
+ soundscene->AddObject(sndobj);
}
break;
}
@@ -540,13 +565,26 @@ void BL_ConvertActuators(char* maggiename,
// does the 'original' for replication exists, and
// is it in a non-active layer ?
SCA_IObject* originalval = NULL;
- if (editobact->ob && !(editobact->ob->lay & activeLayerBitInfo))
- originalval = converter->FindGameObject(editobact->ob);
-
- MT_Vector3 linvelvec ( KX_BLENDERTRUNC(editobact->linVelocity[0]),
+ if (editobact->ob)
+ {
+ if (editobact->ob->lay & activeLayerBitInfo)
+ {
+ fprintf(stderr, "Warning, object \"%s\" from AddObject actuator \"%s\" is not in a hidden layer.\n", objectname.Ptr(), uniquename.Ptr());
+ }
+ else {
+ originalval = converter->FindGameObject(editobact->ob);
+ }
+ }
+ MT_Vector3 linvelvec (
+ KX_BLENDERTRUNC(editobact->linVelocity[0]),
KX_BLENDERTRUNC(editobact->linVelocity[1]),
KX_BLENDERTRUNC(editobact->linVelocity[2]));
-
+
+ MT_Vector3 angvelvec (
+ KX_BLENDERTRUNC(editobact->angVelocity[0]),
+ KX_BLENDERTRUNC(editobact->angVelocity[1]),
+ KX_BLENDERTRUNC(editobact->angVelocity[2]));
+
KX_SCA_AddObjectActuator* tmpaddact =
new KX_SCA_AddObjectActuator(
gameobj,
@@ -554,7 +592,9 @@ void BL_ConvertActuators(char* maggiename,
editobact->time,
scene,
linvelvec.getValue(),
- editobact->localflag!=0
+ (editobact->localflag & ACT_EDOB_LOCAL_LINV)!=0,
+ angvelvec.getValue(),
+ (editobact->localflag & ACT_EDOB_LOCAL_ANGV)!=0
);
//editobact->ob to gameobj
@@ -658,18 +698,18 @@ void BL_ConvertActuators(char* maggiename,
min = conact->minloc[2];
max = conact->maxloc[2];
break;
- case ACT_CONST_DIRMX:
- locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMX;
+ case ACT_CONST_DIRNX:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX;
min = conact->minloc[0];
max = conact->maxloc[0];
break;
- case ACT_CONST_DIRMY:
- locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMY;
+ case ACT_CONST_DIRNY:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY;
min = conact->minloc[1];
max = conact->maxloc[1];
break;
- case ACT_CONST_DIRMZ:
- locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRMZ;
+ case ACT_CONST_DIRNZ:
+ locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNZ;
min = conact->minloc[2];
max = conact->maxloc[2];
break;
@@ -922,10 +962,9 @@ void BL_ConvertActuators(char* maggiename,
bVisibilityActuator *vis_act = (bVisibilityActuator *) bact->data;
KX_VisibilityActuator * tmp_vis_act = NULL;
bool v = ((vis_act->flag & ACT_VISIBILITY_INVISIBLE) != 0);
+ bool recursive = ((vis_act->flag & ACT_VISIBILITY_RECURSIVE) != 0);
- tmp_vis_act =
- new KX_VisibilityActuator(gameobj,
- !v);
+ tmp_vis_act = new KX_VisibilityActuator(gameobj, !v, recursive);
baseact = tmp_vis_act;
}
@@ -1024,7 +1063,7 @@ void BL_ConvertActuators(char* maggiename,
{
bParentActuator *parAct = (bParentActuator *) bact->data;
int mode = KX_ParentActuator::KX_PARENT_NODEF;
- KX_GameObject *tmpgob;
+ KX_GameObject *tmpgob = NULL;
switch(parAct->type)
{
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index 7c9df688d45..f16855955ff 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -65,6 +65,7 @@ probably misplaced */
#include "SCA_JoystickSensor.h"
#include "KX_NetworkMessageSensor.h"
#include "SCA_ActuatorSensor.h"
+#include "SCA_DelaySensor.h"
#include "SCA_PropertySensor.h"
@@ -281,6 +282,22 @@ void BL_ConvertSensors(struct Object* blenderobject,
break;
}
+ case SENS_DELAY:
+ {
+ // we can reuse the Always event manager for the delay sensor
+ SCA_EventManager* eventmgr = logicmgr->FindEventManager(SCA_EventManager::ALWAYS_EVENTMGR);
+ if (eventmgr)
+ {
+ bDelaySensor* delaysensor = (bDelaySensor*)sens->data;
+ gamesensor = new SCA_DelaySensor(eventmgr,
+ gameobj,
+ delaysensor->delay,
+ delaysensor->duration,
+ (delaysensor->flag & SENS_DELAY_REPEAT) != 0);
+ }
+ break;
+ }
+
case SENS_COLLISION:
{
SCA_EventManager* eventmgr = logicmgr->FindEventManager(SCA_EventManager::TOUCH_EVENTMGR);
@@ -616,6 +633,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
if (eventmgr)
{
bool bFindMaterial = (blenderraysensor->mode & SENS_COLLISION_MATERIAL);
+ bool bXRay = (blenderraysensor->mode & SENS_RAY_XRAY);
STR_String checkname = (bFindMaterial? blenderraysensor->matname : blenderraysensor->propname);
@@ -628,6 +646,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
gameobj,
checkname,
bFindMaterial,
+ bXRay,
distance,
axis,
kxscene);
@@ -694,6 +713,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
gamesensor = new SCA_JoystickSensor(
eventmgr,
gameobj,
+ bjoy->joyindex,
joysticktype,
axis,axisf,
prec,
@@ -733,20 +753,41 @@ void BL_ConvertSensors(struct Object* blenderobject,
gameobj->AddSensor(gamesensor);
// only register to manager if it's in an active layer
-
- if (isInActiveLayer)
- gamesensor->RegisterToManager();
+ // Make registration dynamic: only when sensor is activated
+ //if (isInActiveLayer)
+ // gamesensor->RegisterToManager();
for (int i=0;i<sens->totlinks;i++)
{
bController* linkedcont = (bController*) sens->links[i];
- SCA_IController* gamecont = converter->FindGameController(linkedcont);
+ if (linkedcont) {
+ SCA_IController* gamecont = converter->FindGameController(linkedcont);
- if (gamecont) {
- logicmgr->RegisterToSensor(gamecont,gamesensor);
+ if (gamecont) {
+ logicmgr->RegisterToSensor(gamecont,gamesensor);
+ } else {
+ printf(
+ "Warning, sensor \"%s\" could not find its controller "
+ "(link %d of %d) from object \"%s\"\n"
+ "\tthere has been an error converting the blender controller for the game engine,"
+ "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
+ }
+ } else {
+ printf(
+ "Warning, sensor \"%s\" has lost a link to a controller "
+ "(link %d of %d) from object \"%s\"\n"
+ "\tpossible causes are partially appended objects or an error reading the file,"
+ "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
}
}
+ // special case: Keyboard sensor with no link
+ // this combination is usually used for key logging.
+ if (sens->type == SENS_KEYBOARD && sens->totlinks == 0) {
+ // Force the registration so that the sensor runs
+ gamesensor->IncLink();
+ }
+
// done with gamesensor
gamesensor->Release();
diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp
index 75ca59d01e7..ce004fa0504 100644
--- a/source/gameengine/Converter/KX_IpoConvert.cpp
+++ b/source/gameengine/Converter/KX_IpoConvert.cpp
@@ -36,6 +36,7 @@
#pragma warning (disable:4786)
#endif
+#include "BKE_material.h" /* give_current_material */
#include "KX_GameObject.h"
#include "KX_IpoConvert.h"
@@ -68,6 +69,8 @@
#include "SG_Node.h"
+#include "STR_HashedString.h"
+
static BL_InterpolatorList *GetIpoList(struct Ipo *for_ipo, KX_BlenderSceneConverter *converter) {
BL_InterpolatorList *ipoList= converter->FindInterpolatorList(for_ipo);
@@ -560,16 +563,15 @@ void BL_ConvertWorldIpos(struct World* blenderworld,KX_BlenderSceneConverter *co
}
}
-
-void BL_ConvertMaterialIpos(
- Material* blendermaterial,
+static void ConvertMaterialIpos(
+ Material* blendermaterial,
+ dword matname_hash,
KX_GameObject* gameobj,
KX_BlenderSceneConverter *converter
)
{
if (blendermaterial->ipo) {
-
- KX_MaterialIpoController* ipocontr = new KX_MaterialIpoController();
+ KX_MaterialIpoController* ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
@@ -596,7 +598,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_COL_R);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -610,7 +612,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_COL_G);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -624,7 +626,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_COL_B);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -638,7 +640,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_ALPHA);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -653,7 +655,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_SPEC_R );
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -667,7 +669,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_SPEC_G);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -681,7 +683,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_SPEC_B);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -696,7 +698,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_HARD);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -710,7 +712,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_SPEC);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -725,7 +727,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_REF);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -739,7 +741,7 @@ void BL_ConvertMaterialIpos(
ipo = ipoList->GetScalarInterpolator(MA_EMIT);
if (ipo) {
if (!ipocontr) {
- ipocontr = new KX_MaterialIpoController();
+ ipocontr = new KX_MaterialIpoController(matname_hash);
gameobj->GetSGNode()->AddSGController(ipocontr);
ipocontr->SetObject(gameobj->GetSGNode());
}
@@ -752,3 +754,31 @@ void BL_ConvertMaterialIpos(
}
}
+void BL_ConvertMaterialIpos(
+ struct Object* blenderobject,
+ KX_GameObject* gameobj,
+ KX_BlenderSceneConverter *converter
+ )
+{
+ if (blenderobject->totcol==1)
+ {
+ Material *mat = give_current_material(blenderobject, 1);
+ // if there is only one material attached to the mesh then set material_index in BL_ConvertMaterialIpos to NULL
+ // --> this makes the UpdateMaterialData function in KX_GameObject.cpp use the old hack of using SetObjectColor
+ // because this yields a better performance as not all the vertex colors need to be edited
+ if(mat) ConvertMaterialIpos(mat, 0, gameobj, converter);
+ }
+ else
+ {
+ for (int material_index=1; material_index <= blenderobject->totcol; material_index++)
+ {
+ Material *mat = give_current_material(blenderobject, material_index);
+ STR_HashedString matname;
+ if(mat) {
+ matname= mat->id.name;
+ ConvertMaterialIpos(mat, matname.hash(), gameobj, converter);
+ }
+ }
+ }
+}
+
diff --git a/source/gameengine/Converter/KX_IpoConvert.h b/source/gameengine/Converter/KX_IpoConvert.h
index afcb1b22821..4ec9bd31062 100644
--- a/source/gameengine/Converter/KX_IpoConvert.h
+++ b/source/gameengine/Converter/KX_IpoConvert.h
@@ -46,7 +46,7 @@ void BL_ConvertCameraIpos(struct Camera* blendercamera,
class KX_GameObject* cameraobj,
class KX_BlenderSceneConverter *converter);
-void BL_ConvertMaterialIpos(struct Material* blendermaterial,
+void BL_ConvertMaterialIpos(struct Object* blenderobject,
class KX_GameObject* materialobj,
class KX_BlenderSceneConverter *converter);
diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile
index f312fc13221..4dd63e428bd 100644
--- a/source/gameengine/Converter/Makefile
+++ b/source/gameengine/Converter/Makefile
@@ -51,6 +51,7 @@ CPPFLAGS += -I../../blender/include
CPPFLAGS += -I../../blender/blenlib
CPPFLAGS += -I../../blender/blenkernel
CPPFLAGS += -I../../blender/render/extern/include
+CPPFLAGS += -I../../blender/gpu
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../Expressions -I../Rasterizer -I../GameLogic
CPPFLAGS += -I../Ketsji -I../BlenderRoutines -I../SceneGraph
diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript
index f5e382b471e..3be352c568b 100644
--- a/source/gameengine/Converter/SConscript
+++ b/source/gameengine/Converter/SConscript
@@ -16,7 +16,7 @@ incs += ' #source/gameengine/Expressions #source/gameengine/Network #source/game
incs += ' #source/gameengine/Physics/common #source/gameengine/Physics/Bullet #source/gameengine/Physics/BlOde'
incs += ' #source/gameengine/Physics/Dummy #source/gameengine/Physics/Sumo'
incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
-incs += ' #source/blender/misc #source/blender/blenloader'
+incs += ' #source/blender/misc #source/blender/blenloader #source/blender/gpu'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_SOLID_INC']
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp
index 24033dd21a2..32a9de32e21 100644
--- a/source/gameengine/Expressions/InputParser.cpp
+++ b/source/gameengine/Expressions/InputParser.cpp
@@ -631,7 +631,8 @@ void CParser::SetContext(CValue* context)
PyObject* CParserPyMake(PyObject* ignored,PyObject* args)
{
char* txt;
- Py_Try(PyArg_ParseTuple(args,"s",&txt));
+ if (!PyArg_ParseTuple(args,"s",&txt))
+ return NULL;
CParser parser;
CExpression* expr = parser.ProcessText(txt);
CValue* val = expr->Calculate();
@@ -641,7 +642,7 @@ PyObject* CParserPyMake(PyObject* ignored,PyObject* args)
static PyMethodDef CParserMethods[] =
{
- { "calc", CParserPyMake , Py_NEWARGS},
+ { "calc", CParserPyMake , METH_VARARGS},
{ NULL,NULL} // Sentinel
};
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index bbf58a8a06e..9ffdbb1223c 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -43,7 +43,7 @@ PyObject* listvalue_buffer_item(PyObject* list,Py_ssize_t index)
return ((CListValue*) list)->GetValue(index)->AddRef();
}
- Py_Error(PyExc_IndexError, "Python ListIndex out of range");
+ PyErr_SetString(PyExc_IndexError, "Python ListIndex out of range");
return NULL;
}
@@ -130,9 +130,10 @@ listvalue_buffer_concat(PyObject * self, PyObject * other)
}
}
- if (error)
- Py_Error(PyExc_SystemError, "Python Error: couldn't add one or more items to a list");
-
+ if (error) {
+ PyErr_SetString(PyExc_SystemError, "Python Error: couldn't add one or more items to a list");
+ return NULL;
+ }
} else
{
@@ -155,8 +156,8 @@ listvalue_buffer_concat(PyObject * self, PyObject * other)
listval->Add(objval);
} else
{
- Py_Error(PyExc_SystemError, "Python Error: couldn't add item to a list");
- // bad luck
+ PyErr_SetString(PyExc_SystemError, "Python Error: couldn't add item to a list");
+ return NULL;
}
}
}
diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile
index e9c02eedcf2..6736149bbcd 100644
--- a/source/gameengine/Expressions/Makefile
+++ b/source/gameengine/Expressions/Makefile
@@ -36,6 +36,7 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
+CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index aabcd6cb71d..1eca527151a 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -94,7 +94,7 @@ PyObjectPlus::PyObjectPlus(PyTypeObject *T) // constructor
* PyObjectPlus Methods -- Every class, even the abstract one should have a Methods
------------------------------*/
PyMethodDef PyObjectPlus::Methods[] = {
- {"isA", (PyCFunction) sPy_isA, Py_NEWARGS},
+ {"isA", (PyCFunction) sPy_isA, METH_VARARGS},
{NULL, NULL} /* Sentinel */
};
@@ -119,6 +119,7 @@ PyObject *PyObjectPlus::_getattr(const STR_String& attr)
int PyObjectPlus::_delattr(const STR_String& attr)
{
+ PyErr_SetString(PyExc_AttributeError, "attribute cant be deleted");
return 1;
}
@@ -126,7 +127,8 @@ int PyObjectPlus::_setattr(const STR_String& attr, PyObject *value)
{
//return PyObject::_setattr(attr,value);
//cerr << "Unknown attribute" << endl;
- return 1;
+ PyErr_SetString(PyExc_AttributeError, "attribute cant be set");
+ return 1;
}
/*------------------------------
@@ -134,7 +136,8 @@ int PyObjectPlus::_setattr(const STR_String& attr, PyObject *value)
------------------------------*/
PyObject *PyObjectPlus::_repr(void)
{
- Py_Error(PyExc_SystemError, "Representation not overridden by object.");
+ PyErr_SetString(PyExc_SystemError, "Representation not overridden by object.");
+ return NULL;
}
/*------------------------------
@@ -164,11 +167,12 @@ bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent
PyObject *PyObjectPlus::Py_isA(PyObject *args) // Python wrapper for isA
{
char *mytypename;
- Py_Try(PyArg_ParseTuple(args, "s", &mytypename));
+ if (!PyArg_ParseTuple(args, "s", &mytypename))
+ return NULL;
if(isA(mytypename))
- {Py_INCREF(Py_True); return Py_True;}
+ Py_RETURN_TRUE;
else
- {Py_INCREF(Py_False); return Py_False;};
+ Py_RETURN_FALSE;
}
#endif //NO_EXP_PYTHON_EMBEDDING
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 2bcb604dd23..ccc9af2ed79 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -43,23 +43,35 @@
* Python defines
------------------------------*/
+/*
+ Py_RETURN_NONE
+ Python 2.4 macro.
+ defined here until we switch to 2.4
+ also in api2_2x/gen_utils.h
+*/
+#ifndef Py_RETURN_NONE
+#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
+#endif
+#ifndef Py_RETURN_FALSE
+#define Py_RETURN_FALSE return PyBool_FromLong(0)
+#endif
+#ifndef Py_RETURN_TRUE
+#define Py_RETURN_TRUE return PyBool_FromLong(1)
+#endif
+
+/* for pre Py 2.5 */
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#else
+/* Py 2.5 and later */
+#define intargfunc ssizeargfunc
+#define intintargfunc ssizessizeargfunc
+#endif
+
// some basic python macros
-#define Py_NEWARGS 1
#define Py_Return { Py_INCREF(Py_None); return Py_None;}
-static inline PyObject* Py_Success(bool truth)
-{
- if (truth)
- {
- Py_INCREF(Py_True);
- return Py_True;
- }
- Py_INCREF(Py_False);
- return Py_False;
-}
-
-#define Py_Error(E, M) {PyErr_SetString(E, M); return NULL;}
-#define Py_Try(F) {if (!(F)) return NULL;}
-#define Py_Assert(A,E,M) {if (!(A)) {PyErr_SetString(E, M); return NULL;}}
static inline void Py_Fatal(char *M) {
//cout << M << endl;
@@ -117,6 +129,12 @@ static inline void Py_Fatal(char *M) {
return ((class_name*) self)->Py##method_name(self, args, kwds); \
}; \
+#define KX_PYMETHOD_VARARGS(class_name, method_name) \
+ PyObject* Py##method_name(PyObject* self, PyObject* args); \
+ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \
+ return ((class_name*) self)->Py##method_name(self, args); \
+ }; \
+
#define KX_PYMETHOD_NOARGS(class_name, method_name) \
PyObject* Py##method_name(PyObject* self); \
static PyObject* sPy##method_name( PyObject* self) { \
@@ -136,6 +154,13 @@ static inline void Py_Fatal(char *M) {
}; \
static char method_name##_doc[]; \
+#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
+ PyObject* Py##method_name(PyObject* self, PyObject* args); \
+ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \
+ return ((class_name*) self)->Py##method_name(self, args); \
+ }; \
+ static char method_name##_doc[]; \
+
#define KX_PYMETHOD_DOC_O(class_name, method_name) \
PyObject* Py##method_name(PyObject* self, PyObject* value); \
static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \
@@ -158,6 +183,9 @@ static inline void Py_Fatal(char *M) {
#define KX_PYMETHODTABLE(class_name, method_name) \
{#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, class_name::method_name##_doc}
+#define KX_PYMETHODTABLE_NOARG(class_name, method_name) \
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, class_name::method_name##_doc}
+
/**
* Function implementation macro
*/
@@ -165,6 +193,9 @@ static inline void Py_Fatal(char *M) {
char class_name::method_name##_doc[] = doc_string; \
PyObject* class_name::Py##method_name(PyObject*, PyObject* args, PyObject*)
+#define KX_PYMETHODDEF_DOC_NOARG(class_name, method_name, doc_string) \
+char class_name::method_name##_doc[] = doc_string; \
+PyObject* class_name::Py##method_name(PyObject*)
/*------------------------------
* PyObjectPlus
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp
index 48136eb9dc3..7296dfbec10 100644
--- a/source/gameengine/Expressions/Value.cpp
+++ b/source/gameengine/Expressions/Value.cpp
@@ -158,15 +158,14 @@ PyParentObject CValue::Parents[] = {
};
PyMethodDef CValue::Methods[] = {
-// { "printHello", (PyCFunction) CValue::sPyPrintHello, Py_NEWARGS},
- { "getName", (PyCFunction) CValue::sPyGetName, Py_NEWARGS},
+// { "printHello", (PyCFunction) CValue::sPyPrintHello, METH_VARARGS},
+ { "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS},
{NULL,NULL} //Sentinel
};
-PyObject* CValue::PyGetName(PyObject* self,PyObject* args,PyObject* kwds)
+PyObject* CValue::PyGetName(PyObject* self)
{
- PyObject* pyname = PyString_FromString(this->GetName());
- return pyname;
+ return PyString_FromString(this->GetName());
}
/*#define CVALUE_DEBUG*/
@@ -392,16 +391,23 @@ float CValue::GetPropertyNumber(const STR_String& inName,float defnumber)
bool CValue::RemoveProperty(const STR_String & inName)
{
// Check if there are properties at all which can be removed
- if (m_pNamedPropertyArray == NULL)
- return false;
-
- CValue* val = GetProperty(inName);
- if (NULL != val)
- {
- val->Release();
- m_pNamedPropertyArray->erase(inName);
- return true;
- }
+ if (m_pNamedPropertyArray) {
+ CValue* val = GetProperty(inName);
+ if (NULL != val)
+ {
+ val->Release();
+ m_pNamedPropertyArray->erase(inName);
+ return true;
+ }
+ }
+
+ char err[128];
+ if (m_pNamedPropertyArray)
+ sprintf(err, "attribute \"%s\" dosnt exist", inName.ReadPtr());
+ else
+ sprintf(err, "attribute \"%s\" dosnt exist (no property array)", inName.ReadPtr());
+
+ PyErr_SetString(PyExc_AttributeError, err);
return false;
}
@@ -662,7 +668,7 @@ CValue* CValue::FindIdentifier(const STR_String& identifiername)
static PyMethodDef CValueMethods[] =
{
- //{ "new", CValue::PyMake , Py_NEWARGS},
+ //{ "new", CValue::PyMake , METH_VARARGS},
{ NULL,NULL} // Sentinel
};
@@ -700,9 +706,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj)
CValue* vallie = NULL;
- PyTypeObject* type = pyobj->ob_type;
-
- if (type == &PyList_Type)
+ if (PyList_Check(pyobj))
{
CListValue* listval = new CListValue();
bool error = false;
@@ -732,26 +736,25 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj)
}
} else
- if (type == &PyFloat_Type)
+ if (PyFloat_Check(pyobj))
{
- float fl;
- PyArg_Parse(pyobj,"f",&fl);
- vallie = new CFloatValue(fl);
+ vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) );
} else
- if (type==&PyInt_Type)
+ if (PyInt_Check(pyobj))
{
- int innie;
- PyArg_Parse(pyobj,"i",&innie);
- vallie = new CIntValue(innie);
+ vallie = new CIntValue( (int)PyInt_AS_LONG(pyobj) );
} else
-
- if (type==&PyString_Type)
+ if (PyString_Check(pyobj))
{
vallie = new CStringValue(PyString_AsString(pyobj),"");
} else
- if (type==&CValue::Type || type==&CListValue::Type)
+ if (pyobj->ob_type==&CValue::Type || pyobj->ob_type==&CListValue::Type)
{
vallie = ((CValue*) pyobj)->AddRef();
+ } else
+ {
+ /* return an error value from the caller */
+ PyErr_SetString(PyExc_TypeError, "This python value could not be assigned to a game engine property");
}
return vallie;
@@ -759,7 +762,8 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj)
int CValue::_delattr(const STR_String& attr)
{
- RemoveProperty(attr);
+ if (!RemoveProperty(attr)) /* sets error */
+ return 1;
return 0;
}
@@ -778,6 +782,9 @@ int CValue::_setattr(const STR_String& attr,PyObject* pyobj)
SetProperty(attr,vallie);
}
vallie->Release();
+ } else
+ {
+ return 1; /* ConvertPythonToValue sets the error message */
}
//PyObjectPlus::_setattr(attr,value);
@@ -806,9 +813,8 @@ PyObject* CValue::ConvertKeysToPython( void )
PyObject* CValue::PyMake(PyObject* ignored,PyObject* args)
{
- //Py_Try(PyArg_ParseTuple(args,"s",&name));
- Py_INCREF(Py_None);
- return Py_None;//new CValue();
+ //if (!PyArg_ParseTuple(args,"s",&name)) return NULL;
+ Py_RETURN_NONE;//new CValue();
}
*/
diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h
index bcf231cf4f0..74fcdae5756 100644
--- a/source/gameengine/Expressions/Value.h
+++ b/source/gameengine/Expressions/Value.h
@@ -255,7 +255,7 @@ public:
virtual PyObject* ConvertKeysToPython( void );
- KX_PYMETHOD(CValue,GetName);
+ KX_PYMETHOD_NOARGS(CValue,GetName);
#else
CValue();
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
index 18d7b6ffcd0..06002060bf1 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
@@ -29,9 +29,9 @@
#include "SCA_Joystick.h"
#include "SCA_JoystickPrivate.h"
-
-SCA_Joystick::SCA_Joystick()
+SCA_Joystick::SCA_Joystick(short int index)
:
+ m_joyindex(index),
m_axis10(0),
m_axis11(0),
m_axis20(0),
@@ -52,82 +52,53 @@ SCA_Joystick::~SCA_Joystick()
delete m_private;
}
-SCA_Joystick *SCA_Joystick::m_instance = NULL;
+SCA_Joystick *SCA_Joystick::m_instance[JOYINDEX_MAX];
int SCA_Joystick::m_refCount = 0;
-SCA_Joystick *SCA_Joystick::GetInstance()
+SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex )
{
- if (m_instance == 0)
+ if (joyindex < 0 || joyindex >= JOYINDEX_MAX) {
+ echo("Error-invalid joystick index: " << joyindex);
+ return NULL;
+ }
+
+ if (m_refCount == 0)
{
- m_instance = new SCA_Joystick();
- m_instance->CreateJoystickDevice();
+ int i;
+ // do this once only
+ if(SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO ) == -1 ){
+ echo("Error-Initializing-SDL: " << SDL_GetError());
+ return NULL;
+ }
+ for (i=0; i<JOYINDEX_MAX; i++) {
+ m_instance[i] = new SCA_Joystick(i);
+ m_instance[i]->CreateJoystickDevice();
+ }
m_refCount = 1;
}
else
{
m_refCount++;
}
- return m_instance;
+ return m_instance[joyindex];
}
void SCA_Joystick::ReleaseInstance()
{
if (--m_refCount == 0)
{
- DestroyJoystickDevice();
- delete m_instance;
- m_instance = NULL;
- }
-}
-
-
-bool SCA_Joystick::CreateJoystickDevice()
-{
- bool init = false;
- init = pCreateJoystickDevice();
- return init;
-}
-
-
-void SCA_Joystick::DestroyJoystickDevice()
-{
- if(m_isinit)
- pDestroyJoystickDevice();
-}
-
-
-void SCA_Joystick::HandleEvents()
-{
- if(m_isinit)
- {
- if(SDL_PollEvent(&m_private->m_event))
- {
- switch(m_private->m_event.type)
- {
- case SDL_JOYAXISMOTION:
- HANDLE_AXISMOTION(OnAxisMotion);
- break;
- case SDL_JOYHATMOTION:
- HANDLE_HATMOTION(OnHatMotion);
- break;
- case SDL_JOYBUTTONUP:
- HANDLE_BUTTONUP(OnButtonUp);
- break;
- case SDL_JOYBUTTONDOWN:
- HANDLE_BUTTONDOWN(OnButtonDown);
- break;
- case SDL_JOYBALLMOTION:
- HANDLE_BALLMOTION(OnBallMotion);
- break;
- default:
- HANDLE_NOEVENT(OnNothing);
- break;
+ int i;
+ for (i=0; i<JOYINDEX_MAX; i++) {
+ if (m_instance[i]) {
+ m_instance[i]->DestroyJoystickDevice();
+ delete m_instance[i];
}
+ m_instance[i]= NULL;
}
+ SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO );
}
}
-
void SCA_Joystick::cSetPrecision(int val)
{
m_prec = val;
@@ -226,76 +197,6 @@ int SCA_Joystick::pGetHat(int direction)
return 0;
}
-
-bool SCA_Joystick::GetJoyAxisMotion()
-{
- bool result = false;
- if(m_isinit){
- if(SDL_PollEvent(&m_private->m_event)){
- switch(m_private->m_event.type)
- {
- case SDL_JOYAXISMOTION:
- result = true;
- break;
- }
- }
- }
- return result;
-}
-
-
-bool SCA_Joystick::GetJoyButtonPress()
-{
- bool result = false;
- if(m_isinit){
- if(SDL_PollEvent(&m_private->m_event)){
- switch(m_private->m_event.type)
- {
- case SDL_JOYBUTTONDOWN:
- result = true;
- break;
- }
- }
- }
- return result;
-}
-
-
-bool SCA_Joystick::GetJoyButtonRelease()
-{
- bool result = false;
- if(m_isinit)
- {
- if(SDL_PollEvent(&m_private->m_event)){
- switch(m_private->m_event.type)
- {
- case SDL_JOYBUTTONUP:
- result = true;
- break;
- }
- }
- }
- return result;
-}
-
-
-bool SCA_Joystick::GetJoyHatMotion()
-{
- bool result = false;
- if(m_isinit){
- if(SDL_PollEvent(&m_private->m_event)){
- switch(m_private->m_event.type)
- {
- case SDL_JOYHATMOTION:
- result = true;
- break;
- }
- }
- }
- return 0;
-}
-
-
int SCA_Joystick::GetNumberOfAxes()
{
int number;
@@ -334,42 +235,46 @@ int SCA_Joystick::GetNumberOfHats()
return -1;
}
-bool SCA_Joystick::pCreateJoystickDevice()
+bool SCA_Joystick::CreateJoystickDevice(void)
{
if(m_isinit == false){
- if(SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO ) == -1 ){
- echo("Error-Initializing-SDL: " << SDL_GetError());
- return false;
- }
- if(SDL_NumJoysticks() > 0){
- for(int i=0; i<SDL_NumJoysticks();i++){
- m_private->m_joystick = SDL_JoystickOpen(i);
- SDL_JoystickEventState(SDL_ENABLE);
- m_numjoys = i;
- }
- echo("Joystick-initialized");
- m_isinit = true;
- return true;
- }else{
- echo("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)");
+ if (m_joyindex>=SDL_NumJoysticks()) {
+ // don't print a message, because this is done anyway
+ //echo("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)");
return false;
}
+
+ m_private->m_joystick = SDL_JoystickOpen(m_joyindex);
+ SDL_JoystickEventState(SDL_ENABLE);
+
+ echo("Joystick " << m_joyindex << " initialized");
+ m_isinit = true;
}
- return false;
+ return true;
}
-void SCA_Joystick::pDestroyJoystickDevice()
+void SCA_Joystick::DestroyJoystickDevice(void)
{
- echo("Closing-");
- for(int i=0; i<SDL_NumJoysticks(); i++){
- if(SDL_JoystickOpened(i)){
+ if (m_isinit){
+ if(SDL_JoystickOpened(m_joyindex)){
+ echo("Closing-joystick " << m_joyindex);
SDL_JoystickClose(m_private->m_joystick);
}
+ m_isinit = false;
}
- SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO );
}
+int SCA_Joystick::Connected(void)
+{
+ if (m_isinit){
+ if(SDL_JoystickOpened(m_joyindex)){
+ return 1;
+ }
+ }
+
+ return 0;
+}
void SCA_Joystick::pFillAxes()
{
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
index 1e853070b09..bcbb43241c2 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
@@ -1,72 +1,37 @@
/**
-
* ***** BEGIN GPL LICENSE BLOCK *****
-
*
-
* This program is free software; you can redistribute it and/or
-
* modify it under the terms of the GNU General Public License
-
* as published by the Free Software Foundation; either version 2
-
* of the License, or (at your option) any later version.
-
-
-
-
*
-
* This program is distributed in the hope that it will be useful,
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
* GNU General Public License for more details.
-
*
-
* You should have received a copy of the GNU General Public License
-
* along with this program; if not, write to the Free Software Foundation,
-
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
*
-
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-
* All rights reserved.
-
*
-
* The Original Code is: all of this file.
-
*
-
* Contributor(s): snailrose.
-
*
-
* ***** END GPL LICENSE BLOCK *****
-
*/
#ifndef _SCA_JOYSTICK_H_
-
#define _SCA_JOYSTICK_H_
-
-
#include "SCA_JoystickDefines.h"
-
-
-
-
+#include "SDL.h"
/*
-
* Basic Joystick class
* I will make this class a singleton because there should be only one joystick
* even if there are more than one scene using it and count how many scene are using it.
@@ -76,7 +41,7 @@
class SCA_Joystick
{
- static SCA_Joystick *m_instance;
+ static SCA_Joystick *m_instance[JOYINDEX_MAX];
static int m_refCount;
class PrivateData;
@@ -85,226 +50,135 @@ class SCA_Joystick
int m_joyindex;
- /*!
-
- * the number of avail joysticks
-
- */
-
- int m_numjoys;
-
/*
-
*support for 2 axes
-
*/
int m_axis10,m_axis11;
-
int m_axis20,m_axis21;
- /*
-
+ /*
* Precision or range of the axes
-
*/
-
int m_prec;
/*
-
* multiple axis values stored here
-
*/
-
int m_axisnum;
-
int m_axisvalue;
/*
-
* max # of axes avail
-
*/
-
/*disabled
-
int m_axismax;
-
*/
/*
-
* button values stored here
-
*/
-
int m_buttonnum;
/*
-
* max # of buttons avail
-
*/
int m_buttonmax;
-
/*
-
* hat values stored here
-
*/
-
int m_hatnum;
-
int m_hatdir;
/*
* max # of hats avail
-
disabled
-
int m_hatmax;
-
*/
-
/* is the joystick initialized ?*/
-
bool m_isinit;
-
/* is triggered */
-
bool m_istrig;
/*
-
- * Open the joystick
-
+ * event callbacks
*/
-
- bool pCreateJoystickDevice(void);
+ void OnAxisMotion(SDL_Event *sdl_event);
+ void OnHatMotion(SDL_Event *sdl_event);
+ void OnButtonUp(SDL_Event *sdl_event);
+ void OnButtonDown(SDL_Event *sdl_event);
+ void OnNothing(SDL_Event *sdl_event);
+ void OnBallMotion(SDL_Event *sdl_event){}
/*
-
- * Close the joystick
-
+ * Open the joystick
*/
-
- void pDestroyJoystickDevice(void);
-
-
+ bool CreateJoystickDevice(void);
/*
-
- * event callbacks
-
+ * Close the joystick
*/
-
- void OnAxisMotion(void);
-
- void OnHatMotion(void);
-
- void OnButtonUp(void);
-
- void OnButtonDown(void);
-
- void OnNothing(void);
-
- void OnBallMotion(void){}
+ void DestroyJoystickDevice(void);
/*
-
* fills the axis mnember values
-
*/
-
void pFillAxes(void);
-
-
-
void pFillButtons(void);
/*
-
* returns m_axis10,m_axis11...
-
*/
-
int pGetAxis(int axisnum, int udlr);
-
+
/*
-
* gets the current button
-
*/
int pGetButtonPress(int button);
/*
-
* returns if no button is pressed
-
*/
-
int pGetButtonRelease(int button);
/*
-
* gets the current hat direction
-
*/
-
int pGetHat(int direction);
- SCA_Joystick();
+ SCA_Joystick(short int index);
~SCA_Joystick();
- bool CreateJoystickDevice(void);
-
- void DestroyJoystickDevice(void);
-
-
public:
- static SCA_Joystick *GetInstance();
-
+ static SCA_Joystick *GetInstance( short int joyindex );
+ static void HandleEvents( void );
void ReleaseInstance();
- void HandleEvents();
-
/*
-
*/
bool aUpAxisIsPositive(int axis);
-
bool aDownAxisIsPositive(int axis);
-
bool aLeftAxisIsPositive(int axis);
-
bool aRightAxisIsPositive(int axis);
-
bool aButtonPressIsPositive(int button);
-
bool aButtonReleaseIsPositive(int button);
-
bool aHatIsPositive(int dir);
/*
-
* precision is default '3200' which is overridden by input
-
*/
void cSetPrecision(int val);
-
-
int GetAxis10(void){
return m_axis10;
@@ -312,80 +186,48 @@ public:
}
int GetAxis11(void){
-
return m_axis11;
-
}
int GetAxis20(void){
-
return m_axis20;
-
}
int GetAxis21(void){
-
return m_axis21;
-
}
int GetButton(void){
-
return m_buttonnum;
-
}
int GetHat(void){
-
return m_hatdir;
-
}
int GetThreshold(void){
-
return m_prec;
-
}
bool IsTrig(void){
-
return m_istrig;
-
}
-
-
/*
-
- * returns true if an event is being processed
-
- */
-
- bool GetJoyAxisMotion(void);
-
- bool GetJoyButtonPress(void);
-
- bool GetJoyButtonRelease(void);
-
- bool GetJoyHatMotion(void);
-
- /*
-
* returns the # of...
-
*/
int GetNumberOfAxes(void);
-
int GetNumberOfButtons(void);
-
int GetNumberOfHats(void);
-
-
+ /*
+ * Test if the joystick is connected
+ */
+ int Connected(void);
};
-
+void Joystick_HandleEvents( void );
#endif
diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
index 15a421188b9..73ffe1406d9 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
@@ -38,12 +38,6 @@
#define echo(x) std::cout << x << std::endl;
#endif
-/* function callbacks */
-#define HANDLE_AXISMOTION(fn) ((fn)(), 0L)
-#define HANDLE_HATMOTION(fn) ((fn)(), 0L)
-#define HANDLE_BUTTONUP(fn) ((fn)(), 0L)
-#define HANDLE_BUTTONDOWN(fn) ((fn)(), 0L)
-#define HANDLE_BALLMOTION(fn) ((fn)(), 0L)
-#define HANDLE_NOEVENT(fn) ((fn)(), 0L)
+#define JOYINDEX_MAX 8
#endif
diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
index ab523470e21..1e064f55397 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
@@ -30,41 +30,75 @@
-void SCA_Joystick::OnAxisMotion(void)
+void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event)
{
pFillAxes();
- m_axisnum = m_private->m_event.jaxis.axis;
- m_axisvalue = m_private->m_event.jaxis.value;
+ m_axisnum = sdl_event->jaxis.axis;
+ m_axisvalue = sdl_event->jaxis.value;
m_istrig = 1;
}
-void SCA_Joystick::OnHatMotion(void)
+void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event)
{
- m_hatdir = m_private->m_event.jhat.value;
- m_hatnum = m_private->m_event.jhat.hat;
+ m_hatdir = sdl_event->jhat.value;
+ m_hatnum = sdl_event->jhat.hat;
m_istrig = 1;
}
-void SCA_Joystick::OnButtonUp(void)
+void SCA_Joystick::OnButtonUp(SDL_Event* sdl_event)
{
m_buttonnum = -2;
}
-void SCA_Joystick::OnButtonDown(void)
+void SCA_Joystick::OnButtonDown(SDL_Event* sdl_event)
{
m_buttonmax = GetNumberOfButtons();
- if(m_private->m_event.jbutton.button >= 1 || m_private->m_event.jbutton.button <= m_buttonmax)
+ if(sdl_event->jbutton.button >= 1 || sdl_event->jbutton.button <= m_buttonmax)
{
m_istrig = 1;
- m_buttonnum = m_private->m_event.jbutton.button;
+ m_buttonnum = sdl_event->jbutton.button;
}
}
-void SCA_Joystick::OnNothing(void)
+void SCA_Joystick::OnNothing(SDL_Event* sdl_event)
{
m_istrig = 0;
}
+
+/* only handle events for 1 joystick */
+
+void SCA_Joystick::HandleEvents(void)
+{
+ SDL_Event sdl_event;
+
+ if(SDL_PollEvent(&sdl_event))
+ {
+ /* Note! m_instance[sdl_event.jaxis.which]
+ * will segfault if over JOYINDEX_MAX, not too nice but what are the chances? */
+ switch(sdl_event.type)
+ {
+ case SDL_JOYAXISMOTION:
+ SCA_Joystick::m_instance[sdl_event.jaxis.which]->OnAxisMotion(&sdl_event);
+ break;
+ case SDL_JOYHATMOTION:
+ SCA_Joystick::m_instance[sdl_event.jhat.which]->OnHatMotion(&sdl_event);
+ break;
+ case SDL_JOYBUTTONUP:
+ SCA_Joystick::m_instance[sdl_event.jbutton.which]->OnButtonUp(&sdl_event);
+ break;
+ case SDL_JOYBUTTONDOWN:
+ SCA_Joystick::m_instance[sdl_event.jbutton.which]->OnButtonDown(&sdl_event);
+ break;
+ case SDL_JOYBALLMOTION:
+ SCA_Joystick::m_instance[sdl_event.jball.which]->OnBallMotion(&sdl_event);
+ break;
+ default:
+ printf("SCA_Joystick::HandleEvents, Unknown SDL event, this should not happen\n");
+ break;
+ }
+ }
+}
diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
index 23fad3cd55d..bb6bfe2d4cc 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
@@ -33,10 +33,6 @@ class SCA_Joystick::PrivateData
{
public:
/*
- * SDL events structure
- */
- SDL_Event m_event;
- /*
* The Joystick
*/
SDL_Joystick* m_joystick;
diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile
index b3eae5d67dc..355ece6e8bd 100644
--- a/source/gameengine/GameLogic/Makefile
+++ b/source/gameengine/GameLogic/Makefile
@@ -42,6 +42,7 @@ CPPFLAGS += -I../Expressions
CPPFLAGS += -I../Rasterizer
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
+CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
CPPFLAGS += $(NAN_SDLCFLAGS)
diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
index 28ca1fd673f..768a3a45937 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
@@ -48,19 +48,10 @@ SCA_ActuatorEventManager::~SCA_ActuatorEventManager()
}
-
-
-void SCA_ActuatorEventManager::RegisterSensor(SCA_ISensor* sensor)
-{
- m_sensors.push_back(sensor);
-}
-
-
-
void SCA_ActuatorEventManager::NextFrame()
{
// check for changed actuator
- for (vector<SCA_ISensor*>::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++)
+ for (set<SCA_ISensor*>::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++)
{
(*it)->Activate(m_logicmgr,NULL);
}
@@ -69,7 +60,7 @@ void SCA_ActuatorEventManager::NextFrame()
void SCA_ActuatorEventManager::UpdateFrame()
{
// update the state of actuator before executing them
- for (vector<SCA_ISensor*>::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++)
+ for (set<SCA_ISensor*>::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++)
{
((SCA_ActuatorSensor*)(*it))->Update();
}
diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
index b5108764197..a7d61627c23 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
+++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
@@ -44,7 +44,6 @@ public:
virtual ~SCA_ActuatorEventManager();
virtual void NextFrame();
virtual void UpdateFrame();
- virtual void RegisterSensor(SCA_ISensor* sensor);
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
};
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
index e1c8ef87dd1..44a488fa719 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
@@ -149,7 +149,7 @@ PyParentObject SCA_ActuatorSensor::Parents[] = {
};
PyMethodDef SCA_ActuatorSensor::Methods[] = {
- {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_VARARGS, GetActuator_doc},
+ {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, GetActuator_doc},
{"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, SetActuator_doc},
{NULL,NULL} //Sentinel
};
@@ -162,7 +162,7 @@ PyObject* SCA_ActuatorSensor::_getattr(const STR_String& attr) {
char SCA_ActuatorSensor::GetActuator_doc[] =
"getActuator()\n"
"\tReturn the Actuator with which the sensor operates.\n";
-PyObject* SCA_ActuatorSensor::PyGetActuator(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_ActuatorSensor::PyGetActuator(PyObject* self)
{
return PyString_FromString(m_checkactname);
}
diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h
index 6086c5bfce0..a71145f6852 100644
--- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h
+++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h
@@ -66,7 +66,7 @@ public:
/* 3. setProperty */
KX_PYMETHOD_DOC(SCA_ActuatorSensor,SetActuator);
/* 4. getProperty */
- KX_PYMETHOD_DOC(SCA_ActuatorSensor,GetActuator);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator);
};
diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
index ab3bc2cc4ee..4cd2dfba994 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
@@ -51,16 +51,9 @@ SCA_AlwaysEventManager::SCA_AlwaysEventManager(class SCA_LogicManager* logicmgr)
void SCA_AlwaysEventManager::NextFrame()
{
- for (vector<class SCA_ISensor*>::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++)
+ for (set<class SCA_ISensor*>::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++)
{
- SCA_ISensor* sensor = *i;
- sensor->Activate(m_logicmgr, NULL);
+ (*i)->Activate(m_logicmgr, NULL);
}
}
-
-
-void SCA_AlwaysEventManager::RegisterSensor(SCA_ISensor* sensor)
-{
- m_sensors.push_back(sensor);
-}
diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
index 28c71512875..a619eecddd4 100644
--- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
+++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
@@ -39,7 +39,6 @@ class SCA_AlwaysEventManager : public SCA_EventManager
public:
SCA_AlwaysEventManager(class SCA_LogicManager* logicmgr);
virtual void NextFrame();
- virtual void RegisterSensor(SCA_ISensor* sensor);
};
diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp
new file mode 100644
index 00000000000..4d05250e91c
--- /dev/null
+++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp
@@ -0,0 +1,257 @@
+/**
+ * Delay trigger
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WIN32
+// This warning tells us about truncation of __long__ stl-generated names.
+// It can occasionally cause DevStudio to have internal compiler warnings.
+#pragma warning( disable : 4786 )
+#endif
+
+#include "SCA_DelaySensor.h"
+#include "SCA_LogicManager.h"
+#include "SCA_EventManager.h"
+
+/* ------------------------------------------------------------------------- */
+/* Native functions */
+/* ------------------------------------------------------------------------- */
+
+SCA_DelaySensor::SCA_DelaySensor(class SCA_EventManager* eventmgr,
+ SCA_IObject* gameobj,
+ int delay,
+ int duration,
+ bool repeat,
+ PyTypeObject* T)
+ : SCA_ISensor(gameobj,eventmgr, T),
+ m_delay(delay),
+ m_duration(duration),
+ m_repeat(repeat)
+{
+ Init();
+}
+
+void SCA_DelaySensor::Init()
+{
+ m_lastResult = false;
+ m_frameCount = -1;
+ m_reset = true;
+}
+
+SCA_DelaySensor::~SCA_DelaySensor()
+{
+ /* intentionally empty */
+}
+
+CValue* SCA_DelaySensor::GetReplica()
+{
+ CValue* replica = new SCA_DelaySensor(*this);
+ // this will copy properties and so on...
+ CValue::AddDataToReplica(replica);
+
+ return replica;
+}
+
+
+
+bool SCA_DelaySensor::IsPositiveTrigger()
+{
+ return (m_invert ? !m_lastResult : m_lastResult);
+}
+
+bool SCA_DelaySensor::Evaluate(CValue* event)
+{
+ bool trigger = false;
+ bool result;
+
+ if (m_frameCount==-1) {
+ // this is needed to ensure ON trigger in case delay==0
+ // and avoid spurious OFF trigger when duration==0
+ m_lastResult = false;
+ m_frameCount = 0;
+ }
+
+ if (m_frameCount<m_delay) {
+ m_frameCount++;
+ result = false;
+ } else if (m_duration > 0) {
+ if (m_frameCount < m_delay+m_duration) {
+ m_frameCount++;
+ result = true;
+ } else {
+ result = false;
+ if (m_repeat)
+ m_frameCount = -1;
+ }
+ } else {
+ result = true;
+ if (m_repeat)
+ m_frameCount = -1;
+ }
+ if ((m_reset && m_level) || result != m_lastResult)
+ trigger = true;
+ m_reset = false;
+ m_lastResult = result;
+ return trigger;
+}
+
+/* ------------------------------------------------------------------------- */
+/* Python functions */
+/* ------------------------------------------------------------------------- */
+
+/* Integration hooks ------------------------------------------------------- */
+PyTypeObject SCA_DelaySensor::Type = {
+ PyObject_HEAD_INIT(&PyType_Type)
+ 0,
+ "SCA_DelaySensor",
+ sizeof(SCA_DelaySensor),
+ 0,
+ PyDestructor,
+ 0,
+ __getattr,
+ __setattr,
+ 0, //&MyPyCompare,
+ __repr,
+ 0, //&cvalue_as_number,
+ 0,
+ 0,
+ 0,
+ 0
+};
+
+PyParentObject SCA_DelaySensor::Parents[] = {
+ &SCA_DelaySensor::Type,
+ &SCA_ISensor::Type,
+ &SCA_ILogicBrick::Type,
+ &CValue::Type,
+ NULL
+};
+
+PyMethodDef SCA_DelaySensor::Methods[] = {
+ /* setProperty */
+ {"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, SetDelay_doc},
+ {"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, SetDuration_doc},
+ {"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, SetRepeat_doc},
+ /* getProperty */
+ {"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, GetDelay_doc},
+ {"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, GetDuration_doc},
+ {"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, GetRepeat_doc},
+ {NULL,NULL} //Sentinel
+};
+
+PyObject* SCA_DelaySensor::_getattr(const STR_String& attr) {
+ _getattr_up(SCA_ISensor);
+}
+
+char SCA_DelaySensor::SetDelay_doc[] =
+"setDelay(delay)\n"
+"\t- delay: length of the initial OFF period as number of frame\n"
+"\t 0 for immediate trigger\n"
+"\tSet the initial delay before the positive trigger\n";
+PyObject* SCA_DelaySensor::PySetDelay(PyObject* self, PyObject* args, PyObject* kwds)
+{
+ int delay;
+
+ if(!PyArg_ParseTuple(args, "i", &delay)) {
+ return NULL;
+ }
+ if (delay < 0) {
+ PyErr_SetString(PyExc_ValueError, "Delay cannot be negative");
+ return NULL;
+ }
+ m_delay = delay;
+ Py_Return;
+}
+
+char SCA_DelaySensor::SetDuration_doc[] =
+"setDuration(duration)\n"
+"\t- duration: length of the ON period in number of frame after the initial off period\n"
+"\t 0 for no ON period\n"
+"\tSet the duration of the ON pulse after initial delay.\n"
+"\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n";
+PyObject* SCA_DelaySensor::PySetDuration(PyObject* self, PyObject* args, PyObject* kwds)
+{
+ int duration;
+
+ if(!PyArg_ParseTuple(args, "i", &duration)) {
+ return NULL;
+ }
+ if (duration < 0) {
+ PyErr_SetString(PyExc_ValueError, "Duration cannot be negative");
+ return NULL;
+ }
+ m_duration = duration;
+ Py_Return;
+}
+
+char SCA_DelaySensor::SetRepeat_doc[] =
+"setRepeat(repeat)\n"
+"\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n"
+"\t 0 if the initial OFF-ON cycle should run only once\n"
+"\tSet the sensor repeat mode\n";
+PyObject* SCA_DelaySensor::PySetRepeat(PyObject* self, PyObject* args, PyObject* kwds)
+{
+ int repeat;
+
+ if(!PyArg_ParseTuple(args, "i", &repeat)) {
+ return NULL;
+ }
+ m_repeat = (repeat != 0);
+ Py_Return;
+}
+
+char SCA_DelaySensor::GetDelay_doc[] =
+"getDelay()\n"
+"\tReturn the delay parameter value\n";
+PyObject* SCA_DelaySensor::PyGetDelay(PyObject* self)
+{
+ return PyInt_FromLong(m_delay);
+}
+
+char SCA_DelaySensor::GetDuration_doc[] =
+"getDuration()\n"
+"\tReturn the duration parameter value\n";
+PyObject* SCA_DelaySensor::PyGetDuration(PyObject* self)
+{
+ return PyInt_FromLong(m_duration);
+}
+
+char SCA_DelaySensor::GetRepeat_doc[] =
+"getRepeat()\n"
+"\tReturn the repeat parameter value\n";
+PyObject* SCA_DelaySensor::PyGetRepeat(PyObject* self)
+{
+ return BoolToPyArg(m_repeat);
+}
+
+/* eof */
diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h
new file mode 100644
index 00000000000..a997fabe3cd
--- /dev/null
+++ b/source/gameengine/GameLogic/SCA_DelaySensor.h
@@ -0,0 +1,77 @@
+/**
+ * SCA_DelaySensor.h
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __KX_DELAYSENSOR
+#define __KX_DELAYSENSOR
+#include "SCA_ISensor.h"
+
+class SCA_DelaySensor : public SCA_ISensor
+{
+ Py_Header;
+ bool m_lastResult;
+ bool m_repeat;
+ int m_delay;
+ int m_duration;
+ int m_frameCount;
+
+public:
+ SCA_DelaySensor(class SCA_EventManager* eventmgr,
+ SCA_IObject* gameobj,
+ int delay,
+ int duration,
+ bool repeat,
+ PyTypeObject* T =&Type);
+ virtual ~SCA_DelaySensor();
+ virtual CValue* GetReplica();
+ virtual bool Evaluate(CValue* event);
+ virtual bool IsPositiveTrigger();
+ virtual void Init();
+
+
+ /* --------------------------------------------------------------------- */
+ /* Python interface ---------------------------------------------------- */
+ /* --------------------------------------------------------------------- */
+
+ virtual PyObject* _getattr(const STR_String& attr);
+
+ /* setProperty */
+ KX_PYMETHOD_DOC(SCA_DelaySensor,SetDelay);
+ KX_PYMETHOD_DOC(SCA_DelaySensor,SetDuration);
+ KX_PYMETHOD_DOC(SCA_DelaySensor,SetRepeat);
+ /* getProperty */
+ KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay);
+ KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration);
+ KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat);
+
+};
+
+#endif //__KX_ALWAYSSENSOR
+
diff --git a/source/gameengine/GameLogic/SCA_EventManager.cpp b/source/gameengine/GameLogic/SCA_EventManager.cpp
index 0169864a133..e4fd0379597 100644
--- a/source/gameengine/GameLogic/SCA_EventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_EventManager.cpp
@@ -45,17 +45,14 @@ SCA_EventManager::~SCA_EventManager()
{
}
-
+void SCA_EventManager::RegisterSensor(class SCA_ISensor* sensor)
+{
+ m_sensors.insert(sensor);
+}
void SCA_EventManager::RemoveSensor(class SCA_ISensor* sensor)
{
- std::vector<SCA_ISensor*>::iterator i =
- std::find(m_sensors.begin(), m_sensors.end(), sensor);
- if (!(i == m_sensors.end()))
- {
- std::swap(*i, m_sensors.back());
- m_sensors.pop_back();
- }
+ m_sensors.erase(sensor);
}
void SCA_EventManager::NextFrame(double curtime, double fixedtime)
diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h
index 9cc1718cd1e..9dbb5a6d24f 100644
--- a/source/gameengine/GameLogic/SCA_EventManager.h
+++ b/source/gameengine/GameLogic/SCA_EventManager.h
@@ -30,12 +30,14 @@
#define __KX_EVENTMANAGER
#include <vector>
+#include <set>
#include <algorithm>
class SCA_EventManager
{
protected:
- std::vector <class SCA_ISensor*> m_sensors;
+ // use a set to speed-up insertion/removal
+ std::set <class SCA_ISensor*> m_sensors;
public:
enum EVENT_MANAGER_TYPE {
@@ -61,7 +63,7 @@ public:
virtual void NextFrame();
virtual void UpdateFrame();
virtual void EndFrame();
- virtual void RegisterSensor(class SCA_ISensor* sensor)=0;
+ virtual void RegisterSensor(class SCA_ISensor* sensor);
int GetType();
protected:
diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp
index 8f156cc63e7..0bd20117f31 100644
--- a/source/gameengine/GameLogic/SCA_IController.cpp
+++ b/source/gameengine/GameLogic/SCA_IController.cpp
@@ -188,6 +188,8 @@ void SCA_IController::ApplyState(unsigned int state)
for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit)
{
(*sensit)->IncLink();
+ // remember that this controller just activated that sensor
+ (*sensit)->AddNewController(this);
}
SetActive(true);
}
diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
index e73358bc1e8..abd049e9d64 100644
--- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
+++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
@@ -27,6 +27,7 @@
*/
#include "SCA_ILogicBrick.h"
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -271,8 +272,7 @@ PyObject* SCA_ILogicBrick::PyGetOwner(PyObject* self)
}
printf("ERROR: Python scriptblock without owner\n");
- Py_INCREF(Py_None);
- return Py_None;//Int_FromLong(IsPositiveTrigger());
+ Py_RETURN_NONE; //Int_FromLong(IsPositiveTrigger());
}
diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp
index 25b4af696ea..b0f8decee26 100644
--- a/source/gameengine/GameLogic/SCA_IObject.cpp
+++ b/source/gameengine/GameLogic/SCA_IObject.cpp
@@ -337,12 +337,31 @@ void SCA_IObject::Resume(void)
void SCA_IObject::SetState(unsigned int state)
{
- m_state = state;
- // update the status of the controllers
+ unsigned int tmpstate;
SCA_ControllerList::iterator contit;
- for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++)
+
+ // we will update the state in two steps:
+ // 1) set the new state bits that are 1
+ // 2) clr the new state bits that are 0
+ // This to ensure continuity if a sensor is attached to two states
+ // that are switching state: no need to deactive and reactive the sensor
+
+ tmpstate = m_state | state;
+ if (tmpstate != m_state)
+ {
+ // update the status of the controllers
+ for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++)
+ {
+ (*contit)->ApplyState(tmpstate);
+ }
+ }
+ m_state = state;
+ if (m_state != tmpstate)
{
- (*contit)->ApplyState(m_state);
+ for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++)
+ {
+ (*contit)->ApplyState(m_state);
+ }
}
}
diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp
index 68341b57435..084b1395159 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.cpp
+++ b/source/gameengine/GameLogic/SCA_ISensor.cpp
@@ -32,6 +32,8 @@
#include "SCA_ISensor.h"
#include "SCA_EventManager.h"
#include "SCA_LogicManager.h"
+// needed for IsTriggered()
+#include "SCA_PythonController.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -41,7 +43,8 @@
void SCA_ISensor::ReParent(SCA_IObject* parent)
{
SCA_ILogicBrick::ReParent(parent);
- m_eventmgr->RegisterSensor(this);
+ // will be done when the sensor is activated
+ //m_eventmgr->RegisterSensor(this);
this->SetActive(false);
}
@@ -131,9 +134,8 @@ void SCA_ISensor::DecLink() {
}
if (!m_links)
{
- // sensor is detached from all controllers, initialize it so that it
- // is fresh as at startup when it is reattached again.
- Init();
+ // sensor is detached from all controllers, remove it from manager
+ UnregisterToManager();
}
}
@@ -166,27 +168,31 @@ PyParentObject SCA_ISensor::Parents[] = {
};
PyMethodDef SCA_ISensor::Methods[] = {
{"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive,
- METH_VARARGS, IsPositive_doc},
+ METH_NOARGS, IsPositive_doc},
+ {"isTriggered", (PyCFunction) SCA_ISensor::sPyIsTriggered,
+ METH_VARARGS, IsTriggered_doc},
{"getUsePosPulseMode", (PyCFunction) SCA_ISensor::sPyGetUsePosPulseMode,
- METH_VARARGS, GetUsePosPulseMode_doc},
+ METH_NOARGS, GetUsePosPulseMode_doc},
{"setUsePosPulseMode", (PyCFunction) SCA_ISensor::sPySetUsePosPulseMode,
METH_VARARGS, SetUsePosPulseMode_doc},
{"getFrequency", (PyCFunction) SCA_ISensor::sPyGetFrequency,
- METH_VARARGS, GetFrequency_doc},
+ METH_NOARGS, GetFrequency_doc},
{"setFrequency", (PyCFunction) SCA_ISensor::sPySetFrequency,
METH_VARARGS, SetFrequency_doc},
{"getUseNegPulseMode", (PyCFunction) SCA_ISensor::sPyGetUseNegPulseMode,
- METH_VARARGS, GetUseNegPulseMode_doc},
+ METH_NOARGS, GetUseNegPulseMode_doc},
{"setUseNegPulseMode", (PyCFunction) SCA_ISensor::sPySetUseNegPulseMode,
METH_VARARGS, SetUseNegPulseMode_doc},
{"getInvert", (PyCFunction) SCA_ISensor::sPyGetInvert,
- METH_VARARGS, GetInvert_doc},
+ METH_NOARGS, GetInvert_doc},
{"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert,
METH_VARARGS, SetInvert_doc},
{"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel,
- METH_VARARGS, GetLevel_doc},
+ METH_NOARGS, GetLevel_doc},
{"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel,
METH_VARARGS, SetLevel_doc},
+ {"reset", (PyCFunction) SCA_ISensor::sPyReset,
+ METH_NOARGS, Reset_doc},
{NULL,NULL} //Sentinel
};
@@ -200,9 +206,17 @@ SCA_ISensor::_getattr(const STR_String& attr)
void SCA_ISensor::RegisterToManager()
{
+ // sensor is just activated, initialize it
+ Init();
+ m_newControllers.erase(m_newControllers.begin(), m_newControllers.end());
m_eventmgr->RegisterSensor(this);
}
+void SCA_ISensor::UnregisterToManager()
+{
+ m_eventmgr->RemoveSensor(this);
+}
+
void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event)
{
@@ -212,6 +226,9 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event)
bool result = this->Evaluate(event);
if (result) {
logicmgr->AddActivatedSensor(this);
+ // reset these counters so that pulse are synchronized with transition
+ m_pos_ticks = 0;
+ m_neg_ticks = 0;
} else
{
/* First, the pulsing behaviour, if pulse mode is
@@ -240,26 +257,54 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event)
}
}
}
+ if (!m_newControllers.empty())
+ {
+ if (!IsActive() && m_level)
+ {
+ // This level sensor is connected to at least one controller that was just made
+ // active but it did not generate an event yet, do it now to those controllers only
+ for (std::vector<SCA_IController*>::iterator ci=m_newControllers.begin();
+ ci != m_newControllers.end(); ci++)
+ {
+ logicmgr->AddTriggeredController(*ci, this);
+ }
+ }
+ // clear the list. Instead of using clear, which also release the memory,
+ // use erase, which keeps the memory available for next time.
+ m_newControllers.erase(m_newControllers.begin(), m_newControllers.end());
+ }
}
}
/* Python functions: */
char SCA_ISensor::IsPositive_doc[] =
"isPositive()\n"
-"\tReturns whether the sensor is registered a positive event.\n";
-PyObject* SCA_ISensor::PyIsPositive(PyObject* self, PyObject* args, PyObject* kwds)
+"\tReturns whether the sensor is in an active state.\n";
+PyObject* SCA_ISensor::PyIsPositive(PyObject* self)
{
int retval = IsPositiveTrigger();
return PyInt_FromLong(retval);
}
+char SCA_ISensor::IsTriggered_doc[] =
+"isTriggered()\n"
+"\tReturns whether the sensor has triggered the current controller.\n";
+PyObject* SCA_ISensor::PyIsTriggered(PyObject* self)
+{
+ // check with the current controller
+ int retval = 0;
+ if (SCA_PythonController::m_sCurrentController)
+ retval = SCA_PythonController::m_sCurrentController->IsTriggered(this);
+ return PyInt_FromLong(retval);
+}
+
/**
* getUsePulseMode: getter for the pulse mode (KX_TRUE = on)
*/
char SCA_ISensor::GetUsePosPulseMode_doc[] =
"getUsePosPulseMode()\n"
"\tReturns whether positive pulse mode is active.\n";
-PyObject* SCA_ISensor::PyGetUsePosPulseMode(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_ISensor::PyGetUsePosPulseMode(PyObject* self)
{
return BoolToPyArg(m_pos_pulsemode);
}
@@ -286,7 +331,7 @@ PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* self, PyObject* args, PyOb
char SCA_ISensor::GetFrequency_doc[] =
"getFrequency()\n"
"\tReturns the frequency of the updates in pulse mode.\n" ;
-PyObject* SCA_ISensor::PyGetFrequency(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_ISensor::PyGetFrequency(PyObject* self)
{
return PyInt_FromLong(m_pulse_frequency);
}
@@ -321,7 +366,7 @@ PyObject* SCA_ISensor::PySetFrequency(PyObject* self, PyObject* args, PyObject*
char SCA_ISensor::GetInvert_doc[] =
"getInvert()\n"
"\tReturns whether or not pulses from this sensor are inverted.\n" ;
-PyObject* SCA_ISensor::PyGetInvert(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_ISensor::PyGetInvert(PyObject* self)
{
return BoolToPyArg(m_invert);
}
@@ -342,11 +387,10 @@ char SCA_ISensor::GetLevel_doc[] =
"getLevel()\n"
"\tReturns whether this sensor is a level detector or a edge detector.\n"
"\tIt makes a difference only in case of logic state transition (state actuator).\n"
-"\tA level detector will immediately generate a pulse if the condition for the\n"
-"\tdetector is met when entering the state. A edge detector will wait for an off-on\n"
-"\ttransition to occur.\n"
-"\tOnly some sensors implement this feature: keyboard.\n";
-PyObject* SCA_ISensor::PyGetLevel(PyObject* self, PyObject* args, PyObject* kwds)
+"\tA level detector will immediately generate a pulse, negative or positive\n"
+"\tdepending on the sensor condition, as soon as the state is activated.\n"
+"\tA edge detector will wait for a state change before generating a pulse.\n";
+PyObject* SCA_ISensor::PyGetLevel(PyObject* self)
{
return BoolToPyArg(m_level);
}
@@ -366,7 +410,7 @@ PyObject* SCA_ISensor::PySetLevel(PyObject* self, PyObject* args, PyObject* kwds
char SCA_ISensor::GetUseNegPulseMode_doc[] =
"getUseNegPulseMode()\n"
"\tReturns whether negative pulse mode is active.\n";
-PyObject* SCA_ISensor::PyGetUseNegPulseMode(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject* SCA_ISensor::PyGetUseNegPulseMode(PyObject* self)
{
return BoolToPyArg(m_neg_pulsemode);
}
@@ -384,4 +428,15 @@ PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* self, PyObject* args, PyOb
Py_Return;
}
+char SCA_ISensor::Reset_doc[] =
+"reset()\n"
+"\tReset sensor internal state, effect depends on the type of sensor and settings.\n"
+"\tThe sensor is put in its initial state as if it was just activated.\n";
+PyObject* SCA_ISensor::PyReset(PyObject* self)
+{
+ Init();
+ Py_Return;
+}
+
+
/* eof */
diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h
index 4ce49e71507..0d65270dc7b 100644
--- a/source/gameengine/GameLogic/SCA_ISensor.h
+++ b/source/gameengine/GameLogic/SCA_ISensor.h
@@ -34,6 +34,8 @@
#include "SCA_ILogicBrick.h"
+#include <vector>
+
/**
* Interface Class for all logic Sensors. Implements
* pulsemode,pulsefrequency */
@@ -73,9 +75,9 @@ class SCA_ISensor : public SCA_ILogicBrick
/** number of connections to controller */
int m_links;
- /** Pass the activation on to the logic manager.*/
- void SignalActivation(class SCA_LogicManager* logicmgr);
-
+ /** list of controllers that have just activated this sensor because of a state change */
+ std::vector<class SCA_IController*> m_newControllers;
+
public:
SCA_ISensor(SCA_IObject* gameobj,
class SCA_EventManager* eventmgr,
@@ -115,6 +117,8 @@ public:
void SetLevel(bool lvl);
void RegisterToManager();
+ void UnregisterToManager();
+
virtual float GetNumber();
/** Stop sensing for a while. */
@@ -126,26 +130,30 @@ public:
/** Resume sensing. */
void Resume();
+ void AddNewController(class SCA_IController* controller)
+ { m_newControllers.push_back(controller); }
void ClrLink()
{ m_links = 0; }
void IncLink()
- { m_links++; }
+ { if (!m_links++) RegisterToManager(); }
void DecLink();
bool IsNoLink() const
{ return !m_links; }
/* Python functions: */
- KX_PYMETHOD_DOC(SCA_ISensor,IsPositive);
- KX_PYMETHOD_DOC(SCA_ISensor,GetUsePosPulseMode);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsTriggered);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode);
KX_PYMETHOD_DOC(SCA_ISensor,SetUsePosPulseMode);
- KX_PYMETHOD_DOC(SCA_ISensor,GetFrequency);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency);
KX_PYMETHOD_DOC(SCA_ISensor,SetFrequency);
- KX_PYMETHOD_DOC(SCA_ISensor,GetUseNegPulseMode);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode);
KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode);
- KX_PYMETHOD_DOC(SCA_ISensor,GetInvert);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert);
KX_PYMETHOD_DOC(SCA_ISensor,SetInvert);
- KX_PYMETHOD_DOC(SCA_ISensor,GetLevel);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel);
KX_PYMETHOD_DOC(SCA_ISensor,SetLevel);
+ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,Reset);
};
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.cpp b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
index 7bf2049e56e..a86770a6e0a 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
@@ -40,40 +40,48 @@ SCA_JoystickManager::SCA_JoystickManager(class SCA_LogicManager* logicmgr)
: SCA_EventManager(JOY_EVENTMGR),
m_logicmgr(logicmgr)
{
- m_joystick = SCA_Joystick::GetInstance();
+ int i;
+ for (i=0; i<JOYINDEX_MAX; i++) {
+ m_joystick[i] = SCA_Joystick::GetInstance( i );
+ }
}
SCA_JoystickManager::~SCA_JoystickManager()
{
- m_joystick->ReleaseInstance();
+ int i;
+ for (i=0; i<JOYINDEX_MAX; i++) {
+ m_joystick[i]->ReleaseInstance();
+ }
}
void SCA_JoystickManager::NextFrame(double curtime,double deltatime)
{
- for (unsigned int i = 0; i < m_sensors.size(); i++)
- {
- SCA_JoystickSensor* joysensor = (SCA_JoystickSensor*) m_sensors[i];
- if(!joysensor->IsSuspended())
+ if (m_sensors.size()==0) {
+ return;
+ }
+ else {
+ set<SCA_ISensor*>::iterator it;
+
+ SCA_Joystick::HandleEvents(); /* Handle all SDL Joystick events */
+
+ for (it = m_sensors.begin(); it != m_sensors.end(); it++)
{
- m_joystick->HandleEvents();
- joysensor->Activate(m_logicmgr, NULL);
+ SCA_JoystickSensor* joysensor = (SCA_JoystickSensor*)(*it);
+ if(!joysensor->IsSuspended())
+ {
+ joysensor->Activate(m_logicmgr, NULL);
+ }
}
}
}
-void SCA_JoystickManager::RegisterSensor(SCA_ISensor* sensor)
-{
- m_sensors.push_back(sensor);
-}
-
-
-SCA_Joystick *SCA_JoystickManager::GetJoystickDevice()
+SCA_Joystick *SCA_JoystickManager::GetJoystickDevice( short int joyindex)
{
/*
*Return the instance of SCA_Joystick for use
*/
- return m_joystick;
+ return m_joystick[joyindex];
}
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h
index 3c4df64677e..d3a7ac95bea 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.h
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.h
@@ -40,13 +40,12 @@ class SCA_JoystickManager : public SCA_EventManager
/**
* SDL Joystick Class Instance
*/
- SCA_Joystick *m_joystick;
+ SCA_Joystick *m_joystick[JOYINDEX_MAX];
public:
SCA_JoystickManager(class SCA_LogicManager* logicmgr);
virtual ~SCA_JoystickManager();
virtual void NextFrame(double curtime,double deltatime);
- virtual void RegisterSensor(SCA_ISensor* sensor);
- SCA_Joystick* GetJoystickDevice(void);
+ SCA_Joystick* GetJoystickDevice(short int joyindex);
};
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
index 3fb439eb25b..403fbfe6f4c 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
@@ -30,8 +30,11 @@
#include "SCA_EventManager.h"
#include "SCA_LogicManager.h"
+#include "PyObjectPlus.h"
+
#include <iostream>
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -39,6 +42,7 @@
SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
SCA_IObject* gameobj,
+ short int joyindex,
short int joymode,
int axis, int axisf,int prec,
int button, int buttonf,
@@ -53,7 +57,8 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
m_hat(hat),
m_hatf(hatf),
m_precision(prec),
- m_joymode(joymode)
+ m_joymode(joymode),
+ m_joyindex(joyindex)
{
/*
std::cout << " axis " << m_axis << std::endl;
@@ -99,7 +104,7 @@ bool SCA_JoystickSensor::IsPositiveTrigger()
bool SCA_JoystickSensor::Evaluate(CValue* event)
{
- SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice();
+ SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
bool result = false;
bool reset = m_reset && m_level;
@@ -118,7 +123,7 @@ bool SCA_JoystickSensor::Evaluate(CValue* event)
js->cSetPrecision(m_precision);
if(m_axisf == 1){
if(js->aUpAxisIsPositive(m_axis)){
- m_istrig =1;
+ m_istrig = 1;
result = true;
}else{
if(m_istrig){
@@ -241,11 +246,31 @@ bool SCA_JoystickSensor::Evaluate(CValue* event)
printf("Error invalid switch statement\n");
break;
}
- if(!js->IsTrig()){
+
+ if (js->IsTrig()) {
+ /* The if below detects changes with the joystick trigger state.
+ * js->IsTrig() will stay true as long as the key is held.
+ * even though the event from SDL will only be sent once.
+ * (js->IsTrig() && m_istrig_lastjs) - when true it means this sensor
+ * had the same joystick trigger state last time,
+ * Setting the result false this time means it wont run the sensors
+ * controller every time (like a pulse sensor)
+ *
+ * This is not done with the joystick its self incase other sensors use
+ * it or become active.
+ */
+ if (m_istrig_lastjs) {
+ result = false;
+ }
+ m_istrig_lastjs = true;
+ } else {
m_istrig = 0;
+ m_istrig_lastjs = false;
}
+
if (reset)
result = true;
+
return result;
}
@@ -293,6 +318,8 @@ PyParentObject SCA_JoystickSensor::Parents[] = {
PyMethodDef SCA_JoystickSensor::Methods[] = {
+ {"getIndex", (PyCFunction) SCA_JoystickSensor::sPyGetIndex, METH_NOARGS, GetIndex_doc},
+ {"setIndex", (PyCFunction) SCA_JoystickSensor::sPySetIndex, METH_O, SetIndex_doc},
{"getAxis", (PyCFunction) SCA_JoystickSensor::sPyGetAxis, METH_NOARGS, GetAxis_doc},
{"setAxis", (PyCFunction) SCA_JoystickSensor::sPySetAxis, METH_VARARGS, SetAxis_doc},
{"getAxisValue", (PyCFunction) SCA_JoystickSensor::sPyGetRealAxis, METH_NOARGS, GetRealAxis_doc},
@@ -305,6 +332,7 @@ PyMethodDef SCA_JoystickSensor::Methods[] = {
{"getNumAxes", (PyCFunction) SCA_JoystickSensor::sPyNumberOfAxes, METH_NOARGS, NumberOfAxes_doc},
{"getNumButtons",(PyCFunction) SCA_JoystickSensor::sPyNumberOfButtons,METH_NOARGS, NumberOfButtons_doc},
{"getNumHats", (PyCFunction) SCA_JoystickSensor::sPyNumberOfHats, METH_NOARGS, NumberOfHats_doc},
+ {"isConnected", (PyCFunction) SCA_JoystickSensor::sPyConnected, METH_NOARGS, Connected_doc},
{NULL,NULL} //Sentinel
};
@@ -314,14 +342,36 @@ PyObject* SCA_JoystickSensor::_getattr(const STR_String& attr) {
}
+/* get index ---------------------------------------------------------- */
+char SCA_JoystickSensor::GetIndex_doc[] =
+"getIndex\n"
+"\tReturns the joystick index to use.\n";
+PyObject* SCA_JoystickSensor::PyGetIndex( PyObject* self ) {
+ return PyInt_FromLong(m_joyindex);
+}
+
+
+/* set index ---------------------------------------------------------- */
+char SCA_JoystickSensor::SetIndex_doc[] =
+"setIndex\n"
+"\tSets the joystick index to use.\n";
+PyObject* SCA_JoystickSensor::PySetIndex( PyObject* self, PyObject* value ) {
+ int index = PyInt_AsLong( value ); /* -1 on error, will raise an error in this case */
+ if (index < 0 || index >= JOYINDEX_MAX) {
+ PyErr_SetString(PyExc_ValueError, "joystick index out of range or not an int");
+ return NULL;
+ }
+
+ m_joyindex = index;
+ Py_RETURN_NONE;
+}
+
/* get axis ---------------------------------------------------------- */
char SCA_JoystickSensor::GetAxis_doc[] =
"getAxis\n"
"\tReturns the current state of the axis.\n";
-PyObject* SCA_JoystickSensor::PyGetAxis( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- return Py_BuildValue("[ii]",m_axis, m_axisf);
+PyObject* SCA_JoystickSensor::PyGetAxis( PyObject* self) {
+ return PyInt_FromLong(m_joyindex);
}
@@ -329,9 +379,7 @@ PyObject* SCA_JoystickSensor::PyGetAxis( PyObject* self,
char SCA_JoystickSensor::SetAxis_doc[] =
"setAxis\n"
"\tSets the current state of the axis.\n";
-PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self, PyObject* args ) {
int axis,axisflag;
if(!PyArg_ParseTuple(args, "ii", &axis, &axisflag)){
@@ -339,7 +387,7 @@ PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self,
}
m_axis = axis;
m_axisf = axisflag;
- Py_Return;
+ Py_RETURN_NONE;
}
@@ -347,16 +395,9 @@ PyObject* SCA_JoystickSensor::PySetAxis( PyObject* self,
char SCA_JoystickSensor::GetRealAxis_doc[] =
"getAxisValue\n"
"\tReturns a list of the values for each axis .\n";
-PyObject* SCA_JoystickSensor::PyGetRealAxis( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- int a,b,c,d;
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice();
- a = joy->GetAxis10();
- b = joy->GetAxis11();
- c = joy->GetAxis20();
- d = joy->GetAxis21();
- return Py_BuildValue("[iiii]",a,b,c,d);
+PyObject* SCA_JoystickSensor::PyGetRealAxis( PyObject* self) {
+ SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ return Py_BuildValue("[iiii]", joy->GetAxis10(), joy->GetAxis11(), joy->GetAxis20(), joy->GetAxis21());
}
@@ -364,10 +405,8 @@ PyObject* SCA_JoystickSensor::PyGetRealAxis( PyObject* self,
char SCA_JoystickSensor::GetThreshold_doc[] =
"getThreshold\n"
"\tReturns the threshold of the axis.\n";
-PyObject* SCA_JoystickSensor::PyGetThreshold( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- return Py_BuildValue("i", m_precision);
+PyObject* SCA_JoystickSensor::PyGetThreshold( PyObject* self) {
+ return PyInt_FromLong(m_precision);
}
@@ -375,15 +414,13 @@ PyObject* SCA_JoystickSensor::PyGetThreshold( PyObject* self,
char SCA_JoystickSensor::SetThreshold_doc[] =
"setThreshold\n"
"\tSets the threshold of the axis.\n";
-PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* self, PyObject* args ) {
int thresh;
if(!PyArg_ParseTuple(args, "i", &thresh)){
return NULL;
}
m_precision = thresh;
- Py_Return;
+ Py_RETURN_NONE;
}
@@ -391,9 +428,7 @@ PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* self,
char SCA_JoystickSensor::GetButton_doc[] =
"getButton\n"
"\tReturns the currently pressed button.\n";
-PyObject* SCA_JoystickSensor::PyGetButton( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* SCA_JoystickSensor::PyGetButton( PyObject* self) {
return Py_BuildValue("[ii]",m_button, m_buttonf);
}
@@ -402,16 +437,14 @@ PyObject* SCA_JoystickSensor::PyGetButton( PyObject* self,
char SCA_JoystickSensor::SetButton_doc[] =
"setButton\n"
"\tSets the button the sensor reacts to.\n";
-PyObject* SCA_JoystickSensor::PySetButton( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* SCA_JoystickSensor::PySetButton( PyObject* self, PyObject* args ) {
int button,buttonflag;
if(!PyArg_ParseTuple(args, "ii", &button, &buttonflag)){
return NULL;
}
m_button = button;
m_buttonf = buttonflag;
- Py_Return;
+ Py_RETURN_NONE;
}
@@ -419,9 +452,7 @@ PyObject* SCA_JoystickSensor::PySetButton( PyObject* self,
char SCA_JoystickSensor::GetHat_doc[] =
"getHat\n"
"\tReturns the current direction of the hat.\n";
-PyObject* SCA_JoystickSensor::PyGetHat( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* SCA_JoystickSensor::PyGetHat( PyObject* self ) {
return Py_BuildValue("[ii]",m_hat, m_hatf);
}
@@ -430,16 +461,14 @@ PyObject* SCA_JoystickSensor::PyGetHat( PyObject* self,
char SCA_JoystickSensor::SetHat_doc[] =
"setHat\n"
"\tSets the hat the sensor reacts to.\n";
-PyObject* SCA_JoystickSensor::PySetHat( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* SCA_JoystickSensor::PySetHat( PyObject* self, PyObject* args ) {
int hat,hatflag;
if(!PyArg_ParseTuple(args, "ii", &hat, &hatflag)){
return NULL;
}
m_hat = hat;
m_hatf = hatflag;
- Py_Return;
+ Py_RETURN_NONE;
}
@@ -447,37 +476,33 @@ PyObject* SCA_JoystickSensor::PySetHat( PyObject* self,
char SCA_JoystickSensor::NumberOfAxes_doc[] =
"getNumAxes\n"
"\tReturns the number of axes .\n";
-PyObject* SCA_JoystickSensor::PyNumberOfAxes( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- int num;
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice();
- num = joy->GetNumberOfAxes();
- return Py_BuildValue("i",num);
+PyObject* SCA_JoystickSensor::PyNumberOfAxes( PyObject* self ) {
+ SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ return PyInt_FromLong( joy->GetNumberOfAxes() );
}
char SCA_JoystickSensor::NumberOfButtons_doc[] =
"getNumButtons\n"
"\tReturns the number of buttons .\n";
-PyObject* SCA_JoystickSensor::PyNumberOfButtons( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- int num;
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice();
- num = joy->GetNumberOfButtons();
- return Py_BuildValue("i",num);
+PyObject* SCA_JoystickSensor::PyNumberOfButtons( PyObject* self ) {
+ SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ return PyInt_FromLong( joy->GetNumberOfButtons() );
}
char SCA_JoystickSensor::NumberOfHats_doc[] =
"getNumHats\n"
"\tReturns the number of hats .\n";
-PyObject* SCA_JoystickSensor::PyNumberOfHats( PyObject* self,
- PyObject* args,
- PyObject* kwds) {
- int num;
- SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice();
- num = joy->GetNumberOfHats();
- return Py_BuildValue("i",num);
+PyObject* SCA_JoystickSensor::PyNumberOfHats( PyObject* self ) {
+ SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ return PyInt_FromLong( joy->GetNumberOfHats() );
+}
+
+char SCA_JoystickSensor::Connected_doc[] =
+"getConnected\n"
+"\tReturns True if a joystick is connected at this joysticks index.\n";
+PyObject* SCA_JoystickSensor::PyConnected( PyObject* self ) {
+ SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+ return PyBool_FromLong( joy->Connected() );
}
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h
index 69068da6494..8b74f6e0296 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.h
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h
@@ -69,9 +69,19 @@ class SCA_JoystickSensor :public SCA_ISensor
*/
bool m_istrig;
/**
+ * Last trigger state for this sensors joystick,
+ * Otherwise it will trigger all the time
+ * this is used to see if the trigger state changes.
+ */
+ bool m_istrig_lastjs;
+ /**
* The mode to determine axis,button or hat
*/
short int m_joymode;
+ /**
+ * Select which joystick to use
+ */
+ short int m_joyindex;
enum KX_JOYSENSORMODE {
KX_JOYSENSORMODE_NODEF = 0,
@@ -85,6 +95,7 @@ class SCA_JoystickSensor :public SCA_ISensor
public:
SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
SCA_IObject* gameobj,
+ short int joyindex,
short int joymode,
int axis, int axisf,int prec,
int button, int buttonf,
@@ -97,28 +108,36 @@ public:
virtual bool IsPositiveTrigger();
virtual void Init();
+ short int GetJoyIndex(void){
+ return m_joyindex;
+ }
+
/* --------------------------------------------------------------------- */
/* Python interface ---------------------------------------------------- */
/* --------------------------------------------------------------------- */
virtual PyObject* _getattr(const STR_String& attr);
+ /* Joystick Index */
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetIndex);
+ KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetIndex);
/* Axes*/
- KX_PYMETHOD_DOC(SCA_JoystickSensor,GetAxis);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,SetAxis);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,GetRealAxis);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,GetThreshold);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,SetThreshold);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxis);
+ KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetAxis);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetRealAxis);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetThreshold);
+ KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetThreshold);
/* Buttons */
- KX_PYMETHOD_DOC(SCA_JoystickSensor,GetButton);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,SetButton);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButton);
+ KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetButton);
/* Hats */
- KX_PYMETHOD_DOC(SCA_JoystickSensor,GetHat);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,SetHat);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetHat);
+ KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetHat);
/* number of */
- KX_PYMETHOD_DOC(SCA_JoystickSensor,NumberOfAxes);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,NumberOfButtons);
- KX_PYMETHOD_DOC(SCA_JoystickSensor,NumberOfHats);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfAxes);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfButtons);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfHats);
+ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,Connected);
};
diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.cpp b/source/gameengine/GameLogic/SCA_KeyboardManager.cpp
index 259b06134d7..6a96442b124 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardManager.cpp
+++ b/source/gameengine/GameLogic/SCA_KeyboardManager.cpp
@@ -62,23 +62,14 @@ void SCA_KeyboardManager::NextFrame()
{
//const SCA_InputEvent& event = GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
// cerr << "SCA_KeyboardManager::NextFrame"<< endl;
- for (unsigned int i=0;i<m_sensors.size();i++)
+ set<SCA_ISensor*>::iterator it;
+ for (it=m_sensors.begin(); it != m_sensors.end(); it++)
{
- SCA_KeyboardSensor* keysensor = (SCA_KeyboardSensor*)m_sensors[i];
- keysensor->Activate(m_logicmanager,NULL);
+ (*it)->Activate(m_logicmanager,NULL);
}
}
-
-
-void SCA_KeyboardManager::RegisterSensor(SCA_ISensor* keysensor)
-{
- m_sensors.push_back(keysensor);
-}
-
-
-
bool SCA_KeyboardManager::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)
{
return false;
diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h
index b4a50f56025..8f3cc0ab715 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardManager.h
+++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h
@@ -55,7 +55,6 @@ public:
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual void NextFrame();
- virtual void RegisterSensor(class SCA_ISensor* sensor);
SCA_IInputDevice* GetInputDevice();
};
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
index a7a6fa93db4..fba1162993d 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
@@ -505,7 +505,7 @@ PyObject* SCA_KeyboardSensor::sPySetAllMode(PyObject* self,
PyObject* kwds)
{
// printf("sPyIsPositive\n");
- return ((SCA_KeyboardSensor*) self)->PyIsPositive(self, args, kwds);
+ return ((SCA_KeyboardSensor*) self)->PyIsPositive(self);
}
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp
index f50161cbecb..b584b37180f 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.cpp
+++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp
@@ -33,6 +33,7 @@
#include "SCA_IController.h"
#include "SCA_IActuator.h"
#include "SCA_EventManager.h"
+#include "SCA_PythonController.h"
#include <set>
#ifdef HAVE_CONFIG_H
@@ -127,12 +128,17 @@ void SCA_LogicManager::RegisterGameMeshName(const STR_String& gamemeshname, void
-void SCA_LogicManager::RegisterGameObj(CValue* gameobj, void* blendobj)
+void SCA_LogicManager::RegisterGameObj(void* blendobj, CValue* gameobj)
{
- m_map_gameobj_to_blendobj.insert(CHashedPtr(gameobj), blendobj);
+ m_map_blendobj_to_gameobj.insert(CHashedPtr(blendobj), gameobj);
}
-
+void SCA_LogicManager::UnregisterGameObj(void* blendobj, CValue* gameobj)
+{
+ void **obp = m_map_blendobj_to_gameobj[CHashedPtr(blendobj)];
+ if (obp && (CValue*)(*obp) == gameobj)
+ m_map_blendobj_to_gameobj.remove(CHashedPtr(blendobj));
+}
CValue* SCA_LogicManager::GetGameObjectByName(const STR_String& gameobjname)
{
@@ -146,10 +152,10 @@ CValue* SCA_LogicManager::GetGameObjectByName(const STR_String& gameobjname)
}
-void* SCA_LogicManager::FindBlendObjByGameObj(CValue* gameobject)
+CValue* SCA_LogicManager::FindGameObjByBlendObj(void* blendobj)
{
- void **obp= m_map_gameobj_to_blendobj[CHashedPtr(gameobject)];
- return obp?*obp:NULL;
+ void **obp= m_map_blendobj_to_gameobj[CHashedPtr(blendobj)];
+ return obp?(CValue*)(*obp):NULL;
}
@@ -171,12 +177,7 @@ void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor)
(*c)->UnlinkSensor(sensor);
}
m_sensorcontrollermapje.erase(sensor);
-
- for (vector<SCA_EventManager*>::const_iterator ie=m_eventmanagers.begin();
- !(ie==m_eventmanagers.end());ie++)
- {
- (*ie)->RemoveSensor(sensor);
- }
+ sensor->UnregisterToManager();
}
void SCA_LogicManager::RemoveController(SCA_IController* controller)
@@ -232,8 +233,6 @@ void SCA_LogicManager::BeginFrame(double curtime, double fixedtime)
// for this frame, look up for activated sensors, and build the collection of triggered controllers
// int numsensors = this->m_activatedsensors.size(); /*unused*/
- set<SmartControllerPtr> triggeredControllerSet;
-
for (vector<SCA_ISensor*>::const_iterator is=m_activatedsensors.begin();
!(is==m_activatedsensors.end());is++)
{
@@ -244,19 +243,28 @@ void SCA_LogicManager::BeginFrame(double curtime, double fixedtime)
{
SCA_IController* contr = *c;//controllerarray->at(c);
if (contr->IsActive())
- triggeredControllerSet.insert(SmartControllerPtr(contr,0));
+ {
+ m_triggeredControllerSet.insert(SmartControllerPtr(contr,0));
+ // So that the controller knows which sensor has activited it.
+ // Only needed for the python controller though.
+ if (contr->GetType() == &SCA_PythonController::Type)
+ {
+ SCA_PythonController* pythonController = (SCA_PythonController*)contr;
+ pythonController->AddTriggeredSensor(sensor);
+ }
+ }
}
//sensor->SetActive(false);
}
// int numtriggered = triggeredControllerSet.size(); /*unused*/
- for (set<SmartControllerPtr>::iterator tit=triggeredControllerSet.begin();
- !(tit==triggeredControllerSet.end());tit++)
+ for (set<SmartControllerPtr>::iterator tit=m_triggeredControllerSet.begin();
+ !(tit==m_triggeredControllerSet.end());tit++)
{
(*tit)->Trigger(this);
}
- triggeredControllerSet.clear();
+ m_triggeredControllerSet.clear();
}
@@ -382,6 +390,17 @@ void SCA_LogicManager::AddActivatedSensor(SCA_ISensor* sensor)
}
}
+void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_ISensor* sensor)
+{
+ m_triggeredControllerSet.insert(SmartControllerPtr(controller,0));
+ // so that the controller knows which sensor has activited it
+ // only needed for python controller
+ if (controller->GetType() == &SCA_PythonController::Type)
+ {
+ SCA_PythonController* pythonController = (SCA_PythonController*)controller;
+ pythonController->AddTriggeredSensor(sensor);
+ }
+}
void SCA_LogicManager::AddActiveActuator(SCA_IActuator* actua,CValue* event)
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h
index 39d8b865977..50383879d8f 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.h
+++ b/source/gameengine/GameLogic/SCA_LogicManager.h
@@ -99,6 +99,7 @@ class SCA_LogicManager
vector<class SCA_ISensor*> m_activatedsensors;
set<class SmartActuatorPtr> m_activeActuators;
+ set<class SmartControllerPtr> m_triggeredControllerSet;
map<SCA_ISensor*,controllerlist > m_sensorcontrollermapje;
@@ -109,7 +110,7 @@ class SCA_LogicManager
GEN_Map<STR_HashedString,void*> m_mapStringToActions;
GEN_Map<STR_HashedString,void*> m_map_gamemeshname_to_blendobj;
- GEN_Map<CHashedPtr,void*> m_map_gameobj_to_blendobj;
+ GEN_Map<CHashedPtr,void*> m_map_blendobj_to_gameobj;
vector<SmartActuatorPtr> m_removedActuators;
public:
@@ -127,6 +128,7 @@ public:
void EndFrame();
void AddActivatedSensor(SCA_ISensor* sensor);
void AddActiveActuator(SCA_IActuator* sensor,class CValue* event);
+ void AddTriggeredController(SCA_IController* controller, SCA_ISensor* sensor);
SCA_EventManager* FindEventManager(int eventmgrtype);
void RemoveGameObject(const STR_String& gameobjname);
@@ -152,8 +154,9 @@ public:
void RegisterGameMeshName(const STR_String& gamemeshname, void* blendobj);
void* FindBlendObjByGameMeshName(const STR_String& gamemeshname);
- void RegisterGameObj(CValue* gameobj, void* blendobj);
- void* FindBlendObjByGameObj(CValue* gameobj);
+ void RegisterGameObj(void* blendobj, CValue* gameobj);
+ void UnregisterGameObj(void* blendobj, CValue* gameobj);
+ CValue* FindGameObjByBlendObj(void* blendobj);
};
#endif //__KX_LOGICMANAGER
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.cpp b/source/gameengine/GameLogic/SCA_MouseManager.cpp
index b4251d8ab53..ca875dad07c 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.cpp
+++ b/source/gameengine/GameLogic/SCA_MouseManager.cpp
@@ -75,9 +75,10 @@ void SCA_MouseManager::NextFrame()
{
if (m_mousedevice)
{
- for (unsigned int i = 0; i < m_sensors.size(); i++)
+ set<SCA_ISensor*>::iterator it;
+ for (it=m_sensors.begin(); it!=m_sensors.end(); it++)
{
- SCA_MouseSensor* mousesensor = (SCA_MouseSensor*) m_sensors[i];
+ SCA_MouseSensor* mousesensor = (SCA_MouseSensor*)(*it);
// (0,0) is the Upper Left corner in our local window
// coordinates
if (!mousesensor->IsSuspended())
@@ -98,15 +99,6 @@ void SCA_MouseManager::NextFrame()
}
}
-
-
-void SCA_MouseManager::RegisterSensor(SCA_ISensor* keysensor)
-{
- m_sensors.push_back(keysensor);
-}
-
-
-
bool SCA_MouseManager::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)
{
/* We should guard for non-mouse events maybe? A rather silly side */
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h
index bc8254486ad..efa4c639ce7 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.h
+++ b/source/gameengine/GameLogic/SCA_MouseManager.h
@@ -62,7 +62,6 @@ public:
*/
bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
virtual void NextFrame();
- virtual void RegisterSensor(class SCA_ISensor* sensor);
SCA_IInputDevice* GetInputDevice();
};
diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
index fc56d101728..e5e3f9cced5 100644
--- a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
@@ -47,19 +47,10 @@ SCA_PropertyEventManager::~SCA_PropertyEventManager()
}
-
-
-void SCA_PropertyEventManager::RegisterSensor(SCA_ISensor* sensor)
-{
- m_sensors.push_back(sensor);
-}
-
-
-
void SCA_PropertyEventManager::NextFrame()
{
// check for changed properties
- for (vector<SCA_ISensor*>::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++)
+ for (set<SCA_ISensor*>::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++)
{
(*it)->Activate(m_logicmgr,NULL);
}
diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h
index aaa303a52c8..f166065b198 100644
--- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h
+++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h
@@ -43,7 +43,6 @@ public:
SCA_PropertyEventManager(class SCA_LogicManager* logicmgr);
virtual ~SCA_PropertyEventManager();
virtual void NextFrame();
- virtual void RegisterSensor(SCA_ISensor* sensor);
//SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
};
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index 01ae4072335..6e9a0a7c6b6 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -33,8 +33,11 @@
#include "SCA_LogicManager.h"
#include "SCA_ISensor.h"
#include "SCA_IActuator.h"
+#include "PyObjectPlus.h"
#include "compile.h"
#include "eval.h"
+#include <algorithm>
+
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -139,6 +142,14 @@ void SCA_PythonController::SetDictionary(PyObject* pythondictionary)
m_pythondictionary = PyDict_Copy(pythondictionary); /* new reference */
}
+int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor)
+{
+ if (std::find(m_triggeredSensors.begin(), m_triggeredSensors.end(), sensor) !=
+ m_triggeredSensors.end())
+ return 1;
+ return 0;
+}
+
#if 0
static char* sPyGetCurrentController__doc__;
#endif
@@ -248,7 +259,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
{
// didn't compile, so instead of compile, complain
// something is wrong, tell the user what went wrong
- printf("PYTHON SCRIPT ERROR:\n");
+ printf("Python compile error from controller \"%s\": \n", GetName().Ptr());
//PyRun_SimpleString(m_scriptText.Ptr());
PyErr_Print();
return;
@@ -273,43 +284,28 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
* break it by hand, then DECREF (which in this case
* should always ensure excdict is cleared).
*/
-/* PyObject *excdict= myPyDict_Copy(m_pythondictionary);
- struct _object* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
- excdict,
- excdict
- );
- PyDict_Clear(excdict);
- Py_DECREF(excdict);*/
-
-#if 1
PyObject *excdict= PyDict_Copy(m_pythondictionary);
PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
- excdict,
- excdict
- );
- PyDict_Clear(excdict);
- Py_DECREF(excdict);
-#else
-
- PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
- m_pythondictionary,
- m_pythondictionary
- );
-
-#endif
+ excdict, excdict);
if (resultobj)
{
Py_DECREF(resultobj);
- } else
+ }
+ else
{
// something is wrong, tell the user what went wrong
- printf("PYTHON SCRIPT ERROR:\n");
+ printf("Python script error from controller \"%s\": \n", GetName().Ptr());
PyErr_Print();
//PyRun_SimpleString(m_scriptText.Ptr());
}
+ // clear after PyErrPrint - seems it can be using
+ // something in this dictionary and crash?
+ PyDict_Clear(excdict);
+ Py_DECREF(excdict);
+ m_triggeredSensors.erase(m_triggeredSensors.begin(), m_triggeredSensors.end());
m_sCurrentController = NULL;
}
diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h
index 39b6c68c359..1b62e7ecb53 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.h
+++ b/source/gameengine/GameLogic/SCA_PythonController.h
@@ -36,6 +36,8 @@
#include "SCA_LogicManager.h"
#include "BoolValue.h"
+#include <vector>
+
class SCA_IObject;
class SCA_PythonController : public SCA_IController
{
@@ -47,6 +49,7 @@ class SCA_PythonController : public SCA_IController
STR_String m_scriptText;
STR_String m_scriptName;
PyObject* m_pythondictionary;
+ std::vector<class SCA_ISensor*> m_triggeredSensors;
public:
static SCA_PythonController* m_sCurrentController; // protected !!!
@@ -64,6 +67,9 @@ class SCA_PythonController : public SCA_IController
void SetScriptText(const STR_String& text);
void SetScriptName(const STR_String& name);
void SetDictionary(PyObject* pythondictionary);
+ void AddTriggeredSensor(class SCA_ISensor* sensor)
+ { m_triggeredSensors.push_back(sensor); }
+ int IsTriggered(class SCA_ISensor* sensor);
static char* sPyGetCurrentController__doc__;
static PyObject* sPyGetCurrentController(PyObject* self);
diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
index 02020a52a17..156478d866d 100644
--- a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
@@ -50,16 +50,9 @@ SCA_RandomEventManager::SCA_RandomEventManager(class SCA_LogicManager* logicmgr)
void SCA_RandomEventManager::NextFrame()
{
- for (vector<class SCA_ISensor*>::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++)
+ for (set<class SCA_ISensor*>::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++)
{
- SCA_ISensor *sensor = *i;
- sensor->Activate(m_logicmgr, NULL);
+ (*i)->Activate(m_logicmgr, NULL);
}
}
-
-
-void SCA_RandomEventManager::RegisterSensor(SCA_ISensor* sensor)
-{
- m_sensors.push_back(sensor);
-};
diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h
index 8c75ef665fa..79138c23c62 100644
--- a/source/gameengine/GameLogic/SCA_RandomEventManager.h
+++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h
@@ -45,7 +45,6 @@ public:
SCA_RandomEventManager(class SCA_LogicManager* logicmgr);
virtual void NextFrame();
- virtual void RegisterSensor(SCA_ISensor* sensor);
};
#endif //__KX_RANDOMEVENTMGR
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
index 643f1247a52..b7fadd3d62c 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
@@ -65,6 +65,11 @@ void SCA_TimeEventManager::RegisterSensor(SCA_ISensor* sensor)
// not yet
}
+void SCA_TimeEventManager::RemoveSensor(SCA_ISensor* sensor)
+{
+ // empty
+}
+
void SCA_TimeEventManager::NextFrame(double curtime, double fixedtime)
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h
index 2fd39661a2d..bd57e12eb44 100644
--- a/source/gameengine/GameLogic/SCA_TimeEventManager.h
+++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h
@@ -45,6 +45,7 @@ public:
virtual void NextFrame(double curtime, double fixedtime);
virtual void RegisterSensor(class SCA_ISensor* sensor);
+ virtual void RemoveSensor(class SCA_ISensor* sensor);
void AddTimeProperty(CValue* timeval);
void RemoveTimeProperty(CValue* timeval);
};
diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt
index e26f8b9d69a..0c6c4179e2d 100644
--- a/source/gameengine/GamePlayer/common/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/common/CMakeLists.txt
@@ -30,7 +30,6 @@ SET(SRC
GPC_Engine.cpp
GPC_KeyboardDevice.cpp
GPC_MouseDevice.cpp
- GPC_PolygonMaterial.cpp
GPC_RawImage.cpp
GPC_RawLoadDotBlendArray.cpp
GPC_RawLogoArrays.cpp
@@ -69,6 +68,7 @@ SET(INC
../../../../source/gameengine/GamePlayer/ghost
../../../../source/blender/misc
../../../../source/blender/blenloader
+ ../../../../source/blender/gpu
../../../../extern/glew/include
${PYTHON_INC}
${SOLID_INC}
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
index 8b828393c67..78d8eaf2aa3 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
@@ -27,141 +27,256 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include <assert.h>
-
-#ifdef WIN32
-#pragma warning (disable : 4786)
-#include <windows.h>
-#endif
-
#include "GL/glew.h"
-#include <iostream>
-
-#include "GPC_RenderTools.h"
-
#include "RAS_IRenderTools.h"
#include "RAS_IRasterizer.h"
#include "RAS_LightObject.h"
#include "RAS_ICanvas.h"
#include "RAS_GLExtensionManager.h"
-// next two includes/dependencies come from the shadow feature
-// it needs the gameobject and the sumo physics scene for a raycast
#include "KX_GameObject.h"
-
-#include "GPC_PolygonMaterial.h"
#include "KX_PolygonMaterial.h"
-#include "Value.h"
+#include "KX_BlenderMaterial.h"
+#include "KX_RayCast.h"
+#include "KX_IPhysicsController.h"
+
+#include "PHY_IPhysicsEnvironment.h"
-//#include "KX_BlenderGL.h" // for text printing
-//#include "KX_BlenderClientObject.h"
#include "STR_String.h"
-#include "RAS_BucketManager.h" // for polymaterial (needed for textprinting)
-
-
-// Blender includes
-/* This list includes only data type definitions */
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_image_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_group_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_property_types.h"
-#include "DNA_text_types.h"
-#include "DNA_sensor_types.h"
-#include "DNA_controller_types.h"
-#include "DNA_actuator_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_bmfont.h"
+
+#include "GPU_draw.h"
+
+#include "BKE_bmfont.h" // for text printing
#include "BKE_bmfont_types.h"
-#include "BKE_main.h"
-#include "IMB_imbuf_types.h"
-// End of Blender includes
+#include "GPC_RenderTools.h"
-#include "KX_Scene.h"
-#include "KX_RayCast.h"
-#include "KX_IPhysicsController.h"
-#include "PHY_IPhysicsEnvironment.h"
-#include "KX_BlenderMaterial.h"
+unsigned int GPC_RenderTools::m_numgllights;
GPC_RenderTools::GPC_RenderTools()
{
m_font = BMF_GetFont(BMF_kHelvetica10);
+
glGetIntegerv(GL_MAX_LIGHTS, (GLint*) &m_numgllights);
if (m_numgllights < 8)
m_numgllights = 8;
}
-
GPC_RenderTools::~GPC_RenderTools()
{
}
+void GPC_RenderTools::BeginFrame(RAS_IRasterizer* rasty)
+{
+ m_clientobject = NULL;
+ m_lastlightlayer = -1;
+ m_lastlighting = false;
+ DisableOpenGLLights();
+}
void GPC_RenderTools::EndFrame(RAS_IRasterizer* rasty)
{
}
+/* ProcessLighting performs lighting on objects. the layer is a bitfield that
+ * contains layer information. There are 20 'official' layers in blender. A
+ * light is applied on an object only when they are in the same layer. OpenGL
+ * has a maximum of 8 lights (simultaneous), so 20 * 8 lights are possible in
+ * a scene. */
-void GPC_RenderTools::BeginFrame(RAS_IRasterizer* rasty)
+void GPC_RenderTools::ProcessLighting(int layer, const MT_Transform& viewmat)
{
- m_clientobject=NULL;
- m_modified=true;
- DisableOpenGLLights();
+ if(m_lastlightlayer == layer)
+ return;
-}
+ m_lastlightlayer = layer;
-int GPC_RenderTools::ProcessLighting(int layer)
-{
- int result = false;
+ bool enable = false;
- if (layer < 0)
- {
- DisableOpenGLLights();
- result = false;
- } else
+ if (layer >= 0)
{
if (m_clientobject)
- {
- if (applyLights(layer))
- {
- EnableOpenGLLights();
- result = true;
- } else
- {
- DisableOpenGLLights();
- result = false;
- }
+ {
+ if (layer == RAS_LIGHT_OBJECT_LAYER)
+ layer = static_cast<KX_GameObject*>(m_clientobject)->GetLayer();
+
+ enable = applyLights(layer, viewmat);
}
}
- return result;
+
+ if(enable)
+ EnableOpenGLLights();
+ else
+ DisableOpenGLLights();
}
void GPC_RenderTools::EnableOpenGLLights()
{
+ if(m_lastlighting == true)
+ return;
+
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK,GL_DIFFUSE);
+
+ glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, true);
if (GLEW_EXT_separate_specular_color || GLEW_VERSION_1_2)
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
+
+ m_lastlighting = true;
+}
+
+void GPC_RenderTools::DisableOpenGLLights()
+{
+ if(m_lastlighting == false)
+ return;
+
+ glDisable(GL_LIGHTING);
+ glDisable(GL_COLOR_MATERIAL);
+
+ m_lastlighting = false;
+}
+
+
+void GPC_RenderTools::SetClientObject(RAS_IRasterizer *rasty, void* obj)
+{
+ if (m_clientobject != obj)
+ {
+ bool ccw = (obj == NULL || !((KX_GameObject*)obj)->IsNegativeScaling());
+ rasty->SetFrontFace(ccw);
+
+ m_clientobject = obj;
+ }
+}
+
+bool GPC_RenderTools::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data)
+{
+ double* const oglmatrix = (double* const) data;
+ MT_Point3 resultpoint(result->m_hitPoint);
+ MT_Vector3 resultnormal(result->m_hitNormal);
+ MT_Vector3 left(oglmatrix[0],oglmatrix[1],oglmatrix[2]);
+ MT_Vector3 dir = -(left.cross(resultnormal)).safe_normalized();
+ left = (dir.cross(resultnormal)).safe_normalized();
+ // for the up vector, we take the 'resultnormal' returned by the physics
+
+ double maat[16]={
+ left[0], left[1], left[2], 0,
+ dir[0], dir[1], dir[2], 0,
+ resultnormal[0],resultnormal[1],resultnormal[2], 0,
+ 0, 0, 0, 1};
+ glTranslated(resultpoint[0],resultpoint[1],resultpoint[2]);
+ //glMultMatrixd(oglmatrix);
+ glMultMatrixd(maat);
+ return true;
}
-void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
- const char* text,
- int xco,
- int yco,
- int width,
- int height)
+void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,int objectdrawmode )
+{
+ /* FIXME:
+ blender: intern/moto/include/MT_Vector3.inl:42: MT_Vector3 operator/(const
+ MT_Vector3&, double): Assertion `!MT_fuzzyZero(s)' failed.
+
+ Program received signal SIGABRT, Aborted.
+ [Switching to Thread 16384 (LWP 1519)]
+ 0x40477571 in kill () from /lib/libc.so.6
+ (gdb) bt
+ #7 0x08334368 in MT_Vector3::normalized() const ()
+ #8 0x0833e6ec in GPC_RenderTools::applyTransform(RAS_IRasterizer*, double*, int) ()
+ */
+
+ if (objectdrawmode & RAS_IPolyMaterial::BILLBOARD_SCREENALIGNED ||
+ objectdrawmode & RAS_IPolyMaterial::BILLBOARD_AXISALIGNED)
+ {
+ // rotate the billboard/halo
+ //page 360/361 3D Game Engine Design, David Eberly for a discussion
+ // on screen aligned and axis aligned billboards
+ // assumed is that the preprocessor transformed all billboard polygons
+ // so that their normal points into the positive x direction (1.0 , 0.0 , 0.0)
+ // when new parenting for objects is done, this rotation
+ // will be moved into the object
+
+ MT_Point3 objpos (oglmatrix[12],oglmatrix[13],oglmatrix[14]);
+ MT_Point3 campos = rasty->GetCameraPosition();
+ MT_Vector3 dir = (campos - objpos).safe_normalized();
+ MT_Vector3 up(0,0,1.0);
+
+ KX_GameObject* gameobj = (KX_GameObject*) this->m_clientobject;
+ // get scaling of halo object
+ MT_Vector3 size = gameobj->GetSGNode()->GetLocalScale();
+
+ bool screenaligned = (objectdrawmode & RAS_IPolyMaterial::BILLBOARD_SCREENALIGNED)!=0;//false; //either screen or axisaligned
+ if (screenaligned)
+ {
+ up = (up - up.dot(dir) * dir).safe_normalized();
+ } else
+ {
+ dir = (dir - up.dot(dir)*up).safe_normalized();
+ }
+
+ MT_Vector3 left = dir.normalized();
+ dir = (left.cross(up)).normalized();
+
+ // we have calculated the row vectors, now we keep
+ // local scaling into account:
+
+ left *= size[0];
+ dir *= size[1];
+ up *= size[2];
+ double maat[16]={
+ left[0], left[1],left[2], 0,
+ dir[0], dir[1],dir[2],0,
+ up[0],up[1],up[2],0,
+ 0,0,0,1};
+ glTranslated(objpos[0],objpos[1],objpos[2]);
+ glMultMatrixd(maat);
+
+ } else
+ {
+ if (objectdrawmode & RAS_IPolyMaterial::SHADOW)
+ {
+ // shadow must be cast to the ground, physics system needed here!
+ MT_Point3 frompoint(oglmatrix[12],oglmatrix[13],oglmatrix[14]);
+ KX_GameObject *gameobj = (KX_GameObject*) this->m_clientobject;
+ MT_Vector3 direction = MT_Vector3(0,0,-1);
+
+ direction.normalize();
+ direction *= 100000;
+
+ MT_Point3 topoint = frompoint + direction;
+
+ KX_Scene* kxscene = (KX_Scene*) m_auxilaryClientInfo;
+ PHY_IPhysicsEnvironment* physics_environment = kxscene->GetPhysicsEnvironment();
+ KX_IPhysicsController* physics_controller = gameobj->GetPhysicsController();
+
+ KX_GameObject *parent = gameobj->GetParent();
+ if (!physics_controller && parent)
+ physics_controller = parent->GetPhysicsController();
+ if (parent)
+ parent->Release();
+
+ KX_RayCast::Callback<GPC_RenderTools> callback(this, physics_controller, oglmatrix);
+ if (!KX_RayCast::RayTest(physics_environment, frompoint, topoint, callback))
+ {
+ // couldn't find something to cast the shadow on...
+ glMultMatrixd(oglmatrix);
+ }
+ } else
+ {
+
+ // 'normal' object
+ glMultMatrixd(oglmatrix);
+ }
+ }
+}
+
+
+void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
+ const char* text,
+ int xco,
+ int yco,
+ int width,
+ int height)
{
STR_String tmpstr(text);
int lines;
@@ -234,21 +349,19 @@ void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode,
glDisable(GL_LIGHTING);
}
-/**
- * Copied from KX_BlenderRenderTools.cpp in KX_blenderhook
- * Renders text into a (series of) polygon(s), using a texture font,
- * Each character consists of one polygon (one quad or two triangles)
- */
+/* Render Text renders text into a (series of) polygon, using a texture font,
+ * Each character consists of one polygon (one quad or two triangles) */
+
void GPC_RenderTools::RenderText(
int mode,
RAS_IPolyMaterial* polymat,
- float v1[3], float v2[3], float v3[3], float v4[3])
+ float v1[3], float v2[3], float v3[3], float v4[3], int glattrib)
{
STR_String mytext = ((CValue*)m_clientobject)->GetPropertyText("Text");
const unsigned int flag = polymat->GetFlag();
struct MTFace* tface = 0;
- unsigned int* col = 0;
+ unsigned int *col = 0;
if(flag & RAS_BLENDERMAT) {
KX_BlenderMaterial *bl_mat = static_cast<KX_BlenderMaterial*>(polymat);
@@ -259,110 +372,29 @@ void GPC_RenderTools::RenderText(
tface = blenderpoly->GetMTFace();
col = blenderpoly->GetMCol();
}
-
- BL_RenderText(mode, mytext, mytext.Length(), tface, col, v1, v2, v3, v4);
+
+ GPU_render_text(tface, mode, mytext, mytext.Length(), col, v1, v2, v3, v4, glattrib);
}
-
-/**
- * Copied from KX_BlenderGL.cpp in KX_blenderhook
- */
-void GPC_RenderTools::BL_RenderText(
- int mode,
- const char* textstr,
- int textlen,
- struct MTFace* tface,
- unsigned int* col,
- float v1[3],float v2[3],float v3[3],float v4[3])
+void GPC_RenderTools::PushMatrix()
{
- struct Image* ima;
-
- if (mode & TF_BMFONT) {
- //char string[MAX_PROPSTRING];
-// float tmat[4][4];
- int characters, index, character;
- float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance;
-
-// bProperty *prop;
-
- // string = "Frank van Beek";
-
- characters = textlen;
-
- ima = (struct Image*) tface->tpage;
- if (ima == NULL) {
- characters = 0;
- }
-
- if(!col) glColor3f(1.0f, 1.0f, 1.0f);
-
- glPushMatrix();
- for (index = 0; index < characters; index++) {
- // lets calculate offset stuff
- character = textstr[index];
-
- // space starts at offset 1
- // character = character - ' ' + 1;
-
- matrixGlyph((ImBuf *)ima->ibufs.first, character, & centerx, &centery, &sizex, &sizey, &transx, &transy, &movex, &movey, &advance);
-
- glBegin(GL_POLYGON);
- // printf(" %c %f %f %f %f\n", character, tface->uv[0][0], tface->uv[0][1], );
- // glTexCoord2f((tface->uv[0][0] - centerx) * sizex + transx, (tface->uv[0][1] - centery) * sizey + transy);
- glTexCoord2f((tface->uv[0][0] - centerx) * sizex + transx, (tface->uv[0][1] - centery) * sizey + transy);
-
- if(col) BL_spack(col[0]);
- // glVertex3fv(v1);
- glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]);
-
- glTexCoord2f((tface->uv[1][0] - centerx) * sizex + transx, (tface->uv[1][1] - centery) * sizey + transy);
- if(col) BL_spack(col[1]);
- // glVertex3fv(v2);
- glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]);
-
- glTexCoord2f((tface->uv[2][0] - centerx) * sizex + transx, (tface->uv[2][1] - centery) * sizey + transy);
- if(col) BL_spack(col[2]);
- // glVertex3fv(v3);
- glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]);
-
- if(v4) {
- // glTexCoord2f((tface->uv[3][0] - centerx) * sizex + transx, 1.0 - (1.0 - tface->uv[3][1]) * sizey - transy);
- glTexCoord2f((tface->uv[3][0] - centerx) * sizex + transx, (tface->uv[3][1] - centery) * sizey + transy);
- if(col) BL_spack(col[3]);
- // glVertex3fv(v4);
- glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]);
- }
- glEnd();
-
- glTranslatef(advance, 0.0, 0.0);
- }
- glPopMatrix();
-
- }
+ glPushMatrix();
}
-
-RAS_IPolyMaterial* GPC_RenderTools::CreateBlenderPolyMaterial(
- const STR_String &texname,
- bool ba,const STR_String& matname,int tile,int tilexrep,int tileyrep,int mode,bool transparant, bool zsort,
- int lightlayer,bool bIsTriangle,void* clientobject,void* tface)
+void GPC_RenderTools::PopMatrix()
{
- assert(!"Deprecated");
-/* return new GPC_PolygonMaterial(texname, ba,matname,tile,tilexrep,tileyrep,
- mode,transparant,zsort,lightlayer,bIsTriangle,clientobject,tface);
- */
- return NULL;
+ glPopMatrix();
}
-int GPC_RenderTools::applyLights(int objectlayer)
+int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat)
{
-// taken from blender source, incompatibility between Blender Object / GameObject
-
- int count;
+ // taken from blender source, incompatibility between Blender Object / GameObject
+ float glviewmat[16];
+ unsigned int count;
float vec[4];
-
+
vec[3]= 1.0;
for(count=0; count<m_numgllights; count++)
@@ -371,23 +403,20 @@ int GPC_RenderTools::applyLights(int objectlayer)
//std::vector<struct RAS_LightObject*> m_lights;
std::vector<struct RAS_LightObject*>::iterator lit = m_lights.begin();
+ viewmat.getValue(glviewmat);
+ glPushMatrix();
+ glLoadMatrixf(glviewmat);
for (lit = m_lights.begin(), count = 0; !(lit==m_lights.end()) && count < m_numgllights; ++lit)
{
RAS_LightObject* lightdata = (*lit);
if (lightdata->m_layer & objectlayer)
{
-
- glPushMatrix();
- glLoadMatrixf(m_viewmat);
-
-
vec[0] = (*(lightdata->m_worldmatrix))(0,3);
vec[1] = (*(lightdata->m_worldmatrix))(1,3);
vec[2] = (*(lightdata->m_worldmatrix))(2,3);
vec[3] = 1;
-
if(lightdata->m_type==RAS_LightObject::LIGHT_SUN) {
vec[0] = (*(lightdata->m_worldmatrix))(0,2);
@@ -443,142 +472,16 @@ int GPC_RenderTools::applyLights(int objectlayer)
}
glLightfv((GLenum)(GL_LIGHT0+count), GL_SPECULAR, vec);
glEnable((GLenum)(GL_LIGHT0+count));
-
- count++;
- glPopMatrix();
+ count++;
}
}
+ glPopMatrix();
return count;
}
-void GPC_RenderTools::SetClientObject(void* obj)
-{
- if (m_clientobject != obj)
- {
- if (obj == NULL || !((KX_GameObject*)obj)->IsNegativeScaling())
- {
- glFrontFace(GL_CCW);
- } else
- {
- glFrontFace(GL_CW);
- }
- m_clientobject = obj;
- m_modified = true;
- }
-}
-
-bool GPC_RenderTools::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data)
-{
- double* const oglmatrix = (double* const) data;
- MT_Point3 resultpoint(hit_point);
- MT_Vector3 resultnormal(hit_normal);
- MT_Vector3 left(oglmatrix[0],oglmatrix[1],oglmatrix[2]);
- MT_Vector3 dir = -(left.cross(resultnormal)).safe_normalized();
- left = (dir.cross(resultnormal)).safe_normalized();
- // for the up vector, we take the 'resultnormal' returned by the physics
-
- double maat[16]={
- left[0], left[1], left[2], 0,
- dir[0], dir[1], dir[2], 0,
- resultnormal[0],resultnormal[1],resultnormal[2], 0,
- 0, 0, 0, 1};
- glTranslated(resultpoint[0],resultpoint[1],resultpoint[2]);
- //glMultMatrixd(oglmatrix);
- glMultMatrixd(maat);
- return true;
-}
-
-void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,int objectdrawmode )
-{
- if (objectdrawmode & RAS_IPolyMaterial::BILLBOARD_SCREENALIGNED ||
- objectdrawmode & RAS_IPolyMaterial::BILLBOARD_AXISALIGNED)
- {
- // rotate the billboard/halo
- //page 360/361 3D Game Engine Design, David Eberly for a discussion
- // on screen aligned and axis aligned billboards
- // assumed is that the preprocessor transformed all billboard polygons
- // so that their normal points into the positive x direction (1.0 , 0.0 , 0.0)
- // when new parenting for objects is done, this rotation
- // will be moved into the object
-
- MT_Point3 objpos (oglmatrix[12],oglmatrix[13],oglmatrix[14]);
- MT_Point3 campos = rasty->GetCameraPosition();
- MT_Vector3 dir = (campos - objpos).safe_normalized();
- MT_Vector3 up(0,0,1.0);
-
- KX_GameObject* gameobj = (KX_GameObject*) this->m_clientobject;
- // get scaling of halo object
- MT_Vector3 size = gameobj->GetSGNode()->GetLocalScale();
-
- bool screenaligned = (objectdrawmode & RAS_IPolyMaterial::BILLBOARD_SCREENALIGNED)!=0;//false; //either screen or axisaligned
- if (screenaligned)
- {
- up = (up - up.dot(dir) * dir).safe_normalized();
- } else
- {
- dir = (dir - up.dot(dir)*up).safe_normalized();
- }
-
- MT_Vector3 left = dir.normalized();
- dir = (left.cross(up)).normalized();
-
- // we have calculated the row vectors, now we keep
- // local scaling into account:
-
- left *= size[0];
- dir *= size[1];
- up *= size[2];
- double maat[16]={
- left[0], left[1],left[2], 0,
- dir[0], dir[1],dir[2],0,
- up[0],up[1],up[2],0,
- 0,0,0,1};
- glTranslated(objpos[0],objpos[1],objpos[2]);
- glMultMatrixd(maat);
-
- } else
- {
- if (objectdrawmode & RAS_IPolyMaterial::SHADOW)
- {
- // shadow must be cast to the ground, physics system needed here!
- MT_Point3 frompoint(oglmatrix[12],oglmatrix[13],oglmatrix[14]);
- KX_GameObject *gameobj = (KX_GameObject*) this->m_clientobject;
- MT_Vector3 direction = MT_Vector3(0,0,-1);
-
- direction.normalize();
- direction *= 100000;
-
- MT_Point3 topoint = frompoint + direction;
-
- KX_Scene* kxscene = (KX_Scene*) m_auxilaryClientInfo;
- PHY_IPhysicsEnvironment* physics_environment = kxscene->GetPhysicsEnvironment();
- KX_IPhysicsController* physics_controller = gameobj->GetPhysicsController();
-
- KX_GameObject *parent = gameobj->GetParent();
- if (!physics_controller && parent)
- physics_controller = parent->GetPhysicsController();
- if (parent)
- parent->Release();
-
- MT_Point3 resultpoint;
- MT_Vector3 resultnormal;
- if (!KX_RayCast::RayTest(physics_controller, physics_environment, frompoint, topoint, resultpoint, resultnormal, KX_RayCast::Callback<GPC_RenderTools>(this, oglmatrix)))
- {
- // couldn't find something to cast the shadow on...
- glMultMatrixd(oglmatrix);
- }
- } else
- {
-
- // 'normal' object
- glMultMatrixd(oglmatrix);
- }
- }
-}
-
void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer)
{
int state = rasterizer->GetMotionBlurState();
@@ -609,7 +512,6 @@ void GPC_RenderTools::Update2DFilter(vector<STR_String>& propNames, void* gameOb
void GPC_RenderTools::Render2DFilters(RAS_ICanvas* canvas)
{
- m_filtermanager.RenderFilters( canvas);
+ m_filtermanager.RenderFilters(canvas);
}
-unsigned int GPC_RenderTools::m_numgllights;
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.h b/source/gameengine/GamePlayer/common/GPC_RenderTools.h
index 8fae3d2b305..382956e73ea 100644
--- a/source/gameengine/GamePlayer/common/GPC_RenderTools.h
+++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.h
@@ -31,114 +31,67 @@
#define __GPC_RENDERTOOLS_H
#ifdef WIN32
- #include <windows.h>
+// don't show stl-warnings
+#pragma warning (disable:4786)
+#include <windows.h>
#endif // WIN32
-#include "GL/glew.h"
-
#include "RAS_IRenderTools.h"
#include "BMF_Api.h"
struct KX_ClientObjectInfo;
+class KX_RayCast;
+/* BlenderRenderTools are a set of tools to apply 2D/3D graphics effects, which
+ * are not part of the (polygon) Rasterizer. Effects like 2D text, 3D (polygon)
+ * text, lighting.
+ *
+ * Most of this code is duplicated in KX_BlenderRenderTools, so this should be
+ * moved to some common location to avoid duplication. */
class GPC_RenderTools : public RAS_IRenderTools
{
+ int m_lastlightlayer;
+ bool m_lastlighting;
+ static unsigned int m_numgllights;
+
+ BMF_Font* m_font;
+
public:
- GPC_RenderTools();
- virtual ~GPC_RenderTools();
-
- virtual void EndFrame(RAS_IRasterizer* rasty);
- virtual void BeginFrame(RAS_IRasterizer* rasty);
-
- void DisableOpenGLLights()
- {
- glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
- }
-
- void EnableOpenGLLights();
-
- int ProcessLighting(int layer);
-
- void Perspective(int a, int width, int height, float mat[4][4], float viewmat[4][4])
- {
- if(a== 0)
- {
- glMatrixMode(GL_PROJECTION);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- }
- else
- {
- if(a== 1)
- {
- glMatrixMode(GL_PROJECTION);
- glMatrixMode(GL_MODELVIEW);
- }
- }
- }
-
- /**
- * @attention mode is ignored here
- */
- virtual void RenderText2D(
- RAS_TEXT_RENDER_MODE mode,
- const char* text,
- int xco,
- int yco,
- int width,
- int height);
-
- /**
- * Renders text into a (series of) polygon(s), using a texture font,
- * Each character consists of one polygon (one quad or two triangles)
- */
- virtual void RenderText(
- int mode,
- RAS_IPolyMaterial* polymat,
- float v1[3],
- float v2[3],
- float v3[3],
- float v4[3]);
-
- void Render(RAS_IRasterizer* rasty,double* oglmatrix,int objectdrawmode)
- {
- glPopMatrix();
- glPushMatrix();
- glMultMatrixd(oglmatrix);
- }
-
- void applyTransform(RAS_IRasterizer* rasty, double* oglmatrix, int objectdrawmode);
-
- virtual void PushMatrix()
- {
- glPushMatrix();
- }
-
- virtual void PopMatrix()
- {
- glPopMatrix();
- }
-
- virtual class RAS_IPolyMaterial* CreateBlenderPolyMaterial(
- const STR_String &texname,
- bool ba,
- const STR_String& matname,
- int tile,
- int tilexrep,int tileyrep,
- int mode,
- bool transparant,
- bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject,
- void* tface);
-
- int applyLights(int objectlayer);
-
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ GPC_RenderTools();
+ virtual ~GPC_RenderTools();
+
+ void EndFrame(RAS_IRasterizer* rasty);
+ void BeginFrame(RAS_IRasterizer* rasty);
+
+ void EnableOpenGLLights();
+ void DisableOpenGLLights();
+ void ProcessLighting(int layer, const MT_Transform& viewmat);
+
+ /* @attention mode is ignored here */
+ void RenderText2D(RAS_TEXT_RENDER_MODE mode,
+ const char* text,
+ int xco,
+ int yco,
+ int width,
+ int height);
+ void RenderText(int mode,
+ class RAS_IPolyMaterial* polymat,
+ float v1[3],
+ float v2[3],
+ float v3[3],
+ float v4[3],
+ int glattrib);
+
+ void applyTransform(RAS_IRasterizer* rasty, double* oglmatrix, int objectdrawmode);
+ int applyLights(int objectlayer, const MT_Transform& viewmat);
+
+ void PushMatrix();
+ void PopMatrix();
+
+ bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo* client) { return true; }
virtual void MotionBlur(RAS_IRasterizer* rasterizer);
@@ -146,28 +99,7 @@ public:
virtual void Render2DFilters(RAS_ICanvas* canvas);
- virtual void SetClientObject(void* obj);
-
-protected:
- /**
- * Copied from KX_BlenderGL.cpp in KX_blenderhook
- */
- void BL_RenderText(
- int mode,
- const char* textstr,
- int textlen,
- struct MTFace* tface,
- unsigned int* col,
- float v1[3],float v2[3],float v3[3],float v4[3]);
- void BL_spack(unsigned int ucol)
- {
- char *cp = (char *)&ucol;
- glColor3ub(cp[3], cp[2], cp[1]);
- }
-
-
- BMF_Font* m_font;
- static unsigned int m_numgllights;
+ virtual void SetClientObject(RAS_IRasterizer *rasty, void* obj);
};
#endif // __GPC_RENDERTOOLS_H
diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile
index 19d792ddbdb..6a12e659be6 100644
--- a/source/gameengine/GamePlayer/common/Makefile
+++ b/source/gameengine/GamePlayer/common/Makefile
@@ -43,6 +43,7 @@ CPPFLAGS += -I../../../blender/blenloader
CPPFLAGS += -I../../../blender/blenlib
CPPFLAGS += -I../../../blender/imbuf
CPPFLAGS += -I../../../blender/makesdna
+CPPFLAGS += -I../../../blender/gpu
CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
@@ -72,10 +73,6 @@ CPPFLAGS += -I../../../gameengine/Rasterizer/RAS_OpenGLRasterizer
CPPFLAGS += -I../../../gameengine/Physics/Sumo
CPPFLAGS += -I../../../gameengine/Physics/common
-ifeq ($(WITH_BF_GLEXT),true)
- CPPFLAGS += -DWITH_GLEXT
-endif
-
###############################
SOURCEDIR = source/gameengine/GamePlayer/common
diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript
index 3b2367d2592..30f20a670d3 100644
--- a/source/gameengine/GamePlayer/common/SConscript
+++ b/source/gameengine/GamePlayer/common/SConscript
@@ -8,7 +8,6 @@ source_files = ['bmfont.cpp',
'GPC_Engine.cpp',
'GPC_KeyboardDevice.cpp',
'GPC_MouseDevice.cpp',
- 'GPC_PolygonMaterial.cpp',
'GPC_RawImage.cpp',
'GPC_RawLoadDotBlendArray.cpp',
'GPC_RawLogoArrays.cpp',
@@ -46,6 +45,7 @@ incs = ['.',
'#source/gameengine/GamePlayer/ghost',
'#source/blender/misc',
'#source/blender/blenloader',
+ '#source/blender/gpu',
'#extern/glew/include']
#This is all plugin stuff!
diff --git a/source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h b/source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h
index fee729a84ac..e5ed7f39811 100644
--- a/source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h
+++ b/source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h
@@ -37,9 +37,9 @@ class GPU_PolygonMaterial : public BP_PolygonMaterial
public:
GPUPolygonMaterial(const STR_String& texname, bool ba,const STR_String& matname,
int tile, int tileXrep, int tileYrep, int mode, int transparant,
- int lightlayer,bool bIsTriangle,void* clientobject,void* tpage) :
+ int lightlayer,,void* tpage) :
BP_PolygonMaterial(texname, ba,matname, tile, tileXrep, tileYrep,
- mode, transparant, lightlayer, bIsTriangle, clientobject),
+ mode, transparant, lightlayer),
m_tface(tpage)
{
}
diff --git a/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h b/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h
index bb1abd71505..bf8cb720811 100644
--- a/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h
+++ b/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h
@@ -36,7 +36,7 @@
#include <iostream>
#include <windows.h>
-#include <gl/gl.h>
+//#include <gl/gl.h>
#include "GPC_Canvas.h"
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index d9f0675001f..5e0ca93ac06 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -64,6 +64,7 @@ SET(INC
../../../../source/gameengine/GamePlayer/common
../../../../source/blender/misc
../../../../source/blender/blenloader
+ ../../../../source/blender/gpu
../../../../extern/solid
../../../../extern/glew/include
${PYTHON_INC}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index b5ebffb9378..806216e05bb 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -38,6 +38,7 @@
#endif
#include "GL/glew.h"
+#include "GPU_extensions.h"
#include "GPG_Application.h"
@@ -56,6 +57,7 @@ extern "C"
#include "BLO_readfile.h"
#include "BKE_global.h"
#include "BKE_main.h"
+#include "DNA_scene_types.h"
#ifdef __cplusplus
}
#endif // __cplusplus
@@ -96,16 +98,17 @@ extern "C"
#include "GHOST_IEventConsumer.h"
#include "GHOST_IWindow.h"
#include "GHOST_Rect.h"
-
+#include "marshal.h"
static void frameTimerProc(GHOST_ITimerTask* task, GHOST_TUns64 time);
static GHOST_ISystem* fSystem = 0;
static const int kTimerFreq = 10;
-GPG_Application::GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR_String startSceneName)
- : m_startSceneName(startSceneName),
- m_maggie(maggie),
+GPG_Application::GPG_Application(GHOST_ISystem* system)
+ : m_startSceneName(""),
+ m_startScene(0),
+ m_maggie(0),
m_exitRequested(0),
m_system(system),
m_mainWindow(0),
@@ -124,7 +127,9 @@ GPG_Application::GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR
m_networkdevice(0),
m_audiodevice(0),
m_blendermat(0),
- m_blenderglslmat(0)
+ m_blenderglslmat(0),
+ m_pyGlobalDictString(0),
+ m_pyGlobalDictString_Length(0)
{
fSystem = system;
}
@@ -139,15 +144,16 @@ GPG_Application::~GPG_Application(void)
-bool GPG_Application::SetGameEngineData(struct Main* maggie, STR_String startSceneName)
+bool GPG_Application::SetGameEngineData(struct Main* maggie, Scene *scene)
{
bool result = false;
- if (maggie != NULL && startSceneName != "")
+ if (maggie != NULL && scene != NULL)
{
- G.scene = (Scene*)maggie->scene.first;
+ G.scene = scene;
m_maggie = maggie;
- m_startSceneName = startSceneName;
+ m_startSceneName = scene->id.name+2;
+ m_startScene = scene;
result = true;
}
@@ -477,7 +483,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
{
if (!m_engineInitialized)
{
- glewInit();
+ GPU_extensions_init();
bgl::InitExtensions(true);
// get and set the preferences
@@ -496,12 +502,18 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
bool fixed_framerate= (SYS_GetCommandLineInt(syshandle, "fixed_framerate", fixedFr) != 0);
bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
- bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DIAPLAY_LISTS) != 0);
+ bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DISPLAY_LISTS) != 0);
if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) {
int gameflag =(G.fileflags & G_FILE_GAME_MAT);
m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", gameflag) != 0);
}
+
+ if(GPU_extensions_minimum_support()) {
+ int gameflag = (G.fileflags & G_FILE_GAME_MAT_GLSL);
+
+ m_blenderglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", gameflag) != 0);
+ }
// create the canvas, rasterizer and rendertools
m_canvas = new GPG_Canvas(window);
@@ -637,21 +649,31 @@ bool GPG_Application::startEngine(void)
m_mouse,
m_networkdevice,
m_audiodevice,
- startscenename);
+ startscenename,
+ m_startScene);
// some python things
PyObject* dictionaryobject = initGamePlayerPythonScripting("Ketsji", psl_Lowest);
m_ketsjiengine->SetPythonDictionary(dictionaryobject);
initRasterizer(m_rasterizer, m_canvas);
- PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module
+ PyObject *gameLogic = initGameLogic(m_ketsjiengine, startscene);
+ PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module
initGameKeys();
initPythonConstraintBinding();
-
-
-
-
-
+ initMathutils();
+
+ /* Restore the dict */
+ if (m_pyGlobalDictString) {
+ PyObject* pyGlobalDict = PyMarshal_ReadObjectFromString(m_pyGlobalDictString, m_pyGlobalDictString_Length);
+ if (pyGlobalDict) {
+ PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); // Same as importing the module.
+ } else {
+ PyErr_Clear();
+ printf("Error could not marshall string\n");
+ }
+ }
+
m_sceneconverter->ConvertScene(
startscenename,
startscene,
@@ -669,6 +691,11 @@ bool GPG_Application::startEngine(void)
m_ketsjiengine->StartEngine(true);
m_engineRunning = true;
+ // Set the animation playback rate for ipo's and actions
+ // the framerate below should patch with FPS macro defined in blendef.h
+ // Could be in StartEngine set the framerate, we need the scene to do this
+ m_ketsjiengine->SetAnimFrameRate( (((double) G.scene->r.frs_sec) / G.scene->r.frs_sec_base) );
+
}
if (!m_engineRunning)
@@ -682,6 +709,37 @@ bool GPG_Application::startEngine(void)
void GPG_Application::stopEngine()
{
+ // get the python dict and convert to a string for future use
+ {
+ SetPyGlobalDictMarshal(NULL, 0);
+
+ PyObject* gameLogic = PyImport_ImportModule("GameLogic");
+ if (gameLogic) {
+ PyObject* pyGlobalDict = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module
+ if (pyGlobalDict) {
+#ifdef Py_MARSHAL_VERSION
+ PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as of Py2.5
+#else
+ PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict );
+#endif
+ if (pyGlobalDictMarshal) {
+ m_pyGlobalDictString_Length = PyString_Size(pyGlobalDictMarshal);
+ PyObject_Print(pyGlobalDictMarshal, stderr, 0);
+ m_pyGlobalDictString = static_cast<char *> (malloc(m_pyGlobalDictString_Length));
+ memcpy(m_pyGlobalDictString, PyString_AsString(pyGlobalDictMarshal), m_pyGlobalDictString_Length);
+ } else {
+ printf("Error, GameLogic.globalDict could not be marshal'd\n");
+ }
+ Py_DECREF(gameLogic);
+ } else {
+ printf("Error, GameLogic.globalDict was removed\n");
+ }
+ } else {
+ printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n");
+ }
+ }
+
+
// when exiting the mainloop
exitGamePythonScripting();
m_ketsjiengine->StopEngine();
@@ -701,6 +759,8 @@ void GPG_Application::stopEngine()
void GPG_Application::exitEngine()
{
+ GPU_extensions_exit();
+
if (m_ketsjiengine)
{
stopEngine();
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index 17f5add8b19..5242a419808 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -50,14 +50,15 @@ class GPG_Canvas;
class GPG_KeyboardDevice;
class GPG_System;
struct Main;
+struct Scene;
class GPG_Application : public GHOST_IEventConsumer
{
public:
- GPG_Application(GHOST_ISystem* system, struct Main* maggie, STR_String startSceneName);
+ GPG_Application(GHOST_ISystem* system);
~GPG_Application(void);
- bool SetGameEngineData(struct Main* maggie,STR_String startSceneName);
+ bool SetGameEngineData(struct Main* maggie, struct Scene* scene);
bool startWindow(STR_String& title, int windowLeft, int windowTop, int windowWidth, int windowHeight,
const bool stereoVisual, const int stereoMode);
bool startFullScreen(int width, int height, int bpp, int frequency, const bool stereoVisual, const int stereoMode);
@@ -72,6 +73,29 @@ public:
bool StartGameEngine(int stereoMode);
void StopGameEngine();
+ char*
+ GetPyGlobalDictMarshal()
+ {
+ return m_pyGlobalDictString;
+ };
+
+ void
+ SetPyGlobalDictMarshal( char* pyGlobalDictString, int length )
+ {
+ if (m_pyGlobalDictString && m_pyGlobalDictString != pyGlobalDictString)
+ free(m_pyGlobalDictString);
+
+ m_pyGlobalDictString = pyGlobalDictString;
+ m_pyGlobalDictString_Length = length;
+ };
+
+ int
+ GetPyGlobalDictMarshalLength()
+ {
+ return m_pyGlobalDictString_Length;
+ };
+
+
protected:
bool handleWheel(GHOST_IEvent* event);
bool handleButton(GHOST_IEvent* event, bool isDown);
@@ -100,6 +124,7 @@ protected:
/* The game data */
STR_String m_startSceneName;
+ struct Scene* m_startScene;
struct Main* m_maggie;
/* Exit state. */
@@ -142,6 +167,12 @@ protected:
bool m_blendermat;
bool m_blenderglslmat;
-
+
+ /*
+ * GameLogic.globalDict as a string so that loading new blend files can use the same dict.
+ * Do this because python starts/stops when loading blend files.
+ */
+ char* m_pyGlobalDictString;
+ int m_pyGlobalDictString_Length;
};
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 8222e5c8bac..cc781a38bbb 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -64,13 +64,15 @@ extern "C"
#ifdef __cplusplus
}
#endif // __cplusplus
+
+#include "GPU_draw.h"
+
/**********************************
* End Blender include block
**********************************/
#include "SYS_System.h"
#include "GPG_Application.h"
-#include "GPC_PolygonMaterial.h"
#include "GHOST_ISystem.h"
#include "RAS_IRasterizer.h"
@@ -282,7 +284,7 @@ int main(int argc, char** argv)
bool fullScreenParFound = false;
bool windowParFound = false;
bool closeConsole = true;
- RAS_IRasterizer::StereoMode stereomode;
+ RAS_IRasterizer::StereoMode stereomode = RAS_IRasterizer::RAS_STEREO_NOSTEREO;
bool stereoWindow = false;
bool stereoParFound = false;
int windowLeft = 100;
@@ -293,7 +295,9 @@ int main(int argc, char** argv)
GHOST_TUns32 fullScreenHeight= 0;
int fullScreenBpp = 32;
int fullScreenFrequency = 60;
-
+ char* pyGlobalDictString = NULL; /* store python dict data between blend file loading */
+ int pyGlobalDictString_Length = 0;
+
#ifdef __linux__
#ifdef __alpha__
signal (SIGFPE, SIG_IGN);
@@ -523,8 +527,6 @@ int main(int argc, char** argv)
return 0;
}
- if (!stereoParFound) stereomode = RAS_IRasterizer::RAS_STEREO_NOSTEREO;
-
#ifdef WIN32
if (scr_saver_mode != SCREEN_SAVER_MODE_CONFIGURATION)
#endif
@@ -537,7 +539,7 @@ int main(int argc, char** argv)
if (SYS_GetCommandLineInt(syshandle, "nomipmap", 0))
{
- GPC_PolygonMaterial::SetMipMappingEnabled(0);
+ GPU_set_mipmap(0);
}
// Create the system
@@ -559,7 +561,7 @@ int main(int argc, char** argv)
{
int exitcode = KX_EXIT_REQUEST_NO_REQUEST;
STR_String exitstring = "";
- GPG_Application app(system, NULL, exitstring);
+ GPG_Application app(system);
bool firstTimeRunning = true;
char *filename = get_filename(argc, argv);
char *titlename;
@@ -617,7 +619,7 @@ int main(int argc, char** argv)
#endif // WIN32
Main *maggie = bfd->main;
Scene *scene = bfd->curscene;
- char *startscenename = scene->id.name + 2;
+ G.main = maggie;
G.fileflags = bfd->fileflags;
//Seg Fault; icon.c gIcons == 0
@@ -625,6 +627,10 @@ int main(int argc, char** argv)
titlename = maggie->name;
+ // Set the GameLogic.globalDict from marshal'd data, so we can load new blend files
+ // abd keep data in GameLogic.globalDict
+ app.SetPyGlobalDictMarshal(pyGlobalDictString, pyGlobalDictString_Length);
+
// Check whether the game should be displayed full-screen
if ((!fullScreenParFound) && (!windowParFound))
{
@@ -655,7 +661,7 @@ int main(int argc, char** argv)
}
// GPG_Application app (system, maggie, startscenename);
- app.SetGameEngineData(maggie, startscenename);
+ app.SetGameEngineData(maggie, scene);
if (firstTimeRunning)
{
@@ -750,6 +756,12 @@ int main(int argc, char** argv)
}
}
app.StopGameEngine();
+
+ // GameLogic.globalDict has been converted into a buffer
+ // store in pyGlobalDictString so we can restore after python has stopped and started.
+ pyGlobalDictString = app.GetPyGlobalDictMarshal();
+ pyGlobalDictString_Length = app.GetPyGlobalDictMarshalLength();
+
BLO_blendfiledata_free(bfd);
#ifdef __APPLE__
@@ -772,6 +784,11 @@ int main(int argc, char** argv)
}
}
+ if (pyGlobalDictString) {
+ free(pyGlobalDictString);
+ pyGlobalDictString = NULL;
+ }
+
return error ? -1 : 0;
}
diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile
index 13940ac3fc8..0b187791734 100644
--- a/source/gameengine/GamePlayer/ghost/Makefile
+++ b/source/gameengine/GamePlayer/ghost/Makefile
@@ -69,6 +69,7 @@ CPPFLAGS += -I../../../blender/blenloader
CPPFLAGS += -I../../../blender/imbuf
CPPFLAGS += -I../../../blender/makesdna
CPPFLAGS += -I../../../blender/readblenfile
+CPPFLAGS += -I../../../blender/gpu
CPPFLAGS += -I../../../gameengine/BlenderRoutines
@@ -80,7 +81,3 @@ CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_GHOST)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-ifeq ($(WITH_BF_GLEXT),true)
- CPPFLAGS += -DWITH_GLEXT
-endif
-
diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript
index f3cce6c7443..33cf07b6211 100644
--- a/source/gameengine/GamePlayer/ghost/SConscript
+++ b/source/gameengine/GamePlayer/ghost/SConscript
@@ -40,6 +40,7 @@ incs = ['.',
'#source/gameengine/GamePlayer/common',
'#source/blender/misc',
'#source/blender/blenloader',
+ '#source/blender/gpu',
'#extern/glew/include']
incs += Split(env['BF_PYTHON_INC'])
@@ -48,8 +49,5 @@ cflags = []
if env['OURPLATFORM']=='win32-vc':
cflags = ['/GR']
-if env['WITH_BF_GLEXT'] == 1:
- env['CPPFLAGS'].append('-DWITH_GLEXT')
-
env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=0, compileflags=cflags)
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp
index dd45d522b9f..8ec463be6ff 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.cpp
+++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp
@@ -1,79 +1,72 @@
#include "DNA_customdata_types.h"
#include "DNA_material_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_global.h"
+#include "BKE_main.h"
#include "BL_BlenderShader.h"
#include "BL_Material.h"
-#ifdef BLENDER_GLSL
#include "GPU_extensions.h"
#include "GPU_material.h"
-#endif
+#include "RAS_BucketManager.h"
#include "RAS_MeshObject.h"
#include "RAS_IRasterizer.h"
+
+BL_BlenderShader::BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer)
+:
+ mScene(scene),
+ mMat(ma),
+ mLightLayer(lightlayer)
+{
+ mBlenderScene = scene->GetBlenderScene();
+ mBlendMode = GPU_BLEND_SOLID;
+
+ if(mMat)
+ GPU_material_from_blender(mBlenderScene, mMat);
+}
-const bool BL_BlenderShader::Ok()const
+BL_BlenderShader::~BL_BlenderShader()
{
-#ifdef BLENDER_GLSL
- return (mGPUMat != 0);
-#else
- return 0;
-#endif
+ if(mMat && GPU_material_from_blender(mBlenderScene, mMat))
+ GPU_material_unbind(GPU_material_from_blender(mBlenderScene, mMat));
}
-BL_BlenderShader::BL_BlenderShader(struct Material *ma, int lightlayer)
-:
-#ifdef BLENDER_GLSL
- mGPUMat(0),
-#endif
- mBound(false),
- mLightLayer(lightlayer)
+bool BL_BlenderShader::Ok()
{
-#ifdef BLENDER_GLSL
- if(ma) {
- GPU_material_from_blender(ma);
- mGPUMat = ma->gpumaterial;
- }
-#endif
+ return VerifyShader();
}
-BL_BlenderShader::~BL_BlenderShader()
+bool BL_BlenderShader::VerifyShader()
{
-#ifdef BLENDER_GLSL
- if(mGPUMat) {
- GPU_material_unbind(mGPUMat);
- mGPUMat = 0;
- }
-#endif
+ if(mMat)
+ return (GPU_material_from_blender(mBlenderScene, mMat) != 0);
+ else
+ return false;
}
-void BL_BlenderShader::SetProg(bool enable)
+void BL_BlenderShader::SetProg(bool enable, double time)
{
-#ifdef BLENDER_GLSL
- if(mGPUMat) {
- if(enable) {
- GPU_material_bind(mGPUMat, mLightLayer);
- mBound = true;
- }
- else {
- GPU_material_unbind(mGPUMat);
- mBound = false;
- }
+ if(VerifyShader()) {
+ if(enable)
+ GPU_material_bind(GPU_material_from_blender(mBlenderScene, mMat), mLightLayer, ~0, time);
+ else
+ GPU_material_unbind(GPU_material_from_blender(mBlenderScene, mMat));
}
-#endif
}
int BL_BlenderShader::GetAttribNum()
{
-#ifdef BLENDER_GLSL
GPUVertexAttribs attribs;
int i, enabled = 0;
- if(!mGPUMat)
+ if(!VerifyShader())
return enabled;
- GPU_material_vertex_attributes(mGPUMat, &attribs);
+ GPU_material_vertex_attributes(GPU_material_from_blender(mBlenderScene, mMat), &attribs);
for(i = 0; i < attribs.totlayer; i++)
if(attribs.layer[i].glindex+1 > enabled)
@@ -83,24 +76,23 @@ int BL_BlenderShader::GetAttribNum()
enabled = BL_MAX_ATTRIB;
return enabled;
-#else
- return 0;
-#endif
}
void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat)
{
-#ifdef BLENDER_GLSL
GPUVertexAttribs attribs;
+ GPUMaterial *gpumat;
int i, attrib_num;
ras->SetAttribNum(0);
- if(!mGPUMat)
+ if(!VerifyShader())
return;
+
+ gpumat = GPU_material_from_blender(mBlenderScene, mMat);
if(ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) {
- GPU_material_vertex_attributes(mGPUMat, &attribs);
+ GPU_material_vertex_attributes(gpumat, &attribs);
attrib_num = GetAttribNum();
ras->SetTexCoordNum(0);
@@ -131,45 +123,48 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat)
else
ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_DISABLE, attribs.layer[i].glindex);
}
-
- ras->EnableTextures(true);
}
- else
- ras->EnableTextures(false);
-#endif
}
-void BL_BlenderShader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty )
+void BL_BlenderShader::Update(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty )
{
-#ifdef BLENDER_GLSL
- float obmat[4][4], viewmat[4][4], viewinvmat[4][4];
+ float obmat[4][4], viewmat[4][4], viewinvmat[4][4], obcol[4];
+ GPUMaterial *gpumat;
- if(!mGPUMat || !mBound)
+ gpumat = GPU_material_from_blender(mBlenderScene, mMat);
+
+ if(!gpumat || !GPU_material_bound(gpumat))
return;
MT_Matrix4x4 model;
model.setValue(ms.m_OpenGLMatrix);
- MT_Matrix4x4 view;
- rasty->GetViewMatrix(view);
+ const MT_Matrix4x4& view = rasty->GetViewMatrix();
+ const MT_Matrix4x4& viewinv = rasty->GetViewInvMatrix();
+ // note: getValue gives back column major as needed by OpenGL
model.getValue((float*)obmat);
view.getValue((float*)viewmat);
+ viewinv.getValue((float*)viewinvmat);
+
+ if(ms.m_bObjectColor)
+ ms.m_RGBAcolor.getValue((float*)obcol);
+ else
+ obcol[0]= obcol[1]= obcol[2]= obcol[3]= 1.0f;
- view.invert();
- view.getValue((float*)viewinvmat);
+ GPU_material_bind_uniforms(gpumat, obmat, viewmat, viewinvmat, obcol);
- GPU_material_bind_uniforms(mGPUMat, obmat, viewmat, viewinvmat);
-#endif
+ mBlendMode = GPU_material_blend_mode(gpumat, obcol);
+}
+
+int BL_BlenderShader::GetBlendMode()
+{
+ return mBlendMode;
}
bool BL_BlenderShader::Equals(BL_BlenderShader *blshader)
{
-#ifdef BLENDER_GLSL
/* to avoid unneeded state switches */
- return (blshader && mGPUMat == blshader->mGPUMat && mLightLayer == blshader->mLightLayer);
-#else
- return true;
-#endif
+ return (blshader && mMat == blshader->mMat && mLightLayer == blshader->mLightLayer);
}
// eof
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h
index b758d1a9cba..5c1f59f94ad 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.h
+++ b/source/gameengine/Ketsji/BL_BlenderShader.h
@@ -2,9 +2,7 @@
#ifndef __BL_GPUSHADER_H__
#define __BL_GPUSHADER_H__
-#ifdef BLENDER_GLSL
#include "GPU_material.h"
-#endif
#include "MT_Matrix4x4.h"
#include "MT_Matrix3x3.h"
@@ -14,7 +12,10 @@
#include "RAS_IPolygonMaterial.h"
+#include "KX_Scene.h"
+
struct Material;
+struct Scene;
class BL_Material;
#define BL_MAX_ATTRIB 16
@@ -26,22 +27,25 @@ class BL_Material;
class BL_BlenderShader
{
private:
-#ifdef BLENDER_GLSL
- GPUMaterial *mGPUMat;
-#endif
- bool mBound;
+ KX_Scene *mScene;
+ struct Scene *mBlenderScene;
+ struct Material *mMat;
int mLightLayer;
+ int mBlendMode;
+
+ bool VerifyShader();
public:
- BL_BlenderShader(struct Material *ma, int lightlayer);
+ BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer);
virtual ~BL_BlenderShader();
- const bool Ok()const;
- void SetProg(bool enable);
+ bool Ok();
+ void SetProg(bool enable, double time=0.0);
int GetAttribNum();
void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat);
- void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty);
+ void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty);
+ int GetBlendMode();
bool Equals(BL_BlenderShader *blshader);
};
diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h
index 568f7e171de..0eaa234566c 100644
--- a/source/gameengine/Ketsji/BL_Material.h
+++ b/source/gameengine/Ketsji/BL_Material.h
@@ -18,9 +18,9 @@ struct EnvMap;
this will default to users available units
to build with more available, just increment this value
although the more you add the slower the search time will be.
- we will go for three, which should be enough
+ we will go for eight, which should be enough
*/
-#define MAXTEX 3 //match in RAS_TexVert & RAS_OpenGLRasterizer
+#define MAXTEX 8 //match in RAS_TexVert & RAS_OpenGLRasterizer
// different mapping modes
class BL_Mapping
@@ -129,8 +129,7 @@ enum BL_flag
TEXALPHA=8, // use alpha combiner functions
TEXNEG=16, // negate blending
HASIPO=32,
- USENEGALPHA=64,
- ALPHA_TEST=128
+ USENEGALPHA=64
};
// BL_Material::ras_mode
@@ -139,8 +138,8 @@ enum BL_ras_mode
POLY_VIS=1,
COLLIDER=2,
ZSORT=4,
- TRANSP=8,
- TRIANGLE=16,
+ ALPHA=8,
+ // TRIANGLE=16,
USE_LIGHT=32,
WIRE=64
};
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp
index f6f9a29b0e2..f28d3fa2912 100644
--- a/source/gameengine/Ketsji/BL_Shader.cpp
+++ b/source/gameengine/Ketsji/BL_Shader.cpp
@@ -433,7 +433,7 @@ void BL_Shader::SetProg(bool enable)
}
}
-void BL_Shader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty )
+void BL_Shader::Update( const RAS_MeshSlot & ms, RAS_IRasterizer* rasty )
{
if(!Ok() || !mPreDef.size())
return;
@@ -445,8 +445,7 @@ void BL_Shader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty )
{
MT_Matrix4x4 model;
model.setValue(ms.m_OpenGLMatrix);
- MT_Matrix4x4 view;
- rasty->GetViewMatrix(view);
+ const MT_Matrix4x4& view = rasty->GetViewMatrix();
if(mAttr==SHD_TANGENT)
ms.m_mesh->SetMeshModified(true);
@@ -525,13 +524,15 @@ void BL_Shader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty )
}
case VIEWMATRIX_INVERSE:
{
- view.invert();
+ MT_Matrix4x4 viewinv = view;
+ viewinv.invert();
SetUniform(uni->mLoc, view);
break;
}
case VIEWMATRIX_INVERSETRANSPOSE:
{
- view.invert();
+ MT_Matrix4x4 viewinv = view;
+ viewinv.invert();
SetUniform(uni->mLoc, view, true);
break;
}
@@ -670,6 +671,7 @@ void BL_Shader::SetUniform(int uniform, const MT_Matrix4x4& vec, bool transpose)
)
{
float value[16];
+ // note: getValue gives back column major as needed by OpenGL
vec.getValue(value);
glUniformMatrix4fvARB(uniform, 1, transpose?GL_TRUE:GL_FALSE, value);
}
@@ -846,8 +848,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" )
KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if(mShader==0) {
PyErr_Format(PyExc_TypeError, "invalid shader object");
@@ -877,8 +878,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()")
KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
@@ -900,7 +900,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setSampler, "setSampler(name, index)" )
//else
// spit("Invalid texture sample index: " << index);
}
- Py_Return;
+ Py_RETURN_NONE;
}
return NULL;
}
@@ -919,8 +919,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setNumberOfPasses, "setNumberOfPasses( max-pass )
KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
@@ -945,8 +944,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1f, "setUniform1f(name, fx)" )
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
float array[2]={ 0,0 };
@@ -970,8 +968,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2f , "setUniform2f(name, fx, fy)")
KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
float array[3]={0,0,0};
@@ -996,8 +993,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3f, "setUniform3f(name, fx,fy,fz) ")
KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) ")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
float array[4]={0,0,0,0};
@@ -1021,8 +1017,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4f, "setUniform4f(name, fx,fy,fz, fw) "
KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
int value=0;
@@ -1046,8 +1041,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform1i, "setUniform1i(name, ix)" )
KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
int array[2]={ 0,0 };
@@ -1071,8 +1065,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform2i , "setUniform2i(name, ix, iy)")
KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
@@ -1096,8 +1089,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform3i, "setUniform3i(name, ix,iy,iz) ")
KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) ")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
int array[4]={0,0,0, 0};
@@ -1120,8 +1112,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniform4i, "setUniform4i(name, ix,iy,iz, iw) "
KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or list3 or list4) )")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char*uniform = "";
PyObject *listPtr =0;
@@ -1190,8 +1181,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformfv , "setUniformfv( float (list2 or lis
KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( int (list2 or list3 or list4) )")
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char*uniform = "";
PyObject *listPtr =0;
@@ -1263,8 +1253,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix4,
"setUniformMatrix4(uniform-name, mat-4x4, transpose(row-major=true, col-major=false)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
float matr[16] = {
@@ -1306,8 +1295,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
"setUniformMatrix3(uniform-name, list[3x3], transpose(row-major=true, col-major=false)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
float matr[9] = {
@@ -1347,8 +1335,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformMatrix3,
KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
int attr=0;
if(PyArg_ParseTuple(args, "i", &attr )) {
@@ -1368,8 +1355,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setAttrib, "setAttrib(enum)" )
KX_PYMETHODDEF_DOC( BL_Shader, setUniformDef, "setUniformDef(name, enum)" )
{
if(mError) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
char *uniform="";
diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h
index 8f303454087..c7fae31ba03 100644
--- a/source/gameengine/Ketsji/BL_Shader.h
+++ b/source/gameengine/Ketsji/BL_Shader.h
@@ -177,7 +177,7 @@ public:
void UnloadShader();
// Update predefined uniforms each render call
- void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty);
+ void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty);
//// Set sampler units (copied)
//void InitializeSampler(int unit, BL_Texture* texture );
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp
index f24ef4322f0..f0ef84032f7 100644
--- a/source/gameengine/Ketsji/BL_Texture.cpp
+++ b/source/gameengine/Ketsji/BL_Texture.cpp
@@ -384,8 +384,6 @@ void BL_Texture::DisableUnit()
void BL_Texture::DisableAllTextures()
{
- glDisable(GL_BLEND);
-
for(int i=0; i<MAXTEX; i++) {
if(GLEW_ARB_multitexture)
glActiveTextureARB(GL_TEXTURE0_ARB+i);
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index 3b907d8d530..58411f6d25e 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -25,6 +25,17 @@
# ***** END GPL LICENSE BLOCK *****
FILE(GLOB SRC *.cpp)
+SET(SRC
+ ${SRC}
+ ../../../source/blender/python/api2_2x/Mathutils.c
+ ../../../source/blender/python/api2_2x/constant.c
+ ../../../source/blender/python/api2_2x/euler.c
+ ../../../source/blender/python/api2_2x/gen_utils.c
+ ../../../source/blender/python/api2_2x/matrix.c
+ ../../../source/blender/python/api2_2x/point.c
+ ../../../source/blender/python/api2_2x/quat.c
+ ../../../source/blender/python/api2_2x/vector.c
+)
SET(INC
.
@@ -39,7 +50,8 @@ SET(INC
../../../intern/moto/include
../../../source/gameengine/Ketsji
../../../source/blender/blenlib
- ../../../source/blender/blenkernel
+ ../../../source/blender/blenkernel
+ ../../../source/blender/python/api2_2x
../../../source/blender
../../../source/blender/include
../../../source/blender/makesdna
@@ -57,6 +69,7 @@ SET(INC
../../../intern/SoundSystem
../../../source/blender/misc
../../../source/blender/blenloader
+ ../../../source/blender/gpu
../../../extern/bullet2/src
../../../extern/solid
../../../extern/glew/include
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
index 7b5b7fdf78c..eee8e9f6827 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
@@ -55,28 +55,13 @@ KX_NetworkEventManager::~KX_NetworkEventManager()
//printf("KX_NetworkEventManager destructor\n");
}
-void KX_NetworkEventManager::RegisterSensor(class SCA_ISensor* sensor)
-{
- //printf("KX_NetworkEventManager RegisterSensor\n");
- m_sensors.push_back(sensor);
-}
-
-void KX_NetworkEventManager::RemoveSensor(class SCA_ISensor* sensor)
-{
- //printf("KX_NetworkEventManager RemoveSensor\n");
- // Network specific RemoveSensor stuff goes here
-
- // parent
- SCA_EventManager::RemoveSensor(sensor);
-}
-
void KX_NetworkEventManager::NextFrame()
{
// printf("KX_NetworkEventManager::proceed %.2f - %.2f\n", curtime, deltatime);
// each frame, the logicmanager will call the network
// eventmanager to look for network events, and process it's
// 'network' sensors
- vector<class SCA_ISensor*>::iterator it;
+ set<class SCA_ISensor*>::iterator it;
for (it = m_sensors.begin(); !(it==m_sensors.end()); it++) {
// printf("KX_NetworkEventManager::proceed sensor %.2f\n", curtime);
diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h
index 0b097ba2ef6..ae88f1d4987 100644
--- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h
+++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h
@@ -42,9 +42,6 @@ public:
class NG_NetworkDeviceInterface *ndi);
virtual ~KX_NetworkEventManager ();
- virtual void RegisterSensor(class SCA_ISensor* sensor);
- virtual void RemoveSensor(class SCA_ISensor* sensor);
-
virtual void NextFrame();
virtual void EndFrame();
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index 0f445a9f32e..f92200780d5 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -19,13 +19,12 @@
#include "MT_Vector4.h"
#include "MT_Matrix4x4.h"
+#include "RAS_BucketManager.h"
#include "RAS_MeshObject.h"
#include "RAS_IRasterizer.h"
#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h"
-extern "C" {
-#include "BDR_drawmesh.h"
-}
+#include "GPU_draw.h"
#include "STR_HashedString.h"
@@ -38,6 +37,7 @@ extern "C" {
// ------------------------------------
#define spit(x) std::cout << x << std::endl;
+BL_Shader *KX_BlenderMaterial::mLastShader = NULL;
BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL;
//static PyObject *gTextureDict = 0;
@@ -47,7 +47,6 @@ KX_BlenderMaterial::KX_BlenderMaterial(
BL_Material *data,
bool skin,
int lightlayer,
- void *clientobject,
PyTypeObject *T
)
: PyObjectPlus(T),
@@ -58,11 +57,10 @@ KX_BlenderMaterial::KX_BlenderMaterial(
data->tilexrep[0],
data->tileyrep[0],
data->mode,
- ((data->ras_mode &TRANSP)!=0),
+ data->transp,
+ ((data->ras_mode &ALPHA)!=0),
((data->ras_mode &ZSORT)!=0),
- lightlayer,
- ((data->ras_mode &TRIANGLE)!=0),
- clientobject
+ lightlayer
),
mMaterial(data),
mShader(0),
@@ -76,10 +74,10 @@ KX_BlenderMaterial::KX_BlenderMaterial(
{
// --------------------------------
// RAS_IPolyMaterial variables...
- m_flag |=RAS_BLENDERMAT;
- m_flag |=(mMaterial->IdMode>=ONETEX)?RAS_MULTITEX:0;
- m_flag |=(mMaterial->ras_mode & USE_LIGHT)!=0?RAS_MULTILIGHT:0;
- m_flag |=(mMaterial->ras_mode &ALPHA_TEST)!=0?RAS_FORCEALPHA:0;
+ m_flag |= RAS_BLENDERMAT;
+ m_flag |= (mMaterial->IdMode>=ONETEX)? RAS_MULTITEX: 0;
+ m_flag |= ((mMaterial->ras_mode & USE_LIGHT)!=0)? RAS_MULTILIGHT: 0;
+ m_flag |= (mMaterial->glslmat)? RAS_BLENDERGLSL: 0;
// figure max
int enabled = mMaterial->num_enabled;
@@ -96,7 +94,7 @@ KX_BlenderMaterial::KX_BlenderMaterial(
mMaterial->blend_mode[i]
);
}
- m_multimode += mMaterial->IdMode+mMaterial->ras_mode;
+ m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(COLLIDER|USE_LIGHT));
}
@@ -158,12 +156,29 @@ void KX_BlenderMaterial::OnConstruction()
mConstructed = true;
}
+void KX_BlenderMaterial::EndFrame()
+{
+ if(mLastBlenderShader) {
+ mLastBlenderShader->SetProg(false);
+ mLastBlenderShader = NULL;
+ }
+
+ if(mLastShader) {
+ mLastShader->SetProg(false);
+ mLastShader = NULL;
+ }
+}
+
void KX_BlenderMaterial::OnExit()
{
if( mShader ) {
- //note, the shader here is allocated, per unique material
- //and this function is called per face
- mShader->SetProg(false);
+ //note, the shader here is allocated, per unique material
+ //and this function is called per face
+ if(mShader == mLastShader) {
+ mShader->SetProg(false);
+ mLastShader = NULL;
+ }
+
delete mShader;
mShader = 0;
}
@@ -186,7 +201,7 @@ void KX_BlenderMaterial::OnExit()
}
if( mMaterial->tface )
- set_tpage(mMaterial->tface);
+ GPU_set_tpage(mMaterial->tface);
}
@@ -197,13 +212,19 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras)
int i;
if( !enable || !mShader->Ok() ) {
// frame cleanup.
- mShader->SetProg(false);
+ if(mShader == mLastShader) {
+ mShader->SetProg(false);
+ mLastShader = NULL;
+ }
+
+ ras->SetBlendingMode(TF_SOLID);
BL_Texture::DisableAllTextures();
return;
}
BL_Texture::DisableAllTextures();
mShader->SetProg(true);
+ mLastShader = mShader;
BL_Texture::ActivateFirst();
@@ -217,9 +238,12 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras)
}
if(!mUserDefBlend) {
- setDefaultBlending();
+ ras->SetBlendingMode(mMaterial->transp);
}
else {
+ ras->SetBlendingMode(TF_SOLID);
+ ras->SetBlendingMode(-1); // indicates custom mode
+
// tested to be valid enums
glEnable(GL_BLEND);
glBlendFunc(mBlendFunc[0], mBlendFunc[1]);
@@ -229,39 +253,45 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras)
void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras)
{
if( !enable || !mBlenderShader->Ok() ) {
+ ras->SetBlendingMode(TF_SOLID);
+
// frame cleanup.
if(mLastBlenderShader) {
mLastBlenderShader->SetProg(false);
mLastBlenderShader= NULL;
}
- BL_Texture::DisableAllTextures();
+ else
+ BL_Texture::DisableAllTextures();
+
return;
}
if(!mBlenderShader->Equals(mLastBlenderShader)) {
- BL_Texture::DisableAllTextures();
+ ras->SetBlendingMode(mMaterial->transp);
if(mLastBlenderShader)
mLastBlenderShader->SetProg(false);
+ else
+ BL_Texture::DisableAllTextures();
- mBlenderShader->SetProg(true);
+ mBlenderShader->SetProg(true, ras->GetTime());
mLastBlenderShader= mBlenderShader;
}
}
void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras)
{
- if(GLEW_ARB_shader_objects && mShader)
- mShader->SetProg(false);
-
BL_Texture::DisableAllTextures();
- if( !enable )
+
+ if( !enable ) {
+ ras->SetBlendingMode(TF_SOLID);
return;
+ }
BL_Texture::ActivateFirst();
if( mMaterial->IdMode == DEFAULT_BLENDER ) {
- setDefaultBlending();
+ ras->SetBlendingMode(mMaterial->transp);
return;
}
@@ -271,7 +301,7 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras)
mTextures[0].ActivateTexture();
mTextures[0].setTexEnv(0, true);
mTextures[0].SetMapping(mMaterial->mapping[0].mapping);
- setDefaultBlending();
+ ras->SetBlendingMode(mMaterial->transp);
}
return;
}
@@ -294,9 +324,12 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras)
}
if(!mUserDefBlend) {
- setDefaultBlending();
+ ras->SetBlendingMode(mMaterial->transp);
}
else {
+ ras->SetBlendingMode(TF_SOLID);
+ ras->SetBlendingMode(-1); // indicates custom mode
+
glEnable(GL_BLEND);
glBlendFunc(mBlendFunc[0], mBlendFunc[1]);
}
@@ -321,21 +354,22 @@ KX_BlenderMaterial::ActivatShaders(
if (GetCachingInfo() != cachingInfo) {
if (!cachingInfo)
- tmp->setShaderData( false, rasty);
+ tmp->setShaderData(false, rasty);
cachingInfo = GetCachingInfo();
if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)
- tmp->setShaderData( true, rasty);
+ tmp->setShaderData(true, rasty);
else
- tmp->setShaderData( false, rasty);
+ tmp->setShaderData(false, rasty);
if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE)
rasty->SetCullFace(false);
else
rasty->SetCullFace(true);
- if (((mMaterial->ras_mode &WIRE)!=0) || mMaterial->mode & RAS_IRasterizer::KX_LINES)
+ if (((mMaterial->ras_mode &WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) ||
+ (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
if((mMaterial->ras_mode &WIRE)!=0)
rasty->SetCullFace(false);
@@ -356,31 +390,29 @@ KX_BlenderMaterial::ActivateBlenderShaders(
{
KX_BlenderMaterial *tmp = const_cast<KX_BlenderMaterial*>(this);
- // reset...
- if(tmp->mMaterial->IsShared())
- cachingInfo =0;
-
+ if(mLastShader) {
+ mLastShader->SetProg(false);
+ mLastShader= NULL;
+ }
+
if (GetCachingInfo() != cachingInfo) {
if (!cachingInfo)
tmp->setBlenderShaderData(false, rasty);
cachingInfo = GetCachingInfo();
- if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) {
+ if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED)
tmp->setBlenderShaderData(true, rasty);
- rasty->EnableTextures(true);
- }
- else {
+ else
tmp->setBlenderShaderData(false, rasty);
- rasty->EnableTextures(false);
- }
if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE)
rasty->SetCullFace(false);
else
rasty->SetCullFace(true);
- if (((mMaterial->ras_mode &WIRE)!=0) || mMaterial->mode & RAS_IRasterizer::KX_LINES)
+ if (((mMaterial->ras_mode & WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) ||
+ (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
if((mMaterial->ras_mode &WIRE)!=0)
rasty->SetCullFace(false);
@@ -388,10 +420,10 @@ KX_BlenderMaterial::ActivateBlenderShaders(
}
else
rasty->SetLines(false);
- }
- ActivatGLMaterials(rasty);
- mBlenderShader->SetAttribs(rasty, mMaterial);
+ ActivatGLMaterials(rasty);
+ mBlenderShader->SetAttribs(rasty, mMaterial);
+ }
}
void
@@ -402,6 +434,11 @@ KX_BlenderMaterial::ActivateMat(
{
KX_BlenderMaterial *tmp = const_cast<KX_BlenderMaterial*>(this);
+ if(mLastShader) {
+ mLastShader->SetProg(false);
+ mLastShader= NULL;
+ }
+
if(mLastBlenderShader) {
mLastBlenderShader->SetProg(false);
mLastBlenderShader= NULL;
@@ -423,7 +460,8 @@ KX_BlenderMaterial::ActivateMat(
else
rasty->SetCullFace(true);
- if (((mMaterial->ras_mode &WIRE)!=0) || mMaterial->mode & RAS_IRasterizer::KX_LINES)
+ if (((mMaterial->ras_mode &WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) ||
+ (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
if((mMaterial->ras_mode &WIRE)!=0)
rasty->SetCullFace(false);
@@ -443,46 +481,40 @@ KX_BlenderMaterial::Activate(
TCachingInfo& cachingInfo
)const
{
- bool dopass = false;
- if( GLEW_ARB_shader_objects && ( mShader && mShader->Ok() ) ) {
- if( (mPass++) < mShader->getNumPass() ) {
+ if(GLEW_ARB_shader_objects && (mShader && mShader->Ok())) {
+ if((mPass++) < mShader->getNumPass() ) {
ActivatShaders(rasty, cachingInfo);
- dopass = true;
- return dopass;
+ return true;
}
else {
- mShader->SetProg(false);
+ if(mShader == mLastShader) {
+ mShader->SetProg(false);
+ mLastShader = NULL;
+ }
mPass = 0;
- dopass = false;
- return dopass;
+ return false;
}
}
- else if( GLEW_ARB_shader_objects && ( mBlenderShader && mBlenderShader->Ok() ) ) {
- if( (mPass++) == 0 ) {
+ else if( GLEW_ARB_shader_objects && (mBlenderShader && mBlenderShader->Ok() ) ) {
+ if(mPass++ == 0) {
ActivateBlenderShaders(rasty, cachingInfo);
- dopass = true;
- return dopass;
+ return true;
}
else {
mPass = 0;
- dopass = false;
- return dopass;
+ return false;
}
}
else {
- switch (mPass++)
- {
- case 0:
- ActivateMat(rasty, cachingInfo);
- dopass = true;
- break;
- default:
- mPass = 0;
- dopass = false;
- break;
+ if(mPass++ == 0) {
+ ActivateMat(rasty, cachingInfo);
+ return true;
+ }
+ else {
+ mPass = 0;
+ return false;
}
}
- return dopass;
}
bool KX_BlenderMaterial::UsesLighting(RAS_IRasterizer *rasty) const
@@ -490,19 +522,32 @@ bool KX_BlenderMaterial::UsesLighting(RAS_IRasterizer *rasty) const
if(!RAS_IPolyMaterial::UsesLighting(rasty))
return false;
- if(mShader && mShader->Ok());
+ if(mShader && mShader->Ok())
+ return true;
else if(mBlenderShader && mBlenderShader->Ok())
return false;
-
- return true;
+ else
+ return true;
}
-void KX_BlenderMaterial::ActivateMeshSlot(const KX_MeshSlot & ms, RAS_IRasterizer* rasty) const
+void KX_BlenderMaterial::ActivateMeshSlot(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty) const
{
- if(mShader && GLEW_ARB_shader_objects)
+ if(mShader && GLEW_ARB_shader_objects) {
mShader->Update(ms, rasty);
- else if(mBlenderShader && GLEW_ARB_shader_objects)
+ }
+ else if(mBlenderShader && GLEW_ARB_shader_objects) {
+ int blendmode;
+
mBlenderShader->Update(ms, rasty);
+
+ /* we do blend modes here, because they can change per object
+ * with the same material due to obcolor/obalpha */
+ blendmode = mBlenderShader->GetBlendMode();
+ if((blendmode == TF_SOLID || blendmode == TF_ALPHA) && mMaterial->transp != TF_SOLID)
+ blendmode = mMaterial->transp;
+
+ rasty->SetBlendingMode(blendmode);
+ }
}
void KX_BlenderMaterial::ActivatGLMaterials( RAS_IRasterizer* rasty )const
@@ -575,36 +620,7 @@ void KX_BlenderMaterial::ActivateTexGen(RAS_IRasterizer *ras) const
else
ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_DISABLE, i);
}
-
- ras->EnableTextures(true);
- }
- else
- ras->EnableTextures(false);
-}
-
-bool KX_BlenderMaterial::setDefaultBlending()
-{
- if( mMaterial->transp &TF_ADD) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- glDisable ( GL_ALPHA_TEST );
- return true;
- }
-
- if( mMaterial->transp & TF_ALPHA ) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glDisable ( GL_ALPHA_TEST );
- return true;
- }
-
- if( mMaterial->transp & TF_CLIP ) {
- glDisable(GL_BLEND);
- glEnable ( GL_ALPHA_TEST );
- glAlphaFunc(GL_GREATER, 0.5f);
- return false;
}
- return false;
}
void KX_BlenderMaterial::setTexMatrixData(int i)
@@ -679,8 +695,7 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras)
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
- MT_Matrix4x4 mvmat;
- ras->GetViewMatrix(mvmat);
+ const MT_Matrix4x4& mvmat = ras->GetViewMatrix();
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
@@ -802,7 +817,9 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
}
if(mShader && !mShader->GetError()) {
+ m_flag &= ~RAS_BLENDERGLSL;
mMaterial->SetSharedMaterial(true);
+ mScene->GetBucketManager()->ReleaseDisplayLists(this);
Py_INCREF(mShader);
return mShader;
}else
@@ -831,7 +848,7 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()")
void KX_BlenderMaterial::SetBlenderGLSLShader(void)
{
if(!mBlenderShader)
- mBlenderShader = new BL_BlenderShader(mMaterial->material, m_lightlayer);
+ mBlenderShader = new BL_BlenderShader(mScene, mMaterial->material, m_lightlayer);
if(!mBlenderShader->Ok()) {
delete mBlenderShader;
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index bf6d2095e7c..4ddf5a924df 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -28,7 +28,6 @@ public:
BL_Material* mat,
bool skin,
int lightlayer,
- void* clientobject,
PyTypeObject* T=&Type
);
@@ -47,7 +46,7 @@ public:
virtual
void ActivateMeshSlot(
- const KX_MeshSlot & ms,
+ const RAS_MeshSlot & ms,
RAS_IRasterizer* rasty
) const;
@@ -90,11 +89,13 @@ public:
// --------------------------------
// pre calculate to avoid pops/lag at startup
virtual void OnConstruction( );
+
+ static void EndFrame();
+
private:
BL_Material* mMaterial;
BL_Shader* mShader;
BL_BlenderShader* mBlenderShader;
- static BL_BlenderShader *mLastBlenderShader;
KX_Scene* mScene;
BL_Texture mTextures[MAXTEX]; // texture array
bool mUserDefBlend;
@@ -114,7 +115,6 @@ private:
void setBlenderShaderData( bool enable, RAS_IRasterizer *ras);
void setShaderData( bool enable, RAS_IRasterizer *ras);
- bool setDefaultBlending();
void setObjectMatrixData(int i, RAS_IRasterizer *ras);
void setTexMatrixData(int i);
@@ -123,6 +123,10 @@ private:
// cleanup stuff
void OnExit();
+ // shader chacing
+ static BL_BlenderShader *mLastBlenderShader;
+ static BL_Shader *mLastShader;
+
mutable int mPass;
};
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index 0a97b6f0a2f..4948c0ea174 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -35,6 +35,8 @@
#include <math.h>
#include "KX_GameObject.h"
+#include "PyObjectPlus.h"
+
STR_String KX_CameraActuator::X_AXIS_STRING = "x";
STR_String KX_CameraActuator::Y_AXIS_STRING = "y";
@@ -395,8 +397,8 @@ PyParentObject KX_CameraActuator::Parents[] = {
};
PyMethodDef KX_CameraActuator::Methods[] = {
- {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_VARARGS, SetObject_doc},
- {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_NOARGS, GetObject_doc},
+ {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O, SetObject_doc},
+ {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS, GetObject_doc},
{"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, SetMin_doc},
{"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, GetMin_doc},
{"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, SetMax_doc},
@@ -413,50 +415,43 @@ PyObject* KX_CameraActuator::_getattr(const STR_String& attr) {
}
/* get obj ---------------------------------------------------------- */
char KX_CameraActuator::GetObject_doc[] =
-"getObject\n"
+"getObject(name_only = 1)\n"
+"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the object this sensor reacts to.\n";
-PyObject* KX_CameraActuator::PyGetObject(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_CameraActuator::PyGetObject(PyObject* self, PyObject* args)
{
- return PyString_FromString(m_ob->GetName());
+ int ret_name_only = 1;
+ if (!PyArg_ParseTuple(args, "|i", &ret_name_only))
+ return NULL;
+
+ if (!m_ob)
+ Py_RETURN_NONE;
+
+ if (ret_name_only)
+ return PyString_FromString(m_ob->GetName());
+ else
+ return m_ob->AddRef();
}
/* set obj ---------------------------------------------------------- */
char KX_CameraActuator::SetObject_doc[] =
-"setObject\n"
+"setObject(object)\n"
+"\t- object: KX_GameObject, string or None\n"
"\tSets the object this sensor reacts to.\n";
-PyObject* KX_CameraActuator::PySetObject(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_CameraActuator::PySetObject(PyObject* self, PyObject* value)
{
-
- PyObject* gameobj;
- if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj))
- {
- if (m_ob)
- m_ob->UnregisterActuator(this);
- m_ob = (SCA_IObject*)gameobj;
- if (m_ob)
- m_ob->RegisterActuator(this);
- Py_Return;
- }
- PyErr_Clear();
+ KX_GameObject *gameobj;
- char* objectname;
- if (PyArg_ParseTuple(args, "s", &objectname))
- {
- SCA_IObject *object = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));
- if(object)
- {
- if (m_ob != NULL)
- m_ob->UnregisterActuator(this);
- m_ob = object;
- m_ob->RegisterActuator(this);
- Py_Return;
- }
- }
+ if (!ConvertPythonToGameObject(value, &gameobj, true))
+ return NULL; // ConvertPythonToGameObject sets the error
- return NULL;
+ if (m_ob != NULL)
+ m_ob->UnregisterActuator(this);
+
+ m_ob = (SCA_IObject*)gameobj;
+ if (m_ob)
+ m_ob->RegisterActuator(this);
+
+ Py_RETURN_NONE;
}
/* get min ---------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h
index 488b36922b0..d53d12b3b82 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.h
+++ b/source/gameengine/Ketsji/KX_CameraActuator.h
@@ -123,9 +123,9 @@ private :
virtual PyObject* _getattr(const STR_String& attr);
/* set object to look at */
- KX_PYMETHOD_DOC(KX_CameraActuator,SetObject);
+ KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject);
/* get current object */
- KX_PYMETHOD_DOC(KX_CameraActuator,GetObject);
+ KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject);
KX_PYMETHOD_DOC(KX_CameraActuator,SetMin);
KX_PYMETHOD_DOC(KX_CameraActuator,GetMin);
KX_PYMETHOD_DOC(KX_CameraActuator,SetMax);
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index 800416b5f0a..4b57b0e8c54 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -109,16 +109,11 @@ KX_ConstraintActuator::~KX_ConstraintActuator()
// there's nothing to be done here, really....
} /* end of destructor */
-bool KX_ConstraintActuator::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data)
+bool KX_ConstraintActuator::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data)
{
KX_GameObject* hitKXObj = client->m_gameobject;
- if (client->m_type > KX_ClientObjectInfo::ACTOR)
- {
- // false hit
- return false;
- }
bool bFound = false;
if (m_property[0] == 0)
@@ -139,8 +134,26 @@ bool KX_ConstraintActuator::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_p
bFound = hitKXObj->GetProperty(m_property) != NULL;
}
}
+ // update the hit status
+ result->m_hitFound = bFound;
+ // stop looking
+ return true;
+}
- return bFound;
+/* this function is used to pre-filter the object before casting the ray on them.
+ This is useful for "X-Ray" option when we want to see "through" unwanted object.
+ */
+bool KX_ConstraintActuator::NeedRayCast(KX_ClientObjectInfo* client)
+{
+ if (client->m_type > KX_ClientObjectInfo::ACTOR)
+ {
+ // Unknown type of object, skip it.
+ // Should not occur as the sensor objects are filtered in RayTest()
+ printf("Invalid client type %d found in ray casting\n", client->m_type);
+ return false;
+ }
+ // no X-Ray function yet
+ return true;
}
bool KX_ConstraintActuator::Update(double curtime, bool frame)
@@ -237,9 +250,9 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
case KX_ACT_CONSTRAINT_DIRPX:
case KX_ACT_CONSTRAINT_DIRPY:
case KX_ACT_CONSTRAINT_DIRPZ:
- case KX_ACT_CONSTRAINT_DIRMX:
- case KX_ACT_CONSTRAINT_DIRMY:
- case KX_ACT_CONSTRAINT_DIRMZ:
+ case KX_ACT_CONSTRAINT_DIRNX:
+ case KX_ACT_CONSTRAINT_DIRNY:
+ case KX_ACT_CONSTRAINT_DIRNZ:
switch (m_locrot) {
case KX_ACT_CONSTRAINT_DIRPX:
direction[0] = rotation[0][0];
@@ -262,21 +275,21 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
axis = 2;
sign = 1;
break;
- case KX_ACT_CONSTRAINT_DIRMX:
+ case KX_ACT_CONSTRAINT_DIRNX:
direction[0] = -rotation[0][0];
direction[1] = -rotation[1][0];
direction[2] = -rotation[2][0];
axis = 0;
sign = 0;
break;
- case KX_ACT_CONSTRAINT_DIRMY:
+ case KX_ACT_CONSTRAINT_DIRNY:
direction[0] = -rotation[0][1];
direction[1] = -rotation[1][1];
direction[2] = -rotation[2][1];
axis = 1;
sign = 0;
break;
- case KX_ACT_CONSTRAINT_DIRMZ:
+ case KX_ACT_CONSTRAINT_DIRNZ:
direction[0] = -rotation[0][2];
direction[1] = -rotation[1][2];
direction[2] = -rotation[2][2];
@@ -287,8 +300,6 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
direction.normalize();
{
MT_Point3 topoint = position + (m_maximumBound) * direction;
- MT_Point3 resultpoint;
- MT_Vector3 resultnormal;
PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment();
KX_IPhysicsController *spc = obj->GetPhysicsController();
@@ -304,9 +315,10 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
parent->Release();
}
}
- result = KX_RayCast::RayTest(spc, pe, position, topoint, resultpoint, resultnormal, KX_RayCast::Callback<KX_ConstraintActuator>(this));
-
+ KX_RayCast::Callback<KX_ConstraintActuator> callback(this,spc);
+ result = KX_RayCast::RayTest(pe, position, topoint, callback);
if (result) {
+ MT_Vector3 newnormal = callback.m_hitNormal;
// compute new position & orientation
if ((m_option & (KX_ACT_CONSTRAINT_NORMAL|KX_ACT_CONSTRAINT_DISTANCE)) == 0) {
// if none option is set, the actuator does nothing but detect ray
@@ -316,27 +328,27 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
if (m_option & KX_ACT_CONSTRAINT_NORMAL) {
// the new orientation must be so that the axis is parallel to normal
if (sign)
- resultnormal = -resultnormal;
+ newnormal = -newnormal;
// apply damping on the direction
if (m_rotDampTime) {
MT_Scalar rotFilter = 1.0/(1.0+m_rotDampTime);
- resultnormal = (-m_rotDampTime*rotFilter)*direction + rotFilter*resultnormal;
+ newnormal = (-m_rotDampTime*rotFilter)*direction + rotFilter*newnormal;
} else if (m_posDampTime) {
- resultnormal = -filter*direction + (1.0-filter)*resultnormal;
+ newnormal = -filter*direction + (1.0-filter)*newnormal;
}
- obj->AlignAxisToVect(resultnormal, axis);
- direction = -resultnormal;
+ obj->AlignAxisToVect(newnormal, axis);
+ direction = -newnormal;
}
if (m_option & KX_ACT_CONSTRAINT_DISTANCE) {
if (m_posDampTime) {
- newdistance = filter*(position-resultpoint).length()+(1.0-filter)*m_minimumBound;
+ newdistance = filter*(position-callback.m_hitPoint).length()+(1.0-filter)*m_minimumBound;
} else {
newdistance = m_minimumBound;
}
} else {
- newdistance = (position-resultpoint).length();
+ newdistance = (position-callback.m_hitPoint).length();
}
- newposition = resultpoint-newdistance*direction;
+ newposition = callback.m_hitPoint-newdistance*direction;
} else if (m_option & KX_ACT_CONSTRAINT_PERMANENT) {
// no contact but still keep running
result = true;
@@ -437,27 +449,27 @@ PyParentObject KX_ConstraintActuator::Parents[] = {
PyMethodDef KX_ConstraintActuator::Methods[] = {
{"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, SetDamp_doc},
- {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_VARARGS, GetDamp_doc},
+ {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, GetDamp_doc},
{"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, SetRotDamp_doc},
- {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_VARARGS, GetRotDamp_doc},
+ {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, GetRotDamp_doc},
{"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, SetDirection_doc},
- {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_VARARGS, GetDirection_doc},
+ {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, GetDirection_doc},
{"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, SetOption_doc},
- {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_VARARGS, GetOption_doc},
+ {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, GetOption_doc},
{"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, SetTime_doc},
- {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_VARARGS, GetTime_doc},
+ {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, GetTime_doc},
{"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, SetProperty_doc},
- {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc},
+ {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, GetProperty_doc},
{"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, SetMin_doc},
- {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_VARARGS, GetMin_doc},
+ {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, GetMin_doc},
{"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, SetDistance_doc},
- {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_VARARGS, GetDistance_doc},
+ {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, GetDistance_doc},
{"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, SetMax_doc},
- {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_VARARGS, GetMax_doc},
+ {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, GetMax_doc},
{"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, SetRayLength_doc},
- {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_VARARGS, GetRayLength_doc},
+ {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, GetRayLength_doc},
{"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, SetLimit_doc},
- {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_VARARGS, GetLimit_doc},
+ {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, GetLimit_doc},
{NULL,NULL} //Sentinel
};
@@ -488,9 +500,7 @@ PyObject* KX_ConstraintActuator::PySetDamp(PyObject* self,
char KX_ConstraintActuator::GetDamp_doc[] =
"getDamp()\n"
"\tReturns the damping parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetDamp(PyObject* self,
- PyObject* args,
- PyObject* kwds){
+PyObject* KX_ConstraintActuator::PyGetDamp(PyObject* self){
return PyInt_FromLong(m_posDampTime);
}
@@ -517,9 +527,7 @@ PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* self,
char KX_ConstraintActuator::GetRotDamp_doc[] =
"getRotDamp()\n"
"\tReturns the damping time for application of the constraint.\n";
-PyObject* KX_ConstraintActuator::PyGetRotDamp(PyObject* self,
- PyObject* args,
- PyObject* kwds){
+PyObject* KX_ConstraintActuator::PyGetRotDamp(PyObject* self){
return PyInt_FromLong(m_rotDampTime);
}
@@ -554,9 +562,7 @@ PyObject* KX_ConstraintActuator::PySetDirection(PyObject* self,
char KX_ConstraintActuator::GetDirection_doc[] =
"getDirection()\n"
"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n";
-PyObject* KX_ConstraintActuator::PyGetDirection(PyObject* self,
- PyObject* args,
- PyObject* kwds){
+PyObject* KX_ConstraintActuator::PyGetDirection(PyObject* self){
PyObject *retVal = PyList_New(3);
PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_refDirection[0]));
@@ -591,9 +597,7 @@ PyObject* KX_ConstraintActuator::PySetOption(PyObject* self,
char KX_ConstraintActuator::GetOption_doc[] =
"getOption()\n"
"\tReturns the option parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetOption(PyObject* self,
- PyObject* args,
- PyObject* kwds){
+PyObject* KX_ConstraintActuator::PyGetOption(PyObject* self){
return PyInt_FromLong(m_option);
}
@@ -622,9 +626,7 @@ PyObject* KX_ConstraintActuator::PySetTime(PyObject* self,
char KX_ConstraintActuator::GetTime_doc[] =
"getTime()\n"
"\tReturns the time parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetTime(PyObject* self,
- PyObject* args,
- PyObject* kwds){
+PyObject* KX_ConstraintActuator::PyGetTime(PyObject* self){
return PyInt_FromLong(m_activeTime);
}
@@ -654,9 +656,7 @@ PyObject* KX_ConstraintActuator::PySetProperty(PyObject* self,
char KX_ConstraintActuator::GetProperty_doc[] =
"getProperty()\n"
"\tReturns the property parameter.\n";
-PyObject* KX_ConstraintActuator::PyGetProperty(PyObject* self,
- PyObject* args,
- PyObject* kwds){
+PyObject* KX_ConstraintActuator::PyGetProperty(PyObject* self){
return PyString_FromString(m_property);
}
@@ -701,9 +701,7 @@ char KX_ConstraintActuator::GetMin_doc[] =
"getMin()\n"
"\tReturns the lower value of the interval to which the value\n"
"\tis clipped.\n";
-PyObject* KX_ConstraintActuator::PyGetMin(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_ConstraintActuator::PyGetMin(PyObject* self) {
return PyFloat_FromDouble(m_minimumBound);
}
@@ -748,9 +746,7 @@ char KX_ConstraintActuator::GetMax_doc[] =
"getMax()\n"
"\tReturns the upper value of the interval to which the value\n"
"\tis clipped.\n";
-PyObject* KX_ConstraintActuator::PyGetMax(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_ConstraintActuator::PyGetMax(PyObject* self) {
return PyFloat_FromDouble(m_maximumBound);
}
@@ -789,9 +785,7 @@ PyObject* KX_ConstraintActuator::PySetLimit(PyObject* self,
char KX_ConstraintActuator::GetLimit_doc[] =
"getLimit()\n"
"\tReturns the type of constraint.\n";
-PyObject* KX_ConstraintActuator::PyGetLimit(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_ConstraintActuator::PyGetLimit(PyObject* self) {
return PyInt_FromLong(m_locrot);
}
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h
index 3ef51595098..6ec4de9aad9 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.h
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h
@@ -37,6 +37,8 @@
#include "MT_Vector3.h"
#include "KX_ClientObjectInfo.h"
+class KX_RayCast;
+
class KX_ConstraintActuator : public SCA_IActuator
{
Py_Header;
@@ -84,9 +86,9 @@ protected:
KX_ACT_CONSTRAINT_DIRPX,
KX_ACT_CONSTRAINT_DIRPY,
KX_ACT_CONSTRAINT_DIRPZ,
- KX_ACT_CONSTRAINT_DIRMX,
- KX_ACT_CONSTRAINT_DIRMY,
- KX_ACT_CONSTRAINT_DIRMZ,
+ KX_ACT_CONSTRAINT_DIRNX,
+ KX_ACT_CONSTRAINT_DIRNY,
+ KX_ACT_CONSTRAINT_DIRNZ,
KX_ACT_CONSTRAINT_ORIX,
KX_ACT_CONSTRAINT_ORIY,
KX_ACT_CONSTRAINT_ORIZ,
@@ -100,7 +102,8 @@ protected:
KX_ACT_CONSTRAINT_DISTANCE = 512
};
bool IsValidMode(KX_CONSTRAINTTYPE m);
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo*);
KX_ConstraintActuator(SCA_IObject* gameobj,
int posDamptime,
@@ -131,27 +134,27 @@ protected:
virtual PyObject* _getattr(const STR_String& attr);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDamp);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDamp);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetRotDamp);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetRotDamp);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDirection);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDirection);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetOption);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetOption);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetTime);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetTime);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetProperty);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetProperty);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty);
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMin);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMin);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin);
static char SetDistance_doc[];
static char GetDistance_doc[];
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMax);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMax);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax);
static char SetRayLength_doc[];
static char GetRayLength_doc[];
KX_PYMETHOD_DOC(KX_ConstraintActuator,SetLimit);
- KX_PYMETHOD_DOC(KX_ConstraintActuator,GetLimit);
+ KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit);
};
#endif //__KX_CONSTRAINTACTUATOR
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
index 987125ca9ba..c9095ff34f6 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
@@ -27,6 +27,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
+#include "PyObjectPlus.h"
#include "KX_ConstraintWrapper.h"
#include "PHY_IPhysicsEnvironment.h"
@@ -53,8 +54,7 @@ PyObject* KX_ConstraintWrapper::PyTestMethod(PyObject* self,
PyObject* kwds)
{
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* self,
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
index e0cd5a3bc9e..9607489497d 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
@@ -76,16 +76,16 @@
struct KX_PhysicsInstance
{
DT_VertexBaseHandle m_vertexbase;
- int m_vtxarray;
+ RAS_DisplayArray* m_darray;
RAS_IPolyMaterial* m_material;
-
- KX_PhysicsInstance(DT_VertexBaseHandle vertex_base, int vtxarray, RAS_IPolyMaterial* mat)
+
+ KX_PhysicsInstance(DT_VertexBaseHandle vertex_base, RAS_DisplayArray *darray, RAS_IPolyMaterial* mat)
: m_vertexbase(vertex_base),
- m_vtxarray(vtxarray),
- m_material(mat)
+ m_darray(darray),
+ m_material(mat)
{
}
-
+
~KX_PhysicsInstance()
{
DT_DeleteVertexBase(m_vertexbase);
@@ -100,11 +100,11 @@ static void BL_RegisterSumoObject(KX_GameObject* gameobj,class SM_Scene* sumoSce
static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope);
void KX_ConvertSumoObject( KX_GameObject* gameobj,
- RAS_MeshObject* meshobj,
- KX_Scene* kxscene,
- PHY_ShapeProps* kxshapeprops,
- PHY_MaterialProps* kxmaterial,
- struct KX_ObjectProperties* objprop)
+ RAS_MeshObject* meshobj,
+ KX_Scene* kxscene,
+ PHY_ShapeProps* kxshapeprops,
+ PHY_MaterialProps* kxmaterial,
+ struct KX_ObjectProperties* objprop)
{
@@ -150,23 +150,23 @@ void KX_ConvertSumoObject( KX_GameObject* gameobj,
objprop->m_boundobject.box.m_extends[1],
objprop->m_boundobject.box.m_extends[2]);
smprop->m_inertia.scale(objprop->m_boundobject.box.m_extends[0]*objprop->m_boundobject.box.m_extends[0],
- objprop->m_boundobject.box.m_extends[1]*objprop->m_boundobject.box.m_extends[1],
- objprop->m_boundobject.box.m_extends[2]*objprop->m_boundobject.box.m_extends[2]);
+ objprop->m_boundobject.box.m_extends[1]*objprop->m_boundobject.box.m_extends[1],
+ objprop->m_boundobject.box.m_extends[2]*objprop->m_boundobject.box.m_extends[2]);
smprop->m_inertia *= smprop->m_mass/MT_Vector3(objprop->m_boundobject.box.m_extends).length();
break;
case KX_BOUNDCYLINDER:
shape = DT_NewCylinder(smprop->m_radius, objprop->m_boundobject.c.m_height);
smprop->m_inertia.scale(smprop->m_mass*smprop->m_radius*smprop->m_radius,
- smprop->m_mass*smprop->m_radius*smprop->m_radius,
- smprop->m_mass*objprop->m_boundobject.c.m_height*objprop->m_boundobject.c.m_height);
+ smprop->m_mass*smprop->m_radius*smprop->m_radius,
+ smprop->m_mass*objprop->m_boundobject.c.m_height*objprop->m_boundobject.c.m_height);
break;
case KX_BOUNDCONE:
shape = DT_NewCone(objprop->m_radius, objprop->m_boundobject.c.m_height);
smprop->m_inertia.scale(smprop->m_mass*smprop->m_radius*smprop->m_radius,
- smprop->m_mass*smprop->m_radius*smprop->m_radius,
- smprop->m_mass*objprop->m_boundobject.c.m_height*objprop->m_boundobject.c.m_height);
+ smprop->m_mass*smprop->m_radius*smprop->m_radius,
+ smprop->m_mass*objprop->m_boundobject.c.m_height*objprop->m_boundobject.c.m_height);
break;
- /* Dynamic mesh objects. WARNING! slow. */
+ /* Dynamic mesh objects. WARNING! slow. */
case KX_BOUNDPOLYTOPE:
polytope = true;
// fall through
@@ -186,15 +186,15 @@ void KX_ConvertSumoObject( KX_GameObject* gameobj,
shape = DT_NewSphere(objprop->m_radius);
smprop->m_inertia *= smprop->m_mass*smprop->m_radius*smprop->m_radius;
break;
-
+
}
-
+
sumoObj = new SM_Object(shape, !objprop->m_ghost?smmaterial:NULL,smprop,NULL);
-
+
sumoObj->setRigidBody(objprop->m_angular_rigidbody?true:false);
-
+
BL_RegisterSumoObject(gameobj,sceneptr,sumoObj,"",true, true);
-
+
}
else {
// non physics object
@@ -320,12 +320,11 @@ static void BL_RegisterSumoObject(
physicscontroller->SetObject(gameobj->GetSGNode());
}
-static DT_ShapeHandle InstancePhysicsComplex(RAS_MeshObject* meshobj, int vtxarray, RAS_IPolyMaterial *mat)
+static DT_ShapeHandle InstancePhysicsComplex(RAS_MeshObject* meshobj, RAS_DisplayArray *darray, RAS_IPolyMaterial *mat)
{
// instance a mesh from a single vertex array & material
- const RAS_TexVert *vertex_array = &((*meshobj->GetVertexCache(mat)[vtxarray])[0]);
- //const KX_IndexArray &index_array = *meshobj->GetIndexCache(mat)[vtxarray];
- DT_VertexBaseHandle vertex_base = DT_NewVertexBase(vertex_array[0].getLocalXYZ(), sizeof(RAS_TexVert));
+ const RAS_TexVert *vertex_array = &darray->m_vertex[0];
+ DT_VertexBaseHandle vertex_base = DT_NewVertexBase(vertex_array[0].getXYZ(), sizeof(RAS_TexVert));
DT_ShapeHandle shape = DT_NewComplexShape(vertex_base);
@@ -337,15 +336,19 @@ static DT_ShapeHandle InstancePhysicsComplex(RAS_MeshObject* meshobj, int vtxarr
// only add polygons that have the collisionflag set
if (poly->IsCollider())
{
- DT_VertexIndices(3, poly->GetVertexIndexBase().m_indexarray);
+ DT_Begin();
+ DT_VertexIndex(poly->GetVertexOffset(0));
+ DT_VertexIndex(poly->GetVertexOffset(1));
+ DT_VertexIndex(poly->GetVertexOffset(2));
+ DT_End();
// tesselate
if (poly->VertexCount() == 4)
{
DT_Begin();
- DT_VertexIndex(poly->GetVertexIndexBase().m_indexarray[0]);
- DT_VertexIndex(poly->GetVertexIndexBase().m_indexarray[2]);
- DT_VertexIndex(poly->GetVertexIndexBase().m_indexarray[3]);
+ DT_VertexIndex(poly->GetVertexOffset(0));
+ DT_VertexIndex(poly->GetVertexOffset(2));
+ DT_VertexIndex(poly->GetVertexOffset(3));
DT_End();
}
}
@@ -354,16 +357,15 @@ static DT_ShapeHandle InstancePhysicsComplex(RAS_MeshObject* meshobj, int vtxarr
//DT_VertexIndices(indices.size(), &indices[0]);
DT_EndComplexShape();
- map_gamemesh_to_instance.insert(GEN_HashedPtr(meshobj), new KX_PhysicsInstance(vertex_base, vtxarray, mat));
+ map_gamemesh_to_instance.insert(GEN_HashedPtr(meshobj), new KX_PhysicsInstance(vertex_base, darray, mat));
return shape;
}
-static DT_ShapeHandle InstancePhysicsPolytope(RAS_MeshObject* meshobj, int vtxarray, RAS_IPolyMaterial *mat)
+static DT_ShapeHandle InstancePhysicsPolytope(RAS_MeshObject* meshobj, RAS_DisplayArray *darray, RAS_IPolyMaterial *mat)
{
// instance a mesh from a single vertex array & material
- const RAS_TexVert *vertex_array = &((*meshobj->GetVertexCache(mat)[vtxarray])[0]);
- //const KX_IndexArray &index_array = *meshobj->GetIndexCache(mat)[vtxarray];
- DT_VertexBaseHandle vertex_base = DT_NewVertexBase(vertex_array[0].getLocalXYZ(), sizeof(RAS_TexVert));
+ const RAS_TexVert *vertex_array = &darray->m_vertex[0];
+ DT_VertexBaseHandle vertex_base = DT_NewVertexBase(vertex_array[0].getXYZ(), sizeof(RAS_TexVert));
std::vector<DT_Index> indices;
for (int p = 0; p < meshobj->NumPolygons(); p++)
@@ -373,12 +375,12 @@ static DT_ShapeHandle InstancePhysicsPolytope(RAS_MeshObject* meshobj, int vtxar
// only add polygons that have the collisionflag set
if (poly->IsCollider())
{
- indices.push_back(poly->GetVertexIndexBase().m_indexarray[0]);
- indices.push_back(poly->GetVertexIndexBase().m_indexarray[1]);
- indices.push_back(poly->GetVertexIndexBase().m_indexarray[2]);
+ indices.push_back(poly->GetVertexOffset(0));
+ indices.push_back(poly->GetVertexOffset(1));
+ indices.push_back(poly->GetVertexOffset(2));
if (poly->VertexCount() == 4)
- indices.push_back(poly->GetVertexIndexBase().m_indexarray[3]);
+ indices.push_back(poly->GetVertexOffset(3));
}
}
@@ -386,7 +388,7 @@ static DT_ShapeHandle InstancePhysicsPolytope(RAS_MeshObject* meshobj, int vtxar
DT_VertexIndices(indices.size(), &indices[0]);
DT_EndPolytope();
- map_gamemesh_to_instance.insert(GEN_HashedPtr(meshobj), new KX_PhysicsInstance(vertex_base, vtxarray, mat));
+ map_gamemesh_to_instance.insert(GEN_HashedPtr(meshobj), new KX_PhysicsInstance(vertex_base, darray, mat));
return shape;
}
@@ -398,8 +400,8 @@ bool KX_ReInstanceShapeFromMesh(RAS_MeshObject* meshobj)
KX_PhysicsInstance *instance = *map_gamemesh_to_instance[GEN_HashedPtr(meshobj)];
if (instance)
{
- const RAS_TexVert *vertex_array = &((*meshobj->GetVertexCache(instance->m_material)[instance->m_vtxarray])[0]);
- DT_ChangeVertexBase(instance->m_vertexbase, vertex_array[0].getLocalXYZ());
+ const RAS_TexVert *vertex_array = &instance->m_darray->m_vertex[0];
+ DT_ChangeVertexBase(instance->m_vertexbase, vertex_array[0].getXYZ());
return true;
}
return false;
@@ -425,7 +427,7 @@ static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope
// Count the number of collision polygons and check they all come from the same
// vertex array
int numvalidpolys = 0;
- int vtxarray = -1;
+ RAS_DisplayArray *darray = NULL;
RAS_IPolyMaterial *poly_material = NULL;
bool reinstance = true;
@@ -437,14 +439,14 @@ static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope
if (poly->IsCollider())
{
// check polygon is from the same vertex array
- if (poly->GetVertexIndexBase().m_vtxarray != vtxarray)
+ if (poly->GetDisplayArray() != darray)
{
- if (vtxarray < 0)
- vtxarray = poly->GetVertexIndexBase().m_vtxarray;
+ if (darray == NULL)
+ darray = poly->GetDisplayArray();
else
{
reinstance = false;
- vtxarray = -1;
+ darray = NULL;
}
}
@@ -478,9 +480,9 @@ static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope
if (reinstance)
{
if (polytope)
- shape = InstancePhysicsPolytope(meshobj, vtxarray, poly_material);
+ shape = InstancePhysicsPolytope(meshobj, darray, poly_material);
else
- shape = InstancePhysicsComplex(meshobj, vtxarray, poly_material);
+ shape = InstancePhysicsComplex(meshobj, darray, poly_material);
}
else
{
@@ -489,7 +491,7 @@ static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope
std::cout << "CreateShapeFromMesh: " << meshobj->GetName() << " is not suitable for polytope." << std::endl;
if (!poly_material)
std::cout << " Check mesh materials." << std::endl;
- if (vtxarray < 0)
+ if (darray == NULL)
std::cout << " Check number of vertices." << std::endl;
}
@@ -505,18 +507,10 @@ static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope
if (poly->IsCollider())
{ /* We have to tesselate here because SOLID can only raycast triangles */
DT_Begin();
- /* V1 */
- DT_Vertex(meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[2],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ());
- /* V2 */
- DT_Vertex(meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[1],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ());
- /* V3 */
- DT_Vertex(meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[0],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ());
+ /* V1, V2, V3 */
+ DT_Vertex(poly->GetVertex(2)->getXYZ());
+ DT_Vertex(poly->GetVertex(1)->getXYZ());
+ DT_Vertex(poly->GetVertex(0)->getXYZ());
numvalidpolys++;
DT_End();
@@ -524,18 +518,10 @@ static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope
if (poly->VertexCount() == 4)
{
DT_Begin();
- /* V1 */
- DT_Vertex(meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[3],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ());
- /* V3 */
- DT_Vertex(meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[2],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ());
- /* V4 */
- DT_Vertex(meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[0],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ());
+ /* V1, V3, V4 */
+ DT_Vertex(poly->GetVertex(3)->getXYZ());
+ DT_Vertex(poly->GetVertex(2)->getXYZ());
+ DT_Vertex(poly->GetVertex(0)->getXYZ());
numvalidpolys++;
DT_End();
@@ -680,188 +666,6 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj,
// forward declarations
-static btCollisionShape* CreateBulletShapeFromMesh(RAS_MeshObject* meshobj, bool polytope)
-{
- if (!meshobj)
- return 0;
-
- btCollisionShape* collisionMeshShape = 0;
- btConvexHullShape* convexHullShape = 0;
- btTriangleMeshShape* concaveShape = 0;
-
- btTriangleMesh* collisionMeshData = 0;
-
- //see if there is any polygons, if not, bail out.
-
- int numPoints = 0;
- btVector3* points = 0;
-
- // Mesh has no polygons!
- int numpolys = meshobj->NumPolygons();
- if (!numpolys)
- {
- return NULL;
- }
-
- // Count the number of collision polygons and check they all come from the same
- // vertex array
- int numvalidpolys = 0;
- int vtxarray = -1;
- RAS_IPolyMaterial *poly_material = NULL;
- bool reinstance = true;
-
- for (int p=0; p<numpolys; p++)
- {
- RAS_Polygon* poly = meshobj->GetPolygon(p);
-
- // only add polygons that have the collisionflag set
- if (poly->IsCollider())
- {
- // check polygon is from the same vertex array
- if (poly->GetVertexIndexBase().m_vtxarray != vtxarray)
- {
- if (vtxarray < 0)
- vtxarray = poly->GetVertexIndexBase().m_vtxarray;
- else
- {
- reinstance = false;
- vtxarray = -1;
- }
- }
-
- // check poly is from the same material
- if (poly->GetMaterial()->GetPolyMaterial() != poly_material)
- {
- if (poly_material)
- {
- reinstance = false;
- poly_material = NULL;
- }
- else
- poly_material = poly->GetMaterial()->GetPolyMaterial();
- }
-
- // count the number of collision polys
- numvalidpolys++;
-
- // We have one collision poly, and we can't reinstance, so we
- // might as well break here.
- if (!reinstance)
- break;
- }
- }
-
- // No collision polygons
- if (numvalidpolys < 1)
- return NULL;
-
-
- if (polytope)
- {
- convexHullShape = new btConvexHullShape(&points[0].getX(),numPoints);
- collisionMeshShape = convexHullShape;
- } else
- {
- collisionMeshData = new btTriangleMesh();
-// concaveShape = new btTriangleMeshShape(collisionMeshData);
- //collisionMeshShape = concaveShape;
-
- }
-
-
- numvalidpolys = 0;
-
- for (int p2=0; p2<numpolys; p2++)
- {
- RAS_Polygon* poly = meshobj->GetPolygon(p2);
-
- // only add polygons that have the collisionflag set
- if (poly->IsCollider())
- {
- //Bullet can raycast any shape, so
- if (polytope)
- {
- for (int i=0;i<poly->VertexCount();i++)
- {
- const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[i],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 point(vtx[0],vtx[1],vtx[2]);
- convexHullShape->addPoint(point);
- }
- if (poly->VertexCount())
- numvalidpolys++;
-
- } else
- {
- {
- const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[2],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 vertex0(vtx[0],vtx[1],vtx[2]);
- vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[1],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 vertex1(vtx[0],vtx[1],vtx[2]);
- vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[0],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 vertex2(vtx[0],vtx[1],vtx[2]);
- collisionMeshData->addTriangle(vertex0,vertex1,vertex2);
- numvalidpolys++;
- }
- if (poly->VertexCount() == 4)
- {
- const float* vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[3],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 vertex0(vtx[0],vtx[1],vtx[2]);
- vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[2],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 vertex1(vtx[0],vtx[1],vtx[2]);
- vtx = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray,
- poly->GetVertexIndexBase().m_indexarray[0],
- poly->GetMaterial()->GetPolyMaterial())->getLocalXYZ();
- btPoint3 vertex2(vtx[0],vtx[1],vtx[2]);
- collisionMeshData->addTriangle(vertex0,vertex1,vertex2);
- numvalidpolys++;
- }
-
- }
- }
- }
-
-
-
- if (numvalidpolys > 0)
- {
-
- if (!polytope)
- {
- bool useQuantization = true;
- concaveShape = new btBvhTriangleMeshShape( collisionMeshData, useQuantization );
- //concaveShape = new btTriangleMeshShape( collisionMeshData );
-
- concaveShape->recalcLocalAabb();
- if (collisionMeshShape)
- delete collisionMeshShape;
- collisionMeshShape = concaveShape;
-
- }
-
-
-
- return collisionMeshShape;
- }
- if (collisionMeshShape)
- delete collisionMeshShape;
- if (collisionMeshData)
- delete collisionMeshData;
- return NULL;
-
-}
-
void KX_ConvertBulletObject( class KX_GameObject* gameobj,
class RAS_MeshObject* meshobj,
@@ -878,6 +682,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
bool isbulletdyna = false;
CcdConstructionInfo ci;
class PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode());
+ class CcdShapeConstructionInfo *shapeInfo = new CcdShapeConstructionInfo();
@@ -894,120 +699,80 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
ci.m_gravity = btVector3(0,0,0);
ci.m_localInertiaTensor =btVector3(0,0,0);
ci.m_mass = objprop->m_dyna ? shapeprops->m_mass : 0.f;
+ shapeInfo->m_radius = objprop->m_radius;
isbulletdyna = objprop->m_dyna;
ci.m_localInertiaTensor = btVector3(ci.m_mass/3.f,ci.m_mass/3.f,ci.m_mass/3.f);
- btTransform trans;
- trans.setIdentity();
-
btCollisionShape* bm = 0;
switch (objprop->m_boundclass)
{
case KX_BOUNDSPHERE:
{
- float radius = objprop->m_radius;
- btVector3 inertiaHalfExtents (
- radius,
- radius,
- radius);
+ //float radius = objprop->m_radius;
+ //btVector3 inertiaHalfExtents (
+ // radius,
+ // radius,
+ // radius);
//blender doesn't support multisphere, but for testing:
//bm = new MultiSphereShape(inertiaHalfExtents,,&trans.getOrigin(),&radius,1);
- bm = new btSphereShape(objprop->m_radius);
- bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
+ shapeInfo->m_shapeType = PHY_SHAPE_SPHERE;
+ bm = shapeInfo->CreateBulletShape();
break;
};
case KX_BOUNDBOX:
{
- MT_Vector3 halfExtents (
+ shapeInfo->m_halfExtend.setValue(
objprop->m_boundobject.box.m_extends[0],
- objprop->m_boundobject.box.m_extends[1],
- objprop->m_boundobject.box.m_extends[2]);
-
- halfExtents /= 2.f;
-
- //btVector3 he (halfExtents[0]-CONVEX_DISTANCE_MARGIN ,halfExtents[1]-CONVEX_DISTANCE_MARGIN ,halfExtents[2]-CONVEX_DISTANCE_MARGIN );
- //he = he.absolute();
-
- btVector3 he (halfExtents[0],halfExtents[1],halfExtents[2]);
- he = he.absolute();
-
+ objprop->m_boundobject.box.m_extends[1],
+ objprop->m_boundobject.box.m_extends[2]);
- bm = new btBoxShape(he);
- bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
+ shapeInfo->m_halfExtend /= 2.0;
+ shapeInfo->m_halfExtend = shapeInfo->m_halfExtend.absolute();
+ shapeInfo->m_shapeType = PHY_SHAPE_BOX;
+ bm = shapeInfo->CreateBulletShape();
break;
};
case KX_BOUNDCYLINDER:
{
- btVector3 halfExtents (
+ shapeInfo->m_halfExtend.setValue(
objprop->m_boundobject.c.m_radius,
objprop->m_boundobject.c.m_radius,
objprop->m_boundobject.c.m_height * 0.5f
);
- bm = new btCylinderShapeZ(halfExtents);
- bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
-
+ shapeInfo->m_shapeType = PHY_SHAPE_CYLINDER;
+ bm = shapeInfo->CreateBulletShape();
break;
}
- case KX_BOUNDCONE:
+ case KX_BOUNDCONE:
{
- btVector3 halfExtents (objprop->m_boundobject.box.m_extends[0],
- objprop->m_boundobject.box.m_extends[1],
- objprop->m_boundobject.box.m_extends[2]);
-
-
- halfExtents /= 2.f;
-
- bm = new btConeShapeZ(objprop->m_boundobject.c.m_radius,objprop->m_boundobject.c.m_height);
- bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
-
+ shapeInfo->m_radius = objprop->m_boundobject.c.m_radius;
+ shapeInfo->m_height = objprop->m_boundobject.c.m_height;
+ shapeInfo->m_shapeType = PHY_SHAPE_CONE;
+ bm = shapeInfo->CreateBulletShape();
break;
}
- case KX_BOUNDPOLYTOPE:
- {
- bm = CreateBulletShapeFromMesh(meshobj,true);
- if (bm)
- {
- bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
- }
- break;
- }
- case KX_BOUNDMESH:
- {
- if (!ci.m_mass)
- {
- bm = CreateBulletShapeFromMesh(meshobj,false);
- ci.m_localInertiaTensor.setValue(0.f,0.f,0.f);
- //no moving concave meshes, so don't bother calculating inertia
- //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
- }
-
- break;
- }
-
- default:
- //interpret the shape as a concave triangle-mesh
+ case KX_BOUNDPOLYTOPE:
{
- if (meshobj)
- {
- bm = CreateBulletShapeFromMesh(meshobj,false);
- ci.m_localInertiaTensor.setValue(0.f,0.f,0.f);
-
- // assert(0);
-
- /*
- meshobj->ScheduleCollisionPolygons();
-
- KX_DeformableMesh* gfxmesh = new KX_DeformableMesh(meshobj);
- gfxmesh->sendFixedMapping();
- //trianglemesh
- bm = new TriangleMeshInterface(gfxmesh,trans);
- */
+ shapeInfo->SetMesh(meshobj, true);
+ bm = shapeInfo->CreateBulletShape();
+ break;
+ }
+ case KX_BOUNDMESH:
+ {
+ if (!ci.m_mass)
+ {
+ shapeInfo->SetMesh(meshobj, false);
+ bm = shapeInfo->CreateBulletShape();
+ //no moving concave meshes, so don't bother calculating inertia
+ //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
}
+
+ break;
}
}
@@ -1017,44 +782,41 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
if (!bm)
{
delete motionstate;
+ delete shapeInfo;
return;
}
bm->setMargin(0.06);
-
if (objprop->m_isCompoundChild)
{
//find parent, compound shape and add to it
//take relative transform into account!
KX_BulletPhysicsController* parentCtrl = (KX_BulletPhysicsController*)objprop->m_dynamic_parent->GetPhysicsController();
assert(parentCtrl);
+ CcdShapeConstructionInfo* parentShapeInfo = parentCtrl->GetShapeInfo();
btRigidBody* rigidbody = parentCtrl->GetRigidBody();
btCollisionShape* colShape = rigidbody->getCollisionShape();
assert(colShape->isCompound());
btCompoundShape* compoundShape = (btCompoundShape*)colShape;
- btTransform childTrans;
- childTrans.setIdentity();
- NodeList& children = objprop->m_dynamic_parent->GetSGNode()->GetSGChildren();
MT_Point3 childPos = gameobj->GetSGNode()->GetLocalPosition();
MT_Matrix3x3 childRot = gameobj->GetSGNode()->GetLocalOrientation();
MT_Vector3 childScale = gameobj->GetSGNode()->GetLocalScale();
bm->setLocalScaling(btVector3(childScale.x(),childScale.y(),childScale.z()));
- childTrans.setOrigin(btVector3(childPos.x(),childPos.y(),childPos.z()));
+ shapeInfo->m_childTrans.setOrigin(btVector3(childPos.x(),childPos.y(),childPos.z()));
float rotval[12];
childRot.getValue(rotval);
btMatrix3x3 newRot;
newRot.setValue(rotval[0],rotval[1],rotval[2],rotval[4],rotval[5],rotval[6],rotval[8],rotval[9],rotval[10]);
newRot = newRot.transpose();
- childTrans.setBasis(newRot);
-
-
- compoundShape->addChildShape(childTrans,bm);
- kxscene->AddShape(bm);
+ shapeInfo->m_childTrans.setBasis(newRot);
+ parentShapeInfo->AddShape(shapeInfo);
+
+ compoundShape->addChildShape(shapeInfo->m_childTrans,bm);
//do some recalc?
//recalc inertia for rigidbody
if (!rigidbody->isStaticOrKinematicObject())
@@ -1069,15 +831,16 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
if (objprop->m_hasCompoundChildren)
{
- //replace shape by compoundShape
+ // create a compound shape info
+ CcdShapeConstructionInfo *compoundShapeInfo = new CcdShapeConstructionInfo();
+ compoundShapeInfo->m_shapeType = PHY_SHAPE_COMPOUND;
+ compoundShapeInfo->AddShape(shapeInfo);
+ // create the compound shape manually as we already have the child shape
btCompoundShape* compoundShape = new btCompoundShape();
- btTransform identTrans;
- identTrans.setIdentity();
- compoundShape->addChildShape(identTrans,bm);
- //note abount compoundShape: Bullet does not delete the child shapes when
- //the compound shape is deleted, so insert also the child shapes
- kxscene->AddShape(bm);
+ compoundShape->addChildShape(shapeInfo->m_childTrans,bm);
+ // now replace the shape
bm = compoundShape;
+ shapeInfo = compoundShapeInfo;
}
@@ -1113,6 +876,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
ci.m_collisionShape = bm;
+ ci.m_shapeInfo = shapeInfo;
ci.m_friction = smmaterial->m_friction;//tweak the friction a bit, so the default 0.5 works nice
ci.m_restitution = smmaterial->m_restitution;
ci.m_physicsEnv = env;
@@ -1124,9 +888,12 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
ci.m_collisionFilterGroup = (isbulletdyna) ? short(CcdConstructionInfo::DefaultFilter) : short(CcdConstructionInfo::StaticFilter);
ci.m_collisionFilterMask = (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter);
ci.m_bRigid = objprop->m_dyna && objprop->m_angular_rigidbody;
+ MT_Vector3 scaling = gameobj->NodeGetWorldScaling();
+ ci.m_scaling.setValue(scaling[0], scaling[1], scaling[2]);
KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna);
- //remember that we created a shape so that we can delete it when the scene is removed (bullet will not delete it)
- kxscene->AddShape(bm);
+ // shapeInfo is reference counted, decrement now as we don't use it anymore
+ if (shapeInfo)
+ shapeInfo->Release();
if (objprop->m_in_active_layer)
{
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 185f456c83a..27a955b3105 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -51,6 +51,7 @@ typedef unsigned long uint_ptr;
#include "KX_GameObject.h"
#include "RAS_MeshObject.h"
#include "KX_MeshProxy.h"
+#include "KX_PolyProxy.h"
#include <stdio.h> // printf
#include "SG_Controller.h"
#include "KX_IPhysicsController.h"
@@ -64,6 +65,8 @@ typedef unsigned long uint_ptr;
#include "SCA_IActuator.h"
#include "SCA_ISensor.h"
+#include "PyObjectPlus.h" /* python stuff */
+
// This file defines relationships between parents and children
// in the game engine.
@@ -77,13 +80,16 @@ KX_GameObject::KX_GameObject(
SCA_IObject(T),
m_bDyna(false),
m_layer(0),
+ m_pBlenderObject(NULL),
+ m_pBlenderGroupObject(NULL),
m_bSuspendDynamics(false),
m_bUseObjectColor(false),
m_bIsNegativeScaling(false),
- m_pBlenderObject(NULL),
m_bVisible(true),
+ m_bCulled(true),
m_pPhysicsController1(NULL),
m_pPhysicsEnvironment(NULL),
+ m_xray(false),
m_pHitObject(NULL),
m_isDeformable(false)
{
@@ -96,14 +102,14 @@ KX_GameObject::KX_GameObject(
KX_NormalParentRelation * parent_relation =
KX_NormalParentRelation::New();
m_pSGNode->SetParentRelation(parent_relation);
-
-
};
KX_GameObject::~KX_GameObject()
{
+ RemoveMeshes();
+
// is this delete somewhere ?
//if (m_sumoObj)
// delete m_sumoObj;
@@ -277,6 +283,7 @@ void KX_GameObject::ProcessReplica(KX_GameObject* replica)
replica->m_pSGNode = NULL;
replica->m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
replica->m_pClient_info->m_gameobject = replica;
+ replica->m_state = 0;
}
@@ -284,11 +291,11 @@ void KX_GameObject::ProcessReplica(KX_GameObject* replica)
CValue* KX_GameObject::GetReplica()
{
KX_GameObject* replica = new KX_GameObject(*this);
-
+
// this will copy properties and so on...
CValue::AddDataToReplica(replica);
ProcessReplica(replica);
-
+
return replica;
}
@@ -354,24 +361,47 @@ double* KX_GameObject::GetOpenGLMatrix()
return fl;
}
+void KX_GameObject::AddMeshUser()
+{
+ for (size_t i=0;i<m_meshes.size();i++)
+ m_meshes[i]->AddMeshUser(this);
+
+ UpdateBuckets(false);
+}
+
+static void UpdateBuckets_recursive(SG_Node* node)
+{
+ NodeList& children = node->GetSGChildren();
+ for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit)
+ {
+ SG_Node* childnode = (*childit);
+ KX_GameObject *clientgameobj = static_cast<KX_GameObject*>( (*childit)->GetSGClientObject());
+ if (clientgameobj != NULL) // This is a GameObject
+ clientgameobj->UpdateBuckets(0);
+
+ // if the childobj is NULL then this may be an inverse parent link
+ // so a non recursive search should still look down this node.
+ UpdateBuckets_recursive(childnode);
+ }
+}
-void KX_GameObject::Bucketize()
+void KX_GameObject::UpdateBuckets( bool recursive )
{
double* fl = GetOpenGLMatrix();
for (size_t i=0;i<m_meshes.size();i++)
- m_meshes[i]->Bucketize(fl, this, m_bUseObjectColor, m_objectColor);
+ m_meshes[i]->UpdateBuckets(this, fl, m_bUseObjectColor, m_objectColor, m_bVisible, m_bCulled);
+
+ if (recursive) {
+ UpdateBuckets_recursive(m_pSGNode);
+ }
}
-
-
void KX_GameObject::RemoveMeshes()
{
- double* fl = GetOpenGLMatrix();
-
for (size_t i=0;i<m_meshes.size();i++)
- m_meshes[i]->RemoveFromBuckets(fl, this);
+ m_meshes[i]->RemoveFromBuckets(this);
//note: meshes can be shared, and are deleted by KX_BlenderSceneConverter
@@ -442,6 +472,7 @@ void KX_GameObject::UpdateIPO(float curframetime,
// IPO update
void
KX_GameObject::UpdateMaterialData(
+ dword matname_hash,
MT_Vector4 rgba,
MT_Vector3 specrgb,
MT_Scalar hard,
@@ -454,15 +485,34 @@ KX_GameObject::UpdateMaterialData(
{
int mesh = 0;
if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0) {
- RAS_MaterialBucket::Set::iterator mit = m_meshes[mesh]->GetFirstMaterial();
+ list<RAS_MeshMaterial>::iterator mit = m_meshes[mesh]->GetFirstMaterial();
+
for(; mit != m_meshes[mesh]->GetLastMaterial(); ++mit)
{
- RAS_IPolyMaterial* poly = (*mit)->GetPolyMaterial();
+ RAS_IPolyMaterial* poly = mit->m_bucket->GetPolyMaterial();
+
if(poly->GetFlag() & RAS_BLENDERMAT )
{
- SetObjectColor(rgba);
KX_BlenderMaterial *m = static_cast<KX_BlenderMaterial*>(poly);
- m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha);
+
+ if (matname_hash == NULL)
+ {
+ m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha);
+ // if mesh has only one material attached to it then use original hack with no need to edit vertices (better performance)
+ SetObjectColor(rgba);
+ }
+ else
+ {
+ if (matname_hash == poly->GetMaterialNameHash())
+ {
+ m->UpdateIPO(rgba, specrgb,hard,spec,ref,emit, alpha);
+ m_meshes[mesh]->SetVertexColor(poly,rgba);
+
+ // no break here, because one blender material can be split into several game engine materials
+ // (e.g. one uvsphere material is split into one material at poles with ras_mode TRIANGLE and one material for the body
+ // if here was a break then would miss some vertices if material was split
+ }
+ }
}
}
}
@@ -475,68 +525,68 @@ KX_GameObject::GetVisible(
return m_bVisible;
}
+static void setVisible_recursive(SG_Node* node, bool v)
+{
+ NodeList& children = node->GetSGChildren();
+
+ for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit)
+ {
+ SG_Node* childnode = (*childit);
+ KX_GameObject *clientgameobj = static_cast<KX_GameObject*>( (*childit)->GetSGClientObject());
+ if (clientgameobj != NULL) // This is a GameObject
+ clientgameobj->SetVisible(v, 0);
+
+ // if the childobj is NULL then this may be an inverse parent link
+ // so a non recursive search should still look down this node.
+ setVisible_recursive(childnode, v);
+ }
+}
+
+
void
KX_GameObject::SetVisible(
- bool v
+ bool v,
+ bool recursive
)
{
m_bVisible = v;
+ if (recursive)
+ setVisible_recursive(m_pSGNode, v);
}
-void
-KX_GameObject::SetLayer(
- int l
+bool
+KX_GameObject::GetCulled(
+ void
)
{
- m_layer = l;
+ return m_bCulled;
}
-int
-KX_GameObject::GetLayer(
- void
+void
+KX_GameObject::SetCulled(
+ bool c
)
{
- return m_layer;
+ m_bCulled = c;
}
-// used by Python, and the actuatorshould _not_ be misused by the
-// scene!
-void
-KX_GameObject::MarkVisible(
- bool visible
+
+void
+KX_GameObject::SetLayer(
+ int l
)
{
- /* If explicit visibility settings are used, this is
- * determined on this level. Maybe change this to mesh level
- * later on? */
-
- double* fl = GetOpenGLMatrixPtr()->getPointer();
- for (size_t i=0;i<m_meshes.size();i++)
- {
- m_meshes[i]->MarkVisible(fl,this,visible,m_bUseObjectColor,m_objectColor);
- }
+ m_layer = l;
}
-
-// Always use the flag?
-void
-KX_GameObject::MarkVisible(
+int
+KX_GameObject::GetLayer(
void
)
{
- double* fl = GetOpenGLMatrixPtr()->getPointer();
- for (size_t i=0;i<m_meshes.size();i++)
- {
- m_meshes[i]->MarkVisible(fl,
- this,
- m_bVisible,
- m_bUseObjectColor,
- m_objectColor
- );
- }
+ return m_layer;
}
-
void KX_GameObject::addLinearVelocity(const MT_Vector3& lin_vel,bool local)
{
if (m_pPhysicsController1)
@@ -866,13 +916,15 @@ PyMethodDef KX_GameObject::Methods[] = {
{"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O},
{"getLinearVelocity", (PyCFunction) KX_GameObject::sPyGetLinearVelocity, METH_VARARGS},
{"setLinearVelocity", (PyCFunction) KX_GameObject::sPySetLinearVelocity, METH_VARARGS},
+ {"getAngularVelocity", (PyCFunction) KX_GameObject::sPyGetAngularVelocity, METH_VARARGS},
+ {"setAngularVelocity", (PyCFunction) KX_GameObject::sPySetAngularVelocity, METH_VARARGS},
{"getVelocity", (PyCFunction) KX_GameObject::sPyGetVelocity, METH_VARARGS},
{"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_NOARGS},
{"getReactionForce", (PyCFunction) KX_GameObject::sPyGetReactionForce, METH_NOARGS},
{"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS},
{"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O},
{"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_NOARGS},
- {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_O},
+ {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS},
{"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS},
{"setState",(PyCFunction) KX_GameObject::sPySetState, METH_O},
{"alignAxisToVect",(PyCFunction) KX_GameObject::sPyAlignAxisToVect, METH_VARARGS},
@@ -895,6 +947,7 @@ PyMethodDef KX_GameObject::Methods[] = {
KX_PYMETHODTABLE(KX_GameObject, rayCastTo),
KX_PYMETHODTABLE(KX_GameObject, rayCast),
KX_PYMETHODTABLE(KX_GameObject, getDistanceTo),
+ KX_PYMETHODTABLE(KX_GameObject, getVectTo),
{NULL,NULL} //Sentinel
};
@@ -922,7 +975,7 @@ PyObject* KX_GameObject::PyEndObject(PyObject* self)
KX_Scene *scene = PHY_GetActiveScene();
scene->DelayedRemoveObject(this);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -1012,18 +1065,23 @@ PyObject* KX_GameObject::_getattr(const STR_String& attr)
int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr method
{
- if (attr == "mass")
+ if (attr == "mass") {
+ PyErr_SetString(PyExc_AttributeError, "attribute \"mass\" is read only");
return 1;
+ }
- if (attr == "parent")
+ if (attr == "parent") {
+ PyErr_SetString(PyExc_AttributeError, "attribute \"mass\" is read only\nUse setParent()");
return 1;
+ }
if (PyInt_Check(value))
{
int val = PyInt_AsLong(value);
if (attr == "visible")
{
- SetVisible(val != 0);
+ SetVisible(val != 0, false);
+ UpdateBuckets(false);
return 0;
}
}
@@ -1082,7 +1140,7 @@ int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr
}
return 1;
}
-
+ PyErr_SetString(PyExc_AttributeError, "could not set the orientation from a 3x3 matrix, quaternion or euler sequence");
return 1;
}
@@ -1126,9 +1184,7 @@ int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr
}
-PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self, PyObject* args)
{
// only can get the velocity if we have a physics object connected to us...
int local = 0;
@@ -1142,9 +1198,7 @@ PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self,
}
}
-PyObject* KX_GameObject::PySetLinearVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_GameObject::PySetLinearVelocity(PyObject* self, PyObject* args)
{
int local = 0;
PyObject* pyvect;
@@ -1159,17 +1213,43 @@ PyObject* KX_GameObject::PySetLinearVelocity(PyObject* self,
return NULL;
}
-PyObject* KX_GameObject::PySetVisible(PyObject* self, PyObject* value)
+PyObject* KX_GameObject::PyGetAngularVelocity(PyObject* self, PyObject* args)
{
- int visible = PyInt_AsLong(value);
-
- if (visible==-1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError, "expected 0 or 1");
+ // only can get the velocity if we have a physics object connected to us...
+ int local = 0;
+ if (PyArg_ParseTuple(args,"|i",&local))
+ {
+ return PyObjectFrom(GetAngularVelocity((local!=0)));
+ }
+ else
+ {
return NULL;
}
+}
+
+PyObject* KX_GameObject::PySetAngularVelocity(PyObject* self, PyObject* args)
+{
+ int local = 0;
+ PyObject* pyvect;
+
+ if (PyArg_ParseTuple(args,"O|i",&pyvect,&local)) {
+ MT_Vector3 velocity;
+ if (PyVecTo(pyvect, velocity)) {
+ setAngularVelocity(velocity, (local!=0));
+ Py_RETURN_NONE;
+ }
+ }
+ return NULL;
+}
+
+PyObject* KX_GameObject::PySetVisible(PyObject* self, PyObject* args)
+{
+ int visible, recursive = 0;
+ if (!PyArg_ParseTuple(args,"i|i",&visible, &recursive))
+ return NULL;
- MarkVisible(visible!=0);
- m_bVisible = (visible!=0);
+ SetVisible(visible ? true:false, recursive ? true:false);
+ UpdateBuckets(recursive ? true:false);
Py_RETURN_NONE;
}
@@ -1208,9 +1288,7 @@ PyObject* KX_GameObject::PySetState(PyObject* self, PyObject* value)
-PyObject* KX_GameObject::PyGetVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_GameObject::PyGetVelocity(PyObject* self, PyObject* args)
{
// only can get the velocity if we have a physics object connected to us...
MT_Vector3 velocity(0.0,0.0,0.0);
@@ -1342,20 +1420,19 @@ PyObject* KX_GameObject::PyGetChildrenRecursive(PyObject* self)
return list;
}
-PyObject* KX_GameObject::PyGetMesh(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_GameObject::PyGetMesh(PyObject* self, PyObject* args)
{
int mesh = 0;
- if (PyArg_ParseTuple(args, "|i", &mesh))
+ if (!PyArg_ParseTuple(args, "|i", &mesh))
+ return NULL; // python sets a simple error
+
+ if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0)
{
- if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0)
- {
- KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]);
- return meshproxy;
- }
+ KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]);
+ return meshproxy;
}
+
Py_RETURN_NONE;
}
@@ -1383,9 +1460,7 @@ PyObject* KX_GameObject::PySetCollisionMargin(PyObject* self, PyObject* value)
-PyObject* KX_GameObject::PyApplyImpulse(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_GameObject::PyApplyImpulse(PyObject* self, PyObject* args)
{
PyObject* pyattach;
PyObject* pyimpulse;
@@ -1456,9 +1531,7 @@ PyObject* KX_GameObject::PySetOrientation(PyObject* self, PyObject* value)
return NULL;
}
-PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self, PyObject* args)
{
PyObject* pyvect;
int axis = 2; //z axis is the default
@@ -1469,7 +1542,11 @@ PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* self,
MT_Vector3 vect;
if (PyVecTo(pyvect, vect))
{
+ if (fac<=0.0) Py_RETURN_NONE; // Nothing to do.
+ if (fac> 1.0) fac= 1.0;
+
AlignAxisToVect(vect,axis,fac);
+ NodeUpdateGS(0.f,true);
Py_RETURN_NONE;
}
}
@@ -1526,34 +1603,103 @@ KX_PYMETHODDEF_DOC(KX_GameObject, getDistanceTo,
PyErr_Clear();
PyObject *pyother;
- if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &pyother))
+ KX_GameObject *other;
+ if (PyArg_ParseTuple(args, "O", &pyother) && ConvertPythonToGameObject(pyother, &other, false))
{
- KX_GameObject *other = static_cast<KX_GameObject*>(pyother);
return PyFloat_FromDouble(NodeGetWorldPosition().distance(other->NodeGetWorldPosition()));
}
return NULL;
}
-bool KX_GameObject::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data)
+KX_PYMETHODDEF_DOC(KX_GameObject, getVectTo,
+"getVectTo(other): get vector and the distance to another point/KX_GameObject\n"
+"Returns a 3-tuple with (distance,worldVector,localVector)\n")
{
+ MT_Point3 toPoint, fromPoint;
+ MT_Vector3 toDir, locToDir;
+ MT_Scalar distance;
+
+ PyObject *returnValue;
+ PyObject *pyother;
+ if (!PyVecArgTo(args, toPoint))
+ {
+ PyErr_Clear();
+
+ KX_GameObject *other;
+ if (PyArg_ParseTuple(args, "O", &pyother) && ConvertPythonToGameObject(pyother, &other, false))
+ {
+ toPoint = other->NodeGetWorldPosition();
+ } else
+ {
+ PyErr_SetString(PyExc_TypeError, "Expected a 3D Vector or GameObject type");
+ return NULL;
+ }
+ }
+
+ fromPoint = NodeGetWorldPosition();
+ toDir = toPoint-fromPoint;
+ distance = toDir.length();
+
+ if (MT_fuzzyZero(distance))
+ {
+ //cout << "getVectTo() Error: Null vector!\n";
+ locToDir = toDir = MT_Vector3(0.0,0.0,0.0);
+ distance = 0.0;
+ } else {
+ toDir.normalize();
+ locToDir = toDir * NodeGetWorldOrientation();
+ }
+
+ returnValue = PyTuple_New(3);
+ if (returnValue) { // very unlikely to fail, python sets a memory error here.
+ PyTuple_SET_ITEM(returnValue, 0, PyFloat_FromDouble(distance));
+ PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(toDir));
+ PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(locToDir));
+ }
+ return returnValue;
+}
+
+bool KX_GameObject::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data)
+{
+ KX_GameObject* hitKXObj = client->m_gameobject;
+
+ // if X-ray option is selected, the unwnted objects were not tested, so get here only with true hit
+ // if not, all objects were tested and the front one may not be the correct one.
+ if (m_xray || m_testPropName.Length() == 0 || hitKXObj->GetProperty(m_testPropName) != NULL)
+ {
+ m_pHitObject = hitKXObj;
+ return true;
+ }
+ // return true to stop RayCast::RayTest from looping, the above test was decisive
+ // We would want to loop only if we want to get more than one hit point
+ return true;
+}
+
+/* this function is used to pre-filter the object before casting the ray on them.
+ This is useful for "X-Ray" option when we want to see "through" unwanted object.
+ */
+bool KX_GameObject::NeedRayCast(KX_ClientObjectInfo* client)
+{
KX_GameObject* hitKXObj = client->m_gameobject;
if (client->m_type > KX_ClientObjectInfo::ACTOR)
{
- // false hit
+ // Unknown type of object, skip it.
+ // Should not occur as the sensor objects are filtered in RayTest()
+ printf("Invalid client type %d found in ray casting\n", client->m_type);
return false;
}
-
- if (m_testPropName.Length() == 0 || hitKXObj->GetProperty(m_testPropName) != NULL)
+
+ // if X-Ray option is selected, skip object that don't match the criteria as we see through them
+ // if not, test all objects because we don't know yet which one will be on front
+ if (!m_xray || m_testPropName.Length() == 0 || hitKXObj->GetProperty(m_testPropName) != NULL)
{
- m_pHitObject = hitKXObj;
return true;
}
-
+ // skip the object
return false;
-
}
KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
@@ -1567,19 +1713,23 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
float dist = 0.0f;
char *propName = NULL;
- if (!PyArg_ParseTuple(args,"O|fs", &pyarg, &dist, &propName))
- return NULL;
+ if (!PyArg_ParseTuple(args,"O|fs", &pyarg, &dist, &propName)) {
+ return NULL; // python sets simple error
+ }
if (!PyVecTo(pyarg, toPoint))
{
KX_GameObject *other;
PyErr_Clear();
- if (!PyType_IsSubtype(pyarg->ob_type, &KX_GameObject::Type)) {
+
+ if (ConvertPythonToGameObject(pyarg, &other, false))
+ {
+ toPoint = other->NodeGetWorldPosition();
+ } else
+ {
PyErr_SetString(PyExc_TypeError, "the first argument to rayCastTo must be a vector or a KX_GameObject");
return NULL;
}
- other = static_cast<KX_GameObject*>(pyarg);
- toPoint = other->NodeGetWorldPosition();
}
MT_Point3 fromPoint = NodeGetWorldPosition();
if (dist != 0.0f)
@@ -1589,8 +1739,6 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
toPoint = fromPoint + (dist) * toDir;
}
- MT_Point3 resultPoint;
- MT_Vector3 resultNormal;
PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
@@ -1604,7 +1752,8 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
m_testPropName = propName;
else
m_testPropName.SetLength(0);
- KX_RayCast::RayTest(spc, pe, fromPoint, toPoint, resultPoint, resultNormal, KX_RayCast::Callback<KX_GameObject>(this));
+ KX_RayCast::Callback<KX_GameObject> callback(this,spc);
+ KX_RayCast::RayTest(pe, fromPoint, toPoint, callback);
if (m_pHitObject)
{
@@ -1615,13 +1764,24 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
}
KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
-"rayCast(to,from,dist,prop): cast a ray and return tuple (object,hit,normal) of contact point with object within dist that matches prop or None if no hit\n"
-" prop = property name that object must have; can be omitted => detect any object\n"
-" dist = max distance to look (can be negative => look behind); 0 or omitted => detect up to to\n"
+ "rayCast(to,from,dist,prop,face,xray,poly): cast a ray and return 3-tuple (object,hit,normal) or 4-tuple (object,hit,normal,polygon) of contact point with object within dist that matches prop.\n"
+ " If no hit, return (None,None,None) or (None,None,None,None).\n"
+" to = 3-tuple or object reference for destination of ray (if object, use center of object)\n"
" from = 3-tuple or object reference for origin of ray (if object, use center of object)\n"
-" Can None or omitted => start from self object center\n"
-" to = 3-tuple or object reference for destination of ray (if object, use center of object)\n"
-"Note: the object on which you call this method matters: the ray will ignore it if it goes through it\n")
+" Can be None or omitted => start from self object center\n"
+" dist = max distance to look (can be negative => look behind); 0 or omitted => detect up to to\n"
+" prop = property name that object must have; can be omitted => detect any object\n"
+" face = normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin\n"
+" xray = X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object\n"
+" poly = polygon option: 1=>return value is a 4-tuple and the 4th element is a KX_PolyProxy object\n"
+" which can be None if hit object has no mesh or if there is no hit\n"
+" If 0 or omitted, return value is a 3-tuple\n"
+"Note: The object on which you call this method matters: the ray will ignore it.\n"
+" prop and xray option interact as follow:\n"
+" prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray\n"
+" prop off, xray on : idem\n"
+" prop on, xray off: return closest hit if it matches prop, no hit otherwise\n"
+" prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray\n")
{
MT_Point3 toPoint;
MT_Point3 fromPoint;
@@ -1630,19 +1790,24 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
float dist = 0.0f;
char *propName = NULL;
KX_GameObject *other;
+ int face=0, xray=0, poly=0;
- if (!PyArg_ParseTuple(args,"O|Ofs", &pyto, &pyfrom, &dist, &propName))
- return NULL;
+ if (!PyArg_ParseTuple(args,"O|Ofsiii", &pyto, &pyfrom, &dist, &propName, &face, &xray, &poly)) {
+ return NULL; // Python sets a simple error
+ }
if (!PyVecTo(pyto, toPoint))
{
PyErr_Clear();
- if (!PyType_IsSubtype(pyto->ob_type, &KX_GameObject::Type)) {
+
+ if (ConvertPythonToGameObject(pyto, &other, false))
+ {
+ toPoint = other->NodeGetWorldPosition();
+ } else
+ {
PyErr_SetString(PyExc_TypeError, "the first argument to rayCast must be a vector or a KX_GameObject");
return NULL;
}
- other = static_cast<KX_GameObject*>(pyto);
- toPoint = other->NodeGetWorldPosition();
}
if (!pyfrom || pyfrom == Py_None)
{
@@ -1651,12 +1816,15 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
else if (!PyVecTo(pyfrom, fromPoint))
{
PyErr_Clear();
- if (!PyType_IsSubtype(pyfrom->ob_type, &KX_GameObject::Type)) {
+
+ if (ConvertPythonToGameObject(pyfrom, &other, false))
+ {
+ fromPoint = other->NodeGetWorldPosition();
+ } else
+ {
PyErr_SetString(PyExc_TypeError, "the second optional argument to rayCast must be a vector or a KX_GameObject");
return NULL;
}
- other = static_cast<KX_GameObject*>(pyfrom);
- fromPoint = other->NodeGetWorldPosition();
}
if (dist != 0.0f) {
@@ -1670,8 +1838,6 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
return Py_BuildValue("OOO", Py_None, Py_None, Py_None);
}
- MT_Point3 resultPoint;
- MT_Vector3 resultNormal;
PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
@@ -1685,24 +1851,41 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
m_testPropName = propName;
else
m_testPropName.SetLength(0);
- KX_RayCast::RayTest(spc, pe, fromPoint, toPoint, resultPoint, resultNormal, KX_RayCast::Callback<KX_GameObject>(this));
+ m_xray = xray;
+ // to get the hit results
+ KX_RayCast::Callback<KX_GameObject> callback(this,spc,NULL,face);
+ KX_RayCast::RayTest(pe, fromPoint, toPoint, callback);
- if (m_pHitObject)
+ if (m_pHitObject)
{
- PyObject* returnValue = PyTuple_New(3);
- if (!returnValue)
- return NULL;
- PyTuple_SET_ITEM(returnValue, 0, m_pHitObject->AddRef());
- PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(resultPoint));
- PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(resultNormal));
+ PyObject* returnValue = (poly) ? PyTuple_New(4) : PyTuple_New(3);
+ if (returnValue) { // unlikely this would ever fail, if it does python sets an error
+ PyTuple_SET_ITEM(returnValue, 0, m_pHitObject->AddRef());
+ PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(callback.m_hitPoint));
+ PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(callback.m_hitNormal));
+ if (poly)
+ {
+ if (callback.m_hitMesh)
+ {
+ // if this field is set, then we can trust that m_hitPolygon is a valid polygon
+ RAS_Polygon* poly = callback.m_hitMesh->GetPolygon(callback.m_hitPolygon);
+ KX_PolyProxy* polyproxy = new KX_PolyProxy(callback.m_hitMesh, poly);
+ PyTuple_SET_ITEM(returnValue, 3, polyproxy);
+ }
+ else
+ {
+ Py_INCREF(Py_None);
+ PyTuple_SET_ITEM(returnValue, 3, Py_None);
+ }
+ }
+ }
return returnValue;
- //return Py_BuildValue("(O,(fff),(fff))",
- // m_pHitObject->AddRef(), // trick: KX_GameObject are not true Python object, they use a difference reference count system
- // resultPoint[0], resultPoint[1], resultPoint[2],
- // resultNormal[0], resultNormal[1], resultNormal[2]);
}
- return Py_BuildValue("OOO", Py_None, Py_None, Py_None);
- //Py_RETURN_NONE;
+ // no hit
+ if (poly)
+ return Py_BuildValue("OOOO", Py_None, Py_None, Py_None, Py_None);
+ else
+ return Py_BuildValue("OOO", Py_None, Py_None, Py_None);
}
/* ---------------------------------------------------------------------
@@ -1727,3 +1910,49 @@ void KX_GameObject::Relink(GEN_Map<GEN_HashedPtr, void*> *map_parameter)
}
}
+bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok)
+{
+ if (value==NULL) {
+ PyErr_SetString(PyExc_TypeError, "Error in ConvertPythonToGameObject, python pointer NULL, should never happen");
+ *object = NULL;
+ return false;
+ }
+
+ if (value==Py_None) {
+ *object = NULL;
+
+ if (py_none_ok) {
+ return true;
+ } else {
+ PyErr_SetString(PyExc_TypeError, "Expected KX_GameObject or a string for a name of a KX_GameObject, None is invalid");
+ return false;
+ }
+ return (py_none_ok ? true : false);
+ }
+
+ if (PyString_Check(value)) {
+ *object = (KX_GameObject *)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String( PyString_AsString(value) ));
+
+ if (*object) {
+ return true;
+ } else {
+ PyErr_SetString(PyExc_ValueError, "Requested name did not match any KX_GameObject");
+ return false;
+ }
+ }
+
+ if (PyObject_TypeCheck(value, &KX_GameObject::Type)) {
+ *object = static_cast<KX_GameObject*>(value);
+ return true;
+ }
+
+ *object = NULL;
+
+ if (py_none_ok) {
+ PyErr_SetString(PyExc_TypeError, "Expect a KX_GameObject, a string or None");
+ } else {
+ PyErr_SetString(PyExc_TypeError, "Expect a KX_GameObject or a string");
+ }
+
+ return false;
+}
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 6051cf850b5..98b3f3b4c3f 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -48,11 +48,13 @@
#include "KX_KetsjiEngine.h" /* for m_anim_framerate */
#include "KX_IPhysicsController.h" /* for suspend/resume */
#include "DNA_object_types.h"
+#include "SCA_LogicManager.h" /* for ConvertPythonToGameObject to search object names */
#define KX_OB_DYNAMIC 1
//Forward declarations.
struct KX_ClientObjectInfo;
+class KX_RayCast;
class RAS_MeshObject;
class KX_IPhysicsController;
class PHY_IPhysicsEnvironment;
@@ -73,20 +75,23 @@ protected:
int m_layer;
std::vector<RAS_MeshObject*> m_meshes;
struct Object* m_pBlenderObject;
+ struct Object* m_pBlenderGroupObject;
bool m_bSuspendDynamics;
bool m_bUseObjectColor;
bool m_bIsNegativeScaling;
MT_Vector4 m_objectColor;
- // Is this object set to be visible? Only useful for the
- // visibility subsystem right now.
- bool m_bVisible;
+ // visible = user setting
+ // culled = while rendering, depending on camera
+ bool m_bVisible;
+ bool m_bCulled;
KX_IPhysicsController* m_pPhysicsController1;
// used for ray casting
PHY_IPhysicsEnvironment* m_pPhysicsEnvironment;
STR_String m_testPropName;
+ bool m_xray;
KX_GameObject* m_pHitObject;
SG_Node* m_pSGNode;
@@ -392,6 +397,16 @@ public:
{
m_pBlenderObject = obj;
}
+
+ struct Object* GetBlenderGroupObject( )
+ {
+ return m_pBlenderGroupObject;
+ }
+
+ void SetBlenderGroupObject( struct Object* obj)
+ {
+ m_pBlenderGroupObject = obj;
+ }
bool IsDupliGroup()
{
@@ -427,7 +442,8 @@ public:
return (m_pSGNode && m_pSGNode->GetSGParent() && m_pSGNode->GetSGParent()->IsVertexParent());
}
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo* client);
/**
@@ -521,6 +537,7 @@ public:
*/
void
UpdateMaterialData(
+ dword matname_hash,
MT_Vector4 rgba,
MT_Vector3 specrgb,
MT_Scalar hard,
@@ -533,18 +550,23 @@ public:
/**
* @section Mesh accessor functions.
*/
+
+ /**
+ * Update buckets to indicate that there is a new
+ * user of this object's meshes.
+ */
+ void
+ AddMeshUser(
+ );
/**
- * Run through the meshes associated with this
- * object and bucketize them. See RAS_Mesh for
- * more details on this function. Interesting to
- * note that polygon bucketizing seems to happen on a per
- * object basis. Which may explain why there is such
- * a big performance gain when all static objects
- * are joined into 1.
+ * Update buckets with data about the mesh after
+ * creating or duplicating the object, changing
+ * visibility, object color, .. .
*/
void
- Bucketize(
+ UpdateBuckets(
+ bool recursive
);
/**
@@ -605,38 +627,38 @@ public:
ResetDebugColor(
);
- /**
- * Set the visibility of the meshes associated with this
- * object.
+ /**
+ * Was this object marked visible? (only for the explicit
+ * visibility system).
*/
- void
- MarkVisible(
- bool visible
+ bool
+ GetVisible(
+ void
);
- /**
- * Set the visibility according to the visibility flag.
+ /**
+ * Set visibility flag of this object
*/
- void
- MarkVisible(
void
+ SetVisible(
+ bool b,
+ bool recursive
);
/**
- * Was this object marked visible? (only for the ewxplicit
- * visibility system).
+ * Was this object culled?
*/
bool
- GetVisible(
+ GetCulled(
void
);
/**
- * Set visibility flag of this object
+ * Set culled flag of this object
*/
void
- SetVisible(
- bool b
+ SetCulled(
+ bool c
);
/**
@@ -665,6 +687,14 @@ public:
) { return m_bIsNegativeScaling; }
/**
+ * Is this a light?
+ */
+ virtual bool
+ IsLight(
+ void
+ ) { return false; }
+
+ /**
* @section Logic bubbling methods.
*/
@@ -724,37 +754,40 @@ public:
KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition);
KX_PYMETHOD_O(KX_GameObject,SetPosition);
- KX_PYMETHOD(KX_GameObject,GetLinearVelocity);
- KX_PYMETHOD(KX_GameObject,SetLinearVelocity);
- KX_PYMETHOD(KX_GameObject,GetVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetLinearVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,SetLinearVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,SetAngularVelocity);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetVelocity);
KX_PYMETHOD_NOARGS(KX_GameObject,GetMass);
KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce);
KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation);
KX_PYMETHOD_O(KX_GameObject,SetOrientation);
KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible);
- KX_PYMETHOD_O(KX_GameObject,SetVisible);
+ KX_PYMETHOD_VARARGS(KX_GameObject,SetVisible);
KX_PYMETHOD_NOARGS(KX_GameObject,GetState);
KX_PYMETHOD_O(KX_GameObject,SetState);
- KX_PYMETHOD(KX_GameObject,AlignAxisToVect);
+ KX_PYMETHOD_VARARGS(KX_GameObject,AlignAxisToVect);
KX_PYMETHOD_O(KX_GameObject,GetAxisVect);
KX_PYMETHOD_NOARGS(KX_GameObject,SuspendDynamics);
KX_PYMETHOD_NOARGS(KX_GameObject,RestoreDynamics);
KX_PYMETHOD_NOARGS(KX_GameObject,EnableRigidBody);
KX_PYMETHOD_NOARGS(KX_GameObject,DisableRigidBody);
- KX_PYMETHOD(KX_GameObject,ApplyImpulse);
+ KX_PYMETHOD_VARARGS(KX_GameObject,ApplyImpulse);
KX_PYMETHOD_O(KX_GameObject,SetCollisionMargin);
KX_PYMETHOD_NOARGS(KX_GameObject,GetParent);
KX_PYMETHOD_O(KX_GameObject,SetParent);
KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent);
KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren);
KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive);
- KX_PYMETHOD(KX_GameObject,GetMesh);
+ KX_PYMETHOD_VARARGS(KX_GameObject,GetMesh);
KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId);
KX_PYMETHOD_NOARGS(KX_GameObject,GetPropertyNames);
KX_PYMETHOD_NOARGS(KX_GameObject,EndObject);
KX_PYMETHOD_DOC(KX_GameObject,rayCastTo);
KX_PYMETHOD_DOC(KX_GameObject,rayCast);
KX_PYMETHOD_DOC(KX_GameObject,getDistanceTo);
+ KX_PYMETHOD_DOC(KX_GameObject,getVectTo);
private :
@@ -773,5 +806,8 @@ private :
};
+/* utility conversion function */
+bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok);
+
#endif //__KX_GAMEOBJECT
diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp
index d3aa924665e..6223643f75a 100644
--- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp
+++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp
@@ -143,7 +143,7 @@ bool KX_IpoSGController::Update(double currentTime)
{
if (m_ipo_as_force == true)
{
- if (m_game_object && ob)
+ if (m_game_object && ob && m_game_object->GetPhysicsController())
{
m_game_object->GetPhysicsController()->ApplyForce(m_ipo_local ?
ob->GetWorldOrientation() * m_ipo_xform.GetPosition() :
diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h
index f069048cd3d..3709fa8c784 100644
--- a/source/gameengine/Ketsji/KX_ISceneConverter.h
+++ b/source/gameengine/Ketsji/KX_ISceneConverter.h
@@ -32,6 +32,8 @@
#include "STR_String.h"
#include "KX_Python.h"
+struct Scene;
+
class KX_ISceneConverter
{
@@ -77,6 +79,8 @@ public:
// use blender glsl materials
virtual void SetGLSLMaterials(bool val) =0;
virtual bool GetGLSLMaterials()=0;
+
+ virtual struct Scene* GetBlenderSceneForName(const STR_String& name)=0;
};
#endif //__KX_ISCENECONVERTER_H
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp
index b7103f49aee..a203ea6a6ff 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.cpp
+++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp
@@ -430,27 +430,27 @@ PyMethodDef KX_IpoActuator::Methods[] = {
{"setStart", (PyCFunction) KX_IpoActuator::sPySetStart,
METH_VARARGS, SetStart_doc},
{"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart,
- METH_VARARGS, GetStart_doc},
+ METH_NOARGS, GetStart_doc},
{"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd,
METH_VARARGS, SetEnd_doc},
{"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd,
- METH_VARARGS, GetEnd_doc},
+ METH_NOARGS, GetEnd_doc},
{"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce,
METH_VARARGS, SetIpoAsForce_doc},
{"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce,
- METH_VARARGS, GetIpoAsForce_doc},
+ METH_NOARGS, GetIpoAsForce_doc},
{"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd,
METH_VARARGS, SetIpoAdd_doc},
{"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd,
- METH_VARARGS, GetIpoAdd_doc},
+ METH_NOARGS, GetIpoAdd_doc},
{"setType", (PyCFunction) KX_IpoActuator::sPySetType,
METH_VARARGS, SetType_doc},
{"getType", (PyCFunction) KX_IpoActuator::sPyGetType,
- METH_VARARGS, GetType_doc},
+ METH_NOARGS, GetType_doc},
{"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal,
METH_VARARGS, SetForceIpoActsLocal_doc},
{"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal,
- METH_VARARGS, GetForceIpoActsLocal_doc},
+ METH_NOARGS, GetForceIpoActsLocal_doc},
{NULL,NULL} //Sentinel
};
@@ -544,9 +544,7 @@ PyObject* KX_IpoActuator::PySetStart(PyObject* self,
char KX_IpoActuator::GetStart_doc[] =
"getStart()\n"
"\tReturns the frame from which the ipo starts playing.\n";
-PyObject* KX_IpoActuator::PyGetStart(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_IpoActuator::PyGetStart(PyObject* self) {
return PyFloat_FromDouble(m_startframe);
}
@@ -571,9 +569,7 @@ PyObject* KX_IpoActuator::PySetEnd(PyObject* self,
char KX_IpoActuator::GetEnd_doc[] =
"getEnd()\n"
"\tReturns the frame at which the ipo stops playing.\n";
-PyObject* KX_IpoActuator::PyGetEnd(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_IpoActuator::PyGetEnd(PyObject* self) {
return PyFloat_FromDouble(m_endframe);
}
@@ -601,9 +597,7 @@ PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* self,
char KX_IpoActuator::GetIpoAsForce_doc[] =
"getIpoAsForce()\n"
"\tReturns whether to interpret the ipo as a force rather than a displacement.\n";
-PyObject* KX_IpoActuator::PyGetIpoAsForce(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_IpoActuator::PyGetIpoAsForce(PyObject* self) {
return BoolToPyArg(m_ipo_as_force);
}
@@ -631,9 +625,7 @@ PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* self,
char KX_IpoActuator::GetIpoAdd_doc[] =
"getIpoAsAdd()\n"
"\tReturns whether to interpret the ipo as additive rather than absolute.\n";
-PyObject* KX_IpoActuator::PyGetIpoAdd(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_IpoActuator::PyGetIpoAdd(PyObject* self) {
return BoolToPyArg(m_ipo_add);
}
@@ -662,9 +654,7 @@ PyObject* KX_IpoActuator::PySetType(PyObject* self,
char KX_IpoActuator::GetType_doc[] =
"getType()\n"
"\tReturns the operation mode of the actuator.\n";
-PyObject* KX_IpoActuator::PyGetType(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_IpoActuator::PyGetType(PyObject* self) {
return PyInt_FromLong(m_type);
}
@@ -693,9 +683,7 @@ char KX_IpoActuator::GetForceIpoActsLocal_doc[] =
"getForceIpoActsLocal()\n"
"\tReturn whether to apply the force in the object's local\n"
"\tcoordinates rather than the world global coordinates.\n";
-PyObject* KX_IpoActuator::PyGetForceIpoActsLocal(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_IpoActuator::PyGetForceIpoActsLocal(PyObject* self) {
return BoolToPyArg(m_ipo_local);
}
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h
index ae554fb0fce..d6f52f8d59d 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.h
+++ b/source/gameengine/Ketsji/KX_IpoActuator.h
@@ -143,17 +143,17 @@ public:
KX_PYMETHOD_DOC(KX_IpoActuator,SetProperty);
/* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */
KX_PYMETHOD_DOC(KX_IpoActuator,SetStart);
- KX_PYMETHOD_DOC(KX_IpoActuator,GetStart);
+ KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart);
KX_PYMETHOD_DOC(KX_IpoActuator,SetEnd);
- KX_PYMETHOD_DOC(KX_IpoActuator,GetEnd);
+ KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd);
KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAsForce);
- KX_PYMETHOD_DOC(KX_IpoActuator,GetIpoAsForce);
+ KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce);
KX_PYMETHOD_DOC(KX_IpoActuator,SetIpoAdd);
- KX_PYMETHOD_DOC(KX_IpoActuator,GetIpoAdd);
+ KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd);
KX_PYMETHOD_DOC(KX_IpoActuator,SetType);
- KX_PYMETHOD_DOC(KX_IpoActuator,GetType);
+ KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType);
KX_PYMETHOD_DOC(KX_IpoActuator,SetForceIpoActsLocal);
- KX_PYMETHOD_DOC(KX_IpoActuator,GetForceIpoActsLocal);
+ KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal);
};
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index db099d56b55..cf98bb72601 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -96,6 +96,7 @@ double KX_KetsjiEngine::m_ticrate = DEFAULT_LOGIC_TIC_RATE;
double KX_KetsjiEngine::m_anim_framerate = 25.0;
double KX_KetsjiEngine::m_suspendedtime = 0.0;
double KX_KetsjiEngine::m_suspendeddelta = 0.0;
+double KX_KetsjiEngine::m_average_framerate = 0.0;
/**
@@ -118,7 +119,6 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system)
m_bInitialized(false),
m_activecam(0),
m_bFixedTime(false),
- m_game2ipo(false),
m_firstframe(true),
@@ -148,6 +148,8 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system)
m_showBackground(false),
m_show_debug_properties(false),
+ m_game2ipo(false),
+
// Default behavior is to hide the cursor every frame.
m_hideCursor(false),
@@ -309,6 +311,12 @@ void KX_KetsjiEngine::EndFrame()
{
RenderDebugProperties();
}
+
+ m_average_framerate = m_logger->GetAverage();
+ if (m_average_framerate < 1e-6)
+ m_average_framerate = 1e-6;
+ m_average_framerate = 1.0/m_average_framerate;
+
// Go to next profiling measurement, time spend after this call is shown in the next frame.
m_logger->NextMeasurement(m_kxsystem->GetTimeInSeconds());
@@ -320,8 +328,6 @@ void KX_KetsjiEngine::EndFrame()
m_canvas->EndDraw();
-
-
}
//#include "PIL_time.h"
@@ -896,11 +902,18 @@ void KX_KetsjiEngine::SetupRenderFrame(KX_Scene *scene, KX_Camera* cam)
void KX_KetsjiEngine::RenderShadowBuffers(KX_Scene *scene)
{
- CListValue *lightlist = scene->GetLightList();
+ CListValue *objectlist = scene->GetObjectList();
int i, drawmode;
- for(i=0; i<lightlist->GetCount(); i++) {
- KX_LightObject *light = (KX_LightObject*)lightlist->GetValue(i);
+ m_rendertools->SetAuxilaryClientInfo(scene);
+
+ for(i=0; i<objectlist->GetCount(); i++) {
+ KX_GameObject *gameobj = (KX_GameObject*)objectlist->GetValue(i);
+
+ if(!gameobj->IsLight())
+ continue;
+
+ KX_LightObject *light = (KX_LightObject*)gameobj;
light->Update();
@@ -1280,12 +1293,13 @@ void KX_KetsjiEngine::RemoveScheduledScenes()
KX_Scene* KX_KetsjiEngine::CreateScene(const STR_String& scenename)
{
-
+ Scene *scene = m_sceneconverter->GetBlenderSceneForName(scenename);
KX_Scene* tmpscene = new KX_Scene(m_keyboarddevice,
m_mousedevice,
m_networkdevice,
m_audiodevice,
- scenename);
+ scenename,
+ scene);
m_sceneconverter->ConvertScene(scenename,
tmpscene,
@@ -1441,6 +1455,11 @@ void KX_KetsjiEngine::SetAnimFrameRate(double framerate)
m_anim_framerate = framerate;
}
+double KX_KetsjiEngine::GetAverageFrameRate()
+{
+ return m_average_framerate;
+}
+
void KX_KetsjiEngine::SetTimingDisplay(bool frameRate, bool profile, bool properties)
{
m_show_framerate = frameRate;
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 77b69ec2d9e..97458362f0f 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -149,6 +149,8 @@ private:
/** Labels for profiling display. */
static const char m_profileLabels[tc_numCategories][15];
+ /** Last estimated framerate */
+ static double m_average_framerate;
/** Show the framerate on the game display? */
bool m_show_framerate;
/** Show profiling info on the game display? */
@@ -272,6 +274,11 @@ public:
static void SetAnimFrameRate(double framerate);
/**
+ * Gets the last estimated average framerate
+ */
+ static double GetAverageFrameRate();
+
+ /**
* Activates or deactivates timing information display.
* @param frameRate Display for frame rate on or off.
* @param profile Display for individual components on or off.
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index 4e3d6180d22..979015532e3 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -42,14 +42,13 @@
#include "KX_PyMath.h"
-#ifdef BLENDER_GLSL
+#include "DNA_object_types.h"
#include "GPU_material.h"
-#endif
KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,
class RAS_IRenderTools* rendertools,
const RAS_LightObject& lightobj,
- struct GPULamp *gpulamp,
+ bool glsl,
PyTypeObject* T
)
:
@@ -59,7 +58,8 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,
m_lightobj = lightobj;
m_lightobj.m_worldmatrix = GetOpenGLMatrixPtr();
m_rendertools->AddLight(&m_lightobj);
- m_gpulamp = gpulamp;
+ m_glsl = glsl;
+ m_blenderscene = ((KX_Scene*)sgReplicationInfo)->GetBlenderScene();
};
@@ -73,7 +73,7 @@ CValue* KX_LightObject::GetReplica()
{
KX_LightObject* replica = new KX_LightObject(*this);
-
+
// this will copy properties and so on...
CValue::AddDataToReplica(replica);
@@ -81,13 +81,23 @@ CValue* KX_LightObject::GetReplica()
replica->m_lightobj.m_worldmatrix = replica->GetOpenGLMatrixPtr();
m_rendertools->AddLight(&replica->m_lightobj);
+
return replica;
}
+GPULamp *KX_LightObject::GetGPULamp()
+{
+ if(m_glsl)
+ return GPU_lamp_from_blender(m_blenderscene, GetBlenderObject(), GetBlenderGroupObject());
+ else
+ return false;
+}
+
void KX_LightObject::Update()
{
-#ifdef BLENDER_GLSL
- if(m_gpulamp) {
+ GPULamp *lamp;
+
+ if((lamp = GetGPULamp())) {
float obmat[4][4];
double *dobmat = GetOpenGLMatrixPtr()->getPointer();
@@ -95,38 +105,39 @@ void KX_LightObject::Update()
for(int j=0; j<4; j++, dobmat++)
obmat[i][j] = (float)*dobmat;
- GPU_lamp_update(m_gpulamp, obmat);
+ GPU_lamp_update(lamp, m_lightobj.m_layer, obmat);
}
-#endif
}
bool KX_LightObject::HasShadowBuffer()
{
-#ifdef BLENDER_GLSL
- return (m_gpulamp && GPU_lamp_has_shadow_buffer(m_gpulamp));
-#else
- return false;
-#endif
+ GPULamp *lamp;
+
+ if((lamp = GetGPULamp()))
+ return GPU_lamp_has_shadow_buffer(lamp);
+ else
+ return false;
}
int KX_LightObject::GetShadowLayer()
{
-#ifdef BLENDER_GLSL
- if(m_gpulamp)
- return GPU_lamp_shadow_layer(m_gpulamp);
+ GPULamp *lamp;
+
+ if((lamp = GetGPULamp()))
+ return GPU_lamp_shadow_layer(lamp);
else
-#endif
return 0;
}
void KX_LightObject::BindShadowBuffer(RAS_IRasterizer *ras, KX_Camera *cam, MT_Transform& camtrans)
{
-#ifdef BLENDER_GLSL
+ GPULamp *lamp;
float viewmat[4][4], winmat[4][4];
int winsize;
/* bind framebuffer */
- GPU_lamp_shadow_buffer_bind(m_gpulamp, viewmat, &winsize, winmat);
+ lamp = GetGPULamp();
+ GPU_lamp_shadow_buffer_bind(lamp, viewmat, &winsize, winmat);
/* setup camera transformation */
MT_Matrix4x4 modelviewmat((float*)viewmat);
@@ -146,14 +157,12 @@ void KX_LightObject::BindShadowBuffer(RAS_IRasterizer *ras, KX_Camera *cam, MT_T
ras->SetProjectionMatrix(projectionmat);
ras->SetViewMatrix(modelviewmat, cam->NodeGetWorldPosition(),
cam->GetCameraLocation(), cam->GetCameraOrientation());
-#endif
}
void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras)
{
-#ifdef BLENDER_GLSL
- GPU_lamp_shadow_buffer_unbind(m_gpulamp);
-#endif
+ GPULamp *lamp = GetGPULamp();
+ GPU_lamp_shadow_buffer_unbind(lamp);
}
PyObject* KX_LightObject::_getattr(const STR_String& attr)
diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h
index 62eb26c61a8..e5dbf0b7f4a 100644
--- a/source/gameengine/Ketsji/KX_Light.h
+++ b/source/gameengine/Ketsji/KX_Light.h
@@ -33,6 +33,7 @@
#include "KX_GameObject.h"
struct GPULamp;
+struct Scene;
class KX_Camera;
class RAS_IRasterizer;
class RAS_IRenderTools;
@@ -44,16 +45,18 @@ class KX_LightObject : public KX_GameObject
protected:
RAS_LightObject m_lightobj;
class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj
- struct GPULamp *m_gpulamp;
- static char doc[];
+ bool m_glsl;
+ Scene* m_blenderscene;
+ static char doc[];
public:
- KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, struct GPULamp *gpulamp, PyTypeObject *T = &Type);
+ KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl, PyTypeObject *T = &Type);
virtual ~KX_LightObject();
virtual CValue* GetReplica();
RAS_LightObject* GetLightData() { return &m_lightobj;}
/* GLSL shadow */
+ struct GPULamp *GetGPULamp();
bool HasShadowBuffer();
int GetShadowLayer();
void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans);
@@ -62,6 +65,8 @@ public:
virtual PyObject* _getattr(const STR_String& attr); /* lens, near, far, projection_matrix */
virtual int _setattr(const STR_String& attr, PyObject *pyvalue);
+
+ virtual bool IsLight(void) { return true; }
};
#endif //__KX_LIGHT
diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
index c0757a32b9c..85d514bd22f 100644
--- a/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
+++ b/source/gameengine/Ketsji/KX_MaterialIpoController.cpp
@@ -3,6 +3,8 @@
#include "KX_ScalarInterpolator.h"
#include "KX_GameObject.h"
+#include "BLO_sys_types.h" // for intptr_t support
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -37,6 +39,7 @@ bool KX_MaterialIpoController::Update(double currentTime)
//kxgameobj->SetObjectColor(m_rgba);
kxgameobj->UpdateMaterialData(
+ m_matname_hash,
m_rgba,
m_specrgb,
m_hard,
@@ -75,10 +78,10 @@ SG_Controller* KX_MaterialIpoController::GetReplica(class SG_Node* destnode)
iporeplica->AddInterpolator(copyipo);
MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget();
- long orgbase = (long)this;
- long orgloc = (long)scaal;
- long offset = orgloc-orgbase;
- long newaddrbase = (long)iporeplica + offset;
+ intptr_t orgbase = (intptr_t)this;
+ intptr_t orgloc = (intptr_t)scaal;
+ intptr_t offset = orgloc-orgbase;
+ intptr_t newaddrbase = (intptr_t)iporeplica + offset;
MT_Scalar* blaptr = (MT_Scalar*) newaddrbase;
copyipo->SetNewTarget((MT_Scalar*)blaptr);
}
diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h
index e76ddeefb04..4d2e258bf94 100644
--- a/source/gameengine/Ketsji/KX_MaterialIpoController.h
+++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h
@@ -7,6 +7,8 @@
#include "SG_Spatial.h"
#include "KX_IInterpolator.h"
+#include "STR_String.h" //typedef dword
+
class KX_MaterialIpoController : public SG_Controller
{
public:
@@ -23,10 +25,12 @@ private:
bool m_modified;
double m_ipotime;
+ dword m_matname_hash;
public:
- KX_MaterialIpoController() :
+ KX_MaterialIpoController(dword matname_hash) :
m_modified(true),
- m_ipotime(0.0)
+ m_ipotime(0.0),
+ m_matname_hash(matname_hash)
{}
virtual ~KX_MaterialIpoController();
virtual SG_Controller* GetReplica(class SG_Node* destnode);
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp
index c7a251751cd..5cc102248f2 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.cpp
+++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp
@@ -35,6 +35,7 @@
#include "RAS_MeshObject.h"
#include "KX_VertexProxy.h"
+#include "KX_PolyProxy.h"
#include "KX_PolygonMaterial.h"
#include "KX_BlenderMaterial.h"
@@ -42,6 +43,8 @@
#include "KX_PyMath.h"
#include "KX_ConvertPhysicsObject.h"
+#include "PyObjectPlus.h"
+
PyTypeObject KX_MeshProxy::Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
@@ -71,10 +74,12 @@ PyParentObject KX_MeshProxy::Parents[] = {
PyMethodDef KX_MeshProxy::Methods[] = {
{"getNumMaterials", (PyCFunction)KX_MeshProxy::sPyGetNumMaterials,METH_VARARGS},
+{"getNumPolygons", (PyCFunction)KX_MeshProxy::sPyGetNumPolygons,METH_NOARGS},
{"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS},
{"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS},
{"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS},
{"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS},
+{"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS},
KX_PYMETHODTABLE(KX_MeshProxy, reinstancePhysicsMesh),
//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
@@ -93,10 +98,11 @@ KX_MeshProxy::_getattr(const STR_String& attr)
if (attr == "materials")
{
PyObject *materials = PyList_New(0);
- RAS_MaterialBucket::Set::iterator mit = m_meshobj->GetFirstMaterial();
+ list<RAS_MeshMaterial>::iterator mit = m_meshobj->GetFirstMaterial();
for(; mit != m_meshobj->GetLastMaterial(); ++mit)
{
- RAS_IPolyMaterial *polymat = (*mit)->GetPolyMaterial();
+ RAS_IPolyMaterial *polymat = mit->m_bucket->GetPolyMaterial();
+
if(polymat->GetFlag() & RAS_BLENDERMAT)
{
KX_BlenderMaterial *mat = static_cast<KX_BlenderMaterial*>(polymat);
@@ -146,6 +152,12 @@ PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* self,
return PyInt_FromLong(num);
}
+PyObject* KX_MeshProxy::PyGetNumPolygons(PyObject* self)
+{
+ int num = m_meshobj->NumPolygons();
+ return PyInt_FromLong(num);
+}
+
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* self,
PyObject* args,
PyObject* kwds)
@@ -195,11 +207,11 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* self,
if (PyArg_ParseTuple(args,"i",&matid))
{
- RAS_IPolyMaterial* mat = m_meshobj->GetMaterialBucket(matid)->GetPolyMaterial();
+ RAS_MeshMaterial *mmat = m_meshobj->GetMeshMaterial(matid);
+ RAS_IPolyMaterial* mat = mmat->m_bucket->GetPolyMaterial();
+
if (mat)
- {
- length = m_meshobj->GetVertexArrayLength(mat);
- }
+ length = m_meshobj->NumVertices(mat);
}
else {
return NULL;
@@ -234,9 +246,31 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* self,
}
+PyObject* KX_MeshProxy::PyGetPolygon(PyObject* self,
+ PyObject* args,
+ PyObject* kwds)
+{
+ int polyindex= 1;
+ PyObject* polyob = NULL;
+
+ if (!PyArg_ParseTuple(args,"i",&polyindex))
+ return NULL;
+
+ RAS_Polygon* polygon = m_meshobj->GetPolygon(polyindex);
+ if (polygon)
+ {
+ polyob = new KX_PolyProxy(m_meshobj, polygon);
+ }
+ else
+ {
+ PyErr_SetString(PyExc_AttributeError, "Invalid polygon index");
+ }
+ return polyob;
+}
+
KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh,
"Reinstance the physics mesh.")
{
//this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ?
- return Py_None;//Py_Success(KX_ReInstanceShapeFromMesh(m_meshobj));
+ Py_RETURN_NONE;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE;
}
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h
index 7c6202c15a4..3335c349673 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.h
+++ b/source/gameengine/Ketsji/KX_MeshProxy.h
@@ -57,10 +57,12 @@ public:
KX_PYMETHOD(KX_MeshProxy,GetNumMaterials);
KX_PYMETHOD(KX_MeshProxy,GetMaterialName);
KX_PYMETHOD(KX_MeshProxy,GetTextureName);
+ KX_PYMETHOD_NOARGS(KX_MeshProxy,GetNumPolygons);
// both take materialid (int)
KX_PYMETHOD(KX_MeshProxy,GetVertexArrayLength);
KX_PYMETHOD(KX_MeshProxy,GetVertex);
+ KX_PYMETHOD(KX_MeshProxy,GetPolygon);
KX_PYMETHOD_DOC(KX_MeshProxy, reinstancePhysicsMesh);
};
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
index db0bef8b7e1..3156f543ed5 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
@@ -122,16 +122,10 @@ bool KX_MouseFocusSensor::Evaluate(CValue* event)
return result;
}
-bool KX_MouseFocusSensor::RayHit(KX_ClientObjectInfo* client_info, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data)
+bool KX_MouseFocusSensor::RayHit(KX_ClientObjectInfo* client_info, KX_RayCast* result, void * const data)
{
KX_GameObject* hitKXObj = client_info->m_gameobject;
- if (client_info->m_type > KX_ClientObjectInfo::ACTOR)
- {
- // false hit
- return false;
- }
-
/* Is this me? In the ray test, there are a lot of extra checks
* for aliasing artefacts from self-hits. That doesn't happen
* here, so a simple test suffices. Or does the camera also get
@@ -142,8 +136,8 @@ bool KX_MouseFocusSensor::RayHit(KX_ClientObjectInfo* client_info, MT_Point3& hi
if ((m_focusmode == 2) || hitKXObj == thisObj)
{
m_hitObject = hitKXObj;
- m_hitPosition = hit_point;
- m_hitNormal = hit_normal;
+ m_hitPosition = result->m_hitPoint;
+ m_hitNormal = result->m_hitNormal;
return true;
}
@@ -158,8 +152,6 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void)
m_hitObject = 0;
m_hitPosition = MT_Vector3(0,0,0);
m_hitNormal = MT_Vector3(1,0,0);
- MT_Point3 resultpoint;
- MT_Vector3 resultnormal;
/* All screen handling in the gameengine is done by GL,
* specifically the model/view and projection parts. The viewport
@@ -280,7 +272,8 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void)
bool result = false;
- result = KX_RayCast::RayTest(physics_controller, physics_environment, frompoint3, topoint3, resultpoint, resultnormal, KX_RayCast::Callback<KX_MouseFocusSensor>(this));
+ KX_RayCast::Callback<KX_MouseFocusSensor> callback(this,physics_controller);
+ KX_RayCast::RayTest(physics_environment, frompoint3, topoint3, callback);
result = (m_hitObject!=0);
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
index b011ebe1288..a6cc39d66eb 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
@@ -33,6 +33,8 @@
#include "SCA_MouseSensor.h"
+class KX_RayCast;
+
/**
* The mouse focus sensor extends the basic SCA_MouseSensor. It has
* been placed in KX because it needs access to the rasterizer and
@@ -76,7 +78,9 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
return result;
};
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo* client) { return true; }
+
/* --------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp
index 89699d80031..140dd37f5c6 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.cpp
+++ b/source/gameengine/Ketsji/KX_NearSensor.cpp
@@ -98,6 +98,14 @@ void KX_NearSensor::RegisterSumo(KX_TouchEventManager *touchman)
}
}
+void KX_NearSensor::UnregisterSumo(KX_TouchEventManager* touchman)
+{
+ if (m_physCtrl)
+ {
+ touchman->GetPhysicsEnvironment()->removeSensor(m_physCtrl);
+ }
+}
+
CValue* KX_NearSensor::GetReplica()
{
KX_NearSensor* replica = new KX_NearSensor(*this);
diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h
index c6724caccc3..3f7078ef9fd 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.h
+++ b/source/gameengine/Ketsji/KX_NearSensor.h
@@ -77,6 +77,7 @@ public:
const PHY_CollData * coll_data);
virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2);
virtual void RegisterSumo(KX_TouchEventManager *touchman);
+ virtual void UnregisterSumo(KX_TouchEventManager* touchman);
virtual PyObject* _getattr(const STR_String& attr);
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
index 9ac0b4d4703..98e73d4f0d7 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -304,27 +304,27 @@ PyParentObject KX_ObjectActuator::Parents[] = {
};
PyMethodDef KX_ObjectActuator::Methods[] = {
- {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_VARARGS},
+ {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS},
{"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS},
- {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_VARARGS},
+ {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS},
{"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS},
- {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_VARARGS},
+ {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS},
{"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS},
- {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_VARARGS},
+ {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS},
{"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS},
- {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_VARARGS},
+ {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS},
{"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS},
- {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_VARARGS},
+ {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS},
{"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS},
{"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS},
- {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_VARARGS},
+ {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS},
{"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS},
- {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_VARARGS},
+ {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS},
{"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS},
- {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_VARARGS},
+ {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS},
{"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS},
- {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_VARARGS},
- {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_VARARGS},
+ {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS},
+ {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS},
{"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS},
@@ -340,9 +340,7 @@ PyObject* KX_ObjectActuator::_getattr(const STR_String& attr) {
/* Removed! */
/* 2. getForce */
-PyObject* KX_ObjectActuator::PyGetForce(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetForce(PyObject* self)
{
PyObject *retVal = PyList_New(4);
@@ -371,9 +369,7 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* self,
}
/* 4. getTorque */
-PyObject* KX_ObjectActuator::PyGetTorque(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetTorque(PyObject* self)
{
PyObject *retVal = PyList_New(4);
@@ -402,9 +398,7 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* self,
}
/* 6. getDLoc */
-PyObject* KX_ObjectActuator::PyGetDLoc(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetDLoc(PyObject* self)
{
PyObject *retVal = PyList_New(4);
@@ -433,9 +427,7 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* self,
}
/* 8. getDRot */
-PyObject* KX_ObjectActuator::PyGetDRot(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetDRot(PyObject* self)
{
PyObject *retVal = PyList_New(4);
@@ -464,9 +456,7 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* self,
}
/* 10. getLinearVelocity */
-PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_ObjectActuator::PyGetLinearVelocity(PyObject* self) {
PyObject *retVal = PyList_New(4);
PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
@@ -495,9 +485,7 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* self,
/* 12. getAngularVelocity */
-PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_ObjectActuator::PyGetAngularVelocity(PyObject* self) {
PyObject *retVal = PyList_New(4);
PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
@@ -536,15 +524,11 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* self,
}
/* 13. getVelocityDamping */
-PyObject* KX_ObjectActuator::PyGetDamping(PyObject* self,
- PyObject* args,
- PyObject* kwds) {
+PyObject* KX_ObjectActuator::PyGetDamping(PyObject* self) {
return Py_BuildValue("i",m_damping);
}
/* 6. getForceLimitX */
-PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetForceLimitX(PyObject* self)
{
PyObject *retVal = PyList_New(3);
@@ -571,9 +555,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* self,
}
/* 6. getForceLimitY */
-PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetForceLimitY(PyObject* self)
{
PyObject *retVal = PyList_New(3);
@@ -600,9 +582,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* self,
}
/* 6. getForceLimitZ */
-PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetForceLimitZ(PyObject* self)
{
PyObject *retVal = PyList_New(3);
@@ -629,9 +609,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* self,
}
/* 4. getPID */
-PyObject* KX_ObjectActuator::PyGetPID(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_ObjectActuator::PyGetPID(PyObject* self)
{
PyObject *retVal = PyList_New(3);
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h
index bb74756551f..aa686f41233 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.h
@@ -155,27 +155,27 @@ public:
virtual PyObject* _getattr(const STR_String& attr);
- KX_PYMETHOD(KX_ObjectActuator,GetForce);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce);
KX_PYMETHOD(KX_ObjectActuator,SetForce);
- KX_PYMETHOD(KX_ObjectActuator,GetTorque);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque);
KX_PYMETHOD(KX_ObjectActuator,SetTorque);
- KX_PYMETHOD(KX_ObjectActuator,GetDLoc);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc);
KX_PYMETHOD(KX_ObjectActuator,SetDLoc);
- KX_PYMETHOD(KX_ObjectActuator,GetDRot);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot);
KX_PYMETHOD(KX_ObjectActuator,SetDRot);
- KX_PYMETHOD(KX_ObjectActuator,GetLinearVelocity);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity);
KX_PYMETHOD(KX_ObjectActuator,SetLinearVelocity);
- KX_PYMETHOD(KX_ObjectActuator,GetAngularVelocity);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity);
KX_PYMETHOD(KX_ObjectActuator,SetAngularVelocity);
KX_PYMETHOD(KX_ObjectActuator,SetDamping);
- KX_PYMETHOD(KX_ObjectActuator,GetDamping);
- KX_PYMETHOD(KX_ObjectActuator,GetForceLimitX);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX);
KX_PYMETHOD(KX_ObjectActuator,SetForceLimitX);
- KX_PYMETHOD(KX_ObjectActuator,GetForceLimitY);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY);
KX_PYMETHOD(KX_ObjectActuator,SetForceLimitY);
- KX_PYMETHOD(KX_ObjectActuator,GetForceLimitZ);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ);
KX_PYMETHOD(KX_ObjectActuator,SetForceLimitZ);
- KX_PYMETHOD(KX_ObjectActuator,GetPID);
+ KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID);
KX_PYMETHOD(KX_ObjectActuator,SetPID);
};
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp
index fd1b56838e2..3ca121f63f8 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp
@@ -36,6 +36,8 @@
#include "KX_GameObject.h"
#include "KX_PythonInit.h"
+#include "PyObjectPlus.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -164,7 +166,7 @@ PyParentObject KX_ParentActuator::Parents[] = {
};
PyMethodDef KX_ParentActuator::Methods[] = {
- {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_VARARGS, SetObject_doc},
+ {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, SetObject_doc},
{"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, GetObject_doc},
{NULL,NULL} //Sentinel
};
@@ -176,44 +178,44 @@ PyObject* KX_ParentActuator::_getattr(const STR_String& attr) {
/* 1. setObject */
char KX_ParentActuator::SetObject_doc[] =
"setObject(object)\n"
-"\tSet the object to set as parent.\n"
-"\tCan be an object name or an object\n";
-PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* args, PyObject* kwds) {
- PyObject* gameobj;
- if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj))
- {
- if (m_ob != NULL)
- m_ob->UnregisterActuator(this);
- m_ob = (SCA_IObject*)gameobj;
- if (m_ob)
- m_ob->RegisterActuator(this);
- Py_Return;
- }
- PyErr_Clear();
+"\t- object: KX_GameObject, string or None\n"
+"\tSet the object to set as parent.\n";
+PyObject* KX_ParentActuator::PySetObject(PyObject* self, PyObject* value) {
+ KX_GameObject *gameobj;
- char* objectname;
- if (PyArg_ParseTuple(args, "s", &objectname))
- {
- SCA_IObject *object = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));
- if(object)
- {
- if (m_ob != NULL)
- m_ob->UnregisterActuator(this);
- m_ob = object;
- m_ob->RegisterActuator(this);
- Py_Return;
- }
- }
+ if (!ConvertPythonToGameObject(value, &gameobj, true))
+ return NULL; // ConvertPythonToGameObject sets the error
- return NULL;
+ if (m_ob != NULL)
+ m_ob->UnregisterActuator(this);
+
+ m_ob = (SCA_IObject*)gameobj;
+ if (m_ob)
+ m_ob->RegisterActuator(this);
+
+ Py_RETURN_NONE;
}
/* 2. getObject */
-char KX_ParentActuator::GetObject_doc[] =
-"getObject()\n"
+
+/* get obj ---------------------------------------------------------- */
+char KX_ParentActuator::GetObject_doc[] =
+"getObject(name_only = 1)\n"
+"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the object that is set to.\n";
-PyObject* KX_ParentActuator::PyGetObject(PyObject* self, PyObject* args, PyObject* kwds) {
- return PyString_FromString(m_ob->GetName());
-}
+PyObject* KX_ParentActuator::PyGetObject(PyObject* self, PyObject* args)
+{
+ int ret_name_only = 1;
+ if (!PyArg_ParseTuple(args, "|i", &ret_name_only))
+ return NULL;
+
+ if (!m_ob)
+ Py_RETURN_NONE;
+ if (ret_name_only)
+ return PyString_FromString(m_ob->GetName());
+ else
+ return m_ob->AddRef();
+}
+
/* eof */
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h
index 93b07cd424b..e2b30ba2d0f 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.h
+++ b/source/gameengine/Ketsji/KX_ParentActuator.h
@@ -79,9 +79,9 @@ class KX_ParentActuator : public SCA_IActuator
virtual PyObject* _getattr(const STR_String& attr);
/* 1. setObject */
- KX_PYMETHOD_DOC(KX_ParentActuator,SetObject);
+ KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject);
/* 2. getObject */
- KX_PYMETHOD_DOC(KX_ParentActuator,GetObject);
+ KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject);
}; /* end of class KX_ParentActuator : public SCA_PropertyActuator */
diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
index 2df4c6a9980..da4f05ced7c 100644
--- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
@@ -27,6 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
+#include "PyObjectPlus.h"
+
#include "KX_PhysicsObjectWrapper.h"
#include "PHY_IPhysicsEnvironment.h"
#include "PHY_IPhysicsController.h"
@@ -61,7 +63,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetPosition(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -78,7 +80,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetLinearVelocity(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self,
@@ -94,7 +96,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetAngularVelocity(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self,
@@ -109,7 +111,7 @@ PyObject* KX_PhysicsObjectWrapper::PySetActive(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp
new file mode 100644
index 00000000000..c6f6bc2db01
--- /dev/null
+++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp
@@ -0,0 +1,265 @@
+/**
+ * $Id$
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "KX_PolyProxy.h"
+#include "KX_MeshProxy.h"
+#include "RAS_MeshObject.h"
+#include "KX_BlenderMaterial.h"
+#include "KX_PolygonMaterial.h"
+
+#include "KX_PyMath.h"
+
+PyTypeObject KX_PolyProxy::Type = {
+ PyObject_HEAD_INIT(&PyType_Type)
+ 0,
+ "KX_PolyProxy",
+ sizeof(KX_PolyProxy),
+ 0,
+ PyDestructor,
+ 0,
+ __getattr,
+ __setattr,
+ 0, //&MyPyCompare,
+ __repr,
+ 0, //&cvalue_as_number,
+ 0,
+ 0,
+ 0,
+ 0
+};
+
+PyParentObject KX_PolyProxy::Parents[] = {
+ &KX_PolyProxy::Type,
+ &SCA_IObject::Type,
+ &CValue::Type,
+ NULL
+};
+
+PyMethodDef KX_PolyProxy::Methods[] = {
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMaterialIndex),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getNumVertex),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,isVisible),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,isCollider),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMaterialName),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getTextureName),
+ KX_PYMETHODTABLE(KX_PolyProxy,getVertexIndex),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMesh),
+ KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMaterial),
+ {NULL,NULL} //Sentinel
+};
+
+PyObject*
+KX_PolyProxy::_getattr(const STR_String& attr)
+{
+ if (attr == "matname")
+ {
+ return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName());
+ }
+ if (attr == "texture")
+ {
+ return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName());
+ }
+ if (attr == "material")
+ {
+ RAS_IPolyMaterial *polymat = m_polygon->GetMaterial()->GetPolyMaterial();
+ if(polymat->GetFlag() & RAS_BLENDERMAT)
+ {
+ KX_BlenderMaterial* mat = static_cast<KX_BlenderMaterial*>(polymat);
+ Py_INCREF(mat);
+ return mat;
+ }
+ else
+ {
+ KX_PolygonMaterial* mat = static_cast<KX_PolygonMaterial*>(polymat);
+ Py_INCREF(mat);
+ return mat;
+ }
+ }
+ if (attr == "matid")
+ {
+ // we'll have to scan through the material bucket of the mes and compare with
+ // the one of the polygon
+ RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
+ unsigned int matid;
+ for (matid=0; matid<m_mesh->NumMaterials(); matid++)
+ {
+ RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid);
+ if (meshMat->m_bucket == polyBucket)
+ // found it
+ break;
+ }
+ return PyInt_FromLong(matid);
+ }
+ if (attr == "v1")
+ {
+ return PyInt_FromLong(m_polygon->GetVertexOffset(0));
+ }
+ if (attr == "v2")
+ {
+ return PyInt_FromLong(m_polygon->GetVertexOffset(1));
+ }
+ if (attr == "v3")
+ {
+ return PyInt_FromLong(m_polygon->GetVertexOffset(2));
+ }
+ if (attr == "v4")
+ {
+ return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0));
+ }
+ if (attr == "visible")
+ {
+ return PyInt_FromLong(m_polygon->IsVisible());
+ }
+ if (attr == "collide")
+ {
+ return PyInt_FromLong(m_polygon->IsCollider());
+ }
+ _getattr_up(SCA_IObject);
+}
+
+KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon)
+: m_mesh((RAS_MeshObject*)mesh),
+ m_polygon(polygon)
+{
+}
+
+KX_PolyProxy::~KX_PolyProxy()
+{
+}
+
+
+// stuff for cvalue related things
+CValue* KX_PolyProxy::Calc(VALUE_OPERATOR, CValue *) { return NULL;}
+CValue* KX_PolyProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { return NULL;}
+STR_String sPolyName="polygone";
+const STR_String & KX_PolyProxy::GetText() {return sPolyName;};
+float KX_PolyProxy::GetNumber() { return -1;}
+STR_String KX_PolyProxy::GetName() { return sPolyName;}
+void KX_PolyProxy::SetName(STR_String) { };
+CValue* KX_PolyProxy::GetReplica() { return NULL;}
+void KX_PolyProxy::ReplicaSetName(STR_String) {};
+
+
+// stuff for python integration
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterialIndex,
+"getMaterialIndex() : return the material index of the polygon in the mesh\n")
+{
+ RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial();
+ unsigned int matid;
+ for (matid=0; matid<m_mesh->NumMaterials(); matid++)
+ {
+ RAS_MeshMaterial* meshMat = m_mesh->GetMeshMaterial(matid);
+ if (meshMat->m_bucket == polyBucket)
+ // found it
+ break;
+ }
+ return PyInt_FromLong(matid);
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getNumVertex,
+"getNumVertex() : returns the number of vertex of the polygon, 3 or 4\n")
+{
+ return PyInt_FromLong(m_polygon->VertexCount());
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, isVisible,
+"isVisible() : returns whether the polygon is visible or not\n")
+{
+ return PyInt_FromLong(m_polygon->IsVisible());
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, isCollider,
+"isCollider() : returns whether the polygon is receives collision or not\n")
+{
+ return PyInt_FromLong(m_polygon->IsCollider());
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterialName,
+"getMaterialName() : returns the polygon material name, \"NoMaterial\" if no material\n")
+{
+ return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName());
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getTextureName,
+"getTexturelName() : returns the polygon texture name, \"NULL\" if no texture\n")
+{
+ return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName());
+}
+
+KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex,
+"getVertexIndex(vertex) : returns the mesh vertex index of a polygon vertex\n"
+"vertex: index of the vertex in the polygon: 0->3\n"
+"return value can be used to retrieve the vertex details through mesh proxy\n"
+"Note: getVertexIndex(3) on a triangle polygon returns 0\n")
+{
+ int index;
+ if (!PyArg_ParseTuple(args,"i",&index))
+ {
+ return NULL;
+ }
+ if (index < 0 || index > 3)
+ {
+ PyErr_SetString(PyExc_AttributeError, "Valid range for index is 0-3");
+ return NULL;
+ }
+ if (index < m_polygon->VertexCount())
+ {
+ return PyInt_FromLong(m_polygon->GetVertexOffset(index));
+ }
+ return PyInt_FromLong(0);
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMesh,
+"getMesh() : returns a mesh proxy\n")
+{
+ KX_MeshProxy* meshproxy = new KX_MeshProxy((RAS_MeshObject*)m_mesh);
+ return meshproxy;
+}
+
+KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterial,
+"getMaterial() : returns a material\n")
+{
+ RAS_IPolyMaterial *polymat = m_polygon->GetMaterial()->GetPolyMaterial();
+ if(polymat->GetFlag() & RAS_BLENDERMAT)
+ {
+ KX_BlenderMaterial* mat = static_cast<KX_BlenderMaterial*>(polymat);
+ Py_INCREF(mat);
+ return mat;
+ }
+ else
+ {
+ KX_PolygonMaterial* mat = static_cast<KX_PolygonMaterial*>(polymat);
+ Py_INCREF(mat);
+ return mat;
+ }
+}
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h
new file mode 100644
index 00000000000..506e2c2a656
--- /dev/null
+++ b/source/gameengine/Ketsji/KX_PolyProxy.h
@@ -0,0 +1,71 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef __KX_POLYROXY
+#define __KX_POLYPROXY
+
+#include "SCA_IObject.h"
+
+class KX_PolyProxy : public SCA_IObject
+{
+ Py_Header;
+protected:
+ class RAS_Polygon* m_polygon;
+ class RAS_MeshObject* m_mesh;
+public:
+ KX_PolyProxy(const class RAS_MeshObject*mesh, class RAS_Polygon* polygon);
+ virtual ~KX_PolyProxy();
+
+ // stuff for cvalue related things
+ CValue* Calc(VALUE_OPERATOR op, CValue *val) ;
+ CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
+ const STR_String & GetText();
+ float GetNumber();
+ STR_String GetName();
+ void SetName(STR_String name); // Set the name of the value
+ void ReplicaSetName(STR_String name);
+ CValue* GetReplica();
+
+
+// stuff for python integration
+ virtual PyObject* _getattr(const STR_String& attr);
+
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,isVisible)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,isCollider)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialName)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getTextureName)
+ KX_PYMETHOD_DOC(KX_PolyProxy,getVertexIndex)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMesh)
+ KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterial)
+
+};
+
+#endif //__KX_POLYPROXY
+
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
index 93d6d5bb70d..c9180bf3a80 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
@@ -35,10 +35,6 @@
#include "BKE_global.h"
#include "BKE_image.h"
-extern "C" {
-#include "BDR_drawmesh.h"
-}
-
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
#include "DNA_image_types.h"
@@ -46,6 +42,8 @@ extern "C" {
#include "IMB_imbuf_types.h"
+#include "GPU_draw.h"
+
#include "MEM_guardedalloc.h"
#include "RAS_LightObject.h"
@@ -59,11 +57,10 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname,
int tilexrep,
int tileyrep,
int mode,
- bool transparant,
+ int transp,
+ bool alpha,
bool zsort,
int lightlayer,
- bool bIsTriangle,
- void* clientobject,
struct MTFace* tface,
unsigned int* mcol,
PyTypeObject *T)
@@ -74,11 +71,10 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname,
tilexrep,
tileyrep,
mode,
- transparant,
+ transp,
+ alpha,
zsort,
- lightlayer,
- bIsTriangle,
- clientobject),
+ lightlayer),
m_tface(tface),
m_mcol(mcol),
m_material(material),
@@ -138,38 +134,29 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c
if (GetCachingInfo() != cachingInfo)
{
if (!cachingInfo)
- {
- set_tpage(NULL);
- }
+ GPU_set_tpage(NULL);
+
cachingInfo = GetCachingInfo();
if ((m_drawingmode & 4)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED))
{
- update_realtime_texture((struct MTFace*) m_tface, rasty->GetTime());
- set_tpage(m_tface);
- rasty->EnableTextures(true);
+ Image *ima = (Image*)m_tface->tpage;
+ GPU_update_image_time(ima, rasty->GetTime());
+ GPU_set_tpage(m_tface);
}
else
- {
- set_tpage(NULL);
- rasty->EnableTextures(false);
- }
+ GPU_set_tpage(NULL);
if(m_drawingmode & RAS_IRasterizer::KX_TWOSIDE)
- {
rasty->SetCullFace(false);
- }
else
- {
rasty->SetCullFace(true);
- }
- if (m_drawingmode & RAS_IRasterizer::KX_LINES) {
+ if ((m_drawingmode & RAS_IRasterizer::KX_LINES) ||
+ (rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
rasty->SetLines(true);
- }
- else {
+ else
rasty->SetLines(false);
- }
}
rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity);
@@ -245,13 +232,14 @@ PyObject* KX_PolygonMaterial::_getattr(const STR_String& attr)
if (attr == "drawingmode")
return PyInt_FromLong(m_drawingmode);
if (attr == "transparent")
- return PyInt_FromLong(m_transparant);
+ return PyInt_FromLong(m_alpha);
if (attr == "zsort")
return PyInt_FromLong(m_zsort);
if (attr == "lightlayer")
return PyInt_FromLong(m_lightlayer);
if (attr == "triangle")
- return PyInt_FromLong(m_bIsTriangle);
+ // deprecated, triangle/quads shouldn't have been a material property
+ return 0;
if (attr == "diffuse")
return PyObjectFrom(m_diffuse);
@@ -312,7 +300,7 @@ int KX_PolygonMaterial::_setattr(const STR_String &attr, PyObject *pyvalue)
if (attr == "transparent")
{
- m_transparant = value;
+ m_alpha = value;
return 0;
}
@@ -331,7 +319,7 @@ int KX_PolygonMaterial::_setattr(const STR_String &attr, PyObject *pyvalue)
// This probably won't work...
if (attr == "triangle")
{
- m_bIsTriangle = value;
+ // deprecated, triangle/quads shouldn't have been a material property
return 0;
}
}
@@ -384,7 +372,9 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, updateTexture, "updateTexture(tface, rast
{
MTFace *tface = (MTFace*) PyCObject_AsVoidPtr(pytface);
RAS_IRasterizer *rasty = (RAS_IRasterizer*) PyCObject_AsVoidPtr(pyrasty);
- update_realtime_texture(tface, rasty->GetTime());
+ Image *ima = (Image*)tface->tpage;
+ GPU_update_image_time(ima, rasty->GetTime());
+
Py_Return;
}
@@ -397,7 +387,7 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setTexture, "setTexture(tface)")
if (PyArg_ParseTuple(args, "O!", &PyCObject_Type, &pytface))
{
MTFace *tface = (MTFace*) PyCObject_AsVoidPtr(pytface);
- set_tpage(tface);
+ GPU_set_tpage(tface);
Py_Return;
}
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h
index 19015494e06..fe116f757db 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.h
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h
@@ -64,11 +64,10 @@ public:
int tilexrep,
int tileyrep,
int mode,
- bool transparant,
+ int transp,
+ bool alpha,
bool zsort,
int lightlayer,
- bool bIsTriangle,
- void* clientobject,
struct MTFace* tface,
unsigned int* mcol,
PyTypeObject *T = &Type);
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index c01d6a632a3..ac63e3fade5 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -34,6 +34,8 @@
#include "PHY_IPhysicsController.h"
#include "PHY_IVehicle.h"
+#include "PyObjectPlus.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -91,7 +93,7 @@ static PyObject* gPySetGravity(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
static PyObject* gPySetDebugMode(PyObject* self,
@@ -112,7 +114,7 @@ static PyObject* gPySetDebugMode(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -132,7 +134,7 @@ static PyObject* gPySetNumTimeSubSteps(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -151,7 +153,7 @@ static PyObject* gPySetNumIterations(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -171,7 +173,7 @@ static PyObject* gPySetDeactivationTime(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -190,7 +192,7 @@ static PyObject* gPySetDeactivationLinearTreshold(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -209,7 +211,7 @@ static PyObject* gPySetDeactivationAngularTreshold(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
static PyObject* gPySetContactBreakingTreshold(PyObject* self,
@@ -227,7 +229,7 @@ static PyObject* gPySetContactBreakingTreshold(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -246,7 +248,7 @@ static PyObject* gPySetCcdMode(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
static PyObject* gPySetSorConstant(PyObject* self,
@@ -264,7 +266,7 @@ static PyObject* gPySetSorConstant(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
static PyObject* gPySetSolverTau(PyObject* self,
@@ -282,7 +284,7 @@ static PyObject* gPySetSolverTau(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -301,7 +303,7 @@ static PyObject* gPySetSolverDamping(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
static PyObject* gPySetLinearAirDamping(PyObject* self,
@@ -319,7 +321,7 @@ static PyObject* gPySetLinearAirDamping(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -338,7 +340,7 @@ static PyObject* gPySetUseEpa(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
static PyObject* gPySetSolverType(PyObject* self,
PyObject* args,
@@ -355,7 +357,7 @@ static PyObject* gPySetSolverType(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -388,7 +390,7 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -448,7 +450,7 @@ static PyObject* gPyCreateConstraint(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
@@ -502,7 +504,7 @@ static PyObject* gPyRemoveConstraint(PyObject* self,
return NULL;
}
- Py_INCREF(Py_None); return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h
index e1715c9275f..4e383e9b3d4 100644
--- a/source/gameengine/Ketsji/KX_PyMath.h
+++ b/source/gameengine/Ketsji/KX_PyMath.h
@@ -84,7 +84,10 @@ bool PyMatTo(PyObject* pymat, T& mat)
}
} else
noerror = false;
-
+
+ if (noerror==false)
+ PyErr_SetString(PyExc_TypeError, "could not be converted to a matrix (sequence of sequences)");
+
return noerror;
}
@@ -97,9 +100,13 @@ bool PyVecTo(PyObject* pyval, T& vec)
if (PySequence_Check(pyval))
{
unsigned int numitems = PySequence_Size(pyval);
- if (numitems != Size(vec))
+ if (numitems != Size(vec)) {
+ char err[128];
+ sprintf(err, "error setting vector, %d args, should be %d", numitems, Size(vec));
+ PyErr_SetString(PyExc_AttributeError, err);
return false;
-
+ }
+
for (unsigned int x = 0; x < numitems; x++)
{
PyObject *item = PySequence_GetItem(pyval, x); /* new ref */
@@ -107,7 +114,17 @@ bool PyVecTo(PyObject* pyval, T& vec)
Py_DECREF(item);
}
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_AttributeError, "one or more of the items in the sequence was not a float");
+ return false;
+ }
+
return true;
+ } else
+ {
+ char err[128];
+ sprintf(err, "not a sequence type, expected a sequence of numbers size %d", Size(vec));
+ PyErr_SetString(PyExc_AttributeError, err);
}
return false;
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 61ed8b6a8e4..eb0052d71ff 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -30,7 +30,13 @@
#include "GL/glew.h"
+// directory header for py function getBlendFileList
#include <stdlib.h>
+#ifndef WIN32
+ #include <dirent.h>
+#else
+ #include "BLI_winstuff.h"
+#endif
#ifdef WIN32
#pragma warning (disable : 4786)
@@ -51,17 +57,23 @@
#include "BL_ActionActuator.h"
#include "RAS_IRasterizer.h"
#include "RAS_ICanvas.h"
+#include "RAS_BucketManager.h"
#include "MT_Vector3.h"
#include "MT_Point3.h"
#include "ListValue.h"
#include "KX_Scene.h"
#include "SND_DeviceManager.h"
-#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h"
#include "BL_Shader.h"
#include "KX_PyMath.h"
+#include "PyObjectPlus.h"
+
+extern "C" {
+ #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
+}
+
#include "PHY_IPhysicsEnvironment.h"
// FIXME: Enable for access to blender python modules. This is disabled because
// python has dependencies on a lot of other modules and is a pain to link.
@@ -73,6 +85,7 @@
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BLI_blenlib.h"
+#include "GPU_material.h"
static void setSandbox(TPythonSecurityLevel level);
@@ -80,6 +93,7 @@ static void setSandbox(TPythonSecurityLevel level);
// 'local' copy of canvas ptr, for window height/width python scripts
static RAS_ICanvas* gp_Canvas = NULL;
static KX_Scene* gp_KetsjiScene = NULL;
+static KX_KetsjiEngine* gp_KetsjiEngine = NULL;
static RAS_IRasterizer* gp_Rasterizer = NULL;
void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color)
@@ -108,20 +122,16 @@ static PyObject* gPyGetRandomFloat(PyObject*)
return PyFloat_FromDouble(MT_random());
}
-static PyObject* gPySetGravity(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetGravity(PyObject*, PyObject* args)
{
MT_Vector3 vec = MT_Vector3(0., 0., 0.);
- if (PyVecArgTo(args, vec))
- {
- if (gp_KetsjiScene)
- gp_KetsjiScene->SetGravity(vec);
-
- Py_Return;
- }
+ if (!PyVecArgTo(args, vec))
+ return NULL;
+
+ if (gp_KetsjiScene)
+ gp_KetsjiScene->SetGravity(vec);
- return NULL;
+ Py_RETURN_NONE;
}
static char gPyExpandPath_doc[] =
@@ -134,20 +144,17 @@ file to make a full path name (doesn't change during the game, even if you load\
other .blend).\n\
The function also converts the directory separator to the local file system format.";
-static PyObject* gPyExpandPath(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyExpandPath(PyObject*, PyObject* args)
{
char expanded[FILE_MAXDIR + FILE_MAXFILE];
char* filename;
- if (PyArg_ParseTuple(args,"s",&filename))
- {
- BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE);
- BLI_convertstringcode(expanded, G.sce);
- return PyString_FromString(expanded);
- }
- return NULL;
+ if (!PyArg_ParseTuple(args,"s",&filename))
+ return NULL;
+
+ BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE);
+ BLI_convertstringcode(expanded, G.sce);
+ return PyString_FromString(expanded);
}
@@ -175,62 +182,62 @@ static PyObject* gPyGetSpectrum(PyObject*)
PyList_SetItem(resultlist, index, PyFloat_FromDouble(spectrum[index]));
}
}
+ else {
+ for (int index = 0; index < 512; index++)
+ {
+ PyList_SetItem(resultlist, index, PyFloat_FromDouble(0.0));
+ }
+ }
return resultlist;
}
-static PyObject* gPyStartDSP(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyStartDSP(PyObject*, PyObject* args)
{
SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
- if (audiodevice)
- {
- if (!usedsp)
- {
- audiodevice->StartUsingDSP();
- usedsp = true;
- Py_Return;
- }
+ if (!audiodevice) {
+ PyErr_SetString(PyExc_RuntimeError, "no audio device available");
+ return NULL;
}
- return NULL;
+
+ if (!usedsp) {
+ audiodevice->StartUsingDSP();
+ usedsp = true;
+ }
+
+ Py_RETURN_NONE;
}
-static PyObject* gPyStopDSP(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyStopDSP(PyObject*, PyObject* args)
{
SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
- if (audiodevice)
- {
- if (usedsp)
- {
- audiodevice->StopUsingDSP();
- usedsp = false;
- Py_Return;
- }
+ if (!audiodevice) {
+ PyErr_SetString(PyExc_RuntimeError, "no audio device available");
+ return NULL;
}
- return NULL;
+
+ if (usedsp) {
+ audiodevice->StopUsingDSP();
+ usedsp = true;
+ }
+
+ Py_RETURN_NONE;
}
-static PyObject* gPySetLogicTicRate(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetLogicTicRate(PyObject*, PyObject* args)
{
float ticrate;
- if (PyArg_ParseTuple(args, "f", &ticrate))
- {
- KX_KetsjiEngine::SetTicRate(ticrate);
- Py_Return;
- }
+ if (!PyArg_ParseTuple(args, "f", &ticrate))
+ return NULL;
- return NULL;
+ KX_KetsjiEngine::SetTicRate(ticrate);
+ Py_RETURN_NONE;
}
static PyObject* gPyGetLogicTicRate(PyObject*)
@@ -238,33 +245,24 @@ static PyObject* gPyGetLogicTicRate(PyObject*)
return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate());
}
-static PyObject* gPySetPhysicsTicRate(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args)
{
float ticrate;
- if (PyArg_ParseTuple(args, "f", &ticrate))
- {
-
- PHY_GetActiveEnvironment()->setFixedTimeStep(true,ticrate);
- Py_Return;
- }
+ if (!PyArg_ParseTuple(args, "f", &ticrate))
+ return NULL;
- return NULL;
+ PHY_GetActiveEnvironment()->setFixedTimeStep(true,ticrate);
+ Py_RETURN_NONE;
}
-static PyObject* gPySetPhysicsDebug(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetPhysicsDebug(PyObject*, PyObject* args)
{
int debugMode;
- if (PyArg_ParseTuple(args, "i", &debugMode))
- {
- PHY_GetActiveEnvironment()->setDebugMode(debugMode);
- Py_Return;
- }
+ if (!PyArg_ParseTuple(args, "i", &debugMode))
+ return NULL;
- return NULL;
+ PHY_GetActiveEnvironment()->setDebugMode(debugMode);
+ Py_RETURN_NONE;
}
@@ -274,6 +272,51 @@ static PyObject* gPyGetPhysicsTicRate(PyObject*)
return PyFloat_FromDouble(PHY_GetActiveEnvironment()->getFixedTimeStep());
}
+static PyObject* gPyGetAverageFrameRate(PyObject*)
+{
+ return PyFloat_FromDouble(KX_KetsjiEngine::GetAverageFrameRate());
+}
+
+static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
+{
+ char cpath[sizeof(G.sce)];
+ char *searchpath = NULL;
+ PyObject* list, *value;
+
+ DIR *dp;
+ struct dirent *dirp;
+
+ if (!PyArg_ParseTuple(args, "|s", &searchpath))
+ return NULL;
+
+ list = PyList_New(0);
+
+ if (searchpath) {
+ BLI_strncpy(cpath, searchpath, FILE_MAXDIR + FILE_MAXFILE);
+ BLI_convertstringcode(cpath, G.sce);
+ } else {
+ /* Get the dir only */
+ BLI_split_dirfile_basic(G.sce, cpath, NULL);
+ }
+
+ if((dp = opendir(cpath)) == NULL) {
+ /* todo, show the errno, this shouldnt happen anyway if the blendfile is readable */
+ fprintf(stderr, "Could not read directoty () failed, code %d (%s)\n", cpath, errno, strerror(errno));
+ return list;
+ }
+
+ while ((dirp = readdir(dp)) != NULL) {
+ if (BLI_testextensie(dirp->d_name, ".blend")) {
+ value = PyString_FromString(dirp->d_name);
+ PyList_Append(list, value);
+ Py_DECREF(value);
+ }
+ }
+
+ closedir(dp);
+ return list;
+}
+
static STR_String gPyGetCurrentScene_doc =
"getCurrentScene()\n"
"Gets a reference to the current scene.\n";
@@ -351,8 +394,7 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *)
if(!count)
pprint("No extenstions are used in this build");
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -374,33 +416,23 @@ static struct PyMethodDef game_methods[] = {
{"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, "Sets the logic tic rate"},
{"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, "Gets the physics tic rate"},
{"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, "Sets the physics tic rate"},
+ {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, "Gets the estimated average frame rate"},
+ {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, "Gets a list of blend files in the same directory as the current blend file"},
{"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, "Prints GL Extension Info"},
{NULL, (PyCFunction) NULL, 0, NULL }
};
-static PyObject* gPyGetWindowHeight(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyGetWindowHeight(PyObject*, PyObject* args)
{
- int height = (gp_Canvas ? gp_Canvas->GetHeight() : 0);
-
- PyObject* heightval = PyInt_FromLong(height);
- return heightval;
+ return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetHeight() : 0));
}
-static PyObject* gPyGetWindowWidth(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyGetWindowWidth(PyObject*, PyObject* args)
{
-
-
- int width = (gp_Canvas ? gp_Canvas->GetWidth() : 0);
-
- PyObject* widthval = PyInt_FromLong(width);
- return widthval;
+ return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetWidth() : 0));
}
@@ -408,260 +440,311 @@ static PyObject* gPyGetWindowWidth(PyObject*,
// temporarility visibility thing, will be moved to rasterizer/renderer later
bool gUseVisibilityTemp = false;
-static PyObject* gPyEnableVisibility(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyEnableVisibility(PyObject*, PyObject* args)
{
int visible;
- if (PyArg_ParseTuple(args,"i",&visible))
- {
- gUseVisibilityTemp = (visible != 0);
- }
- else
- {
+ if (!PyArg_ParseTuple(args,"i",&visible))
return NULL;
- }
- Py_Return;
+
+ gUseVisibilityTemp = (visible != 0);
+ Py_RETURN_NONE;
}
-static PyObject* gPyShowMouse(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyShowMouse(PyObject*, PyObject* args)
{
int visible;
- if (PyArg_ParseTuple(args,"i",&visible))
- {
- if (visible)
- {
- if (gp_Canvas)
- gp_Canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
- } else
- {
- if (gp_Canvas)
- gp_Canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE);
- }
- }
- else {
+ if (!PyArg_ParseTuple(args,"i",&visible))
return NULL;
+
+ if (visible)
+ {
+ if (gp_Canvas)
+ gp_Canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
+ } else
+ {
+ if (gp_Canvas)
+ gp_Canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE);
}
- Py_Return;
+ Py_RETURN_NONE;
}
-static PyObject* gPySetMousePosition(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetMousePosition(PyObject*, PyObject* args)
{
int x,y;
- if (PyArg_ParseTuple(args,"ii",&x,&y))
- {
- if (gp_Canvas)
- gp_Canvas->SetMousePosition(x,y);
- }
- else {
+ if (!PyArg_ParseTuple(args,"ii",&x,&y))
return NULL;
- }
- Py_Return;
+ if (gp_Canvas)
+ gp_Canvas->SetMousePosition(x,y);
+
+ Py_RETURN_NONE;
}
-static PyObject* gPySetEyeSeparation(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetEyeSeparation(PyObject*, PyObject* args)
{
float sep;
- if (PyArg_ParseTuple(args, "f", &sep))
- {
- if (gp_Rasterizer)
- gp_Rasterizer->SetEyeSeparation(sep);
-
- Py_Return;
+ if (!PyArg_ParseTuple(args, "f", &sep))
+ return NULL;
+
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
}
- return NULL;
+ gp_Rasterizer->SetEyeSeparation(sep);
+
+ Py_RETURN_NONE;
}
static PyObject* gPyGetEyeSeparation(PyObject*, PyObject*, PyObject*)
{
- if (gp_Rasterizer)
- return PyFloat_FromDouble(gp_Rasterizer->GetEyeSeparation());
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
+ }
- return NULL;
+ return PyFloat_FromDouble(gp_Rasterizer->GetEyeSeparation());
}
-static PyObject* gPySetFocalLength(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetFocalLength(PyObject*, PyObject* args)
{
float focus;
- if (PyArg_ParseTuple(args, "f", &focus))
- {
- if (gp_Rasterizer)
- gp_Rasterizer->SetFocalLength(focus);
- Py_Return;
+ if (!PyArg_ParseTuple(args, "f", &focus))
+ return NULL;
+
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
}
+
+ gp_Rasterizer->SetFocalLength(focus);
- return NULL;
+ Py_RETURN_NONE;
}
static PyObject* gPyGetFocalLength(PyObject*, PyObject*, PyObject*)
{
- if (gp_Rasterizer)
- return PyFloat_FromDouble(gp_Rasterizer->GetFocalLength());
- return NULL;
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
+ }
+
+ return PyFloat_FromDouble(gp_Rasterizer->GetFocalLength());
+
+ Py_RETURN_NONE;
}
-static PyObject* gPySetBackgroundColor(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetBackgroundColor(PyObject*, PyObject* args)
{
MT_Vector4 vec = MT_Vector4(0., 0., 0.3, 0.);
- if (PyVecArgTo(args, vec))
+ if (!PyVecArgTo(args, vec))
+ return NULL;
+
+ if (gp_Canvas)
{
- if (gp_Canvas)
- {
- gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
- }
- Py_Return;
+ gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
}
-
- return NULL;
+ Py_RETURN_NONE;
}
-static PyObject* gPySetMistColor(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetMistColor(PyObject*, PyObject* args)
{
MT_Vector3 vec = MT_Vector3(0., 0., 0.);
- if (PyVecArgTo(args, vec))
- {
- if (gp_Rasterizer)
- {
- gp_Rasterizer->SetFogColor(vec[0], vec[1], vec[2]);
- }
- Py_Return;
- }
+ if (!PyVecArgTo(args, vec))
+ return NULL;
- return NULL;
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
+ }
+ gp_Rasterizer->SetFogColor(vec[0], vec[1], vec[2]);
+
+ Py_RETURN_NONE;
}
-static PyObject* gPySetMistStart(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetMistStart(PyObject*, PyObject* args)
{
float miststart;
- if (PyArg_ParseTuple(args,"f",&miststart))
- {
- if (gp_Rasterizer)
- {
- gp_Rasterizer->SetFogStart(miststart);
- }
- }
- else {
+ if (!PyArg_ParseTuple(args,"f",&miststart))
+ return NULL;
+
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
return NULL;
}
- Py_Return;
+
+ gp_Rasterizer->SetFogStart(miststart);
+
+ Py_RETURN_NONE;
}
-static PyObject* gPySetMistEnd(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetMistEnd(PyObject*, PyObject* args)
{
float mistend;
- if (PyArg_ParseTuple(args,"f",&mistend))
- {
- if (gp_Rasterizer)
- {
- gp_Rasterizer->SetFogEnd(mistend);
- }
- }
- else {
+ if (!PyArg_ParseTuple(args,"f",&mistend))
+ return NULL;
+
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
return NULL;
}
- Py_Return;
+
+ gp_Rasterizer->SetFogEnd(mistend);
+
+ Py_RETURN_NONE;
}
-static PyObject* gPySetAmbientColor(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPySetAmbientColor(PyObject*, PyObject* args)
{
MT_Vector3 vec = MT_Vector3(0., 0., 0.);
- if (PyVecArgTo(args, vec))
- {
- if (gp_Rasterizer)
- {
- gp_Rasterizer->SetAmbientColor(vec[0], vec[1], vec[2]);
- }
- Py_Return;
- }
+ if (!PyVecArgTo(args, vec))
+ return NULL;
- return NULL;
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
+ }
+ gp_Rasterizer->SetAmbientColor(vec[0], vec[1], vec[2]);
+
+ Py_RETURN_NONE;
}
-static PyObject* gPyMakeScreenshot(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyMakeScreenshot(PyObject*, PyObject* args)
{
char* filename;
- if (PyArg_ParseTuple(args,"s",&filename))
+ if (!PyArg_ParseTuple(args,"s",&filename))
+ return NULL;
+
+ if (gp_Canvas)
{
- if (gp_Canvas)
- {
- gp_Canvas->MakeScreenShot(filename);
- }
+ gp_Canvas->MakeScreenShot(filename);
}
- else {
+
+ Py_RETURN_NONE;
+}
+
+static PyObject* gPyEnableMotionBlur(PyObject*, PyObject* args)
+{
+ float motionblurvalue;
+ if (!PyArg_ParseTuple(args,"f",&motionblurvalue))
+ return NULL;
+
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
return NULL;
}
- Py_Return;
+
+ gp_Rasterizer->EnableMotionBlur(motionblurvalue);
+
+ Py_RETURN_NONE;
}
-static PyObject* gPyEnableMotionBlur(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyDisableMotionBlur(PyObject*, PyObject* args)
{
- float motionblurvalue;
- if (PyArg_ParseTuple(args,"f",&motionblurvalue))
- {
- if(gp_Rasterizer)
- {
- gp_Rasterizer->EnableMotionBlur(motionblurvalue);
- }
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
}
- else {
+
+ gp_Rasterizer->DisableMotionBlur();
+
+ Py_RETURN_NONE;
+}
+
+int getGLSLSettingFlag(char *setting)
+{
+ if(strcmp(setting, "lights") == 0)
+ return G_FILE_GLSL_NO_LIGHTS;
+ else if(strcmp(setting, "shaders") == 0)
+ return G_FILE_GLSL_NO_SHADERS;
+ else if(strcmp(setting, "shadows") == 0)
+ return G_FILE_GLSL_NO_SHADOWS;
+ else if(strcmp(setting, "ramps") == 0)
+ return G_FILE_GLSL_NO_RAMPS;
+ else if(strcmp(setting, "nodes") == 0)
+ return G_FILE_GLSL_NO_NODES;
+ else if(strcmp(setting, "extra_textures") == 0)
+ return G_FILE_GLSL_NO_EXTRA_TEX;
+ else
+ return -1;
+}
+
+static PyObject* gPySetGLSLMaterialSetting(PyObject*,
+ PyObject* args,
+ PyObject*)
+{
+ char *setting;
+ int enable, flag;
+
+ if (!PyArg_ParseTuple(args,"si",&setting,&enable))
+ return NULL;
+
+ flag = getGLSLSettingFlag(setting);
+
+ if (flag==-1) {
+ PyErr_SetString(PyExc_ValueError, "glsl setting is not known");
return NULL;
}
- Py_Return;
+
+ if (enable)
+ G.fileflags &= ~flag;
+ else
+ G.fileflags |= flag;
+
+ /* display lists and GLSL materials need to be remade */
+ if(gp_KetsjiEngine) {
+ KX_SceneList *scenes = gp_KetsjiEngine->CurrentScenes();
+ KX_SceneList::iterator it;
+
+ for(it=scenes->begin(); it!=scenes->end(); it++)
+ if((*it)->GetBucketManager())
+ (*it)->GetBucketManager()->ReleaseDisplayLists();
+ }
+
+ GPU_materials_free();
+
+ Py_RETURN_NONE;
}
-static PyObject* gPyDisableMotionBlur(PyObject*,
- PyObject* args,
- PyObject*)
+static PyObject* gPyGetGLSLMaterialSetting(PyObject*,
+ PyObject* args,
+ PyObject*)
{
- if(gp_Rasterizer)
- {
- gp_Rasterizer->DisableMotionBlur();
+ char *setting;
+ int enabled = 0, flag;
+
+ if (!PyArg_ParseTuple(args,"s",&setting))
+ return NULL;
+
+ flag = getGLSLSettingFlag(setting);
+
+ if (flag==-1) {
+ PyErr_SetString(PyExc_ValueError, "glsl setting is not known");
+ return NULL;
}
- Py_Return;
+
+ enabled = ((G.fileflags & flag) != 0);
+ return PyInt_FromLong(enabled);
}
STR_String gPyGetWindowHeight__doc__="getWindowHeight doc";
@@ -697,11 +780,13 @@ static struct PyMethodDef rasterizer_methods[] = {
{"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_VARARGS, "get the eye separation for stereo mode"},
{"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"},
{"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"},
+ {"setGLSLMaterialSetting",(PyCFunction) gPySetGLSLMaterialSetting,
+ METH_VARARGS, "set the state of a GLSL material setting"},
+ {"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting,
+ METH_VARARGS, "get the state of a GLSL material setting"},
{ NULL, (PyCFunction) NULL, 0, NULL }
};
-
-
// Initialization function for the module (*must* be called initGameLogic)
static char GameLogic_module_documentation[] =
@@ -714,11 +799,12 @@ static char Rasterizer_module_documentation[] =
-PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
+PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack to get gravity hook
{
PyObject* m;
PyObject* d;
+ gp_KetsjiEngine = engine;
gp_KetsjiScene = scene;
gUseVisibilityTemp=false;
@@ -730,10 +816,14 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
// Add some symbolic constants to the module
d = PyModule_GetDict(m);
+
+ // can be overwritten later for gameEngine instances that can load new blend files and re-initialize this module
+ // for now its safe to make sure it exists for other areas such as the web plugin
+ PyDict_SetItemString(d, "globalDict", PyDict_New());
ErrorObject = PyString_FromString("GameLogic.error");
PyDict_SetItemString(d, "error", ErrorObject);
-
+
// XXXX Add constants here
/* To use logic bricks, we need some sort of constants. Here, we associate */
/* constants and sumbolic names. Add them to dictionary d. */
@@ -756,6 +846,15 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTX);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTY);
KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY);
+ KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ);
/* 4. Ipo actuator, simple part */
KX_MACRO_addTypesToDict(d, KX_IPOACT_PLAY, KX_IpoActuator::KX_ACT_IPO_PLAY);
@@ -835,13 +934,30 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
// override builtin functions import() and open()
-PyObject *KXpy_open(PyObject *self, PyObject *args)
-{
+PyObject *KXpy_open(PyObject *self, PyObject *args) {
PyErr_SetString(PyExc_RuntimeError, "Sandbox: open() function disabled!\nGame Scripts should not use this function.");
return NULL;
}
+PyObject *KXpy_reload(PyObject *self, PyObject *args) {
+ PyErr_SetString(PyExc_RuntimeError, "Sandbox: reload() function disabled!\nGame Scripts should not use this function.");
+ return NULL;
+}
+PyObject *KXpy_file(PyObject *self, PyObject *args) {
+ PyErr_SetString(PyExc_RuntimeError, "Sandbox: file() function disabled!\nGame Scripts should not use this function.");
+ return NULL;
+}
+
+PyObject *KXpy_execfile(PyObject *self, PyObject *args) {
+ PyErr_SetString(PyExc_RuntimeError, "Sandbox: execfile() function disabled!\nGame Scripts should not use this function.");
+ return NULL;
+}
+
+PyObject *KXpy_compile(PyObject *self, PyObject *args) {
+ PyErr_SetString(PyExc_RuntimeError, "Sandbox: compile() function disabled!\nGame Scripts should not use this function.");
+ return NULL;
+}
PyObject *KXpy_import(PyObject *self, PyObject *args)
{
@@ -867,7 +983,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args)
/* quick hack for GamePython modules
TODO: register builtin modules properly by ExtendInittab */
if (!strcmp(name, "GameLogic") || !strcmp(name, "GameKeys") || !strcmp(name, "PhysicsConstraints") ||
- !strcmp(name, "Rasterizer")) {
+ !strcmp(name, "Rasterizer") || !strcmp(name, "Mathutils")) {
return PyImport_ImportModuleEx(name, globals, locals, fromlist);
}
@@ -878,19 +994,13 @@ PyObject *KXpy_import(PyObject *self, PyObject *args)
}
+static PyMethodDef meth_open[] = {{ "open", KXpy_open, METH_VARARGS, "(disabled)"}};
+static PyMethodDef meth_reload[] = {{ "reload", KXpy_reload, METH_VARARGS, "(disabled)"}};
+static PyMethodDef meth_file[] = {{ "file", KXpy_file, METH_VARARGS, "(disabled)"}};
+static PyMethodDef meth_execfile[] = {{ "execfile", KXpy_execfile, METH_VARARGS, "(disabled)"}};
+static PyMethodDef meth_compile[] = {{ "compile", KXpy_compile, METH_VARARGS, "(disabled)"}};
-static PyMethodDef meth_open[] = {
- { "open", KXpy_open, METH_VARARGS,
- "(disabled)"}
-};
-
-
-static PyMethodDef meth_import[] = {
- { "import", KXpy_import, METH_VARARGS,
- "our own import"}
-};
-
-
+static PyMethodDef meth_import[] = {{ "import", KXpy_import, METH_VARARGS, "our own import"}};
//static PyObject *g_oldopen = 0;
//static PyObject *g_oldimport = 0;
@@ -901,15 +1011,21 @@ void setSandbox(TPythonSecurityLevel level)
{
PyObject *m = PyImport_AddModule("__builtin__");
PyObject *d = PyModule_GetDict(m);
- PyObject *meth = PyCFunction_New(meth_open, NULL);
switch (level) {
case psl_Highest:
//if (!g_security) {
//g_oldopen = PyDict_GetItemString(d, "open");
- PyDict_SetItemString(d, "open", meth);
- meth = PyCFunction_New(meth_import, NULL);
- PyDict_SetItemString(d, "__import__", meth);
+
+ // functions we cant trust
+ PyDict_SetItemString(d, "open", PyCFunction_New(meth_open, NULL));
+ PyDict_SetItemString(d, "reload", PyCFunction_New(meth_reload, NULL));
+ PyDict_SetItemString(d, "file", PyCFunction_New(meth_file, NULL));
+ PyDict_SetItemString(d, "execfile", PyCFunction_New(meth_execfile, NULL));
+ PyDict_SetItemString(d, "compile", PyCFunction_New(meth_compile, NULL));
+
+ // our own import
+ PyDict_SetItemString(d, "__import__", PyCFunction_New(meth_import, NULL));
//g_security = level;
//}
break;
@@ -1014,9 +1130,38 @@ static char GameKeys_module_documentation[] =
"This modules provides defines for key-codes"
;
+static char gPyEventToString_doc[] =
+"Take a valid event from the GameKeys module or Keyboard Sensor and return a name"
+;
+static PyObject* gPyEventToString(PyObject*, PyObject* value)
+{
+ PyObject* mod, *dict, *key, *val, *ret = NULL;
+ Py_ssize_t pos = 0;
+
+ mod = PyImport_ImportModule( "GameKeys" );
+ if (!mod)
+ return NULL;
+
+ dict = PyModule_GetDict(mod);
+
+ while (PyDict_Next(dict, &pos, &key, &val)) {
+ if (PyObject_Compare(value, val)==0) {
+ ret = key;
+ break;
+ }
+ }
+
+ PyErr_Clear(); // incase there was an error clearing
+ Py_DECREF(mod);
+ if (!ret) PyErr_SetString(PyExc_ValueError, "expected a valid int keyboard event");
+ else Py_INCREF(ret);
+
+ return ret;
+}
static struct PyMethodDef gamekeys_methods[] = {
+ {"EventToString", (PyCFunction)gPyEventToString, METH_O, gPyEventToString_doc},
{ NULL, (PyCFunction) NULL, 0, NULL }
};
@@ -1160,6 +1305,11 @@ PyObject* initGameKeys()
return d;
}
+PyObject* initMathutils()
+{
+ return Mathutils_Init("Mathutils"); // Use as a top level module in BGE
+}
+
void PHY_SetActiveScene(class KX_Scene* scene)
{
gp_KetsjiScene = scene;
diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h
index 41cf7fd67b3..388d073c6db 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.h
+++ b/source/gameengine/Ketsji/KX_PythonInit.h
@@ -40,10 +40,11 @@ typedef enum {
extern bool gUseVisibilityTemp;
-PyObject* initGameLogic(class KX_Scene* ketsjiscene);
+PyObject* initGameLogic(class KX_KetsjiEngine *engine, class KX_Scene* ketsjiscene);
PyObject* initGameKeys();
PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas);
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level);
+PyObject* initMathutils();
void exitGamePlayerPythonScripting();
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level);
void exitGamePythonScripting();
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp
index de4979ac4c9..d371626b597 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.cpp
+++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp
@@ -147,23 +147,23 @@ void KX_RadarSensor::SynchronizeTransform()
};
case 3: // -X Axis
{
- MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90));
+ MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(-90));
trans.rotate(rotquatje);
- trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0));
+ trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
break;
};
case 4: // -Y Axis
{
- MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180));
- trans.rotate(rotquatje);
- trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0));
+ //MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180));
+ //trans.rotate(rotquatje);
+ trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
break;
};
case 5: // -Z Axis
{
- MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-90));
+ MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(90));
trans.rotate(rotquatje);
- trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0));
+ trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
break;
};
default:
diff --git a/source/gameengine/Ketsji/KX_RayCast.cpp b/source/gameengine/Ketsji/KX_RayCast.cpp
index 89e2d645d54..974d4b992a6 100644
--- a/source/gameengine/Ketsji/KX_RayCast.cpp
+++ b/source/gameengine/Ketsji/KX_RayCast.cpp
@@ -40,7 +40,21 @@
#include "PHY_IPhysicsEnvironment.h"
#include "PHY_IPhysicsController.h"
-bool KX_RayCast::RayTest(KX_IPhysicsController* ignore_controller, PHY_IPhysicsEnvironment* physics_environment, const MT_Point3& _frompoint, const MT_Point3& topoint, MT_Point3& result_point, MT_Vector3& result_normal, const KX_RayCast& callback)
+KX_RayCast::KX_RayCast(KX_IPhysicsController* ignoreController, bool faceNormal)
+ :PHY_IRayCastFilterCallback(dynamic_cast<PHY_IPhysicsController*>(ignoreController), faceNormal)
+{
+}
+
+void KX_RayCast::reportHit(PHY_RayCastResult* result)
+{
+ m_hitFound = true;
+ m_hitPoint.setValue((const float*)result->m_hitPoint);
+ m_hitNormal.setValue((const float*)result->m_hitNormal);
+ m_hitMesh = result->m_meshObject;
+ m_hitPolygon = result->m_polygon;
+}
+
+bool KX_RayCast::RayTest(PHY_IPhysicsEnvironment* physics_environment, const MT_Point3& _frompoint, const MT_Point3& topoint, KX_RayCast& callback)
{
// Loops over all physics objects between frompoint and topoint,
// calling callback.RayHit for each one.
@@ -50,58 +64,51 @@ bool KX_RayCast::RayTest(KX_IPhysicsController* ignore_controller, PHY_IPhysicsE
// returns true if an object was found, false if not.
MT_Point3 frompoint(_frompoint);
const MT_Vector3 todir( (topoint - frompoint).safe_normalized() );
+ MT_Point3 prevpoint(_frompoint+todir*(-1.f));
PHY_IPhysicsController* hit_controller;
- PHY__Vector3 phy_pos;
- PHY__Vector3 phy_normal;
- while((hit_controller = physics_environment->rayTest(dynamic_cast<PHY_IPhysicsController*>(ignore_controller),
+ while((hit_controller = physics_environment->rayTest(callback,
frompoint.x(),frompoint.y(),frompoint.z(),
- topoint.x(),topoint.y(),topoint.z(),
- phy_pos[0],phy_pos[1],phy_pos[2],
- phy_normal[0],phy_normal[1],phy_normal[2])))
+ topoint.x(),topoint.y(),topoint.z())) != NULL)
{
- result_point = MT_Point3(phy_pos);
- result_normal = MT_Vector3(phy_normal);
KX_ClientObjectInfo* info = static_cast<KX_ClientObjectInfo*>(hit_controller->getNewClientInfo());
if (!info)
{
printf("no info!\n");
MT_assert(info && "Physics controller with no client object info");
- return false;
+ break;
}
- if (callback.RayHit(info, result_point, result_normal))
- return true;
-
- // There is a bug in the code below: the delta is computed with the wrong
- // sign on the face opposite to the center, resulting in infinite looping.
- // In Blender 2.45 this code was never executed because callback.RayHit() always
- // returned true, causing the ray sensor to stop on the first object.
- // To avoid changing the behaviour will simply return false here.
- // It should be discussed if we want the ray sensor to "see" through objects
- // that don't have the required property/material (condition to get here)
- return false;
-
- // skip past the object and keep tracing
- /* We add 0.01 of fudge, so that if the margin && radius == 0., we don't endless loop. */
- MT_Scalar marg = 0.01 + hit_controller->GetMargin();
- marg += 2.f * hit_controller->GetMargin();
+ // The biggest danger to to endless loop, prevent this by checking that the
+ // hit point always progresses along the ray direction..
+ prevpoint -= callback.m_hitPoint;
+ if (prevpoint.length2() < MT_EPSILON)
+ break;
+
+ if (callback.RayHit(info))
+ // caller may decide to stop the loop and still cancel the hit
+ return callback.m_hitFound;
+
+ // Skip past the object and keep tracing.
+ // Note that retrieving in a single shot multiple hit points would be possible
+ // but it would require some change in Bullet.
+ prevpoint = callback.m_hitPoint;
+ /* We add 0.001 of fudge, so that if the margin && radius == 0., we don't endless loop. */
+ MT_Scalar marg = 0.001 + hit_controller->GetMargin();
+ marg *= 2.f;
/* Calculate the other side of this object */
- PHY__Vector3 hitpos;
- hit_controller->getPosition(hitpos);
- MT_Point3 hitObjPos(hitpos);
-
- MT_Vector3 hitvector = hitObjPos - result_point;
- if (hitvector.dot(hitvector) > MT_EPSILON)
- {
- hitvector.normalize();
- marg *= 2.*todir.dot(hitvector);
- }
- frompoint = result_point + marg * todir;
+ MT_Scalar h = MT_abs(todir.dot(callback.m_hitNormal));
+ if (h <= 0.01)
+ // the normal is almost orthogonal to the ray direction, cannot compute the other side
+ break;
+ marg /= h;
+ frompoint = callback.m_hitPoint + marg * todir;
+ // verify that we are not passed the to point
+ if ((topoint - frompoint).dot(todir) < 0.f)
+ break;
}
-
- return hit_controller;
+ return false;
}
diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h
index 607dabd8afc..c3084c997a1 100644
--- a/source/gameengine/Ketsji/KX_RayCast.h
+++ b/source/gameengine/Ketsji/KX_RayCast.h
@@ -30,12 +30,14 @@
#ifndef __KX_RAYCAST_H__
#define __KX_RAYCAST_H__
-class MT_Point3;
-class MT_Vector3;
-class KX_IPhysicsController;
-class PHY_IPhysicsEnvironment;
+#include "PHY_IPhysicsEnvironment.h"
+#include "PHY_IPhysicsController.h"
+#include "MT_Point3.h"
+#include "MT_Vector3.h"
+class RAS_MeshObject;
struct KX_ClientObjectInfo;
+class KX_IPhysicsController;
/**
* Defines a function for doing a ray cast.
@@ -49,17 +51,27 @@ struct KX_ClientObjectInfo;
*
* Returns true if a client was accepted, false if nothing found.
*/
-class KX_RayCast
+class KX_RayCast : public PHY_IRayCastFilterCallback
{
-protected:
- KX_RayCast() {};
public:
+ bool m_hitFound;
+ MT_Point3 m_hitPoint;
+ MT_Vector3 m_hitNormal;
+ const RAS_MeshObject* m_hitMesh;
+ int m_hitPolygon;
+
+ KX_RayCast(KX_IPhysicsController* ignoreController, bool faceNormal);
virtual ~KX_RayCast() {}
+ /**
+ * The physic environment returns the ray casting result through this function
+ */
+ virtual void reportHit(PHY_RayCastResult* result);
+
/** ray test callback.
* either override this in your class, or use a callback wrapper.
*/
- virtual bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal) const = 0;
+ virtual bool RayHit(KX_ClientObjectInfo* client) = 0;
/**
* Callback wrapper.
@@ -71,13 +83,11 @@ public:
/// Public interface.
/// Implement bool RayHit in your class to receive ray callbacks.
- static bool RayTest(KX_IPhysicsController* physics_controller,
+ static bool RayTest(
PHY_IPhysicsEnvironment* physics_environment,
- const MT_Point3& _frompoint,
+ const MT_Point3& frompoint,
const MT_Point3& topoint,
- MT_Point3& result_point,
- MT_Vector3& result_normal,
- const KX_RayCast& callback);
+ KX_RayCast& callback);
};
@@ -86,18 +96,32 @@ template<class T> class KX_RayCast::Callback : public KX_RayCast
T *self;
void *data;
public:
- Callback(T *_self, void *_data = NULL)
- : self(_self),
+ Callback(T *_self, KX_IPhysicsController* controller=NULL, void *_data = NULL, bool faceNormal=false)
+ : KX_RayCast(controller, faceNormal),
+ self(_self),
data(_data)
{
}
~Callback() {}
-
- virtual bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal) const
+
+ virtual bool RayHit(KX_ClientObjectInfo* client)
{
- return self->RayHit(client, hit_point, hit_normal, data);
+ return self->RayHit(client, this, data);
}
+
+ virtual bool needBroadphaseRayCast(PHY_IPhysicsController* controller)
+ {
+ KX_ClientObjectInfo* info = static_cast<KX_ClientObjectInfo*>(controller->getNewClientInfo());
+
+ if (!info)
+ {
+ MT_assert(info && "Physics controller with no client object info");
+ return false;
+ }
+ return self->NeedRayCast(info);
+ }
+
};
diff --git a/source/gameengine/Ketsji/KX_RayEventManager.cpp b/source/gameengine/Ketsji/KX_RayEventManager.cpp
index 4101c6b547e..1af29151adf 100644
--- a/source/gameengine/Ketsji/KX_RayEventManager.cpp
+++ b/source/gameengine/Ketsji/KX_RayEventManager.cpp
@@ -44,14 +44,9 @@ using namespace std;
void KX_RayEventManager::NextFrame()
{
- for (vector<class SCA_ISensor*>::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++)
+ for (set<class SCA_ISensor*>::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++)
{
- SCA_ISensor *sensor = *i;
- sensor->Activate(m_logicmgr, NULL);
+ (*i)->Activate(m_logicmgr, NULL);
}
}
-void KX_RayEventManager::RegisterSensor(SCA_ISensor* sensor)
-{
- m_sensors.push_back(sensor);
-};
diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h
index 3630f9682b9..b816d4d5250 100644
--- a/source/gameengine/Ketsji/KX_RayEventManager.h
+++ b/source/gameengine/Ketsji/KX_RayEventManager.h
@@ -45,7 +45,6 @@ public:
m_logicmgr(logicmgr)
{}
virtual void NextFrame();
- virtual void RegisterSensor(SCA_ISensor* sensor);
};
#endif //__KX_RAYEVENTMGR
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp
index a416c8c9f89..8dc22fe13c1 100644
--- a/source/gameengine/Ketsji/KX_RaySensor.cpp
+++ b/source/gameengine/Ketsji/KX_RaySensor.cpp
@@ -51,6 +51,7 @@ KX_RaySensor::KX_RaySensor(class SCA_EventManager* eventmgr,
SCA_IObject* gameobj,
const STR_String& propname,
bool bFindMaterial,
+ bool bXRay,
double distance,
int axis,
KX_Scene* ketsjiScene,
@@ -58,6 +59,7 @@ KX_RaySensor::KX_RaySensor(class SCA_EventManager* eventmgr,
: SCA_ISensor(gameobj,eventmgr, T),
m_propertyname(propname),
m_bFindMaterial(bFindMaterial),
+ m_bXRay(bXRay),
m_distance(distance),
m_scene(ketsjiScene),
m_axis(axis)
@@ -104,16 +106,10 @@ bool KX_RaySensor::IsPositiveTrigger()
return result;
}
-bool KX_RaySensor::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data)
+bool KX_RaySensor::RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data)
{
KX_GameObject* hitKXObj = client->m_gameobject;
-
- if (client->m_type > KX_ClientObjectInfo::ACTOR)
- {
- // false hit
- return false;
- }
bool bFound = false;
if (m_propertyname.Length() == 0)
@@ -139,16 +135,43 @@ bool KX_RaySensor::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_
{
m_rayHit = true;
m_hitObject = hitKXObj;
- m_hitPosition = hit_point;
- m_hitNormal = hit_normal;
+ m_hitPosition = result->m_hitPoint;
+ m_hitNormal = result->m_hitNormal;
}
-
- return bFound;
-
+ // no multi-hit search yet
+ return true;
}
-
+/* this function is used to pre-filter the object before casting the ray on them.
+ This is useful for "X-Ray" option when we want to see "through" unwanted object.
+ */
+bool KX_RaySensor::NeedRayCast(KX_ClientObjectInfo* client)
+{
+ if (client->m_type > KX_ClientObjectInfo::ACTOR)
+ {
+ // Unknown type of object, skip it.
+ // Should not occur as the sensor objects are filtered in RayTest()
+ printf("Invalid client type %d found ray casting\n", client->m_type);
+ return false;
+ }
+ if (m_bXRay && m_propertyname.Length() != 0)
+ {
+ if (m_bFindMaterial)
+ {
+ // not quite correct: an object may have multiple material
+ // should check all the material and not only the first one
+ if (!client->m_auxilary_info || (m_propertyname != ((char*)client->m_auxilary_info)))
+ return false;
+ }
+ else
+ {
+ if (client->m_gameobject->GetProperty(m_propertyname) == NULL)
+ return false;
+ }
+ }
+ return true;
+}
bool KX_RaySensor::Evaluate(CValue* event)
{
@@ -215,8 +238,6 @@ bool KX_RaySensor::Evaluate(CValue* event)
m_rayDirection = todir;
MT_Point3 topoint = frompoint + (m_distance) * todir;
- MT_Point3 resultpoint;
- MT_Vector3 resultnormal;
PHY_IPhysicsEnvironment* pe = m_scene->GetPhysicsEnvironment();
if (!pe)
@@ -238,7 +259,8 @@ bool KX_RaySensor::Evaluate(CValue* event)
PHY_IPhysicsEnvironment* physics_environment = this->m_scene->GetPhysicsEnvironment();
- result = KX_RayCast::RayTest(spc, physics_environment, frompoint, topoint, resultpoint, resultnormal, KX_RayCast::Callback<KX_RaySensor>(this));
+ KX_RayCast::Callback<KX_RaySensor> callback(this, spc);
+ KX_RayCast::RayTest(physics_environment, frompoint, topoint, callback);
/* now pass this result to some controller */
@@ -265,6 +287,10 @@ bool KX_RaySensor::Evaluate(CValue* event)
// notify logicsystem that ray JUST left the Object
result = true;
}
+ else
+ {
+ result = false;
+ }
}
if (reset)
diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h
index f4305b053d1..02a755fedc1 100644
--- a/source/gameengine/Ketsji/KX_RaySensor.h
+++ b/source/gameengine/Ketsji/KX_RaySensor.h
@@ -36,12 +36,14 @@
#include "MT_Point3.h"
struct KX_ClientObjectInfo;
+class KX_RayCast;
class KX_RaySensor : public SCA_ISensor
{
Py_Header;
STR_String m_propertyname;
bool m_bFindMaterial;
+ bool m_bXRay;
double m_distance;
class KX_Scene* m_scene;
bool m_bTriggered;
@@ -56,7 +58,8 @@ public:
KX_RaySensor(class SCA_EventManager* eventmgr,
SCA_IObject* gameobj,
const STR_String& propname,
- bool fFindMaterial,
+ bool bFindMaterial,
+ bool bXRay,
double distance,
int axis,
class KX_Scene* ketsjiScene,
@@ -68,7 +71,8 @@ public:
virtual bool IsPositiveTrigger();
virtual void Init();
- bool RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, MT_Vector3& hit_normal, void * const data);
+ bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data);
+ bool NeedRayCast(KX_ClientObjectInfo* client);
KX_PYMETHOD_DOC(KX_RaySensor,GetHitObject);
KX_PYMETHOD_DOC(KX_RaySensor,GetHitPosition);
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
index e36891b56f4..c4c190e9fa1 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
@@ -39,6 +39,8 @@
#include "KX_GameObject.h"
#include "KX_IPhysicsController.h"
+#include "PyObjectPlus.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -52,14 +54,20 @@ KX_SCA_AddObjectActuator::KX_SCA_AddObjectActuator(SCA_IObject *gameobj,
int time,
SCA_IScene* scene,
const MT_Vector3& linvel,
- bool local,
+ bool linv_local,
+ const MT_Vector3& angvel,
+ bool angv_local,
PyTypeObject* T)
:
SCA_IActuator(gameobj, T),
m_OriginalObject(original),
m_scene(scene),
+
m_linear_velocity(linvel),
- m_localFlag(local)
+ m_localLinvFlag(linv_local),
+
+ m_angular_velocity(angvel),
+ m_localAngvFlag(angv_local)
{
if (m_OriginalObject)
m_OriginalObject->RegisterActuator(this);
@@ -180,14 +188,16 @@ PyParentObject KX_SCA_AddObjectActuator::Parents[] = {
NULL
};
PyMethodDef KX_SCA_AddObjectActuator::Methods[] = {
- {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_VARARGS, SetObject_doc},
- {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_VARARGS, SetTime_doc},
+ {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, SetObject_doc},
+ {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, SetTime_doc},
{"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, GetObject_doc},
- {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_VARARGS, GetTime_doc},
- {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_VARARGS, GetLinearVelocity_doc},
+ {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, GetTime_doc},
+ {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, GetLinearVelocity_doc},
{"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, SetLinearVelocity_doc},
- {"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_VARARGS,"getLastCreatedObject() : get the object handle to the last created object\n"},
- {"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_VARARGS,"instantAddObject() : immediately add object without delay\n"},
+ {"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, GetAngularVelocity_doc},
+ {"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, SetAngularVelocity_doc},
+ {"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_NOARGS,"getLastCreatedObject() : get the object handle to the last created object\n"},
+ {"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"},
{NULL,NULL} //Sentinel
};
@@ -200,41 +210,25 @@ PyObject* KX_SCA_AddObjectActuator::_getattr(const STR_String& attr)
/* 1. setObject */
char KX_SCA_AddObjectActuator::SetObject_doc[] =
-"setObject(name)\n"
-"\t- name: string\n"
+"setObject(object)\n"
+"\t- object: KX_GameObject, string or None\n"
"\tSets the object that will be added. There has to be an object\n"
"\tof this name. If not, this function does nothing.\n";
-
-
-
-PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self,
- PyObject* args,
- PyObject* kwds)
-{
- PyObject* gameobj;
- if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj))
- {
- if (m_OriginalObject != NULL)
- m_OriginalObject->UnregisterActuator(this);
- m_OriginalObject = (SCA_IObject*)gameobj;
- if (m_OriginalObject)
- m_OriginalObject->RegisterActuator(this);
- Py_Return;
- }
- PyErr_Clear();
+PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* self, PyObject* value)
+{
+ KX_GameObject *gameobj;
- char* objectname;
- if (PyArg_ParseTuple(args, "s", &objectname))
- {
- if (m_OriginalObject != NULL)
- m_OriginalObject->UnregisterActuator(this);
- m_OriginalObject = (SCA_IObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));;
- if (m_OriginalObject)
- m_OriginalObject->RegisterActuator(this);
- Py_Return;
- }
+ if (!ConvertPythonToGameObject(value, &gameobj, true))
+ return NULL; // ConvertPythonToGameObject sets the error
- return NULL;
+ if (m_OriginalObject != NULL)
+ m_OriginalObject->UnregisterActuator(this);
+
+ m_OriginalObject = (SCA_IObject*)gameobj;
+ if (m_OriginalObject)
+ m_OriginalObject->RegisterActuator(this);
+
+ Py_RETURN_NONE;
}
@@ -247,19 +241,18 @@ char KX_SCA_AddObjectActuator::SetTime_doc[] =
"\tIf the duration is negative, it is set to 0.\n";
-PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* self, PyObject* value)
{
- int deltatime;
-
- if (!PyArg_ParseTuple(args, "i", &deltatime))
+ int deltatime = PyInt_AsLong(value);
+ if (deltatime==-1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, "expected an int");
return NULL;
+ }
m_timeProp = deltatime;
if (m_timeProp < 0) m_timeProp = 0;
- Py_Return;
+ Py_RETURN_NONE;
}
@@ -270,9 +263,7 @@ char KX_SCA_AddObjectActuator::GetTime_doc[] =
"\tReturns the lifetime of the object that will be added.\n";
-PyObject* KX_SCA_AddObjectActuator::PyGetTime(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PyGetTime(PyObject* self)
{
return PyInt_FromLong(m_timeProp);
}
@@ -280,19 +271,22 @@ PyObject* KX_SCA_AddObjectActuator::PyGetTime(PyObject* self,
/* 4. getObject */
char KX_SCA_AddObjectActuator::GetObject_doc[] =
-"getObject()\n"
+"getObject(name_only = 1)\n"
+"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
"\tReturns the name of the object that will be added.\n";
-
-
-
-PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* self, PyObject* args)
{
+ int ret_name_only = 1;
+ if (!PyArg_ParseTuple(args, "|i", &ret_name_only))
+ return NULL;
+
if (!m_OriginalObject)
- Py_Return;
-
- return PyString_FromString(m_OriginalObject->GetName());
+ Py_RETURN_NONE;
+
+ if (ret_name_only)
+ return PyString_FromString(m_OriginalObject->GetName());
+ else
+ return m_OriginalObject->AddRef();
}
@@ -303,17 +297,13 @@ char KX_SCA_AddObjectActuator::GetLinearVelocity_doc[] =
"\tReturns the linear velocity that will be assigned to \n"
"\tthe created object.\n";
-
-
-PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity(PyObject* self)
{
PyObject *retVal = PyList_New(3);
- PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
- PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1]));
- PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2]));
+ PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
+ PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1]));
+ PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2]));
return retVal;
}
@@ -326,12 +316,10 @@ char KX_SCA_AddObjectActuator::SetLinearVelocity_doc[] =
"\t- vx: float\n"
"\t- vy: float\n"
"\t- vz: float\n"
+"\t- local: bool\n"
"\tAssign this velocity to the created object. \n";
-
-PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* self, PyObject* args)
{
float vecArg[3];
@@ -339,7 +327,46 @@ PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* self,
return NULL;
m_linear_velocity.setValue(vecArg);
- Py_Return;
+ Py_RETURN_NONE;
+}
+
+/* 7. getAngularVelocity */
+char KX_SCA_AddObjectActuator::GetAngularVelocity_doc[] =
+"GetAngularVelocity()\n"
+"\tReturns the angular velocity that will be assigned to \n"
+"\tthe created object.\n";
+
+PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity(PyObject* self)
+{
+ PyObject *retVal = PyList_New(3);
+
+ PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
+ PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1]));
+ PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2]));
+
+ return retVal;
+}
+
+
+
+/* 8. setAngularVelocity */
+char KX_SCA_AddObjectActuator::SetAngularVelocity_doc[] =
+"setAngularVelocity(vx, vy, vz)\n"
+"\t- vx: float\n"
+"\t- vy: float\n"
+"\t- vz: float\n"
+"\t- local: bool\n"
+"\tAssign this angular velocity to the created object. \n";
+
+PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* self, PyObject* args)
+{
+
+ float vecArg[3];
+ if (!PyArg_ParseTuple(args, "fff", &vecArg[0], &vecArg[1], &vecArg[2]))
+ return NULL;
+
+ m_angular_velocity.setValue(vecArg);
+ Py_RETURN_NONE;
}
void KX_SCA_AddObjectActuator::InstantAddObject()
@@ -350,8 +377,9 @@ void KX_SCA_AddObjectActuator::InstantAddObject()
// Now it needs to be added to the current scene.
SCA_IObject* replica = m_scene->AddReplicaObject(m_OriginalObject,GetParent(),m_timeProp );
KX_GameObject * game_obj = static_cast<KX_GameObject *>(replica);
- game_obj->setLinearVelocity(m_linear_velocity,m_localFlag);
- game_obj->ResolveCombinedVelocities(m_linear_velocity, MT_Vector3(0., 0., 0.), m_localFlag, false);
+ game_obj->setLinearVelocity(m_linear_velocity,m_localLinvFlag);
+ game_obj->setAngularVelocity(m_angular_velocity,m_localAngvFlag);
+ game_obj->ResolveCombinedVelocities(m_linear_velocity, m_angular_velocity, m_localLinvFlag, m_localAngvFlag);
// keep a copy of the last object, to allow python scripters to change it
if (m_lastCreatedObject)
@@ -368,13 +396,11 @@ void KX_SCA_AddObjectActuator::InstantAddObject()
}
}
-PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject(PyObject* self)
{
InstantAddObject();
- Py_Return;
+ Py_RETURN_NONE;
}
@@ -385,16 +411,17 @@ char KX_SCA_AddObjectActuator::GetLastCreatedObject_doc[] =
"\tReturn the last created object. \n";
-PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject(PyObject* self)
{
SCA_IObject* result = this->GetLastCreatedObject();
- if (result)
+
+ // if result->GetSGNode() is NULL
+ // it means the object has ended, The BGE python api crashes in many places if the object is returned.
+ if (result && (static_cast<KX_GameObject *>(result))->GetSGNode())
{
result->AddRef();
return result;
}
// don't return NULL to python anymore, it gives trouble in the scripts
- Py_Return;
+ Py_RETURN_NONE;
}
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
index 1359f39278d..278d4180284 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
@@ -60,9 +60,13 @@ class KX_SCA_AddObjectActuator : public SCA_IActuator
/// Linear velocity upon creation of the object.
MT_Vector3 m_linear_velocity;
+
+ /// Angular velocity upon creation of the object.
+ MT_Vector3 m_angular_velocity;
/// Apply the velocity locally
- bool m_localFlag;
+ bool m_localLinvFlag;
+ bool m_localAngvFlag;
SCA_IObject* m_lastCreatedObject;
@@ -79,7 +83,9 @@ public:
int time,
SCA_IScene* scene,
const MT_Vector3& linvel,
- bool local,
+ bool linv_local,
+ const MT_Vector3& angvel,
+ bool angv_local,
PyTypeObject* T=&Type
);
@@ -113,21 +119,25 @@ public:
void InstantAddObject();
/* 1. setObject */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,SetObject);
+ KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetObject);
/* 2. setTime */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,SetTime);
+ KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetTime);
/* 3. getTime */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetTime);
+ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetTime);
/* 4. getObject */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetObject);
+ KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,GetObject);
/* 5. getLinearVelocity */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetLinearVelocity);
+ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLinearVelocity);
/* 6. setLinearVelocity */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,SetLinearVelocity);
- /* 7. getLastCreatedObject */
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,GetLastCreatedObject);
- /* 8. instantAddObject*/
- KX_PYMETHOD_DOC(KX_SCA_AddObjectActuator,InstantAddObject);
+ KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetLinearVelocity);
+ /* 7. getAngularVelocity */
+ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetAngularVelocity);
+ /* 8. setAngularVelocity */
+ KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetAngularVelocity);
+ /* 9. getLastCreatedObject */
+ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLastCreatedObject);
+ /* 10. instantAddObject*/
+ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject);
}; /* end of class KX_SCA_AddObjectActuator : public KX_EditObjectActuator */
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
index 630df2d21d9..e1f11732085 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
@@ -37,6 +37,8 @@
#include "KX_SCA_ReplaceMeshActuator.h"
+#include "PyObjectPlus.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -80,7 +82,7 @@ PyParentObject KX_SCA_ReplaceMeshActuator::Parents[] = {
PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = {
- {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_VARARGS, SetMesh_doc},
+ {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, SetMesh_doc},
KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh),
KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh),
@@ -99,28 +101,29 @@ PyObject* KX_SCA_ReplaceMeshActuator::_getattr(const STR_String& attr)
/* 1. setMesh */
char KX_SCA_ReplaceMeshActuator::SetMesh_doc[] =
"setMesh(name)\n"
- "\t- name: string\n"
+ "\t- name: string or None\n"
"\tSet the mesh that will be substituted for the current one.\n";
-PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* self,
- PyObject* args,
- PyObject* kwds)
+PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* self, PyObject* value)
{
- char* meshname;
-
- if (!PyArg_ParseTuple(args, "s", &meshname))
- {
- return NULL;
- }
-
- void* mesh = SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String(meshname));
-
- if (mesh) {
+ if (value == Py_None) {
+ m_mesh = NULL;
+ } else {
+ char* meshname = PyString_AsString(value);
+ if (!meshname) {
+ PyErr_SetString(PyExc_ValueError, "Expected the name of a mesh or None");
+ return NULL;
+ }
+ void* mesh = SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String(meshname));
+
+ if (mesh==NULL) {
+ PyErr_SetString(PyExc_ValueError, "The mesh name given does not exist");
+ return NULL;
+ }
m_mesh= (class RAS_MeshObject*)mesh;
- Py_Return;
}
- return NULL;
+ Py_RETURN_NONE;
}
KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh,
@@ -129,7 +132,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh,
)
{
if (!m_mesh)
- Py_Return;
+ Py_RETURN_NONE;
return PyString_FromString(const_cast<char *>(m_mesh->GetName().ReadPtr()));
}
@@ -139,7 +142,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh,
"instantReplaceMesh() : immediately replace mesh without delay\n")
{
InstantReplaceMesh();
- Py_Return;
+ Py_RETURN_NONE;
}
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
index 5ba0a099b14..1da154cc222 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
@@ -76,7 +76,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
void InstantReplaceMesh();
/* 1. setMesh */
- KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,SetMesh);
+ KX_PYMETHOD_DOC_O(KX_SCA_ReplaceMeshActuator,SetMesh);
KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,getMesh);
KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh);
diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
index f085ff435dc..d651373869a 100644
--- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
+++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
@@ -78,7 +78,7 @@ UpdateChildCoordinates(
if (parent)
{
- const BL_ArmatureObject *armature = (const BL_ArmatureObject*)(parent->GetSGClientObject());
+ BL_ArmatureObject *armature = (BL_ArmatureObject*)(parent->GetSGClientObject());
if (armature)
{
MT_Matrix4x4 parent_matrix;
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index c374b9d6fd1..72875bbc039 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -37,6 +37,7 @@
#include "MT_assert.h"
#include "KX_KetsjiEngine.h"
+#include "KX_BlenderMaterial.h"
#include "RAS_IPolygonMaterial.h"
#include "ListValue.h"
#include "SCA_LogicManager.h"
@@ -67,6 +68,7 @@
#include "SG_IObject.h"
#include "SG_Tree.h"
#include "DNA_group_types.h"
+#include "DNA_scene_types.h"
#include "BKE_anim.h"
#include "KX_SG_NodeRelationships.h"
@@ -92,6 +94,9 @@ void* KX_SceneReplicationFunc(SG_IObject* node,void* gameobj,void* scene)
{
KX_GameObject* replica = ((KX_Scene*)scene)->AddNodeReplicaObject(node,(KX_GameObject*)gameobj);
+ if(replica)
+ replica->Release();
+
return (void*)replica;
}
@@ -112,17 +117,19 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
class SCA_IInputDevice* mousedevice,
class NG_NetworkDeviceInterface *ndi,
class SND_IAudioDevice* adi,
- const STR_String& sceneName):
+ const STR_String& sceneName,
+ Scene *scene):
PyObjectPlus(&KX_Scene::Type),
m_keyboardmgr(NULL),
m_mousemgr(NULL),
+ m_sceneConverter(NULL),
m_physicsEnvironment(0),
m_sceneName(sceneName),
m_adi(adi),
m_networkDeviceInterface(ndi),
m_active_camera(NULL),
m_ueberExecutionPriority(0),
- m_sceneConverter(NULL)
+ m_blenderScene(scene)
{
m_suspendedtime = 0.0;
m_suspendeddelta = 0.0;
@@ -230,40 +237,9 @@ KX_Scene::~KX_Scene()
{
delete m_bucketmanager;
}
-#ifdef USE_BULLET
- // This is a fix for memory leaks in bullet: the collision shapes is not destroyed
- // when the physical controllers are destroyed. The reason is that shapes are shared
- // between replicas of an object. There is no reference count in Bullet so the
- // only workaround that does not involve changes in Bullet is to save in this array
- // the list of shapes that are created when the scene is created (see KX_ConvertPhysicsObjects.cpp)
- class btCollisionShape* shape;
- class btTriangleMeshShape* meshShape;
- vector<class btCollisionShape*>::iterator it = m_shapes.begin();
- while (it != m_shapes.end()) {
- shape = *it;
- if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
- {
- meshShape = static_cast<btTriangleMeshShape*>(shape);
- // shapes based on meshes use an interface that contains the vertices.
- // Again the idea is to be able to share the interface between shapes but
- // this is not used in Blender: each base object will have its own interface
- btStridingMeshInterface* meshInterface = meshShape->getMeshInterface();
- if (meshInterface)
- delete meshInterface;
- }
- delete shape;
- it++;
- }
-#endif
//Py_DECREF(m_attrlist);
}
-void KX_Scene::AddShape(class btCollisionShape*shape)
-{
- m_shapes.push_back(shape);
-}
-
-
void KX_Scene::SetProjectionMatrix(MT_CmMatrix4x4& pmat)
{
m_projectionmat = pmat;
@@ -480,7 +456,7 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal
// this is the list of object that are send to the graphics pipeline
m_objectlist->Add(newobj->AddRef());
- newobj->Bucketize();
+ newobj->AddMeshUser();
// logic cannot be replicated, until the whole hierarchy is replicated.
m_logicHierarchicalGameObjects.push_back(newobj);
@@ -650,14 +626,18 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level)
if (blgroupobj == blenderobj)
// this check is also in group_duplilist()
continue;
- gameobj = m_sceneConverter->FindGameObject(blenderobj);
+
+ gameobj = (KX_GameObject*)m_logicmgr->FindGameObjByBlendObj(blenderobj);
if (gameobj == NULL)
{
// this object has not been converted!!!
// Should not happen as dupli group are created automatically
continue;
}
- if (blenderobj->lay & group->layer==0)
+
+ gameobj->SetBlenderGroupObject(blgroupobj);
+
+ if ((blenderobj->lay & group->layer)==0)
{
// object is not visible in the 3D view, will not be instantiated
continue;
@@ -669,8 +649,12 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level)
for (oit=m_groupGameObjects.begin(); oit != m_groupGameObjects.end(); oit++)
{
gameobj = (KX_GameObject*)(*oit);
- if (gameobj->GetParent() != NULL)
+
+ KX_GameObject *parent = gameobj->GetParent();
+ if (parent != NULL)
{
+ parent->Release(); // GetParent() increased the refcount
+
// this object is not a top parent. Either it is the child of another
// object in the group and it will be added automatically when the parent
// is added. Or it is the child of an object outside the group and the group
@@ -860,6 +844,20 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject,
replica->GetSGNode()->UpdateWorldData(0);
replica->GetSGNode()->SetBBox(originalobj->GetSGNode()->BBox());
replica->GetSGNode()->SetRadius(originalobj->GetSGNode()->Radius());
+ // check if there are objects with dupligroup in the hierarchy
+ vector<KX_GameObject*> duplilist;
+ for (git = m_logicHierarchicalGameObjects.begin();!(git==m_logicHierarchicalGameObjects.end());++git)
+ {
+ if ((*git)->IsDupliGroup())
+ {
+ // separate list as m_logicHierarchicalGameObjects is also used by DupliGroupRecurse()
+ duplilist.push_back(*git);
+ }
+ }
+ for (git = duplilist.begin();!(git==duplilist.end());++git)
+ {
+ DupliGroupRecurse(*git, 0);
+ }
// don't release replica here because we are returning it, not done with it...
return replica;
}
@@ -906,6 +904,12 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
int ret;
KX_GameObject* newobj = (KX_GameObject*) gameobj;
+ // keep the blender->game object association up to date
+ // note that all the replicas of an object will have the same
+ // blender object, that's why we need to check the game object
+ // as only the deletion of the original object must be recorded
+ m_logicmgr->UnregisterGameObj(newobj->GetBlenderObject(), gameobj);
+
//todo: look at this
//GetPhysicsEnvironment()->RemovePhysicsController(gameobj->getPhysicsController());
@@ -947,6 +951,8 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
newobj->RemoveMeshes();
ret = 1;
+ if (m_lightlist->RemoveValue(newobj)) // TODO - use newobj->IsLight() test when its merged in from apricot. - Campbell
+ ret = newobj->Release();
if (m_objectlist->RemoveValue(newobj))
ret = newobj->Release();
if (m_tempObjectList->RemoveValue(newobj))
@@ -964,6 +970,7 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
//m_active_camera->Release();
m_active_camera = NULL;
}
+
// in case this is a camera
m_cameras.remove((KX_Camera*)newobj);
@@ -999,7 +1006,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj)
newobj->m_pDeformer = NULL;
}
- if (mesh->m_class == 1)
+ if (mesh->IsDeformed())
{
// we must create a new deformer but which one?
KX_GameObject* parentobj = newobj->GetParent();
@@ -1073,7 +1080,8 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj)
parentobj->Release();
}
}
- gameobj->Bucketize();
+
+ gameobj->AddMeshUser();
}
@@ -1220,16 +1228,14 @@ void KX_Scene::MarkSubTreeVisible(SG_Tree *node, RAS_IRasterizer* rasty, bool vi
if (visible)
{
int nummeshes = gameobj->GetMeshCount();
- MT_Transform t( cam->GetWorldToCamera() * gameobj->GetSGNode()->GetWorldTransform());
-
+ // this adds the vertices to the display list
for (int m=0;m<nummeshes;m++)
- {
- // this adds the vertices to the display list
- (gameobj->GetMesh(m))->SchedulePolygons(t, rasty->GetDrawingMode());
- }
+ (gameobj->GetMesh(m))->SchedulePolygons(rasty->GetDrawingMode());
}
- gameobj->MarkVisible(visible);
+
+ gameobj->SetCulled(!visible);
+ gameobj->UpdateBuckets(false);
}
}
if (node->Left())
@@ -1246,7 +1252,8 @@ void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Cam
// Shadow lamp layers
if(layer && !(gameobj->GetLayer() & layer)) {
- gameobj->MarkVisible(false);
+ gameobj->SetCulled(true);
+ gameobj->UpdateBuckets(false);
return;
}
@@ -1284,18 +1291,19 @@ void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Cam
if (vis)
{
int nummeshes = gameobj->GetMeshCount();
- MT_Transform t(cam->GetWorldToCamera() * gameobj->GetSGNode()->GetWorldTransform());
for (int m=0;m<nummeshes;m++)
{
// this adds the vertices to the display list
- (gameobj->GetMesh(m))->SchedulePolygons(t, rasty->GetDrawingMode());
+ (gameobj->GetMesh(m))->SchedulePolygons(rasty->GetDrawingMode());
}
// Visibility/ non-visibility are marked
// elsewhere now.
- gameobj->MarkVisible();
+ gameobj->SetCulled(false);
+ gameobj->UpdateBuckets(false);
} else {
- gameobj->MarkVisible(false);
+ gameobj->SetCulled(true);
+ gameobj->UpdateBuckets(false);
}
}
@@ -1402,7 +1410,7 @@ void KX_Scene::UpdateParents(double curtime)
RAS_MaterialBucket* KX_Scene::FindBucket(class RAS_IPolyMaterial* polymat, bool &bucketCreated)
{
- return m_bucketmanager->RAS_BucketManagerFindBucket(polymat, bucketCreated);
+ return m_bucketmanager->FindBucket(polymat, bucketCreated);
}
@@ -1412,10 +1420,9 @@ void KX_Scene::RenderBuckets(const MT_Transform & cameratransform,
class RAS_IRenderTools* rendertools)
{
m_bucketmanager->Renderbuckets(cameratransform,rasty,rendertools);
+ KX_BlenderMaterial::EndFrame();
}
-
-
void KX_Scene::UpdateObjectActivity(void)
{
if (m_activity_culling) {
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 80a2abe287a..5f7e1167e27 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -54,6 +54,7 @@
*/
struct SM_MaterialProps;
struct SM_ShapeProps;
+struct Scene;
class GEN_HashedPtr;
class CListValue;
@@ -122,11 +123,6 @@ protected:
*/
list<class KX_Camera*> m_cameras;
/**
- * The set of bullet shapes that must be deleted at the end of the scene
- * to avoid memory leak (not deleted by bullet because shape are shared between replicas)
- */
- vector<class btCollisionShape*> m_shapes;
- /**
* Various SCA managers used by the scene
*/
SCA_LogicManager* m_logicmgr;
@@ -282,12 +278,15 @@ protected:
*/
PyObject* m_attrlist;
+ struct Scene* m_blenderScene;
+
public:
KX_Scene(class SCA_IInputDevice* keyboarddevice,
class SCA_IInputDevice* mousedevice,
class NG_NetworkDeviceInterface* ndi,
class SND_IAudioDevice* adi,
- const STR_String& scenename );
+ const STR_String& scenename,
+ struct Scene* scene);
virtual
~KX_Scene();
@@ -322,7 +321,6 @@ public:
int NewRemoveObject(CValue* gameobj);
void ReplaceMesh(CValue* gameobj,
void* meshobj);
- void AddShape(class btCollisionShape* shape);
/**
* @section Logic stuff
* Initiate an update of the logic system.
@@ -588,6 +586,10 @@ public:
* was running and not suspended) and the "curtime"
*/
double getSuspendedDelta();
+ /**
+ * Returns the Blender scene this was made from
+ */
+ struct Scene *GetBlenderScene() { return m_blenderScene; }
};
typedef std::vector<KX_Scene*> KX_SceneList;
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 34a3baec093..f75a1ee5c62 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -69,11 +69,11 @@ KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj,
KX_SoundActuator::~KX_SoundActuator()
{
- //m_soundScene->RemoveObject(this->m_soundObject);
- //(this->m_soundObject)->DeleteWhenFinished();
- m_soundScene->RemoveActiveObject(m_soundObject);
-// m_soundScene->DeleteObjectWhenFinished(m_soundObject);
- m_soundScene->DeleteObject(m_soundObject);
+ if (m_soundObject)
+ {
+ m_soundScene->RemoveActiveObject(m_soundObject);
+ m_soundScene->DeleteObject(m_soundObject);
+ }
}
@@ -82,9 +82,12 @@ CValue* KX_SoundActuator::GetReplica()
{
KX_SoundActuator* replica = new KX_SoundActuator(*this);
replica->ProcessReplica();
- SND_SoundObject* soundobj = new SND_SoundObject(*m_soundObject);
- replica->setSoundObject(soundobj);
- m_soundScene->AddObject(soundobj);
+ if (m_soundObject)
+ {
+ SND_SoundObject* soundobj = new SND_SoundObject(*m_soundObject);
+ replica->setSoundObject(soundobj);
+ m_soundScene->AddObject(soundobj);
+ }
// this will copy properties and so on...
CValue::AddDataToReplica(replica);
@@ -104,6 +107,9 @@ bool KX_SoundActuator::Update(double curtime, bool frame)
RemoveAllEvents();
+ if (!m_soundObject)
+ return false;
+
if (m_pino)
{
bNegativeEvent = true;
@@ -287,6 +293,10 @@ PyObject* KX_SoundActuator::PySetFilename(PyObject* self, PyObject* args, PyObje
PyObject* KX_SoundActuator::PyGetFilename(PyObject* self, PyObject* args, PyObject* kwds)
{
+ if (!m_soundObject)
+ {
+ return PyString_FromString("");
+ }
STR_String objectname = m_soundObject->GetObjectName();
char* name = objectname.Ptr();
@@ -301,7 +311,8 @@ PyObject* KX_SoundActuator::PyGetFilename(PyObject* self, PyObject* args, PyObje
PyObject* KX_SoundActuator::PyStartSound(PyObject* self, PyObject* args, PyObject* kwds)
{
- m_soundObject->StartSound();
+ if (m_soundObject)
+ m_soundObject->StartSound();
Py_Return;
}
@@ -309,7 +320,8 @@ PyObject* KX_SoundActuator::PyStartSound(PyObject* self, PyObject* args, PyObjec
PyObject* KX_SoundActuator::PyPauseSound(PyObject* self, PyObject* args, PyObject* kwds)
{
- m_soundObject->PauseSound();
+ if (m_soundObject)
+ m_soundObject->PauseSound();
Py_Return;
}
@@ -317,7 +329,8 @@ PyObject* KX_SoundActuator::PyPauseSound(PyObject* self, PyObject* args, PyObjec
PyObject* KX_SoundActuator::PyStopSound(PyObject* self, PyObject* args, PyObject* kwds)
{
- m_soundObject->StopSound();
+ if (m_soundObject)
+ m_soundObject->StopSound();
Py_Return;
}
@@ -329,7 +342,8 @@ PyObject* KX_SoundActuator::PySetGain(PyObject* self, PyObject* args, PyObject*
if (!PyArg_ParseTuple(args, "f", &gain))
return NULL;
- m_soundObject->SetGain(gain);
+ if (m_soundObject)
+ m_soundObject->SetGain(gain);
Py_Return;
}
@@ -338,7 +352,7 @@ PyObject* KX_SoundActuator::PySetGain(PyObject* self, PyObject* args, PyObject*
PyObject* KX_SoundActuator::PyGetGain(PyObject* self, PyObject* args, PyObject* kwds)
{
- float gain = m_soundObject->GetGain();
+ float gain = (m_soundObject) ? m_soundObject->GetGain() : 1.0f;
PyObject* result = PyFloat_FromDouble(gain);
return result;
@@ -352,7 +366,8 @@ PyObject* KX_SoundActuator::PySetPitch(PyObject* self, PyObject* args, PyObject*
if (!PyArg_ParseTuple(args, "f", &pitch))
return NULL;
- m_soundObject->SetPitch(pitch);
+ if (m_soundObject)
+ m_soundObject->SetPitch(pitch);
Py_Return;
}
@@ -361,7 +376,7 @@ PyObject* KX_SoundActuator::PySetPitch(PyObject* self, PyObject* args, PyObject*
PyObject* KX_SoundActuator::PyGetPitch(PyObject* self, PyObject* args, PyObject* kwds)
{
- float pitch = m_soundObject->GetPitch();
+ float pitch = (m_soundObject) ? m_soundObject->GetPitch() : 1.0;
PyObject* result = PyFloat_FromDouble(pitch);
return result;
@@ -375,7 +390,8 @@ PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* self, PyObject* args, P
if (!PyArg_ParseTuple(args, "f", &rollofffactor))
return NULL;
- m_soundObject->SetRollOffFactor(rollofffactor);
+ if (m_soundObject)
+ m_soundObject->SetRollOffFactor(rollofffactor);
Py_Return;
}
@@ -384,7 +400,7 @@ PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* self, PyObject* args, P
PyObject* KX_SoundActuator::PyGetRollOffFactor(PyObject* self, PyObject* args, PyObject* kwds)
{
- float rollofffactor = m_soundObject->GetRollOffFactor();
+ float rollofffactor = (m_soundObject) ? m_soundObject->GetRollOffFactor() : 1.0;
PyObject* result = PyFloat_FromDouble(rollofffactor);
return result;
@@ -398,7 +414,8 @@ PyObject* KX_SoundActuator::PySetLooping(PyObject* self, PyObject* args, PyObjec
if (!PyArg_ParseTuple(args, "i", &looping))
return NULL;
- m_soundObject->SetLoopMode(looping);
+ if (m_soundObject)
+ m_soundObject->SetLoopMode(looping);
Py_Return;
}
@@ -407,7 +424,7 @@ PyObject* KX_SoundActuator::PySetLooping(PyObject* self, PyObject* args, PyObjec
PyObject* KX_SoundActuator::PyGetLooping(PyObject* self, PyObject* args, PyObject* kwds)
{
- int looping = m_soundObject->GetLoopMode();
+ int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : SND_LOOP_OFF;
PyObject* result = PyInt_FromLong(looping);
return result;
@@ -425,7 +442,8 @@ PyObject* KX_SoundActuator::PySetPosition(PyObject* self, PyObject* args, PyObje
if (!PyArg_ParseTuple(args, "fff", &pos[0], &pos[1], &pos[2]))
return NULL;
- m_soundObject->SetPosition(pos);
+ if (m_soundObject)
+ m_soundObject->SetPosition(pos);
Py_Return;
}
@@ -442,7 +460,8 @@ PyObject* KX_SoundActuator::PySetVelocity(PyObject* self, PyObject* args, PyObje
if (!PyArg_ParseTuple(args, "fff", &vel[0], &vel[1], &vel[2]))
return NULL;
- m_soundObject->SetVelocity(vel);
+ if (m_soundObject)
+ m_soundObject->SetVelocity(vel);
Py_Return;
}
@@ -465,7 +484,8 @@ PyObject* KX_SoundActuator::PySetOrientation(PyObject* self, PyObject* args, PyO
if (!PyArg_ParseTuple(args, "fffffffff", &ori[0][0], &ori[0][1], &ori[0][2], &ori[1][0], &ori[1][1], &ori[1][2], &ori[2][0], &ori[2][1], &ori[2][2]))
return NULL;
- m_soundObject->SetOrientation(ori);
+ if (m_soundObject)
+ m_soundObject->SetOrientation(ori);
Py_Return;
}
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp
index 423543eef5c..48d4cf59a2b 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp
@@ -100,16 +100,24 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data,
void KX_TouchEventManager::RegisterSensor(SCA_ISensor* sensor)
{
KX_TouchSensor* touchsensor = static_cast<KX_TouchSensor*>(sensor);
- m_sensors.push_back(touchsensor);
+ if (m_sensors.insert(touchsensor).second)
+ // the sensor was effectively inserted, register it
+ touchsensor->RegisterSumo(this);
+}
- touchsensor->RegisterSumo(this);
+void KX_TouchEventManager::RemoveSensor(SCA_ISensor* sensor)
+{
+ KX_TouchSensor* touchsensor = static_cast<KX_TouchSensor*>(sensor);
+ if (m_sensors.erase(touchsensor))
+ // the sensor was effectively removed, unregister it
+ touchsensor->UnregisterSumo(this);
}
void KX_TouchEventManager::EndFrame()
{
- vector<SCA_ISensor*>::iterator it;
+ set<SCA_ISensor*>::iterator it;
for ( it = m_sensors.begin();
!(it==m_sensors.end());it++)
{
@@ -124,7 +132,7 @@ void KX_TouchEventManager::NextFrame()
{
if (m_sensors.size() > 0)
{
- vector<SCA_ISensor*>::iterator it;
+ set<SCA_ISensor*>::iterator it;
for (it = m_sensors.begin();!(it==m_sensors.end());++it)
static_cast<KX_TouchSensor*>(*it)->SynchronizeTransform();
@@ -157,20 +165,3 @@ void KX_TouchEventManager::NextFrame()
(*it)->Activate(m_logicmgr,NULL);
}
}
-
-
-
-void KX_TouchEventManager::RemoveSensor(class SCA_ISensor* sensor)
-{
- std::vector<SCA_ISensor*>::iterator i =
- std::find(m_sensors.begin(), m_sensors.end(), sensor);
- if (!(i == m_sensors.end()))
- {
- std::swap(*i, m_sensors.back());
- m_sensors.pop_back();
- }
-
- // remove the sensor forever :)
- SCA_EventManager::RemoveSensor(sensor);
-}
-
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h
index 20ed6126bd0..cc77bccfc31 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.h
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.h
@@ -71,8 +71,8 @@ public:
PHY_IPhysicsEnvironment* physEnv);
virtual void NextFrame();
virtual void EndFrame();
- virtual void RemoveSensor(class SCA_ISensor* sensor);
virtual void RegisterSensor(SCA_ISensor* sensor);
+ virtual void RemoveSensor(SCA_ISensor* sensor);
SCA_LogicManager* GetLogicManager() { return m_logicmgr;}
PHY_IPhysicsEnvironment *GetPhysicsEnvironment() { return m_physEnv; }
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp
index ce3aa1de2ef..60e1d87d318 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.cpp
+++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp
@@ -153,6 +153,14 @@ void KX_TouchSensor::RegisterSumo(KX_TouchEventManager *touchman)
}
}
+void KX_TouchSensor::UnregisterSumo(KX_TouchEventManager* touchman)
+{
+ if (m_physCtrl)
+ {
+ touchman->GetPhysicsEnvironment()->removeCollisionCallback(m_physCtrl);
+ }
+}
+
bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_CollData* colldata)
{
// KX_TouchEventManager* toucheventmgr = (KX_TouchEventManager*)m_eventmgr;
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h
index 056440ccd6c..b611d296939 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.h
+++ b/source/gameengine/Ketsji/KX_TouchSensor.h
@@ -76,6 +76,7 @@ public:
virtual void ReParent(SCA_IObject* parent);
virtual void RegisterSumo(KX_TouchEventManager* touchman);
+ virtual void UnregisterSumo(KX_TouchEventManager* touchman);
// virtual DT_Bool HandleCollision(void* obj1,void* obj2,
// const DT_CollData * coll_data);
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
index c580aa4d4e5..8b09cd4e953 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
@@ -42,6 +42,8 @@
#include <iostream>
#include "KX_GameObject.h"
+#include "PyObjectPlus.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -146,19 +148,19 @@ void compatible_eulFast(float *eul, float *oldrot)
{
float dx, dy, dz;
- /* verschillen van ong 360 graden corrigeren */
+ /* angular difference of 360 degrees */
dx= eul[0] - oldrot[0];
dy= eul[1] - oldrot[1];
dz= eul[2] - oldrot[2];
- if( fabs(dx) > 5.1) {
+ if( fabs(dx) > MT_PI) {
if(dx > 0.0) eul[0] -= MT_2_PI; else eul[0]+= MT_2_PI;
}
- if( fabs(dy) > 5.1) {
+ if( fabs(dy) > MT_PI) {
if(dy > 0.0) eul[1] -= MT_2_PI; else eul[1]+= MT_2_PI;
}
- if( fabs(dz) > 5.1 ) {
+ if( fabs(dz) > MT_PI ) {
if(dz > 0.0) eul[2] -= MT_2_PI; else eul[2]+= MT_2_PI;
}
}
@@ -195,6 +197,8 @@ void KX_TrackToActuator::ProcessReplica()
// the replica is tracking the same object => register it
if (m_object)
m_object->RegisterActuator(this);
+ if (m_parentobj)
+ m_parentobj->AddRef();
SCA_IActuator::ProcessReplica();
}
@@ -219,6 +223,14 @@ void KX_TrackToActuator::Relink(GEN_Map<GEN_HashedPtr, void*> *obj_map)
m_object = (SCA_IObject*)(*h_obj);
m_object->RegisterActuator(this);
}
+
+ void **h_parobj = (*obj_map)[m_parentobj];
+ if (h_parobj) {
+ if (m_parentobj)
+ m_parentobj->Release();
+ m_parentobj= (KX_GameObject*)(*h_parobj);
+ m_parentobj->AddRef();
+ }
}
@@ -444,7 +456,7 @@ PyParentObject KX_TrackToActuator::Parents[] = {
PyMethodDef KX_TrackToActuator::Methods[] = {
- {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_VARARGS, SetObject_doc},
+ {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, SetObject_doc},
{"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, GetObject_doc},
{"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, SetTime_doc},
{"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_VARARGS, GetTime_doc},
@@ -465,47 +477,45 @@ PyObject* KX_TrackToActuator::_getattr(const STR_String& attr)
/* 1. setObject */
char KX_TrackToActuator::SetObject_doc[] =
"setObject(object)\n"
-"\t- object: string\n"
+"\t- object: KX_GameObject, string or None\n"
"\tSet the object to track with the parent of this actuator.\n";
-PyObject* KX_TrackToActuator::PySetObject(PyObject* self, PyObject* args, PyObject* kwds) {
- PyObject* gameobj;
- if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj))
- {
- if (m_object != NULL)
- m_object->UnregisterActuator(this);
- m_object = (SCA_IObject*)gameobj;
- if (m_object)
- m_object->RegisterActuator(this);
- Py_Return;
- }
- PyErr_Clear();
+PyObject* KX_TrackToActuator::PySetObject(PyObject* self, PyObject* value)
+{
+ KX_GameObject *gameobj;
- char* objectname;
- if (PyArg_ParseTuple(args, "s", &objectname))
- {
- if (m_object != NULL)
- m_object->UnregisterActuator(this);
- m_object= static_cast<SCA_IObject*>(SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname)));
- if (m_object)
- m_object->RegisterActuator(this);
- Py_Return;
- }
+ if (!ConvertPythonToGameObject(value, &gameobj, true))
+ return NULL; // ConvertPythonToGameObject sets the error
+
+ if (m_object != NULL)
+ m_object->UnregisterActuator(this);
+
+ m_object = (SCA_IObject*)gameobj;
+ if (m_object)
+ m_object->RegisterActuator(this);
- return NULL;
+ Py_RETURN_NONE;
}
/* 2. getObject */
char KX_TrackToActuator::GetObject_doc[] =
-"getObject()\n"
-"\tReturns the object to track with the parent of this actuator.\n";
-PyObject* KX_TrackToActuator::PyGetObject(PyObject* self, PyObject* args, PyObject* kwds)
+"getObject(name_only = 1)\n"
+"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
+"\tReturns the object to track with the parent of this actuator\n";
+PyObject* KX_TrackToActuator::PyGetObject(PyObject* self, PyObject* args)
{
+ int ret_name_only = 1;
+ if (!PyArg_ParseTuple(args, "|i", &ret_name_only))
+ return NULL;
+
if (!m_object)
- Py_Return;
-
- return PyString_FromString(m_object->GetName());
+ Py_RETURN_NONE;
+
+ if (ret_name_only)
+ return PyString_FromString(m_object->GetName());
+ else
+ return m_object->AddRef();
}
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h
index 1d1cf46d21b..445132a6094 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.h
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.h
@@ -75,9 +75,9 @@ class KX_TrackToActuator : public SCA_IActuator
virtual PyObject* _getattr(const STR_String& attr);
/* 1. setObject */
- KX_PYMETHOD_DOC(KX_TrackToActuator,SetObject);
+ KX_PYMETHOD_DOC_O(KX_TrackToActuator,SetObject);
/* 2. getObject */
- KX_PYMETHOD_DOC(KX_TrackToActuator,GetObject);
+ KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject);
/* 3. setTime */
KX_PYMETHOD_DOC(KX_TrackToActuator,SetTime);
/* 4. getTime */
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 7e8160a4d67..342e71c5093 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -1,6 +1,8 @@
#include <Python.h>
+#include "PyObjectPlus.h"
+
#include "KX_VehicleWrapper.h"
#include "PHY_IPhysicsEnvironment.h"
#include "PHY_IVehicle.h"
@@ -71,8 +73,7 @@ PyObject* KX_VehicleWrapper::PyAddWheel(PyObject* self,
} else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -157,8 +158,7 @@ PyObject* KX_VehicleWrapper::PyApplyEngineForce(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self,
@@ -175,8 +175,7 @@ PyObject* KX_VehicleWrapper::PySetTyreFriction(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self,
@@ -193,8 +192,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionStiffness(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self,
@@ -210,8 +208,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionDamping(PyObject* self,
} else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self,
@@ -227,8 +224,7 @@ PyObject* KX_VehicleWrapper::PySetSuspensionCompression(PyObject* self,
} else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self,
@@ -245,8 +241,7 @@ PyObject* KX_VehicleWrapper::PySetRollInfluence(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -264,8 +259,7 @@ PyObject* KX_VehicleWrapper::PyApplyBraking(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -285,8 +279,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* self,
else {
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp
index 5cec65dff1c..25205714308 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.cpp
+++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp
@@ -82,7 +82,7 @@ PyObject*
KX_VertexProxy::_getattr(const STR_String& attr)
{
if (attr == "XYZ")
- return PyObjectFrom(MT_Vector3(m_vertex->getLocalXYZ()));
+ return PyObjectFrom(MT_Vector3(m_vertex->getXYZ()));
if (attr == "UV")
return PyObjectFrom(MT_Point2(m_vertex->getUV1()));
@@ -102,11 +102,11 @@ KX_VertexProxy::_getattr(const STR_String& attr)
// pos
if (attr == "x")
- return PyFloat_FromDouble(m_vertex->getLocalXYZ()[0]);
+ return PyFloat_FromDouble(m_vertex->getXYZ()[0]);
if (attr == "y")
- return PyFloat_FromDouble(m_vertex->getLocalXYZ()[1]);
+ return PyFloat_FromDouble(m_vertex->getXYZ()[1]);
if (attr == "z")
- return PyFloat_FromDouble(m_vertex->getLocalXYZ()[2]);
+ return PyFloat_FromDouble(m_vertex->getXYZ()[2]);
// Col
if (attr == "r")
@@ -184,7 +184,7 @@ int KX_VertexProxy::_setattr(const STR_String& attr, PyObject *pyvalue)
{
float val = PyFloat_AsDouble(pyvalue);
// pos
- MT_Point3 pos(m_vertex->getLocalXYZ());
+ MT_Point3 pos(m_vertex->getXYZ());
if (attr == "x")
{
pos.x() = val;
@@ -312,7 +312,7 @@ PyObject* KX_VertexProxy::PyGetXYZ(PyObject*,
PyObject*,
PyObject*)
{
- return PyObjectFrom(MT_Point3(m_vertex->getLocalXYZ()));
+ return PyObjectFrom(MT_Point3(m_vertex->getXYZ()));
}
PyObject* KX_VertexProxy::PySetXYZ(PyObject*,
@@ -426,7 +426,7 @@ PyObject* KX_VertexProxy::PySetUV2(PyObject*,
{
if (PyVecTo(list, vec))
{
- m_vertex->SetFlag((m_vertex->getFlag()|TV_2NDUV));
+ m_vertex->SetFlag((m_vertex->getFlag()|RAS_TexVert::SECOND_UV));
m_vertex->SetUnit(unit);
m_vertex->SetUV2(vec);
m_mesh->SetMeshModified(true);
diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
index b4693a7a7db..60ea6ace53b 100644
--- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
+++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp
@@ -38,10 +38,12 @@
KX_VisibilityActuator::KX_VisibilityActuator(
SCA_IObject* gameobj,
bool visible,
+ bool recursive,
PyTypeObject* T
)
: SCA_IActuator(gameobj,T),
- m_visible(visible)
+ m_visible(visible),
+ m_recursive(recursive)
{
// intentionally empty
}
@@ -75,8 +77,8 @@ KX_VisibilityActuator::Update()
KX_GameObject *obj = (KX_GameObject*) GetParent();
- obj->SetVisible(m_visible);
- obj->MarkVisible();
+ obj->SetVisible(m_visible, m_recursive);
+ obj->UpdateBuckets(m_recursive);
return true;
}
diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h
index 9b4753033fb..d1b85ab998c 100644
--- a/source/gameengine/Ketsji/KX_VisibilityActuator.h
+++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h
@@ -39,12 +39,14 @@ class KX_VisibilityActuator : public SCA_IActuator
/** Make visible? */
bool m_visible;
+ bool m_recursive;
public:
KX_VisibilityActuator(
SCA_IObject* gameobj,
bool visible,
+ bool recursive,
PyTypeObject* T=&Type
);
diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile
index 47a4855b00c..0b48ad8b8c3 100644
--- a/source/gameengine/Ketsji/Makefile
+++ b/source/gameengine/Ketsji/Makefile
@@ -35,10 +35,13 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+CPPFLAGS += $(NAN_SDLCFLAGS)
CPPFLAGS += $(OGL_CPPFLAGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
-CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -I../../blender/python
+CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
+CPPFLAGS += -I../../blender/python
+CPPFLAGS += -I../../blender/python/api2_2x
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include
@@ -61,13 +64,9 @@ CPPFLAGS += -I../../blender/blenlib
CPPFLAGS += -I../../blender/include
CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I../../blender/imbuf
+CPPFLAGS += -I../../blender/gpu
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-ifeq ($(WITH_BF_GLEXT),true)
- CPPFLAGS += -DWITH_GLEXT
-endif
-
-
###########################
SOURCEDIR = source/gameengine/Ketsji
diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript
index fdac5a71071..02e7aed82a5 100644
--- a/source/gameengine/Ketsji/SConscript
+++ b/source/gameengine/Ketsji/SConscript
@@ -5,7 +5,21 @@ Import ('env')
sources = env.Glob('*.cpp')
-incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
+# Mathutils C files.
+sources.extend([\
+ '#source/blender/python/api2_2x/Mathutils.c',\
+ '#source/blender/python/api2_2x/constant.c',\
+ '#source/blender/python/api2_2x/euler.c',\
+ '#source/blender/python/api2_2x/gen_utils.c',\
+ '#source/blender/python/api2_2x/matrix.c',\
+ '#source/blender/python/api2_2x/point.c',\
+ '#source/blender/python/api2_2x/quat.c',\
+ '#source/blender/python/api2_2x/vector.c',\
+])
+
+incs = '. #source/blender/python/api2_2x' # Only for Mathutils! - no other deps
+
+incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc'
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/openal'
incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter'
@@ -18,16 +32,13 @@ incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #sourc
incs += ' #source/gameengine/Physics/BlOde #source/gameengine/Physics/Dummy'
incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/include'
incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
-incs += ' #source/blender/misc #source/blender/blenloader #extern/glew/include'
+incs += ' #source/blender/misc #source/blender/blenloader #extern/glew/include #source/blender/gpu'
cflags = []
if env['OURPLATFORM'] == 'win32-vc':
cflags.append('/GR')
cflags.append('/Ox')
-if env['WITH_BF_GLEXT'] == 1:
- env['CPPFLAGS'].append('-DWITH_GLEXT')
-
incs += ' ' + env['BF_SOLID_INC']
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_SDL_INC']
diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
index a04560aaf09..6d9b41e08d2 100644
--- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
@@ -206,8 +206,7 @@ void ODEPhysicsEnvironment::removeConstraint(int constraintid)
}
}
-PHY_IPhysicsController* ODEPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient,float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)
+PHY_IPhysicsController* ODEPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ)
{
//m_OdeWorld
diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
index ec1b7702ffd..dcc87d614c0 100644
--- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
+++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
@@ -54,8 +54,7 @@ public:
float axisX,float axisY,float axisZ);
virtual void removeConstraint(void * constraintid);
- virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient,float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
+ virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
//gamelogic callbacks
@@ -65,6 +64,7 @@ public:
{
}
virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {}
+ virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {}
virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;}
virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;}
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt
index b610fd1bbb0..6c733786caf 100644
--- a/source/gameengine/Physics/Bullet/CMakeLists.txt
+++ b/source/gameengine/Physics/Bullet/CMakeLists.txt
@@ -30,6 +30,10 @@ SET(INC
.
../common
../../../../extern/bullet2/src
+ ../../../../intern/moto/include
+ ../../../kernel/gen_system
+ ../../../../intern/string
+ ../../Rasterizer
)
BLENDERLIB(bf_bullet "${SRC}" "${INC}")
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 5c70b071661..8fd89295b03 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -18,6 +18,7 @@ subject to the following restrictions:
#include "PHY_IMotionState.h"
#include "CcdPhysicsEnvironment.h"
+#include "RAS_MeshObject.h"
class BP_Proxy;
@@ -42,8 +43,20 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci)
{
m_collisionDelay = 0;
m_newClientInfo = 0;
-
+ m_registerCount = 0;
+
+ // copy pointers locally to allow smart release
m_MotionState = ci.m_MotionState;
+ m_collisionShape = ci.m_collisionShape;
+ // apply scaling before creating rigid body
+ m_collisionShape->setLocalScaling(m_cci.m_scaling);
+ if (m_cci.m_mass)
+ m_collisionShape->calculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor);
+ // shape info is shared, increment ref count
+ m_shapeInfo = ci.m_shapeInfo;
+ if (m_shapeInfo)
+ m_shapeInfo->AddRef();
+
m_bulletMotionState = 0;
@@ -115,7 +128,7 @@ void CcdPhysicsController::CreateRigidbody()
m_body = new btRigidBody(m_cci.m_mass,
m_bulletMotionState,
- m_cci.m_collisionShape,
+ m_collisionShape,
m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor,
m_cci.m_linearDamping,m_cci.m_angularDamping,
m_cci.m_friction,m_cci.m_restitution);
@@ -143,6 +156,19 @@ void CcdPhysicsController::CreateRigidbody()
}
}
+static void DeleteBulletShape(btCollisionShape* shape)
+{
+ if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
+ {
+ // shapes based on meshes use an interface that contains the vertices.
+ btTriangleMeshShape* meshShape = static_cast<btTriangleMeshShape*>(shape);
+ btStridingMeshInterface* meshInterface = meshShape->getMeshInterface();
+ if (meshInterface)
+ delete meshInterface;
+ }
+ delete shape;
+}
+
CcdPhysicsController::~CcdPhysicsController()
{
//will be reference counted, due to sharing
@@ -154,6 +180,27 @@ CcdPhysicsController::~CcdPhysicsController()
if (m_bulletMotionState)
delete m_bulletMotionState;
delete m_body;
+
+ if (m_collisionShape)
+ {
+ // collision shape is always unique to the controller, can delete it here
+ if (m_collisionShape->isCompound())
+ {
+ // bullet does not delete the child shape, must do it here
+ btCompoundShape* compoundShape = (btCompoundShape*)m_collisionShape;
+ int numChild = compoundShape->getNumChildShapes();
+ for (int i=numChild-1 ; i >= 0; i--)
+ {
+ btCollisionShape* childShape = compoundShape->getChildShape(i);
+ DeleteBulletShape(childShape);
+ }
+ }
+ DeleteBulletShape(m_collisionShape);
+ }
+ if (m_shapeInfo)
+ {
+ m_shapeInfo->Release();
+ }
}
@@ -217,12 +264,34 @@ void CcdPhysicsController::WriteDynamicsToMotionState()
void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl)
{
m_MotionState = motionstate;
+ m_registerCount = 0;
+ m_collisionShape = NULL;
-
+ // always create a new shape to avoid scaling bug
+ if (m_shapeInfo)
+ {
+ m_shapeInfo->AddRef();
+ m_collisionShape = m_shapeInfo->CreateBulletShape();
+
+ if (m_collisionShape)
+ {
+ // new shape has no scaling, apply initial scaling
+ m_collisionShape->setLocalScaling(m_cci.m_scaling);
+ if (m_cci.m_mass)
+ m_collisionShape->calculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor);
+ }
+ }
m_body = 0;
CreateRigidbody();
-
+
+ if (m_body)
+ {
+ if (m_cci.m_mass)
+ {
+ m_body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor);
+ }
+ }
m_cci.m_physicsEnv->addCcdPhysicsController(this);
@@ -596,29 +665,32 @@ bool CcdPhysicsController::wantsSleeping()
PHY_IPhysicsController* CcdPhysicsController::GetReplica()
{
- //very experimental, shape sharing is not implemented yet.
- //just support btSphereShape/ConeShape for now
-
+ // This is used only to replicate Near and Radar sensor controllers
+ // The replication of object physics controller is done in KX_BulletPhysicsController::GetReplica()
CcdConstructionInfo cinfo = m_cci;
- if (cinfo.m_collisionShape)
+ if (m_shapeInfo)
+ {
+ // This situation does not normally happen
+ cinfo.m_collisionShape = m_shapeInfo->CreateBulletShape();
+ }
+ else if (m_collisionShape)
{
- switch (cinfo.m_collisionShape->getShapeType())
+ switch (m_collisionShape->getShapeType())
{
case SPHERE_SHAPE_PROXYTYPE:
{
- btSphereShape* orgShape = (btSphereShape*)cinfo.m_collisionShape;
+ btSphereShape* orgShape = (btSphereShape*)m_collisionShape;
cinfo.m_collisionShape = new btSphereShape(*orgShape);
break;
}
- case CONE_SHAPE_PROXYTYPE:
+ case CONE_SHAPE_PROXYTYPE:
{
- btConeShape* orgShape = (btConeShape*)cinfo.m_collisionShape;
+ btConeShape* orgShape = (btConeShape*)m_collisionShape;
cinfo.m_collisionShape = new btConeShape(*orgShape);
break;
}
-
default:
{
return 0;
@@ -627,6 +699,7 @@ PHY_IPhysicsController* CcdPhysicsController::GetReplica()
}
cinfo.m_MotionState = new DefaultMotionState();
+ cinfo.m_shapeInfo = m_shapeInfo;
CcdPhysicsController* replica = new CcdPhysicsController(cinfo);
return replica;
@@ -688,3 +761,198 @@ void DefaultMotionState::calculateWorldTransformations()
}
+// Shape constructor
+bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope)
+{
+ // assume no shape information
+ m_shapeType = PHY_SHAPE_NONE;
+ m_vertexArray.clear();
+ m_polygonIndexArray.clear();
+ m_meshObject = NULL;
+
+ if (!meshobj)
+ return false;
+
+ // Mesh has no polygons!
+ int numpolys = meshobj->NumPolygons();
+ if (!numpolys)
+ {
+ return false;
+ }
+
+ // check that we have at least one colliding polygon
+ int numvalidpolys = 0;
+
+ for (int p=0; p<numpolys; p++)
+ {
+ RAS_Polygon* poly = meshobj->GetPolygon(p);
+
+ // only add polygons that have the collisionflag set
+ if (poly->IsCollider())
+ {
+ numvalidpolys++;
+ break;
+ }
+ }
+
+ // No collision polygons
+ if (numvalidpolys < 1)
+ return false;
+
+ m_shapeType = (polytope) ? PHY_SHAPE_POLYTOPE : PHY_SHAPE_MESH;
+
+ numvalidpolys = 0;
+
+ for (int p2=0; p2<numpolys; p2++)
+ {
+ RAS_Polygon* poly = meshobj->GetPolygon(p2);
+
+ // only add polygons that have the collisionflag set
+ if (poly->IsCollider())
+ {
+ //Bullet can raycast any shape, so
+ if (polytope)
+ {
+ for (int i=0;i<poly->VertexCount();i++)
+ {
+ const float* vtx = poly->GetVertex(i)->getXYZ();
+ btPoint3 point(vtx[0],vtx[1],vtx[2]);
+ m_vertexArray.push_back(point);
+ numvalidpolys++;
+ }
+ } else
+ {
+ {
+ const float* vtx = poly->GetVertex(2)->getXYZ();
+ btPoint3 vertex0(vtx[0],vtx[1],vtx[2]);
+
+ vtx = poly->GetVertex(1)->getXYZ();
+ btPoint3 vertex1(vtx[0],vtx[1],vtx[2]);
+
+ vtx = poly->GetVertex(0)->getXYZ();
+ btPoint3 vertex2(vtx[0],vtx[1],vtx[2]);
+
+ m_vertexArray.push_back(vertex0);
+ m_vertexArray.push_back(vertex1);
+ m_vertexArray.push_back(vertex2);
+ m_polygonIndexArray.push_back(p2);
+ numvalidpolys++;
+ }
+ if (poly->VertexCount() == 4)
+ {
+ const float* vtx = poly->GetVertex(3)->getXYZ();
+ btPoint3 vertex0(vtx[0],vtx[1],vtx[2]);
+
+ vtx = poly->GetVertex(2)->getXYZ();
+ btPoint3 vertex1(vtx[0],vtx[1],vtx[2]);
+
+ vtx = poly->GetVertex(0)->getXYZ();
+ btPoint3 vertex2(vtx[0],vtx[1],vtx[2]);
+
+ m_vertexArray.push_back(vertex0);
+ m_vertexArray.push_back(vertex1);
+ m_vertexArray.push_back(vertex2);
+ m_polygonIndexArray.push_back(p2);
+ numvalidpolys++;
+ }
+ }
+ }
+ }
+
+ if (!numvalidpolys)
+ {
+ // should not happen
+ m_shapeType = PHY_SHAPE_NONE;
+ return false;
+ }
+ m_meshObject = meshobj;
+ return true;
+}
+
+btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape()
+{
+ btCollisionShape* collisionShape = 0;
+ btTriangleMeshShape* concaveShape = 0;
+ btTriangleMesh* collisionMeshData = 0;
+ btCompoundShape* compoundShape = 0;
+ CcdShapeConstructionInfo* nextShapeInfo;
+
+ switch (m_shapeType)
+ {
+ case PHY_SHAPE_NONE:
+ break;
+
+ case PHY_SHAPE_BOX:
+ collisionShape = new btBoxShape(m_halfExtend);
+ break;
+
+ case PHY_SHAPE_SPHERE:
+ collisionShape = new btSphereShape(m_radius);
+ break;
+
+ case PHY_SHAPE_CYLINDER:
+ collisionShape = new btCylinderShapeZ(m_halfExtend);
+ break;
+
+ case PHY_SHAPE_CONE:
+ collisionShape = new btConeShapeZ(m_radius, m_height);
+ break;
+
+ case PHY_SHAPE_POLYTOPE:
+ collisionShape = new btConvexHullShape(&m_vertexArray.begin()->getX(), m_vertexArray.size());
+ break;
+
+ case PHY_SHAPE_MESH:
+ collisionMeshData = new btTriangleMesh();
+ // m_vertexArray is necessarily a multiple of 3
+ for (std::vector<btPoint3>::iterator it=m_vertexArray.begin(); it != m_vertexArray.end(); )
+ {
+ collisionMeshData->addTriangle(*it++,*it++,*it++);
+ }
+ concaveShape = new btBvhTriangleMeshShape( collisionMeshData, true );
+ concaveShape->recalcLocalAabb();
+ collisionShape = concaveShape;
+ break;
+
+ case PHY_SHAPE_COMPOUND:
+ if (m_nextShape)
+ {
+ compoundShape = new btCompoundShape();
+ for (nextShapeInfo=m_nextShape; nextShapeInfo; nextShapeInfo = nextShapeInfo->m_nextShape)
+ {
+ collisionShape = nextShapeInfo->CreateBulletShape();
+ if (collisionShape)
+ {
+ compoundShape->addChildShape(nextShapeInfo->m_childTrans, collisionShape);
+ }
+ }
+ collisionShape = compoundShape;
+ }
+ }
+ return collisionShape;
+}
+
+void CcdShapeConstructionInfo::AddShape(CcdShapeConstructionInfo* shapeInfo)
+{
+ CcdShapeConstructionInfo* nextShape = this;
+ while (nextShape->m_nextShape != NULL)
+ nextShape = nextShape->m_nextShape;
+ nextShape->m_nextShape = shapeInfo;
+}
+
+CcdShapeConstructionInfo::~CcdShapeConstructionInfo()
+{
+ CcdShapeConstructionInfo* childShape = m_nextShape;
+
+ while (childShape)
+ {
+ CcdShapeConstructionInfo* nextShape = childShape->m_nextShape;
+ childShape->m_nextShape = NULL;
+ childShape->Release();
+ childShape = nextShape;
+ }
+
+ m_vertexArray.clear();
+}
+
+
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
index 64f1876e199..a3fbb502c08 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
@@ -17,11 +17,14 @@ subject to the following restrictions:
#ifndef BULLET2_PHYSICSCONTROLLER_H
#define BULLET2_PHYSICSCONTROLLER_H
+#include <vector>
+
#include "PHY_IPhysicsController.h"
/// PHY_IPhysicsController is the abstract simplified Interface to a physical object.
/// It contains the IMotionState and IDeformableMesh Interfaces.
#include "btBulletDynamicsCommon.h"
+#include "LinearMath/btTransform.h"
#include "PHY_IMotionState.h"
@@ -31,8 +34,81 @@ extern float gAngularSleepingTreshold;
extern bool gDisableDeactivation;
class CcdPhysicsEnvironment;
class btMotionState;
+class RAS_MeshObject;
+class btCollisionShape;
+// Shape contructor
+// It contains all the information needed to create a simple bullet shape at runtime
+class CcdShapeConstructionInfo
+{
+public:
+ CcdShapeConstructionInfo() :
+ m_shapeType(PHY_SHAPE_NONE),
+ m_radius(1.0),
+ m_height(1.0),
+ m_halfExtend(0.f,0.f,0.f),
+ m_nextShape(NULL),
+ m_refCount(1)
+ {
+ m_childTrans.setIdentity();
+ }
+ ~CcdShapeConstructionInfo();
+
+ CcdShapeConstructionInfo* AddRef()
+ {
+ m_refCount++;
+ return this;
+ }
+
+ int Release()
+ {
+ if (--m_refCount > 0)
+ return m_refCount;
+ delete this;
+ return 0;
+ }
+
+ void AddShape(CcdShapeConstructionInfo* shapeInfo);
+
+ CcdShapeConstructionInfo* GetNextShape()
+ {
+ return m_nextShape;
+ }
+ CcdShapeConstructionInfo* GetChildShape(int i)
+ {
+ CcdShapeConstructionInfo* shape = m_nextShape;
+ while (i > 0 && shape != NULL)
+ {
+ shape = shape->m_nextShape;
+ i--;
+ }
+ return shape;
+ }
+
+ bool SetMesh(RAS_MeshObject* mesh, bool polytope);
+
+ btCollisionShape* CreateBulletShape();
+
+ // member variables
+ PHY_ShapeType m_shapeType;
+ btScalar m_radius;
+ btScalar m_height;
+ btVector3 m_halfExtend;
+ btTransform m_childTrans;
+ std::vector<btPoint3> m_vertexArray; // Contains both vertex array for polytope shape and
+ // triangle array for concave mesh shape.
+ // In this case a triangle is made of 3 consecutive points
+ std::vector<int> m_polygonIndexArray; // Contains the array of polygon index in the
+ // original mesh that correspond to shape triangles.
+ // only set for concave mesh shape.
+ const RAS_MeshObject* m_meshObject; // Keep a pointer to the original mesh
+
+protected:
+ CcdShapeConstructionInfo* m_nextShape; // for compound shape
+ int m_refCount; // this class is shared between replicas
+ // keep track of users so that we can release it
+};
struct CcdConstructionInfo
{
@@ -52,7 +128,8 @@ struct CcdConstructionInfo
CcdConstructionInfo()
- : m_gravity(0,0,0),
+ : m_localInertiaTensor(1.f, 1.f, 1.f),
+ m_gravity(0,0,0),
m_scaling(1.f,1.f,1.f),
m_mass(0.f),
m_restitution(0.1f),
@@ -65,6 +142,7 @@ struct CcdConstructionInfo
m_collisionFilterMask(AllFilter),
m_collisionShape(0),
m_MotionState(0),
+ m_shapeInfo(0),
m_physicsEnv(0),
m_inertiaFactor(1.f)
{
@@ -89,8 +167,11 @@ struct CcdConstructionInfo
short int m_collisionFilterGroup;
short int m_collisionFilterMask;
+ ///these pointers are used as argument passing for the CcdPhysicsController constructor
+ ///and not anymore after that
class btCollisionShape* m_collisionShape;
class PHY_IMotionState* m_MotionState;
+ class CcdShapeConstructionInfo* m_shapeInfo;
CcdPhysicsEnvironment* m_physicsEnv; //needed for self-replication
float m_inertiaFactor;//tweak the inertia (hooked up to Blender 'formfactor'
@@ -106,16 +187,26 @@ class CcdPhysicsController : public PHY_IPhysicsController
btRigidBody* m_body;
class PHY_IMotionState* m_MotionState;
btMotionState* m_bulletMotionState;
+ class btCollisionShape* m_collisionShape;
+ class CcdShapeConstructionInfo* m_shapeInfo;
+
friend class CcdPhysicsEnvironment; // needed when updating the controller
void* m_newClientInfo;
-
+ int m_registerCount; // needed when multiple sensors use the same controller
CcdConstructionInfo m_cci;//needed for replication
void GetWorldOrientation(btMatrix3x3& mat);
void CreateRigidbody();
+ bool Register() {
+ return (m_registerCount++ == 0) ? true : false;
+ }
+ bool Unregister() {
+ return (--m_registerCount == 0) ? true : false;
+ }
+
protected:
void setWorldOrientation(const btMatrix3x3& mat);
@@ -130,6 +221,7 @@ class CcdPhysicsController : public PHY_IPhysicsController
btRigidBody* GetRigidBody() { return m_body;}
+ CcdShapeConstructionInfo* GetShapeInfo() { return m_shapeInfo; }
btCollisionShape* GetCollisionShape() {
return m_body->getCollisionShape();
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index b773f40650b..d14ddf8f65c 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -53,6 +53,7 @@ void DrawRasterizerLine(const float* from,const float* to,int color);
#include <stdio.h>
+#include <string.h> // for memset
#ifdef NEW_BULLET_VEHICLE_SUPPORT
class WrapperVehicle : public PHY_IVehicle
@@ -368,7 +369,7 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl)
body->setUserPointer(ctrl);
body->setGravity( m_gravity );
- m_controllers.push_back(ctrl);
+ m_controllers.insert(ctrl);
//use explicit group/filter for finer control over collision in bullet => near/radar sensor
m_dynamicsWorld->addRigidBody(body, ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask());
@@ -434,36 +435,16 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl)
void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctrl)
{
-
//also remove constraint
-
-
m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody());
+ m_controllers.erase(ctrl);
-
- {
- std::vector<CcdPhysicsController*>::iterator i =
- std::find(m_controllers.begin(), m_controllers.end(), ctrl);
- if (!(i == m_controllers.end()))
- {
- std::swap(*i, m_controllers.back());
- m_controllers.pop_back();
- }
- }
+ if (ctrl->m_registerCount != 0)
+ printf("Warning: removing controller with non-zero m_registerCount: %d\n", ctrl->m_registerCount);
//remove it from the triggers
- {
- std::vector<CcdPhysicsController*>::iterator i =
- std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl);
- if (!(i == m_triggerControllers.end()))
- {
- std::swap(*i, m_triggerControllers.back());
- m_triggerControllers.pop_back();
- }
- }
-
-
+ m_triggerControllers.erase(ctrl);
}
void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask)
@@ -487,16 +468,22 @@ void CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctr
void CcdPhysicsEnvironment::enableCcdPhysicsController(CcdPhysicsController* ctrl)
{
- std::vector<CcdPhysicsController*>::iterator i =
- std::find(m_controllers.begin(), m_controllers.end(), ctrl);
- if (i == m_controllers.end())
+ if (m_controllers.insert(ctrl).second)
{
btRigidBody* body = ctrl->GetRigidBody();
+ body->setUserPointer(ctrl);
m_dynamicsWorld->addCollisionObject(body,
ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask());
}
}
+void CcdPhysicsEnvironment::disableCcdPhysicsController(CcdPhysicsController* ctrl)
+{
+ if (m_controllers.erase(ctrl))
+ {
+ m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody());
+ }
+}
void CcdPhysicsEnvironment::beginFrame()
@@ -507,12 +494,12 @@ void CcdPhysicsEnvironment::beginFrame()
bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
{
+ std::set<CcdPhysicsController*>::iterator it;
+ int i;
- int i,numCtrl = GetNumControllers();
- for (i=0;i<numCtrl;i++)
+ for (it=m_controllers.begin(); it!=m_controllers.end(); it++)
{
- CcdPhysicsController* ctrl = GetPhysicsController(i);
- ctrl->SynchronizeMotionStates(timeStep);
+ (*it)->SynchronizeMotionStates(timeStep);
}
float subStep = timeStep / float(m_numTimeSubSteps);
@@ -521,11 +508,9 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
m_dynamicsWorld->stepSimulation(subStep,0);//perform always a full simulation step
}
- numCtrl = GetNumControllers();
- for (i=0;i<numCtrl;i++)
+ for (it=m_controllers.begin(); it!=m_controllers.end(); it++)
{
- CcdPhysicsController* ctrl = GetPhysicsController(i);
- ctrl->SynchronizeMotionStates(timeStep);
+ (*it)->SynchronizeMotionStates(timeStep);
}
for (i=0;i<m_wrapperVehicles.size();i++)
@@ -725,35 +710,51 @@ void CcdPhysicsEnvironment::removeConstraint(int constraintId)
struct FilterClosestRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
{
- PHY_IPhysicsController* m_ignoreClient;
+ PHY_IRayCastFilterCallback& m_phyRayFilter;
+ const btCollisionShape* m_hitTriangleShape;
+ int m_hitTriangleIndex;
- FilterClosestRayResultCallback (PHY_IPhysicsController* ignoreClient,const btVector3& rayFrom,const btVector3& rayTo)
+ FilterClosestRayResultCallback (PHY_IRayCastFilterCallback& phyRayFilter,const btVector3& rayFrom,const btVector3& rayTo)
: btCollisionWorld::ClosestRayResultCallback(rayFrom,rayTo),
- m_ignoreClient(ignoreClient)
+ m_phyRayFilter(phyRayFilter),
+ m_hitTriangleShape(NULL),
+ m_hitTriangleIndex(0)
{
-
}
virtual ~FilterClosestRayResultCallback()
{
}
+ virtual bool NeedRayCast(btCollisionObject* object)
+ {
+ CcdPhysicsController* phyCtrl = static_cast<CcdPhysicsController*>(object->getUserPointer());
+ if (phyCtrl != m_phyRayFilter.m_ignoreController)
+ {
+ return m_phyRayFilter.needBroadphaseRayCast(phyCtrl);
+ }
+ return false;
+ }
+
virtual float AddSingleResult( btCollisionWorld::LocalRayResult& rayResult)
{
CcdPhysicsController* curHit = static_cast<CcdPhysicsController*>(rayResult.m_collisionObject->getUserPointer());
- //ignore client...
- if (curHit != m_ignoreClient)
- {
- //if valid
- return ClosestRayResultCallback::AddSingleResult(rayResult);
+ // save shape information as ClosestRayResultCallback::AddSingleResult() does not do it
+ if (rayResult.m_localShapeInfo)
+ {
+ m_hitTriangleShape = rayResult.m_localShapeInfo->m_triangleShape;
+ m_hitTriangleIndex = rayResult.m_localShapeInfo->m_triangleIndex;
+ } else
+ {
+ m_hitTriangleShape = NULL;
+ m_hitTriangleIndex = 0;
}
- return m_closestHitFraction;
+ return ClosestRayResultCallback::AddSingleResult(rayResult);
}
};
-PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)
+PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ)
{
@@ -767,18 +768,21 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* i
//Either Ray Cast with or without filtering
//btCollisionWorld::ClosestRayResultCallback rayCallback(rayFrom,rayTo);
- FilterClosestRayResultCallback rayCallback(ignoreClient,rayFrom,rayTo);
+ FilterClosestRayResultCallback rayCallback(filterCallback,rayFrom,rayTo);
- PHY_IPhysicsController* nearestHit = 0;
+ PHY_RayCastResult result;
+ memset(&result, 0, sizeof(result));
+
// don't collision with sensor object
- m_dynamicsWorld->rayTest(rayFrom,rayTo,rayCallback, CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::SensorFilter);
+ m_dynamicsWorld->rayTest(rayFrom,rayTo,rayCallback, CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::SensorFilter,filterCallback.m_faceNormal);
if (rayCallback.HasHit())
{
- nearestHit = static_cast<CcdPhysicsController*>(rayCallback.m_collisionObject->getUserPointer());
- hitX = rayCallback.m_hitPointWorld.getX();
- hitY = rayCallback.m_hitPointWorld.getY();
- hitZ = rayCallback.m_hitPointWorld.getZ();
+ CcdPhysicsController* controller = static_cast<CcdPhysicsController*>(rayCallback.m_collisionObject->getUserPointer());
+ result.m_controller = controller;
+ result.m_hitPoint[0] = rayCallback.m_hitPointWorld.getX();
+ result.m_hitPoint[1] = rayCallback.m_hitPointWorld.getY();
+ result.m_hitPoint[2] = rayCallback.m_hitPointWorld.getZ();
if (rayCallback.m_hitNormalWorld.length2() > (SIMD_EPSILON*SIMD_EPSILON))
{
@@ -787,14 +791,42 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* i
{
rayCallback.m_hitNormalWorld.setValue(1,0,0);
}
- normalX = rayCallback.m_hitNormalWorld.getX();
- normalY = rayCallback.m_hitNormalWorld.getY();
- normalZ = rayCallback.m_hitNormalWorld.getZ();
-
+ result.m_hitNormal[0] = rayCallback.m_hitNormalWorld.getX();
+ result.m_hitNormal[1] = rayCallback.m_hitNormalWorld.getY();
+ result.m_hitNormal[2] = rayCallback.m_hitNormalWorld.getZ();
+ if (rayCallback.m_hitTriangleShape != NULL)
+ {
+ // identify the mesh polygon
+ CcdShapeConstructionInfo* shapeInfo = controller->m_shapeInfo;
+ if (shapeInfo)
+ {
+ btCollisionShape* shape = controller->GetRigidBody()->getCollisionShape();
+ if (shape->isCompound())
+ {
+ btCompoundShape* compoundShape = (btCompoundShape*)shape;
+ CcdShapeConstructionInfo* compoundShapeInfo = shapeInfo;
+ // need to search which sub-shape has been hit
+ for (int i=0; i<compoundShape->getNumChildShapes(); i++)
+ {
+ shapeInfo = compoundShapeInfo->GetChildShape(i);
+ shape=compoundShape->getChildShape(i);
+ if (shape == rayCallback.m_hitTriangleShape)
+ break;
+ }
+ }
+ if (shape == rayCallback.m_hitTriangleShape &&
+ rayCallback.m_hitTriangleIndex < shapeInfo->m_polygonIndexArray.size())
+ {
+ result.m_meshObject = shapeInfo->m_meshObject;
+ result.m_polygon = shapeInfo->m_polygonIndexArray.at(rayCallback.m_hitTriangleIndex);
+ }
+ }
+ }
+ filterCallback.reportHit(&result);
}
- return nearestHit;
+ return result.m_controller;
}
@@ -852,20 +884,6 @@ CcdPhysicsEnvironment::~CcdPhysicsEnvironment()
}
-int CcdPhysicsEnvironment::GetNumControllers()
-{
- return m_controllers.size();
-}
-
-
-CcdPhysicsController* CcdPhysicsEnvironment::GetPhysicsController( int index)
-{
- return m_controllers[index];
-}
-
-
-
-
void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float value0,float value1)
{
btTypedConstraint* typedConstraint = getConstraintById(constraintId);
@@ -905,12 +923,14 @@ void CcdPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl)
{
CcdPhysicsController* ctrl1 = (CcdPhysicsController* )ctrl;
- std::vector<CcdPhysicsController*>::iterator i =
- std::find(m_controllers.begin(), m_controllers.end(), ctrl);
- if ((i == m_controllers.end()))
- {
- addCcdPhysicsController(ctrl1);
- }
+ // addSensor() is a "light" function for bullet because it is used
+ // dynamically when the sensor is activated. Use enableCcdPhysicsController() instead
+ //if (m_controllers.insert(ctrl1).second)
+ //{
+ // addCcdPhysicsController(ctrl1);
+ //}
+ enableCcdPhysicsController(ctrl1);
+
//Collision filter/mask is now set at the time of the creation of the controller
//force collision detection with everything, including static objects (might hurt performance!)
//ctrl1->GetRigidBody()->getBroadphaseHandle()->m_collisionFilterMask = btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::SensorTrigger;
@@ -923,21 +943,19 @@ void CcdPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl)
void CcdPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl)
{
- std::vector<CcdPhysicsController*>::iterator i =
- std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl);
- if (!(i == m_triggerControllers.end()))
- {
- std::swap(*i, m_triggerControllers.back());
- m_triggerControllers.pop_back();
- }
+ CcdPhysicsController* ccdCtrl = (CcdPhysicsController*)ctrl;
+ if (ccdCtrl->Unregister())
+ m_triggerControllers.erase(ccdCtrl);
}
void CcdPhysicsEnvironment::removeSensor(PHY_IPhysicsController* ctrl)
{
removeCollisionCallback(ctrl);
- //printf("removeSensor\n");
+
+ disableCcdPhysicsController((CcdPhysicsController*)ctrl);
}
+
void CcdPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)
{
/* printf("addTouchCallback\n(response class = %i)\n",response_class);
@@ -974,11 +992,10 @@ void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctr
{
CcdPhysicsController* ccdCtrl = static_cast<CcdPhysicsController*>(ctrl);
- //printf("requestCollisionCallback\n");
- m_triggerControllers.push_back(ccdCtrl);
+ if (ccdCtrl->Register())
+ m_triggerControllers.insert(ccdCtrl);
}
-
void CcdPhysicsEnvironment::CallbackTriggers()
{
@@ -987,13 +1004,16 @@ void CcdPhysicsEnvironment::CallbackTriggers()
if (m_triggerCallbacks[PHY_OBJECT_RESPONSE] || (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints)))
{
//walk over all overlapping pairs, and if one of the involved bodies is registered for trigger callback, perform callback
- int numManifolds = m_dynamicsWorld->getDispatcher()->getNumManifolds();
+ btDispatcher* dispatcher = m_dynamicsWorld->getDispatcher();
+ int numManifolds = dispatcher->getNumManifolds();
for (int i=0;i<numManifolds;i++)
{
- btPersistentManifold* manifold = m_dynamicsWorld->getDispatcher()->getManifoldByIndexInternal(i);
+ btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i);
int numContacts = manifold->getNumContacts();
if (numContacts)
{
+ btRigidBody* rb0 = static_cast<btRigidBody*>(manifold->getBody0());
+ btRigidBody* rb1 = static_cast<btRigidBody*>(manifold->getBody1());
if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints))
{
for (int j=0;j<numContacts;j++)
@@ -1004,18 +1024,17 @@ void CcdPhysicsEnvironment::CallbackTriggers()
m_debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color);
}
}
- btRigidBody* obj0 = static_cast<btRigidBody* >(manifold->getBody0());
- btRigidBody* obj1 = static_cast<btRigidBody* >(manifold->getBody1());
+ btRigidBody* obj0 = rb0;
+ btRigidBody* obj1 = rb1;
//m_internalOwner is set in 'addPhysicsController'
CcdPhysicsController* ctrl0 = static_cast<CcdPhysicsController*>(obj0->getUserPointer());
CcdPhysicsController* ctrl1 = static_cast<CcdPhysicsController*>(obj1->getUserPointer());
- std::vector<CcdPhysicsController*>::iterator i =
- std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl0);
+ std::set<CcdPhysicsController*>::const_iterator i = m_triggerControllers.find(ctrl0);
if (i == m_triggerControllers.end())
{
- i = std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl1);
+ i = m_triggerControllers.find(ctrl1);
}
if (!(i == m_triggerControllers.end()))
@@ -1023,6 +1042,15 @@ void CcdPhysicsEnvironment::CallbackTriggers()
m_triggerCallbacks[PHY_OBJECT_RESPONSE](m_triggerCallbacksUserPtrs[PHY_OBJECT_RESPONSE],
ctrl0,ctrl1,0);
}
+ // Bullet does not refresh the manifold contact point for object without contact response
+ // may need to remove this when a newer Bullet version is integrated
+ if (!dispatcher->needsResponse(rb0, rb1))
+ {
+ // Refresh algorithm fails sometimes when there is penetration
+ // (usuall the case with ghost and sensor objects)
+ // Let's just clear the manifold, in any case, it is recomputed on each frame.
+ manifold->clearManifold(); //refreshContactPoints(rb0->getCenterOfMassTransform(),rb1->getCenterOfMassTransform());
+ }
}
}
@@ -1125,7 +1153,6 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::CreateSphereController(float radi
CcdPhysicsController* sphereController = new CcdPhysicsController(cinfo);
-
return sphereController;
}
@@ -1391,8 +1418,9 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl
PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float coneradius,float coneheight)
{
CcdConstructionInfo cinfo;
- //This is a memory leak: Bullet does not delete the shape and it cannot be added to
- //the KX_Scene.m_shapes list -- too bad but that's not a lot of data
+
+ // we don't need a CcdShapeConstructionInfo for this shape:
+ // it is simple enough for the standard copy constructor (see CcdPhysicsController::GetReplica)
cinfo.m_collisionShape = new btConeShape(coneradius,coneheight);
cinfo.m_MotionState = 0;
cinfo.m_physicsEnv = this;
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index 453749b27b3..667e310dcb3 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -18,6 +18,7 @@ subject to the following restrictions:
#include "PHY_IPhysicsEnvironment.h"
#include <vector>
+#include <set>
class CcdPhysicsController;
#include "LinearMath/btVector3.h"
#include "LinearMath/btTransform.h"
@@ -156,8 +157,7 @@ protected:
btTypedConstraint* getConstraintById(int constraintId);
- virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
+ virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
//Methods for gamelogic collision/physics callbacks
@@ -185,10 +185,7 @@ protected:
void updateCcdPhysicsController(CcdPhysicsController* ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask);
- void disableCcdPhysicsController(CcdPhysicsController* ctrl)
- {
- removeCcdPhysicsController(ctrl);
- }
+ void disableCcdPhysicsController(CcdPhysicsController* ctrl);
void enableCcdPhysicsController(CcdPhysicsController* ctrl);
@@ -209,12 +206,6 @@ protected:
}
- int GetNumControllers();
-
- CcdPhysicsController* GetPhysicsController( int index);
-
-
-
const btPersistentManifold* GetManifold(int index) const;
@@ -229,9 +220,9 @@ protected:
- std::vector<CcdPhysicsController*> m_controllers;
+ std::set<CcdPhysicsController*> m_controllers;
- std::vector<CcdPhysicsController*> m_triggerControllers;
+ std::set<CcdPhysicsController*> m_triggerControllers;
PHY_ResponseCallback m_triggerCallbacks[PHY_NUM_RESPONSE];
void* m_triggerCallbacksUserPtrs[PHY_NUM_RESPONSE];
diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile
index 49259d0a67c..d5570e75833 100644
--- a/source/gameengine/Physics/Bullet/Makefile
+++ b/source/gameengine/Physics/Bullet/Makefile
@@ -37,5 +37,10 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_BULLET2)/include
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I$(NAN_STRING)/include
+CPPFLAGS += -I$(NAN_MOTO)/include
+CPPFLAGS += -I../../../kernel/gen_system
CPPFLAGS += -I../../Physics/common
CPPFLAGS += -I../../Physics/Dummy
+CPPFLAGS += -I../../Rasterizer
+
diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript
index dd6eab0f018..0936d45197a 100644
--- a/source/gameengine/Physics/Bullet/SConscript
+++ b/source/gameengine/Physics/Bullet/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = 'CcdPhysicsEnvironment.cpp CcdPhysicsController.cpp'
-incs = '. ../common'
+incs = '. ../common #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer'
incs += ' ' + env['BF_BULLET_INC']
diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
index f512d44c9f2..d78958b746c 100644
--- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
@@ -109,8 +109,7 @@ void DummyPhysicsEnvironment::removeConstraint(int constraintid)
}
}
-PHY_IPhysicsController* DummyPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient,float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)
+PHY_IPhysicsController* DummyPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ)
{
//collision detection / raytesting
return NULL;
diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
index f0761618e4e..975be84f2a7 100644
--- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
@@ -69,8 +69,7 @@ public:
return 0;
}
- virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
+ virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
//gamelogic callbacks
@@ -80,6 +79,7 @@ public:
{
}
virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {}
+ virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {}
virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;}
virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;}
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
index b5bf67b14ea..f0791bbf89f 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
+++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
@@ -98,12 +98,17 @@ void SM_Scene::addTouchCallback(int response_class, DT_ResponseCallback callback
void SM_Scene::addSensor(SM_Object& object)
{
- object.calcXform();
- m_objectList.push_back(&object);
- DT_AddObject(m_scene, object.getObjectHandle());
- DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[SENSOR_RESPONSE]);
- DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass[SENSOR_RESPONSE]);
- DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[SENSOR_RESPONSE]);
+ T_ObjectList::iterator i =
+ std::find(m_objectList.begin(), m_objectList.end(), &object);
+ if (i == m_objectList.end())
+ {
+ object.calcXform();
+ m_objectList.push_back(&object);
+ DT_AddObject(m_scene, object.getObjectHandle());
+ DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[SENSOR_RESPONSE]);
+ DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass [SENSOR_RESPONSE]);
+ DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[SENSOR_RESPONSE]);
+ }
}
void SM_Scene::add(SM_Object& object) {
diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
index 16ba45a0be5..80e4dc4044e 100644
--- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
@@ -26,6 +26,7 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
+#include <string.h> // memset
#include "SumoPhysicsEnvironment.h"
#include "PHY_IMotionState.h"
#include "SumoPhysicsController.h"
@@ -125,37 +126,35 @@ void SumoPhysicsEnvironment::removeConstraint(int constraintid)
}
}
-PHY_IPhysicsController* SumoPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClientCtrl,
+PHY_IPhysicsController* SumoPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback,
float fromX,float fromY,float fromZ,
- float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,
- float& normalX,float& normalY,float& normalZ)
+ float toX,float toY,float toZ)
{
- SumoPhysicsController* ignoreCtr = static_cast<SumoPhysicsController*> (ignoreClientCtrl);
+ SumoPhysicsController* ignoreCtr = static_cast<SumoPhysicsController*> (filterCallback.m_ignoreController);
//collision detection / raytesting
MT_Point3 hit, normal;
- PHY_IPhysicsController *ret = 0;
+ PHY_RayCastResult result;
SM_Object* sm_ignore = 0;
if (ignoreCtr)
sm_ignore = ignoreCtr->GetSumoObject();
+ memset(&result, 0, sizeof(result));
SM_Object* smOb = m_sumoScene->rayTest(sm_ignore,MT_Point3(fromX, fromY, fromZ),MT_Point3(toX, toY, toZ), hit, normal);
if (smOb)
{
- ret = (PHY_IPhysicsController *) smOb->getPhysicsClientObject();
+ result.m_controller = (PHY_IPhysicsController *) smOb->getPhysicsClientObject();
+ result.m_hitPoint[0] = hit[0];
+ result.m_hitPoint[1] = hit[1];
+ result.m_hitPoint[2] = hit[2];
+ result.m_hitNormal[0] = normal[0];
+ result.m_hitNormal[1] = normal[1];
+ result.m_hitNormal[2] = normal[2];
+ filterCallback.reportHit(&result);
}
- hitX = hit[0];
- hitY = hit[1];
- hitZ = hit[2];
-
- normalX = normal[0];
- normalY = normal[1];
- normalZ = normal[2];
-
- return ret;
+ return result.m_controller;
}
//gamelogic callbacks
void SumoPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl)
@@ -228,6 +227,12 @@ void SumoPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ct
m_sumoScene->requestCollisionCallback(*smObject);
}
}
+
+void SumoPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl)
+{
+ // intentionally empty
+}
+
PHY_IPhysicsController* SumoPhysicsEnvironment::CreateSphereController(float radius,const PHY__Vector3& position)
{
DT_ShapeHandle shape = DT_NewSphere(0.0);
diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
index ce5cd70e8cc..100adf969d5 100644
--- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
@@ -75,8 +75,7 @@ public:
return 0;
}
- virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient,float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
+ virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ);
//gamelogic callbacks
@@ -84,6 +83,7 @@ public:
virtual void removeSensor(PHY_IPhysicsController* ctrl);
virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user);
virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl);
+ virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl);
virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position);
virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight);
diff --git a/source/gameengine/Physics/common/PHY_DynamicTypes.h b/source/gameengine/Physics/common/PHY_DynamicTypes.h
index c289b9d8bcb..3b3e42c38d2 100644
--- a/source/gameengine/Physics/common/PHY_DynamicTypes.h
+++ b/source/gameengine/Physics/common/PHY_DynamicTypes.h
@@ -87,6 +87,18 @@ typedef enum PHY_ConstraintType {
} PHY_ConstraintType;
+typedef enum PHY_ShapeType {
+ PHY_SHAPE_NONE,
+ PHY_SHAPE_BOX,
+ PHY_SHAPE_SPHERE,
+ PHY_SHAPE_CYLINDER,
+ PHY_SHAPE_CONE,
+ PHY_SHAPE_MESH,
+ PHY_SHAPE_POLYTOPE,
+ PHY_SHAPE_COMPOUND
+} PHY_ShapeType;
+
+
typedef float PHY_Vector3[3];
#endif //__PHY_DYNAMIC_TYPES
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
index c148210903f..98496fb7f9e 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
@@ -33,6 +33,50 @@
#include <vector>
#include "PHY_DynamicTypes.h"
class PHY_IVehicle;
+class RAS_MeshObject;
+class PHY_IPhysicsController;
+
+/**
+ * pass back information from rayTest
+ */
+struct PHY_RayCastResult
+{
+ PHY_IPhysicsController* m_controller;
+ PHY__Vector3 m_hitPoint;
+ PHY__Vector3 m_hitNormal;
+ const RAS_MeshObject* m_meshObject; // !=NULL for mesh object (only for Bullet controllers)
+ int m_polygon; // index of the polygon hit by the ray,
+ // only if m_meshObject != NULL
+};
+
+/**
+ * This class replaces the ignoreController parameter of rayTest function.
+ * It allows more sophisticated filtering on the physics controller before computing the ray intersection to save CPU.
+ * It is only used to its full extend by the Ccd physics environement (Bullet).
+ */
+class PHY_IRayCastFilterCallback
+{
+public:
+ PHY_IPhysicsController* m_ignoreController;
+ bool m_faceNormal;
+
+ virtual ~PHY_IRayCastFilterCallback()
+ {
+ }
+
+ virtual bool needBroadphaseRayCast(PHY_IPhysicsController* controller)
+ {
+ return true;
+ }
+
+ virtual void reportHit(PHY_RayCastResult* result) = 0;
+
+ PHY_IRayCastFilterCallback(PHY_IPhysicsController* ignoreController, bool faceNormal=false)
+ :m_ignoreController(ignoreController),
+ m_faceNormal(faceNormal)
+ {
+ }
+};
/**
* Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.)
@@ -94,8 +138,7 @@ class PHY_IPhysicsEnvironment
//complex constraint for vehicles
virtual PHY_IVehicle* getVehicleConstraint(int constraintId) =0;
- virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
- float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)=0;
+ virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ)=0;
//Methods for gamelogic collision/physics callbacks
@@ -104,6 +147,7 @@ class PHY_IPhysicsEnvironment
virtual void removeSensor(PHY_IPhysicsController* ctrl)=0;
virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0;
virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl)=0;
+ virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl)=0;
//These two methods are *solely* used to create controllers for sensor! Don't use for anything else
virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) =0;
virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight)=0;
diff --git a/source/gameengine/PyDoc/BL_ShapeActionActuator.py b/source/gameengine/PyDoc/BL_ShapeActionActuator.py
new file mode 100644
index 00000000000..63cce253fa4
--- /dev/null
+++ b/source/gameengine/PyDoc/BL_ShapeActionActuator.py
@@ -0,0 +1,158 @@
+# $Id$
+# Documentation for BL_ShapeActionActuator
+from SCA_IActuator import *
+
+class BL_ShapeActionActuator(SCA_IActuator):
+ """
+ ShapeAction Actuators apply an shape action to an mesh object.
+ """
+ def setAction(action, reset = True):
+ """
+ Sets the current action.
+
+ @param action: The name of the action to set as the current action.
+ @type action: string
+ @param reset: Optional parameter indicating whether to reset the
+ blend timer or not. A value of 1 indicates that the
+ timer should be reset. A value of 0 will leave it
+ unchanged. If reset is not specified, the timer will
+ be reset.
+ """
+
+ def setStart(start):
+ """
+ Specifies the starting frame of the animation.
+
+ @param start: the starting frame of the animation
+ @type start: float
+ """
+
+ def setEnd(end):
+ """
+ Specifies the ending frame of the animation.
+
+ @param end: the ending frame of the animation
+ @type end: float
+ """
+ def setBlendin(blendin):
+ """
+ Specifies the number of frames of animation to generate
+ when making transitions between actions.
+
+ @param blendin: the number of frames in transition.
+ @type blendin: float
+ """
+
+ def setPriority(priority):
+ """
+ Sets the priority of this actuator.
+
+ @param priority: Specifies the new priority. Actuators will lower
+ priority numbers will override actuators with higher
+ numbers.
+ @type priority: integer
+ """
+ def setFrame(frame):
+ """
+ Sets the current frame for the animation.
+
+ @param frame: Specifies the new current frame for the animation
+ @type frame: float
+ """
+
+ def setProperty(prop):
+ """
+ Sets the property to be used in FromProp playback mode.
+
+ @param prop: the name of the property to use.
+ @type prop: string.
+ """
+
+ def setBlendtime(blendtime):
+ """
+ Sets the internal frame timer.
+
+ Allows the script to directly modify the internal timer
+ used when generating transitions between actions.
+
+ @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0.
+ @type blendtime: float
+ """
+
+ def setType(mode):
+ """
+ Sets the operation mode of the actuator
+
+ @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
+ @type mode: integer
+ """
+
+ def setContinue(cont):
+ """
+ Set the actions continue option True or False. see getContinue.
+
+ @param cont: The continue option.
+ @type cont: bool
+ """
+
+ def getType():
+ """
+ Returns the operation mode of the actuator
+
+ @rtype: integer
+ @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND
+ """
+
+ def getContinue():
+ """
+ When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame.
+
+ @rtype: bool
+ """
+
+ def getAction():
+ """
+ getAction() returns the name of the action associated with this actuator.
+
+ @rtype: string
+ """
+
+ def getStart():
+ """
+ Returns the starting frame of the action.
+
+ @rtype: float
+ """
+ def getEnd():
+ """
+ Returns the last frame of the action.
+
+ @rtype: float
+ """
+ def getBlendin():
+ """
+ Returns the number of interpolation animation frames to be generated when this actuator is triggered.
+
+ @rtype: float
+ """
+ def getPriority():
+ """
+ Returns the priority for this actuator. Actuators with lower Priority numbers will
+ override actuators with higher numbers.
+
+ @rtype: integer
+ """
+ def getFrame():
+ """
+ Returns the current frame number.
+
+ @rtype: float
+ """
+ def getProperty():
+ """
+ Returns the name of the property to be used in FromProp mode.
+
+ @rtype: string
+ """
+
+
diff --git a/source/gameengine/PyDoc/GameKeys.py b/source/gameengine/PyDoc/GameKeys.py
index 268fb9cc172..1a0a737718e 100644
--- a/source/gameengine/PyDoc/GameKeys.py
+++ b/source/gameengine/PyDoc/GameKeys.py
@@ -164,3 +164,12 @@ Example::
# Activate Right!
"""
+
+def EventToString(event):
+ """
+ Return the string name of a key event. Will raise a ValueError error if its invalid.
+
+ @type event: int
+ @param event: key event from GameKeys or the keyboard sensor.
+ @rtype: string
+ """
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py
index 965c0522bd7..af3d2810553 100644
--- a/source/gameengine/PyDoc/GameLogic.py
+++ b/source/gameengine/PyDoc/GameLogic.py
@@ -14,8 +14,7 @@ Documentation for the GameLogic Module.
Examples::
# To get a controller:
- import GameLogic
- co = GameLogic.getCurrentController()
+ co = GameLogic.getCurrentController() # GameLogic is automatically imported
# To get the game object associated with this controller:
obj = co.getOwner()
@@ -42,6 +41,7 @@ Documentation for the GameLogic Module.
- L{SCA_MouseSensor}
- L{SCA_PropertySensor}
- L{SCA_RandomSensor}
+ - L{SCA_DelaySensor}
You can also access actuators linked to the controller::
# To get an actuator attached to the controller:
@@ -220,6 +220,13 @@ def setPhysicsTicRate(ticrate):
@param ticrate: The new update frequency (in Hz).
@type ticrate: float
"""
+def getAverageFrameRate():
+ """
+ Gets the estimated average framerate
+
+ @return: The estimed average framerate in frames per second
+ @rtype: float
+ """
def expandPath(path):
"""
@@ -236,3 +243,13 @@ def expandPath(path):
@return: The converted string
@rtype: string
"""
+
+def getBlendFileList(path = "//"):
+ """
+ Returns a list of blend files in the same directory as the open blend file, or from using the option argument.
+
+ @param path: Optional directory argument, will be expanded (like expandPath) into the full path.
+ @type path: string
+ @return: A list of filenames, with no directory prefix
+ @rtype: list
+ """
diff --git a/source/gameengine/PyDoc/KX_ActuatorSensor.py b/source/gameengine/PyDoc/KX_ActuatorSensor.py
new file mode 100644
index 00000000000..f9aef86f7f0
--- /dev/null
+++ b/source/gameengine/PyDoc/KX_ActuatorSensor.py
@@ -0,0 +1,24 @@
+# $Id$
+# Documentation for KX_ActuatorSensor
+from SCA_IActuator import *
+
+class KX_ActuatorSensor(SCA_ISensor):
+ """
+ Actuator sensor detect change in actuator state of the parent object.
+ It generates a positive pulse if the corresponding actuator is activated
+ and a negative pulse if the actuator is deactivated.
+ """
+ def getActuator():
+ """
+ Return the Actuator with which the sensor operates.
+
+ @rtype: string
+ """
+ def setActuator(name):
+ """
+ Sets the Actuator with which to operate. If there is no Actuator
+ of this name, the function has no effect.
+
+ @param name: actuator name
+ @type name: string
+ """
diff --git a/source/gameengine/PyDoc/KX_CameraActuator.py b/source/gameengine/PyDoc/KX_CameraActuator.py
index 032fc7338ac..9a9abaf3d57 100644
--- a/source/gameengine/PyDoc/KX_CameraActuator.py
+++ b/source/gameengine/PyDoc/KX_CameraActuator.py
@@ -8,11 +8,13 @@ class KX_CameraActuator(SCA_IActuator):
@author: snail
"""
- def getObject():
+ def getObject(name_only = 1):
"""
Returns the name of the object this actuator tracks.
- rtype: string
+ @type name_only: bool
+ @param name_only: optional argument, when 0 return a KX_GameObject
+ @rtype: string, KX_GameObject or None if no object is set
"""
def setObject(target):
@@ -20,7 +22,7 @@ class KX_CameraActuator(SCA_IActuator):
Sets the object this actuator tracks.
@param target: the object to track.
- @type target: string or L{KX_GameObject}
+ @type target: L{KX_GameObject}, string or None
"""
def getMin():
diff --git a/source/gameengine/PyDoc/KX_ConstraintActuator.py b/source/gameengine/PyDoc/KX_ConstraintActuator.py
index 9630690e572..b1c6f3c0f4e 100644
--- a/source/gameengine/PyDoc/KX_ConstraintActuator.py
+++ b/source/gameengine/PyDoc/KX_ConstraintActuator.py
@@ -4,7 +4,7 @@ from SCA_IActuator import *
class KX_ConstraintActuator(SCA_IActuator):
"""
- A constraint actuator limits the position or orientation of an object.
+ A constraint actuator limits the position, rotation, distance or orientation of an object.
"""
def setDamp(time):
"""
@@ -24,7 +24,7 @@ class KX_ConstraintActuator(SCA_IActuator):
"""
Sets the lower bound of the constraint.
- For rotational constraints, lower is specified in degrees.
+ For rotational and orientation constraints, lower is specified in degrees.
@type lower: float
"""
@@ -32,7 +32,7 @@ class KX_ConstraintActuator(SCA_IActuator):
"""
Gets the lower bound of the constraint.
- For rotational constraints, the lower bound is returned in radians.
+ For rotational and orientation constraints, the lower bound is returned in radians.
@rtype: float
"""
@@ -40,7 +40,7 @@ class KX_ConstraintActuator(SCA_IActuator):
"""
Sets the upper bound of the constraint.
- For rotational constraints, upper is specified in degrees.
+ For rotational and orientation constraints, upper is specified in degrees.
@type upper: float
"""
@@ -48,7 +48,7 @@ class KX_ConstraintActuator(SCA_IActuator):
"""
Gets the upper bound of the constraint.
- For rotational constraints, the upper bound is returned in radians.
+ For rotational and orientation constraints, the upper bound is returned in radians.
@rtype: float
"""
@@ -60,6 +60,9 @@ class KX_ConstraintActuator(SCA_IActuator):
@param limit: Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ,
Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ
+ Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ,
+ KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ,
+ Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ
"""
def getLimit():
"""
@@ -68,5 +71,110 @@ class KX_ConstraintActuator(SCA_IActuator):
See module L{GameLogic} for valid constraints.
@return: Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ,
- Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ
+ Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ,
+ Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ,
+ KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ,
+ Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ
"""
+ def setRotDamp(duration):
+ """
+ Sets the time constant of the orientation constraint.
+
+ @param duration: If the duration is negative, it is set to 0.
+ @type duration: integer
+ """
+ def getRotDamp():
+ """
+ Returns the damping time for application of the constraint.
+
+ @rtype: integer
+ """
+ def setDirection(vector):
+ """
+ Sets the reference direction in world coordinate for the orientation constraint
+
+ @type vector: 3-tuple
+ """
+ def getDirection():
+ """
+ Returns the reference direction of the orientation constraint in world coordinate.
+
+ @rtype: 3-tuple
+ """
+ def setOption(option):
+ """
+ Sets several options of the distance constraint.
+
+ @type option: integer
+ @param option: Binary combination of the following values:
+ 64 : Activate alignment to surface
+ 128 : Detect material rather than property
+ 256 : No deactivation if ray does not hit target
+ 512 : Activate distance control
+ """
+ def getOption():
+ """
+ Returns the option parameter.
+
+ @rtype: integer
+ """
+ def setTime(duration):
+ """
+ Sets the activation time of the actuator.
+
+ @type duration: integer
+ @param duration: The actuator disables itself after this many frame.
+ If set to 0 or negative, the actuator is not limited in time.
+ """
+ def getTime():
+ """
+ Returns the time parameter.
+
+ @rtype: integer
+ """
+ def setProperty(property):
+ """
+ Sets the name of the property or material for the ray detection of the distance constraint.
+
+ @type property: string
+ @param property: If empty, the ray will detect any collisioning object.
+ """
+ def getProperty():
+ """
+ Returns the property parameter.
+
+ @rtype: string
+ """
+ def setDistance(distance):
+ """
+ Sets the target distance in distance constraint.
+
+ @type distance: float
+ """
+ def getDistance():
+ """
+ Returns the distance parameter.
+
+ @rtype: float
+ """
+ def setRayLength(length):
+ """
+ Sets the maximum ray length of the distance constraint.
+
+ @type length: float
+ """
+ def getRayLength():
+ """
+ Returns the length of the ray
+
+ @rtype: float
+ """
+
+
+
+
+
+
+
+
+
diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py
index 8f17cf26f15..9729b14a43f 100644
--- a/source/gameengine/PyDoc/KX_GameObject.py
+++ b/source/gameengine/PyDoc/KX_GameObject.py
@@ -30,11 +30,11 @@ class KX_GameObject:
Delete this object, can be used inpace of the EndObject Actuator.
The actual removal of the object from the scene is delayed.
"""
- def getVisible(visible):
+ def getVisible():
"""
Gets the game object's visible flag.
- @type visible: boolean
+ @rtype: boolean
"""
def setVisible(visible):
"""
@@ -49,12 +49,12 @@ class KX_GameObject:
@rtype: int
@return: the objects state.
"""
- def setState():
+ def setState(state):
"""
- Sets the game object's visible flag.
+ Sets the game object's state flag.
The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29)
- @type visible: boolean
+ @type state: integer
"""
def setPosition(pos):
"""
@@ -135,6 +135,26 @@ class KX_GameObject:
@param local: - False: you get the "global" velocity ie: relative to world orientation (default).
- True: you get the "local" velocity ie: relative to object orientation.
"""
+ def getAngularVelocity(local = 0):
+ """
+ Gets the game object's angular velocity.
+
+ @type local: boolean
+ @param local: - False: you get the "global" velocity ie: relative to world orientation (default).
+ - True: you get the "local" velocity ie: relative to object orientation.
+ @rtype: list [vx, vy, vz]
+ @return: the object's angular velocity.
+ """
+ def setAngularVelocity(velocity, local = 0):
+ """
+ Sets the game object's angular velocity.
+
+ @type velocity: 3d vector.
+ @param velocity: angular velocity vector.
+ @type local: boolean
+ @param local: - False: you get the "global" velocity ie: relative to world orientation (default).
+ - True: you get the "local" velocity ie: relative to object orientation.
+ """
def getVelocity(point):
"""
Gets the game object's velocity at the specified point.
@@ -253,6 +273,16 @@ class KX_GameObject:
@type other: L{KX_GameObject} or list [x, y, z]
@rtype: float
"""
+ def getVectTo(other):
+ """
+ Returns the vector and the distance to another object or point.
+ The vector is normalized unless the distance is 0, in which a NULL vector is returned.
+
+ @param other: a point or another L{KX_GameObject} to get the vector and distance to.
+ @type other: L{KX_GameObject} or list [x, y, z]
+ @rtype: 3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z))
+ @return: (distance, globalVector(3), localVector(3))
+ """
def rayCastTo(other,dist,prop):
"""
Look towards another point/object and find first object hit within dist that matches prop.
@@ -270,11 +300,13 @@ class KX_GameObject:
@rtype: L{KX_GameObject}
@return: the first object hit or None if no object or object does not match prop
"""
- def rayCast(to,from,dist,prop):
+ def rayCast(objto,objfrom,dist,prop,face,xray,poly):
"""
Look from a point/object to another point/object and find first object hit within dist that matches prop.
- Returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
- Ex:
+ if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
+ if poly is 1, returns a 4-tuple with in addition a L{KX_PolyProxy} as 4th element.
+
+ Ex::
# shoot along the axis gun-gunAim (gunAim should be collision-free)
ob,point,normal = gun.rayCast(gunAim,None,50)
if ob:
@@ -282,21 +314,42 @@ class KX_GameObject:
Notes:
The ray ignores the object on which the method is called.
- If is casted from/to object center or explicit [x,y,z] points.
- The ray does not have X-Ray capability: the first object hit (other than self object) stops the ray
- If a property was specified and the first object hit does not have that property, there is no hit
- The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
+ It is casted from/to object center or explicit [x,y,z] points.
+
+ The face paremeter determines the orientation of the normal::
+ 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
+ 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
+
+ The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
+ The prop and xray parameters interact as follow::
+ prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
+ prop off, xray on : idem.
+ prop on, xray off: return closest hit if it matches prop, no hit otherwise.
+ prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
+ The L{KX_PolyProxy} 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray.
+ If there is no hit or the hit object is not a static mesh, None is returned as 4th element.
+
+ The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects.
- @param to: [x,y,z] or object to which the ray is casted
- @type to: L{KX_GameObject} or 3-tuple
- @param from: [x,y,z] or object from which the ray is casted; None or omitted => use self object center
- @type from: L{KX_GameObject} or 3-tuple or None
+ @param objto: [x,y,z] or object to which the ray is casted
+ @type objto: L{KX_GameObject} or 3-tuple
+ @param objfrom: [x,y,z] or object from which the ray is casted; None or omitted => use self object center
+ @type objfrom: L{KX_GameObject} or 3-tuple or None
@param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to
@type dist: float
@param prop: property name that object must have; can be omitted => detect any object
@type prop: string
- @rtype: 3-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz))
- @return: (object,hitpoint,hitnormal) or (None,None,None)
+ @param face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin
+ @type face: int
+ @param xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object
+ @type xray: int
+ @param poly: polygon option: 1=>return value is a 4-tuple and the 4th element is a L{KX_PolyProxy}
+ @type poly: int
+ @rtype: 3-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz))
+ or 4-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), L{KX_PolyProxy})
+ @return: (object,hitpoint,hitnormal) or (object,hitpoint,hitnormal,polygon)
+ If no hit, returns (None,None,None) or (None,None,None,None)
+ If the object hit is not a static mesh, polygon is None
"""
diff --git a/source/gameengine/PyDoc/KX_IpoActuator.py b/source/gameengine/PyDoc/KX_IpoActuator.py
index da8d05ddd5e..1cdab829385 100644
--- a/source/gameengine/PyDoc/KX_IpoActuator.py
+++ b/source/gameengine/PyDoc/KX_IpoActuator.py
@@ -6,7 +6,7 @@ class KX_IpoActuator(SCA_IActuator):
"""
IPO actuator activates an animation.
"""
- def set(mode, startframe, endframe, force):
+ def set(mode, startframe, endframe, mode):
"""
Sets the properties of the actuator.
@@ -16,8 +16,8 @@ class KX_IpoActuator(SCA_IActuator):
@type startframe: integer
@param endframe: last frame to use
@type endframe: integer
- @param force: interpret this ipo as a force
- @type force: boolean (KX_TRUE, KX_FALSE)
+ @param mode: special mode
+ @type mode: integer (0=normal, 1=interpret location as force, 2=additive)
"""
def setProperty(property):
"""
@@ -62,6 +62,19 @@ class KX_IpoActuator(SCA_IActuator):
@rtype: boolean
"""
+ def setIpoAdd(add):
+ """
+ Set whether to interpret the ipo as additive rather than absolute.
+
+ @type add: boolean
+ @param add: KX_TRUE or KX_FALSE
+ """
+ def getIpoAdd():
+ """
+ Returns whether to interpret the ipo as additive rather than absolute.
+
+ @rtype: boolean
+ """
def setType(mode):
"""
Sets the operation mode of the actuator.
diff --git a/source/gameengine/PyDoc/KX_MeshProxy.py b/source/gameengine/PyDoc/KX_MeshProxy.py
index e43fa3598f0..03bc36b6ac1 100644
--- a/source/gameengine/PyDoc/KX_MeshProxy.py
+++ b/source/gameengine/PyDoc/KX_MeshProxy.py
@@ -95,6 +95,21 @@ class KX_MeshProxy:
@rtype: L{KX_VertexProxy}
@return: a vertex object.
"""
+ def getNumPolygons():
+ """
+ Returns the number of polygon in the mesh.
+
+ @rtype: integer
+ """
+ def getPolygon(index):
+ """
+ Gets the specified polygon from the mesh.
+
+ @type index: integer
+ @param index: polygon number
+ @rtype: L{KX_PolyProxy}
+ @return: a polygon object.
+ """
def reinstancePhysicsMesh():
"""
Updates the physics system with the changed mesh.
diff --git a/source/gameengine/PyDoc/KX_ObjectActuator.py b/source/gameengine/PyDoc/KX_ObjectActuator.py
index 532c18eea5c..b7b76473292 100644
--- a/source/gameengine/PyDoc/KX_ObjectActuator.py
+++ b/source/gameengine/PyDoc/KX_ObjectActuator.py
@@ -6,6 +6,7 @@ class KX_ObjectActuator(SCA_IActuator):
"""
The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement,
velocity, or angular velocity to an object.
+ Servo control allows to regulate force to achieve a certain speed target.
"""
def getForce():
"""
@@ -107,15 +108,15 @@ class KX_ObjectActuator(SCA_IActuator):
def getLinearVelocity():
"""
Returns the linear velocity applied by the actuator.
+ For the servo control actuator, this is the target speed.
@rtype: list [vx, vy, vz, local]
- @return: A four item list, containing the vector velocity, and whether
- the velocity is applied in local coordinates (True) or world
- coordinates (False)
+ @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False)
"""
def setLinearVelocity(vx, vy, vz, local):
"""
Sets the linear velocity applied by the actuator.
+ For the servo control actuator, sets the target speed.
@type vx: float
@param vx: the x component of the velocity vector.
@@ -124,8 +125,8 @@ class KX_ObjectActuator(SCA_IActuator):
@type vz: float
@param vz: the z component of the velocity vector.
@type local: boolean
- @param local: - False: the velocity vector is applied in world coordinates.
- - True: the velocity vector is applied in local coordinates.
+ @param local: - False: the velocity vector is in world coordinates.
+ - True: the velocity vector is in local coordinates.
"""
def getAngularVelocity():
"""
@@ -150,5 +151,100 @@ class KX_ObjectActuator(SCA_IActuator):
@param local: - False: the velocity vector is applied in world coordinates.
- True: the velocity vector is applied in local coordinates.
"""
+ def getDamping():
+ """
+ Returns the damping parameter of the servo controller.
+
+ @rtype: integer
+ @return: the time constant of the servo controller in frame unit.
+ """
+ def setDamping(damp):
+ """
+ Sets the damping parameter of the servo controller.
+
+ @type damp: integer
+ @param damp: the damping parameter in frame unit.
+ """
+ def getForceLimitX():
+ """
+ Returns the min/max force limit along the X axis used by the servo controller.
+
+ @rtype: list [min, max, enabled]
+ @return: A three item list, containing the min and max limits of the force as float
+ and whether the limits are active(true) or inactive(true)
+ """
+ def setForceLimitX(min, max, enable):
+ """
+ Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
+
+ @type min: float
+ @param min: the minimum value of the force along the X axis.
+ @type max: float
+ @param max: the maximum value of the force along the X axis.
+ @type enable: boolean
+ @param enable: - True: the force will be limited to the min/max
+ - False: the force will not be limited
+ """
+ def getForceLimitY():
+ """
+ Returns the min/max force limit along the Y axis used by the servo controller.
+
+ @rtype: list [min, max, enabled]
+ @return: A three item list, containing the min and max limits of the force as float
+ and whether the limits are active(true) or inactive(true)
+ """
+ def setForceLimitY(min, max, enable):
+ """
+ Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
+
+ @type min: float
+ @param min: the minimum value of the force along the Y axis.
+ @type max: float
+ @param max: the maximum value of the force along the Y axis.
+ @type enable: boolean
+ @param enable: - True: the force will be limited to the min/max
+ - False: the force will not be limited
+ """
+ def getForceLimitZ():
+ """
+ Returns the min/max force limit along the Z axis used by the servo controller.
+
+ @rtype: list [min, max, enabled]
+ @return: A three item list, containing the min and max limits of the force as float
+ and whether the limits are active(true) or inactive(true)
+ """
+ def setForceLimitZ(min, max, enable):
+ """
+ Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
+
+ @type min: float
+ @param min: the minimum value of the force along the Z axis.
+ @type max: float
+ @param max: the maximum value of the force along the Z axis.
+ @type enable: boolean
+ @param enable: - True: the force will be limited to the min/max
+ - False: the force will not be limited
+ """
+ def getPID():
+ """
+ Returns the PID coefficient of the servo controller.
+
+ @rtype: list [P, I, D]
+ @return: A three item list, containing the PID coefficient as floats:
+ P : proportional coefficient
+ I : Integral coefficient
+ D : Derivate coefficient
+ """
+ def setPID(P, I, D):
+ """
+ Sets the PID coefficients of the servo controller.
+
+ @type P: flat
+ @param P: proportional coefficient
+ @type I: float
+ @param I: Integral coefficient
+ @type D: float
+ @param D: Derivate coefficient
+ """
diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py
index f45bb5d20b1..6d6e0937257 100644
--- a/source/gameengine/PyDoc/KX_ParentActuator.py
+++ b/source/gameengine/PyDoc/KX_ParentActuator.py
@@ -12,11 +12,12 @@ class KX_ParentActuator(SCA_IActuator):
Object can be either a L{KX_GameObject} or the name of the object.
- @type object: L{KX_GameObject} or string
+ @type object: L{KX_GameObject}, string or None
"""
- def getObject():
+ def getObject(name_only = 1):
"""
Returns the name of the object to change to.
-
- @rtype: string
+ @type name_only: bool
+ @param name_only: optional argument, when 0 return a KX_GameObject
+ @rtype: string, KX_GameObject or None if no object is set
"""
diff --git a/source/gameengine/PyDoc/KX_PolyProxy.py b/source/gameengine/PyDoc/KX_PolyProxy.py
new file mode 100644
index 00000000000..bcd42c2ac2e
--- /dev/null
+++ b/source/gameengine/PyDoc/KX_PolyProxy.py
@@ -0,0 +1,100 @@
+# $Id$
+# Documentation for the polygon proxy class
+
+class KX_PolyProxy:
+ """
+ A polygon holds the index of the vertex forming the poylgon.
+
+ Note:
+ The polygon attributes are read-only, you need to retrieve the vertex proxy if you want
+ to change the vertex settings.
+
+ @ivar matname: The name of polygon material, empty if no material.
+ @type matname: string
+ @ivar material: The material of the polygon
+ @type material: L{KX_PolygonMaterial} or KX_BlenderMaterial
+ @ivar texture: The texture name of the polygon.
+ @type texture: string
+ @ivar matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
+ @type matid: integer
+ @ivar v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
+ @type v1: integer
+ @ivar v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
+ @type v2: integer
+ @ivar v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
+ @type v3: integer
+ @ivar v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
+ use this to retrieve vertex proxy from mesh proxy
+ @type v4: integer
+ @ivar visible: visible state of the polygon: 1=visible, 0=invisible
+ @type visible: integer
+ @ivar collide: collide state of the polygon: 1=receives collision, 0=collision free.
+ @type collide: integer
+ """
+
+ def getMaterialName():
+ """
+ Returns the polygon material name with MA prefix
+
+ @rtype: string
+ @return: material name
+ """
+ def getMaterial():
+ """
+ Returns the polygon material
+
+ @rtype: L{KX_PolygonMaterial} or KX_BlenderMaterial
+ """
+ def getTextureName():
+ """
+ Returns the polygon texture name
+
+ @rtype: string
+ @return: texture name
+ """
+ def getMaterialIndex():
+ """
+ Returns the material bucket index of the polygon.
+ This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}.
+
+ @rtype: integer
+ @return: the material index in the mesh
+ """
+ def getNumVertex():
+ """
+ Returns the number of vertex of the polygon.
+
+ @rtype: integer
+ @return: number of vertex, 3 or 4.
+ """
+ def isVisible():
+ """
+ Returns whether the polygon is visible or not
+
+ @rtype: integer
+ @return: 0=invisible, 1=visible
+ """
+ def isCollider():
+ """
+ Returns whether the polygon is receives collision or not
+
+ @rtype: integer
+ @return: 0=collision free, 1=receives collision
+ """
+ def getVertexIndex(vertex):
+ """
+ Returns the mesh vertex index of a polygon vertex
+ This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}.
+
+ @type vertex: integer
+ @param vertex: index of the vertex in the polygon: 0->3
+ @rtype: integer
+ @return: mesh vertex index
+ """
+ def getMesh():
+ """
+ Returns a mesh proxy
+
+ @rtype: L{KX_MeshProxy}
+ @return: mesh proxy
+ """
diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
index 44f9e051c8c..c3b2e947ddb 100644
--- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
+++ b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
@@ -13,7 +13,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator):
C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)}
"""
- def setObject(obj):
+ def setObject(object):
"""
Sets the game object to add.
@@ -21,17 +21,18 @@ class KX_SCA_AddObjectActuator(SCA_IActuator):
If the object does not exist, this function is ignored.
- obj can either be a L{KX_GameObject} or the name of an object.
+ object can either be a L{KX_GameObject} or the name of an object or None.
- @type obj: L{KX_GameObject} or string
+ @type object: L{KX_GameObject}, string or None
"""
- def getObject():
+ def getObject(name_only = 0):
"""
Returns the name of the game object to be added.
Returns None if no game object has been assigned to be added.
-
- @rtype: string
+ @type name_only: bool
+ @param name_only: optional argument, when 0 return a KX_GameObject
+ @rtype: string, KX_GameObject or None if no object is set
"""
def setTime(time):
"""
@@ -65,6 +66,23 @@ class KX_SCA_AddObjectActuator(SCA_IActuator):
@rtype: list [vx, vy, vz]
"""
+ def setAngularVelocity(vx, vy, vz):
+ """
+ Sets the initial angular velocity of added objects.
+
+ @type vx: float
+ @param vx: the x component of the initial angular velocity.
+ @type vy: float
+ @param vy: the y component of the initial angular velocity.
+ @type vz: float
+ @param vz: the z component of the initial angular velocity.
+ """
+ def getAngularVelocity():
+ """
+ Returns the initial angular velocity of added objects.
+
+ @rtype: list [vx, vy, vz]
+ """
def getLastCreatedObject():
"""
Returns the last object created by this actuator.
diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py
index eb00a91a4ce..498f6072e23 100644
--- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py
+++ b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py
@@ -59,8 +59,9 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator):
def setMesh(name):
"""
Sets the name of the mesh that will replace the current one.
+ When the name is None it will unset the mesh value so no action is taken.
- @type name: string
+ @type name: string or None
"""
def getMesh():
"""
@@ -68,6 +69,6 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator):
Returns None if no mesh has been scheduled to be added.
- @rtype: string
+ @rtype: string or None
"""
diff --git a/source/gameengine/PyDoc/KX_StateActuator.py b/source/gameengine/PyDoc/KX_StateActuator.py
new file mode 100644
index 00000000000..fb6ae5a3621
--- /dev/null
+++ b/source/gameengine/PyDoc/KX_StateActuator.py
@@ -0,0 +1,26 @@
+# $Id$
+# Documentation for KX_StateActuator
+from SCA_IActuator import *
+
+class KX_StateActuator(SCA_IActuator):
+ """
+ State actuator changes the state mask of parent object.
+ """
+ def setOperation(op):
+ """
+ Set the type of bit operation to be applied on object state mask.
+ Use setMask() to specify the bits that will be modified.
+
+ @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert)
+ @type op: integer
+ """
+ def setMask(mask):
+ """
+ Set the value that defines the bits that will be modified by the operation.
+ The bits that are 1 in the value will be updated in the object state,
+ the bits that are 0 are will be left unmodified expect for the Copy operation
+ which copies the value to the object state.
+
+ @param mask: bits that will be modified
+ @type mask: integer
+ """
diff --git a/source/gameengine/PyDoc/KX_TrackToActuator.py b/source/gameengine/PyDoc/KX_TrackToActuator.py
index 39fb99ec2e2..948302991b7 100644
--- a/source/gameengine/PyDoc/KX_TrackToActuator.py
+++ b/source/gameengine/PyDoc/KX_TrackToActuator.py
@@ -18,16 +18,16 @@ class KX_TrackToActuator(SCA_IActuator):
"""
Sets the object to track.
- @type object: L{KX_GameObject} or string
+ @type object: L{KX_GameObject}, string or None
@param object: Either a reference to a game object or the name of the object to track.
"""
- def getObject():
+ def getObject(name_only):
"""
Returns the name of the object to track.
- Returns None if no object has been set to track.
-
- @rtype: string
+ @type name_only: bool
+ @param name_only: optional argument, when 0 return a KX_GameObject
+ @rtype: string, KX_GameObject or None if no object is set
"""
def setTime(time):
"""
diff --git a/source/gameengine/PyDoc/Rasterizer.py b/source/gameengine/PyDoc/Rasterizer.py
index f0e48b6ed43..7afdcf07f2e 100644
--- a/source/gameengine/PyDoc/Rasterizer.py
+++ b/source/gameengine/PyDoc/Rasterizer.py
@@ -84,7 +84,8 @@ def setMousePosition(x, y):
"""
Sets the mouse cursor position.
- @type x, y: integer
+ @type x: integer
+ @type y: integer
"""
def setBackgroundColor(rgba):
@@ -145,3 +146,20 @@ def getFocalLength():
@rtype: float
"""
+
+def setGLSLMaterialSetting(setting, enable):
+ """
+ Enables or disables a GLSL material setting.
+
+ @type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
+ @type enable: boolean
+ """
+
+def getGLSLMaterialSetting(setting, enable):
+ """
+ Get the state of a GLSL material setting.
+
+ @type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
+ @rtype: boolean
+ """
+
diff --git a/source/gameengine/PyDoc/SCA_DelaySensor.py b/source/gameengine/PyDoc/SCA_DelaySensor.py
new file mode 100644
index 00000000000..19df589ea7b
--- /dev/null
+++ b/source/gameengine/PyDoc/SCA_DelaySensor.py
@@ -0,0 +1,56 @@
+# $Id$
+# Documentation for SCA_DelaySensor
+from SCA_ISensor import *
+
+class SCA_DelaySensor(SCA_ISensor):
+ """
+ The Delay sensor generates positive and negative triggers at precise time,
+ expressed in number of frames. The delay parameter defines the length
+ of the initial OFF period. A positive trigger is generated at the end of this period.
+ The duration parameter defines the length of the ON period following the OFF period.
+ There is a negative trigger at the end of the ON period. If duration is 0, the sensor
+ stays ON and there is no negative trigger.
+ The sensor runs the OFF-ON cycle once unless the repeat option is set: the
+ OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0).
+ Use SCA_ISensor::reset() at any time to restart sensor.
+ """
+ def setDelay(delay):
+ """
+ Set the initial delay before the positive trigger.
+
+ @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger
+ @type delay: integer
+ """
+ def setDuration(duration):
+ """
+ Set the duration of the ON pulse after initial delay and the generation of the positive trigger.
+ If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
+
+ @param duration: length of the ON period in number of frame after the initial OFF period
+ @type duration: integer
+ """
+ def setRepeat(repeat):
+ """
+ Set if the sensor repeat mode.
+
+ @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
+ @type repeat: integer
+ """
+ def getDelay():
+ """
+ Return the delay parameter value.
+
+ @rtype: integer
+ """
+ def getDuration():
+ """
+ Return the duration parameter value
+
+ @rtype: integer
+ """
+ def getRepeat():
+ """
+ Return the repeat parameter value
+
+ @rtype: KX_TRUE or KX_FALSE
+ """
diff --git a/source/gameengine/PyDoc/SCA_ISensor.py b/source/gameengine/PyDoc/SCA_ISensor.py
index b96d8c8c075..14858505e24 100644
--- a/source/gameengine/PyDoc/SCA_ISensor.py
+++ b/source/gameengine/PyDoc/SCA_ISensor.py
@@ -9,7 +9,12 @@ class SCA_ISensor(SCA_ILogicBrick):
def isPositive():
"""
- True if this sensor brick has been activated.
+ True if this sensor brick is in a positive state.
+ """
+
+ def isTriggered():
+ """
+ True if this sensor brick has triggered the current controller.
"""
def getUsePosPulseMode():
@@ -59,4 +64,28 @@ class SCA_ISensor(SCA_ILogicBrick):
@type invert: boolean
@param invert: true if activates on negative events; false if activates on positive events.
"""
+ def getLevel():
+ """
+ Returns whether this sensor is a level detector or a edge detector.
+ It makes a difference only in case of logic state transition (state actuator).
+ A level detector will immediately generate a pulse, negative or positive
+ depending on the sensor condition, as soon as the state is activated.
+ A edge detector will wait for a state change before generating a pulse.
+
+ @rtype: boolean
+ @return: true if sensor is level sensitive, false if it is edge sensitive
+ """
+ def setLevel(level):
+ """
+ Set whether to detect level or edge transition when entering a state.
+
+ @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE)
+ @type level: boolean
+ """
+ def reset():
+ """
+ Reset sensor internal state, effect depends on the type of sensor and settings.
+
+ The sensor is put in its initial state as if it was just activated.
+ """
diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile
index e3b1f274ee5..917f70c7108 100644
--- a/source/gameengine/Rasterizer/Makefile
+++ b/source/gameengine/Rasterizer/Makefile
@@ -49,10 +49,6 @@ ifeq ($(OS),darwin)
CPPFLAGS += -fpascal-strings
endif
-ifeq ($(WITH_BF_GLEXT),true)
- CPPFLAGS += -DWITH_GLEXT
-endif
-
###############
SOURCEDIR = source/gameengine/Rasterizer
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index b4492ca03a9..9fb21a3c17b 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -26,10 +26,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// don't show these anoying STL warnings
#pragma warning (disable:4786)
@@ -39,159 +35,245 @@
#include "RAS_MaterialBucket.h"
#include "STR_HashedString.h"
#include "RAS_MeshObject.h"
-#define KX_NUM_MATERIALBUCKETS 100
#include "RAS_IRasterizer.h"
#include "RAS_IRenderTools.h"
#include "RAS_BucketManager.h"
+#include <algorithm>
#include <set>
-RAS_BucketManager::RAS_BucketManager()
+/* sorting */
+
+struct RAS_BucketManager::sortedmeshslot
{
+public:
+ MT_Scalar m_z; /* depth */
+ RAS_MeshSlot *m_ms; /* mesh slot */
+ RAS_MaterialBucket *m_bucket; /* buck mesh slot came from */
-}
+ sortedmeshslot() {}
-RAS_BucketManager::~RAS_BucketManager()
-{
- RAS_BucketManagerClearAll();
-}
+ void set(RAS_MeshSlot *ms, RAS_MaterialBucket *bucket, const MT_Vector3& pnorm)
+ {
+ // would be good to use the actual bounding box center instead
+ MT_Point3 pos(ms->m_OpenGLMatrix[12], ms->m_OpenGLMatrix[13], ms->m_OpenGLMatrix[14]);
-/**
- * struct alphamesh holds a mesh, (m_ms) it's depth, (m_z) and the bucket it came from (m_bucket.)
- */
-struct RAS_BucketManager::alphamesh
-{
-public:
- MT_Scalar m_z;
- RAS_MaterialBucket::T_MeshSlotList::iterator m_ms;
- RAS_MaterialBucket *m_bucket;
- alphamesh(MT_Scalar z, RAS_MaterialBucket::T_MeshSlotList::iterator &ms, RAS_MaterialBucket *bucket) :
- m_z(z),
- m_ms(ms),
- m_bucket(bucket)
- {}
+ m_z = MT_dot(pnorm, pos);
+ m_ms = ms;
+ m_bucket = bucket;
+ }
};
struct RAS_BucketManager::backtofront
{
- bool operator()(const alphamesh &a, const alphamesh &b)
+ bool operator()(const sortedmeshslot &a, const sortedmeshslot &b)
{
- return a.m_z < b.m_z;
+ return (a.m_z < b.m_z) || (a.m_z == b.m_z && a.m_ms < b.m_ms);
}
};
+
+struct RAS_BucketManager::fronttoback
+{
+ bool operator()(const sortedmeshslot &a, const sortedmeshslot &b)
+ {
+ return (a.m_z > b.m_z) || (a.m_z == b.m_z && a.m_ms > b.m_ms);
+ }
+};
+
+/* bucket manager */
+
+RAS_BucketManager::RAS_BucketManager()
+{
+
+}
+
+RAS_BucketManager::~RAS_BucketManager()
+{
+ BucketList::iterator it;
+
+ for (it = m_SolidBuckets.begin(); it != m_SolidBuckets.end(); it++)
+ delete (*it);
+
+ for (it = m_AlphaBuckets.begin(); it != m_AlphaBuckets.end(); it++)
+ delete(*it);
+ m_SolidBuckets.clear();
+ m_AlphaBuckets.clear();
+}
+
+void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList& buckets, vector<sortedmeshslot>& slots, bool alpha)
+{
+ BucketList::iterator bit;
+ list<RAS_MeshSlot>::iterator mit;
+ size_t size = 0, i = 0;
+
+ /* Camera's near plane equation: pnorm.dot(point) + pval,
+ * but we leave out pval since it's constant anyway */
+ const MT_Vector3 pnorm(cameratrans.getBasis()[2]);
+
+ for (bit = buckets.begin(); bit != buckets.end(); ++bit)
+ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit)
+ if (!mit->IsCulled())
+ size++;
+
+ slots.resize(size);
+
+ for (bit = buckets.begin(); bit != buckets.end(); ++bit)
+ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit)
+ if (!mit->IsCulled())
+ slots[i++].set(&*mit, *bit, pnorm);
+
+ if(alpha)
+ sort(slots.begin(), slots.end(), backtofront());
+ else
+ sort(slots.begin(), slots.end(), fronttoback());
+}
+
+//static int TOTASLOT = 0;
+//static int TOTSLOT = 0;
void RAS_BucketManager::RenderAlphaBuckets(
const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools)
{
- BucketList::iterator bit;
- std::multiset<alphamesh, backtofront> alphameshset;
- RAS_MaterialBucket::T_MeshSlotList::iterator mit;
+ vector<sortedmeshslot> slots;
+ vector<sortedmeshslot>::iterator sit;
+
+ // Having depth masks disabled/enabled gives different artifacts in
+ // case no sorting is done or is done inexact. For compatibility, we
+ // disable it.
+ rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_DISABLED);
+
+ OrderBuckets(cameratrans, m_AlphaBuckets, slots, true);
- /* Camera's near plane equation: cam_norm.dot(point) + cam_origin */
- const MT_Vector3 cam_norm(cameratrans.getBasis()[2]);
- const MT_Scalar cam_origin = cameratrans.getOrigin()[2];
- for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit)
- {
- (*bit)->ClearScheduledPolygons();
- for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit)
- {
- if ((*mit).m_bVisible)
- {
- MT_Point3 pos((*mit).m_OpenGLMatrix[12], (*mit).m_OpenGLMatrix[13], (*mit).m_OpenGLMatrix[14]);
- alphameshset.insert(alphamesh(MT_dot(cam_norm, pos) + cam_origin, mit, *bit));
- }
+ for(sit=slots.begin(); sit!=slots.end(); ++sit) {
+ rendertools->SetClientObject(rasty, sit->m_ms->m_clientObj);
+
+ while(sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools)) {
+ sit->m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(sit->m_ms));
+ //TOTASLOT++;
}
}
-
- // It shouldn't be strictly necessary to disable depth writes; but
- // it is needed for compatibility.
- rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_DISABLED);
- RAS_IRasterizer::DrawMode drawingmode;
- std::multiset< alphamesh, backtofront>::iterator msit = alphameshset.begin();
- for (; msit != alphameshset.end(); ++msit)
- {
- rendertools->SetClientObject((*(*msit).m_ms).m_clientObj);
- while ((*msit).m_bucket->ActivateMaterial(cameratrans, rasty, rendertools, drawingmode))
- (*msit).m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(*msit).m_ms, drawingmode);
- }
-
rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_ENABLED);
}
-void RAS_BucketManager::Renderbuckets(
+void RAS_BucketManager::RenderSolidBuckets(
const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools)
{
- BucketList::iterator bucket;
-
- rasty->EnableTextures(false);
+ BucketList::iterator bit;
+ list<RAS_MeshSlot>::iterator mit;
+
rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_ENABLED);
-
- // beginning each frame, clear (texture/material) caching information
- rasty->ClearCachingInfo();
- RAS_MaterialBucket::StartFrame();
- for (bucket = m_MaterialBuckets.begin(); bucket != m_MaterialBuckets.end(); ++bucket)
- {
- (*bucket)->ClearScheduledPolygons();
+ for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) {
+ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
+ if (mit->IsCulled())
+ continue;
+
+ rendertools->SetClientObject(rasty, mit->m_clientObj);
+
+ while ((*bit)->ActivateMaterial(cameratrans, rasty, rendertools)) {
+ (*bit)->RenderMeshSlot(cameratrans, rasty, rendertools, *mit);
+ //TOTSLOT++;
+ }
+ }
}
- for (bucket = m_MaterialBuckets.begin(); bucket != m_MaterialBuckets.end(); ++bucket)
- {
- RAS_IPolyMaterial *tmp = (*bucket)->GetPolyMaterial();
- if(tmp->IsZSort() || tmp->GetFlag() &RAS_FORCEALPHA )
- rasty->SetAlphaTest(true);
- else
- rasty->SetAlphaTest(false);
+#if 0
+ vector<sortedmeshslot> slots;
+ vector<sortedmeshslot>::iterator sit;
- (*bucket)->Render(cameratrans,rasty,rendertools);
+ OrderBuckets(cameratrans, m_SolidBuckets, slots, false);
+
+ for(sit=slots.begin(); sit!=slots.end(); ++sit) {
+ rendertools->SetClientObject(rasty, sit->m_ms->m_clientObj);
+
+ while(sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools))
+ sit->m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(sit->m_ms));
}
- rasty->SetAlphaTest(false);
+#endif
+}
+void RAS_BucketManager::Renderbuckets(
+ const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools)
+{
+ // beginning each frame, clear (texture/material) caching information
+ rasty->ClearCachingInfo();
+
+ //TOTASLOT = 0;
+ //TOTSLOT = 0;
+
+ RenderSolidBuckets(cameratrans, rasty, rendertools);
RenderAlphaBuckets(cameratrans, rasty, rendertools);
- RAS_MaterialBucket::EndFrame();
+
+ //printf("total slots = %d = %d + %d\n", TOTSLOT + TOTASLOT, TOTSLOT, TOTASLOT);
+
+ rendertools->SetClientObject(rasty, NULL);
}
-RAS_MaterialBucket* RAS_BucketManager::RAS_BucketManagerFindBucket(RAS_IPolyMaterial * material, bool &bucketCreated)
+RAS_MaterialBucket* RAS_BucketManager::FindBucket(RAS_IPolyMaterial * material, bool &bucketCreated)
{
- bucketCreated = false;
BucketList::iterator it;
- for (it = m_MaterialBuckets.begin(); it != m_MaterialBuckets.end(); it++)
- {
+
+ bucketCreated = false;
+
+ for (it = m_SolidBuckets.begin(); it != m_SolidBuckets.end(); it++)
if (*(*it)->GetPolyMaterial() == *material)
return *it;
- }
for (it = m_AlphaBuckets.begin(); it != m_AlphaBuckets.end(); it++)
- {
if (*(*it)->GetPolyMaterial() == *material)
return *it;
- }
RAS_MaterialBucket *bucket = new RAS_MaterialBucket(material);
bucketCreated = true;
- if (bucket->IsTransparant())
+
+ if (bucket->IsAlpha())
m_AlphaBuckets.push_back(bucket);
else
- m_MaterialBuckets.push_back(bucket);
+ m_SolidBuckets.push_back(bucket);
return bucket;
}
-void RAS_BucketManager::RAS_BucketManagerClearAll()
+void RAS_BucketManager::OptimizeBuckets(MT_Scalar distance)
{
- BucketList::iterator it;
- for (it = m_MaterialBuckets.begin(); it != m_MaterialBuckets.end(); it++)
- {
- delete (*it);
- }
- for (it = m_AlphaBuckets.begin(); it != m_AlphaBuckets.end(); it++)
- {
- delete(*it);
+ BucketList::iterator bit;
+
+ distance = 10.0;
+
+ for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit)
+ (*bit)->Optimize(distance);
+ for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit)
+ (*bit)->Optimize(distance);
+}
+
+void RAS_BucketManager::ReleaseDisplayLists(RAS_IPolyMaterial *mat)
+{
+ BucketList::iterator bit;
+ list<RAS_MeshSlot>::iterator mit;
+
+ for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) {
+ if (mat == NULL || (mat == (*bit)->GetPolyMaterial())) {
+ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
+ if(mit->m_DisplayList) {
+ mit->m_DisplayList->Release();
+ mit->m_DisplayList = NULL;
+ }
+ }
+ }
}
- m_MaterialBuckets.clear();
- m_AlphaBuckets.clear();
+ for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) {
+ if (mat == NULL || (mat == (*bit)->GetPolyMaterial())) {
+ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
+ if(mit->m_DisplayList) {
+ mit->m_DisplayList->Release();
+ mit->m_DisplayList = NULL;
+ }
+ }
+ }
+ }
}
+
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h
index 010478b1d5b..74526f365a0 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.h
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.h
@@ -39,31 +39,33 @@
class RAS_BucketManager
{
- //GEN_Map<class RAS_IPolyMaterial,class RAS_MaterialBucket*> m_MaterialBuckets;
-
typedef std::vector<class RAS_MaterialBucket*> BucketList;
- BucketList m_MaterialBuckets;
+ BucketList m_SolidBuckets;
BucketList m_AlphaBuckets;
- struct alphamesh;
+ struct sortedmeshslot;
struct backtofront;
+ struct fronttoback;
public:
RAS_BucketManager();
virtual ~RAS_BucketManager();
- void RenderAlphaBuckets(const MT_Transform& cameratrans,
- RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
void Renderbuckets(const MT_Transform & cameratrans,
- RAS_IRasterizer* rasty,
- class RAS_IRenderTools* rendertools);
+ RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
- RAS_MaterialBucket* RAS_BucketManagerFindBucket(RAS_IPolyMaterial * material, bool &bucketCreated);
+ RAS_MaterialBucket* FindBucket(RAS_IPolyMaterial * material, bool &bucketCreated);
+ void OptimizeBuckets(MT_Scalar distance);
+ void ReleaseDisplayLists(RAS_IPolyMaterial * material = NULL);
private:
- void RAS_BucketManagerClearAll();
+ void OrderBuckets(const MT_Transform& cameratrans, BucketList& buckets, vector<sortedmeshslot>& slots, bool alpha);
+ void RenderSolidBuckets(const MT_Transform& cameratrans,
+ RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
+ void RenderAlphaBuckets(const MT_Transform& cameratrans,
+ RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools);
};
#endif //__RAS_BUCKETMANAGER
diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h b/source/gameengine/Rasterizer/RAS_CameraData.h
index 0327a3f4763..e3af43fb839 100644
--- a/source/gameengine/Rasterizer/RAS_CameraData.h
+++ b/source/gameengine/Rasterizer/RAS_CameraData.h
@@ -42,7 +42,7 @@ struct RAS_CameraData
int m_viewporttop;
float m_focallength;
- RAS_CameraData(float lens = 35., float clipstart = 0.1, float clipend = 100., bool perspective = true,
+ RAS_CameraData(float lens = 35.0, float clipstart = 0.1, float clipend = 5000.0, bool perspective = true,
float focallength = 0.0f, bool viewport = false, int viewportleft = 0, int viewportbottom = 0,
int viewportright = 0, int viewporttop = 0) :
m_lens(lens),
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
index cb10ba6bf37..fb3607f89f4 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
@@ -39,22 +39,20 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname,
int tilexrep,
int tileyrep,
int mode,
- bool transparant,
+ int transp,
+ bool alpha,
bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject=NULL) :
-
- m_texturename(texname),
+ int lightlayer)
+ : m_texturename(texname),
m_materialname(matname),
m_tile(tile),
m_tilexrep(tilexrep),
m_tileyrep(tileyrep),
m_drawingmode (mode),
- m_transparant(transparant),
+ m_transp(transp),
+ m_alpha(alpha),
m_zsort(zsort),
m_lightlayer(lightlayer),
- m_bIsTriangle(bIsTriangle),
m_polymatid(m_newpolymatid++),
m_flag(0),
m_multimode(0)
@@ -70,14 +68,16 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const
{
if(m_flag &RAS_BLENDERMAT)
{
- return (
+ bool test = (
this->m_multimode == lhs.m_multimode &&
this->m_flag == lhs.m_flag &&
this->m_drawingmode == lhs.m_drawingmode &&
- this->m_lightlayer == lhs.m_lightlayer &&
+ this->m_transp == lhs.m_transp &&
this->m_texturename.hash() == lhs.m_texturename.hash() &&
this->m_materialname.hash() == lhs.m_materialname.hash()
);
+
+ return test;
}
else
{
@@ -85,11 +85,10 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const
this->m_tile == lhs.m_tile &&
this->m_tilexrep == lhs.m_tilexrep &&
this->m_tileyrep == lhs.m_tileyrep &&
- this->m_transparant == lhs.m_transparant &&
+ this->m_transp == lhs.m_transp &&
+ this->m_alpha == lhs.m_alpha &&
this->m_zsort == lhs.m_zsort &&
this->m_drawingmode == lhs.m_drawingmode &&
- this->m_bIsTriangle == lhs.m_bIsTriangle &&
- this->m_lightlayer == lhs.m_lightlayer &&
this->m_texturename.hash() == lhs.m_texturename.hash() &&
this->m_materialname.hash() == lhs.m_materialname.hash()
);
@@ -109,9 +108,9 @@ int RAS_IPolyMaterial::GetLightLayer() const
return m_lightlayer;
}
-bool RAS_IPolyMaterial::IsTransparant() const
+bool RAS_IPolyMaterial::IsAlpha() const
{
- return m_transparant;
+ return m_alpha || m_zsort;
}
bool RAS_IPolyMaterial::IsZSort() const
@@ -119,11 +118,6 @@ bool RAS_IPolyMaterial::IsZSort() const
return m_zsort;
}
-bool RAS_IPolyMaterial::UsesTriangles() const
-{
- return m_bIsTriangle;
-}
-
unsigned int RAS_IPolyMaterial::hash() const
{
return m_texturename.hash();
@@ -139,6 +133,11 @@ const STR_String& RAS_IPolyMaterial::GetMaterialName() const
return m_materialname;
}
+dword RAS_IPolyMaterial::GetMaterialNameHash() const
+{
+ return m_materialname.hash();
+}
+
const STR_String& RAS_IPolyMaterial::GetTextureName() const
{
return m_texturename;
@@ -163,5 +162,10 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const
return dolights;
}
+bool RAS_IPolyMaterial::UsesObjectColor() const
+{
+ return !(m_flag & RAS_BLENDERGLSL);
+}
+
unsigned int RAS_IPolyMaterial::m_newpolymatid = 0;
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
index d2d1dba99d9..218dd91cb30 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
@@ -52,7 +52,7 @@ enum MaterialProps
RAS_AUTOGEN =128,
RAS_NORMAL =256,
RAS_DEFMULTI =512,
- RAS_FORCEALPHA =1024
+ RAS_BLENDERGLSL =1024
};
/**
@@ -67,10 +67,10 @@ protected:
int m_tile;
int m_tilexrep,m_tileyrep;
int m_drawingmode; // tface->mode
- bool m_transparant;
+ int m_transp;
+ bool m_alpha;
bool m_zsort;
int m_lightlayer;
- bool m_bIsTriangle;
unsigned int m_polymatid;
static unsigned int m_newpolymatid;
@@ -102,11 +102,10 @@ public:
int tilexrep,
int tileyrep,
int mode,
- bool transparant,
+ int transp,
+ bool alpha,
bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject);
+ int lightlayer);
virtual ~RAS_IPolyMaterial() {};
/**
@@ -127,21 +126,22 @@ public:
{
return false;
}
- virtual void ActivateMeshSlot(const class KX_MeshSlot & ms, RAS_IRasterizer* rasty) const {}
+ virtual void ActivateMeshSlot(const class RAS_MeshSlot & ms, RAS_IRasterizer* rasty) const {}
virtual bool Equals(const RAS_IPolyMaterial& lhs) const;
bool Less(const RAS_IPolyMaterial& rhs) const;
int GetLightLayer() const;
- bool IsTransparant() const;
+ bool IsAlpha() const;
bool IsZSort() const;
- bool UsesTriangles() const;
unsigned int hash() const;
int GetDrawingMode() const;
const STR_String& GetMaterialName() const;
+ dword GetMaterialNameHash() const;
const STR_String& GetTextureName() const;
const unsigned int GetFlag() const;
virtual bool UsesLighting(RAS_IRasterizer *rasty) const;
+ virtual bool UsesObjectColor() const;
/*
* PreCalculate texture gen
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index d4a9177a85d..1d18d02a583 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -217,39 +217,18 @@ public:
// Drawing Functions
/**
- * IndexPrimitives: Renders primitives.
- * @param vertexarrays is an array of vertex arrays
- * @param indexarrays is an array of index arrays
- * @param mode determines the type of primitive stored in the vertex/index arrays
- * @param useObjectColor will render the object using @param rgbacolor instead of
- * vertex colors.
- */
- virtual void IndexPrimitives( const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot)=0;
-
- virtual void IndexPrimitivesMulti(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot)=0;
+ * IndexPrimitives: Renders primitives from mesh slot.
+ */
+ virtual void IndexPrimitives(class RAS_MeshSlot& ms)=0;
+ virtual void IndexPrimitivesMulti(class RAS_MeshSlot& ms)=0;
/**
* IndexPrimitives_3DText will render text into the polygons.
* The text to be rendered is from @param rendertools client object's text property.
*/
- virtual void IndexPrimitives_3DText( const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
+ virtual void IndexPrimitives_3DText(class RAS_MeshSlot& ms,
class RAS_IPolyMaterial* polymat,
- class RAS_IRenderTools* rendertools,
- bool useObjectColor,
- const MT_Vector4& rgbacolor)=0;
+ class RAS_IRenderTools* rendertools)=0;
virtual void SetProjectionMatrix(MT_CmMatrix4x4 & mat)=0;
/* This one should become our final version, methinks. */
@@ -271,9 +250,6 @@ public:
virtual const MT_Point3& GetCameraPosition()=0;
/**
*/
- virtual void LoadViewMatrix()=0;
- /**
- */
virtual void SetFog(float start,
float dist,
float r,
@@ -309,9 +285,6 @@ public:
*/
virtual int GetDrawingMode()=0;
/**
- */
- virtual void EnableTextures(bool enable)=0;
- /**
* Sets face culling
*/
virtual void SetCullFace(bool enable)=0;
@@ -372,10 +345,6 @@ public:
virtual void SetAmbientColor(float red, float green, float blue)=0;
virtual void SetAmbient(float factor)=0;
- /**
- * Sets alpha testing
- */
- virtual void SetAlphaTest(bool enable)=0;
/**
* Sets a polygon offset. z depth will be: z1 = mult*z0 + add
@@ -389,7 +358,9 @@ public:
virtual void SetAttribNum(int num) = 0;
virtual void SetTexCoord(TexCoGen coords, int unit) = 0;
virtual void SetAttrib(TexCoGen coords, int unit) = 0;
- virtual void GetViewMatrix(MT_Matrix4x4 &mat) const = 0;
+
+ virtual const MT_Matrix4x4& GetViewMatrix() const = 0;
+ virtual const MT_Matrix4x4& GetViewInvMatrix() const = 0;
virtual bool QueryLists(){return false;}
virtual bool QueryArrays(){return false;}
@@ -398,8 +369,11 @@ public:
virtual void DisableMotionBlur()=0;
virtual float GetMotionBlurValue()=0;
- virtual int GetMotionBlurState()=0;
- virtual void SetMotionBlurState(int newstate)=0;
+ virtual int GetMotionBlurState()=0;
+ virtual void SetMotionBlurState(int newstate)=0;
+
+ virtual void SetBlendingMode(int blendmode)=0;
+ virtual void SetFrontFace(bool ccw)=0;
};
#endif //__RAS_IRASTERIZER
diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.cpp b/source/gameengine/Rasterizer/RAS_IRenderTools.cpp
index 2be9bb75ebf..555a3520bb4 100644
--- a/source/gameengine/Rasterizer/RAS_IRenderTools.cpp
+++ b/source/gameengine/Rasterizer/RAS_IRenderTools.cpp
@@ -28,42 +28,22 @@
#include "RAS_IRenderTools.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-void RAS_IRenderTools::SetViewMat(const MT_Transform& trans)
-{
- trans.getValue(m_viewmat);
-}
-
-
-
-void RAS_IRenderTools::SetClientObject(void* obj)
+void RAS_IRenderTools::SetClientObject(RAS_IRasterizer* rasty, void *obj)
{
if (m_clientobject != obj)
- {
m_clientobject = obj;
- m_modified = true;
- }
}
-
-
void RAS_IRenderTools::SetAuxilaryClientInfo(void* inf)
{
m_auxilaryClientInfo = inf;
}
-
-
void RAS_IRenderTools::AddLight(struct RAS_LightObject* lightobject)
{
m_lights.push_back(lightobject);
}
-
-
void RAS_IRenderTools::RemoveLight(struct RAS_LightObject* lightobject)
{
std::vector<struct RAS_LightObject*>::iterator lit =
@@ -71,5 +51,5 @@ void RAS_IRenderTools::RemoveLight(struct RAS_LightObject* lightobject)
if (!(lit==m_lights.end()))
m_lights.erase(lit);
-
}
+
diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h
index 54a663ba111..57f331e64cb 100644
--- a/source/gameengine/Rasterizer/RAS_IRenderTools.h
+++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h
@@ -44,12 +44,9 @@ class RAS_IRenderTools
{
protected:
- float m_viewmat[16];
void* m_clientobject;
void* m_auxilaryClientInfo;
- bool m_modified;
-
std::vector<struct RAS_LightObject*> m_lights;
RAS_2DFilterManager m_filtermanager;
@@ -68,8 +65,7 @@ public:
RAS_IRenderTools(
) :
- m_clientobject(NULL),
- m_modified(true)
+ m_clientobject(NULL)
{
};
@@ -131,24 +127,21 @@ public:
float v1[3],
float v2[3],
float v3[3],
- float v4[3]
+ float v4[3],
+ int glattrib
)=0;
virtual
- void
- SetViewMat(
- const MT_Transform& trans
- );
-
- virtual
- int
+ void
ProcessLighting(
- int layer
+ int layer,
+ const MT_Transform& trans
)=0;
virtual
void
SetClientObject(
+ RAS_IRasterizer* rasty,
void* obj
);
@@ -190,24 +183,6 @@ public:
virtual
void
Render2DFilters(RAS_ICanvas* canvas)=0;
-
- virtual
- class RAS_IPolyMaterial*
- CreateBlenderPolyMaterial(
- const STR_String &texname,
- bool ba,
- const STR_String& matname,
- int tile,
- int tilexrep,
- int tileyrep,
- int mode,
- bool transparant,
- bool zsort,
- int lightlayer,
- bool bIsTriangle,
- void* clientobject,
- void* tface
- )=0;
};
#endif //__RAS_IRENDERTOOLS
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
index e295d69e48e..69a8271d3e8 100644
--- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
+++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
@@ -28,10 +28,6 @@
#include "RAS_MaterialBucket.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#pragma warning (disable:4786)
#include <windows.h>
@@ -44,257 +40,553 @@
#include "RAS_MeshObject.h"
#include "RAS_Deformer.h" // __NLA
+/* mesh slot */
-
-KX_VertexIndex::KX_VertexIndex(int size)
+RAS_MeshSlot::RAS_MeshSlot()
{
- m_size = size;
+ m_clientObj = NULL;
+ m_pDeformer = NULL;
+ m_OpenGLMatrix = NULL;
+ m_mesh = NULL;
+ m_bucket = NULL;
+ m_bVisible = false;
+ m_bCulled = true;
+ m_bObjectColor = false;
+ m_RGBAcolor = MT_Vector4(0.0, 0.0, 0.0, 0.0);
+ m_DisplayList = NULL;
+ m_bDisplayList = true;
+ m_joinSlot = NULL;
}
+RAS_MeshSlot::~RAS_MeshSlot()
+{
+ vector<RAS_DisplayArray*>::iterator it;
+
+ Split(true);
+ while(m_joinedSlots.size())
+ m_joinedSlots.front()->Split(true);
+
+ for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) {
+ (*it)->m_users--;
+ if((*it)->m_users == 0)
+ delete *it;
+ }
+
+ if (m_DisplayList) {
+ m_DisplayList->Release();
+ m_DisplayList = NULL;
+ }
+}
-void KX_VertexIndex::SetIndex(short loc,unsigned int index)
+RAS_MeshSlot::RAS_MeshSlot(const RAS_MeshSlot& slot)
{
- m_indexarray[loc]=index;
+ vector<RAS_DisplayArray*>::iterator it;
+
+ m_clientObj = NULL;
+ m_pDeformer = NULL;
+ m_OpenGLMatrix = NULL;
+ m_mesh = slot.m_mesh;
+ m_bucket = slot.m_bucket;
+ m_bVisible = slot.m_bVisible;
+ m_bCulled = slot.m_bCulled;
+ m_bObjectColor = slot.m_bObjectColor;
+ m_RGBAcolor = slot.m_RGBAcolor;
+ m_DisplayList = NULL;
+ m_bDisplayList = slot.m_bDisplayList;
+ m_joinSlot = NULL;
+ m_currentArray = slot.m_currentArray;
+ m_displayArrays = slot.m_displayArrays;
+ m_joinedSlots = slot.m_joinedSlots;
+
+ m_startarray = slot.m_startarray;
+ m_startvertex = slot.m_startvertex;
+ m_startindex = slot.m_startindex;
+ m_endarray = slot.m_endarray;
+ m_endvertex = slot.m_endvertex;
+ m_endindex = slot.m_endindex;
+
+ for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) {
+ *it = new RAS_DisplayArray(**it);
+ (*it)->m_users = 1;
+ }
}
-bool KX_MeshSlot::Less(const KX_MeshSlot& lhs) const
+void RAS_MeshSlot::init(RAS_MaterialBucket *bucket, int numverts)
{
- bool result = ((m_mesh < lhs.m_mesh ) ||
- ((m_mesh == lhs.m_mesh)&&(m_OpenGLMatrix < lhs.m_OpenGLMatrix)));
-
- return result;
+ m_bucket = bucket;
+
+ SetDisplayArray(numverts);
+
+ m_startarray = 0;
+ m_startvertex = 0;
+ m_startindex = 0;
+ m_endarray = 0;
+ m_endvertex = 0;
+ m_endindex = 0;
}
-KX_MeshSlot::~KX_MeshSlot()
+void RAS_MeshSlot::begin(RAS_MeshSlot::iterator& it)
{
- if (m_DisplayList)
- m_DisplayList->Release();
+ int startvertex, endvertex;
+ int startindex, endindex;
+
+ it.array = (m_displayArrays.size() > 0)? m_displayArrays[m_startarray]: NULL;
+
+ if(it.array == NULL || it.array->m_index.size() == 0 || it.array->m_vertex.size() == 0) {
+ it.array = NULL;
+ it.vertex = NULL;
+ it.index = NULL;
+ it.startvertex = 0;
+ it.endvertex = 0;
+ it.totindex = 0;
+ }
+ else {
+ startvertex = m_startvertex;
+ endvertex = (m_startarray == m_endarray)? m_endvertex: it.array->m_vertex.size();
+ startindex = m_startindex;
+ endindex = (m_startarray == m_endarray)? m_endindex: it.array->m_index.size();
+
+ it.vertex = &it.array->m_vertex[0];
+ it.index = &it.array->m_index[startindex];
+ it.startvertex = startvertex;
+ it.endvertex = endvertex;
+ it.totindex = endindex-startindex;
+ it.arraynum = m_startarray;
+ }
}
+void RAS_MeshSlot::next(RAS_MeshSlot::iterator& it)
+{
+ int startvertex, endvertex;
+ int startindex, endindex;
+
+ if(it.arraynum == (size_t)m_endarray) {
+ it.array = NULL;
+ it.vertex = NULL;
+ it.index = NULL;
+ it.startvertex = 0;
+ it.endvertex = 0;
+ it.totindex = 0;
+ }
+ else {
+ it.arraynum++;
+ it.array = m_displayArrays[it.arraynum];
+
+ startindex = 0;
+ endindex = (it.arraynum == (size_t)m_endarray)? m_endindex: it.array->m_index.size();
+ startvertex = 0;
+ endvertex = (it.arraynum == (size_t)m_endarray)? m_endvertex: it.array->m_vertex.size();
+
+ it.vertex = &it.array->m_vertex[0];
+ it.index = &it.array->m_index[startindex];
+ it.startvertex = startvertex;
+ it.endvertex = endvertex;
+ it.totindex = endindex-startindex;
+ }
+}
-RAS_MaterialBucket::RAS_MaterialBucket(RAS_IPolyMaterial* mat)
- :m_bModified(true)
+bool RAS_MeshSlot::end(RAS_MeshSlot::iterator& it)
{
- m_bScheduled=true;
- m_material = mat;
+ return (it.array == NULL);
}
+RAS_DisplayArray *RAS_MeshSlot::CurrentDisplayArray()
+{
+ return m_currentArray;
+}
+void RAS_MeshSlot::SetDisplayArray(int numverts)
+{
+ vector<RAS_DisplayArray*>::iterator it;
+ RAS_DisplayArray *darray = NULL;
+
+ for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) {
+ darray = *it;
+
+ if(darray->m_type == numverts) {
+ if(darray->m_index.size()+numverts >= RAS_DisplayArray::BUCKET_MAX_INDEX)
+ darray = NULL;
+ else if(darray->m_vertex.size()+numverts >= RAS_DisplayArray::BUCKET_MAX_VERTEX)
+ darray = NULL;
+ else
+ break;
+ }
+ else
+ darray = NULL;
+ }
-void RAS_MaterialBucket::SchedulePolygons(int drawingmode)
-{
- m_bScheduled = true;
-}
+ if(!darray) {
+ darray = new RAS_DisplayArray();
+ darray->m_users = 1;
+ if(numverts == 2) darray->m_type = RAS_DisplayArray::LINE;
+ else if(numverts == 3) darray->m_type = RAS_DisplayArray::TRIANGLE;
+ else darray->m_type = RAS_DisplayArray::QUAD;
+ m_displayArrays.push_back(darray);
-void RAS_MaterialBucket::ClearScheduledPolygons()
-{
- m_bScheduled = false;
+ if(numverts == 2)
+ darray->m_type = RAS_DisplayArray::LINE;
+ else if(numverts == 3)
+ darray->m_type = RAS_DisplayArray::TRIANGLE;
+ else if(numverts == 4)
+ darray->m_type = RAS_DisplayArray::QUAD;
+
+ m_endarray = m_displayArrays.size()-1;
+ m_endvertex = 0;
+ m_endindex = 0;
+ }
+
+ m_currentArray = darray;
}
+void RAS_MeshSlot::AddPolygon(int numverts)
+{
+ SetDisplayArray(numverts);
+}
+
+int RAS_MeshSlot::AddVertex(const RAS_TexVert& tv)
+{
+ RAS_DisplayArray *darray;
+ int offset;
+ darray = m_currentArray;
+ darray->m_vertex.push_back(tv);
+ offset = darray->m_vertex.size()-1;
-RAS_IPolyMaterial* RAS_MaterialBucket::GetPolyMaterial() const
-{
- return m_material;
+ if(darray == m_displayArrays[m_endarray])
+ m_endvertex++;
+
+ return offset;
}
+void RAS_MeshSlot::AddPolygonVertex(int offset)
+{
+ RAS_DisplayArray *darray;
+
+ darray = m_currentArray;
+ darray->m_index.push_back(offset);
+ if(darray == m_displayArrays[m_endarray])
+ m_endindex++;
+}
+
+bool RAS_MeshSlot::Equals(RAS_MeshSlot *target)
+{
+ if(!m_OpenGLMatrix || !target->m_OpenGLMatrix)
+ return false;
+ if(m_pDeformer || target->m_pDeformer)
+ return false;
+ if(m_bVisible != target->m_bVisible)
+ return false;
+ if(m_bObjectColor != target->m_bObjectColor)
+ return false;
+ if(m_bObjectColor && !(m_RGBAcolor == target->m_RGBAcolor))
+ return false;
-void RAS_MaterialBucket::SetMeshSlot(KX_MeshSlot& ms)
+ return true;
+}
+
+bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance)
{
- m_meshSlots.insert(ms);
+ vector<RAS_DisplayArray*>::iterator it;
+ iterator mit;
+ size_t i;
+
+ // verify if we can join
+ if(m_joinSlot || m_joinedSlots.size() || target->m_joinSlot)
+ return false;
+
+ if(!Equals(target))
+ return false;
+
+ MT_Vector3 co(&m_OpenGLMatrix[12]);
+ MT_Vector3 targetco(&target->m_OpenGLMatrix[12]);
+
+ if((co - targetco).length() > distance)
+ return false;
+
+ MT_Matrix4x4 mat(m_OpenGLMatrix);
+ MT_Matrix4x4 targetmat(target->m_OpenGLMatrix);
+ targetmat.invert();
+
+ MT_Matrix4x4 transform = targetmat*mat;
+
+ // m_mesh, clientobj
+ m_joinSlot = target;
+ m_joinInvTransform = transform;
+ m_joinInvTransform.invert();
+ target->m_joinedSlots.push_back(this);
+
+ MT_Matrix4x4 ntransform = m_joinInvTransform.transposed();
+ ntransform[0][3]= ntransform[1][3]= ntransform[2][3]= 0.0f;
+
+ for(begin(mit); !end(mit); next(mit))
+ for(i=mit.startvertex; i<mit.endvertex; i++)
+ mit.vertex[i].Transform(transform, ntransform);
+
+ for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) {
+ target->m_displayArrays.push_back(*it);
+ target->m_endarray++;
+ target->m_endvertex = target->m_displayArrays.back()->m_vertex.size();
+ target->m_endindex = target->m_displayArrays.back()->m_index.size();
+ }
+
+ if (m_DisplayList) {
+ m_DisplayList->Release();
+ m_DisplayList = NULL;
+ }
+ if (target->m_DisplayList) {
+ target->m_DisplayList->Release();
+ target->m_DisplayList = NULL;
+ }
+
+ return true;
+#if 0
+ return false;
+#endif
}
+bool RAS_MeshSlot::Split(bool force)
+{
+ list<RAS_MeshSlot*>::iterator jit;
+ RAS_MeshSlot *target = m_joinSlot;
+ vector<RAS_DisplayArray*>::iterator it, jt;
+ iterator mit;
+ size_t i, found0 = 0, found1 = 0;
+
+ if(target && (force || !Equals(target))) {
+ m_joinSlot = NULL;
+
+ for(jit=target->m_joinedSlots.begin(); jit!=target->m_joinedSlots.end(); jit++) {
+ if(*jit == this) {
+ target->m_joinedSlots.erase(jit);
+ found0 = 1;
+ break;
+ }
+ }
+
+ if(!found0)
+ abort();
+
+ for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) {
+ found1 = 0;
+ for(jt=target->m_displayArrays.begin(); jt!=target->m_displayArrays.end(); jt++) {
+ if(*jt == *it) {
+ target->m_displayArrays.erase(jt);
+ target->m_endarray--;
+ found1 = 1;
+ break;
+ }
+ }
+
+ if(!found1)
+ abort();
+ }
+
+ if(target->m_displayArrays.size()) {
+ target->m_endvertex = target->m_displayArrays.back()->m_vertex.size();
+ target->m_endindex = target->m_displayArrays.back()->m_index.size();
+ }
+ else {
+ target->m_endvertex = 0;
+ target->m_endindex = 0;
+ }
+ MT_Matrix4x4 ntransform = m_joinInvTransform.inverse().transposed();
+ ntransform[0][3]= ntransform[1][3]= ntransform[2][3]= 0.0f;
-void RAS_MaterialBucket::RemoveMeshSlot(KX_MeshSlot& ms)
+ for(begin(mit); !end(mit); next(mit))
+ for(i=mit.startvertex; i<mit.endvertex; i++)
+ mit.vertex[i].Transform(m_joinInvTransform, ntransform);
+
+ if (target->m_DisplayList) {
+ target->m_DisplayList->Release();
+ target->m_DisplayList = NULL;
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+bool RAS_MeshSlot::IsCulled()
{
- T_MeshSlotList::iterator it = m_meshSlots.find(ms);
+ list<RAS_MeshSlot*>::iterator it;
- if (!(it == m_meshSlots.end()))
- m_meshSlots.erase(it);
-
+ if(m_joinSlot)
+ return true;
+ if(!m_bCulled)
+ return false;
+
+ for(it=m_joinedSlots.begin(); it!=m_joinedSlots.end(); it++)
+ if(!(*it)->m_bCulled)
+ return false;
+
+ return true;
}
+/* material bucket sorting */
+struct RAS_MaterialBucket::less
+{
+ bool operator()(const RAS_MaterialBucket* x, const RAS_MaterialBucket* y) const
+ {
+ return *x->GetPolyMaterial() < *y->GetPolyMaterial();
+ }
+};
-void RAS_MaterialBucket::MarkVisibleMeshSlot(KX_MeshSlot& ms,
- bool visible,
- bool color,
- const MT_Vector4& rgbavec)
+/* material bucket */
+
+RAS_MaterialBucket::RAS_MaterialBucket(RAS_IPolyMaterial* mat)
{
- T_MeshSlotList::iterator it = m_meshSlots.find(ms);
-
- assert (!(it == m_meshSlots.end()));
- (*it).m_bVisible = visible;
- (*it).m_bObjectColor = color;
- (*it).m_RGBAcolor= rgbavec;
+ m_material = mat;
}
-bool RAS_MaterialBucket::IsTransparant() const
-{
- return (m_material->IsTransparant());
+RAS_MaterialBucket::~RAS_MaterialBucket()
+{
}
+RAS_IPolyMaterial* RAS_MaterialBucket::GetPolyMaterial() const
+{
+ return m_material;
+}
+bool RAS_MaterialBucket::IsAlpha() const
+{
+ return (m_material->IsAlpha());
+}
-void RAS_MaterialBucket::StartFrame()
-{
+bool RAS_MaterialBucket::IsZSort() const
+{
+ return (m_material->IsZSort());
}
+RAS_MeshSlot* RAS_MaterialBucket::AddMesh(int numverts)
+{
+ RAS_MeshSlot *ms;
+ m_meshSlots.push_back(RAS_MeshSlot());
+
+ ms = &m_meshSlots.back();
+ ms->init(this, numverts);
-void RAS_MaterialBucket::EndFrame()
+ return ms;
+}
+
+RAS_MeshSlot* RAS_MaterialBucket::CopyMesh(RAS_MeshSlot *ms)
{
+ m_meshSlots.push_back(RAS_MeshSlot(*ms));
+
+ return &m_meshSlots.back();
}
-unsigned int RAS_MaterialBucket::NumMeshSlots()
+void RAS_MaterialBucket::RemoveMesh(RAS_MeshSlot* ms)
{
- return m_meshSlots.size();
+ list<RAS_MeshSlot>::iterator it;
+
+ for(it=m_meshSlots.begin(); it!=m_meshSlots.end(); it++) {
+ if(&*it == ms) {
+ m_meshSlots.erase(it);
+ return;
+ }
+ }
}
-RAS_MaterialBucket::T_MeshSlotList::iterator RAS_MaterialBucket::msBegin()
+list<RAS_MeshSlot>::iterator RAS_MaterialBucket::msBegin()
{
return m_meshSlots.begin();
}
-RAS_MaterialBucket::T_MeshSlotList::iterator RAS_MaterialBucket::msEnd()
+list<RAS_MeshSlot>::iterator RAS_MaterialBucket::msEnd()
{
return m_meshSlots.end();
}
bool RAS_MaterialBucket::ActivateMaterial(const MT_Transform& cameratrans, RAS_IRasterizer* rasty,
- RAS_IRenderTools *rendertools, RAS_IRasterizer::DrawMode &drawmode)
+ RAS_IRenderTools *rendertools)
{
- rendertools->SetViewMat(cameratrans);
-
if (!rasty->SetMaterial(*m_material))
return false;
if (m_material->UsesLighting(rasty))
- rendertools->ProcessLighting(RAS_IRenderTools::RAS_LIGHT_OBJECT_LAYER/*m_material->GetLightLayer()*/);
- else
- rendertools->ProcessLighting(-1);
-
- if(rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID)
- drawmode = RAS_IRasterizer::KX_MODE_LINES;
- else if(m_material->UsesTriangles())
- drawmode = RAS_IRasterizer::KX_MODE_TRIANGLES;
+ rendertools->ProcessLighting(RAS_IRenderTools::RAS_LIGHT_OBJECT_LAYER, cameratrans);
else
- drawmode = RAS_IRasterizer::KX_MODE_QUADS;
+ rendertools->ProcessLighting(-1, cameratrans);
return true;
}
void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRasterizer* rasty,
- RAS_IRenderTools* rendertools, const KX_MeshSlot &ms, RAS_IRasterizer::DrawMode drawmode)
+ RAS_IRenderTools* rendertools, RAS_MeshSlot &ms)
{
- if (!ms.m_bVisible)
- return;
-
m_material->ActivateMeshSlot(ms, rasty);
- /* __NLA Do the deformation */
if (ms.m_pDeformer)
{
ms.m_pDeformer->Apply(m_material);
// KX_ReInstanceShapeFromMesh(ms.m_mesh); // Recompute the physics mesh. (Can't call KX_* from RAS_)
}
- /* End __NLA */
- if (rasty->GetDrawingMode() >= RAS_IRasterizer::KX_SOLID)
- ms.m_mesh->SortPolygons(cameratrans*MT_Transform(ms.m_OpenGLMatrix));
+ if(IsZSort() && rasty->GetDrawingMode() >= RAS_IRasterizer::KX_SOLID)
+ ms.m_mesh->SortPolygons(ms, cameratrans*MT_Transform(ms.m_OpenGLMatrix));
rendertools->PushMatrix();
rendertools->applyTransform(rasty,ms.m_OpenGLMatrix,m_material->GetDrawingMode());
if(rasty->QueryLists())
- {
if(ms.m_DisplayList)
ms.m_DisplayList->SetModified(ms.m_mesh->MeshModified());
- }
// verify if we can use display list, not for deformed object, and
// also don't create a new display list when drawing shadow buffers,
- // then it won't have texture coordinates for actual drawing
- KX_ListSlot **displaylist;
+ // then it won't have texture coordinates for actual drawing. also
+ // for zsort we can't make a display list, since the polygon order
+ // changes all the time.
if(ms.m_pDeformer)
- displaylist = 0;
+ ms.m_bDisplayList = false;
else if(!ms.m_DisplayList && rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW)
- displaylist = 0;
+ ms.m_bDisplayList = false;
+ else if (IsZSort())
+ ms.m_bDisplayList = false;
+ else if(m_material->UsesObjectColor() && ms.m_bObjectColor)
+ ms.m_bDisplayList = false;
else
- displaylist = &ms.m_DisplayList;
+ ms.m_bDisplayList = true;
- // Use the text-specific IndexPrimitives for text faces
+ // for text drawing using faces
if (m_material->GetDrawingMode() & RAS_IRasterizer::RAS_RENDER_3DPOLYGON_TEXT)
- {
- rasty->IndexPrimitives_3DText(
- ms.m_mesh->GetVertexCache(m_material),
- ms.m_mesh->GetIndexCache(m_material),
- drawmode,
- m_material,
- rendertools, // needed for textprinting on polys
- ms.m_bObjectColor,
- ms.m_RGBAcolor);
- }
-
- // for using glMultiTexCoord
+ rasty->IndexPrimitives_3DText(ms, m_material, rendertools);
+ // for multitexturing
else if((m_material->GetFlag() & RAS_MULTITEX))
- {
- rasty->IndexPrimitivesMulti(
- ms.m_mesh->GetVertexCache(m_material),
- ms.m_mesh->GetIndexCache(m_material),
- drawmode,
- ms.m_bObjectColor,
- ms.m_RGBAcolor,
- displaylist);
- }
-
- // Use the normal IndexPrimitives
+ rasty->IndexPrimitivesMulti(ms);
+ // use normal IndexPrimitives
else
- {
- rasty->IndexPrimitives(
- ms.m_mesh->GetVertexCache(m_material),
- ms.m_mesh->GetIndexCache(m_material),
- drawmode,
- ms.m_bObjectColor,
- ms.m_RGBAcolor,
- displaylist);
- }
+ rasty->IndexPrimitives(ms);
- if(rasty->QueryLists()) {
+ if(rasty->QueryLists())
if(ms.m_DisplayList)
ms.m_mesh->SetMeshModified(false);
- }
rendertools->PopMatrix();
}
-void RAS_MaterialBucket::Render(const MT_Transform& cameratrans,
- RAS_IRasterizer* rasty,
- RAS_IRenderTools* rendertools)
+void RAS_MaterialBucket::Optimize(MT_Scalar distance)
{
- if (m_meshSlots.begin()== m_meshSlots.end())
- return;
-
- //rendertools->SetViewMat(cameratrans);
-
- //rasty->SetMaterial(*m_material);
+ /* TODO: still have to check before this works correct:
+ * - lightlayer, frontface, text, billboard
+ * - make it work with physics */
- RAS_IRasterizer::DrawMode drawmode;
- for (T_MeshSlotList::const_iterator it = m_meshSlots.begin();
- ! (it == m_meshSlots.end()); ++it)
- {
- rendertools->SetClientObject((*it).m_clientObj);
- while (ActivateMaterial(cameratrans, rasty, rendertools, drawmode)) {
- RenderMeshSlot(cameratrans, rasty, rendertools, *it, drawmode);
- }
- }
- // to reset the eventual GL_CW mode
- rendertools->SetClientObject(NULL);
+#if 0
+ list<RAS_MeshSlot>::iterator it;
+ list<RAS_MeshSlot>::iterator jt;
+
+ // greed joining on all following buckets
+ for(it=m_meshSlots.begin(); it!=m_meshSlots.end(); it++)
+ for(jt=it, jt++; jt!=m_meshSlots.end(); jt++)
+ jt->Join(&*it, distance);
+#endif
}
-
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
index 13d8a53714a..475f01d549a 100644
--- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h
+++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
@@ -36,30 +36,15 @@
#include "MT_Transform.h"
#include "RAS_IPolygonMaterial.h"
#include "RAS_IRasterizer.h"
-#include "RAS_Deformer.h" // __NLA
+#include "RAS_Deformer.h"
+
#include <vector>
-#include <map>
#include <set>
+#include <list>
using namespace std;
-/**
- * KX_VertexIndex
- */
-struct KX_VertexIndex {
-public:
- KX_VertexIndex(int size);
- void SetIndex(short loc,unsigned int index);
-
- // The vertex array
- short m_vtxarray;
- // An index into the vertex array for up to 4 verticies
- unsigned short m_indexarray[4];
- short m_size;
-};
+/* Display List Slot */
-/**
- * KX_ListSlot.
- */
class KX_ListSlot
{
protected:
@@ -80,94 +65,149 @@ public:
virtual void SetModified(bool mod)=0;
};
-/**
- * KX_MeshSlot.
- */
-class KX_MeshSlot
+class RAS_DisplayArray;
+class RAS_MeshSlot;
+class RAS_MeshMaterial;
+class RAS_MaterialBucket;
+
+/* An array with data used for OpenGL drawing */
+
+class RAS_DisplayArray
{
public:
- void* m_clientObj;
- RAS_Deformer* m_pDeformer; // __NLA
- double* m_OpenGLMatrix;
- class RAS_MeshObject* m_mesh;
- mutable bool m_bVisible; // for visibility
- mutable bool m_bObjectColor;
- mutable MT_Vector4 m_RGBAcolor;
- mutable KX_ListSlot* m_DisplayList; // for lists
- KX_MeshSlot() :
- m_pDeformer(NULL),
- m_bVisible(true),
- m_DisplayList(0)
- {
- }
- ~KX_MeshSlot();
- bool Less(const KX_MeshSlot& lhs) const;
+ vector<RAS_TexVert> m_vertex;
+ vector<unsigned short> m_index;
+ enum { LINE = 2, TRIANGLE = 3, QUAD = 4 } m_type;
+ //RAS_MeshSlot *m_origSlot;
+ int m_users;
+
+ enum { BUCKET_MAX_INDEX = 65535 };
+ enum { BUCKET_MAX_VERTEX = 65535 };
};
+/* Entry of a RAS_MeshObject into RAS_MaterialBucket */
-inline bool operator <( const KX_MeshSlot& rhs,const KX_MeshSlot& lhs)
+class RAS_MeshSlot
{
- return ( rhs.Less(lhs));
-}
+private:
+ // indices into display arrays
+ int m_startarray;
+ int m_endarray;
+ int m_startindex;
+ int m_endindex;
+ int m_startvertex;
+ int m_endvertex;
+ vector<RAS_DisplayArray*> m_displayArrays;
+
+ // for construction only
+ RAS_DisplayArray* m_currentArray;
+
+public:
+ // for rendering
+ RAS_MaterialBucket* m_bucket;
+ RAS_MeshObject* m_mesh;
+ void* m_clientObj;
+ RAS_Deformer* m_pDeformer;
+ double* m_OpenGLMatrix;
+ // visibility
+ bool m_bVisible;
+ bool m_bCulled;
+ // object color
+ bool m_bObjectColor;
+ MT_Vector4 m_RGBAcolor;
+ // display lists
+ KX_ListSlot* m_DisplayList;
+ bool m_bDisplayList;
+ // joined mesh slots
+ RAS_MeshSlot* m_joinSlot;
+ MT_Matrix4x4 m_joinInvTransform;
+ list<RAS_MeshSlot*> m_joinedSlots;
+
+ RAS_MeshSlot();
+ RAS_MeshSlot(const RAS_MeshSlot& slot);
+ virtual ~RAS_MeshSlot();
+
+ void init(RAS_MaterialBucket *bucket, int numverts);
+
+ struct iterator {
+ RAS_DisplayArray *array;
+ RAS_TexVert *vertex;
+ unsigned short *index;
+ size_t startvertex;
+ size_t endvertex;
+ size_t totindex;
+ size_t arraynum;
+ };
+
+ void begin(iterator& it);
+ void next(iterator& it);
+ bool end(iterator& it);
+
+ /* used during construction */
+ void SetDisplayArray(int numverts);
+ RAS_DisplayArray *CurrentDisplayArray();
+
+ void AddPolygon(int numverts);
+ int AddVertex(const RAS_TexVert& tv);
+ void AddPolygonVertex(int offset);
+
+ /* optimization */
+ bool Split(bool force=false);
+ bool Join(RAS_MeshSlot *target, MT_Scalar distance);
+ bool Equals(RAS_MeshSlot *target);
+ bool IsCulled();
+};
+
+/* Used by RAS_MeshObject, to point to it's slots in a bucket */
+
+class RAS_MeshMaterial
+{
+public:
+ RAS_MeshSlot *m_baseslot;
+ class RAS_MaterialBucket *m_bucket;
+
+ GEN_Map<GEN_HashedPtr,RAS_MeshSlot*> m_slots;
+};
+
+/* Contains a list of display arrays with the same material,
+ * and a mesh slot for each mesh that uses display arrays in
+ * this bucket */
-/**
- * Contains a list of meshs with the same material properties.
- */
class RAS_MaterialBucket
{
public:
- typedef std::set<KX_MeshSlot> T_MeshSlotList;
-
RAS_MaterialBucket(RAS_IPolyMaterial* mat);
- virtual ~RAS_MaterialBucket() {}
-
- void Render(const MT_Transform& cameratrans,
- class RAS_IRasterizer* rasty,
- class RAS_IRenderTools* rendertools);
-
- void SchedulePolygons(int drawingmode);
- void ClearScheduledPolygons();
+ virtual ~RAS_MaterialBucket();
+ /* Bucket Sorting */
+ struct less;
+ typedef set<RAS_MaterialBucket*, less> Set;
+
+ /* Material Properties */
RAS_IPolyMaterial* GetPolyMaterial() const;
- bool IsTransparant() const;
+ bool IsAlpha() const;
+ bool IsZSort() const;
- static void StartFrame();
- static void EndFrame();
-
- void SetMeshSlot(KX_MeshSlot& ms);
- void RemoveMeshSlot(KX_MeshSlot& ms);
- void MarkVisibleMeshSlot(KX_MeshSlot& ms,
- bool visible,
- bool color,
- const MT_Vector4& rgbavec);
-
- void RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRasterizer* rasty,
- RAS_IRenderTools* rendertools, const KX_MeshSlot &ms, RAS_IRasterizer::DrawMode drawmode);
+ /* Rendering */
bool ActivateMaterial(const MT_Transform& cameratrans, RAS_IRasterizer* rasty,
- RAS_IRenderTools *rendertools, RAS_IRasterizer::DrawMode& drawmode);
-
- unsigned int NumMeshSlots();
- T_MeshSlotList::iterator msBegin();
- T_MeshSlotList::iterator msEnd();
-
- struct less
- {
- bool operator()(const RAS_MaterialBucket* x, const RAS_MaterialBucket* y) const
- {
- return *x->GetPolyMaterial() < *y->GetPolyMaterial();
- }
- };
+ RAS_IRenderTools *rendertools);
+ void RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRasterizer* rasty,
+ RAS_IRenderTools* rendertools, RAS_MeshSlot &ms);
- typedef set<RAS_MaterialBucket*, less> Set;
+ /* Mesh Slot Access */
+ list<RAS_MeshSlot>::iterator msBegin();
+ list<RAS_MeshSlot>::iterator msEnd();
+
+ class RAS_MeshSlot* AddMesh(int numverts);
+ class RAS_MeshSlot* CopyMesh(class RAS_MeshSlot *ms);
+ void RemoveMesh(class RAS_MeshSlot* ms);
+ void Optimize(MT_Scalar distance);
+
private:
-
- T_MeshSlotList m_meshSlots;
- bool m_bScheduled;
- bool m_bModified;
+ list<RAS_MeshSlot> m_meshSlots;
RAS_IPolyMaterial* m_material;
- double* m_pOGLMatrix;
};
-#endif //__KX_BUCKET
+#endif //__RAS_MATERIAL_BUCKET
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp
index 4420f16c56d..a907994bf57 100644
--- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp
+++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp
@@ -26,71 +26,91 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "RAS_MeshObject.h"
#include "RAS_IRasterizer.h"
#include "MT_MinMax.h"
#include "MT_Point3.h"
+#include <algorithm>
-STR_String RAS_MeshObject::s_emptyname = "";
-
-
+/* polygon sorting */
-KX_ArrayOptimizer::~KX_ArrayOptimizer()
+struct RAS_MeshObject::polygonSlot
{
- for (vector<KX_VertexArray*>::iterator itv = m_VertexArrayCache1.begin();
- !(itv == m_VertexArrayCache1.end());++itv)
+ float m_z;
+ int m_index[4];
+
+ polygonSlot() {}
+
+ /* pnorm is the normal from the plane equation that the distance from is
+ * used to sort again. */
+ void get(const RAS_TexVert *vertexarray, const unsigned short *indexarray,
+ int offset, int nvert, const MT_Vector3& pnorm)
{
- delete (*itv);
+ MT_Vector3 center(0, 0, 0);
+ int i;
+
+ for(i=0; i<nvert; i++) {
+ m_index[i] = indexarray[offset+i];
+ center += vertexarray[m_index[i]].getXYZ();
+ }
+
+ /* note we don't divide center by the number of vertices, since all
+ * polygons have the same number of vertices, and that we leave out
+ * the 4-th component of the plane equation since it is constant. */
+ m_z = MT_dot(pnorm, center);
}
- for (vector<KX_IndexArray*>::iterator iti = m_IndexArrayCache1.begin();
- !(iti == m_IndexArrayCache1.end());++iti)
+ void set(unsigned short *indexarray, int offset, int nvert)
{
- delete (*iti);
+ int i;
+
+ for(i=0; i<nvert; i++)
+ indexarray[offset+i] = m_index[i];
}
+};
- m_TriangleArrayCount.clear();
- m_VertexArrayCache1.clear();
- m_IndexArrayCache1.clear();
-
+struct RAS_MeshObject::backtofront
+{
+ bool operator()(const polygonSlot &a, const polygonSlot &b) const
+ {
+ return a.m_z < b.m_z;
+ }
+};
-}
+struct RAS_MeshObject::fronttoback
+{
+ bool operator()(const polygonSlot &a, const polygonSlot &b) const
+ {
+ return a.m_z > b.m_z;
+ }
+};
+/* mesh object */
+STR_String RAS_MeshObject::s_emptyname = "";
RAS_MeshObject::RAS_MeshObject(Mesh* mesh, int lightlayer)
- : m_bModified(true),
- m_lightlayer(lightlayer),
- m_zsort(false),
- m_MeshMod(true),
+ : m_lightlayer(lightlayer),
+ m_bModified(true),
+ m_bMeshModified(true),
m_mesh(mesh),
- m_class(0)
+ m_bDeformed(false)
{
}
-
-bool RAS_MeshObject::MeshModified()
-{
- return m_MeshMod;
-}
-
-
RAS_MeshObject::~RAS_MeshObject()
{
- for (vector<RAS_Polygon*>::iterator it=m_Polygons.begin();!(it==m_Polygons.end());it++)
- {
- delete (*it);
- }
+ vector<RAS_Polygon*>::iterator it;
- ClearArrayData();
+ for(it=m_Polygons.begin(); it!=m_Polygons.end(); it++)
+ delete (*it);
}
-
+bool RAS_MeshObject::MeshModified()
+{
+ return m_bMeshModified;
+}
unsigned int RAS_MeshObject::GetLightLayer()
{
@@ -106,18 +126,21 @@ int RAS_MeshObject::NumMaterials()
const STR_String& RAS_MeshObject::GetMaterialName(unsigned int matid)
{
- RAS_MaterialBucket* bucket = GetMaterialBucket(matid);
+ RAS_MeshMaterial* mmat = GetMeshMaterial(matid);
+
+ if(mmat)
+ return mmat->m_bucket->GetPolyMaterial()->GetMaterialName();
- return bucket?bucket->GetPolyMaterial()->GetMaterialName():s_emptyname;
+ return s_emptyname;
}
-RAS_MaterialBucket* RAS_MeshObject::GetMaterialBucket(unsigned int matid)
+RAS_MeshMaterial* RAS_MeshObject::GetMeshMaterial(unsigned int matid)
{
if (m_materials.size() > 0 && (matid < m_materials.size()))
{
- RAS_MaterialBucket::Set::const_iterator it = m_materials.begin();
+ list<RAS_MeshMaterial>::iterator it = m_materials.begin();
while (matid--) ++it;
- return *it;
+ return &*it;
}
return NULL;
@@ -132,21 +155,24 @@ int RAS_MeshObject::NumPolygons()
-RAS_Polygon* RAS_MeshObject::GetPolygon(int num)
+RAS_Polygon* RAS_MeshObject::GetPolygon(int num) const
{
return m_Polygons[num];
}
-RAS_MaterialBucket::Set::iterator RAS_MeshObject::GetFirstMaterial()
+
+ list<RAS_MeshMaterial>::iterator GetFirstMaterial();
+ list<RAS_MeshMaterial>::iterator GetLastMaterial();
+list<RAS_MeshMaterial>::iterator RAS_MeshObject::GetFirstMaterial()
{
return m_materials.begin();
}
-RAS_MaterialBucket::Set::iterator RAS_MeshObject::GetLastMaterial()
+list<RAS_MeshMaterial>::iterator RAS_MeshObject::GetLastMaterial()
{
return m_materials.end();
}
@@ -169,373 +195,238 @@ const STR_String& RAS_MeshObject::GetName()
const STR_String& RAS_MeshObject::GetTextureName(unsigned int matid)
{
- RAS_MaterialBucket* bucket = GetMaterialBucket(matid);
+ RAS_MeshMaterial* mmat = GetMeshMaterial(matid);
- return bucket?bucket->GetPolyMaterial()->GetTextureName():s_emptyname;
+ if(mmat)
+ return mmat->m_bucket->GetPolyMaterial()->GetTextureName();
+
+ return s_emptyname;
}
+RAS_MeshMaterial *RAS_MeshObject::GetMeshMaterial(RAS_IPolyMaterial *mat)
+{
+ list<RAS_MeshMaterial>::iterator mit;
+ /* find a mesh material */
+ for(mit = m_materials.begin(); mit != m_materials.end(); mit++)
+ if(mit->m_bucket->GetPolyMaterial() == mat)
+ return &*mit;
-void RAS_MeshObject::AddPolygon(RAS_Polygon* poly)
-{
- m_Polygons.push_back(poly);
+ return NULL;
}
+RAS_Polygon* RAS_MeshObject::AddPolygon(RAS_MaterialBucket *bucket, int numverts)
+{
+ RAS_MeshMaterial *mmat;
+ RAS_Polygon *poly;
+ RAS_MeshSlot *slot;
+ /* find a mesh material */
+ mmat = GetMeshMaterial(bucket->GetPolyMaterial());
+
+ /* none found, create a new one */
+ if(!mmat) {
+ RAS_MeshMaterial meshmat;
+ meshmat.m_bucket = bucket;
+ meshmat.m_baseslot = meshmat.m_bucket->AddMesh(numverts);
+ m_materials.push_back(meshmat);
+ mmat = &m_materials.back();
+ }
+
+ /* add it to the bucket, this also adds new display arrays */
+ slot = mmat->m_baseslot;
+ slot->AddPolygon(numverts);
+
+ /* create a new polygon */
+ RAS_DisplayArray *darray = slot->CurrentDisplayArray();
+ poly = new RAS_Polygon(bucket, darray, numverts);
+ m_Polygons.push_back(poly);
+
+ return poly;
+}
void RAS_MeshObject::DebugColor(unsigned int abgr)
{
-/*
- int numpolys = NumPolygons();
- for (int i=0;i<numpolys;i++)
- {
+ /*int numpolys = NumPolygons();
+
+ for (int i=0;i<numpolys;i++) {
RAS_Polygon* poly = m_polygons[i];
for (int v=0;v<poly->VertexCount();v++)
- {
- RAS_TexVert* vtx = poly->GetVertex(v);
- vtx->setDebugRGBA(abgr);
- }
+ RAS_TexVert* vtx = poly->GetVertex(v)->setDebugRGBA(abgr);
}
*/
- m_debugcolor = abgr;
+ /* m_debugcolor = abgr; */
}
-
-
-void RAS_MeshObject::SchedulePoly(const KX_VertexIndex& idx,
- int numverts,
- RAS_IPolyMaterial* mat)
+void RAS_MeshObject::SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba)
{
- //int indexpos = m_IndexArrayCount[idx.m_vtxarray];
- //m_IndexArrayCount[idx.m_vtxarray] = indexpos + 3;
-
- KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);
- ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[0]);
- ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[1]);
- ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[2]);
- if (!mat->UsesTriangles()) //if (!m_bUseTriangles)
- {
- //m_IndexArrayCount[idx.m_vtxarray] = indexpos+4;
- ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(idx.m_indexarray[3]);
- }
-}
-
+ RAS_MeshMaterial *mmat = GetMeshMaterial(mat);
+ RAS_MeshSlot *slot = mmat->m_baseslot;
+ RAS_MeshSlot::iterator it;
+ size_t i;
-
-void RAS_MeshObject::ScheduleWireframePoly(const KX_VertexIndex& idx,
- int numverts,
- int edgecode,
- RAS_IPolyMaterial* mat)
-{
- //int indexpos = m_IndexArrayCount[idx.m_vtxarray];
- int edgetrace = 1<<(numverts-1);
- bool drawedge = (edgecode & edgetrace)!=0;
- edgetrace = 1;
- int prevvert = idx.m_indexarray[numverts-1];
- KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);
-
- for (int v = 0; v < numverts; v++)
- {
- unsigned int curvert = idx.m_indexarray[v];
- if (drawedge)
- {
- ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(prevvert);
- ao->m_IndexArrayCache1[idx.m_vtxarray]->push_back(curvert);
- }
- prevvert = curvert;
- drawedge = (edgecode & edgetrace)!=0;
- edgetrace*=2;
- }
- //m_IndexArrayCount[idx.m_vtxarray] = indexpos;
+ for(slot->begin(it); !slot->end(it); slot->next(it))
+ for(i=it.startvertex; i<it.endvertex; i++)
+ it.vertex[i].SetRGBA(rgba);
}
-int RAS_MeshObject::FindOrAddVertex(int vtxarray,
- const MT_Point3& xyz,
- const MT_Point2& uv,
- const MT_Point2& uv2,
- const MT_Vector4& tangent,
- const unsigned int rgbacolor,
- const MT_Vector3& normal,
- bool flat,
- RAS_IPolyMaterial* mat,
- int origindex)
+void RAS_MeshObject::AddVertex(RAS_Polygon *poly, int i,
+ const MT_Point3& xyz,
+ const MT_Point2& uv,
+ const MT_Point2& uv2,
+ const MT_Vector4& tangent,
+ const unsigned int rgba,
+ const MT_Vector3& normal,
+ bool flat,
+ int origindex)
{
- KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);
+ RAS_TexVert texvert(xyz, uv, uv2, tangent, rgba, normal, flat, origindex);
+ RAS_MeshMaterial *mmat;
+ RAS_DisplayArray *darray;
+ RAS_MeshSlot *slot;
+ int offset;
- int numverts = ao->m_VertexArrayCache1[vtxarray]->size();//m_VertexArrayCount[vtxarray];
- RAS_TexVert newvert(xyz,uv,uv2,tangent,rgbacolor,normal, flat? TV_CALCFACENORMAL: 0,origindex);
+ mmat = GetMeshMaterial(poly->GetMaterial()->GetPolyMaterial());
+ slot = mmat->m_baseslot;
+ darray = slot->CurrentDisplayArray();
-#define KX_FIND_SHARED_VERTICES
-#ifdef KX_FIND_SHARED_VERTICES
if(!flat) {
- for (std::vector<RAS_MatArrayIndex>::iterator it = m_xyz_index_to_vertex_index_mapping[origindex].begin();
- it != m_xyz_index_to_vertex_index_mapping[origindex].end();
- it++)
+ /* find vertices shared between faces, with the restriction
+ * that they exist in the same display array, and have the
+ * same uv coordinate etc */
+ vector<SharedVertex>& sharedmap = m_sharedvertex_map[origindex];
+ vector<SharedVertex>::iterator it;
+
+ for(it = sharedmap.begin(); it != sharedmap.end(); it++)
{
- if ((*it).m_arrayindex1 == ao->m_index1 &&
- (*it).m_array == vtxarray &&
- *(*it).m_matid == *mat &&
- (*ao->m_VertexArrayCache1[vtxarray])[(*it).m_index].closeTo(&newvert)
- )
- {
- return (*it).m_index;
- }
+ if(it->m_darray != darray)
+ continue;
+ if(!it->m_darray->m_vertex[it->m_offset].closeTo(&texvert))
+ continue;
+
+ /* found one, add it and we're done */
+ if(poly->IsVisible())
+ slot->AddPolygonVertex(it->m_offset);
+ poly->SetVertexOffset(i, it->m_offset);
+ return;
}
}
-#endif // KX_FIND_SHARED_VERTICES
-
- // no vertex found, add one
- ao->m_VertexArrayCache1[vtxarray]->push_back(newvert);
- // printf("(%f,%f,%f) ",xyz[0],xyz[1],xyz[2]);
- RAS_MatArrayIndex idx;
- idx.m_arrayindex1 = ao->m_index1;
- idx.m_array = vtxarray;
- idx.m_index = numverts;
- idx.m_matid = mat;
- m_xyz_index_to_vertex_index_mapping[origindex].push_back(idx);
-
- return numverts;
-}
-vecVertexArray& RAS_MeshObject::GetVertexCache (RAS_IPolyMaterial* mat)
-{
- KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);
+ /* no shared vertex found, add a new one */
+ offset = slot->AddVertex(texvert);
+ if(poly->IsVisible())
+ slot->AddPolygonVertex(offset);
+ poly->SetVertexOffset(i, offset);
- return ao->m_VertexArrayCache1;
+ if(!flat) {
+ SharedVertex shared;
+ shared.m_darray = darray;
+ shared.m_offset = offset;
+ m_sharedvertex_map[origindex].push_back(shared);
+ }
}
-int RAS_MeshObject::GetVertexArrayLength(RAS_IPolyMaterial* mat)
+int RAS_MeshObject::NumVertices(RAS_IPolyMaterial* mat)
{
- int len = 0;
+ RAS_MeshMaterial *mmat;
+ RAS_MeshSlot *slot;
+ RAS_MeshSlot::iterator it;
+ size_t len = 0;
- const vecVertexArray & vertexvec = GetVertexCache(mat);
- vector<KX_VertexArray*>::const_iterator it = vertexvec.begin();
+ mmat = GetMeshMaterial(mat);
+ slot = mmat->m_baseslot;
+ for(slot->begin(it); !slot->end(it); slot->next(it))
+ len += it.endvertex - it.startvertex;
- for (; it != vertexvec.end(); ++it)
- {
- len += (*it)->size();
- }
-
return len;
}
-
RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid,
unsigned int index)
{
- RAS_TexVert* vertex = NULL;
-
- RAS_MaterialBucket* bucket = GetMaterialBucket(matid);
- if (bucket)
- {
- RAS_IPolyMaterial* mat = bucket->GetPolyMaterial();
- if (mat)
- {
- const vecVertexArray & vertexvec = GetVertexCache(mat);
- vector<KX_VertexArray*>::const_iterator it = vertexvec.begin();
-
- for (unsigned int len = 0; it != vertexvec.end(); ++it)
- {
- if (index < len + (*it)->size())
- {
- vertex = &(*(*it))[index-len];
- break;
- }
- else
- {
- len += (*it)->size();
- }
- }
- }
- }
-
- return vertex;
-}
-
-
-
-const vecIndexArrays& RAS_MeshObject::GetIndexCache (RAS_IPolyMaterial* mat)
-{
- KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);
-
- return ao->m_IndexArrayCache1;
-}
+ RAS_MeshMaterial *mmat;
+ RAS_MeshSlot *slot;
+ RAS_MeshSlot::iterator it;
+ size_t len;
+ mmat = GetMeshMaterial(matid);
-
-KX_ArrayOptimizer* RAS_MeshObject::GetArrayOptimizer(RAS_IPolyMaterial* polymat)
-{
- KX_ArrayOptimizer** aop = m_matVertexArrayS[polymat];
-
- if(aop)
- return *aop;
+ if(!mmat)
+ return NULL;
- // didn't find array, but an array might already exist
- // for a material equal to this one
- for(int i=0;i<m_matVertexArrayS.size();i++) {
- RAS_IPolyMaterial *mat = (RAS_IPolyMaterial*)(m_matVertexArrayS.getKey(i)->getValue());
- if(*mat == *polymat) {
- m_matVertexArrayS.insert(polymat, *m_matVertexArrayS.at(i));
- return *m_matVertexArrayS.at(i);
- }
+ slot = mmat->m_baseslot;
+ len = 0;
+ for(slot->begin(it); !slot->end(it); slot->next(it)) {
+ if(index >= len + it.endvertex - it.startvertex)
+ len += it.endvertex - it.startvertex;
+ else
+ return &it.vertex[index - len];
}
-
- // create new array
- int numelements = m_matVertexArrayS.size();
- m_sortedMaterials.push_back(polymat);
-
- KX_ArrayOptimizer* ao = new KX_ArrayOptimizer(numelements);
- m_matVertexArrayS.insert(polymat, ao);
- return ao;
+ return NULL;
}
-
-
-void RAS_MeshObject::Bucketize(double* oglmatrix,
- void* clientobj,
- bool useObjectColor,
- const MT_Vector4& rgbavec)
+void RAS_MeshObject::AddMeshUser(void *clientobj)
{
- KX_MeshSlot ms;
- ms.m_clientObj = clientobj;
- ms.m_mesh = this;
- ms.m_OpenGLMatrix = oglmatrix;
- ms.m_bObjectColor = useObjectColor;
- ms.m_RGBAcolor = rgbavec;
-
- for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it)
- {
- RAS_MaterialBucket* bucket = *it;
- bucket->SchedulePolygons(0);
-// KX_ArrayOptimizer* oa = GetArrayOptimizer(bucket->GetPolyMaterial());
- bucket->SetMeshSlot(ms);
- }
-
-}
+ list<RAS_MeshMaterial>::iterator it;
-
-
-void RAS_MeshObject::MarkVisible(double* oglmatrix,
- void* clientobj,
- bool visible,
- bool useObjectColor,
- const MT_Vector4& rgbavec)
-{
- KX_MeshSlot ms;
- ms.m_clientObj = clientobj;
- ms.m_mesh = this;
- ms.m_OpenGLMatrix = oglmatrix;
- ms.m_RGBAcolor = rgbavec;
- ms.m_bObjectColor= useObjectColor;
-
- for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it)
- {
- RAS_MaterialBucket* bucket = *it;
- bucket->SchedulePolygons(0);
-// KX_ArrayOptimizer* oa = GetArrayOptimizer(bucket->GetPolyMaterial());
- bucket->MarkVisibleMeshSlot(ms,visible,useObjectColor,rgbavec);
+ for(it = m_materials.begin();it!=m_materials.end();++it) {
+ /* always copy from the base slot, which is never removed
+ * since new objects can be created with the same mesh data */
+ RAS_MeshSlot *ms = it->m_bucket->CopyMesh(it->m_baseslot);
+ ms->m_clientObj = clientobj;
+ it->m_slots.insert(clientobj, ms);
}
}
-
-void RAS_MeshObject::RemoveFromBuckets(double* oglmatrix,
- void* clientobj)
+void RAS_MeshObject::UpdateBuckets(void* clientobj,
+ double* oglmatrix,
+ bool useObjectColor,
+ const MT_Vector4& rgbavec,
+ bool visible,
+ bool culled)
{
- KX_MeshSlot ms;
- ms.m_clientObj = clientobj;
- ms.m_mesh = this;
- ms.m_OpenGLMatrix = oglmatrix;
+ list<RAS_MeshMaterial>::iterator it;
- for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it)
- {
- RAS_MaterialBucket* bucket = *it;
-// RAS_IPolyMaterial* polymat = bucket->GetPolyMaterial();
- bucket->SchedulePolygons(0);
- //KX_ArrayOptimizer* oa = GetArrayOptimizer(polymat);
- bucket->RemoveMeshSlot(ms);
- }
+ for(it = m_materials.begin();it!=m_materials.end();++it) {
+ RAS_MeshSlot **msp = it->m_slots[clientobj];
-}
+ if(!msp)
+ continue;
+ RAS_MeshSlot *ms = *msp;
+ ms->m_mesh = this;
+ ms->m_OpenGLMatrix = oglmatrix;
+ ms->m_bObjectColor = useObjectColor;
+ ms->m_RGBAcolor = rgbavec;
+ ms->m_bVisible = visible;
+ ms->m_bCulled = culled || !visible;
-/*
- * RAS_MeshObject::GetVertex returns the vertex located somewhere in the vertexpool
- * it is the clients responsibility to make sure the array and index are valid
- */
-RAS_TexVert* RAS_MeshObject::GetVertex(short array,
- unsigned int index,
- RAS_IPolyMaterial* polymat)
-{
- KX_ArrayOptimizer* ao = GetArrayOptimizer(polymat);
- return &((*(ao->m_VertexArrayCache1)[array])[index]);
-}
-
-
-
-void RAS_MeshObject::ClearArrayData()
-{
- for (int i=0;i<m_matVertexArrayS.size();i++) {
- KX_ArrayOptimizer** ao = m_matVertexArrayS.at(i);
-
- // we have duplicate entries, only free once
- for(int j=i+1;j<m_matVertexArrayS.size();j++) {
- if(ao == m_matVertexArrayS.at(j)) {
- ao = NULL;
- break;
- }
- }
-
- if (ao)
- delete *ao;
+ /* split if necessary */
+ ms->Split();
}
}
-
-
-/**
- * RAS_MeshObject::CreateNewVertices creates vertices within sorted pools of vertices that share same material
-*/
-int RAS_MeshObject::FindVertexArray(int numverts,
- RAS_IPolyMaterial* polymat)
+void RAS_MeshObject::RemoveFromBuckets(void *clientobj)
{
-// bool found=false;
- int array=-1;
+ list<RAS_MeshMaterial>::iterator it;
- KX_ArrayOptimizer* ao = GetArrayOptimizer(polymat);
+ for(it = m_materials.begin();it!=m_materials.end();++it) {
+ RAS_MeshSlot **msp = it->m_slots[clientobj];
- for (unsigned int i=0;i<ao->m_VertexArrayCache1.size();i++)
- {
- if ( (ao->m_TriangleArrayCount[i] + (numverts-2)) < BUCKET_MAX_TRIANGLES)
- {
- if((ao->m_VertexArrayCache1[i]->size()+numverts < BUCKET_MAX_INDICES))
- {
- array = i;
- ao->m_TriangleArrayCount[array]+=numverts-2;
- break;
- }
- }
- }
+ if(!msp)
+ continue;
- if (array == -1)
- {
- array = ao->m_VertexArrayCache1.size();
- vector<RAS_TexVert>* va = new vector<RAS_TexVert>;
- ao->m_VertexArrayCache1.push_back(va);
- KX_IndexArray *ia = new KX_IndexArray();
- ao->m_IndexArrayCache1.push_back(ia);
- ao->m_TriangleArrayCount.push_back(numverts-2);
- }
+ RAS_MeshSlot *ms = *msp;
- return array;
+ it->m_bucket->RemoveMesh(ms);
+ it->m_slots.remove(clientobj);
+ }
}
-
-
-
//void RAS_MeshObject::Transform(const MT_Transform& trans)
//{
//m_trans.translate(MT_Vector3(0,0,1));//.operator *=(trans);
@@ -557,159 +448,62 @@ void RAS_MeshObject::RelativeTransform(const MT_Vector3& vec)
}
*/
-
-
-void RAS_MeshObject::UpdateMaterialList()
-{
- m_materials.clear();
- unsigned int numpolys = m_Polygons.size();
- // for all polygons, find out which material they use, and add it to the set of materials
- for (unsigned int i=0;i<numpolys;i++)
- {
- m_materials.insert(m_Polygons[i]->GetMaterial());
- }
-}
-
-struct RAS_MeshObject::polygonSlot
-{
- float m_z;
- RAS_Polygon *m_poly;
-
- polygonSlot(float z, RAS_Polygon* poly) :
- m_z(z),
- m_poly(poly)
- {}
- /**
- * pnorm and pval form the plane equation that the distance from is used to
- * sort against.
- */
- polygonSlot(const MT_Vector3 &pnorm, const MT_Scalar &pval, RAS_MeshObject *mesh, RAS_Polygon* poly) :
- m_poly(poly)
- {
- const KX_VertexIndex &base = m_poly->GetIndexBase();
- RAS_TexVert *vert = mesh->GetVertex(base.m_vtxarray, base.m_indexarray[0], poly->GetMaterial()->GetPolyMaterial());
- m_z = MT_dot(pnorm, vert->getLocalXYZ()) + pval;
-
- for(int i = 1; i < m_poly->VertexCount(); i++)
- {
- vert = mesh->GetVertex(base.m_vtxarray, base.m_indexarray[i], poly->GetMaterial()->GetPolyMaterial());
- float z = MT_dot(pnorm, vert->getLocalXYZ()) + pval;
- m_z += z;
- }
- m_z /= m_poly->VertexCount();
- }
-};
-
-struct RAS_MeshObject::backtofront
-{
- bool operator()(const polygonSlot &a, const polygonSlot &b) const
- {
- return a.m_z < b.m_z;
- }
-};
-
-struct RAS_MeshObject::fronttoback
-{
- bool operator()(const polygonSlot &a, const polygonSlot &b) const
- {
- return a.m_z > b.m_z;
+void RAS_MeshObject::SortPolygons(RAS_MeshSlot& ms, const MT_Transform &transform)
+{
+ // Limitations: sorting is quite simple, and handles many
+ // cases wrong, partially due to polygons being sorted per
+ // bucket.
+ //
+ // a) mixed triangles/quads are sorted wrong
+ // b) mixed materials are sorted wrong
+ // c) more than 65k faces are sorted wrong
+ // d) intersecting objects are sorted wrong
+ // e) intersecting polygons are sorted wrong
+ //
+ // a) can be solved by making all faces either triangles or quads
+ // if they need to be z-sorted. c) could be solved by allowing
+ // larger buckets, b) and d) cannot be solved easily if we want
+ // to avoid excessive state changes while drawing. e) would
+ // require splitting polygons.
+
+ RAS_MeshSlot::iterator it;
+ size_t j;
+
+ for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ unsigned int nvert = (int)it.array->m_type;
+ unsigned int totpoly = it.totindex/nvert;
+
+ if(totpoly <= 1)
+ continue;
+ if(it.array->m_type == RAS_DisplayArray::LINE)
+ continue;
+
+ // Extract camera Z plane...
+ const MT_Vector3 pnorm(transform.getBasis()[2]);
+ // unneeded: const MT_Scalar pval = transform.getOrigin()[2];
+
+ vector<polygonSlot> slots(totpoly);
+
+ /* get indices and z into temporary array */
+ for(j=0; j<totpoly; j++)
+ slots[j].get(it.vertex, it.index, j*nvert, nvert, pnorm);
+
+ /* sort (stable_sort might be better, if flickering happens?) */
+ std::sort(slots.begin(), slots.end(), backtofront());
+
+ /* get indices from temporary array again */
+ for(j=0; j<totpoly; j++)
+ slots[j].set(it.index, j*nvert, nvert);
}
-};
-
-
-void RAS_MeshObject::SortPolygons(const MT_Transform &transform)
-{
- if (!m_zsort)
- return;
-
- // Extract camera Z plane...
- const MT_Vector3 pnorm(transform.getBasis()[2]);
- const MT_Scalar pval = transform.getOrigin()[2];
-
- unsigned int numpolys = m_Polygons.size();
- std::multiset<polygonSlot, backtofront> alphapolyset;
- std::multiset<polygonSlot, fronttoback> solidpolyset;
-
- for (unsigned int p = 0; p < numpolys; p++)
- {
- RAS_Polygon* poly = m_Polygons[p];
- if (poly->IsVisible())
- {
- if (poly->GetMaterial()->GetPolyMaterial()->IsTransparant())
- {
- alphapolyset.insert(polygonSlot(pnorm, pval, this, poly));
- } else {
- solidpolyset.insert(polygonSlot(pnorm, pval, this, poly));
- }
- }
- }
-
- // Clear current array data.
- for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it)
- {
- vector<KX_IndexArray*> *indexcache = &GetArrayOptimizer((*it)->GetPolyMaterial())->m_IndexArrayCache1;
- for (vector<KX_IndexArray*>::iterator iit = indexcache->begin(); iit != indexcache->end(); ++iit)
- (*iit)->clear();
- }
-
- std::multiset<polygonSlot, fronttoback>::iterator sit = solidpolyset.begin();
- for (; sit != solidpolyset.end(); ++sit)
- SchedulePoly((*sit).m_poly->GetVertexIndexBase(), (*sit).m_poly->VertexCount(), (*sit).m_poly->GetMaterial()->GetPolyMaterial());
-
- std::multiset<polygonSlot, backtofront>::iterator ait = alphapolyset.begin();
- for (; ait != alphapolyset.end(); ++ait)
- SchedulePoly((*ait).m_poly->GetVertexIndexBase(), (*ait).m_poly->VertexCount(), (*ait).m_poly->GetMaterial()->GetPolyMaterial());
}
-void RAS_MeshObject::SchedulePolygons(const MT_Transform &transform, int drawingmode)
+void RAS_MeshObject::SchedulePolygons(int drawingmode)
{
-// int nummaterials = m_materials.size();
- int i;
-
if (m_bModified)
{
- for (RAS_MaterialBucket::Set::iterator it = m_materials.begin();it!=m_materials.end();++it)
- {
- RAS_MaterialBucket* bucket = *it;
-
- bucket->SchedulePolygons(drawingmode);
- if (bucket->GetPolyMaterial()->IsZSort())
- m_zsort = true;
- }
-
- int numpolys = m_Polygons.size();
-
- if ((drawingmode > RAS_IRasterizer::KX_BOUNDINGBOX) &&
- (drawingmode < RAS_IRasterizer::KX_SOLID))
- {
- for (i=0;i<numpolys;i++)
- {
- RAS_Polygon* poly = m_Polygons[i];
- if (poly->IsVisible())
- ScheduleWireframePoly(poly->GetVertexIndexBase(),poly->VertexCount(),poly->GetEdgeCode()
- ,poly->GetMaterial()->GetPolyMaterial());
-
- }
- m_zsort = false;
- }
- else
- {
- if (!m_zsort)
- {
- for (i=0;i<numpolys;i++)
- {
- RAS_Polygon* poly = m_Polygons[i];
- if (poly->IsVisible())
- {
- SchedulePoly(poly->GetVertexIndexBase(),poly->VertexCount(),poly->GetMaterial()->GetPolyMaterial());
- }
- }
- }
- }
-
m_bModified = false;
-
- m_MeshMod = true;
+ m_bMeshModified = true;
}
}
+
diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h
index 0d06748f91f..0d35a2f402b 100644
--- a/source/gameengine/Rasterizer/RAS_MeshObject.h
+++ b/source/gameengine/Rasterizer/RAS_MeshObject.h
@@ -36,6 +36,7 @@
#include <vector>
#include <set>
+#include <list>
#include "RAS_Polygon.h"
#include "RAS_MaterialBucket.h"
@@ -44,196 +45,71 @@
#include "GEN_HashedPtr.h"
struct Mesh;
-/**
- * This class holds an array of vertices and indicies.
- */
-class KX_ArrayOptimizer
-{
-public:
- KX_ArrayOptimizer(int index)
- : m_index1(index)
- {};
- virtual ~KX_ArrayOptimizer();
-
- vector<KX_VertexArray*> m_VertexArrayCache1;
- vector<int> m_TriangleArrayCount;
- vector<KX_IndexArray*> m_IndexArrayCache1;
-
- /**
- order in which they are stored into the mesh
- */
- int m_index1;
-};
-
-/**
- * This struct holds a triangle.
- */
-struct RAS_TriangleIndex
-{
-public:
- int m_index[3];
- int m_array;
- RAS_IPolyMaterial* m_matid;
- bool m_collider;
-};
-
-/**
- * This class looks horribly broken. Only m_matid is used, and
- * m_matid is a (int) RAS_IPolyMaterial*.
- * --> m_matid == lhs.m_matid should be *m_matid == *lhs.m_matid
- */
-class RAS_MatArrayIndex
-{
-public:
- int m_arrayindex1;
- RAS_IPolyMaterial* m_matid;
- int m_array;
- int m_index;
+/* RAS_MeshObject is a mesh used for rendering. It stores polygons,
+ * but the actual vertices and index arrays are stored in material
+ * buckets, referenced by the list of RAS_MeshMaterials. */
-/*
- inline bool Less(const RAS_MatArrayIndex& lhs) const {
- bool result =
- ( (m_matid < lhs.m_matid) ||
- ((m_matid == lhs.m_matid)&&(m_array < lhs.m_array)) ||
- ((m_matid == lhs.m_matid) && (m_array == lhs.m_array) &&
- (m_index < lhs.m_index))
-
- );
- return result;
-
- }
-*/
-
-};
-/*
-inline bool operator <( const RAS_MatArrayIndex& rhs,const RAS_MatArrayIndex& lhs)
-{
- return ( rhs.Less(lhs));
-}*/
-
-/**
- * RAS_MeshObject stores mesh data for the renderer.
- */
class RAS_MeshObject
{
-
- // GEN_Map<class RAS_IPolyMaterial,KX_ArrayOptimizer*> m_matVertexArrayS;
- //vector<class RAS_IPolyMaterial*,KX_ArrayOptimizer> m_vertexArrays;
- virtual KX_ArrayOptimizer* GetArrayOptimizer(RAS_IPolyMaterial* polymat);
- //vector<RAS_Polygon*> m_polygons;
-
+private:
unsigned int m_debugcolor;
- bool m_bModified;
int m_lightlayer;
-
- vector<class RAS_Polygon*> m_Polygons;
+
+ bool m_bModified;
+ bool m_bMeshModified;
+
STR_String m_name;
static STR_String s_emptyname;
- bool m_zsort;
- bool m_MeshMod;
+ vector<class RAS_Polygon*> m_Polygons;
+
+ /* polygon sorting */
struct polygonSlot;
struct backtofront;
struct fronttoback;
-
protected:
- enum { BUCKET_MAX_INDICES = 65535 };//2048};//8192};
- enum { BUCKET_MAX_TRIANGLES = 65535 };
-
- GEN_Map<GEN_HashedPtr,KX_ArrayOptimizer*> m_matVertexArrayS;
-
- RAS_MaterialBucket::Set m_materials;
+ list<RAS_MeshMaterial> m_materials;
Mesh* m_mesh;
+ bool m_bDeformed;
+
public:
// for now, meshes need to be in a certain layer (to avoid sorting on lights in realtime)
RAS_MeshObject(Mesh* mesh, int lightlayer);
virtual ~RAS_MeshObject();
- vector<RAS_IPolyMaterial*> m_sortedMaterials;
- vector<vector<RAS_MatArrayIndex> > m_xyz_index_to_vertex_index_mapping;
- vector<RAS_TriangleIndex > m_triangle_indices;
-
- int m_class;
- unsigned int GetLightLayer();
+ bool IsDeformed() { return m_bDeformed; }
+
+ /* materials */
int NumMaterials();
const STR_String& GetMaterialName(unsigned int matid);
- RAS_MaterialBucket* GetMaterialBucket(unsigned int matid);
const STR_String& GetTextureName(unsigned int matid);
- virtual void AddPolygon(RAS_Polygon* poly);
- void UpdateMaterialList();
-
- int NumPolygons();
- RAS_Polygon* GetPolygon(int num);
-
- virtual void Bucketize(
- double* oglmatrix,
- void* clientobj,
- bool useObjectColor,
- const MT_Vector4& rgbavec
- );
- void RemoveFromBuckets(
- double* oglmatrix,
- void* clientobj
- );
+ RAS_MeshMaterial* GetMeshMaterial(unsigned int matid);
+ RAS_MeshMaterial* GetMeshMaterial(RAS_IPolyMaterial *mat);
- void MarkVisible(
- double* oglmatrix,
- void* clientobj,
- bool visible,
- bool useObjectColor,
- const MT_Vector4& rgbavec
- );
+ list<RAS_MeshMaterial>::iterator GetFirstMaterial();
+ list<RAS_MeshMaterial>::iterator GetLastMaterial();
- void DebugColor(unsigned int abgr);
-
- /**
- * Sorts the polygons by their transformed z values.
- */
- void SortPolygons(const MT_Transform &transform);
+ unsigned int GetLightLayer();
- void SchedulePolygons(
- const MT_Transform &transform,
- int drawingmode
- );
+ /* name */
+ void SetName(STR_String name);
+ const STR_String& GetName();
- void ClearArrayData();
-
- RAS_MaterialBucket::Set::iterator GetFirstMaterial();
- RAS_MaterialBucket::Set::iterator GetLastMaterial();
-
- virtual RAS_TexVert* GetVertex(
- short array,
- unsigned int index,
- RAS_IPolyMaterial* polymat
- );
-
- virtual int FindVertexArray(
- int numverts,
- RAS_IPolyMaterial* polymat
- );
-
- void SchedulePoly(
- const KX_VertexIndex& idx,
- int numverts,
- RAS_IPolyMaterial* mat
- );
+ /* modification state */
+ bool MeshModified();
+ void SetMeshModified(bool v){m_bMeshModified = v;}
- void ScheduleWireframePoly(
- const KX_VertexIndex& idx,
- int numverts,
- int edgecode,
- RAS_IPolyMaterial* mat
- );
-
- // find (and share) or add vertices
- // for some speedup, only the last 20 added vertices are searched for equality
+ /* original blender mesh */
+ Mesh* GetMesh() { return m_mesh; }
+
+ /* mesh construction */
- virtual int FindOrAddVertex(
- int vtxarray,
+ virtual RAS_Polygon* AddPolygon(RAS_MaterialBucket *bucket, int numverts);
+ virtual void AddVertex(RAS_Polygon *poly, int i,
const MT_Point3& xyz,
const MT_Point2& uv,
const MT_Point2& uv2,
@@ -241,27 +117,43 @@ public:
const unsigned int rgbacolor,
const MT_Vector3& normal,
bool flat,
- RAS_IPolyMaterial* mat,
- int origindex
- );
-
- vecVertexArray& GetVertexCache (RAS_IPolyMaterial* mat);
+ int origindex);
+
+ void SchedulePolygons(int drawingmode);
+
+ /* vertex and polygon acces */
+ int NumVertices(RAS_IPolyMaterial* mat);
+ RAS_TexVert* GetVertex(unsigned int matid, unsigned int index);
+
+ int NumPolygons();
+ RAS_Polygon* GetPolygon(int num) const;
- int GetVertexArrayLength(RAS_IPolyMaterial* mat);
+ /* buckets */
+ virtual void AddMeshUser(void *clientobj);
+ virtual void UpdateBuckets(
+ void* clientobj,
+ double* oglmatrix,
+ bool useObjectColor,
+ const MT_Vector4& rgbavec,
+ bool visible,
+ bool culled);
- RAS_TexVert* GetVertex(
- unsigned int matid,
- unsigned int index
- );
+ void RemoveFromBuckets(void *clientobj);
- const vecIndexArrays& GetIndexCache (RAS_IPolyMaterial* mat);
- void SetName(STR_String name);
- const STR_String& GetName();
+ /* colors */
+ void DebugColor(unsigned int abgr);
+ void SetVertexColor(RAS_IPolyMaterial* mat,MT_Vector4 rgba);
+
+ /* polygon sorting by Z for alpha */
+ void SortPolygons(RAS_MeshSlot& ms, const MT_Transform &transform);
- bool MeshModified();
- void SetMeshModified(bool v){m_MeshMod = v;}
- Mesh* GetMesh() { return m_mesh; }
+ /* for construction to find shared vertices */
+ struct SharedVertex {
+ RAS_DisplayArray *m_darray;
+ int m_offset;
+ };
+ vector<vector<SharedVertex> > m_sharedvertex_map;
};
#endif //__RAS_MESHOBJECT
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
index 2a6d64ecc73..e4403ace69f 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
@@ -32,6 +32,7 @@ SET(INC
../../../../intern/moto/include
../../../../source/gameengine/Rasterizer
../../../../extern/glew/include
+ ../../../../source/blender/gpu
)
BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}")
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
index f01978b8eb1..aee485a22be 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
@@ -41,12 +41,11 @@ CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../../kernel/gen_system
+CPPFLAGS += -I../../../blender/gpu
CPPFLAGS += -I../../BlenderRoutines
CPPFLAGS += -I..
+
ifeq ($(OS),darwin)
CPPFLAGS += -fpascal-strings
endif
-ifeq ($(WITH_BF_GLEXT),true)
- CPPFLAGS += -DWITH_GLEXT
-endif
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
index c2687319717..2c4b55ff964 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
@@ -9,6 +9,7 @@
#include "GL/glew.h"
+#include "RAS_MaterialBucket.h"
#include "RAS_TexVert.h"
#include "MT_assert.h"
@@ -125,20 +126,20 @@ void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list)
}
}
-RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(const vecVertexArray& vertexarrays, KX_ListSlot** slot)
+RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
{
/*
Keep a copy of constant lists submitted for rendering,
this guards against (replicated)new...delete every frame,
and we can reuse lists!
- :: sorted by vertex array
+ :: sorted by mesh slot
*/
- RAS_ListSlot* localSlot = (RAS_ListSlot*)*slot;
+ RAS_ListSlot* localSlot = (RAS_ListSlot*)ms.m_DisplayList;
if(!localSlot) {
- RAS_Lists::iterator it = mLists.find(vertexarrays);
+ RAS_Lists::iterator it = mLists.find(&ms);
if(it == mLists.end()) {
localSlot = new RAS_ListSlot(this);
- mLists.insert(std::pair<vecVertexArray, RAS_ListSlot*>(vertexarrays, localSlot));
+ mLists.insert(std::pair<RAS_MeshSlot*, RAS_ListSlot*>(&ms, localSlot));
} else {
localSlot = static_cast<RAS_ListSlot*>(it->second->AddRef());
}
@@ -157,69 +158,45 @@ void RAS_ListRasterizer::ReleaseAlloc()
mLists.clear();
}
-
-void RAS_ListRasterizer::IndexPrimitives(
- const vecVertexArray & vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot)
+void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
{
RAS_ListSlot* localSlot =0;
- // useObjectColor(are we updating every frame?)
- if(!useObjectColor && slot) {
- localSlot = FindOrAdd(vertexarrays, slot);
+ if(ms.m_bDisplayList) {
+ localSlot = FindOrAdd(ms);
localSlot->DrawList();
if(localSlot->End()) {
// save slot here too, needed for replicas and object using same mesh
// => they have the same vertexarray but different mesh slot
- *slot = localSlot;
+ ms.m_DisplayList = localSlot;
return;
}
}
- if (mUseVertexArrays) {
- RAS_VAOpenGLRasterizer::IndexPrimitives(
- vertexarrays, indexarrays,
- mode, useObjectColor,
- rgbacolor,slot
- );
- } else {
- RAS_OpenGLRasterizer::IndexPrimitives(
- vertexarrays, indexarrays,
- mode, useObjectColor,
- rgbacolor,slot
- );
- }
+ if (mUseVertexArrays)
+ RAS_VAOpenGLRasterizer::IndexPrimitives(ms);
+ else
+ RAS_OpenGLRasterizer::IndexPrimitives(ms);
- if(!useObjectColor && slot) {
+ if(ms.m_bDisplayList) {
localSlot->EndList();
- *slot = localSlot;
+ ms.m_DisplayList = localSlot;
}
}
-void RAS_ListRasterizer::IndexPrimitivesMulti(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot)
+void RAS_ListRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
{
RAS_ListSlot* localSlot =0;
- // useObjectColor(are we updating every frame?)
- if(!useObjectColor && slot) {
- localSlot = FindOrAdd(vertexarrays, slot);
+ if(ms.m_bDisplayList) {
+ localSlot = FindOrAdd(ms);
localSlot->DrawList();
if(localSlot->End()) {
// save slot here too, needed for replicas and object using same mesh
// => they have the same vertexarray but different mesh slot
- *slot = localSlot;
+ ms.m_DisplayList = localSlot;
return;
}
}
@@ -227,23 +204,14 @@ void RAS_ListRasterizer::IndexPrimitivesMulti(
// workaround: note how we do not use vertex arrays for making display
// lists, since glVertexAttribPointerARB doesn't seem to work correct
// in display lists on ATI? either a bug in the driver or in Blender ..
- if (mUseVertexArrays && !localSlot) {
- RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(
- vertexarrays, indexarrays,
- mode, useObjectColor,
- rgbacolor,slot
- );
- } else {
- RAS_OpenGLRasterizer::IndexPrimitivesMulti(
- vertexarrays, indexarrays,
- mode, useObjectColor,
- rgbacolor,slot
- );
- }
+ if (mUseVertexArrays && !localSlot)
+ RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(ms);
+ else
+ RAS_OpenGLRasterizer::IndexPrimitivesMulti(ms);
- if(!useObjectColor && slot) {
+ if(ms.m_bDisplayList) {
localSlot->EndList();
- *slot = localSlot;
+ ms.m_DisplayList = localSlot;
}
}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
index b1b19144c12..96d6d2a995d 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
@@ -4,6 +4,7 @@
#include "RAS_MaterialBucket.h"
#include "RAS_VAOpenGLRasterizer.h"
#include <vector>
+#include <map>
class RAS_ListRasterizer;
class RAS_ListSlot : public KX_ListSlot
@@ -34,14 +35,14 @@ enum RAS_ListSlotFlags {
LIST_REGEN =64
};
-typedef std::map<const vecVertexArray, RAS_ListSlot*> RAS_Lists;
+typedef std::map<class RAS_MeshSlot*, RAS_ListSlot*> RAS_Lists;
class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer
{
bool mUseVertexArrays;
RAS_Lists mLists;
- RAS_ListSlot* FindOrAdd(const vecVertexArray& vertexarrays, KX_ListSlot** slot);
+ RAS_ListSlot* FindOrAdd(class RAS_MeshSlot& ms);
void ReleaseAlloc();
public:
@@ -49,23 +50,8 @@ public:
RAS_ListRasterizer(RAS_ICanvas* canvas, bool useVertexArrays=false, bool lock=false);
virtual ~RAS_ListRasterizer();
- virtual void IndexPrimitives(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot
- );
-
- virtual void IndexPrimitivesMulti(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot
- );
+ virtual void IndexPrimitives(class RAS_MeshSlot& ms);
+ virtual void IndexPrimitivesMulti(class RAS_MeshSlot& ms);
virtual bool Init();
virtual void Exit();
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index dcc36bf5a39..62ee2edb731 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -38,6 +38,9 @@
#include "MT_CmMatrix4x4.h"
#include "RAS_IRenderTools.h" // rendering text
+#include "GPU_draw.h"
+#include "GPU_material.h"
+
/**
* 32x32 bit masks for vinterlace stereo mode
*/
@@ -67,9 +70,12 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas)
m_motionblurvalue(-1.0),
m_texco_num(0),
m_attrib_num(0),
+ m_last_blendmode(GPU_BLEND_SOLID),
+ m_last_frontface(true),
m_materialCachingInfo(0)
{
- m_viewmatrix.Identity();
+ m_viewmatrix.setIdentity();
+ m_viewinvmatrix.setIdentity();
for (int i = 0; i < 32; i++)
{
@@ -86,81 +92,9 @@ RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer()
{
}
-
-
-static void Myinit_gl_stuff(void)
-{
- float mat_specular[] = { 0.5, 0.5, 0.5, 1.0 };
- float mat_shininess[] = { 35.0 };
-/* float one= 1.0; */
- int a, x, y;
- GLubyte pat[32*32];
- const GLubyte *patc= pat;
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_specular);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
-
-
-#if defined(__FreeBSD) || defined(__linux__)
- glDisable(GL_DITHER); /* op sgi/sun hardware && 12 bits */
-#endif
-
- /* no local viewer, looks ugly in ortho mode */
- /* glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, &one); */
-
- glDepthFunc(GL_LEQUAL);
- /* scaling matrices */
- glEnable(GL_NORMALIZE);
-
- glShadeModel(GL_FLAT);
-
- glDisable(GL_ALPHA_TEST);
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_FOG);
- glDisable(GL_LIGHTING);
- glDisable(GL_LOGIC_OP);
- glDisable(GL_STENCIL_TEST);
- glDisable(GL_TEXTURE_1D);
- glDisable(GL_TEXTURE_2D);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
- glPixelTransferi(GL_RED_SCALE, 1);
- glPixelTransferi(GL_RED_BIAS, 0);
- glPixelTransferi(GL_GREEN_SCALE, 1);
- glPixelTransferi(GL_GREEN_BIAS, 0);
- glPixelTransferi(GL_BLUE_SCALE, 1);
- glPixelTransferi(GL_BLUE_BIAS, 0);
- glPixelTransferi(GL_ALPHA_SCALE, 1);
- glPixelTransferi(GL_ALPHA_BIAS, 0);
-
- a = 0;
- for(x=0; x<32; x++)
- {
- for(y=0; y<4; y++)
- {
- if( (x) & 1) pat[a++]= 0x88;
- else pat[a++]= 0x22;
- }
- }
-
- glPolygonStipple(patc);
-
- glFrontFace(GL_CCW);
- glCullFace(GL_BACK);
- glEnable(GL_CULL_FACE);
-}
-
-
-
bool RAS_OpenGLRasterizer::Init()
{
-
- Myinit_gl_stuff();
+ GPU_state_init();
m_redback = 0.4375;
m_greenback = 0.4375;
@@ -171,6 +105,9 @@ bool RAS_OpenGLRasterizer::Init()
m_ambg = 0.0f;
m_ambb = 0.0f;
+ SetBlendingMode(GPU_BLEND_SOLID);
+ SetFrontFace(true);
+
glClearColor(m_redback,m_greenback,m_blueback,m_alphaback);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -189,18 +126,6 @@ void RAS_OpenGLRasterizer::SetAmbientColor(float red, float green, float blue)
}
-void RAS_OpenGLRasterizer::SetAlphaTest(bool enable)
-{
- if (enable)
- {
- glEnable(GL_ALPHA_TEST);
- glAlphaFunc(GL_GREATER, 0.6f);
- }
- else glDisable(GL_ALPHA_TEST);
-}
-
-
-
void RAS_OpenGLRasterizer::SetAmbient(float factor)
{
float ambient[] = { m_ambr*factor, m_ambg*factor, m_ambb*factor, 1.0f };
@@ -353,6 +278,9 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time)
glEnable (GL_CULL_FACE);
}
+ SetBlendingMode(GPU_BLEND_SOLID);
+ SetFrontFace(true);
+
glShadeModel(GL_SMOOTH);
m_2DCanvas->BeginFrame();
@@ -366,28 +294,16 @@ void RAS_OpenGLRasterizer::SetDrawingMode(int drawingmode)
{
m_drawingmode = drawingmode;
- switch (m_drawingmode)
- {
- case KX_WIREFRAME:
- {
- glDisable (GL_CULL_FACE);
- break;
- }
- default:
- {
- }
- }
+ if(m_drawingmode == KX_WIREFRAME)
+ glDisable(GL_CULL_FACE);
}
-
-
int RAS_OpenGLRasterizer::GetDrawingMode()
{
return m_drawingmode;
}
-
void RAS_OpenGLRasterizer::SetDepthMask(DepthMask depthmask)
{
glDepthMask(depthmask == KX_DEPTHMASK_DISABLED ? GL_FALSE : GL_TRUE);
@@ -580,294 +496,84 @@ void RAS_OpenGLRasterizer::SwapBuffers()
-void RAS_OpenGLRasterizer::GetViewMatrix(MT_Matrix4x4 &mat) const
+const MT_Matrix4x4& RAS_OpenGLRasterizer::GetViewMatrix() const
{
- float viewmat[16];
- glGetFloatv(GL_MODELVIEW_MATRIX, viewmat);
- mat.setValue(viewmat);
+ return m_viewmatrix;
}
-
-
-void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot
- )
-{
- const RAS_TexVert* vertexarray;
- unsigned int numindices, vt;
-
- for (vt=0;vt<vertexarrays.size();vt++)
- {
- vertexarray = &((*vertexarrays[vt]) [0]);
- const KX_IndexArray & indexarray = (*indexarrays[vt]);
- numindices = indexarray.size();
-
- if (!numindices)
- break;
-
- int vindex=0;
- switch (mode)
- {
- case KX_MODE_LINES:
- {
- glBegin(GL_LINES);
- vindex=0;
- for (unsigned int i=0;i<numindices;i+=2)
- {
- glVertex3fv(vertexarray[(indexarray[vindex++])].getLocalXYZ());
- glVertex3fv(vertexarray[(indexarray[vindex++])].getLocalXYZ());
- }
- glEnd();
- }
- break;
- case KX_MODE_QUADS:
- {
- glBegin(GL_QUADS);
- vindex=0;
- if (useObjectColor)
- {
- for (unsigned int i=0;i<numindices;i+=4)
- {
-
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- else
- {
- for (unsigned int i=0;i<numindices;i+=4)
- {
- // This looks curiously endian unsafe to me.
- // However it depends on the way the colors are packed into
- // the m_rgba field of RAS_TexVert
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- glEnd();
- break;
- }
- case KX_MODE_TRIANGLES:
- {
- glBegin(GL_TRIANGLES);
- vindex=0;
- if (useObjectColor)
- {
- for (unsigned int i=0;i<numindices;i+=3)
- {
-
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- else
- {
- for (unsigned int i=0;i<numindices;i+=3)
- {
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1());
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- glEnd();
- break;
- }
- default:
- {
- }
-
- } // switch
- } // for each vertexarray
-
+const MT_Matrix4x4& RAS_OpenGLRasterizer::GetViewInvMatrix() const
+{
+ return m_viewinvmatrix;
}
-void RAS_OpenGLRasterizer::IndexPrimitives_3DText(const vecVertexArray & vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
+void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
class RAS_IPolyMaterial* polymat,
- class RAS_IRenderTools* rendertools,
- bool useObjectColor,
- const MT_Vector4& rgbacolor
- )
+ class RAS_IRenderTools* rendertools)
{
- const RAS_TexVert* vertexarray;
- unsigned int numindices, vt;
-
- if (useObjectColor)
- {
+ bool obcolor = ms.m_bObjectColor;
+ MT_Vector4& rgba = ms.m_RGBAcolor;
+ RAS_MeshSlot::iterator it;
+
+ // handle object color
+ if (obcolor) {
glDisableClientState(GL_COLOR_ARRAY);
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
+ glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
}
else
- {
glEnableClientState(GL_COLOR_ARRAY);
- }
-
- for (vt=0;vt<vertexarrays.size();vt++)
- {
- vertexarray = &((*vertexarrays[vt]) [0]);
- const KX_IndexArray & indexarray = (*indexarrays[vt]);
- numindices = indexarray.size();
-
- if (!numindices)
- break;
+
+ for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ RAS_TexVert *vertex;
+ size_t i, j, numvert;
- int vindex=0;
- switch (mode)
- {
- case KX_MODE_LINES:
- {
- glBegin(GL_LINES);
- vindex=0;
- for (unsigned int i=0;i<numindices;i+=2)
- {
- glVertex3fv(vertexarray[(indexarray[vindex++])].getLocalXYZ());
- glVertex3fv(vertexarray[(indexarray[vindex++])].getLocalXYZ());
- }
- glEnd();
- }
- break;
- case KX_MODE_QUADS:
+ numvert = it.array->m_type;
+
+ if(it.array->m_type == RAS_DisplayArray::LINE) {
+ // line drawing, no text
+ glBegin(GL_LINES);
+
+ for(i=0; i<it.totindex; i+=2)
{
- vindex=0;
- for (unsigned int i=0;i<numindices;i+=4)
- {
- float v1[3],v2[3],v3[3],v4[3];
-
- v1[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v1[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v1[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
- vindex++;
-
- v2[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v2[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v2[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
- vindex++;
-
- v3[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v3[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v3[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
- vindex++;
-
- v4[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v4[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v4[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
-
- vindex++;
-
- rendertools->RenderText(polymat->GetDrawingMode(),polymat,v1,v2,v3,v4);
- ClearCachingInfo();
- }
- break;
+ vertex = &it.vertex[it.index[i]];
+ glVertex3fv(vertex->getXYZ());
+
+ vertex = &it.vertex[it.index[i+1]];
+ glVertex3fv(vertex->getXYZ());
}
- case KX_MODE_TRIANGLES:
+
+ glEnd();
+ }
+ else {
+ // triangle and quad text drawing
+ for(i=0; i<it.totindex; i+=numvert)
{
- glBegin(GL_TRIANGLES);
- vindex=0;
- for (unsigned int i=0;i<numindices;i+=3)
- {
- float v1[3],v2[3],v3[3];
-
- v1[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v1[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v1[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
- vindex++;
-
- v2[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v2[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v2[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
- vindex++;
-
- v3[0] = vertexarray[(indexarray[vindex])].getLocalXYZ()[0];
- v3[1] = vertexarray[(indexarray[vindex])].getLocalXYZ()[1];
- v3[2] = vertexarray[(indexarray[vindex])].getLocalXYZ()[2];
- vindex++;
-
- rendertools->RenderText(polymat->GetDrawingMode(),polymat,v1,v2,v3,NULL);
- ClearCachingInfo();
+ float v[4][3];
+ int glattrib, unit;
+
+ for(j=0; j<numvert; j++) {
+ vertex = &it.vertex[it.index[i+j]];
+
+ v[j][0] = vertex->getXYZ()[0];
+ v[j][1] = vertex->getXYZ()[1];
+ v[j][2] = vertex->getXYZ()[2];
}
- glEnd();
- break;
- }
- default:
- {
+
+ // find the right opengl attribute
+ glattrib = -1;
+ if(GLEW_ARB_vertex_program)
+ for(unit=0; unit<m_attrib_num; unit++)
+ if(m_attrib[unit] == RAS_TEXCO_UV1)
+ glattrib = unit;
+
+ rendertools->RenderText(polymat->GetDrawingMode(), polymat,
+ v[0], v[1], v[2], (numvert == 4)? v[3]: NULL, glattrib);
+
+ ClearCachingInfo();
}
- } //switch
- } //for each vertexarray
+ }
+ }
+
+ glDisableClientState(GL_COLOR_ARRAY);
}
void RAS_OpenGLRasterizer::SetTexCoordNum(int num)
@@ -904,14 +610,14 @@ void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv)
if(GLEW_ARB_multitexture) {
for(unit=0; unit<m_texco_num; unit++) {
- if(tv.getFlag() & TV_2NDUV && (int)tv.getUnit() == unit) {
+ if(tv.getFlag() & RAS_TexVert::SECOND_UV && (int)tv.getUnit() == unit) {
glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV2());
continue;
}
switch(m_texco[unit]) {
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
- glMultiTexCoord3fvARB(GL_TEXTURE0_ARB+unit, tv.getLocalXYZ());
+ glMultiTexCoord3fvARB(GL_TEXTURE0_ARB+unit, tv.getXYZ());
break;
case RAS_TEXCO_UV1:
glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV1());
@@ -936,7 +642,7 @@ void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv)
switch(m_attrib[unit]) {
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
- glVertexAttrib3fvARB(unit, tv.getLocalXYZ());
+ glVertexAttrib3fvARB(unit, tv.getXYZ());
break;
case RAS_TEXCO_UV1:
glVertexAttrib2fvARB(unit, tv.getUV1());
@@ -960,211 +666,80 @@ void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv)
}
}
-void RAS_OpenGLRasterizer::Tangent( const RAS_TexVert& v1,
- const RAS_TexVert& v2,
- const RAS_TexVert& v3,
- const MT_Vector3 &no)
+
+void RAS_OpenGLRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
{
- // TODO: set for deformer...
- MT_Vector3 x1(v1.getLocalXYZ()), x2(v2.getLocalXYZ()), x3(v3.getLocalXYZ());
- MT_Vector2 uv1(v1.getUV1()), uv2(v2.getUV1()), uv3(v3.getUV1());
- MT_Vector3 dx1(x2 - x1), dx2(x3 - x1);
- MT_Vector2 duv1(uv2 - uv1), duv2(uv3 - uv1);
-
- MT_Scalar r = 1.0 / (duv1.x() * duv2.y() - duv2.x() * duv1.y());
- duv1 *= r;
- duv2 *= r;
- MT_Vector3 sdir(duv2.y() * dx1 - duv1.y() * dx2);
- MT_Vector3 tdir(duv1.x() * dx2 - duv2.x() * dx1);
-
- // Gram-Schmidt orthogonalize
- MT_Vector3 t(sdir - no.cross(no.cross(sdir)));
- if (!MT_fuzzyZero(t)) t /= t.length();
-
- float tangent[4];
- t.getValue(tangent);
- // Calculate handedness
- tangent[3] = no.dot(sdir.cross(tdir)) < 0.0 ? -1.0 : 1.0;
+ IndexPrimitivesInternal(ms, false);
}
+void RAS_OpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
+{
+ IndexPrimitivesInternal(ms, true);
+}
-void RAS_OpenGLRasterizer::IndexPrimitivesMulti(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot
- )
+void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi)
{
+ bool obcolor = ms.m_bObjectColor;
+ bool wireframe = m_drawingmode <= KX_WIREFRAME;
+ MT_Vector4& rgba = ms.m_RGBAcolor;
+ RAS_MeshSlot::iterator it;
+
+ // iterate over display arrays, each containing an index + vertex array
+ for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ RAS_TexVert *vertex;
+ size_t i, j, numvert;
+
+ numvert = it.array->m_type;
- const RAS_TexVert* vertexarray;
- unsigned int numindices,vt;
-
- for (vt=0;vt<vertexarrays.size();vt++)
- {
- vertexarray = &((*vertexarrays[vt]) [0]);
- const KX_IndexArray & indexarray = (*indexarrays[vt]);
- numindices = indexarray.size();
+ if(it.array->m_type == RAS_DisplayArray::LINE) {
+ // line drawing
+ glBegin(GL_LINES);
- if (!numindices)
- break;
-
- int vindex=0;
- switch (mode)
- {
- case KX_MODE_LINES:
+ for(i=0; i<it.totindex; i+=2)
{
- glBegin(GL_LINES);
- vindex=0;
- for (unsigned int i=0;i<numindices;i+=2)
- {
- glVertex3fv(vertexarray[(indexarray[vindex++])].getLocalXYZ());
- glVertex3fv(vertexarray[(indexarray[vindex++])].getLocalXYZ());
- }
- glEnd();
+ vertex = &it.vertex[it.index[i]];
+ glVertex3fv(vertex->getXYZ());
+
+ vertex = &it.vertex[it.index[i+1]];
+ glVertex3fv(vertex->getXYZ());
}
- break;
- case KX_MODE_QUADS:
- {
+
+ glEnd();
+ }
+ else {
+ // triangle and quad drawing
+ if(it.array->m_type == RAS_DisplayArray::TRIANGLE)
+ glBegin(GL_TRIANGLES);
+ else
glBegin(GL_QUADS);
- vindex=0;
- if (useObjectColor)
- {
- for (unsigned int i=0;i<numindices;i+=4)
- {
-
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
-
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- else
- {
- for (unsigned int i=0;i<numindices;i+=4)
- {
- // This looks curiously endian unsafe to me.
- // However it depends on the way the colors are packed into
- // the m_rgba field of RAS_TexVert
-
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
-
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- glEnd();
- break;
- }
- case KX_MODE_TRIANGLES:
+
+ for(i=0; i<it.totindex; i+=numvert)
{
- glBegin(GL_TRIANGLES);
- vindex=0;
- if (useObjectColor)
- {
- for (unsigned int i=0;i<numindices;i+=3)
- {
-
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
- }
- }
- else
- {
- for (unsigned int i=0;i<numindices;i+=3)
- {
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
-
- //
- glColor4ubv((const GLubyte *)(vertexarray[(indexarray[vindex])].getRGBA()));
- glNormal3fv(vertexarray[(indexarray[vindex])].getNormal());
- TexCoord(vertexarray[(indexarray[vindex])]);
- glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ());
- vindex++;
+ if(obcolor)
+ glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
+
+ for(j=0; j<numvert; j++) {
+ vertex = &it.vertex[it.index[i+j]];
+
+ if(!wireframe) {
+ if(!obcolor)
+ glColor4ubv((const GLubyte *)(vertex->getRGBA()));
+
+ glNormal3fv(vertex->getNormal());
+
+ if(multi)
+ TexCoord(*vertex);
+ else
+ glTexCoord2fv(vertex->getUV1());
}
+
+ glVertex3fv(vertex->getXYZ());
}
- glEnd();
- break;
}
- default:
- {
- }
- } // switch
- } // for each vertexarray
+
+ glEnd();
+ }
+ }
}
void RAS_OpenGLRasterizer::SetProjectionMatrix(MT_CmMatrix4x4 &mat)
@@ -1239,7 +814,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, const MT_Vector3& campos,
const MT_Point3 &, const MT_Quaternion &camOrientQuat)
{
- MT_Matrix4x4 viewMat = mat;
+ m_viewmatrix = mat;
// correction for stereo
if(m_stereomode != RAS_STEREO_NOSTEREO)
@@ -1266,7 +841,7 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, const MT_Vecto
MT_Transform transform;
transform.setIdentity();
transform.translate(-(eyeline * m_eyeseparation / 2.0));
- viewMat *= transform;
+ m_viewmatrix *= transform;
}
break;
case RAS_STEREO_RIGHTEYE:
@@ -1275,20 +850,21 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, const MT_Vecto
MT_Transform transform;
transform.setIdentity();
transform.translate(eyeline * m_eyeseparation / 2.0);
- viewMat *= transform;
+ m_viewmatrix *= transform;
}
break;
}
}
- // convert row major matrix 'viewMat' to column major for OpenGL
- MT_Scalar cammat[16];
- viewMat.getValue(cammat);
- MT_CmMatrix4x4 viewCmmat = cammat;
+ m_viewinvmatrix = m_viewmatrix;
+ m_viewinvmatrix.invert();
+
+ // note: getValue gives back column major as needed by OpenGL
+ MT_Scalar glviewmat[16];
+ m_viewmatrix.getValue(glviewmat);
glMatrixMode(GL_MODELVIEW);
- m_viewmatrix = viewCmmat;
- glLoadMatrixd(&m_viewmatrix(0,0));
+ glLoadMatrixd(glviewmat);
m_campos = campos;
}
@@ -1299,20 +875,6 @@ const MT_Point3& RAS_OpenGLRasterizer::GetCameraPosition()
}
-
-void RAS_OpenGLRasterizer::LoadViewMatrix()
-{
- glLoadMatrixd(&m_viewmatrix(0,0));
-}
-
-
-
-void RAS_OpenGLRasterizer::EnableTextures(bool enable)
-{
-}
-
-
-
void RAS_OpenGLRasterizer::SetCullFace(bool enable)
{
if (enable)
@@ -1389,3 +951,47 @@ void RAS_OpenGLRasterizer::DisableMotionBlur()
m_motionblur = 0;
m_motionblurvalue = -1.0;
}
+
+void RAS_OpenGLRasterizer::SetBlendingMode(int blendmode)
+{
+ if(blendmode == m_last_blendmode)
+ return;
+
+ if(blendmode == GPU_BLEND_SOLID) {
+ glDisable(GL_BLEND);
+ glDisable(GL_ALPHA_TEST);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+ else if(blendmode == GPU_BLEND_ADD) {
+ glBlendFunc(GL_ONE, GL_ONE);
+ glEnable(GL_BLEND);
+ glDisable(GL_ALPHA_TEST);
+ }
+ else if(blendmode == GPU_BLEND_ALPHA) {
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, 0.0f);
+ }
+ else if(blendmode == GPU_BLEND_CLIP) {
+ glDisable(GL_BLEND);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, 0.5f);
+ }
+
+ m_last_blendmode = blendmode;
+}
+
+void RAS_OpenGLRasterizer::SetFrontFace(bool ccw)
+{
+ if(m_last_frontface == ccw)
+ return;
+
+ if(ccw)
+ glFrontFace(GL_CCW);
+ else
+ glFrontFace(GL_CW);
+
+ m_last_frontface = ccw;
+}
+
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index 0d54552db05..368bd4312ac 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -41,7 +41,7 @@ using namespace std;
#include "RAS_MaterialBucket.h"
#include "RAS_ICanvas.h"
-#define RAS_MAX_TEXCO 3 // match in BL_Material
+#define RAS_MAX_TEXCO 8 // match in BL_Material
#define RAS_MAX_ATTRIB 16 // match in BL_BlenderShader
struct OglDebugLine
@@ -77,7 +77,8 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer
float m_ambb;
double m_time;
- MT_CmMatrix4x4 m_viewmatrix;
+ MT_Matrix4x4 m_viewmatrix;
+ MT_Matrix4x4 m_viewinvmatrix;
MT_Point3 m_campos;
StereoMode m_stereomode;
@@ -99,6 +100,8 @@ protected:
TexCoGen m_attrib[RAS_MAX_ATTRIB];
int m_texco_num;
int m_attrib_num;
+ int m_last_blendmode;
+ bool m_last_frontface;
/** Stores the caching information for the last material activated. */
RAS_IPolyMaterial::TCachingInfo m_materialCachingInfo;
@@ -142,36 +145,16 @@ public:
virtual void SetFocalLength(const float focallength);
virtual float GetFocalLength();
- virtual void SetAlphaTest(bool enable);
-
virtual void SwapBuffers();
- virtual void IndexPrimitives(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot
- );
+ virtual void IndexPrimitives(class RAS_MeshSlot& ms);
+ virtual void IndexPrimitivesMulti(class RAS_MeshSlot& ms);
virtual void IndexPrimitives_3DText(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
+ class RAS_MeshSlot& ms,
class RAS_IPolyMaterial* polymat,
- class RAS_IRenderTools* rendertools,
- bool useObjectColor,
- const MT_Vector4& rgbacolor
- );
-
- virtual void IndexPrimitivesMulti(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot);
+ class RAS_IRenderTools* rendertools);
+ void IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi);
virtual void SetProjectionMatrix(MT_CmMatrix4x4 & mat);
virtual void SetProjectionMatrix(const MT_Matrix4x4 & mat);
@@ -183,7 +166,6 @@ public:
);
virtual const MT_Point3& GetCameraPosition();
- virtual void LoadViewMatrix();
virtual void SetFog(
float start,
@@ -215,7 +197,6 @@ public:
virtual void SetDrawingMode(int drawingmode);
virtual int GetDrawingMode();
- virtual void EnableTextures(bool enable);
virtual void SetCullFace(bool enable);
virtual void SetLines(bool enable);
@@ -271,19 +252,16 @@ public:
virtual void SetTexCoord(TexCoGen coords, int unit);
virtual void SetAttrib(TexCoGen coords, int unit);
- void TexCoord(const RAS_TexVert &tv);
- virtual void GetViewMatrix(MT_Matrix4x4 &mat) const;
+ void TexCoord(const RAS_TexVert &tv);
- void Tangent(const RAS_TexVert& v1,
- const RAS_TexVert& v2,
- const RAS_TexVert& v3,
- const MT_Vector3 &no);
+ const MT_Matrix4x4& GetViewMatrix() const;
+ const MT_Matrix4x4& GetViewInvMatrix() const;
virtual void EnableMotionBlur(float motionblurvalue);
virtual void DisableMotionBlur();
virtual float GetMotionBlurValue(){return m_motionblurvalue;};
- virtual int GetMotionBlurState(){return m_motionblur;};
- virtual void SetMotionBlurState(int newstate)
+ virtual int GetMotionBlurState(){return m_motionblur;};
+ virtual void SetMotionBlurState(int newstate)
{
if(newstate<0)
m_motionblur = 0;
@@ -292,6 +270,9 @@ public:
else
m_motionblur = newstate;
};
+
+ virtual void SetBlendingMode(int blendmode);
+ virtual void SetFrontFace(bool ccw);
};
#endif //__RAS_OPENGLRASTERIZER
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
index c78a97ad7be..2cb3b52adfb 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include "GL/glew.h"
+#include "GPU_extensions.h"
#include "STR_String.h"
#include "RAS_TexVert.h"
@@ -77,16 +78,16 @@ void RAS_VAOpenGLRasterizer::SetDrawingMode(int drawingmode)
{
case KX_BOUNDINGBOX:
case KX_WIREFRAME:
- glDisableClientState(GL_COLOR_ARRAY);
- glDisable(GL_CULL_FACE);
+ //glDisableClientState(GL_COLOR_ARRAY);
+ //glDisable(GL_CULL_FACE);
break;
case KX_SOLID:
- glDisableClientState(GL_COLOR_ARRAY);
+ //glDisableClientState(GL_COLOR_ARRAY);
break;
case KX_TEXTURED:
case KX_SHADED:
case KX_SHADOW:
- glEnableClientState(GL_COLOR_ARRAY);
+ //glEnableClientState(GL_COLOR_ARRAY);
default:
break;
}
@@ -98,141 +99,121 @@ void RAS_VAOpenGLRasterizer::Exit()
glEnableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
- EnableTextures(false);
RAS_OpenGLRasterizer::Exit();
}
-void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot)
+void RAS_VAOpenGLRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
{
- static const GLsizei vtxstride = sizeof(RAS_TexVert);
+ static const GLsizei stride = sizeof(RAS_TexVert);
+ bool wireframe = m_drawingmode <= KX_WIREFRAME;
+ RAS_MeshSlot::iterator it;
GLenum drawmode;
- if(mode == KX_MODE_TRIANGLES)
- drawmode = GL_TRIANGLES;
- else if(mode == KX_MODE_QUADS)
- drawmode = GL_QUADS;
- else
- drawmode = GL_LINES;
- const RAS_TexVert* vertexarray;
- unsigned int numindices, vt;
-
- if (drawmode != GL_LINES)
- {
- if (useObjectColor)
- {
- glDisableClientState(GL_COLOR_ARRAY);
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
- } else
- {
- glColor4d(0,0,0,1.0);
- glEnableClientState(GL_COLOR_ARRAY);
- }
- }
- else
- {
- glColor3d(0,0,0);
- }
-
- EnableTextures(false);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ if(!wireframe)
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// use glDrawElements to draw each vertexarray
- for (vt=0;vt<vertexarrays.size();vt++)
- {
- vertexarray = &((*vertexarrays[vt]) [0]);
- const KX_IndexArray & indexarray = (*indexarrays[vt]);
- numindices = indexarray.size();
-
- if (!numindices)
+ for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ if(it.totindex == 0)
continue;
-
- glVertexPointer(3,GL_FLOAT,vtxstride,vertexarray->getLocalXYZ());
- glNormalPointer(GL_FLOAT,vtxstride,vertexarray->getNormal());
- glTexCoordPointer(2,GL_FLOAT,vtxstride,vertexarray->getUV1());
- if(glIsEnabled(GL_COLOR_ARRAY))
- glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA());
- //if(m_Lock)
- // local->Begin(vertexarrays[vt]->size());
+ // drawing mode
+ if(it.array->m_type == RAS_DisplayArray::TRIANGLE)
+ drawmode = GL_TRIANGLES;
+ else if(it.array->m_type == RAS_DisplayArray::QUAD)
+ drawmode = GL_QUADS;
+ else
+ drawmode = GL_LINES;
+
+ // colors
+ if (drawmode != GL_LINES && !wireframe) {
+ if (ms.m_bObjectColor) {
+ const MT_Vector4& rgba = ms.m_RGBAcolor;
- // here the actual drawing takes places
- glDrawElements(drawmode,numindices,GL_UNSIGNED_SHORT,&(indexarray[0]));
+ glDisableClientState(GL_COLOR_ARRAY);
+ glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
+ }
+ else {
+ glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
+ glEnableClientState(GL_COLOR_ARRAY);
+ }
+ }
+ else
+ glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
+
+ glVertexPointer(3, GL_FLOAT, stride, it.vertex->getXYZ());
+ glNormalPointer(GL_FLOAT, stride, it.vertex->getNormal());
+ if(!wireframe) {
+ glTexCoordPointer(2, GL_FLOAT, stride, it.vertex->getUV1());
+ if(glIsEnabled(GL_COLOR_ARRAY))
+ glColorPointer(4, GL_UNSIGNED_BYTE, stride, it.vertex->getRGBA());
+ }
- //if(m_Lock)
- // local->End();
+ // here the actual drawing takes places
+ glDrawElements(drawmode, it.totindex, GL_UNSIGNED_SHORT, it.index);
}
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ if(!wireframe) {
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
}
-void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti( const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot)
+void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
{
- static const GLsizei vtxstride = sizeof(RAS_TexVert);
-
+ static const GLsizei stride = sizeof(RAS_TexVert);
+ bool wireframe = m_drawingmode <= KX_WIREFRAME;
+ RAS_MeshSlot::iterator it;
GLenum drawmode;
- if(mode == KX_MODE_TRIANGLES)
- drawmode = GL_TRIANGLES;
- else if(mode == KX_MODE_QUADS)
- drawmode = GL_QUADS;
- else
- drawmode = GL_LINES;
- const RAS_TexVert* vertexarray;
- unsigned int numindices, vt;
-
- if (drawmode != GL_LINES)
- {
- if (useObjectColor)
- {
- glDisableClientState(GL_COLOR_ARRAY);
- glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]);
- }
- else
- {
- glColor4d(0,0,0,1.0);
- glEnableClientState(GL_COLOR_ARRAY);
- }
- }
- else
- {
- glColor3d(0,0,0);
- }
+ if(!wireframe)
+ EnableTextures(true);
// use glDrawElements to draw each vertexarray
- for (vt=0;vt<vertexarrays.size();vt++)
- {
- vertexarray = &((*vertexarrays[vt]) [0]);
- const KX_IndexArray & indexarray = (*indexarrays[vt]);
- numindices = indexarray.size();
-
- if (!numindices)
+ for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ if(it.totindex == 0)
continue;
- glVertexPointer(3,GL_FLOAT,vtxstride,vertexarray->getLocalXYZ());
- glNormalPointer(GL_FLOAT,vtxstride,vertexarray->getNormal());
- TexCoordPtr(vertexarray);
- if(glIsEnabled(GL_COLOR_ARRAY))
- glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,vertexarray->getRGBA());
+ // drawing mode
+ if(it.array->m_type == RAS_DisplayArray::TRIANGLE)
+ drawmode = GL_TRIANGLES;
+ else if(it.array->m_type == RAS_DisplayArray::QUAD)
+ drawmode = GL_QUADS;
+ else
+ drawmode = GL_LINES;
+
+ // colors
+ if (drawmode != GL_LINES && !wireframe) {
+ if (ms.m_bObjectColor) {
+ const MT_Vector4& rgba = ms.m_RGBAcolor;
- //if(m_Lock)
- // local->Begin(vertexarrays[vt]->size());
+ glDisableClientState(GL_COLOR_ARRAY);
+ glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
+ }
+ else {
+ glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
+ glEnableClientState(GL_COLOR_ARRAY);
+ }
+ }
+ else
+ glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
+
+ glVertexPointer(3, GL_FLOAT, stride, it.vertex->getXYZ());
+ glNormalPointer(GL_FLOAT, stride, it.vertex->getNormal());
+ if(!wireframe) {
+ TexCoordPtr(it.vertex);
+ if(glIsEnabled(GL_COLOR_ARRAY))
+ glColorPointer(4, GL_UNSIGNED_BYTE, stride, it.vertex->getRGBA());
+ }
// here the actual drawing takes places
- glDrawElements(drawmode,numindices,GL_UNSIGNED_SHORT,&(indexarray[0]));
-
- //if(m_Lock)
- // local->End();
+ glDrawElements(drawmode, it.totindex, GL_UNSIGNED_SHORT, it.index);
+ }
+
+ if(!wireframe) {
+ glDisableClientState(GL_COLOR_ARRAY);
+ EnableTextures(false);
}
}
@@ -248,7 +229,7 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
for(unit=0; unit<m_texco_num; unit++)
{
glClientActiveTextureARB(GL_TEXTURE0_ARB+unit);
- if(tv->getFlag() & TV_2NDUV && (int)tv->getUnit() == unit) {
+ if(tv->getFlag() & RAS_TexVert::SECOND_UV && (int)tv->getUnit() == unit) {
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert), tv->getUV2());
continue;
@@ -257,7 +238,7 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
{
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
- glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getLocalXYZ());
+ glTexCoordPointer(3, GL_FLOAT, sizeof(RAS_TexVert),tv->getXYZ());
break;
case RAS_TEXCO_UV1:
glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert),tv->getUV1());
@@ -284,7 +265,7 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
switch(m_attrib[unit]) {
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
- glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getLocalXYZ());
+ glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getXYZ());
break;
case RAS_TEXCO_UV1:
glVertexAttribPointerARB(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV1());
@@ -313,11 +294,6 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
TexCoGen *texco, *attrib;
int unit, texco_num, attrib_num;
- /* disable previously enabled texture coordinates and attributes. ideally
- * this shouldn't be necessary .. */
- if(enable)
- EnableTextures(false);
-
/* we cache last texcoords and attribs to ensure we disable the ones that
* were actually last set */
if(enable) {
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
index e4cc4ace0e8..766bbfbed0e 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
@@ -50,22 +50,10 @@ public:
virtual void SetDrawingMode(int drawingmode);
- virtual void IndexPrimitives( const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot);
-
- virtual void IndexPrimitivesMulti(
- const vecVertexArray& vertexarrays,
- const vecIndexArrays & indexarrays,
- DrawMode mode,
- bool useObjectColor,
- const MT_Vector4& rgbacolor,
- class KX_ListSlot** slot);
-
+ virtual void IndexPrimitives(class RAS_MeshSlot& ms);
+ virtual void IndexPrimitivesMulti(class RAS_MeshSlot& ms);
+private:
virtual void EnableTextures(bool enable);
//virtual bool QueryArrays(){return true;}
//virtual bool QueryLists(){return m_Lock;}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
index 0cf9c326370..8d46528f7f0 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
@@ -1,12 +1,9 @@
#!/usr/bin/python
Import ('env')
-if env['WITH_BF_GLEXT'] == 1:
- env['CPPFLAGS'].append('-DWITH_GLEXT')
-
sources = env.Glob('*.cpp')
incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines '
-incs += ' #extern/glew/include ' + env['BF_OPENGL_INC']
+incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC']
env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['game','player'], priority=[40, 120] )
diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp
index 852c94def3f..50331d7a664 100644
--- a/source/gameengine/Rasterizer/RAS_Polygon.cpp
+++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp
@@ -26,117 +26,82 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
-
#pragma warning (disable:4786)
#endif
#include "RAS_Polygon.h"
-/*
-RAS_TexVert* RAS_Polygon::GetVertex(int index)
-{
- if (m_bucket)
- return m_bucket->GetVertex(m_vertexindexbase.m_vtxarray, m_vertexindexbase.m_indexarray[index]);
- else
- return NULL;
-}
-*/
-
-/*void RAS_Polygon::Bucketize(double* oglmatrix)
+RAS_Polygon::RAS_Polygon(RAS_MaterialBucket* bucket, RAS_DisplayArray *darray, int numvert)
{
- //Transform(trans);
- if (m_bucket)
- m_bucket->AddPolygon(this,oglmatrix);
-}
-*/
-
-RAS_Polygon::RAS_Polygon(RAS_MaterialBucket* bucket,
- bool visible,
- int numverts,
- int vtxarrayindex)
- :m_bucket(bucket),
- m_vertexindexbase(numverts),
- m_numverts(numverts),
- m_edgecode(65535)
-{
- m_vertexindexbase.m_vtxarray = vtxarrayindex ;//m_bucket->FindVertexArray(numverts);
- m_polyFlags.Visible = visible;
-}
-
+ m_bucket = bucket;
+ m_darray = darray;
+ m_offset[0]= m_offset[1]= m_offset[2]= m_offset[3]= 0;
+ m_numvert = numvert;
+ m_edgecode = 255;
+ m_polyflags = 0;
+}
int RAS_Polygon::VertexCount()
{
- return m_numverts;
+ return m_numvert;
}
-
-
-void RAS_Polygon::SetVertex(int i,
- unsigned int vertexindex ) //const MT_Point3& xyz,const MT_Point2& uv,const unsigned int rgbacolor,const MT_Vector3& normal)
+void RAS_Polygon::SetVertexOffset(int i, unsigned short offset)
{
- m_vertexindexbase.SetIndex(i,vertexindex); //m_bucket->FindOrAddVertex(m_vertexindexbase.m_vtxarray,
- //xyz,uv,rgbacolor,normal));
+ m_offset[i] = offset;
}
-
-
-const KX_VertexIndex& RAS_Polygon::GetIndexBase()
+RAS_TexVert *RAS_Polygon::GetVertex(int i)
{
- return m_vertexindexbase;
+ return &m_darray->m_vertex[m_offset[i]];
}
-
-
-void RAS_Polygon::SetVisibleWireframeEdges(int edgecode)
+int RAS_Polygon::GetVertexOffset(int i)
{
- m_edgecode = edgecode;
+ return m_offset[i];
}
-
-
-// each bit is for a visible edge, starting with bit 1 for the first edge, bit 2 for second etc.
int RAS_Polygon::GetEdgeCode()
{
return m_edgecode;
}
+void RAS_Polygon::SetEdgeCode(int edgecode)
+{
+ m_edgecode = edgecode;
+}
bool RAS_Polygon::IsVisible()
{
- return m_polyFlags.Visible;
+ return (m_polyflags & VISIBLE) != 0;
}
-
+void RAS_Polygon::SetVisible(bool visible)
+{
+ if(visible) m_polyflags |= VISIBLE;
+ else m_polyflags &= ~VISIBLE;
+}
bool RAS_Polygon::IsCollider()
{
- return m_polyFlags.Collider;
+ return (m_polyflags & COLLIDER) != 0;
}
-
-
-void RAS_Polygon::SetCollider(bool col)
+void RAS_Polygon::SetCollider(bool visible)
{
- m_polyFlags.Collider = col;
+ if(visible) m_polyflags |= COLLIDER;
+ else m_polyflags &= ~COLLIDER;
}
-
-
-KX_VertexIndex& RAS_Polygon::GetVertexIndexBase()
+RAS_MaterialBucket* RAS_Polygon::GetMaterial()
{
- return m_vertexindexbase;
+ return m_bucket;
}
-
-
-RAS_MaterialBucket* RAS_Polygon::GetMaterial()
+RAS_DisplayArray* RAS_Polygon::GetDisplayArray()
{
- return m_bucket;
+ return m_darray;
}
diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h
index 7ce7926a816..18526ba45f7 100644
--- a/source/gameengine/Rasterizer/RAS_Polygon.h
+++ b/source/gameengine/Rasterizer/RAS_Polygon.h
@@ -35,55 +35,47 @@
#include <vector>
using namespace std;
-
-//
-// Bitfield that stores the flags for each CValue derived class
-//
-struct PolygonFlags {
- PolygonFlags() :
- Visible(true),
- Collider(true)
- {
- }
- unsigned char Visible : 1;
- unsigned char Collider : 1;
- //int Visible : 1;
- //int Collider : 1;
-};
+/* polygon flags */
class RAS_Polygon
{
+ /* location */
RAS_MaterialBucket* m_bucket;
- KX_VertexIndex m_vertexindexbase;
- int m_numverts;
- int m_edgecode;
- PolygonFlags m_polyFlags;
-
+ RAS_DisplayArray* m_darray;
+ unsigned short m_offset[4];
+ unsigned short m_numvert;
+
+ /* flags */
+ unsigned char m_edgecode;
+ unsigned char m_polyflags;
public:
- RAS_Polygon(RAS_MaterialBucket* bucket,
- bool visible,
- int numverts,
- int vtxarrayindex) ;
+ enum {
+ VISIBLE = 1,
+ COLLIDER = 2
+ };
+
+ RAS_Polygon(RAS_MaterialBucket* bucket, RAS_DisplayArray* darray, int numvert);
virtual ~RAS_Polygon() {};
-// RAS_TexVert* GetVertex(int index);
int VertexCount();
- void SetVertex(int i, unsigned int vertexindex); //const MT_Point3& xyz,const MT_Point2& uv,const unsigned int rgbacolor,const MT_Vector3& normal)
-
- const KX_VertexIndex& GetIndexBase();
+ RAS_TexVert* GetVertex(int i);
- void SetVisibleWireframeEdges(int edgecode);
+ void SetVertexOffset(int i, unsigned short offset);
+ int GetVertexOffset(int i);
+
// each bit is for a visible edge, starting with bit 1 for the first edge, bit 2 for second etc.
int GetEdgeCode();
+ void SetEdgeCode(int edgecode);
bool IsVisible();
+ void SetVisible(bool visible);
+
bool IsCollider();
- void SetCollider(bool col);
+ void SetCollider(bool collider);
- KX_VertexIndex& GetVertexIndexBase();
RAS_MaterialBucket* GetMaterial();
-
+ RAS_DisplayArray* GetDisplayArray();
};
#endif
diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp
index 935633dc636..d6f1fe912be 100644
--- a/source/gameengine/Rasterizer/RAS_TexVert.cpp
+++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp
@@ -27,12 +27,7 @@
*/
#include "RAS_TexVert.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define SHORT(x) short(x*32767.0)
+#include "MT_Matrix4x4.h"
RAS_TexVert::RAS_TexVert(const MT_Point3& xyz,
const MT_Point2& uv,
@@ -40,7 +35,7 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz,
const MT_Vector4& tangent,
const unsigned int rgba,
const MT_Vector3& normal,
- const short flag,
+ const bool flat,
const unsigned int origindex)
{
xyz.getValue(m_localxyz);
@@ -49,7 +44,7 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz,
SetRGBA(rgba);
SetNormal(normal);
tangent.getValue(m_tangent);
- m_flag = flag;
+ m_flag = (flat)? FLAT: 0;
m_origindex = origindex;
m_unit = 2;
}
@@ -101,7 +96,7 @@ void RAS_TexVert::SetFlag(const short flag)
void RAS_TexVert::SetUnit(const unsigned int u)
{
- m_unit = u<=TV_MAX?u:TV_MAX;
+ m_unit = u<=MAX_UNIT?u:MAX_UNIT;
}
void RAS_TexVert::SetNormal(const MT_Vector3& normal)
@@ -109,12 +104,18 @@ void RAS_TexVert::SetNormal(const MT_Vector3& normal)
normal.getValue(m_normal);
}
+void RAS_TexVert::SetTangent(const MT_Vector3& tangent)
+{
+ tangent.getValue(m_tangent);
+}
+
// compare two vertices, and return TRUE if both are almost identical (they can be shared)
bool RAS_TexVert::closeTo(const RAS_TexVert* other)
{
return (m_flag == other->m_flag &&
m_rgba == other->m_rgba &&
MT_fuzzyEqual(MT_Vector3(m_normal), MT_Vector3(other->m_normal)) &&
+ MT_fuzzyEqual(MT_Vector3(m_tangent), MT_Vector3(other->m_tangent)) &&
MT_fuzzyEqual(MT_Vector2(m_uv1), MT_Vector2(other->m_uv1)) &&
MT_fuzzyEqual(MT_Vector2(m_uv2), MT_Vector2(other->m_uv2)) && // p --
MT_fuzzyEqual(MT_Vector3(m_localxyz), MT_Vector3(other->m_localxyz))) ;
@@ -131,11 +132,10 @@ unsigned int RAS_TexVert::getUnit() const
return m_unit;
}
-
-void RAS_TexVert::getOffsets(void* &xyz, void* &uv1, void* &rgba, void* &normal) const
+void RAS_TexVert::Transform(const MT_Matrix4x4& mat, const MT_Matrix4x4& nmat)
{
- xyz = (void *) m_localxyz;
- uv1 = (void *) m_uv1;
- rgba = (void *) &m_rgba;
- normal = (void *) m_normal;
+ SetXYZ((mat*MT_Vector4(m_localxyz[0], m_localxyz[1], m_localxyz[2], 1.0)).getValue());
+ SetNormal((nmat*MT_Vector4(m_normal[0], m_normal[1], m_normal[2], 1.0)).getValue());
+ SetTangent((nmat*MT_Vector4(m_tangent[0], m_tangent[1], m_tangent[2], 1.0)).getValue());
}
+
diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h
index bf092b4b230..4ec4db19e53 100644
--- a/source/gameengine/Rasterizer/RAS_TexVert.h
+++ b/source/gameengine/Rasterizer/RAS_TexVert.h
@@ -37,11 +37,6 @@
static MT_Point3 g_pt3;
static MT_Point2 g_pt2;
-#define TV_CALCFACENORMAL 0x0001
-#define TV_2NDUV 0x0002
-
-#define TV_MAX 3//match Def in BL_Material.h
-
class RAS_TexVert
{
@@ -59,6 +54,12 @@ class RAS_TexVert
// 32 bytes total size, fits nice = 56 = not fit nice.
// We'll go for 64 bytes total size - 24 bytes left.
public:
+ enum {
+ FLAT = 1,
+ SECOND_UV = 2,
+ MAX_UNIT = 8
+ };
+
short getFlag() const;
unsigned int getUnit() const;
@@ -70,7 +71,7 @@ public:
const MT_Vector4& tangent,
const unsigned int rgba,
const MT_Vector3& normal,
- const short flag,
+ const bool flat,
const unsigned int origindex);
~RAS_TexVert() {};
@@ -82,7 +83,7 @@ public:
return m_uv2;
};
- const float* getLocalXYZ() const {
+ const float* getXYZ() const {
return m_localxyz;
};
@@ -108,20 +109,19 @@ public:
void SetRGBA(const unsigned int rgba);
void SetNormal(const MT_Vector3& normal);
+ void SetTangent(const MT_Vector3& tangent);
void SetFlag(const short flag);
void SetUnit(const unsigned u);
void SetRGBA(const MT_Vector4& rgba);
const MT_Point3& xyz();
- // compare two vertices, and return TRUE if both are almost identical (they can be shared)
- bool closeTo(const RAS_TexVert* other);
+ void Transform(const class MT_Matrix4x4& mat,
+ const class MT_Matrix4x4& nmat);
- bool closeTo(const MT_Point3& otherxyz,
- const MT_Point2& otheruv,
- const unsigned int otherrgba,
- short othernormal[3]) const;
- void getOffsets(void*&xyz, void *&uv1, void *&rgba, void *&normal) const;
+ // compare two vertices, to test if they can be shared, used for
+ // splitting up based on uv's, colors, etc
+ bool closeTo(const RAS_TexVert* other);
};
#endif //__RAS_TEXVERT
diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript
index e6bc657ed6d..a024f7e0ee6 100644
--- a/source/gameengine/Rasterizer/SConscript
+++ b/source/gameengine/Rasterizer/SConscript
@@ -3,11 +3,8 @@ Import ('env')
sources = env.Glob('*.cpp')
-if env['WITH_BF_GLEXT'] == 1:
- env['CPPFLAGS'].append('-DWITH_GLEXT')
-
-incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions'
+incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/blender/blenkernel #source/blender/makesdna'
incs += ' ' + env['BF_PYTHON_INC']
if env['OURPLATFORM']=='win32-vc':
diff --git a/source/kernel/CMakeLists.txt b/source/kernel/CMakeLists.txt
index 3d966152cc5..ac759393326 100644
--- a/source/kernel/CMakeLists.txt
+++ b/source/kernel/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SET(INC gen_messaging gen_system ../../intern/string ../../intern/moto/include)
+SET(INC gen_messaging gen_system ../../intern/string ../../intern/moto/include ../../source/blender/blenloader )
FILE(GLOB SRC
gen_messaging/intern/messaging.c
diff --git a/source/kernel/SConscript b/source/kernel/SConscript
index 9e678c041dc..8bd1a18f835 100644
--- a/source/kernel/SConscript
+++ b/source/kernel/SConscript
@@ -5,6 +5,6 @@ sources = 'gen_messaging/intern/messaging.c gen_system/GEN_HashedPtr.cpp'
sources += ' gen_system/GEN_Matrix4x4.cpp gen_system/SYS_SingletonSystem.cpp'
sources += ' gen_system/SYS_System.cpp'
-incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include'
+incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include #/source/blender/blenloader '
env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['common','game2', 'player'], priority = [15, 10, 150] )
diff --git a/source/kernel/gen_system/GEN_HashedPtr.cpp b/source/kernel/gen_system/GEN_HashedPtr.cpp
index 49ccb252246..6dbed1fb7a8 100644
--- a/source/kernel/gen_system/GEN_HashedPtr.cpp
+++ b/source/kernel/gen_system/GEN_HashedPtr.cpp
@@ -33,6 +33,8 @@
#include <config.h>
#endif
+#include "BLO_sys_types.h" // for intptr_t support
+
//
// Build hash index from pointer. Even though the final result
// is a 32-bit integer, use all the bits of the pointer as long
@@ -41,11 +43,7 @@
unsigned int GEN_Hash(void * inDWord)
{
-#if defined(_WIN64)
- unsigned __int64 key = (unsigned __int64)inDWord;
-#else
- unsigned long key = (unsigned long)inDWord;
-#endif
+ uintptr_t key = (uintptr_t)inDWord;
key += ~(key << 16);
key ^= (key >> 5);
diff --git a/source/kernel/gen_system/GEN_Map.h b/source/kernel/gen_system/GEN_Map.h
index 37c75d8293a..88c79293223 100644
--- a/source/kernel/gen_system/GEN_Map.h
+++ b/source/kernel/gen_system/GEN_Map.h
@@ -50,6 +50,19 @@ public:
m_buckets[i] = 0;
}
}
+
+ GEN_Map(const GEN_Map& map)
+ {
+ m_num_buckets = map.m_num_buckets;
+ m_buckets = new Entry *[m_num_buckets];
+
+ for (int i = 0; i < m_num_buckets; ++i) {
+ m_buckets[i] = 0;
+
+ for(Entry *entry = map.m_buckets[i]; entry; entry=entry->m_next)
+ insert(entry->m_key, entry->m_value);
+ }
+ }
int size() {
int count=0;
diff --git a/source/kernel/gen_system/Makefile b/source/kernel/gen_system/Makefile
index 855af376615..31535ad2a97 100644
--- a/source/kernel/gen_system/Makefile
+++ b/source/kernel/gen_system/Makefile
@@ -37,4 +37,5 @@ CCFLAGS += $(LEVEL_2_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_STRING)/include
+CPPFLAGS += -I../../../source/blender/blenloader
diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk
index 9c1a28de999..424a7c558d7 100644
--- a/source/nan_definitions.mk
+++ b/source/nan_definitions.mk
@@ -56,9 +56,6 @@ all debug::
# Object Config_Guess DIRectory
export OCGDIR = $(NAN_OBJDIR)/$(CONFIG_GUESS)
- export WITH_GLEXT?=true
- export WITH_BF_GLEXT?=$(WITH_GLEXT)
-
# Determines what targets are built
export WITH_BF_DYNAMICOPENGL ?= true
export WITH_BF_STATICOPENGL ?= false
@@ -287,7 +284,7 @@ endif
export FREEDESKTOP ?= true
export NAN_PYTHON ?= /usr/local
- export NAN_PYTHON_VERSION ?= 2.3
+ export NAN_PYTHON_VERSION ?= 2.5
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
export NAN_OPENAL ?= /usr/local
@@ -302,9 +299,9 @@ endif
export NAN_NSPR ?= /usr/local
export NAN_FREETYPE ?= $(LCGDIR)/freetype
export NAN_GETTEXT ?= $(LCGDIR)/gettext
- export NAN_SDL ?= $(shell sdl11-config --prefix)
- export NAN_SDLLIBS ?= $(shell sdl11-config --libs)
- export NAN_SDLCFLAGS ?= $(shell sdl11-config --cflags)
+ export NAN_SDL ?= $(shell sdl-config --prefix)
+ export NAN_SDLLIBS ?= $(shell sdl-config --libs)
+ export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
# Uncomment the following line to use Mozilla inplace of netscape
# CPPFLAGS +=-DMOZ_NOT_NET
diff --git a/tools/btools.py b/tools/btools.py
index f8f9eacd6b1..ffdf90d5c49 100755
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -51,7 +51,6 @@ def validate_arguments(args, bc):
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', 'BF_OPENGL_LINKFLAGS',
'WITH_BF_FTGL', 'BF_FTGL', 'BF_FTGL_INC', 'BF_FTGL_LIB',
'WITH_BF_PLAYER',
- 'WITH_BF_GLEXT',
'WITH_BF_BINRELOC',
'CFLAGS', 'CCFLAGS', 'CPPFLAGS',
'REL_CFLAGS', 'REL_CCFLAGS',
@@ -296,7 +295,6 @@ def read_opts(cfg, args):
('BF_FTGL_INC', 'FTGL include path', ''),
('BF_FTGL_LIB', 'FTGL libraries', ''),
- (BoolOption('WITH_BF_GLEXT', 'Enable GL Extensions', 'true')),
(BoolOption('WITH_BF_PLAYER', 'Build blenderplayer if true', 'false')),
('CFLAGS', 'C-compiler flags', ''),
@@ -336,6 +334,8 @@ def read_opts(cfg, args):
('BF_X264_CONFIG', 'configuration flags for x264', ''),
('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
+
+ ('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'),
) # end of opts.AddOptions()