Changeset 3012
- Timestamp:
- 2007-10-02 23:54:01 (3 years ago)
- Location:
- cel/trunk
- Files:
-
- 1 added
- 5 modified
-
docs/history.txt (modified) (1 diff)
-
include/bindings/blcel.i (modified) (3 diffs)
-
plugins/behaviourlayer/python/blpython.cpp (modified) (3 diffs)
-
plugins/behaviourlayer/python/Jamfile (modified) (2 diffs)
-
plugins/behaviourlayer/python/pytocel.cpp (modified) (1 diff)
-
plugins/behaviourlayer/python/swigpyruntime.h (added)
Legend:
- Unmodified
- Added
- Removed
-
cel/trunk/docs/history.txt
r3009 r3012 6 6 02-Oct-2007 7 7 - cfraz89 added anti-sway ability to pcwheeled. 8 - caedes adapted blpython and cel bindings to account for bindingsplit 9 branch merge into trunk. Side effect is now pure python cel 10 applications are possible. 8 11 29-Sep-2007 9 12 - Sueastside added SetAnimationMapping() which allows you to -
cel/trunk/include/bindings/blcel.i
r2992 r3012 4 4 %include "celproperties.i" // all property accessors 5 5 CS_PROPERTY_HELPERS 6 6 7 %{ 7 8 #include <crystalspace.h> … … 57 58 %} 58 59 60 /* Funtions to set the modules global SCF pointer, this is needed 61 when working on a pure scripting environment, as then this code 62 lives in a non-cs dll, thus the pointer isnt initialized 63 by cs itself, and scf stuff wont work unless the pointer is 64 initialized manually. Use it after CreateEnvironment call. */ 65 INLINE_FUNCTIONS 66 59 67 //============================================================================= 60 68 // Interfaces that need csRef,csPtr,csRefArray … … 619 627 } 620 628 621 /* Funtions to set the modules global SCF pointer, this is needed622 when working on a pure scripting environment, as then this code623 lives in a non-cs dll, thus the pointer isnt initialized624 by cs itself, and scf stuff wont work unless the pointer is625 initialized manually. Use it after CreateEnvironment call. */626 void SetSCFPointer(iSCF* pscf)627 {628 iSCF::SCF = pscf;629 }630 631 iSCF* GetSCFPointer()632 {633 return iSCF::SCF;634 }635 636 629 %} 637 630 -
cel/trunk/plugins/behaviourlayer/python/blpython.cpp
r2926 r3012 36 36 #include "physicallayer/pl.h" 37 37 38 extern "C" 39 { 40 #include "swigpyruntime.h" 41 } 42 43 38 44 extern unsigned char pycel_py_wrapper[]; // pycel.py file compiled and marshalled 39 45 extern size_t pycel_py_wrapper_size; … … 107 113 if (!LoadModule ("blcelc")) return false; 108 114 115 Store("cspace.__corecvar_iSCF_SCF", iSCF::SCF, (void*)"iSCF *"); 116 RunText("cspace.SetSCFPointer(cspace.__corecvar_iSCF_SCF)"); 109 117 // Store the object registry pointer in 'blcel.object_reg'. 110 118 Store ("blcelc.object_reg_ptr", object_reg, (void *) "iObjectRegistry *"); … … 152 160 153 161 return true; 162 } 163 164 PyObject* csWrapTypedObject(void* objectptr, const char *typetag, 165 int own) 166 { 167 swig_type_info *ti = SWIG_TypeQuery (typetag); 168 PyObject *obj = SWIG_NewPointerObj (objectptr, ti, own); 169 return obj; 154 170 } 155 171 -
cel/trunk/plugins/behaviourlayer/python/Jamfile
r2655 r3012 36 36 { 37 37 SEARCH on $(blcelcpp) = $(SEARCH_SOURCE) ; 38 local frozenpy = $(blcelpy:G=frozenblcelpy) ;39 SEARCH on $(frozenpy) = [ ConcatDirs $(TOP) scripts ] ;40 Copy $(blcelpy) : $(frozenpy) ;41 Depends $(blcelpy) : $(frozenpy) ;42 38 } 43 39 } … … 74 70 # blpython plugin. 75 71 #-------- 72 local swigruntime = swigpyruntime.h ; 73 if $(CMD.SWIG) 74 { 75 SwigExternalRuntime $(swigruntime) : 76 python : 77 -c++ -shadow : 78 $(SEARCH_SOURCE) [ ConcatDirs $(TOP) scripts python ] : 79 blpython ; 80 Depends blpythonclean : blpythonswigclean ; 81 } 82 else 83 { 84 SEARCH on $(swigruntime) = $(SEARCH_SOURCE) ; 85 } 86 87 save_HDRS = $(HDRS) ; 88 HDRS = [ on $(swigruntime) GetVar LOCATE ] $(HDRS) ; 76 89 Plugin blpython : blpython.cpp blpython.h pytocel.cpp PYCEL_py.cpp ; 77 90 LinkWith blpython : cel_python ; 78 91 ExternalLibs blpython : PYTHON CRYSTAL ; 79 92 CFlags blpython : $(CELPYTHON.CFLAGS) ; 80 93 HDRS = $(save_HDRS) ; 94 81 95 #-------- 82 96 # blcelmod -- Pure Python module -
cel/trunk/plugins/behaviourlayer/python/pytocel.cpp
r1122 r3012 57 57 }; 58 58 59 extern "C" void SWIG_init_cspace();60 extern "C" void SWIG_init_blcelc();61 //TODO temporary62 63 59 void InitPytocel () 64 60 { 65 61 Py_InitModule ("pytocel", PytocelMethods); 66 SWIG_init_cspace();67 SWIG_init_blcelc();68 //TODO temporary69 62 } 70 63
