Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


dkrusu

Member Since 09 Dec 2012
Offline Last Active Yesterday, 08:13 PM

Topics I've Started

Change to test_feature gnuc makefile

Yesterday, 12:36 PM

Would you mind making the following change to the test_feature gnuc makefile:

CXX = g++

to

CXX ?= g++

This allows you to override the compiler used, you already have it this way for the libraries makefile.

 

Thanks


Patch for namespace support in get/setters

20 July 2015 - 04:34 PM

Currently get/setters do not support namespaces in the return type. Attached is a simple patch that adds support for scopes in IsVirtualPropertyDecl() which previously did not check for them. I also added a simple test case.

 

Edit: First diffs I generated in the wrong order, fixed.

 

Thanks,

dkrusu


Can't get method param's name at runtime

16 June 2015 - 12:41 PM

Hi, I'm trying to get information about a script class's methods and parameters. Getting the name of the method and then the type id of each of the parameters works just fine, but when I try to get the name or default arguments it gives me a nullptr. I saw in asIScriptFunction::GetParam you have a comment that says that it doesn't work with pre-compiled bytecode w/o debug symbols, but this wasn't pre-compiled. The size of parameterNames in asIScriptFunction is 0.

 

Thanks,

dkrusu


Context not suspending?

15 June 2015 - 10:52 PM

I'm trying to create a way to dynamically call methods on a script object, in order to do this I thought I would suspend execution on the active context, create a new context and execute the method, then resume execution on the original context. To start to test this plan I first am trying to suspend the execution and thats where I've hit a issue. I call Suspend on the context and it returns a value of 0, but then if I check the current state it says that it's still active.

 

Here is my code for suspending, it's part of a template class 

bool callMethodVoid(void *objRef, int typeId, const UString& methodName)
{
    asIScriptContext* ctx = asGetActiveContext();
    int r = ctx->Suspend();
    
    printf("Suspend Return: %i\n", r);
    printf("Current State: %i\n", ctx->GetState());
    
    r = ctx->Execute();
    printf("Execute Return: %i\n", r);
    return true;
}

Here is the output for above:

Suspend Return: 0
Current State: 6
Execute Return: -4

It's called in the script language with the following

class Test
{
    void test()
    {
        stdout << "Works!";
    }
}

Object<Test> obj;
Test a;
obj.callMethod(a, "test");

Any idea what would keep the context from suspending?

 

Thank You,

dkrusu


Getting dictionary addon to work with ref-counted strings

05 June 2015 - 10:03 PM

Hi, I'm trying to get the dictionary add-on to work with ref-counted strings.  After I replaced all the uses of std::string with my own most things worked except for the initialization lists and index operators. I was able to initialization lists working with the following change to how the name is extracted:

UString *name = *(UString**)buffer;
buffer += sizeof(UString*);

That fixed that issue, but now I'm getting a crash when attempting to retrieve the data using the index operators

dictionary dict = { {"test", "foo"} };
dictionaryValue val = dict["test"];
stdout << string(val);

That will cause a crash when attempting to call opEquals on the string object. The following will work:

dictionary dict = { {"test", "foo"} };
string val;
dict.get("test", val);
stdout << val;

I'm sure the pointer it's using for the string class is not correct, but any ideas on why that would be? I attached a valgrind log.

 

Thanks

 

Attached File  valgrind.txt   4.66KB   18 downloads


PARTNERS