Ejemplo n.º 1
0
Handle<Entity> newEntity(core::Context &context, World &world, const GCTP_TYPEINFO &typeinfo, const _TCHAR *name, const _TCHAR *srcfilename)
{
    if(srcfilename) context.load(srcfilename);
    Pointer<Entity> ret = context.create(typeinfo, name).lock();
    if(ret) {
        if(srcfilename) ret->setUp(srcfilename);
        ret->enter(world);
    }
    return ret.get();
}
Ejemplo n.º 2
0
Handle<Entity> newEntity(core::Context &context, World &world, const char *classname, const _TCHAR *name, const _TCHAR *srcfilename)
{
    if(srcfilename) {
        if(!context.load(srcfilename)) return Handle<Entity>();
    }
    Pointer<Entity> ret = context.create(classname, name).lock();
    if(ret) {
        if(srcfilename) ret->setUp(srcfilename);
        ret->enter(world);
    }
    return ret;
}