void xlPartsAct(void (*actor)(void *user), void *user) { XLparticles *bind = xlGetParticles(); for(bind->runtime.particle = 0; bind->runtime.particle < bind->body.count; bind->runtime.particle++) actor(user); }
ActorID Stage::new_actor() { ActorID result = ActorManager::manager_new(); actor(result)->set_parent(this); //Tell everyone about the new actor signal_actor_created_(result); return result; }
CustomActorPtr CustomActor::New(CustomActorImpl& extension) { CustomActorPtr actor(new CustomActor(extension)); // Second-phase construction extension.Initialize(*actor); actor->Initialize(); return actor; }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askSameAs * Signature: (Luk/ac/manchester/cs/factplusplus/IndividualPointer;)[Luk/ac/manchester/cs/factplusplus/IndividualPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askSameAs (JNIEnv * env, jobject obj, jobject arg) { TRACE_JNI("askSameAs"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<IndividualPolicy</*plain=*/true> > actor(J); PROCESS_QUERY ( J->K->getSameAs ( getROIndividualExpr(env,arg), actor ) ); return actor.getSynonyms(); }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askEquivalentDataProperties * Signature: (Luk/ac/manchester/cs/factplusplus/DataPropertyPointer;)[Luk/ac/manchester/cs/factplusplus/DataPropertyPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askEquivalentDataProperties (JNIEnv * env, jobject obj, jobject arg) { TRACE_JNI("askEquivalentDataProperties"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<DataPropertyPolicy> actor(J); PROCESS_QUERY ( J->K->getEquivalentRoles ( getRODRoleExpr(env,arg), actor ) ); return actor.getSynonyms(); }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askDataPropertyDomain * Signature: (Luk/ac/manchester/cs/factplusplus/DataPropertyPointer;Z)[[Luk/ac/manchester/cs/factplusplus/ClassPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askDataPropertyDomain (JNIEnv * env, jobject obj, jobject arg, jboolean direct) { TRACE_JNI("askDataPropertyDomain"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<ClassPolicy> actor(J); PROCESS_QUERY ( J->K->getDRoleDomain ( getRODRoleExpr(env,arg), direct, actor ) ); return actor.getElements(); }
static int mark_create_actor(lua_State * state) { game::engine & engine = lua::get_game_engine(state); // Create the actor object. game::mark_ref actor(new game::actor); // Create and return the userdata proxy. engine.lua_engine().push_proxy(lua::actor_class, actor); return 1; }
lexer operator [](semantic_action action) const { static char _ = 0; detail::base_lexer_ptr marker(new detail::base_lexer(detail::base_lexer::lexer_type::marker, _, _)); detail::base_lexer_ptr actor(new detail::base_lexer(detail::base_lexer::lexer_type::actor, _, _)); actor->action = action; ++_; append_success(marker, clone_tree(this->base_lexer)); append_success(marker, actor); return lexer(marker); }
void DumpActorLook(json::Value& value, uint32 aid) { SnoFile<Actor> actor(Actor::name(aid)); if (!actor) return; SnoFile<Appearance> app(actor->x014_AppearanceSno.name()); if (!app) return; auto& val = value[fmtstring("%d", aid)]["looks"]; uint32 index = 0; for (auto& look : app->x1C0_AppearanceLooks) { val[fmtstring("%u", HashName(look.x00_Text))] = index++; } }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askInstancesGrouped * Signature: (Luk/ac/manchester/cs/factplusplus/ClassPointer;Z)[[Luk/ac/manchester/cs/factplusplus/IndividualPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askInstancesGrouped (JNIEnv * env, jobject obj, jobject arg, jboolean direct) { TRACE_JNI("askInstancesGrouped"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<IndividualPolicy</*plain=*/false> > actor(J); const TConceptExpr* p = getROConceptExpr(env,arg); PROCESS_QUERY ( direct ? J->K->getDirectInstances(p,actor) : J->K->getInstances(p,actor) ); return actor.getElements(); }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askIndividualTypes * Signature: (Luk/ac/manchester/cs/factplusplus/IndividualPointer;Z)[[Luk/ac/manchester/cs/factplusplus/ClassPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askIndividualTypes (JNIEnv * env, jobject obj, jobject arg, jboolean direct) { TRACE_JNI("askIndividualTypes"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<ClassPolicy> actor(J); const TIndividualExpr* p = getROIndividualExpr(env,arg); PROCESS_QUERY ( J->K->getTypes(p,direct,actor) ); return actor.getElements(); }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askSubDataProperties * Signature: (Luk/ac/manchester/cs/factplusplus/DataPropertyPointer;Z)[[Luk/ac/manchester/cs/factplusplus/DataPropertyPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askSubDataProperties (JNIEnv * env, jobject obj, jobject arg, jboolean direct) { TRACE_JNI("askSubDataProperties"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<DataPropertyPolicy> actor(J); const TDRoleExpr* p = getRODRoleExpr(env,arg); PROCESS_QUERY ( J->K->getSubRoles(p,direct,actor) ); return actor.getElements(); }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askDisjointClasses * Signature: (Luk/ac/manchester/cs/factplusplus/ClassPointer;)[[Luk/ac/manchester/cs/factplusplus/ClassPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askDisjointClasses (JNIEnv * env, jobject obj, jobject arg) { TRACE_JNI("askDisjointClasses"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<ClassPolicy> actor(J); const TConceptExpr* p = getROConceptExpr(env,arg); PROCESS_QUERY ( J->K->getDisjointConcepts(p,actor) ); return actor.getElements(); }
mozilla::ipc::IProtocol* NeckoParent::CloneProtocol(Channel* aChannel, mozilla::ipc::ProtocolCloneContext* aCtx) { ContentParent* contentParent = aCtx->GetContentParent(); nsAutoPtr<PNeckoParent> actor(contentParent->AllocPNeckoParent()); if (!actor || !contentParent->RecvPNeckoConstructor(actor)) { return nullptr; } return actor.forget(); }
mozilla::ipc::IProtocol* CookieServiceParent::CloneProtocol(Channel* aChannel, mozilla::ipc::ProtocolCloneContext* aCtx) { NeckoParent* manager = aCtx->GetNeckoParent(); nsAutoPtr<PCookieServiceParent> actor(manager->AllocPCookieServiceParent()); if (!actor || !manager->RecvPCookieServiceConstructor(actor)) { return nullptr; } return actor.forget(); }
/* * Class: uk_ac_manchester_cs_factplusplus_FaCTPlusPlus * Method: askSuperClasses * Signature: (Luk/ac/manchester/cs/factplusplus/ClassPointer;Z)[[Luk/ac/manchester/cs/factplusplus/ClassPointer; */ JNIEXPORT jobjectArray JNICALL Java_uk_ac_manchester_cs_factplusplus_FaCTPlusPlus_askSuperClasses (JNIEnv * env, jobject obj, jobject arg, jboolean direct) { MemoryStatistics MS("getSuperClasses"); TRACE_JNI("askSuperClasses"); TRACE_ARG(env,obj,arg); TJNICache* J = getJ(env,obj); JTaxonomyActor<ClassPolicy> actor(J); const TConceptExpr* p = getROConceptExpr(env,arg); PROCESS_QUERY ( J->K->getSupConcepts(p,direct,actor) ); return actor.getElements(); }
void parse_actors(const char* json, Array<PhysicsConfigActor>& objects) { TempAllocator4096 ta; JsonObject object(ta); sjson::parse(json, object); auto begin = map::begin(object); auto end = map::end(object); for (; begin != end; ++begin) { const FixedString key = begin->pair.first; const char* value = begin->pair.second; JsonObject actor(ta); sjson::parse_object(value, actor); PhysicsConfigActor pa2; pa2.name = StringId32(key.data(), key.length()); // pa2.linear_damping = sjson::parse_float(actor["linear_damping"]); // 0.0f; // pa2.angular_damping = sjson::parse_float(actor["angular_damping"]); // 0.05f; const bool has_dynamic = map::has(actor, FixedString("dynamic")); const bool has_kinematic = map::has(actor, FixedString("kinematic")); const bool has_disable_gravity = map::has(actor, FixedString("disable_gravity")); pa2.flags = 0; if (has_dynamic) { pa2.flags |= (sjson::parse_bool(actor["dynamic"]) ? 1 : 0 ); } if (has_kinematic) { pa2.flags |= (sjson::parse_bool(actor["kinematic"]) ? PhysicsConfigActor::KINEMATIC : 0 ); } if (has_disable_gravity) { pa2.flags |= (sjson::parse_bool(actor["disable_gravity"]) ? PhysicsConfigActor::DISABLE_GRAVITY : 0 ); } array::push_back(objects, pa2); } }
//-------------------------------------------------------------- // OPENCV FUNCTIONS //-------------------------------------------------------------- void kinactorApp::blobsInsert() { // costruisco actors with a blob for(int i = 0; i < contourFinder.blobs.size(); i++) { actor a = actor(contourFinder.blobs[i]); #ifdef DEBUG std::cerr << "\tInserting ACTOR" << a.code << "WITH STATUS UPDATED: " << a.updated; std::cerr << std::endl; #endif actors.insert(std::pair<string, actor>(a.code, a)); } }
static int ethtool_set_value(struct net_device *dev, char __user *useraddr, int (*actor)(struct net_device *, u32)) { struct ethtool_value edata; if (!actor) return -EOPNOTSUPP; if (copy_from_user(&edata, useraddr, sizeof(edata))) return -EFAULT; return actor(dev, edata.data); }
ActorID Stage::new_actor(MeshID mid) { ActorID result = ActorManager::manager_new(); //If a mesh was specified, set it if(mid) { actor(result).set_mesh(mid); } //Tell everyone about the new actor signal_actor_created_(result); return result; }
static int ethtool_get_value(struct net_device *dev, char __user *useraddr, u32 cmd, u32 (*actor)(struct net_device *)) { struct ethtool_value edata = { cmd }; if (!actor) return -EOPNOTSUPP; edata.data = actor(dev); if (copy_to_user(useraddr, &edata, sizeof(edata))) return -EFAULT; return 0; }
/* * Name: KeActorFactory::CreateActor * Desc: */ KeStrongActorPtr KeActorFactory::CreateActor( const char* actor_resource ) { /* Parse the XML data */ ezxml_t xml = ezxml_parse_str( (char*) actor_resource, strlen( actor_resource ) ); if( !xml ) { return KeStrongActorPtr(); } /* Create a new actor instance */ KeStrongActorPtr actor( new KeActor( GetNextActorId() ) ); if( !actor->Init(xml) ) { } }
Item *AGOSEngine::getNextItemPtr() { int a = getNextWord(); switch (a) { case -1: return _subjectItem; case -3: return _objectItem; case -5: return me(); case -7: return actor(); case -9: return derefItem(me()->parent); default: return derefItem(a); } }
std::auto_ptr<Actor> ActorCreator::Create()const { std::auto_ptr<Actor> actor( new Actor( mId ) ); for( ComponentLoaderMap_t::const_iterator i = mComponentLoaders.begin(), e = mComponentLoaders.end(); i != e; ++i ) { // actor->AddComponent(i->second->FillProperties(mComponentFactory(i->first))); actor->AddComponent( mComponentFactory( i->first ) ); i->second->FillProperties( *actor.get() ); } //TODO: guid will come from outside zorder will be done by ordering at renderer Opt<IRenderableComponent> renderableC = actor->Get<IRenderableComponent>(); if ( renderableC.IsValid() ) { renderableC->SetZOrder( actor->GetGUID() ); } return actor; }
/* boost::shared_ptr<PhysicsMesh> createConvexMesh(const char *filename, IStorm3D_Model_Object *object) { boost::shared_ptr<PhysicsMesh> mesh(new PhysicsMesh()); MeshData data; data.mesh = mesh; data.object = object; data.filename = filename; meshList.push_back(data); return mesh; } */ boost::shared_ptr<PhysicsActor> createActor(boost::shared_ptr<PhysicsMesh> &mesh, const VC3 &position, const QUAT &rotation, const VC3 &velocity, const VC3 &angularVelocity, float mass, int collisionGroup, int soundGroup) { boost::shared_ptr<PhysicsActor> actor(new PhysicsActor(position, rotation)); physicsActorList.push_back(actor.get()); ActorData data; data.actor = actor; data.mesh = mesh; data.velocity = velocity; data.angularVelocity = angularVelocity; data.mass = mass; data.collisionGroup = collisionGroup; data.soundGroup = soundGroup; actorList.push_back(data); return actor; }
void CtfSoldierSpawnPointMapElement::Save( Json::Value& Element ) { Opt<Actor> actor( Scene::Get().GetActor( mSpawnedActorGUID ) ); if ( !actor.IsValid() ) { return; } MapElement::Save( Element ); Element["team"] = Json::Value( mTeam == Team::Blue ? "blue" : "red" ); Json::Value positionObj( Json::objectValue ); positionObj["x"] = mX; positionObj["y"] = mY; Element["position"] = positionObj; }
/** Creates an actor and all its components based on XML configuration ** resource: filename for xml ** state: current game state **/ StrongActorPtr ActorFactory::CreateActor(const char* resource, int* state) { //Holds referenced to loaded XML file pugi::xml_document doc; //Error check to see if file was loaded corectly pugi::xml_parse_result result; std::string resource_str(resource); if (!(result = doc.load_file(("./assets/actors/" + resource_str + ".xml").c_str()))) { std::cout << "ActorFactory::CreateActor(...): Failed to load" << std::endl; std::cout << "Filename: " << resource << " Load result: " << result.description() << std::endl; return StrongActorPtr(); } // Constructs a default actor and gives in the current game state StrongActorPtr actor(new Actor()); actor->resetGameState(state); //Used to iterate over XML file to get attributes pugi::xml_node tools = doc.child(resource); //Initializes the specified actor with chosen XML attributes if(!actor->Init(&tools)) { std::cout << "ActorFactory::CreateActor(...): Failed to initialize actor: " << resource << std::endl; return StrongActorPtr(); } //Iterates over XML to get components to add for (pugi::xml_node tool = tools.first_child(); tool; tool = tool.next_sibling()) { //Creates each component given the XML attribute StrongActorComponentPtr component(CreateComponent(&tool)); if (component) { //Adds the component to the actor actor->AddComponent(component); //Gives the component a reference to its owner component->SetOwner(actor); //Completes any post-initialization of the components component->PostInit(NULL); } else { std::cout << "ActorFactory::CreateActor(...): Failed to create component" << std::endl; return StrongActorPtr(); } } return actor; }
void DynamicsWorld::Terminate(Stage& stage) { DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__); if( stage.IsInstalled() ) { while( !mBodies.empty() ) { ActorPtr actor( mBodies.begin()->second ); if( actor ) { actor->DisableDynamics(); } } TerminateDynamicsWorldMessage( stage.GetUpdateManager() ); } }
void AddActorInfo(json::Value& values, uint32 aid, bool hair, bool fixEmitter, uint32 orig = 0) { SnoFile<Actor> actor(Actor::name(aid)); if (!actor) return; uint32 emitId = (fixEmitter ? FixEmitter(actor) : aid); if (emitId != actor->x000_Header.id) { AddActorInfo(values, emitId, hair, false, aid); return; } auto& value = values[fmtstring("%d", orig ? orig : aid)]; if (hair) { std::map<uint32, uint32> tags; for (uint32 i = 1; i + 3 <= actor->x060_TagMap.size(); i += 3) { tags[actor->x060_TagMap[i + 1]] = actor->x060_TagMap[i + 2]; } value["hair"] = tags[66564]; } SnoFile<AnimSet> animSet(actor->x068_AnimSetSno.name()); if (animSet) { uint32 anim = 0; for (auto& tm : animSet->x010_AnimSetTagMaps) { if (!tm.x08_TagMap.size() || tm.x08_TagMap.size() != tm.x08_TagMap[0] * 3 + 1) continue; for (uint32 i = 1; i + 3 <= tm.x08_TagMap.size(); i += 3) { if (Anim::name(tm.x08_TagMap[i + 2])) { anim = tm.x08_TagMap[i + 2]; } } } if (anim) { value["animation"] = anim; } } SnoFile<Appearance> app(actor->x014_AppearanceSno.name()); if (app) { json::Value enable(json::Value::tObject); uint32 index = 0; for (auto& object : app->x010_Structure.x088_GeoSets[0].x10_SubObjects) { if (strcmp(object.x05C_Text, "FX_EMIT")) { enable[fmtstring("%d", index)] = 0; } ++index; } value["enable"] = enable; } }
/* * Call out to userspace for key construction. * * Program failure is ignored in favour of key status. */ static int construct_key(struct key *key, const void *callout_info, size_t callout_len, void *aux, struct key *dest_keyring) { struct key_construction *cons; request_key_actor_t actor; struct key *authkey; int ret; kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux); cons = kmalloc(sizeof(*cons), GFP_KERNEL); if (!cons) return -ENOMEM; /* allocate an authorisation key */ authkey = request_key_auth_new(key, callout_info, callout_len, dest_keyring); if (IS_ERR(authkey)) { kfree(cons); ret = PTR_ERR(authkey); authkey = NULL; } else { cons->authkey = key_get(authkey); cons->key = key_get(key); /* make the call */ actor = call_sbin_request_key; if (key->type->request_key) actor = key->type->request_key; ret = actor(cons, "create", aux); /* check that the actor called complete_request_key() prior to * returning an error */ WARN_ON(ret < 0 && !test_bit(KEY_FLAG_REVOKED, &authkey->flags)); key_put(authkey); } kleave(" = %d", ret); return ret; }