I am playing with the most recent version of JSCocoa.And I noticed that I can't use custom inline C function (previously loading the BridgeSupport file), but for example, CGPointMake works OK.
Certain elements, such as inline functions, cannot be described in the metadata files. It is therefore required to generate a dynamic library in order to make the bridges use them. The gen_bridge_metadata tool can take care of that for you.
dyld: Library not loaded: ../Resources-Mac/cocos2d-mac.dylib
Reason: image not found
Do you know where should I put the .dylib file ? If possible, I would like to avoid changing the LD_LIBRARY_PATH environment.
Thank you,
Ricardo
2012-05-15 17:34:53.908 JavascriptTest[24154:503] toJSValueRef FAILED
2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return value not converted in ccc4f on line 369 of /Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhijembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resources/js/test-action.js
struct ccColor4F {
GLfloat r;
GLfloat g;
GLfloat b;
GLfloat a;
};
typedef struct ccColor4F ccColor4F;
static inline ccColor4F ccc4f(const GLfloat r, const GLfloat g, const GLfloat b, const GLfloat a)
{
return (ccColor4F){r, g, b, a};
}
And the BridgeSupport for ccColor4F is:
<struct name='ccColor4F' type='{ccColor4F="r"f"g"f"b"f"a"f}'>
<field name='r' declared_type='GLfloat' type='f'/>
<field name='g' declared_type='GLfloat' type='f'/>
<field name='b' declared_type='GLfloat' type='f'/>
<field name='a' declared_type='GLfloat' type='f'/>
</struct>
[[BridgeSupportController sharedController] loadBridgeSupport:cocos2dBridgeFilePath];
2012-05-15 17:34:53.908 JavascriptTest[24154:503] toJSValueRef FAILED
2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return value not converted in ccc4f on line 369 of /Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhijembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resources/js/test-action.js