ForceVFX
(ForceVFX)
March 10, 2016, 4:42pm
11
From a quick glance, that appears to convert C# to C++/CLI not straight C++. C++/CLI is effectively the C++ dialect of C# for .Net. Great for doing plumbing work for managed languages but it won’t help in this case because it still needs to run on the .Net run-time and expects a GC.
The syntax between C++ and C# is very similar so there is some scope for automatic conversion of logic and class hierarchy but the main problem is the change in memory models. Even a successful syntactic conversion leaves you a nightmare of a big lump of code that allocates memory all over the place and never frees it.
You really need to redesign your code for the change in memory management models between C# and C++.
I have ported a lot of code in both directions in the past and its not too bad really. Get some strong coffee and be prepared to write a few regexes in your editor for common replacements and you can motor through the code pretty quickly. It becomes quite meditative. Oh and make sure you have a test suite!
I have written a few tools to help port from C# in the past using NRefactory. I may adapt one to help with Unity conversions.
I would pay for that!
That is exactly what I am doing today…I just need a couple core physics scripts, both physX 3.3…
I wanted to experiment, how quickly can I get a full mobile game ported?..
Using code to connect to BP for Editor Configuration, seems to be the best way…
but a little tool like that may be real handy…, more zen like…
Patrick
patrick