Re: Tile Engine Wrapper Help
- Posted by ghaberek (admin) Oct 07, 2022
- 538 views
Icy_Viking said...
Hello all,
I was using Greg's FFI library to try and wrap Tile Engine. So far the wrapper itself appears to run without error when running it through eui.exe However when I went to make a test example, I got the following error. I feel the error has something to do with dealing with an opaque struct.
ffi.e: 908 attempt to subscript an atom (reading from it) in assignment to 'fn'
Tile engine.h file TLNAPI TLN_Engine TLN_Init (int hres, int vres, int numlayers, int numsprites, int numanimations);
This is happening because the id returned from define_c_func() is -1, indicating the function name was not found. There's no check for this in c_func() so it fails the subscript to the first element of m_funcs which is 0.
I can add some error handling so it crashes better, but the question why did it not find the function? What binaries are you using?
-Greg