Fixing a blenderplayer compile error reported by Meino Christian Cramer:
authorWillian Padovani Germano <wpgermano@gmail.com>
Fri, 16 Jul 2004 06:00:40 +0000 (06:00 +0000)
committerWillian Padovani Germano <wpgermano@gmail.com>
Fri, 16 Jul 2004 06:00:40 +0000 (06:00 +0000)
- added mainqenter to stubs.c so it can be used in blender/blenkernel/intern/blender.c's setup_app_data.

We can't run the onload scriptlink in setup_app_data because the visible areas won't have been updated and redrawn for the loaded .blend file until control returns to screenmain() in blender/src/editscreen.c.  So an ONLOAD_SCRIPT event is entered in setup_app_data and caught in screenmain, where the onload script is then executed.  All for a good looking demo mode ...

BPython:
- Added image.getBindCode() method, contributed by Andrew Corrigan (thanks!).

source/blender/blenkernel/bad_level_call_stubs/stubs.c
source/blender/python/api2_2x/Image.c

index 50fe29d1eec886bceb7dbedc6e82e1f5e4bf0f6f..ada7692b0145cf3c86a89f0dc73c6c6fd68b5fc9 100644 (file)
@@ -72,6 +72,9 @@ void build_seqar(struct ListBase *seqbase, struct Sequence  ***seqar, int *totse
        *totseq = 0;
 }
 
+/* blender.c */
+void mainqenter (unsigned short event, short val){}
+
 void BPY_do_pyscript(ID *id, short int event){}
 void BPY_clear_script(Script *script){}
 void BPY_free_compiled_text(struct Text *text){}
index e897bb5c5ac4f1272e926724deace94c49440c1b..80ca8a38bd7fe2988f2d03bbfd21735770acca81 100644 (file)
@@ -232,6 +232,7 @@ static PyObject *Image_getSize(BPy_Image *self);
 static PyObject *Image_getDepth(BPy_Image *self);
 static PyObject *Image_getXRep(BPy_Image *self);
 static PyObject *Image_getYRep(BPy_Image *self);
+static PyObject *Image_getBindCode(BPy_Image *self); 
 static PyObject *Image_setName(BPy_Image *self, PyObject *args);
 static PyObject *Image_setXRep(BPy_Image *self, PyObject *args);
 static PyObject *Image_setYRep(BPy_Image *self, PyObject *args);
@@ -243,19 +244,21 @@ static PyObject *Image_reload(BPy_Image *self); /* by Campbell */
 static PyMethodDef BPy_Image_methods[] = {
  /* name, method, flags, doc */
        {"getName", (PyCFunction)Image_getName, METH_NOARGS,
-                                       "() - Return Image object name"},
+                       "() - Return Image object name"},
        {"getFilename", (PyCFunction)Image_getFilename, METH_NOARGS,
-                                       "() - Return Image object filename"},
+                       "() - Return Image object filename"},
        {"getSize", (PyCFunction)Image_getSize, METH_NOARGS,
-                                       "() - Return Image object [width, height] dimension in pixels"},
+                       "() - Return Image object [width, height] dimension in pixels"},
        {"getDepth", (PyCFunction)Image_getDepth, METH_NOARGS,
-                                       "() - Return Image object pixel depth"},
+                       "() - Return Image object pixel depth"},
        {"getXRep", (PyCFunction)Image_getXRep, METH_NOARGS,
-                                       "() - Return Image object x repetition value"},
+                       "() - Return Image object x repetition value"},
        {"getYRep", (PyCFunction)Image_getYRep, METH_NOARGS,
-                                       "() - Return Image object y repetition value"},
+                       "() - Return Image object y repetition value"},
+       {"getBindCode", (PyCFunction)Image_getBindCode, METH_NOARGS,
+                       "() - Return Image object's bind code value"},                                                                                  
        {"reload", (PyCFunction)Image_reload, METH_NOARGS,
-                                       "() - Reload the image from the filesystem"},
+                       "() - Reload the image from the filesystem"},
        {"setName", (PyCFunction)Image_setName, METH_VARARGS,
                                        "(str) - Change Image object name"},
        {"setXRep", (PyCFunction)Image_setXRep, METH_VARARGS,
@@ -435,6 +438,16 @@ static PyObject *Image_getYRep(BPy_Image *self)
                                        "couldn't get Image.yrep attribute");
 }
 
+static PyObject *Image_getBindCode(BPy_Image *self)
+{
+       PyObject *attr = PyLong_FromUnsignedLong(self->image->bindcode);
+
+       if (attr) return attr;
+
+       return EXPP_ReturnPyObjError (PyExc_RuntimeError,
+               "couldn't get Image.bindcode attribute");
+}
+
 static PyObject *Image_reload(BPy_Image *self)
 {
        Image *img = self->image;
@@ -522,10 +535,12 @@ static PyObject *Image_getAttr (BPy_Image *self, char *name)
                attr = PyInt_FromLong(self->image->xrep);
        else if (strcmp(name, "yrep") == 0)
                attr = PyInt_FromLong(self->image->yrep);
+       else if (strcmp(name, "bindcode") == 0)
+               attr = PyInt_FromLong(self->image->bindcode);
 
        else if (strcmp(name, "__members__") == 0)
-               attr = Py_BuildValue("[s,s,s,s,s,s]",
-                                                                               "name", "filename", "size", "depth", "xrep", "yrep");
+               attr = Py_BuildValue("[s,s,s,s,s,s,s]",
+                       "name", "filename", "size", "depth", "xrep", "yrep", "bindcode");
 
        if (!attr)
                return (EXPP_ReturnPyObjError (PyExc_MemoryError,