• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

172 Neutral

About chewbakka

  • Rank
  1. Script object reference in C++

    It is http://brumisoft.com.   Thank you.
  2. Script object reference in C++

    Thank you, I now have only one feature left before I'll release it to the public; Skinned animation.
  3. Script object reference in C++

    I wasn't aware of the Debugger addon. Thank you, checked it, and now I have a nice game editor with a full angelscript IDE. :) Like this:   [attachment=17951:editor.jpg]
  4. Script object reference in C++

    Hi,   I'm writing a debugger for my project using AngelScript 2.27.1. I've registered a callback and able to extract the variables. I have a nice display showing the variables. For references I'd like to write if it is null or not. for ( int varIx = 0; varIx < context->GetVarCount( level ); varIx++ ) watch->Show( context->GetVarName( varIx, level ) , context->GetVarTypeId( varIx, level ) , context->GetAddressOfVar( varIx, level ) ); This way I enumerate the variables. In Show, I get the object type: asIObjectType* objType = ScriptEngine::Instance().GetAsEngine()->GetObjectTypeById( typeId ); And then I have a TODO now if ( objType->GetFlags() & asOBJ_REF ) { const asIScriptObject* object = (const asIScriptObject*)address; bool isValidRef = true; // TODO item->setText( 2, isValidRef ? "valid ref" : "null ref" ); } I can cast the address of the property to an asIScriptObject, but I can't still determine if it is null reference or not. I've checked if the address pointer is maybe null, but it is not null even for null ref objects.   Is there a way to check if it is a null ref or not?   Thank you.
  5. Native vs Generic calling conventions performance?

    My engine is a 2D full game making solution with AS sitting in it's heart. Basically there is going to be a free license where the engine source is not provided, but a dynamic library can be downloaded. In this version the game makers can use AS to write game code. Basically all engine functionality is delegated to AS and I'm measuring the time spent in the scripting system. The proof of concept game is now shaping up based on the engine, proving that a full fledged game can be made by using only scripting without touching the engine code. The good news that there is no slowdowns in AS so far, but I'll provide you cases when they are showing up.
  6. Hi, Just wondering if anyone has some measurements about the difference between using native or generic calling conventions on different platforms? I'm in the phase of porting my engine to as many platforms as I can. Some of them like the Android MIPS or the Windows Runtime ARM are working only with generic (the code itself can be compiled on any platforms to use generic) and I'm really curious if the difference is significant or not so much, so I can use generic in the final code.
  7. Autohandles with generic callconv

    I use autohandles on my script interface. The solution itself can be compiled to use native calling conventions or generic, based on the target device (I use generic on android mips and used to use it for arm too before). I use macros like _DelegateClassMethod( T, FrameServer, AddListener ); and the compiler decides if it is going to be registered natively or generic. With the little fix, the autohandles are working well for generic calling too (no crashes/leaks).
  8. Autohandles with generic callconv

    Since I use AS there is a bug in the generic calling convention when returning auto handles. When a function returns an autohandle, the generic callconv doesn't increase it's reference counter and later it is going to cause crashes. I've managed to fix this by adding [source lang="cpp"] if ( sysFunction->returnType.IsObject() && !sysFunction->returnType.IsReference() && sysFunction->returnType.IsObjectHandle() && sysFunc->returnAutoHandle && m_regs.objectRegister ) m_engine->CallObjectMethod( m_regs.objectRegister, sysFunction->returnType.GetObjectType()->beh.addref ); [/source] to the asCContext::CallGeneric function before "Clean up function parameters" (line 4382 in 2.24.1). I'm using this for a long time now (copying it over upon AS upgrade), but not sure if this is the correct solution. It works though.
  9. Running on Android with MIPS

    After 4 hours I still can't runt the test on android. I've managed to make it compile, but upon start, it crashes before the first line of main. So far I wasn't able to use the debugger for the MIPS device (not even for my own project) so I'm stuck. I'm using generic calls for now I'm willing to try it again. If someone makes an eclipse project that is working on ARM android and can be built by the android toolchain on windows, then I'll try it again.
  10. Running on Android with MIPS

    My project works like a charm on Android now. With 2.24.0 it is now fully working on Android ARM. However my MIPS based tablet is not so lucky. If I just compile the project with MIPS abi and run, the application will not be able to register a thing, every call to registering application interface fails. I noticed from as_config.h that AS_MIPS will only get detected with the snsystems compiler or PSP. I could add AS_MIPS manually but I'm not sure about the other configuration macros like CDECL_RETURN_SIMPLE_IN_MEMORY and stuff. Is there any experience about setting AS up for Android on MIPS?
  11. Memory leak

    Thank you.
  12. Memory leak

    Just switched to as 2.24.0 and got a memory leak in the library. In angelscript\source\as_builder.cpp(3438) signature = asNEW(sExplicitSignature); This allocation is later passed to RegisterScriptFunctionWithSignature, but if the virtual property is an interface, it is not going to be stored and therefore not going to be freed.
  13. handle property compile error

    Thank you for the clarification.
  14. handle property compile error

    I know I know, but being able to use this form, would make a more consistent look on the code, showing what is a property on the first sight. you can use operator methods with non arrays as well, but the code is much readable writing it in property form.
  15. handle property compile error

    It was that yes. While it makes sense, the confusion comes from the documentation. I taught that the property accessors are equivalent with the set_ and get_ functions, whose are willing to work like set_IFace( Thing() ) of course. An off topic question. Is there a reason that the language don't accept array properties in this form too: [source lang="cpp"]string firstString; string secondString; string stringArray[] { get { switch( index ) { case 0: return firstString; case 1: return secondString; } return ""; } set { switch( index ) { case 0: firstString = value; break; case 1: secondString = value; break; } } }[/source] With the index parameter coming form the property declaration like the value. Thank you.
  • Advertisement