/*! * This function is called whenever the user clicks "Add". It calls NewJob(). */ void GamessQFrame::OnADDClick( wxCommandEvent& event ) { GreyButtons(); NewJob(); RefreshList(); RefreshButtons(); }
void MFFileSystem_UnregisterFileSystem(MFFileSystemHandle filesystemHandle) { MFDebug_Assert((uint32)filesystemHandle < gDefaults.filesys.maxFileSystems, "Invalid filesystem"); GET_MODULE_DATA(MFFileSystemState); MFFileSystem *pFS = pModuleData->ppFileSystemList[filesystemHandle]; MFDebug_Assert(pFS, "Filesystem not mounted"); if(pFS->callbacks.UnregisterFS) pFS->callbacks.UnregisterFS(); if(pFS->thread) { // terminate job thread MFJob *pJob = NewJob(pFS); PostJob(pFS, pJob); while(pJob->status != MFJS_Finished) { // yield } MFThread_DestroySemaphore(pFS->semaphore); pFS->jobs.Deinit(); MFHeap_Free(pFS->ppJobQueue); } pModuleData->gFileSystems.Destroy(pFS); pModuleData->ppFileSystemList[filesystemHandle] = NULL; }
void ai_agent::AddAgent() { tempBrain = new sprite_memory; brainMemory.push_back(tempBrain); EntMemory = brainMemory.at(brainMemory.size()-1); this->unitNum++; //this->Entities = ptrWorld->Units; //Ent = Entities.at(Entities.size()-1); //Ent ptr is now set in ai_agent::Process() before addagent is called Ent->ptrBrain = EntMemory; //State Inits SetMMState(states::AI_MM_IDLE); tempBrain->jobData = new jobInfo(); tempBrain->jobData->nextJob = NewJob(tempBrain->jobData,states::AI_JOB_STATE_BIRTH); SetPri1State(states::AI_PRI1_STATE_SELF); //unused? tempBrain->collision = false; //tempBrain->hasNav = false; //Get some nav memory, GetNav returns recycled navdata or new if all else used up tempBrain->navData = Nav->GetNav(); tempBrain->safe = true; tempBrain->dangerlevel = 0; tempBrain->defaultJob = this->stateToDefaultJob_Pri1.at(tempBrain->state_pri1); StartNextJob(); tempBrain->hasTargetToGuard = false; //this->ptrWorld->lock_newunit = false; //this->ptrWorld->ask_newai = false; Ent->fullyCreated = true; //not used Ent->fullyCreatedSafety = 44; //this->SetTarget(this->ptrWorld->ptrPhysics->GetClosestSpriteID((((phys_obj* )Ent)),true)); //this->SetTarget(this->getRandEnemyID()); //int dsdfsd = this->Entities.size(); }