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

Function refCast

sdk/tests/test_feature/source/test_implicitcast.cpp:1281–1294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279// This doesn't seem to link well on MSVC6
1280template<class A, class B>
1281B* refCast(A* a)
1282{
1283 // If the handle already is a null handle, then just return the null handle
1284 if( !a ) return 0;
1285
1286 // Now try to dynamically cast the pointer to the wanted type
1287 B* b = dynamic_cast<B*>(a);
1288 if( b != 0 )
1289 {
1290 // Since the cast was made, we need to increase the ref counter for the returned handle
1291 b->AddRef();
1292 }
1293 return b;
1294}
1295#endif
1296
1297MovieClip *MovieClipFactory()

Callers

nothing calls this directly

Calls 1

AddRefMethod · 0.45

Tested by

no test coverage detected