glcolor

Members
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

328 Neutral

About glcolor

  • Rank
    Member
  1. Hi Andreas,there may be a bug in asCScriptEngine::GenerateTemplateFactoryStub,when object is value-type,the name of the function should be "$beh0" rather than "$fact", this causes asASSERT(usedFunctions[n] == 0) fails in asCReader::ReadUsedFunctions.
  2. At last I solved the problem by using the autohandles, it's all ok now.
  3. funcdef void CB(); CB @cb0 = function() {}; // ok auto cb1=cb0; // ok auto cb2= function() {}; // crash auto @cb3= function() {}; // crash error info: Assertion failed: !invalidStackSize, file ..\..\source\as_bytecode.cpp, line 2430
  4. I'll take a further study on it,thanks a lot.
  5. I have not noticed asBEHAVE_GETREFCOUNT before,it looks like just be used by classes registered with asOBJ_GC,but I registered the classes with only the asOBJ_REF flag,so only asBEHAVE_ADDREF and asBEHAVE_RELEASE will be used. I'll study it,thanks.
  6. Hi,Andreas. Recently I have to add scripting support for an old project,this project uses a ref-counted system which uses 0 as the initial ref count instead of 1,just like COM, this causes crash in AngelScript by the wrong ref count, could you add some support for this kind of ref-counted system? Thanks a lot.
  7. Issue in registering template specialization?

    Great,all codes work now,Thanks!
  8. Issue in registering template specialization?

    I experimentally skipped the registering of vector_iterator<int8> if it has been registered, then I met a new problem that the asBEHAVE_CONSTRUCT of vector_iterator<int8> cannot be registered because "Can't support template subtypes by value, since each type is treated differently in the ABI" in asCScriptEngine::RegisterBehaviourToObjectType(): // Can't support template subtypes by value, since each type is treated differently in the ABI if( !func.returnType.IsObjectHandle() && !func.returnType.IsReference() ) { return ConfigError( asNOT_SUPPORTED, "RegisterObjectMethod", objectType-&gt;name.AddressOf(), decl ); } while the behaviour function decl is void f(vector<int8>@). As constructor of value types all take "void" as return type,does this mean all template class should be reference type?
  9. Issue in registering template specialization?

    There is still someting wrong,I wrote the code bellow at the begin of asCScriptEngine::RegisterObjectType: printf("------------------------------------------------------------------\n"); printf("Begin Register Type %s:\n", name); for (int i = 0; i < generatedTemplateTypes.GetLength(); ++i) { auto v = generatedTemplateTypes[i]; if (v->templateSubTypes.GetLength() > 0) { if (v->templateSubTypes[0].GetObjectType()) { printf("%s<%s>\n", v->name.AddressOf(), v->templateSubTypes[0].GetObjectType()->name.AddressOf()); } else { printf("%s<%s>\n", v->name.AddressOf(), asCTokenizer::GetDefinition(v->templateSubTypes[0].GetTokenType())); } } else { printf("%s\n", v->name.AddressOf()); } } and the code bellow at the end of asCScriptEngine::RegisterObjectType: printf("End Register Type %s:\n", name); for (int i = 0; i < generatedTemplateTypes.GetLength(); ++i) { auto v = generatedTemplateTypes[i]; if (v->templateSubTypes.GetLength() > 0) { if (v->templateSubTypes[0].GetObjectType()) { printf("%s<%s>\n", v->name.AddressOf(), v->templateSubTypes[0].GetObjectType()->name.AddressOf()); } else { printf("%s<%s>\n", v->name.AddressOf(), asCTokenizer::GetDefinition(v->templateSubTypes[0].GetTokenType())); } } else { printf("%s\n", v->name.AddressOf()); } } printf("------------------------------------------------------------------\n"); and it outputs: ------------------------------------------------------------------ Begin Register Type vector<int8>: End Register Type vector<int8>: vector_iterator<int8> ------------------------------------------------------------------  why it registered vector<int8> but got vector_iterator<int8>?
  10. I was trying to use the aatc library today, when I call aatc_RegisterAllContainers(), the script engine gives an error of "ConfigError(asNOT_SUPPORTED, "RegisterObjectType", name, 0)" in asCScriptEngine::RegisterObjectType at line 1915, while the aatc is registering the template specialization vector<int8>, it looks as if the condition of the if-statement is always satisfied.   At line 1849 ,there is: // Keep the most recent template generated instance type, so we know what it was before parsing the datatype asCObjectType *mostRecentTemplateInstanceType = 0; if( generatedTemplateTypes.GetLength() ) mostRecentTemplateInstanceType = generatedTemplateTypes[generatedTemplateTypes.GetLength()-1]; And at line 1911 there is if( (generatedTemplateTypes.GetLength() && generatedTemplateTypes[generatedTemplateTypes.GetLength()-1] == mostRecentTemplateInstanceType) || mostRecentTemplateInstanceType == dt.GetObjectType() ) // TODO: Should have a better error message return ConfigError(asNOT_SUPPORTED, "RegisterObjectType", name, 0);  Is it an issue ,or am i misunderstanding the code?
  11. AngelScript 2.26.3 is out

    Great,thanks,I waited delegate for a long time,and I hope the @ symbol can be removed completely from the language as soon as possible,I was confused by it frequently...