- BGE Python API converting a mesh from a python arg was broken but happened to work...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 25 Jul 2009 19:34:38 +0000 (19:34 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 25 Jul 2009 19:34:38 +0000 (19:34 +0000)
- iris.c - looks like a copy/paste error, was using rect where it could not have been initialized.

source/blender/imbuf/intern/iris.c
source/gameengine/Ketsji/KX_MeshProxy.cpp

index eba148cb8a5b789f80b90e61e41d004770e6dc95..7b8c383ddb93d86f66b46583e8af6056f798d0ec 100644 (file)
@@ -245,7 +245,6 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
        int xsize, ysize, zsize;
        int bpp, rle, cur, badorder;
        ImBuf * ibuf;
-       uchar * rect;
        
        /*printf("new iris\n");*/
        
@@ -436,6 +435,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
        
        
        if (bpp == 1) {
+               uchar * rect;
                
                if (image.zsize == 1){
                        rect = (uchar *) ibuf->rect;
@@ -467,7 +467,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags)
                        fbase = ibuf->rect_float;
                        for (x = ibuf->x * ibuf->y; x > 0; x--) {
                                fbase[0] = 1;
-                               fbase[1] = rect[2] = rect[3];
+                               fbase[1] = fbase[2] = fbase[3];
                                fbase += 4;
                        }
                } else if (image.zsize == 2){
index 11effa1ca980a0cd09d532cfc764a947bd58da8f..ee5813ad85496f42eb962f585b98419bd6921a36 100644 (file)
@@ -347,7 +347,7 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none
                KX_MeshProxy *kx_mesh = static_cast<KX_MeshProxy*>BGE_PROXY_REF(value);
                
                /* sets the error */
-               if (*object==NULL) {
+               if (kx_mesh==NULL) {
                        PyErr_Format(PyExc_SystemError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix);
                        return false;
                }