Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Andreas Jonsson

Member Since 26 Mar 2000
Offline Last Active Yesterday, 05:00 PM
*****

#4991524 Implicit cast to bool

Posted by Andreas Jonsson on 18 October 2012 - 01:13 PM

The reasoning is that the implicit conversion to bool in C/C++ is a very common bug with less experienced programmers.

Why not add a function, e.g. isDown() to the Keystate object? It would make the code more readable to those unfamiliar with it.

Keystate@ state = keyboard.getKeystate("space");
// elsewhere...
if ( state.isDown() )
{
   // key is down
}



#4990978 Compiller bug

Posted by Andreas Jonsson on 16 October 2012 - 08:15 PM

I've fixed this problem in revision 1439.

Thanks,
Andreas


#4990973 Context GetLineNumber crash

Posted by Andreas Jonsson on 16 October 2012 - 07:52 PM

I've fixed this in revision 1438. Thanks.


#4990707 Virtual Inheritance

Posted by Andreas Jonsson on 16 October 2012 - 07:32 AM

Virtual methods for classes with virtual inheritance still cannot be registered without the use of wrappers.

You should be able to use the autowrappers, though I haven't tried it myself.

If you don't want to use the autowrappers, you can write the wrapper functions yourself as global functions that takes the object pointer as the first or last parameter. For example:

void derived_callMe(derived *obj)
{
   obj->callMe();
} 

engine->RegisterObjectMethod("derived", "void callMe()", asFUNCTION(derived_callMe), asCALL_CDECL_OBJLAST);


Just out of curiousity. What 3rd party library is this that uses virtual inheritance?


#4990188 Function parameter problem

Posted by Andreas Jonsson on 14 October 2012 - 05:30 PM

It appears that I made a break-through. As of revision 1435, all tests pass successfully with MinGW32 4.7.0 and 4.6.2.

The MinGW developers made some strange choices with the new ABI. For the most part they seem to have wanted to more closely follow the MS ABI, most likely to make it easier to use the many dlls available, but in some cases they ended up with something that is neither like the MS ABI nor the GNUC ABI. This doesn't make any sense at all to me, and quite frankly I believe they may very well change it again with a future version.


#4989824 How to disable - Caught an exception from the application

Posted by Andreas Jonsson on 13 October 2012 - 11:24 AM

Compile the library with AS_NO_EXCEPTIONS and AngelScript won't catch exceptions from the application.

Regards,
Andreas


#4988913 16 Byte Alignment on Value Types

Posted by Andreas Jonsson on 10 October 2012 - 06:54 PM

So far the only way to guarantee memory alignment is with scoped reference types.

I have plans to add support for per-type memory alignment with registered types, but it is not an easy thing to do, and is quite low on my priorities.


#4987420 registering specialized template class?

Posted by Andreas Jonsson on 06 October 2012 - 09:47 AM

The registration was failing because the LLObject template type didn't have a default constructor, which AngelScript treated as if the template type cannot be instanciated at all.

I've fixed this in revision 1424.


#4987411 Mixin in different section compile error

Posted by Andreas Jonsson on 06 October 2012 - 09:15 AM

This has been fixed in revision 1423.

Thanks,
Andreas


#4986979 registering specialized template class?

Posted by Andreas Jonsson on 04 October 2012 - 07:28 PM

It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.


#4986616 Mixin in different section compile error

Posted by Andreas Jonsson on 03 October 2012 - 07:14 PM

Thanks. This problem has already been reported by another user. I'll have it fixed asap.


#4986610 CreateUninitializedScriptObject return null for type of array<int>

Posted by Andreas Jonsson on 03 October 2012 - 06:53 PM

Jake's correct. CreateUninitializedScriptObject only works for script classes, and not for registered types. AngelScript wouldn't know how to safely create an uninitialized instance of a registered type.


#4982560 More advanced parsing & script section order

Posted by Andreas Jonsson on 21 September 2012 - 09:17 PM

The order of the script sections doesn't matter to AngelScript. The only thing that matters is that a script section added to AngelScript only contains fully declared entities, i.e. you cannot declare part of a class or a function one section and the other part in another section.

Sequential pre-processing commands were not on my mind when I implemented the script builder add-on. To support sequential pre-processing commands the includes would probably have to be pre-processed as they are found. This would likely make the add-on more complex.

The token definitions used internally by AngelScript are not exposed to the application, so there is no way to get them without modifying the library. The ParseToken() method can quite easily be modified to return the token definition. What exactly do you want this for?


#4982436 Using AngelScript namespace causes linker error (VC11)

Posted by Andreas Jonsson on 21 September 2012 - 11:15 AM

It's better to define AS_USE_NAMESPACE on the project settings, rather than in the code. Otherwise it is very easy to forget it in some places which makes part of the code refer to AngelScript functions without the namespace, and others with it, which is sure to cause linker errors.

In your case the namespace got declared when you included the scriptstdstring.h, thus the code sees the RegisterStdString() as part of the namespace. On the other hand, when the scriptstdstring.cpp was compiled the namespace was not declared, so RegisterStdString() was implemented outside the namespace.


#4982076 Delegates in AngelScript

Posted by Andreas Jonsson on 20 September 2012 - 10:21 AM

It's tricky, but can be done similarly to how the property accessors are evaluated already, i.e. the decision to use either set or get needs to be deferred until the very last moment when it can be determined which function signature the delegate is expecting.




PARTNERS