Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualjustin12343

Posted 22 May 2013 - 01:53 PM

I found that I could do the following:

 

asIScriptObject *Object::GetScriptObject()
{
	/*CScriptAny *n = new CScriptAny( scriptManager->GetEngine());
	int typeId = scriptManager->GetEngine()->GetTypeIdByDecl( "Base_Object_IMP@");
	n->Store( pScrObj, typeId);

	return n;*/

	pScrObj->AddRef();//<----- Crashes without calling AddRef
	return pScrObj;
}

and then cast like so:

int id = create_instance( x+(LogWidth*i), y, objBridgeNode);
objBridgeNode_controller @node;
Object @obj = get_instance( id);

if (obj != null)
	@node = cast<objBridgeNode_controller>( @obj.GetScriptObject());

 

Now the problem is the frame rate slowly drops. What could be causing this to happen?


#2justin12343

Posted 22 May 2013 - 01:53 PM

I found that I could do the following:

 

asIScriptObject *Object::GetScriptObject()
{
	/*CScriptAny *n = new CScriptAny( scriptManager->GetEngine());
	int typeId = scriptManager->GetEngine()->GetTypeIdByDecl( "Base_Object_IMP@");
	n->Store( pScrObj, typeId);

	return n;*/

	pScrObj->AddRef();//<----- Crashes without calling AddRef
	return pScrObj;
}

and the cast like so:

int id = create_instance( x+(LogWidth*i), y, objBridgeNode);
objBridgeNode_controller @node;
Object @obj = get_instance( id);

if (obj != null)
	@node = cast<objBridgeNode_controller>( @obj.GetScriptObject());

 

Now the problem is the frame rate slowly drops. What could be causing this to happen?


#1justin12343

Posted 22 May 2013 - 01:52 PM

If found that I could do the following:

 

asIScriptObject *Object::GetScriptObject()
{
	/*CScriptAny *n = new CScriptAny( scriptManager->GetEngine());
	int typeId = scriptManager->GetEngine()->GetTypeIdByDecl( "Base_Object_IMP@");
	n->Store( pScrObj, typeId);

	return n;*/

	pScrObj->AddRef();//<----- Crashes without calling AddRef
	return pScrObj;
}

and the cast like so:

int id = create_instance( x+(LogWidth*i), y, objBridgeNode);
objBridgeNode_controller @node;
Object @obj = get_instance( id);

if (obj != null)
	@node = cast<objBridgeNode_controller>( @obj.GetScriptObject());

 

Now the problem is the frame rate slowly drops. What could be causing this to happen?


PARTNERS