MCPcopy Create free account
hub / github.com/anjo76/angelscript / SetObject

Method SetObject

sdk/angelscript/source/as_context.cpp:1018–1039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016}
1017
1018int asCContext::SetObject(void *obj)
1019{
1020 if( m_status != asEXECUTION_PREPARED )
1021 return asCONTEXT_NOT_PREPARED;
1022
1023 if( !m_initialFunction->objectType )
1024 {
1025 m_status = asEXECUTION_ERROR;
1026 return asERROR;
1027 }
1028
1029 asASSERT( *(asPWORD*)&m_regs.stackFramePointer[0] == 0 );
1030
1031 *(asPWORD*)&m_regs.stackFramePointer[0] = (asPWORD)obj;
1032
1033 // TODO: This should be optional by having a flag where the application can chose whether it should be done or not
1034 // The flag could be named something like takeOwnership and have default value of true
1035 if( obj && (m_initialFunction->objectType->flags & asOBJ_SCRIPT_OBJECT) )
1036 reinterpret_cast<asCScriptObject*>(obj)->AddRef();
1037
1038 return 0;
1039}
1040
1041int asCContext::SetArgByte(asUINT arg, asBYTE value)
1042{

Callers 15

CallOnThinkMethod · 0.80
CallOnMessageMethod · 0.80
CallDestructorMethod · 0.80
CopyFromAsMethod · 0.80
RefCastObjectMethod · 0.80
CompareRelationFunction · 0.80
CompareEqualityFunction · 0.80
SetValueMethod · 0.80
EqualsMethod · 0.80
operator()Function · 0.80
CopyBufferMethod · 0.80

Calls 1

AddRefMethod · 0.45

Tested by 15

Test3Function · 0.64
TestFunction · 0.64
callMethodOfBarFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestScriptsFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
UpdateMethod · 0.64
printFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64