svn merge -r 16077:16174 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Mon, 18 Aug 2008 14:33:26 +0000 (14:33 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Mon, 18 Aug 2008 14:33:26 +0000 (14:33 +0000)
151 files changed:
CMakeLists.txt
intern/guardedalloc/BLO_sys_types.h [new file with mode: 0644]
intern/guardedalloc/intern/mallocn.c
intern/guardedalloc/intern/mmap_win.c
intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj
intern/guardedalloc/mmap_win.h
intern/opennl/make/msvc_7_0/opennl.vcproj
intern/opennl/superlu/BLO_sys_types.h [new file with mode: 0644]
intern/opennl/superlu/smemory.c
projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
projectfiles_vc7/kernel/system/SYS_system.vcproj
release/VERSION
release/datafiles/datatoc.c
release/datafiles/splash.jpg
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_effect.h
source/blender/blenkernel/BKE_endian.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/intern/CCGSubSurf.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/icons.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/sca.c
source/blender/blenlib/BLI_editVert.h
source/blender/blenlib/BLI_rand.h
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/psfont.c
source/blender/blenlib/intern/rand.c
source/blender/blenlib/intern/util.c
source/blender/blenloader/BLO_sys_types.h
source/blender/blenloader/intern/genfile.c
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/intern/pluginapi.c
source/blender/imbuf/intern/cineon/cineonlib.c
source/blender/imbuf/intern/cineon/dpxlib.c
source/blender/imbuf/intern/cineon/logImageCore.h
source/blender/imbuf/intern/cineon/logmemfile.c
source/blender/imbuf/intern/cineon/logmemfile.h
source/blender/imbuf/intern/scaling.c
source/blender/include/BIF_meshtools.h
source/blender/makesdna/DNA_ipo_types.h
source/blender/makesdna/DNA_object_force.h
source/blender/makesdna/DNA_sensor_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/python/api2_2x/Draw.c
source/blender/python/api2_2x/Text3d.c
source/blender/python/api2_2x/doc/Mathutils.py
source/blender/python/api2_2x/doc/Text3d.py
source/blender/python/api2_2x/vector.c
source/blender/python/api2_2x/vector.h
source/blender/radiosity/CMakeLists.txt
source/blender/radiosity/SConscript
source/blender/radiosity/intern/source/Makefile
source/blender/radiosity/intern/source/radnode.c
source/blender/radiosity/intern/source/radpreprocess.c
source/blender/render/CMakeLists.txt
source/blender/render/SConscript
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/zbuf.c
source/blender/src/buttons_editing.c
source/blender/src/buttons_logic.c
source/blender/src/buttons_object.c
source/blender/src/buttons_scene.c
source/blender/src/drawmesh.c
source/blender/src/drawobject.c
source/blender/src/editipo_lib.c
source/blender/src/editkey.c
source/blender/src/editmesh_mods.c
source/blender/src/editmesh_tools.c
source/blender/src/header_info.c
source/blender/src/header_script.c
source/blender/src/header_view3d.c
source/blender/src/interface.c
source/blender/src/meshlaplacian.c
source/blender/src/meshtools.c
source/blender/src/parametrizer.c
source/blender/src/parametrizer.h
source/blender/src/parametrizer_intern.h
source/blender/src/renderwin.c
source/blender/src/space.c
source/blender/src/splash.jpg.c
source/blender/src/toolbox.c
source/blender/src/transform_conversions.c
source/blender/src/transform_generics.c
source/blender/yafray/intern/export_Plugin.cpp
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Expressions/InputParser.cpp
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_DelaySensor.cpp [new file with mode: 0644]
source/gameengine/GameLogic/SCA_DelaySensor.h [new file with mode: 0644]
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_CameraActuator.h
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_MaterialIpoController.cpp
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.h
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_TrackToActuator.h
source/gameengine/Ketsji/KX_VehicleWrapper.cpp
source/gameengine/PyDoc/GameLogic.py
source/gameengine/PyDoc/KX_CameraActuator.py
source/gameengine/PyDoc/KX_ParentActuator.py
source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
source/gameengine/PyDoc/KX_TrackToActuator.py
source/gameengine/PyDoc/SCA_DelaySensor.py [new file with mode: 0644]
source/gameengine/PyDoc/SCA_ISensor.py
source/kernel/CMakeLists.txt
source/kernel/SConscript
source/kernel/gen_system/GEN_HashedPtr.cpp
source/kernel/gen_system/Makefile

index 0ea2675..5b86ca8 100644 (file)
@@ -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)
diff --git a/intern/guardedalloc/BLO_sys_types.h b/intern/guardedalloc/BLO_sys_types.h
new file mode 100644 (file)
index 0000000..5ed3117
--- /dev/null
@@ -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 */
+
index 25f2fd8..a36549d 100644 (file)
@@ -49,6 +49,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLO_sys_types.h" // needed for intptr_t
+
 /* --------------------------------------------------------------------- */
 /* Data definition                                                       */
 /* --------------------------------------------------------------------- */
@@ -112,7 +114,7 @@ static const char *check_memlist(MemHead *memh);
        
 
 volatile int totblock= 0;
-volatile unsigned long mem_in_use= 0, mmap_in_use= 0;
+volatile uintptr_t mem_in_use= 0, mmap_in_use= 0;
 
 static volatile struct localListBase _membase;
 static volatile struct localListBase *membase = &_membase;
@@ -335,7 +337,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 +487,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);
                }
index 436c993..642cc16 100644 (file)
@@ -151,7 +151,7 @@ void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset)
 }
 
 /* munmap for windows */
-long munmap(void *ptr, long size)
+intptr_t munmap(void *ptr, intptr_t size)
 {
        MemMap *mm = mmap_findlink(mmapbase, ptr);
        if (!mm) {
index 40e8851..974acef 100644 (file)
@@ -261,6 +261,9 @@ ECHO Done
                        <Filter
                                Name="extern"
                                Filter="">
+                               <File
+                                       RelativePath="..\..\BLO_sys_types.h">
+                               </File>
                                <File
                                        RelativePath="..\..\MEM_guardedalloc.h">
                                </File>
index f83a2d6..443c3b6 100644 (file)
 
 #define MAP_FAILED ((void *)-1)
 
+#include "BLO_sys_types.h" // needed for intptr_t
+
 void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset);
-long munmap(void *ptr, long size);
+intptr_t munmap(void *ptr, intptr_t size);
 
 #endif
 
index ec999b0..d302a25 100644 (file)
@@ -715,6 +715,9 @@ ECHO Done
                        <Filter
                                Name="superlu"
                                Filter="">
+                               <File
+                                       RelativePath="..\..\superlu\BLO_sys_types.h">
+                               </File>
                                <File
                                        RelativePath="..\..\superlu\Cnames.h">
                                </File>
diff --git a/intern/opennl/superlu/BLO_sys_types.h b/intern/opennl/superlu/BLO_sys_types.h
new file mode 100644 (file)
index 0000000..5ed3117
--- /dev/null
@@ -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 */
+
index 79da748..7eefb90 100644 (file)
@@ -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;
index 7e2db4f..5f14b5a 100644 (file)
                        <File
                                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
                                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>
index 50ffc1f..3b239d9 100644 (file)
                        <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"
                        <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"
                        <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"
                        <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"
index e72716a..5d8213c 100644 (file)
@@ -1 +1 @@
-2.46
+2.47
index 2e24a0f..46b935c 100644 (file)
@@ -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) {
index 6a1bd28..684a12c 100644 (file)
Binary files a/release/datafiles/splash.jpg and b/release/datafiles/splash.jpg differ
index d951c84..e1eb671 100644 (file)
@@ -40,8 +40,8 @@ extern "C" {
 struct ListBase;
 struct MemFile;
 
-#define BLENDER_VERSION                        246
-#define BLENDER_SUBVERSION             1
+#define BLENDER_VERSION                        247
+#define BLENDER_SUBVERSION             0
 
 #define BLENDER_MINVERSION             245
 #define BLENDER_MINSUBVERSION  15
index e84c7d3..c84b690 100644 (file)
 #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;
index 3763a65..3b4c319 100644 (file)
@@ -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(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);
+float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float *vec_to_part);
+
+
 
 
 #endif
index 1757103..dc5efd5 100644 (file)
 
 #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
index a96a3e1..f389521 100644 (file)
 
 /* 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
 
index 9dcb6b6..1652b24 100644 (file)
@@ -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));
index 67cf89d..1dabab9 100644 (file)
@@ -79,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
@@ -479,7 +481,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 {
@@ -497,7 +499,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) {
@@ -532,7 +534,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) {
@@ -619,7 +621,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) {
@@ -637,7 +639,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);
@@ -733,7 +735,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);
@@ -1053,7 +1055,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);
@@ -1081,7 +1083,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;
@@ -1168,7 +1170,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");
index c7817b0..dbc9457 100644 (file)
@@ -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;
index 298e4b8..3b79f66 100644 (file)
@@ -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;
index 4588ef8..7620eda 100644 (file)
@@ -157,6 +157,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 +212,189 @@ 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               */
+/************************************************/
+
+// 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;
+       
+       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(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)
+{
+       float mag_vec[3]={0,0,0};
+       float temp[3], temp2[3];
+       float eff_vel[3];
+       float wind = 0;
+
+       VecCopyf(eff_vel,eff_velocity);
+       Normalize(eff_vel);
+
+       switch(type){
+               case PFIELD_WIND:
+                       VECCOPY(mag_vec,eff_vel);
+                       
+                       // add wind noise here
+                       if(noise> 0.0f)
+                               wind = wind_func(rng, noise);
+
+                       VecMulf(mag_vec,(force_val+wind)*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;
+       }
+}
+
+
+
+
 /*  -------- pdDoEffectors() --------
     generic force/speed system, now used for particles and softbodies
        lb                      = listbase with objects that take part in effecting
@@ -244,13 +427,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 +441,32 @@ 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];
-                       
-                       /* 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 );
+               else {
+                       float field[3]={0,0,0}, tmp[3];
+                       VECCOPY(field, force);
+                       do_physical_effector(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);
                        
-                       /* 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
index cab7865..b9e3c59 100644 (file)
@@ -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 */
index b6c8ad5..07537e3 100644 (file)
@@ -86,6 +86,8 @@
 #include "blendef.h"
 #include "BSE_time.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
 
@@ -630,11 +632,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 +658,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);
index 297ac0b..0375ab2 100644 (file)
@@ -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.05;
+                       
+                       // 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
index 59eb383..fe92edf 100644 (file)
@@ -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
 };
 
 
@@ -1608,6 +1608,12 @@ 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;
                }
        }
 
index d1c0cde..60fdbca 100644 (file)
@@ -2205,177 +2205,6 @@ static int get_particles_from_cache(Object *ob, ParticleSystem *psys, int cfra)
        return 1;
 }
 
-/************************************************/
-/*                     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];
@@ -2788,7 +2617,7 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P
                                } 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);
+                                                                               pa->state.vel,force_field,pd->flag&PFIELD_PLANAR, pd->rng, pd->f_noise);
                                }
                        }
                        if(ec->type & PSYS_EC_PARTICLE){
@@ -2837,7 +2666,7 @@ void do_effectors(int pa_no, ParticleData *pa, ParticleKey *state, Object *ob, P
                                                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);
+                                                       state->vel,force_field,0, pd->rng, pd->f_noise);
                                        }
                                        else if(pd->forcefield==PFIELD_HARMONIC && cfra-framestep <= epa->dietime && cfra>epa->dietime){
                                                /* first step after key release */
@@ -3948,27 +3777,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;
+                                               }
                                        }
                                }
                        }
index fcf1c7c..47d11bb 100644 (file)
@@ -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;
index d42663e..447f6a2 100644 (file)
@@ -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];
index 0e53478..266aa34 100644 (file)
@@ -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);
index 227cb8f..e9271ca 100644 (file)
@@ -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);
index d0db133..d20143f 100644 (file)
@@ -634,6 +634,18 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
        BVHBuildHelper data;
        int depth;
 
+       //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];             
+               return;
+       }
+
        branches_array--;       //Implicit trees use 1-based indexs
        
        build_implicit_tree_helper(tree, &data);
index 96de5e9..2acbbbe 100644 (file)
@@ -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;
 }
 
index 498c87c..216246d 100644 (file)
@@ -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 {
index ccc4782..c484a30 100644 (file)
@@ -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) {
index 48ebf77..a311211 100644 (file)
@@ -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
index a188589..a9d2937 100644 (file)
 #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)
 
@@ -64,6 +59,14 @@ typedef unsigned __int16 uint16_t;
 typedef unsigned __int32 uint32_t;
 typedef unsigned __int64 uint64_t;
 
+#ifdef _WIN64
+typedef __int64 intptr_t;
+typedef unsigned __int64 uintptr_t;
+#else
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+#endif
+
 #elif defined(__linux__)
 
        /* Linux-i386, Linux-Alpha, Linux-ppc */
@@ -73,6 +76,10 @@ typedef unsigned __int64 uint64_t;
 
 #include <inttypes.h>
 
+#elif defined(FREE_WINDOWS)
+
+#include <stdint.h>
+
 #else
 
        /* FreeBSD, Irix, Solaris */
index 87c859d..86338ca 100644 (file)
@@ -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);
 }
 
 
index f56b261..5a75b5c 100644 (file)
@@ -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");
index 70ead61..9d7a030 100644 (file)
@@ -2949,11 +2949,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);
@@ -2968,11 +2966,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);
@@ -3600,9 +3596,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) {
@@ -4101,7 +4097,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;
@@ -7737,31 +7733,6 @@ 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) {
@@ -7788,6 +7759,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                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! */
@@ -8510,9 +8489,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);
@@ -8526,9 +8502,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);
index 3a70438..b462233 100644 (file)
@@ -608,6 +608,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;
index e65148a..9c08a0b 100644 (file)
 #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                                                          */ 
index 3b45a9d..ecee3c7 100644 (file)
@@ -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;
index 500c09b..1710cdd 100644 (file)
@@ -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;
        }
index 01eff8d..2646e8b 100644 (file)
@@ -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;
 };
 
index 2035933..160e845 100644 (file)
 
 #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;
index 6e82cf2..39e2f36 100644 (file)
@@ -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);
 
index 40c1f83..8257eb4 100644 (file)
@@ -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;
index b08c66f..d809d1f 100644 (file)
@@ -40,7 +40,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);
index 3954a50..03ffef3 100644 (file)
@@ -354,8 +354,8 @@ typedef short IPO_Channel;
 
 /* ******************** */
 /* particle ipos */
-#define PART_TOTIPO            19
-#define PART_TOTNAM            19
+#define PART_TOTIPO            22
+#define PART_TOTNAM            22
 
 #define PART_EMIT_FREQ 1
 #define PART_EMIT_LIFE 2
@@ -381,6 +381,10 @@ typedef short IPO_Channel;
 
 #define PART_BB_TILT   19
 
+#define PART_PD_FSTR   20
+#define PART_PD_FFALL  21
+#define PART_PD_FMAXD  22
+
 
 /* these are IpoCurve specific */
 /* **************** IPO ********************* */
index dc6c2bc..5f6ae7c 100644 (file)
@@ -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 {
index c0306f4..b5d8511 100644 (file)
@@ -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      */
@@ -204,6 +211,7 @@ 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
@@ -254,5 +262,7 @@ typedef struct bJoystickSensor {
 #define SENS_JOY_HAT                   2
 #define SENS_JOY_HAT_DIR               0
 
+#define SENS_DELAY_REPEAT              1
+
 #endif
 
index 3818d66..b4deb1f 100644 (file)
@@ -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);
index 047a035..bd19a6a 100644 (file)
@@ -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(  );
index 5137e98..202195c 100644 (file)
@@ -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;
index 8b0c41b..524d1fb 100644 (file)
@@ -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
index a7d8c58..4bd9890 100644 (file)
@@ -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.
index 33ca993..fe28f0f 100644 (file)
@@ -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 */
index a86f2dd..61b50d5 100644 (file)
@@ -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);
 
index 36e9ad1..941da41 100644 (file)
@@ -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
 )
 
 BLENDERLIB_NOLIST(blender_radiosity "${SRC}" "${INC}")
index 102f796..a86b76b 100644 (file)
@@ -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'
 
 incs += ' ' + env['BF_OPENGL_INC']
 
index 19768c9..e5ff8c4 100644 (file)
@@ -44,6 +44,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
index 5517a22..042fe68 100644 (file)
@@ -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;
index 5f8a397..07b933b 100644 (file)
@@ -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;
        }
index b543dff..0b65955 100644 (file)
@@ -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)
index b1bc967..f0d1353 100644 (file)
@@ -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'
 
 defs = []
 
index 2f97b19..f83bbd7 100644 (file)
@@ -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;
 
index d70c51b..15c57eb 100644 (file)
@@ -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;
 
index 6a0af82..3cd7bdc 100644 (file)
@@ -138,7 +138,7 @@ static void print_error(char *str) {printf("ERROR: %s\n", str);}
 
 static void stats_background(RenderStats *rs)
 {
-       extern unsigned long mem_in_use;
+       extern uintptr_t mem_in_use;
        float megs_used_memory= mem_in_use/(1024.0*1024.0);
        char str[400], *spos= str;
        
index 4520e4c..4a2ad99 100644 (file)
@@ -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;
@@ -1027,7 +1027,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 +1092,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 +1133,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) 
@@ -1433,7 +1433,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 +1569,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 +1581,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");
index f3258b6..f477df3 100644 (file)
@@ -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;
@@ -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++)
@@ -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 */
index 591d51a..05e3616 100644 (file)
@@ -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;
index c91c9e2..29aa6e3 100644 (file)
@@ -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;
@@ -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;
index 6330346..4682549 100644 (file)
@@ -4277,7 +4277,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);
index 5cf1958..2dd6d70 100644 (file)
@@ -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;
@@ -1689,7 +1713,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
                                        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-6106, wval, 19, oa->forcerot+2, -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, "");                                
                                }
                                
                                if ( ob->gameflag & OB_DYNAMIC )
@@ -3183,7 +3207,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;
@@ -3231,7 +3256,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");
@@ -3323,8 +3349,8 @@ void logic_buts(void)
                                        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-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;
@@ -3334,9 +3360,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-124), 19, sens, 0, 31, 0, 0, "");
                                                uiButSetFunc(but, sca_move_sensor, sens, NULL);
                                        }
 
@@ -3393,8 +3419,8 @@ void logic_buts(void)
 
                                        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-134), 19, act->name, 0, 31, 0, 0, "Actuator name");
                                                uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
 
                                                ycoo= yco;
@@ -3404,9 +3430,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-134), 19, act, 0, 0, 0, 0, "Actuator name");
                                                uiButSetFunc(but, sca_move_actuator, act, NULL);
                                                ycoo= yco;
                                        }
index 370f699..132bae8 100644 (file)
@@ -3452,6 +3452,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);
                        
index fb6a763..5205be3 100644 (file)
@@ -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"
@@ -3261,7 +3262,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);
@@ -3322,7 +3323,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++) {
@@ -3381,7 +3382,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 */
index dd51259..09f74c0 100644 (file)
@@ -664,7 +664,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 +682,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 +698,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 +706,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;
index 1a469e8..213f495 100644 (file)
@@ -5315,7 +5315,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 +5327,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 +5336,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 +5348,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 +5382,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));
@@ -5415,7 +5415,7 @@ 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);
+       uintptr_t flags = (intptr_t)BLI_edgehash_lookup(data->eh, med->v1, med->v2);
 
        if (flags & 1) {
                set_framebuffer_index_color(data->offset+index);
index 41044ad..7b3d439 100644 (file)
@@ -103,7 +103,7 @@ 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"};
 
 /* gets the appropriate icon for the given blocktype */
 int geticon_ipo_blocktype(short blocktype)
index 1f24fb0..ce79806 100644 (file)
@@ -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);
 
index 6dfbd67..c162c90 100644 (file)
@@ -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 **************** */
 
@@ -2937,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;
 
@@ -3041,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;
 
index f9bb14a..3615a4a 100644 (file)
@@ -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++;
index a9280d9..8b8fd9e 100644 (file)
@@ -39,6 +39,8 @@
 #include <config.h>
 #endif
 
+#include "BLO_sys_types.h" // for intptr_t support
+
 #include "DNA_group_types.h"
 #include "DNA_ID.h"
 #include "DNA_image_types.h"
@@ -2106,7 +2108,7 @@ static void info_text(int x, int y)
 {
        Object *ob= OBACT;
        extern float hashvectf[];
-       extern unsigned long mem_in_use, mmap_in_use;
+       extern uintptr_t mem_in_use, mmap_in_use;
        unsigned int swatch_color;
        float fac1, fac2, fac3;
        char infostr[300], memstr[64];
index 3c96e16..53c4b9b 100644 (file)
 #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, "");
index 948023b..fcf4caf 100644 (file)
@@ -5139,7 +5139,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"); 
@@ -5777,7 +5777,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)");  
index e7b5b17..a2b2af0 100644 (file)
 #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
@@ -6039,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;
@@ -6370,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;
 }
index 60f569e..2de6367 100644 (file)
@@ -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)
index 0f30aef..9983362 100644 (file)
@@ -107,6 +107,8 @@ void sort_faces(void);
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.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 +594,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 +612,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 +644,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 +692,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 +736,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 +807,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 +865,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]) ||
index 096629b..7aa27f9 100644 (file)
@@ -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)
index 80fab11..c468b8d 100644 (file)
@@ -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
index f7a3281..bc38cb4 100644 (file)
@@ -30,7 +30,7 @@ typedef enum PBool {
 
 /* Special Purpose Hash */
 
-typedef long PHashKey;
+typedef intptr_t PHashKey;
 
 typedef struct PHashLink {
        struct PHashLink *next;
index 6c150f3..88f5f6e 100644 (file)
@@ -50,6 +50,8 @@
 
 #endif
 
+#include "BLO_sys_types.h" // for intptr_t support
+
 #include <limits.h>
 
 #include "BLI_blenlib.h"
@@ -901,7 +903,7 @@ 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;
+       extern uintptr_t mem_in_use, mmap_in_use;
        float megs_used_memory, mmap_used_memory;
        char *spos= str;
        
index 8d86336..fb05521 100644 (file)
 
 #include "SYS_System.h" /* for the user def menu ... should move elsewhere. */
 
+#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*/
@@ -460,7 +462,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 +480,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);
index 2431ff5..ecd6316 100644 (file)
 /* 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,&nbs