svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17279:HEAD
authorCampbell Barton <ideasman42@gmail.com>
Wed, 5 Nov 2008 15:11:40 +0000 (15:11 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 5 Nov 2008 15:11:40 +0000 (15:11 +0000)
somehow scripts line endings change is messing things up, these changes wont be included
error is:
svn: File 'release/scripts/scripttemplate_metaball_create.py' has inconsistent newlines
svn: Inconsistent line ending style
svn: Error reading spooled REPORT request response

70 files changed:
CMakeLists.txt
config/darwin-config.py
config/linux2-config.py
config/linuxcross-config.py
config/openbsd3-config.py
config/sunos5-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
extern/libopenjpeg/SConscript
extern/libredcode/SConscript
extern/libredcode/format.c
source/Makefile
source/blender/blenkernel/BKE_lattice.h
source/blender/blenkernel/BKE_shrinkwrap.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/simple_deform.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/readfile.h
source/blender/imbuf/intern/IMB_anim.h
source/blender/imbuf/intern/amiga.c
source/blender/imbuf/intern/anim.c
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/util.c
source/blender/python/api2_2x/Armature.c
source/blender/src/buttons_logic.c
source/blender/src/buttons_shading.c
source/blender/src/editmesh_mods.c
source/blender/src/interface.c
source/blender/src/reeb.c
source/creator/CMakeLists.txt
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Makefile
source/gameengine/VideoTexture/Exception.cpp
source/gameengine/VideoTexture/FilterBase.cpp
source/gameengine/VideoTexture/FilterBase.h
source/gameengine/VideoTexture/FilterBlueScreen.cpp
source/gameengine/VideoTexture/FilterBlueScreen.h
source/gameengine/VideoTexture/FilterColor.cpp
source/gameengine/VideoTexture/FilterColor.h
source/gameengine/VideoTexture/FilterNormal.cpp
source/gameengine/VideoTexture/FilterNormal.h
source/gameengine/VideoTexture/FilterSource.cpp
source/gameengine/VideoTexture/FilterSource.h
source/gameengine/VideoTexture/ImageBase.cpp
source/gameengine/VideoTexture/ImageBase.h
source/gameengine/VideoTexture/ImageBuff.cpp
source/gameengine/VideoTexture/ImageMix.cpp
source/gameengine/VideoTexture/ImageRender.cpp
source/gameengine/VideoTexture/ImageViewport.cpp
source/gameengine/VideoTexture/ImageViewport.h
source/gameengine/VideoTexture/PyTypeList.cpp
source/gameengine/VideoTexture/PyTypeList.h
source/gameengine/VideoTexture/SConscript
source/gameengine/VideoTexture/Texture.cpp
source/gameengine/VideoTexture/Texture.h
source/gameengine/VideoTexture/VideoBase.h
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/gameengine/VideoTexture/VideoFFmpeg.h
source/gameengine/VideoTexture/blendVideoTex.cpp
source/nan_compile.mk
tools/Blender.py

index 41f2311af985a4daea4ee4f472ee071e04265ba9..e01a37d3b3edfa2d2b834cd4d020c77c977686cf 100644 (file)
@@ -88,14 +88,16 @@ INCLUDE(CMake/macros.cmake)
 #Platform specifics
 
 IF(UNIX)
-  INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
-  IF(OPENAL_FOUND)
-    SET(WITH_OPENAL ON)
-    SET(OPENAL_LIB ${OPENAL_LIBRARY})
-    SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
-  ELSE(OPENAL_FOUND)
-    SET(WITH_OPENAL OFF)
-  ENDIF(OPENAL_FOUND)
+  IF(WITH_OPENAL)
+    INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
+    IF(OPENAL_FOUND)
+      SET(WITH_OPENAL ON)
+      SET(OPENAL_LIB ${OPENAL_LIBRARY})
+      SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
+    ELSE(OPENAL_FOUND)
+      SET(WITH_OPENAL OFF)
+    ENDIF(OPENAL_FOUND)
+  ENDIF(WITH_OPENAL)
 
   FIND_LIBRARY(ALUT_LIBRARY
     NAMES alut
index 547d655b531ad93e52c2d6cb3e6fb000cc8814e1..53e45f5233c9ecebc29d3127ea7461567399f788 100644 (file)
@@ -260,11 +260,11 @@ CC_WARN = ['-Wall', '-Wno-long-double']
 ##LOPTS = --dynamic
 ##DYNLDFLAGS = -shared $(LDFLAGS)
 
-BF_PROFILE_FLAGS = ' -pg -g '
+BF_PROFILE_FLAGS = ['-pg', '-g ']
 BF_PROFILE = False
 
 BF_DEBUG = False
-BF_DEBUG_FLAGS = '-g'
+BF_DEBUG_FLAGS = ['-g']
 
 BF_BUILDDIR='../build/darwin'
 BF_INSTALLDIR='../install/darwin'
index ca07bf10ab8836339b862cc1b6e00dda83e04c9c..e890d264682d16d2784c94539ba7c8211072f9f1 100644 (file)
@@ -201,7 +201,7 @@ BF_PROFILE_FLAGS = ['-pg','-g']
 BF_PROFILE = False
 
 BF_DEBUG = False
-BF_DEBUG_FLAGS = '-g'
+BF_DEBUG_FLAGS = ['-g']
 
 BF_BUILDDIR = '../build/linux2'
 BF_INSTALLDIR='../install/linux2'
index c10e9d76cb525cb9e752f00535d233da2d08cf90..251f53a90e2f2ff4bf5c9813f311fe56e7cc9e2a 100644 (file)
@@ -144,7 +144,7 @@ CC_WARN = [ '-Wall' ]
 LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
 
 BF_DEBUG = False
-BF_DEBUG_FLAGS= ''
+BF_DEBUG_FLAGS= []
 
 BF_BUILDDIR = '../build/linuxcross'
 BF_INSTALLDIR='../install/linuxcross'
index 0a4f75e3bccc4fc4d777cc7309e3a3fc9739866d..9313cbc211fcb71bfed318146e5d40c8c461963e 100644 (file)
@@ -155,11 +155,11 @@ LLIBS = 'm stdc++ pthread util'
 ##LOPTS = --dynamic
 ##DYNLDFLAGS = -shared $(LDFLAGS)
 
-BF_PROFILE_FLAGS = ' -pg -g '
+BF_PROFILE_FLAGS = ['-pg', '-g']
 BF_PROFILE = False
 
 BF_DEBUG = False
-BF_DEBUG_FLAGS = '-g'
+BF_DEBUG_FLAGS = ['-g']
 
 BF_BUILDDIR='../build/openbsd3'
 BF_INSTALLDIR='../install/openbsd3'
index 2343ce69060ceaaf5228d5b3679f8d3446952d43..7b1295da9412954fe24a730b8265d0eb7fbc1142 100644 (file)
@@ -173,11 +173,11 @@ BF_PROFILE_FLAGS = ['-pg','-g']
 BF_PROFILE = False
 
 BF_DEBUG = False
-BF_DEBUG_FLAGS = ''
+BF_DEBUG_FLAGS = []
 
 BF_BUILDDIR = '../build/sunos5'
 BF_INSTALLDIR='../install/sunos5'
 BF_DOCDIR='../install/doc'
 
 
-PLATFORM_LINKFLAGS = ['']
+PLATFORM_LINKFLAGS = []
index bdeca1ddc9182ab9e43d0b23f00c8d817d65b5df..19e9d1918c63f7369f2b6fd6e6be100c27e8a6d2 100644 (file)
@@ -160,7 +160,7 @@ CC_WARN = [ '-Wall' ]
 LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++']
 
 BF_DEBUG = False
-BF_DEBUG_FLAGS= '-g'
+BF_DEBUG_FLAGS= ['-g']
 
 BF_PROFILE_FLAGS = ['-pg','-g']
 BF_PROFILE = False
index a5aa76c2868a9b8016c5cb22b6e5f4ec3d689314..9a41f7ee55745910930efd29663bca94e4f9f6f6 100644 (file)
@@ -150,6 +150,11 @@ BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
 BF_QUICKTIME_LIB = 'qtmlClient'
 BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
 
+WITH_BF_OPENJPEG = True 
+
+WITH_BF_REDCODE = False  
+BF_REDCODE_INC = '#extern'
+
 WITH_BF_STATICOPENGL = False
 BF_OPENGL_INC = '${BF_OPENGL}/include'
 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
index f0a93f6e2d9cdeae878c404500ad5d58c737da2b..837701eeae0c3416ce316447ffddc23232f88f0b 100644 (file)
@@ -7,14 +7,18 @@ Import('env')
 sources = env.Glob('*.c')
 incs = '.'
 
-flags = "-Wall -O3 -ffast-math -std=c99"
+if env['OURPLATFORM'] == 'win32-vc':
+       flags = []
+else:
+       flags = ['-Wall', '-O3', '-ffast-math', '-std=c99']
 
-oj_env = env.Copy();
-oj_env.Replace(CCFLAGS = '')
-oj_env.Replace(BF_DEBUG_FLAGS = '')
+oj_env = env.Clone()
+if not env['OURPLATFORM'] == 'win32-vc':
+       oj_env.Replace(CCFLAGS = '')
+       oj_env.Replace(BF_DEBUG_FLAGS = '')
 
 oj_env.BlenderLib ( libname='extern_openjpeg', 
                     sources=sources, includes=Split(incs),
                     defines=[],
                     libtype=['core','intern','player'],
-                    priority=[10, 10, 300], compileflags = Split(flags))
+                    priority=[10, 10, 300], compileflags = flags)
index 4e83ba5cbb4f28bdcf437d7a7a71d59ade76486e..9fd25ad63c7478ba2cd5ac5d9f8fcc0503bdd830 100644 (file)
@@ -9,18 +9,6 @@ Import('env')
 sources = env.Glob('*.c')
 incs = '. ../libopenjpeg'
 
-root = "extern/libredcode"
-
-if not os.path.isdir(root + "/include"):
-    os.mkdir(root + "/include");
-if not os.path.isdir(root + "/include/redcode"):
-    os.mkdir(root + "/include/redcode");
-
-for h in env.Glob('*.h'):
-    shutil.copyfile(root + "/" + h,
-                    root + "/include/redcode/" + h)
-
-
 env.BlenderLib ( libname='extern_redcode', 
                  sources=sources, includes=Split(incs),
                  defines=[],
index 35410e9e26916c09f928d501ccb4ef9e05c0a180..4677c49b8a561b978a53704365b1988f3fb916e0 100644 (file)
@@ -1,4 +1,9 @@
+#ifdef _WIN32
+#include <Winsock2.h>
+#else
 #include <netinet/in.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 99155206987448c4edb90fd2cbbf0b047c8d61b8..558a844eca790df8d58096d6b7f3e663e45f54cd 100644 (file)
@@ -142,6 +142,7 @@ ifneq ($(NAN_NO_KETSJI),true)
     COMLIB += $(OCGDIR)/gameengine/OpenGLrasterizer/$(DEBUG_DIR)libOpenGLrasterizer.a
     COMLIB += $(OCGDIR)/gameengine/expression/$(DEBUG_DIR)libexpression.a
     COMLIB += $(OCGDIR)/gameengine/scenegraph/$(DEBUG_DIR)libscenegraph.a
+    COMLIB += $(OCGDIR)/gameengine/videotex/$(DEBUG_DIR)libvideotex.a
 #    COMLIB += $(OCGDIR)/sumo/$(DEBUG_DIR)libfuzzics.a
 #    COMLIB += $(OCGDIR)/sumo/$(DEBUG_DIR)libsolid.a
     COMLIB += $(NAN_MOTO)/lib/libmoto.a
index 5620674e791eee6838b09a65fa7b13342b7ee370..dc7c9dcd5e596fbe80531e6f3e71b7fd5969ce41 100644 (file)
@@ -35,6 +35,7 @@ struct Lattice;
 struct Object;
 struct DerivedMesh;
 struct BPoint;
+struct MDeformVert;
 
 extern struct Lattice *editLatt;
 
@@ -67,5 +68,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3];
 void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3]);
 void lattice_calc_modifiers(struct Object *ob);
 
+struct MDeformVert* lattice_get_deform_verts(struct Object *lattice);
+
 #endif
 
index e8276238ff220213cbdacb262ad9afb99adb847f..eed22ff9d8e3dda2609fcc6ac4485bf780807f19 100644 (file)
@@ -96,6 +96,7 @@ void space_transform_invert_normal(const SpaceTransform *data, float *no);
 struct Object;
 struct DerivedMesh;
 struct ShrinkwrapModifierData;
+struct MDeformVert;
 struct BVHTree;
 
 
@@ -109,6 +110,9 @@ typedef struct ShrinkwrapCalcData
        float (*vertexCos)[3];                  //vertexs being shrinkwraped
        int numVerts;
 
+       struct MDeformVert* dvert;                      //Pointer to mdeform array
+       int vgroup;                                             //Vertex group num
+
        struct DerivedMesh *target;             //mesh we are shrinking to      
        SpaceTransform local2target;    //transform to move bettwem local and target space
 
index 1fe6447752e72f37dd51c11d09663925e3b7cb19..5dcccc56d06223841d8d47c115eb68a917f38355 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef WIN32 
-    #include <unistd.h> // for read close
-    #include <sys/param.h> // for MAXPATHLEN
+#ifndef _WIN32 
+       #include <unistd.h> // for read close
+       #include <sys/param.h> // for MAXPATHLEN
 #else
-    #include <io.h> // for open close read
+       #include <io.h> // for open close read
+       #define open _open
+       #define read _read
+       #define close _close
+       #define write _write
 #endif
 
 #include <stdlib.h>
index b090ac2b538466081caa7dc58f167af137fbe179..1a671dfe771ec73d5ad2f473317280148ae1a421 100644 (file)
@@ -1100,9 +1100,12 @@ float *make_orco_curve(Object *ob)
                                                fp[1]= 2.0f*v/(dl->nr-1) - 1.0f;
                                                fp[2]= 0.0;
                                        } else {
+                                               float *vert;
                                                int realv= v % dl->nr;
-
-                                               VECCOPY(fp, &dl->verts[(dl->nr*u + realv)*3]);
+                                               int realu= u % dl->parts;
+                                               
+                                               vert= dl->verts + 3*(dl->nr*realu + realv);
+                                               VECCOPY(fp, vert);
 
                                                fp[0]= (fp[0]-cu->loc[0])/cu->size[0];
                                                fp[1]= (fp[1]-cu->loc[1])/cu->size[1];
index 3143c5e4df2328e80647f9e73c9d13171756c28c..477368652735e598ae62104b3b1300e97c67cf43 100644 (file)
@@ -239,12 +239,9 @@ float deformvert_get_weight(const struct MDeformVert *dvert, int group_num)
 
 float vertexgroup_get_vertex_weight(const struct MDeformVert *dvert, int index, int group_num)
 {
-       if(group_num == -1)
+       if(group_num == -1 || dvert == NULL)
                return 1.0;
 
-       if(dvert == 0)
-               return 0.0;
-
        return deformvert_get_weight(dvert+index, group_num);
 }
 
index 9fb8d17d730da2b794da9d9270e723ad38dc24cf..ee3fd59fe9fd5c6cf6cd042c55b9d9a017a3e085 100644 (file)
 #include <fcntl.h>
 #include <string.h>
 
-#ifndef WIN32 
+#ifndef _WIN32 
 #include <unistd.h>
 #else
 #include <io.h>
+#define open _open
+#define read _read
+#define close _close
+#define write _write
 #endif
 
 #include "MEM_guardedalloc.h"
index 54915058bab7b21778a8c29ff0a3db9d86e04ab2..6614c657647b3bb0df33a7e7c2252d074ac25219 100644 (file)
@@ -928,3 +928,15 @@ void lattice_calc_modifiers(Object *ob)
                BLI_addtail(&ob->disp, dl);
        }
 }
+
+struct MDeformVert* lattice_get_deform_verts(struct Object *oblatt)
+{
+       if(oblatt->type == OB_LATTICE)
+       {
+               Lattice *lt = (oblatt==G.obedit)?editLatt:(Lattice*)oblatt->data;
+               return lt->dvert;
+       }
+
+       return NULL;    
+}
+
index 13dc2e834f234de04fa532aec14fec4932adb325..6bdd395a2ac1f22d1c737b6d7bb20f8fdcb00f5d 100644 (file)
@@ -7804,9 +7804,10 @@ static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, Derived
        {
                if(derivedData) dm = CDDM_copy(derivedData);
                else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+               else if(ob->type==OB_LATTICE) dm = NULL;
                else return;
 
-               if(dataMask & CD_MVERT)
+               if(dm != NULL && (dataMask & CD_MVERT))
                {
                        CDDM_apply_vert_coords(dm, vertexCos);
                        CDDM_calc_normals(dm);
@@ -7828,9 +7829,10 @@ static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditM
        {
                if(derivedData) dm = CDDM_copy(derivedData);
                else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob->data);
+               else if(ob->type==OB_LATTICE) dm = NULL;
                else return;
 
-               if(dataMask & CD_MVERT)
+               if(dm != NULL && (dataMask & CD_MVERT))
                {
                        CDDM_apply_vert_coords(dm, vertexCos);
                        CDDM_calc_normals(dm);
@@ -7916,9 +7918,10 @@ static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, Deriv
        {
                if(derivedData) dm = CDDM_copy(derivedData);
                else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+               else if(ob->type==OB_LATTICE) dm = NULL;
                else return;
 
-               if(dataMask & CD_MVERT)
+               if(dm != NULL && (dataMask & CD_MVERT))
                {
                        CDDM_apply_vert_coords(dm, vertexCos);
                        CDDM_calc_normals(dm);
@@ -7942,9 +7945,10 @@ static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, Edi
        {
                if(derivedData) dm = CDDM_copy(derivedData);
                else if(ob->type==OB_MESH) dm = CDDM_from_editmesh(editData, ob->data);
+               else if(ob->type==OB_LATTICE) dm = NULL;
                else return;
 
-               if(dataMask & CD_MVERT)
+               if(dm != NULL && (dataMask & CD_MVERT))
                {
                        CDDM_apply_vert_coords(dm, vertexCos);
                        CDDM_calc_normals(dm);
index 77c891ee82eb0bcabae44ac7c0240eb82d15effe..a25afeafaef5fb3edd115b3ff865439c82d6cecb 100644 (file)
@@ -1163,7 +1163,10 @@ static void copy_object_pose(Object *obn, Object *ob)
                        ListBase targets = {NULL, NULL};
                        bConstraintTarget *ct;
                        
-                       if(con->ipo) {
+                       /* note that we can't change lib linked ipo blocks. for making
+                        * proxies this still works correct however because the object
+                        * is changed to object->proxy_from when evaluating the driver. */
+                       if(con->ipo && !con->ipo->id.lib) {
                                IpoCurve *icu;
                                for(icu= con->ipo->curve.first; icu; icu= icu->next) {
                                        if(icu->driver && icu->driver->ob==ob)
index 28bf7aee88439578c05e1400f213920ec020b4e4..ab98fb1f0078c79a915351189aca2d0bdddec291 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "BKE_shrinkwrap.h"
 #include "BKE_DerivedMesh.h"
+#include "BKE_lattice.h"
 #include "BKE_utildefines.h"
 #include "BKE_deform.h"
 #include "BKE_cdderivedmesh.h"
@@ -161,6 +162,18 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
        calc.numVerts = numVerts;
        calc.vertexCos = vertexCos;
 
+       //DeformVertex
+       calc.vgroup = get_named_vertexgroup_num(calc.ob, calc.smd->vgroup_name);
+       if(calc.original)
+       {
+               calc.dvert = calc.original->getVertDataArray(calc.original, CD_MDEFORMVERT);
+       }
+       else if(calc.ob->type == OB_LATTICE)
+       {
+               calc.dvert = lattice_get_deform_verts(calc.ob);
+       }
+
+
        if(smd->target)
        {
                //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array
@@ -207,8 +220,6 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
 void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
 {
        int i;
-       const int vgroup                 = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name);
-       MDeformVert *const dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL;
 
        BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;
        BVHTreeNearest  nearest  = NULL_BVHTreeNearest;
@@ -230,7 +241,7 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
        {
                float *co = calc->vertexCos[i];
                float tmp_co[3];
-               float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup);
+               float weight = vertexgroup_get_vertex_weight(calc->dvert, i, calc->vgroup);
                if(weight == 0.0f) continue;
 
                VECCOPY(tmp_co, co);
@@ -342,11 +353,6 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
        MVert *vert  = NULL; //Needed in case of vertex normal
        DerivedMesh* ss_mesh = NULL;
 
-       //Vertex group data
-       const int vgroup                   = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name);
-       const MDeformVert *dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL;
-
-
        //Raycast and tree stuff
        BVHTreeRayHit hit;
        BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;        //target
@@ -441,7 +447,7 @@ do
                float *co = calc->vertexCos[i];
                float tmp_co[3], tmp_no[3];
                float lim = 10000.0f; //TODO: we should use FLT_MAX here, but sweepsphere code isnt prepared for that
-               float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup);
+               float weight = vertexgroup_get_vertex_weight(calc->dvert, i, calc->vgroup);
 
                if(weight == 0.0f) continue;
 
@@ -520,9 +526,6 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
 {
        int i;
 
-       const int vgroup = get_named_vertexgroup_num(calc->ob, calc->smd->vgroup_name);
-       const MDeformVert *const dvert = calc->original ? calc->original->getVertDataArray(calc->original, CD_MDEFORMVERT) : NULL;
-
        BVHTreeFromMesh treeData = NULL_BVHTreeFromMesh;
        BVHTreeNearest  nearest  = NULL_BVHTreeNearest;
 
@@ -547,7 +550,7 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
        {
                float *co = calc->vertexCos[i];
                float tmp_co[3];
-               float weight = vertexgroup_get_vertex_weight(dvert, i, vgroup);
+               float weight = vertexgroup_get_vertex_weight(calc->dvert, i, calc->vgroup);
                if(weight == 0.0f) continue;
 
                //Convert the vertex to tree coordinates
index 0eb710fa48ec31ddc59a1c55f81bbc0d9a5d7286..2978a6f7f01972e01dfb4aae0985f22174835e1b 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "BKE_simple_deform.h"
 #include "BKE_DerivedMesh.h"
+#include "BKE_lattice.h"
 #include "BKE_deform.h"
 #include "BKE_utildefines.h"
 #include "BLI_arithb.h"
@@ -204,7 +205,14 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s
 
 
        if(dm)
-               dvert   = dm->getVertDataArray(dm, CD_MDEFORMVERT);
+       {
+               dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
+       }
+       else if(ob->type == OB_LATTICE)
+       {
+               dvert = lattice_get_deform_verts(ob);
+       }
+
 
 
        switch(smd->mode)
index bb726887d32770a0a43b510324e8c3136b75be27..ab9e6f9af415c33d5569a459b9369a6eb16c4986 100644 (file)
@@ -348,6 +348,15 @@ int do_colorband(ColorBand *coba, float in, float out[4])
                                else
                                        fac= 0.0f;
                                
+                               if (coba->ipotype==4) {
+                                       /* constant */
+                                       out[0]= cbd2->r;
+                                       out[1]= cbd2->g;
+                                       out[2]= cbd2->b;
+                                       out[3]= cbd2->a;
+                                       return 1;
+                               }
+                               
                                if(coba->ipotype>=2) {
                                        /* ipo from right to left: 3 2 1 0 */
                                        
index 5a75b5c8b110426dd5dcaac269dde28a6d1c51c3..e4bc6e3abb208b8e07ce0a82dee5bbbccc0ebaac 100644 (file)
@@ -364,6 +364,9 @@ BlendFileData *BLO_read_from_memfile(const char *filename, MemFile *memfile, Ble
        if (fd) {
                strcpy(fd->filename, filename);
                
+               /* clear ob->proxy_from pointers in G.main */
+               blo_clear_proxy_pointers_from_lib(fd);
+
                /* separate libraries from G.main */
                blo_split_main(&mainlist, G.main);
                /* add the library pointers in oldmap lookup */
index 3a9d0a6ae6a16cd611658fe33c86cf2886cb4df8..acedf51e6191f050d02e7e8c67f3d8bd12766661 100644 (file)
@@ -1130,6 +1130,19 @@ static void change_idid_adr(ListBase *mainlist, FileData *basefd, void *old, voi
        }
 }
 
+/* lib linked proxy objects point to our local data, we need
+ * to clear that pointer before reading the undo memfile since
+ * the object might be removed, it is set again in reading
+ * if the local object still exists */
+void blo_clear_proxy_pointers_from_lib(FileData *fd)
+{
+       Object *ob= G.main->object.first;
+       
+       for(;ob; ob= ob->id.next)
+               if(ob->id.lib)
+                       ob->proxy_from= NULL;
+}
+
 /* assumed; G.main still exists */
 void blo_make_image_pointer_map(FileData *fd)
 {
index 7ddb1e361da010cfde4ccaad36a356bae60ae9c9..8547a4d96523b6c6d82a230642ab15339bba514e 100644 (file)
@@ -112,6 +112,7 @@ FileData *blo_openblenderfile( char *name, BlendReadError *error_r);
 FileData *blo_openblendermemory( void *buffer, int buffersize, BlendReadError *error_r);
 FileData *blo_openblendermemfile(struct MemFile *memfile, BlendReadError *error_r);
 
+void blo_clear_proxy_pointers_from_lib(FileData *fd);
 void blo_make_image_pointer_map(FileData *fd);
 void blo_end_image_pointer_map(FileData *fd);
 void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd);
index 7dc1f966b71b950edb40ac60c6abb97066c6b9c3..745248d321861500b0ec69856e573a494bc44da8 100644 (file)
 #endif
 
 #ifdef WITH_REDCODE
-#include <redcode/format.h>
+#ifdef _WIN32 /* on windows we use the one in extern instead */
+#include "libredcode/format.h"
+#else
+#include "libredcode/format.h"
+#endif
 #endif
 
 #include "IMB_imbuf_types.h"
index 3d52a287a31d9bb24c5704f962a40d0e4d555660..534e4945aa34fd3dbd5e54d0c33a056c5a33562d 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <io.h>
+#define open _open
+#define read _read
+#define close _close
+#define write _write
 #endif
 #include "imbuf.h"
 #include "imbuf_patch.h"
index c0e84b73e47bb64c5bef4e24c5a047420dde12da..80bf401bec01e56d7cba827c6e8c7b0cde23a3e8 100644 (file)
 #endif
 
 #ifdef WITH_REDCODE
-#include <redcode/format.h>
-#include <redcode/codec.h>
+#ifdef _WIN32 /* on windows we use the ones in extern instead */
+#include "libredcode/format.h"
+#include "libredcode/codec.h"
+#else
+#include "libredcode/format.h"
+#include "libredcode/codec.h"
+#endif
 #endif
 
 /****/
index 566df53a25e6033ca261bc1a9bfdc7ed25206e0a..05e7921665bc2707fbda9fe2f59602a0bb52c976 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <io.h>
 #include <stddef.h>
 #include <sys/types.h>
 #include "mmap_win.h"
+#define open _open
+#define read _read
+#define close _close
 #endif
 
 #include "BLI_blenlib.h"
index cd58d9e4e960b5d87ce75d9dd578c3221a71f4b8..c86f9b017bf295392ca35b0c4b9300e79f8b2dc2 100644 (file)
  * $Id$
  */
 
+#ifdef _WIN32
+#include <io.h>
+#define open _open
+#define read _read
+#define close _close
+#endif
+
 #include "BLI_blenlib.h"
 
 #include "DNA_userdef_types.h"
@@ -65,6 +72,7 @@
 #include <ffmpeg/avcodec.h>
 #include <ffmpeg/avformat.h>
 //#include <ffmpeg/avdevice.h>
+#include <ffmpeg/log.h>
 
 #if LIBAVFORMAT_VERSION_INT < (49 << 16)
 #define FFMPEG_OLD_FRAME_RATE 1
@@ -230,6 +238,19 @@ static int isqtime (char *name) {
 #endif
 
 #ifdef WITH_FFMPEG
+
+void silence_log_ffmpeg(int quiet)
+{
+       if (quiet)
+       {
+               av_log_set_level(AV_LOG_QUIET);
+       }
+       else
+       {
+               av_log_set_level(AV_LOG_INFO);
+       }
+}
+
 extern void do_init_ffmpeg();
 void do_init_ffmpeg()
 {
@@ -238,6 +259,11 @@ void do_init_ffmpeg()
                ffmpeg_init = 1;
                av_register_all();
                //avdevice_register_all();
+               
+               if ((G.f & G_DEBUG) == 0)
+               {
+                       silence_log_ffmpeg(1);
+               }
        }
 }
 
@@ -256,7 +282,8 @@ static AVCodecContext* get_codec_from_stream(AVStream* stream)
 
 static int isffmpeg (char *filename) {
        AVFormatContext *pFormatCtx;
-       int            i, videoStream;
+       unsigned int i;
+       int videoStream;
        AVCodec *pCodec;
        AVCodecContext *pCodecCtx;
 
index aa3ef82a3e8f6d7af7c455e33069bc6850e12a4a..99a4398ec89c3fe010d05109658cd3f5170178fc 100644 (file)
@@ -244,7 +244,8 @@ static PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
        }
        if(value == NULL){  /* item not found in dict. throw exception */
                char* key_str = PyString_AsString( key );
-               if (key_str) {
+               
+               if (key_str==NULL) {
                        return EXPP_ReturnPyObjError(PyExc_KeyError, "bone key must be a string" );
                } else {
                        char buffer[128];
index 0dcdc36fdcdda1eed2483a1a31dfc73f7494b6fe..8aca111f41ff24f65656a451d8bfd7cd83b23221 100644 (file)
@@ -3549,7 +3549,7 @@ void logic_buts(void)
                if(ob->controllers.first) uiSetCurFont(block, UI_HELV);
                uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
                uiBlockEndAlign(block);
-               yco-=17;
+               yco-=20;
                
                /* mark all actuators linked to these controllers */
                /* note that some of these actuators could be from objects that are not in the display list.
index 5687651a6c5da4ce6a66e47e8f1f02d57d4b6e22..f1250c975fb894a2b9819434a8d21078f3f43885 100644 (file)
@@ -1468,10 +1468,9 @@ static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int
        uiDefButS(block, NUM, redraw,           "Cur:",         117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active color from the colorband");
        bt= uiDefBut(block, BUT, redraw,                "Del",          199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position");
        uiButSetFunc(bt, colorband_del_cb, coba, NULL);
-       uiDefButS(block, ROW, redraw,            "E",           236+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) ");
-       uiDefButS(block, ROW, redraw,           "C",            252+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal");
-       uiDefButS(block, ROW, redraw,           "L",            268+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear");
-       uiDefButS(block, ROW, redraw,           "S",            284+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline");
+       
+       uiDefButS(block, MENU, redraw,          "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
+               236+xoffs, 95+yoffs, 64, 20,            &coba->ipotype, 0.0, 0.0, 0, 0, "Sets interpolation type");
 
        uiDefBut(block, BUT_COLORBAND, redraw, "",      xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, "");
        
@@ -1506,11 +1505,10 @@ void draw_colorband_buts_small(uiBlock *block, ColorBand *coba, rctf *butr, int
        uiButSetFunc(bt, colorband_add_cb, coba, NULL);
        bt= uiDefBut(block, BUT, event, "Del",          xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20,     NULL, 0, 0, 0, 0, "Deletes the active position");
        uiButSetFunc(bt, colorband_del_cb, coba, NULL);
-       uiDefButS(block, ROW, event,            "E",            xs+10.0f*unit,butr->ymin+20.0f,unit,20,         &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) ");
-       uiDefButS(block, ROW, event,            "C",            xs+11.0f*unit,butr->ymin+20.0f,unit,20,         &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal");
-       uiDefButS(block, ROW, event,            "L",            xs+12.0f*unit,butr->ymin+20.0f,unit,20,         &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear");
-       uiDefButS(block, ROW, event,            "S",            xs+13.0f*unit,butr->ymin+20.0f,unit,20,         &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline");
-       
+
+       uiDefButS(block, MENU, event,           "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
+               xs+10.0f*unit, butr->ymin+20.0f, unit*4, 20,            &coba->ipotype, 0.0, 0.0, 0, 0, "Sets interpolation type");
+
        uiDefBut(block, BUT_COLORBAND, event, "",               xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, "");
        uiBlockEndAlign(block);
        
index 81d0ffeeb3bc4424214e3bb413b81e88828a3d8d..3dbbe7d73363a68daff6f19819a03eb30da7b10b 100644 (file)
@@ -1864,7 +1864,7 @@ void faceloop_select(EditEdge *startedge, int select)
                looking= 0;
                
                for(efa= em->faces.first; efa; efa= efa->next) {
-                       if(efa->e4 && efa->f1==0) {     /* not done quad */
+                       if(efa->h==0 && efa->e4 && efa->f1==0) {        /* not done quad */
                                if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { /* valence ok */
 
                                        /* if edge tagged, select opposing edge and mark face ok */
index 9decbd9a1ce8ab67b7b8f226e93db68eb2b37d69..7417218f2539a5e51552e8123cfe5b11d2b2f05e 100644 (file)
@@ -2153,7 +2153,7 @@ static int ui_act_as_text_but(uiBut *but)
                value = 0.0f; /* Zero out value on error */
                
                if(str[0]) 
-                       retval = 0;  /* invalidate return value if eval failed, except when string was null */
+                       retval = B_NOP;  /* invalidate return value if eval failed, except when string was null */
        }
 #else
        value=atof(str);
index 5f80a2c72279cc1d6b7ad9c7ad3ac0370343877c..b37087064cb22516d5d015fa626c09a35a77ec5e 100644 (file)
@@ -69,8 +69,6 @@
 
 #include "reeb.h"
 
-/* REPLACE WITH NEW ONE IN UTILDEFINES ONCE PATCH IS APPLIED */
-#define FTOCHAR(val) (val<=0.0f)? 0 : ((val>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*val)+0.5f))
 
 ReebGraph *GLOBAL_RG = NULL;
 ReebGraph *FILTERED_RG = NULL;
index e84d1aac3a797e3d05b8e4c3d2c1504f46353c45..ee6f19e457d00690b36c0c93664fbe2c802180b2 100644 (file)
@@ -143,6 +143,7 @@ IF(WIN32)
     COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
     COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
     COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
+    COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python25.zip\" \"${TARGETDIR}\\\"
   )
   
   FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR)
@@ -265,7 +266,8 @@ IF(UNIX)
     blender_python
     bf_quicktime
     extern_binreloc
-       extern_glew
+    extern_glew
+    bf_videotex
   )
 
   FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
index b858fa3754cc92866d0738b814d110b6de0680c7..6e5db1b56c1b8947bf41f2562c814924da6e3342 100644 (file)
@@ -70,6 +70,9 @@ public:
        BL_Texture * getTex (unsigned int idx) { 
                return (idx < MAXTEX) ? mTextures + idx : NULL; 
        }
+       Image * getImage (unsigned int idx) { 
+               return (idx < MAXTEX && mMaterial) ? mMaterial->img[idx] : NULL; 
+       }
 
        // for ipos
        void UpdateIPO(
index 1d3bc8c2058f89a78bdcd29ab0f9d4964a245215..51bc0f7d39f4ce657d4a4455be3bc4261371e3be 100644 (file)
@@ -35,7 +35,7 @@ DIR = $(OCGDIR)/gameengine
 DIRS = BlenderRoutines
 DIRS += Converter
 DIRS += Expressions GameLogic Ketsji Rasterizer SceneGraph
-DIRS += Network Physics
+DIRS += Network Physics VideoTexture
 
 ifeq ($(WITH_BF_BLENDERGAMEENGINE),true)
   DIRS += GamePlayer
index c576cebddc8aae6cf4592f257f3aff5b7576510a..3f939de6bc292bbf112321dfab05f9374843cb02 100644 (file)
@@ -24,7 +24,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #include <strstream>
 #include <fstream>
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 #include "Exception.h"
 
@@ -168,15 +168,15 @@ void Exception::setXptDesc (void)
                }
                // add result code
                // length of result code
-               const size_t rsltSize = 10;
+               const size_t rsltSize = 11;
                // delimit description
                const char delimRslt[] = ": ";
                // set text of description
                char rsltTxt[rsltSize];
                std::ostrstream os(rsltTxt, rsltSize);
-               os << std::hex << m_hRslt << delimRslt;
+               os << std::hex << m_hRslt << delimRslt << '\0';
                // copy result to description
-               m_desc.insert(0, rsltTxt, rsltSize);
+               m_desc.insert(0, rsltTxt);
                // copy exception description to last exception string
                m_lastError = m_desc;
        }
index 078a096aff7659283faf33eb75d598052a9466e1..b0112cd355b683ea7759d34eb18faa2aa7814e86 100644 (file)
@@ -22,7 +22,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 #include "FilterBase.h"
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 
index 1c9a2b46927e7d6c8a72683128ffe271e42f3eef..b6080f018d5108bea234d9dcee36c58aea353d55 100644 (file)
@@ -25,10 +25,16 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 #include "Common.h"
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 #include "PyTypeList.h"
 
+#define VT_C(v,idx)    ((unsigned char*)&v)[idx]
+#define VT_R(v)        ((unsigned char*)&v)[0]
+#define VT_G(v)        ((unsigned char*)&v)[1]
+#define VT_B(v)        ((unsigned char*)&v)[2]
+#define VT_A(v)        ((unsigned char*)&v)[3]
+#define VT_RGBA(v,r,g,b,a)     VT_R(v)=(unsigned char)r, VT_G(v)=(unsigned char)g, VT_B(v)=(unsigned char)b, VT_A(v)=(unsigned char)a
 
 // forward declaration
 class FilterBase;
index d911b1d7743e119c46a76f25c14a182fddd342b7..43d7566102a550792825a5f6e330f0e247c4631b 100644 (file)
@@ -21,7 +21,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 */
 
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "FilterBlueScreen.h"
@@ -125,10 +125,10 @@ static int setLimits (PyFilter * self, PyObject * value, void * closure)
 // attributes structure
 static PyGetSetDef filterBSGetSets[] =
 { 
-       {"color", (getter)getColor, (setter)setColor, "blue screen color", NULL},
-       {"limits", (getter)getLimits, (setter)setLimits, "blue screen color limits", NULL},
+       {(char*)"color", (getter)getColor, (setter)setColor, (char*)"blue screen color", NULL},
+       {(char*)"limits", (getter)getLimits, (setter)setLimits, (char*)"blue screen color limits", NULL},
        // attributes from FilterBase class
-       {"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, "previous pixel filter", NULL},
+       {(char*)"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, (char*)"previous pixel filter", NULL},
        {NULL}
 };
 
index 20660804f78e3ee29a25582816914c1222518d11..820e4a44501e73c86c6c3213ce6e7dd1810f35e6 100644 (file)
@@ -63,25 +63,24 @@ protected:
                short * size, unsigned int pixSize, unsigned int val)
        {
                // calculate differences
-               int difRed = int((val >> 16) & 0xFF) - int(m_color[0]);
-               int difGreen = int((val >> 8) & 0xFF) - int(m_color[1]);
-               int difBlue = int(val & 0xFF) - int(m_color[2]);
+               int difRed = int(VT_R(val)) - int(m_color[0]);
+               int difGreen = int(VT_G(val)) - int(m_color[1]);
+               int difBlue = int(VT_B(val)) - int(m_color[2]);
                // calc distance from "blue screen" color
                unsigned int dist = (unsigned int)(difRed * difRed + difGreen * difGreen
                        + difBlue * difBlue);
                // condition for fully transparent color
                if (m_squareLimits[0] >= dist) 
                        // return color with zero alpha
-                       //return 0xFF000000;
-                       return val & 0x00FFFFFF;
+                       VT_A(val) = 0;
                // condition for fully opaque color
                else if (m_squareLimits[1] <= dist)
                        // return normal colour
-                       return val | 0xFF000000;
+                       VT_A(val) = 0xFF;
                // otherwise calc alpha
                else
-                       return (val & 0x00FFFFFF) | ((((dist - m_squareLimits[0]) << 8)
-                       / m_limitDist) << 24);
+                       VT_A(val) = (((dist - m_squareLimits[0]) << 8) / m_limitDist);
+               return val;
        }
 
        /// virtual filtering function for byte source
index c45804caf9d9519810c77141e7ab5d9ba1f8b39e..22ee729b200f7bb3fc8767146cea3ff1e5f476e3 100644 (file)
@@ -21,7 +21,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 */
 
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "FilterColor.h"
@@ -34,7 +34,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 // attributes structure
 static PyGetSetDef filterGrayGetSets[] =
 { // attributes from FilterBase class
-       {"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, "previous pixel filter", NULL},
+       {(char*)"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, (char*)"previous pixel filter", NULL},
        {NULL}
 };
 
@@ -164,9 +164,9 @@ static int setMatrix (PyFilter * self, PyObject * value, void * closure)
 // attributes structure
 static PyGetSetDef filterColorGetSets[] =
 { 
-       {"matrix", (getter)getMatrix, (setter)setMatrix, "matrix [4][5] for color calculation", NULL},
+       {(char*)"matrix", (getter)getMatrix, (setter)setMatrix, (char*)"matrix [4][5] for color calculation", NULL},
        // attributes from FilterBase class
-       {"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, "previous pixel filter", NULL},
+       {(char*)"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, (char*)"previous pixel filter", NULL},
        {NULL}
 };
 
@@ -223,7 +223,7 @@ FilterLevel::FilterLevel (void)
        for (int r = 0; r < 4; ++r)
        {
                levels[r][0] = 0;
-               levels[r][1] = 0xFF << (r << 3);
+               levels[r][1] = 0xFF;
                levels[r][2] = 0xFF;
        }
 }
@@ -235,7 +235,7 @@ void FilterLevel::setLevels (ColorLevel & lev)
        for (int r = 0; r < 4; ++r)
        {
                for (int c = 0; c < 2; ++c)
-                       levels[r][c] = lev[r][c] << (r << 3);
+                       levels[r][c] = lev[r][c];
                levels[r][2] = lev[r][0] < lev[r][1] ? lev[r][1] - lev[r][0] : 1;
        }
 }
@@ -252,9 +252,9 @@ inline FilterLevel * getFilterLevel (PyFilter * self)
 static PyObject * getLevels (PyFilter * self, void * closure)
 {
        ColorLevel & lev = getFilterLevel(self)->getLevels();
-       return Py_BuildValue("((kk)(kk)(kk)(kk))",
-               lev[0][0], lev[0][1], lev[1][0] >> 8, lev[1][1] >> 8,
-               lev[2][0] >> 16, lev[2][1] >> 16, lev[3][0] >> 24, lev[3][1] >> 24);
+       return Py_BuildValue("((HH)(HH)(HH)(HH))",
+               lev[0][0], lev[0][1], lev[1][0], lev[1][1],
+               lev[2][0], lev[2][1], lev[3][0], lev[3][1]);
 }
 
 // set color levels
@@ -279,7 +279,7 @@ static int setLevels (PyFilter * self, PyObject * value, void * closure)
                        valid = PyInt_Check(PySequence_Fast_GET_ITEM(row, c));
                        // if it is valid, save it in matrix
                        if (valid)
-                               lev[r][c] = (unsigned long)(PyInt_AsLong(PySequence_Fast_GET_ITEM(row, c)));
+                               lev[r][c] = (unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(row, c)));
                }
        }
        // if parameter is not valid, report error
@@ -298,9 +298,9 @@ static int setLevels (PyFilter * self, PyObject * value, void * closure)
 // attributes structure
 static PyGetSetDef filterLevelGetSets[] =
 { 
-       {"levels", (getter)getLevels, (setter)setLevels, "levels matrix [4] (min, max)", NULL},
+       {(char*)"levels", (getter)getLevels, (setter)setLevels, (char*)"levels matrix [4] (min, max)", NULL},
        // attributes from FilterBase class
-       {"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, "previous pixel filter", NULL},
+       {(char*)"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, (char*)"previous pixel filter", NULL},
        {NULL}
 };
 
index ae2e98fa942ff5ef520971eaecb376343cdfedc2..b7e52c4521c3c6f954a4fb17dd810cb7304d53d5 100644 (file)
@@ -43,10 +43,13 @@ protected:
                short * size, unsigned int pixSize, unsigned int val)
        {
                // calculate gray value
-               unsigned int gray = (28 * ((val >> 16) & 0xFF) + 151 * ((val >> 8) & 0xFF)
-                       + 77 * (val & 0xFF)) & 0xFF00;
+               unsigned int gray = (28 * (VT_B(val)) + 151 * (VT_G(val))
+                       + 77 * (VT_R(val))) >> 8;
                // return gray scale value
-               return (val & 0xFF000000) | gray << 8 | gray | gray >> 8;
+               VT_R(val) = gray;
+               VT_G(val) = gray;
+               VT_B(val) = gray;
+               return val;
        }
 
        /// virtual filtering function for byte source
@@ -82,11 +85,11 @@ protected:
        ColorMatrix m_matrix;
 
        /// calculate one color component
-       unsigned int calcColor (unsigned int val, short idx)
+       unsigned char calcColor (unsigned int val, short idx)
        {
-               return (((m_matrix[idx][0]  * (val & 0xFF) + m_matrix[idx][1] * ((val >> 8) & 0xFF)
-                       + m_matrix[idx][2] * ((val >> 16) & 0xFF) + m_matrix[idx][3] * ((val >> 24) & 0xFF)
-                       + m_matrix[idx][4]) >> 8) & 0xFF) << (idx << 3);
+               return (((m_matrix[idx][0]  * (VT_R(val)) + m_matrix[idx][1] * (VT_G(val))
+                       + m_matrix[idx][2] * (VT_B(val)) + m_matrix[idx][3] * (VT_A(val))
+                       + m_matrix[idx][4]) >> 8) & 0xFF);
        }
 
        /// filter pixel template, source int buffer
@@ -94,8 +97,9 @@ protected:
                short * size, unsigned int pixSize, unsigned int val)
        {
                // return calculated color
-               return calcColor(val, 0) | calcColor(val, 1) | calcColor(val, 2)
-                       | calcColor(val, 3);
+               int color;
+               VT_RGBA(color, calcColor(val, 0), calcColor(val, 1), calcColor(val, 2), calcColor(val, 3));
+               return color;
        }
 
        /// virtual filtering function for byte source
@@ -110,7 +114,7 @@ protected:
 
 
 /// type for color levels
-typedef unsigned long ColorLevel[4][3];
+typedef unsigned short ColorLevel[4][3];
 
 /// pixel filter for color calculation
 class FilterLevel : public FilterBase
@@ -133,11 +137,10 @@ protected:
        /// calculate one color component
        unsigned int calcColor (unsigned int val, short idx)
        {
-               unsigned int col = val & (0xFF << (idx << 3));
+               unsigned int col = VT_C(val,idx);;
                if (col <= levels[idx][0]) col = 0;
-               else if (col >= levels[idx][1]) col = 0xFF << (idx << 3);
-               else if (idx < 3) col = (((col - levels[idx][0]) << 8) / levels[idx][2]) & (0xFF << (idx << 3));
-               else col = (((col - levels[idx][0]) / levels[idx][2]) << 8) & (0xFF << (idx << 3));
+               else if (col >= levels[idx][1]) col = 0xFF;
+               else col = (((col - levels[idx][0]) << 8) / levels[idx][2]) & 0xFF;
                return col; 
        }
 
@@ -146,8 +149,9 @@ protected:
                short * size, unsigned int pixSize, unsigned int val)
        {
                // return calculated color
-               return calcColor(val, 0) | calcColor(val, 1) | calcColor(val, 2)
-                       | calcColor(val, 3);
+               int color;
+               VT_RGBA(color, calcColor(val, 0), calcColor(val, 1), calcColor(val, 2), calcColor(val, 3));
+               return color;
        }
 
        /// virtual filtering function for byte source
index 5eeb63b7128a8d2f931775c60d89fbd2c74ca2c2..03a79c1c8ce95eaf7d3f2d866ae72632af06ea8d 100644 (file)
@@ -21,7 +21,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 */
 
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "FilterNormal.h"
@@ -32,7 +32,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 // implementation FilterNormal
 
 // constructor
-FilterNormal::FilterNormal (void) : m_colShift(0)
+FilterNormal::FilterNormal (void) : m_colIdx(0)
 {
        // set default depth
        setDepth(4);
@@ -44,7 +44,7 @@ void FilterNormal::setColor (unsigned short colIdx)
        // check validity of index
        if (colIdx < 3)
                // set color shift
-               m_colShift = colIdx << 3;
+               m_colIdx = colIdx;
 }
 
 // set depth
@@ -109,10 +109,10 @@ static int setDepth (PyFilter * self, PyObject * value, void * closure)
 // attributes structure
 static PyGetSetDef filterNormalGetSets[] =
 { 
-       {"colorIdx", (getter)getColor, (setter)setColor, "index of color used to calculate normal (0 - red, 1 - green, 2 - blue)", NULL},
-       {"depth", (getter)getDepth, (setter)setDepth, "depth of relief", NULL},
+       {(char*)"colorIdx", (getter)getColor, (setter)setColor, (char*)"index of color used to calculate normal (0 - red, 1 - green, 2 - blue)", NULL},
+       {(char*)"depth", (getter)getDepth, (setter)setDepth, (char*)"depth of relief", NULL},
        // attributes from FilterBase class
-       {"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, "previous pixel filter", NULL},
+       {(char*)"previous", (getter)Filter_getPrevious, (setter)Filter_setPrevious, (char*)"previous pixel filter", NULL},
        {NULL}
 };
 
index ec51ca39db9710fd2273807cf2be438ded1c67fe..840043be9a133c02eb99b045f814049a3776aa83 100644 (file)
@@ -43,7 +43,7 @@ public:
        virtual ~FilterNormal (void) {}
 
        /// get index of color used to calculate normals
-       unsigned short getColor (void) { return m_colShift >> 3; }
+       unsigned short getColor (void) { return m_colIdx; }
        /// set index of color used to calculate normals
        void setColor (unsigned short colIdx);
 
@@ -58,20 +58,28 @@ protected:
        /// scale to calculate normals
        float m_depthScale;
 
-       /// shift to used color component
-       unsigned short m_colShift;
+       /// color index, 0=red, 1=green, 2=blue, 3=alpha
+       unsigned short m_colIdx;
 
        /// filter pixel, source int buffer
        template <class SRC> unsigned int tFilter (SRC * src, short x, short y,
                short * size, unsigned int pixSize, unsigned int val = 0)
        {
                // get value of required color
-               int actPix = int((val >> m_colShift) & 0xFF);
+               int actPix = int(VT_C(val,m_colIdx));
+               int upPix = actPix;
+               int leftPix = actPix;
                // get upper and left pixel from actual pixel
-               int upPix = y > 0 ? int((convertPrevious(src - pixSize * size[0], x, y - 1,
-                       size, pixSize) >> m_colShift) & 0xFF) : actPix;
-               int leftPix = x > 0 ? int((convertPrevious(src - pixSize, x - 1, y, size, pixSize)
-                       >> m_colShift) & 0xFF) : actPix;
+               if (y > 0)
+               {
+                       val = convertPrevious(src - pixSize * size[0], x, y - 1, size, pixSize);
+                       upPix = VT_C(val,m_colIdx);
+               }
+               if (x > 0)
+               {
+                       val = convertPrevious(src - pixSize, x - 1, y, size, pixSize);
+                       leftPix = VT_C(val,m_colIdx);
+               }
                // height differences (from blue color)
                float dx = (actPix - leftPix) * m_depthScale;
                float dy = (actPix - upPix) * m_depthScale;
@@ -81,7 +89,8 @@ protected:
                dy = dy * dz + normScaleKoef;
                dz += normScaleKoef;
                // return normal vector converted to color
-               return 0xFF000000 | int(dz) << 16 | int(dy) << 8 | int(dx);
+               VT_RGBA(val, dx, dy, dz, 0xFF);
+               return val;
        }
 
        /// filter pixel, source byte buffer
index 4b96a9792e28cced2b348e7a600ff706a35a9577..f3676e93a6d6665ec6aa849c176e7cd6a5d4bfbd 100644 (file)
@@ -22,7 +22,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 // implementation
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "FilterSource.h"
@@ -77,6 +77,52 @@ PyTypeObject FilterRGB24Type =
        Filter_allocNew,           /* tp_new */
 };
 
+// FilterRGBA32
+
+// define python type
+PyTypeObject FilterRGBA32Type =
+{ 
+       PyObject_HEAD_INIT(NULL)
+       0,                         /*ob_size*/
+       "VideoTexture.FilterRGBA32",   /*tp_name*/
+       sizeof(PyFilter),          /*tp_basicsize*/
+       0,                         /*tp_itemsize*/
+       (destructor)Filter_dealloc,/*tp_dealloc*/
+       0,                         /*tp_print*/
+       0,                         /*tp_getattr*/
+       0,                         /*tp_setattr*/
+       0,                         /*tp_compare*/
+       0,                         /*tp_repr*/
+       0,                         /*tp_as_number*/
+       0,                         /*tp_as_sequence*/
+       0,                         /*tp_as_mapping*/
+       0,                         /*tp_hash */
+       0,                         /*tp_call*/
+       0,                         /*tp_str*/
+       0,                         /*tp_getattro*/
+       0,                         /*tp_setattro*/
+       0,                         /*tp_as_buffer*/
+       Py_TPFLAGS_DEFAULT,        /*tp_flags*/
+       "Source filter RGBA32 objects",       /* tp_doc */
+       0,                             /* tp_traverse */
+       0,                             /* tp_clear */
+       0,                             /* tp_richcompare */
+       0,                             /* tp_weaklistoffset */
+       0,                             /* tp_iter */
+       0,                             /* tp_iternext */
+       NULL,                /* tp_methods */
+       0,                   /* tp_members */
+       NULL,             /* tp_getset */
+       0,                         /* tp_base */
+       0,                         /* tp_dict */
+       0,                         /* tp_descr_get */
+       0,                         /* tp_descr_set */
+       0,                         /* tp_dictoffset */
+       (initproc)Filter_init<FilterRGBA32>,     /* tp_init */
+       0,                         /* tp_alloc */
+       Filter_allocNew,           /* tp_new */
+};
+
 // FilterBGR24
 
 // define python type
index 7bed5c77a4da340d15f52beb1943baa87305d1c4..7e90747d2522f5ae6fdeb93b29291eeb5ab86704 100644 (file)
@@ -44,9 +44,35 @@ protected:
        /// filter pixel, source byte buffer
        virtual unsigned int filter (unsigned char * src, short x, short y,
                short * size, unsigned int pixSize, unsigned int val)
-       { return 0xFF000000 | src[0] << 16 | src[1] << 8 | src[2]; }
+       { VT_RGBA(val,src[0],src[1],src[2],0xFF); return val; }
 };
 
+/// class for RGBA32 conversion
+class FilterRGBA32 : public FilterBase
+{
+public:
+       /// constructor
+       FilterRGBA32 (void) {}
+       /// destructor
+       virtual ~FilterRGBA32 (void) {}
+
+       /// get source pixel size
+       virtual unsigned int getPixelSize (void) { return 4; }
+
+protected:
+       /// filter pixel, source byte buffer
+       virtual unsigned int filter (unsigned char * src, short x, short y,
+               short * size, unsigned int pixSize, unsigned int val)
+       { 
+               if ((intptr_t(src)&0x3) == 0) 
+                       return *(unsigned int*)src;
+               else 
+               {
+                       VT_RGBA(val,src[0],src[1],src[2],src[3]); 
+                       return val; 
+               }
+       }
+};
 
 /// class for BGR24 conversion
 class FilterBGR24 : public FilterBase
@@ -64,10 +90,9 @@ protected:
        /// filter pixel, source byte buffer
        virtual unsigned int filter (unsigned char * src, short x, short y,
                short * size, unsigned int pixSize, unsigned int val)
-       { return 0xFF000000 | src[2] << 16 | src[1] << 8 | src[0]; }
+       { VT_RGBA(val,src[2],src[1],src[0],0xFF); return val; }
 };
 
-
 /// class for YV12 conversion
 class FilterYV12 : public FilterBase
 {
@@ -217,15 +242,15 @@ protected:
                int red = (298 * c + 409 * e + 128) >> 8;
                if (red >= 0x100) red = 0xFF;
                else if (red < 0) red = 0;
-               int green = 298 * c - 100 * d - 208 * e;
-               if (green > 0x10000) green = 0xFF00;
+               int green = (298 * c - 100 * d - 208 * e) >> 8;
+               if (green >= 0x100) green = 0xFF;
                else if (green < 0) green = 0;
-               int blue = (298 * c + 516 * d + 128) << 8;
-               if (blue > 0x1000000) blue = 0xFF0000;
+               int blue = (298 * c + 516 * d + 128) >> 8;
+               if (blue >= 0x100) blue = 0xFF;
                else if (blue < 0) blue = 0;
                // return result
-               return 0xFF000000 | blue & 0xFF0000 | green & 0xFF00
-                       | red & 0xFF;
+               VT_RGBA(val, red, green, blue, 0xFF);
+               return val;
        }
 };
 
index d2e980d979a5d299b650440c10d36ec52c1537e0..dcca20de24aa4dded84a6752e5c6d6de91862c3f 100644 (file)
@@ -25,7 +25,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #include <vector>
 #include <string.h>
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "FilterBase.h"
index 2b923a06ee3b8a8c55ed78eddae8330995eb0a99..138580ce701151e20f84c1b31c34eb3dee8e99d7 100644 (file)
@@ -26,7 +26,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #include "Common.h"
 
 #include <vector>
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 #include "PyTypeList.h"
 
index f09514a36f0c76c81907ca35bb3d9f81d950bff2..19ad17ac64326cd09dad2eb6e2707d0752266160 100644 (file)
@@ -22,7 +22,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 // implementation
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "ImageBuff.h"
@@ -32,7 +32,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 
 // default filter
-FilterBGR24 defFilter;
+FilterRGB24 defFilter;
 
 
 // load image from buffer
@@ -111,11 +111,11 @@ static PyMethodDef imageBuffMethods[] =
 // attributes structure
 static PyGetSetDef imageBuffGetSets[] =
 {      // attributes from ImageBase class
-       {"image", (getter)Image_getImage, NULL, "image data", NULL},
-       {"size", (getter)Image_getSize, NULL, "image size", NULL},
-       {"scale", (getter)Image_getScale, (setter)Image_setScale, "fast scale of image (near neighbour)", NULL},
-       {"flip", (getter)Image_getFlip, (setter)Image_setFlip, "flip image vertically", NULL},
-       {"filter", (getter)Image_getFilter, (setter)Image_setFilter, "pixel filter", NULL},
+       {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
+       {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
+       {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL},
+       {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL},
+       {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL},
        {NULL}
 };
 
index 71250005129fbc70127342a6657ae31b9d7f4d02..b07b362818cf968511a9062c280bdb4af18331af 100644 (file)
@@ -22,7 +22,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 // implementation
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include "ImageMix.h"
@@ -150,11 +150,11 @@ static PyMethodDef imageMixMethods[] =
 // attributes structure
 static PyGetSetDef imageMixGetSets[] =
 { // attributes from ImageBase class
-       {"image", (getter)Image_getImage, NULL, "image data", NULL},
-       {"size", (getter)Image_getSize, NULL, "image size", NULL},
-       {"scale", (getter)Image_getScale, (setter)Image_setScale, "fast scale of image (near neighbour)", NULL},
-       {"flip", (getter)Image_getFlip, (setter)Image_setFlip, "flip image vertically", NULL},
-       {"filter", (getter)Image_getFilter, (setter)Image_setFilter, "pixel filter", NULL},
+       {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
+       {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
+       {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL},
+       {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL},
+       {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL},
        {NULL}
 };
 
index ce27a24d35a39f0ab86ea2cf599ca53bbd07b98c..2f2d9debd48451ba51506a04ff42ddcf965d9ee5 100644 (file)
@@ -22,7 +22,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 // implementation
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include <KX_BlenderCanvas.h>
@@ -207,13 +207,13 @@ static PyMethodDef imageRenderMethods[] =
 // attributes structure
 static PyGetSetDef imageRenderGetSets[] =
 { 
-       {"background", (getter)getBackground, (setter)setBackground, "background color", NULL},
+       {(char*)"background", (getter)getBackground, (setter)setBackground, (char*)"background color", NULL},
        // attributes from ImageBase class
-       {"image", (getter)Image_getImage, NULL, "image data", NULL},
-       {"size", (getter)Image_getSize, NULL, "image size", NULL},
-       {"scale", (getter)Image_getScale, (setter)Image_setScale, "fast scale of image (near neighbour)",       NULL},
-       {"flip", (getter)Image_getFlip, (setter)Image_setFlip, "flip image vertically", NULL},
-       {"filter", (getter)Image_getFilter, (setter)Image_setFilter, "pixel filter", NULL},
+       {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
+       {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
+       {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL},
+       {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL},
+       {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL},
        {NULL}
 };
 
index e1d3316a43e8db2627036b2d4c3a6d1be3260d93..deb66ffb6ba4500d783dae579b38f02ed8d89756 100644 (file)
@@ -22,16 +22,15 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 // implementation
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
-#include "ImageViewport.h"
-
 #include <BIF_gl.h>
 
 #include "Texture.h"
 #include "ImageBase.h"
 #include "FilterSource.h"
+#include "ImageViewport.h"
 
 
 // constructor
@@ -81,7 +80,7 @@ void ImageViewport::setCaptureSize (short * size)
                if (size[idx] < 1)
                        m_capSize[idx] = 1;
                else if (size[idx] > getViewportSize()[idx])
-                       m_capSize[idx] = getViewportSize()[idx];
+                       m_capSize[idx] = short(getViewportSize()[idx]);
                else
                        m_capSize[idx] = size[idx];
        }
@@ -91,7 +90,7 @@ void ImageViewport::setCaptureSize (short * size)
 }
 
 // set position of capture rectangle
-void ImageViewport::setPosition (int * pos)
+void ImageViewport::setPosition (GLint * pos)
 {
        // if new position is not provided, use existing position
        if (pos == NULL) pos = m_position;
@@ -125,7 +124,7 @@ void ImageViewport::calcImage (unsigned int texId)
        {
                // just copy current viewport to texture
                glBindTexture(GL_TEXTURE_2D, texId);
-               glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_upLeft[0], m_upLeft[1], m_capSize[0], m_capSize[1]);
+               glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1]);
                // image is not available
                m_avail = false;
        }
@@ -133,10 +132,10 @@ void ImageViewport::calcImage (unsigned int texId)
        else if (!m_avail)
        {
                // get frame buffer data
-               glReadPixels(m_upLeft[0], m_upLeft[1], m_capSize[0], m_capSize[1], GL_RGB,
+               glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB,
                        GL_UNSIGNED_BYTE, m_viewportImage);
                // filter loaded data
-               FilterBGR24 filt;
+               FilterRGB24 filt;
                filterImage(filt, m_viewportImage, m_capSize);
        }
 }
@@ -193,9 +192,9 @@ static int ImageViewport_setPosition (PyImage * self, PyObject * value, void * c
                return -1;
        }
        // set position
-       int pos [] = {
-               int(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))),
-                       int(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1)))
+       GLint pos [] = {
+               GLint(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))),
+                       GLint(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1)))
        };
        getImageViewport(self)->setPosition(pos);
        // success
@@ -240,15 +239,15 @@ static PyMethodDef imageViewportMethods[] =
 // attributes structure
 static PyGetSetDef imageViewportGetSets[] =
 { 
-       {"whole", (getter)ImageViewport_getWhole, (setter)ImageViewport_setWhole, "use whole viewport to capture", NULL},
-       {"position", (getter)ImageViewport_getPosition, (setter)ImageViewport_setPosition, "upper left corner of captured area", NULL},
-       {"capsize", (getter)ImageViewport_getCaptureSize, (setter)ImageViewport_setCaptureSize, "size of viewport area being captured", NULL},
+       {(char*)"whole", (getter)ImageViewport_getWhole, (setter)ImageViewport_setWhole, (char*)"use whole viewport to capture", NULL},
+       {(char*)"position", (getter)ImageViewport_getPosition, (setter)ImageViewport_setPosition, (char*)"upper left corner of captured area", NULL},
+       {(char*)"capsize", (getter)ImageViewport_getCaptureSize, (setter)ImageViewport_setCaptureSize, (char*)"size of viewport area being captured", NULL},
        // attributes from ImageBase class
-       {"image", (getter)Image_getImage, NULL, "image data", NULL},
-       {"size", (getter)Image_getSize, NULL, "image size", NULL},
-       {"scale", (getter)Image_getScale, (setter)Image_setScale, "fast scale of image (near neighbour)", NULL},
-       {"flip", (getter)Image_getFlip, (setter)Image_setFlip, "flip image vertically", NULL},
-       {"filter", (getter)Image_getFilter, (setter)Image_setFilter, "pixel filter", NULL},
+       {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
+       {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
+       {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL},
+       {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL},
+       {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL},
        {NULL}
 };
 
index 9fd3aeb7ba9bfdde786be881d3eb4ff41f3cd462..4265906b8f57d4143b74c564b69fcb6bfdcd69d6 100644 (file)
@@ -49,13 +49,13 @@ public:
        void setCaptureSize (short * size = NULL);
 
        /// get position in viewport
-       int * getPosition (void) { return m_position; }
+       GLint * getPosition (void) { return m_position; }
        /// set position in viewport
-       void setPosition (int * pos = NULL);
+       void setPosition (GLint * pos = NULL);
 
 protected:
        /// frame buffer rectangle
-       int m_viewport[4];
+       GLint m_viewport[4];
 
        /// size of captured area
        short m_capSize[2];
@@ -63,9 +63,9 @@ protected:
        bool m_whole;
 
        /// position of capture rectangle in viewport
-       int m_position[2];
+       GLint m_position[2];
        /// upper left point for capturing
-       int m_upLeft[2];
+       GLint m_upLeft[2];
 
        /// buffer to copy viewport
        BYTE * m_viewportImage;
@@ -76,7 +76,7 @@ protected:
        virtual void calcImage (unsigned int texId);
 
        /// get viewport size
-       int * getViewportSize (void) { return m_viewport + 2; }
+       GLint * getViewportSize (void) { return m_viewport + 2; }
 };
 
 
index b8c40052e8191f307f27cb996601236806f00335..6d2676dce09b139c8e6aeb1d741fc57e21ce3a96 100644 (file)
@@ -26,7 +26,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #include <memory>
 #include <vector>
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 
 /// check, if type is in list
@@ -78,6 +78,6 @@ void PyTypeList::reg (PyObject * module)
                        // increase ref count
                        Py_INCREF((*it)->getType());
                        // add type to module
-                       PyModule_AddObject(module, (*it)->getName(), (PyObject*)(*it)->getType());
+                       PyModule_AddObject(module, (char*)(*it)->getName(), (PyObject*)(*it)->getType());
                }
 }
index 736fc9aaefd5c57aecb7c145b091c4c5e10ee972..4daf88bfa19efd2dfda729d655ec5fc74b06dd73 100644 (file)
@@ -28,7 +28,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #include <memory>
 #include <vector>
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 // forward declaration
 class PyTypeListItem;
index bf8d7c133ff7af0dad625e81278c438a293c79cc..f3fe0dab6ad835abd8d3f4a6b75810c27b33f92f 100644 (file)
@@ -21,7 +21,6 @@ if env['OURPLATFORM'] == 'win32-vc':
        cflags.append('/GR')
        cflags.append('/Ox')
 
-incs += ' ' + env['BF_PYTHON'] + '/lib/python' + env['BF_PYTHON_VERSION'] + "/site-packages/numpy/core/include"
 incs += ' ' + env['BF_PYTHON_INC']
 #incs += ' ' + env['BF_OPENGL_INC']
 
index ea3f60b2775b7b806ae84b1622bc893c30421ffc..88a26e3c0884eb21b93f478e92d8750254d80b35 100644 (file)
@@ -22,7 +22,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 
 // implementation
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include <KX_GameObject.h>
@@ -54,9 +54,6 @@ http://www.gnu.org/copyleft/lesser.txt.
 { exp.report(); }
 
 
-// are Blender materials used
-bool blendMats = false;
-
 // Blender GameObject type
 BlendType<KX_GameObject> gameObjectType ("KX_GameObject");
 
@@ -198,15 +195,22 @@ int Texture_init (Texture *self, PyObject *args, PyObject *kwds)
                        if (mat != NULL)
                        {
                                // is it blender material or polygon material
-                               blendMats = (mat->GetFlag() & RAS_BLENDERMAT) != 0;
-                               if (blendMats)
+                               if (mat->GetFlag() & RAS_BLENDERGLSL) 
+                               {
+                                       self->m_imgTexture = static_cast<KX_BlenderMaterial*>(mat)->getImage(texID);
+                                       self->m_useMatTexture = false;
+                               } else if (mat->GetFlag() & RAS_BLENDERMAT)
+                               {
                                        // get blender material texture
                                        self->m_matTexture = static_cast<KX_BlenderMaterial*>(mat)->getTex(texID);
+                                       self->m_useMatTexture = true;
+                               }
                                else
                                {
                                        // get texture pointer from polygon material
                                        MTFace * tface = static_cast<KX_PolygonMaterial*>(mat)->GetMTFace();
                                        self->m_imgTexture = (Image*)tface->tpage;
+                                       self->m_useMatTexture = false;
                                }
                        }
                        // check if texture is available, if not, initialization failed
@@ -246,7 +250,7 @@ PyObject * Texture_close(Texture * self)
        {
                self->m_orgSaved = false;
                // restore original texture code
-               if (blendMats)
+               if (self->m_useMatTexture)
                        self->m_matTexture->swapTexture(self->m_orgTex);
                else
                        self->m_imgTexture->bindcode = self->m_orgTex;
@@ -292,7 +296,7 @@ PyObject * Texture_refresh (Texture * self, PyObject * args)
                                {
                                        self->m_orgSaved = true;
                                        // save original image code
-                                       if (blendMats)
+                                       if (self->m_useMatTexture)
                                                self->m_orgTex = self->m_matTexture->swapTexture(self->m_actTex);
                                        else
                                        {
@@ -412,8 +416,8 @@ static PyMethodDef textureMethods[] =
 // class Texture attributes
 static PyGetSetDef textureGetSets[] =
 { 
-       {"source", (getter)Texture_getSource, (setter)Texture_setSource, "source of texture", NULL},
-       {"mipmap", (getter)Texture_getMipmap, (setter)Texture_setMipmap, "mipmap texture", NULL},
+       {(char*)"source", (getter)Texture_getSource, (setter)Texture_setSource, (char*)"source of texture", NULL},
+       {(char*)"mipmap", (getter)Texture_getMipmap, (setter)Texture_setMipmap, (char*)"mipmap texture", NULL},
        {NULL}
 };
 
index f19f8da607dcdc8f0ac4d88955fe7397a810fe3d..3c371e51537c31bc8299f21a7a950ada996fdfa8 100644 (file)
@@ -23,7 +23,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #if !defined TEXTURE_H
 #define TEXTURE_H
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 #include <structmember.h>
 
 #include <DNA_image_types.h>
@@ -39,9 +39,11 @@ struct Texture
 {
        PyObject_HEAD
 
+       // texture is using blender material
+       bool m_useMatTexture;
+
        // video texture bind code
        unsigned int m_actTex;
-
        // original texture bind code
        unsigned int m_orgTex;
        // original texture saved
@@ -70,9 +72,6 @@ struct Texture
 // Texture type description
 extern PyTypeObject TextureType;
 
-// usage of Blender materials
-extern bool blendMats;
-
 // load texture
 void loadTexture (unsigned int texId, unsigned int * texture, short * size,
                                  bool mipmap = false);
index 78e8ba65909cffc84ae85ae793368febf249b71d..5bb635e1f19313bd55bd7d541b9be532896c2b5f 100644 (file)
@@ -24,7 +24,7 @@ http://www.gnu.org/copyleft/lesser.txt.
 #define VIDEOBASE_H
 
 
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 #include "ImageBase.h"
 
index 272d2695c4b38e3e099f47c2b882e91d70149433..91b8a54dd8643c92536612c50d53206004abede0 100644 (file)
@@ -20,6 +20,11 @@ http://www.gnu.org/copyleft/lesser.txt.
 -----------------------------------------------------------------------------
 */
 
+// INT64_C fix for some linux machines (C99ism)
+#define __STDC_CONSTANT_MACROS
+#include <stdint.h>
+
+
 #include "MEM_guardedalloc.h"
 #include "PIL_time.h"
 
@@ -46,7 +51,7 @@ extern "C" void do_init_ffmpeg();
 // constructor
 VideoFFmpeg::VideoFFmpeg (HRESULT * hRslt) : VideoBase(), 
 m_codec(NULL), m_formatCtx(NULL), m_codecCtx(NULL), 
-m_frame(NULL), m_frameDeinterlaced(NULL), m_frameBGR(NULL), m_imgConvertCtx(NULL),
+m_frame(NULL), m_frameDeinterlaced(NULL), m_frameRGB(NULL), m_imgConvertCtx(NULL),
 m_deinterlace(false), m_preseek(0),    m_videoStream(-1), m_baseFrameRate(25.0),
 m_lastFrame(-1),  m_curPosition(-1), m_startTime(0), 
 m_captWidth(0), m_captHeight(0), m_captRate(0.f)
@@ -86,10 +91,10 @@ bool VideoFFmpeg::release()
                MEM_freeN(m_frameDeinterlaced->data[0]);
                av_free(m_frameDeinterlaced);
        }
-       if (m_frameBGR)
+       if (m_frameRGB)
        {
-               MEM_freeN(m_frameBGR->data[0]);
-               av_free(m_frameBGR);
+               MEM_freeN(m_frameRGB->data[0]);
+               av_free(m_frameRGB);
        }
        if (m_imgConvertCtx)
        {
@@ -101,7 +106,7 @@ bool VideoFFmpeg::release()
        m_formatCtx = NULL;
        m_frame = NULL;
        m_frame = NULL;
-       m_frameBGR = NULL;
+       m_frameRGB = NULL;
        m_imgConvertCtx = NULL;
 
        // object will be deleted after that
@@ -184,7 +189,7 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
        m_videoStream = videoStream;
        m_frame = avcodec_alloc_frame();
        m_frameDeinterlaced = avcodec_alloc_frame();
-       m_frameBGR = avcodec_alloc_frame();
+       m_frameRGB = avcodec_alloc_frame();
 
 
        // allocate buffer if deinterlacing is required
@@ -196,12 +201,12 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
                m_codecCtx->pix_fmt, m_codecCtx->width, m_codecCtx->height);
 
        // allocate buffer to store final decoded frame
-       avpicture_fill((AVPicture*)m_frameBGR
+       avpicture_fill((AVPicture*)m_frameRGB
                (uint8_t*)MEM_callocN(avpicture_get_size(
-               PIX_FMT_BGR24,
+               PIX_FMT_RGB24,
                m_codecCtx->width, m_codecCtx->height),
-               "ffmpeg bgr"),
-               PIX_FMT_BGR24, m_codecCtx->width, m_codecCtx->height);
+               "ffmpeg rgb"),
+               PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
        // allocate sws context
        m_imgConvertCtx = sws_getContext(
                m_codecCtx->width,
@@ -209,7 +214,7 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
                m_codecCtx->pix_fmt,
                m_codecCtx->width,
                m_codecCtx->height,
-               PIX_FMT_BGR24,
+               PIX_FMT_RGB24,
                SWS_FAST_BILINEAR,
                NULL, NULL, NULL);
 
@@ -219,8 +224,8 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
                av_free(m_frame);
                MEM_freeN(m_frameDeinterlaced->data[0]);
                av_free(m_frameDeinterlaced);
-               MEM_freeN(m_frameBGR->data[0]);
-               av_free(m_frameBGR);
+               MEM_freeN(m_frameRGB->data[0]);
+               av_free(m_frameRGB);
                return -1;
        }
        return 0;
@@ -560,14 +565,14 @@ bool VideoFFmpeg::grabFrame(long position)
                                                input = m_frameDeinterlaced;
                                        }
                                }
-                               // convert to BGR24
+                               // convert to RGB24
                                sws_scale(m_imgConvertCtx,
                                        input->data,
                                        input->linesize,
                                        0,
                                        m_codecCtx->height,
-                                       m_frameBGR->data,
-                                       m_frameBGR->linesize);
+                                       m_frameRGB->data,
+                                       m_frameRGB->linesize);
                                av_free_packet(&packet);
                                frameLoaded = true;
                                break;
@@ -687,18 +692,18 @@ static PyMethodDef videoMethods[] =
 // attributes structure
 static PyGetSetDef videoGetSets[] =
 { // methods from VideoBase class
-       {"status", (getter)Video_getStatus, NULL, "video status", NULL},
-       {"range", (getter)Video_getRange, (setter)Video_setRange, "replay range", NULL},
-       {"repeat", (getter)Video_getRepeat, (setter)Video_setRepeat, "repeat count, -1 for infinite repeat", NULL},
-       {"framerate", (getter)Video_getFrameRate, (setter)Video_setFrameRate, "frame rate", NULL},
+       {(char*)"status", (getter)Video_getStatus, NULL, (char*)"video status", NULL},
+       {(char*)"range", (getter)Video_getRange, (setter)Video_setRange, (char*)"replay range", NULL},
+       {(char*)"repeat", (getter)Video_getRepeat, (setter)Video_setRepeat, (char*)"repeat count, -1 for infinite repeat", NULL},
+       {(char*)"framerate", (getter)Video_getFrameRate, (setter)Video_setFrameRate, (char*)"frame rate", NULL},
        // attributes from ImageBase class
-       {"image", (getter)Image_getImage, NULL, "image data", NULL},
-       {"size", (getter)Image_getSize, NULL, "image size", NULL},
-       {"scale", (getter)Image_getScale, (setter)Image_setScale, "fast scale of image (near neighbour)", NULL},
-       {"flip", (getter)Image_getFlip, (setter)Image_setFlip, "flip image vertically", NULL},
-       {"filter", (getter)Image_getFilter, (setter)Image_setFilter, "pixel filter", NULL},
-       {"preseek", (getter)VideoFFmpeg_getPreseek, (setter)VideoFFmpeg_setPreseek, "nb of frames of preseek", NULL},
-       {"deinterlace", (getter)VideoFFmpeg_getDeinterlace, (setter)VideoFFmpeg_setDeinterlace, "deinterlace image", NULL},
+       {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
+       {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
+       {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL},
+       {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL},
+       {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL},
+       {(char*)"preseek", (getter)VideoFFmpeg_getPreseek, (setter)VideoFFmpeg_setPreseek, (char*)"nb of frames of preseek", NULL},
+       {(char*)"deinterlace", (getter)VideoFFmpeg_getDeinterlace, (setter)VideoFFmpeg_setDeinterlace, (char*)"deinterlace image", NULL},
        {NULL}
 };
 
index 4720bef1841b64db5de7910a169f5520ab2eca20..3903116c82c496b78ea02cdfcf7b856bb3a5b81c 100644 (file)
@@ -100,7 +100,7 @@ protected:
        // deinterlaced frame if codec requires it
        AVFrame *m_frameDeinterlaced;
        // decoded RGB24 frame if codec requires it
-       AVFrame *m_frameBGR;
+       AVFrame *m_frameRGB;
        // conversion from raw to RGB is done with sws_scale
        struct SwsContext *m_imgConvertCtx;
        // should the codec be deinterlaced?
@@ -150,7 +150,7 @@ protected:
        bool grabFrame(long frame);
 
        /// return the frame in RGB24 format, the image data is found in AVFrame.data[0]
-       AVFrame* getFrame(void) { return m_frameBGR; }
+       AVFrame* getFrame(void) { return m_frameRGB; }
 };
 
 inline VideoFFmpeg * getFFmpeg (PyImage * self) 
index d08762b1d7c3b41c7bda7b9c857765295400fbf5..530ec7a85dddc939507e03963e677654f65340c1 100644 (file)
@@ -20,16 +20,12 @@ http://www.gnu.org/copyleft/lesser.txt.
 -----------------------------------------------------------------------------
 */
 
-#define PY_ARRAY_UNIQUE_SYMBOL numpyPtr
-
-#include <Python.h>
+#include <PyObjectPlus.h>
 
 #include <RAS_GLExtensionManager.h>
 
 #include <RAS_IPolygonMaterial.h>
 
-#include <numpy/arrayobject.h>
-
 //Old API
 //#include "TexPlayer.h"
 //#include "TexImage.h"
@@ -85,15 +81,6 @@ static PyObject * setLogFile (PyObject *self, PyObject *args)
 }
 
 
-// function to initialize numpy structures
-static bool initNumpy (void)
-{
-       // init module and report failure
-       import_array1(false);
-       // report success
-       return true;
-}
-
 // image to numpy array
 static PyObject * imageToArray (PyObject * self, PyObject *args)
 {
@@ -107,15 +94,14 @@ static PyObject * imageToArray (PyObject * self, PyObject *args)
        }
        // get image structure
        PyImage * img = reinterpret_cast<PyImage*>(pyImg);
-       // check initialization of numpy interface, and initialize it if needed
-       if (numpyPtr == NULL && !initNumpy()) Py_RETURN_NONE;
        // create array object
-       npy_intp dim[1];
-       dim[0] = img->m_image->getBuffSize() / sizeof(unsigned int);
        unsigned int * imgBuff = img->m_image->getImage();
        // if image is available, convert it to array
        if (imgBuff != NULL)
-               return PyArray_SimpleNewFromData(1, dim, NPY_UBYTE, imgBuff);
+        // Nasty problem here: the image buffer is an array of integers 
+        // in the processor endian format. The user must take care of that in the script. 
+        // Need to find an elegant solution to this problem 
+        return Py_BuildValue("s#", imgBuff, img->m_image->getBuffSize());
        // otherwise return None
        Py_RETURN_NONE;
 }
@@ -140,6 +126,7 @@ extern PyTypeObject FilterColorType;
 extern PyTypeObject FilterLevelType;
 extern PyTypeObject FilterNormalType;
 extern PyTypeObject FilterRGB24Type;
+extern PyTypeObject FilterRGBA32Type;
 extern PyTypeObject FilterBGR24Type;
 extern PyTypeObject ImageBuffType;
 extern PyTypeObject ImageMixType;
@@ -164,6 +151,7 @@ static void registerAllTypes(void)
        pyFilterTypes.add(&FilterLevelType, "FilterLevel");
        pyFilterTypes.add(&FilterNormalType, "FilterNormal");
        pyFilterTypes.add(&FilterRGB24Type, "FilterRGB24");
+       pyFilterTypes.add(&FilterRGBA32Type, "FilterRGBA32");
        pyFilterTypes.add(&FilterBGR24Type, "FilterBGR24");
 }
 
@@ -189,15 +177,12 @@ PyObject* initVideoTexture(void)
        if (m == NULL) 
                return NULL;
 
-       // prepare numpy array
-       numpyPtr = NULL;
-
        // initialize classes
        pyImageTypes.reg(m);
        pyFilterTypes.reg(m);
 
        Py_INCREF(&TextureType);
-       PyModule_AddObject(m, "Texture", (PyObject*)&TextureType);
+       PyModule_AddObject(m, (char*)"Texture", (PyObject*)&TextureType);
 
        // init last error description
        Exception::m_lastError[0] = '\0';
index 151c741e8b4d3e5074a992f34af5f005c10aee57..4b13ef8f678de04c6a3508fff18fb27bcf39f2fd 100644 (file)
@@ -89,8 +89,8 @@ ifeq ($(OS),darwin)
         CFLAGS += -pipe -fPIC -ffast-math -march=pentium-m -funsigned-char -fno-strict-aliasing
         CCFLAGS        += -pipe -fPIC  -funsigned-char -fno-strict-aliasing
        endif
-    REL_CFLAGS += -O2
-    REL_CCFLAGS        += -O2
+#    REL_CFLAGS        += -O2
+#    REL_CCFLAGS       += -O2
     CPPFLAGS   += -D_THREAD_SAFE
     NAN_DEPEND = true
     OPENGL_HEADERS = /System/Library/Frameworks/OpenGL.framework
index af2a20eb95a4a2bdc7fec24b335d50f688f9bd2e..857d5c4d78056b68540ea7a09698a7f2883551b3 100644 (file)
@@ -416,14 +416,10 @@ class BlenderEnvironment(SConsEnvironment):
                     lenv.Append(CPPDEFINES=['GAMEBLENDER=1'])
             if lenv['WITH_BF_BULLET']:
                     lenv.Append(CPPDEFINES=['WITH_BULLET=1'])
-            # debug or not
-            # CXXFLAGS defaults to CCFLAGS, therefore
-            #  we Replace() rather than Append() to CXXFLAGS the first time
-            #lenv.Replace(CXXFLAGS = lenv['CCFLAGS'])
             if lenv['BF_DEBUG'] or (libname in quickdebug):
-                    lenv.Append(CFLAGS = Split(lenv['BF_DEBUG_CFLAGS']))
-                    lenv.Append(CCFLAGS = Split(lenv['BF_DEBUG_CCFLAGS']))
-                    lenv.Append(CXXFLAGS = Split(lenv['BF_DEBUG_CXXFLAGS']))
+                    lenv.Append(CFLAGS = lenv['BF_DEBUG_CFLAGS'])
+                    lenv.Append(CCFLAGS = lenv['BF_DEBUG_CCFLAGS'])
+                    lenv.Append(CXXFLAGS = lenv['BF_DEBUG_CXXFLAGS'])
             else:
                     lenv.Append(CFLAGS = lenv['REL_CFLAGS'])
                     lenv.Append(CCFLAGS = lenv['REL_CCFLAGS'])