Changeset 3012

Show
Ignore:
Timestamp:
2007-10-02 23:54:01 (3 years ago)
Author:
caedesv
Message:

adapted cel for bindingsplit merge into cs trunk.

Location:
cel/trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • cel/trunk/docs/history.txt

    r3009 r3012  
    6602-Oct-2007 
    77        - 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. 
    81129-Sep-2007 
    912        - Sueastside added SetAnimationMapping() which allows you to 
  • cel/trunk/include/bindings/blcel.i

    r2992 r3012  
    44%include "celproperties.i" // all property accessors 
    55CS_PROPERTY_HELPERS 
     6 
    67%{ 
    78#include <crystalspace.h> 
     
    5758%} 
    5859 
     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. */ 
     65INLINE_FUNCTIONS 
     66 
    5967//============================================================================= 
    6068// Interfaces that need csRef,csPtr,csRefArray 
     
    619627} 
    620628 
    621 /* Funtions to set the modules global SCF pointer, this is needed 
    622    when working on a pure scripting environment, as then this code 
    623    lives in a non-cs dll, thus the pointer isnt initialized 
    624    by cs itself, and scf stuff wont work unless the pointer is 
    625    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  
    636629%} 
    637630 
  • cel/trunk/plugins/behaviourlayer/python/blpython.cpp

    r2926 r3012  
    3636#include "physicallayer/pl.h" 
    3737 
     38extern "C" 
     39{ 
     40  #include "swigpyruntime.h" 
     41} 
     42 
     43 
    3844extern unsigned char pycel_py_wrapper[]; // pycel.py file compiled and marshalled 
    3945extern size_t pycel_py_wrapper_size; 
     
    107113  if (!LoadModule ("blcelc")) return false; 
    108114 
     115  Store("cspace.__corecvar_iSCF_SCF", iSCF::SCF, (void*)"iSCF *"); 
     116  RunText("cspace.SetSCFPointer(cspace.__corecvar_iSCF_SCF)"); 
    109117  // Store the object registry pointer in 'blcel.object_reg'. 
    110118  Store ("blcelc.object_reg_ptr", object_reg, (void *) "iObjectRegistry *"); 
     
    152160 
    153161  return true; 
     162} 
     163 
     164PyObject* 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; 
    154170} 
    155171 
  • cel/trunk/plugins/behaviourlayer/python/Jamfile

    r2655 r3012  
    3636    { 
    3737      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) ; 
    4238    } 
    4339  } 
     
    7470  # blpython plugin. 
    7571  #-------- 
     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) ; 
    7689  Plugin blpython : blpython.cpp blpython.h pytocel.cpp PYCEL_py.cpp ; 
    7790  LinkWith blpython : cel_python ; 
    7891  ExternalLibs blpython : PYTHON CRYSTAL ;  
    7992  CFlags blpython : $(CELPYTHON.CFLAGS) ; 
    80    
     93  HDRS = $(save_HDRS) ; 
     94 
    8195  #-------- 
    8296  # blcelmod -- Pure Python module 
  • cel/trunk/plugins/behaviourlayer/python/pytocel.cpp

    r1122 r3012  
    5757}; 
    5858 
    59 extern "C" void SWIG_init_cspace(); 
    60 extern "C" void SWIG_init_blcelc(); 
    61 //TODO temporary 
    62  
    6359void InitPytocel () 
    6460{ 
    6561  Py_InitModule ("pytocel", PytocelMethods); 
    66   SWIG_init_cspace(); 
    67   SWIG_init_blcelc(); 
    68 //TODO temporary 
    6962} 
    7063