Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

328 Neutral

About glcolor

  • Rank

Personal Information

  • Role
  • Interests
  1. glcolor

    Suggestion: Callback for external functions

    And maybe we could load library in similar way just like: #pragma library("foo.dll") and suppose there is a function "void InitializeLibrary(asIScriptEngine* engine)" in the dll, so we can register types and functions in the function.
  2. Thanks for your answers, but there's a misunderstanding that I mean it's maybe a bug of angelscript, not C++. I tested the code in the test project, which is in file test_constructor2.cpp: const char *script1 = "class InternalClass \n" "{ \n" " protected InternalClass() \n" " { \n" " m_x = 3; \n" " m_y = 773456; \n" " } \n" " \n" " int8 m_x; \n" " int m_y; \n" "} \n" "class MyClass \n" "{ \n" " MyClass() \n" " { \n" " m_c = InternalClass(); \n" " } \n" " void Test() \n" " { \n" " Assert( m_c.m_x == 3 ); \n" " Assert( m_c.m_y == 773456 ); \n" " } \n" " InternalClass m_c; \n" "} \n"; The constructor InternalClass() is 'protected' now, and still the same result.
  3. Hi, maybe i met a new bug. Like the code below: class A { protected A() { } } void main() { A a(); } There should be a compiler error as the constructor A() is private to main(), but it works ok.
  4. glcolor

    Strange code works normally.

    as_compiler.cpp line 10679 // If at this point no functions have been identified, then this may be a construct call if (funcs.GetLength() == 0) { bool isValid = false; asCDataType dt = builder->CreateDataTypeFromNode(node->firstChild, script, outFunc->nameSpace, false, 0, false, &isValid); if (isValid) return CompileConstructCall(node, ctx); } change the line if(funcs.GetLength()==0) to if (funcs.GetLength() == 0 && objectType == 0) may solve the problem, hope this will help
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!