Jump to content
  • Advertisement

WitchLord

Moderator
  • Content Count

    8215
  • Joined

  • Last visited

Community Reputation

4697 Excellent

2 Followers

About WitchLord

  • Rank
    Moderator - AngelCode

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. WitchLord

    X64 GCC native CallFunction gives invalid this pointer

    Most likely the problem is with how you've registered the Float3 type. Can you show me how you've registered it? Just the call the RegisterObjectType is needed. I also want to see the C++ declaration of this class so I can verify if the registration is correct. Even without seeing your code I would risk a guess and say that it should be registered like this: engine->RegisterObjectType("Float3", sizeof(Float3), asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<vec3>() | asOBJ_APP_CLASS_ALLFLOATS); The last flag, asOBJ_APP_CLASS_ALLFLOATS, is probably what you're missing in your code. This flag has no effect on Windows, as the C++ ABI on Windows doesn't change with the members of the classes, but with gnuc on Linux it makes a difference, which is why I believe this is the cause of your problem.
  2. WitchLord

    Typo in scriptfilesystem.cpp

    Thanks. I've fixed this in revision 2548.
  3. WitchLord

    dictionary value and string conversions

    In theory yes, but you need to customize the 'any' add-on.
  4. WitchLord

    Checking reference count of script objects

    Yes, your usage of script exceptions is also how I would use it, that is to identify cases of badly performing scripts, log the case and abort the script in a graceful way.
  5. WitchLord

    Checking reference count of script objects

    Raising exceptions or returning default values is really a matter of taste. I try to use exceptions only when it truly is an exception to normal behaviour in which case the exception really should abort the execution, but others like to use exception even for most trivial errors, in which case I think all the catch logic tend to pollute the code. With the latest WIP version I've added support for try/catch statements as well if you prefer to allow that. Though you can also raise a non-catchable exception if you don't want the scripts to be able to catch them. Your abstract class Object is similar to the design written for 'Inheriting from application registered class'.
  6. WitchLord

    Checking reference count of script objects

    What I do in my prototype game engine is that I have a "proxy" object (I call it GameObjectLink) that gives the link from scripts to the true C++ "game object". No script holds any reference directly to the C++ "game object", so malformed scripts cannot keep the C++ "game object" alive. The C++ game object keeps a reference to the proxy object and to the script controller object. As long as the C++ game object is alive there is a cyclic reference "script controller" -> "proxy" <-> "game object" -> "script controller". Other references to the "proxy" can also exists (e.g. when holding a reference to @lastAttackedBy), but no other references to the "script controller". When the game needs to remove a "game object" (destroy it), the link between the "proxy" and the "game object" and the link to the "script controller" is released. After this the "game object" is guaranteed to have no other references to it and can be safely destroyed. The "proxy" can still have references to it and won't necessarily be destroyed immediately, but it is now only an empty shell, and won't cause any harm. The "script controller" itself will be destroyed since on the "game object" held references to it. The only exception is if some malformed script is keeping a link to the "script controller" somewhere, but since the "script controller" can no longer affect the "game object" there is no harm in that, and the garbage collector will eventually free the lingering "script controller". The "proxy" itself has no real logic in it. So while there is a little run-time overhead in this solution, the gain in simplicity of the memory mangement greatly outweighs that overhead.
  7. WitchLord

    Checking reference count of script objects

    If you really need to know the current refCount of script objects you can do so by calling AddRef and then Release. The returned value from Release is the current refCount. I can see the usefulness of this for debugging purposes, but not really for anything else. Having your code continously poll the current refCount of certain objects in order to take a decision doesn't sound very efficient. Are you this is really what you want? I would recommend not to use any game logic that relies on the refCount of any objects, as objects may live longer than intuitively expected due to circular references that may take several iterations to be identified and destroyed by the garbage collector. And under no circumstances should you be calling Release on an object that you don't own as it would very likely lead to crashing your application when the actual owner will attempt to access the object that was destroyed prematurely by your call to Release.
  8. WitchLord

    dictionary value and string conversions

    I've added the support for flagging conversion constructors/factories as 'explicit' now. Just add the keyword 'explicit' after the constructor's parameter list in the declaration to disallow its use in implicit conversions. This is available in revision 2541.
  9. WitchLord

    Version 2.33.0 WIP crash (fix included)

    Your change fixes the crash, but in reality the compiler should be giving an error in this case since the right hand expression doesn't support handles. I've fixed this in revision 2540.
  10. WitchLord

    ASSERT triggered when converting

    Your solution is correct. I've checked in this in revision 2539.
  11. I changed the name of the property accessors back to the original, however now they will only be registered if you define AS_USE_ACCESSORS 1. In this case the the length() method won't be registered to avoid the conflict. I hope this works for you. This is available in revision 2538.
  12. I didn't give it much thought. I had to make a decision, and naturally I decided according to my personal preference (which is to use length()). Sometime in the future I will review all the method names of the add-ons and change them to be consistent throughout.
  13. Yes. It currenty doesn't give an error if you register both length() and get_length(), however when compiling expressions with length the symbol will only match the accessor, so the length() method becomes unaccessible. As such any expression that tries to call length() will give an error.
  14. WitchLord

    JIT compiler fixes for 2.33.0 WIP compatibility

    Have you submitted these fixes to the official BlindMind JIT compiler project too? I'm not sure if @ThyReaper is still actively following this forum. It's been a while since I saw anything from him.
  15. With the refactoring of the symbol lookup it is no longer allowed to have the same symbol match more than one different entity. size can not be both a method "size()" and virtual accessor "get_size()". Unfortunately it won't be possible to maintain backwards compatibility in this case.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!