• Content count

  • Joined

  • Last visited

Community Reputation

187 Neutral

About Gyrbo

  • Rank
  1. New YAASB release

    I've been hard at work to improve my automatic AngelScript binding generator. Several new features were added and it now comes with a readme to explain things better. There is both a binary win32 release and a source release. The binary release comes packaged with everything you need to get started. Simply follow the readme instructions and you'll have a .cpp file that you can easily compile into your project. The binder does expect that you've bound std::string as the string type. Any functions using char*'s will automatically be wrapped. As usual, any feedback is greatly appreciated.
  2. Script isn't building

    I think your problem is using asMETHOD with asCALL_GENERIC. Methods can only be bound using asCALL_THISCALL. If you want to use asCALL_GENERIC, you'll need to make it a static method. The "this pointer" can be retrieved from the asIScriptGeneric paramater.
  3. I don't have a particular reason for it. The reason I asked it is that for some reason TinyXML (which I'm trying to bind with my auto-binder) has it this way. Since I'm generating wrapper functions anyway, it's easy to provide an AS compatible signature. I was just wondering why it was this way, no need to consider this a feature request :). It may be useful to mention it in the documentation, though.
  4. The following code causes an error: // ERROR! r = -10 (INVALID_DECLARATION) r = engine->RegisterObjectBehaviour("Test", asBEHAVE_ASSIGNMENT, "void f(const Test &in)", asMETHOD(Test, operator=), asCALL_THISCALL); // This works //r = engine->RegisterObjectBehaviour("Test", asBEHAVE_ASSIGNMENT, "Test& f(const Test &in)", asMETHOD(Test, operator=), asCALL_THISCALL); Is there any specific reason this is disallowed, or is this a bug?
  5. (another) AngelScript binding generator

    I've been working on this for a while and I have a very basic first release. You can download it here: It's called YAASB (Yet Another AngelScript Binder). The zip includes everything to get you started. To use it, you'll have to get your header files processed by doxygen. You can do this by going into their directory and executing doxygen.exe with the supplied Doxyfile as an argument. This will create a folder called "xml" with all the required files for YAASB to work. You pass this folder as an argument to YAASB.exe. It sounds complex, but it's quite easy. The following commands will generate and output.cpp file with all the bindings it can generate doxygen.exe Doxyfile YAASB.exe -y -o output.cpp xml/ It will most likely generate lots of inout references, so you'll need to enable ALLOW_UNSAFE_REFERENCES for it to work. Handles are planned for a later release. If you only want to include specific files, remove the "-y" switch and put the following in each file you want to use: /*! @file @use{recursive} */ If there are any classes/namespaces/methods you don't want includes, you can prepend them with the following comment: //! @use{no} If you already use doxygen for your project, you can add these actions to existing comments. In order for them not to show up in the documentation, add the following to your Doxyfile: ALIASES += use{1}="\xmlonly<yaasb use=\"\1\" />\endxmlonly" Things that aren't included, but planned: - Handles - Inheritance - Downcasting functions - Arrays (using STL containers?) - Templated classes (using typedefs) - Wrappers for const char* to strings - Wrappers so generic calling conventions can be used Any comments are greatly appreciated. I'm also looking for header file to test the code on.
  6. 4e6

    Well, according to wikipedia, "pony" has some other meanings: 1 2 3 (this might be interesting) 4 So I'll repeat the question, how liberal can we be in this? Curious note: all elements are plural. So would having a single accountant make your entry qualify?
  7. (another) AngelScript binding generator

    That actually seems like a pretty nice idea. From what I gather, custom commands would be a bit of a hack, but workable. I'll have to do some experiments to see if this an actual viable solution, but it seems to best method for now. Thanks for the hint abrken!
  8. (another) AngelScript binding generator

    The tool itself would only work on windows, but its generated code is potentially portable. That is assuming that other compilers don't default to a different calling convention. I hadn't giving the C++ <-> AS binding difference enough thought, it seems. Handles are probably the most difficult to do automatically since you have to add the refcount to the class. The refcount also needs to be updated appropriately. References need to correct in/out specifier, too. My intention was to make the configuration file as light as possible (only specifying the class/function names and offering to automatically bind all methods of a class). The reason for this is that AS itself is already pretty user friendly. If the configuration file is too complex, there would be no added value over simply calling RegisterXXX manually. Making a validator for the code was one of the things I was planning once this was finished. It might be better to start on that, but if you're going to provide this yourself using inline code, it might not be worth it. I'd try to do it using templates, but I can't really wrap my head around all the required concepts.
  9. I was wondering if there was any interest in an automatic AS binding generator. As a basis for the bindings, I would use the pdb file that MSVC generates (by using the DIA SDK). The tool would read the pdb and output either of these formats: 1. A C++ file that can be compiled into your project would would contain all the required binding code. This would require you to compile your project twice: once for generating the pdb and parsing it and a second time for linking in the generated .cpp file. I'm not sure how well this would integrate with build systems. The advantage would be that this file can easily be used by other operating systems besides windows. 2. A sort of serialized version of the internal AS state. All information that is required is contained in the pdb file. The advantage of this approach would be that you only have simple postprocessing step. On the other hand, this file would probably expose more information that you want about the internals of your program. This file would also only be usable on windows (since it contains function pointers, etc.) A small description file would specify which classes/functions should be included. I haven't started any actual implementations, so I'd like to get some feedback on this idea before I start on this. If I still have some time after this is finished, I might try using an approach based on the actual source (probably using GCC-XML). But since this would probably be harder to do and not be as reliable (calling conventions, ...?), I'd prefer to use the pdb approach first.
  10. Improved thread local storage for angelscript

    For atomic operations, the libatomic_ops library from HP is interesting. It contains implementations for a lot of platforms, including linux and windows. It's licensed under a MIT-style license.
  11. Preserve variable state after function call

    The complexity of find() depends on the container you're using it on. A plain std::map is usually implemented as a binary tree. I couldn't find any Big O for it, though. An alternative would be to use a hash_map, which is usually implemented as a hash table, wich pretty much gives you O(1). The choice depends on how many items are in the map and how fast your hash function is. The best way to determine this is to make two versions of the code in a simple test program and profile. I personally use AMD's CodeAnalyst (it's a free download, probably only works on AMD CPUs). If you need a string hash function, try this:
  12. AS_ALLOW_UNSAFE_REFERENCES desappeared ?

    I believe this was changed to a runtime setting in the latest versions.
  13. push / pop bytecodes, variable names, pointers

    Not to mention that the posted code doesn't make any sense at all, there isn't really a question. What is it you want to know/ask?
  14. RegisterGlobalFunction - calling convention?

    Global functions can't be thiscall. Declare the method as static in c++ and use either cdecl or generic (with a wrapper). In you case though, you probably get an error because you're using non-generic calling conventions on an unsupported platform. Which OS/processor are you using?
  15. You can try running linux in VMWare. Threre is a free Player available, you just have to find a suitable linux image for it. A list of some suitable VMWare images: The player itself can be downloaded here: