- AddScriptSection()
- Build()
- GetFunctionCount()
- GetFunctionIDByName()
- GetFunctionIDByDecl()
AngelScript 1.8.0 WIP #4 (2004/07/03)
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
The implementation for the STDCALL support was contributed by Adam Hoult from Game Institute, a.k.a. daedalusd. The bug was also discovered by him. Thanks very much, Adam.
Regards,
Andreas Jonsson
Author of AngelScript
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
The valid function IDs are between 0 and GetFunctionCount()-1. The first 2 functions may be @init() and @exit(), which shouldn't be called by the application.
GetFunctionName() returns the name of the function by ID.
GetFunctionDeclaration() returns the declaration of the function by ID.
The above is true for version 1.7.1.
For version 1.8.0 this is currently slightly broken since a function ID now holds the module ID in the upper 16 bits. I'll figure out a way before final release to make it just as easy to enumerate the functions.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Here are a few:
angelscript.lib(as_variablescope.obj) : error LNK2001: unresolved external symbol __ftol
ac_string.obj : error LNK2001: unresolved external symbol __imp__strstr
angelscript.lib(as_compiler.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
hgehelp.lib(hgeparticle.obj) : error LNK2001: unresolved external symbol __fltused
Here is what I link against:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hge.lib hgehelp.lib angelscript.lib
Is there some kind of system lib I'm not linking (I have the latest WIP of angelscript btw)?
with v 1.7.1a I registered overloaded methods like this:
asMETHOD( (void (Vector3::*)(float , float , float) )Vector3::set) asMETHOD( (void (Vector3::*)(const Vector3&) )Vector3::set )
but with the new macro definition of WIP#4 I have some truble to get the right method.
asMETHOD(Vecotr3,set) // doesn't work in MSVC .NET 2003 (vc7.1)
Any hints what I could try?
Thanks
Tom
It should just be a matter of writing another macro that takes as a parameter the method parameters so that the pointer cast can be formed. I'm no wiz with macros so it might take me some time to get a nice looking macro. If someone can come up with a macro before me, don't hesitate to give me your suggestions.
If possible I would like the macro to look something like this:
asMETHOD(c,m,p) where c is the class name, m is the method name, and p is the parameter list. It would then be used as follows:
asMETHOD(CMyClass, MyMethod, (int, float, double))
In the meantime you could skip the macro and use the following to get to your method
asSMethodPtr<sizeof(void (c::*)())>::Convert((void (c::*)(p))(&c::m))
Exchange c for the class name, m for the method names, and p for the parameter list for the method.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Put the following macro in the angelscript.h file
#define asMETHODP(c,m,p) asSMethodPtr<sizeof(void (c::*)())>::Convert((void (c::*)p)(&c::m))
Now you can take the pointer of overloaded methods by writing the following:
asMETHODP(MyClass, MyMethod, (int, float))
Note you should keep asMETHOD(c,m) as it will still be used when there is no need to define the parameter list.
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
You will probably have to include the return value with the macro
maybe for global functions too??
#define asMETHOD4(c,r,m,p) asSMethodPtr<sizeof(void (c::*)())>::Convert((r (c::*)(p))(&c::m))
the above doesn't work ofcourse, that is it works for one parameter functions .....