|Subject:||[Adonthell-devel] SWIG 1.3.24 and more ...|
|Date:||Fri, 3 Jun 2005 19:40:18 +0200|
It's done :-).I have managed to get the v0.4 code working with latest SWIG. There have been a few changes, but nothing too dramatic. I have replaced the swig_runtime library with a lib called py_runtime which contains a few wrappers around the internal SWIG functions we used to call. Specifically, there is py_to_cxx (for passing Python objects to C++) and cxx_to_py for the other way round. As they are implemented in a SWIG interface file, they have access to all the static SWIG functions.
Where we formerly called SWIG internals directly in our code, one of the functions above is used now. That's it; our different Python modules are linked against py_runtime as they were against swig_runtime, ensuring that wrapped classes are seen by all modules.
As I had some troubles with this at first, I have also started work on a separate debug module. For now, it's only function 'log_py_objects()' prints all types known to SWIG. Others will follow. For example, since I ran into problems with it, I plan a function to list information about the python object pool used by game events (and others). There might be other parts of the engine where debug information might be useful to track down problems. All such functionality could be grouped in the debug module. That way, it will not clutter other modules with stuff that is not really required. But if developers/game designers face problems, they can pop up the Python Console, import debug and have a look at engine internals that are hardly available otherwise.
Now that I am at home again and have access to the net, I'll continue with the documentation, but more code to come for sure ...
KaiP.S. When you update your code, make sure to remove all *_wrap.cc files from py-wrappers/adonthell, so that SWIG can generate them new. Mixing code from old SWIG versions with the new 1.3.24 won't work!
|[Prev in Thread]||Current Thread||[Next in Thread]|