Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

126 Neutral

About Cordan

  • Rank
  1. Cordan

    Bad access in virtual methods (iOS ARM)

    Yes, everything works now. Huge thanks!
  2. Cordan

    Bad access in virtual methods (iOS ARM)

    I sent PM to you.
  3. Cordan

    Bad access in virtual methods (iOS ARM)

    It not helps. asMETHODPR is wrapper around asSMethodPtr. I'm still getting crashes when use virtual and pure-virtual methods. I guess it is memory corruption in arm implementation of angel script. After call of any virtual method which returns my type crash occurs. It occurs either in method itself or further in code.
  4. Cordan

    Bad access in virtual methods (iOS ARM)

    Of course. Method: [source lang="cpp"]int r = engine->RegisterObjectMethod("Derived", "my_type method()", asSMethodPtr<sizeof(void (Derived::*)())>::Convert(&Derived::method), asCALL_THISCALL); assert(r >= 0);[/source] Type: [source lang="cpp"]int r = engine->RegisterObjectType("my_type", sizeof(my_type), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK); assert(r >= 0); r = engine->RegisterObjectBehaviour("my_type", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(__construct<my_type>), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectBehaviour("my_type", asBEHAVE_CONSTRUCT, "void f(const my_type &in)", asFUNCTION(__construct_copy<my_type>),asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectBehaviour("my_type", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(__destruct<my_type>), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectMethod("my_type", "my_type& opAssign(my_type &in)", asSMethodPtr<sizeof(my_type& (my_type::*)(const my_type&))>::Convert((my_type& (my_type::*)(const my_type&))(&my_type::operator=)), asCALL_THISCALL); assert(r >= 0);[/source]
  5. I getting EXC_BAD_ACCESS in virtual methods when i run program on iPad. It happens only if method returns registered data type and if method have virtual definition in base class. My code: [source lang="cpp"] virtual my_type Base::method() = 0; ... my_type Derived::method() { ... this->field = 10; // EXC_BAD_ACCESS ... } [/source] If i replace code above with: [source lang="cpp"] virtual void Base::method(my_type &res) = 0; ... void Derived::method(my_type &res) { ... this->field = 10; // OK ... } [/source] problem will disappear. I have this problem only on ios device. i've tested my code on windows, osx and iphone simulator - all is ok. If i replace 'my_type' to 'int' all is ok as well. It looks like calling of virtual methods with wrong object. So, what it can be? ps: as version - 2.25.0
  6. Cordan

    Using const char*

    Big thanks for beautiful support, Andreas! It works.
  7. Cordan

    Using const char*

    I have problems with this on 64bit mac. When i try to build the script i get errors: Don't support passing type 'charptr' by value to application in native calling convention on this platform How can i fix this problem? Thanks in advance.
  8. Cordan

    Using const char*

    I have a lot of functions that using const char* as argument type. Can i bind these functions? Or i necessarily have to using std::string? What i would like to do: C++: void print(const char *str){ printf("%s",str); } Script: print("text"); Thanks in advance.
  • 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!