Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

FDsagizi

Member Since 03 Apr 2009
Offline Last Active Today, 10:12 AM
-----

Topics I've Started

Custom memory and addons

19 April 2013 - 02:09 AM

Hy smile.png

 

 

this method:

AS_API int asSetGlobalMemoryFunctions(asALLOCFUNC_t allocFunc, asFREEFUNC_t freeFunc);

 

work only with AngelScript engine, module, contex, but - AS have addons.


asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT, true

07 April 2013 - 09:43 PM

Hi Andreas smile.png

 

with asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT we can create all objects from c++ code, for deserealization - It work fine!

but, for scripts, i think no need use this.

 

exemple:

this code work, but it's not goood

 

 

 

 

class SomeClass{
     SomeClass( int init_param ){}
}
void f(){
     SomeClass s;
}
 

 


convertion problem - No conversion from 'A@&' to 'B@' available.

15 February 2013 - 02:38 AM

Hi smile.png

I think variant "b is a" - valid, but compiler say no

 

class A{}
class B : A{}


void startGame( string &param )
{
    A @a;
    B @b;
    
    if( a is b )
    {}
    
    if( b is a ) //  No conversion from 'A@&' to 'B@' available.
    {}
}
 

crash in ctx->GetLineNumber

11 February 2013 - 10:19 PM

Hi smile.png

script code:

 

 

 

// Global scope
Object @obj = CraeteObject();

 

 

 

 

// C++

Object *CreateObject()
{
    asIScriptContext *ctx = asGetActiveContext();


    assert( ctx );


    int stack_size = ctx->GetCallstackSize();


    if( stack_size > 0 )
    {    
        const char *script_section;


        int line = ctx->GetLineNumber(0, 0, &script_section); // Crash
    }
}
 

 


asASSERT in file: as_compiller.cpp line: 675

11 February 2013 - 04:25 AM

Hi smile.png

 

I update from svn to new version, and i have asserts on debug compilation! But last version compilated with out asserts!

 

If i comment code: 

 

 

 

    // At this point there should be no variables allocated
    //asASSERT(variableAllocations.GetLength() == freeVariables.GetLength());
 

 

 
Then compilate ok, and work fine!

PARTNERS