LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, Responder* responder) { LLMutexLock lock(mCreationMutex); handle_t handle = generateHandle(); mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder)); return handle; }
void LLCurlThread::addMulti(LLCurl::Multi* multi) { multi->mHandle = generateHandle() ; CurlRequest* req = new CurlRequest(multi->mHandle, multi, this) ; if (!addRequest(req)) { llwarns << "curl request added when the thread is quitted" << llendl; } }
void ComposerState::initController() { Controller_::ActionMapT actions; actions[A_QUIT] = "A_QUIT"; actions[A_LOADING_MESH] = "A_LOADING_MESH"; actions[A_LOADING_MATERIAL] = "A_LOADING_MATERIAL"; actions[A_CAMERA_AXIS_X] = "A_CAMERA_AXIS_X"; actions[A_CAMERA_AXIS_Y] = "A_CAMERA_AXIS_Y"; actions[A_CAMERA_AXIS_Z] = "A_CAMERA_AXIS_Z"; actions[A_CAMERA_MOVE] = "A_CAMERA_MOVE"; actions[A_CAMERA_RESET] = "A_CAMERA_RESET"; actions[A_CAMERA_ORBIT] = "A_CAMERA_ORBIT"; actions[A_SCREENSHOT] = "A_SCREENSHOT"; actions[A_LOADING_SKY] = "A_LOADING_SKY"; actions[A_CREATE_LIGHT] = "A_CREATE_LIGHT"; actions[A_DESTROY_LIGHT] = "A_DESTROY_LIGHT"; actions[A_PREV_LIGHT] = "A_PREV_LIGHT"; actions[A_NEXT_LIGHT] = "A_NEXT_LIGHT"; actions[A_FIRST_LIGHT] = "A_FIRST_LIGHT"; actions[A_LAST_LIGHT] = "A_LAST_LIGHT"; actions[A_INFO_WINDOW] = "A_INFO_WINDOW"; actions[A_CAMERA_MOUSE_X] = "A_CAMERA_MOUSE_X"; actions[A_CAMERA_MOUSE_Y] = "A_CAMERA_MOUSE_Y"; actions[A_CAMERA_MOUSE_Z] = "A_CAMERA_MOUSE_Z"; actions[A_CAMERA_MOUSE_MOVE] = "A_CAMERA_MOUSE_MOVE"; actions[A_SUB_MESH] = "A_SUB_MESH"; actions[A_TEX_UNIT] = "A_TEX_UNIT"; actions[A_ANIMATION] = "A_ANIMATION"; actions[A_ADAPTER] = "A_ADAPTER"; actions[A_UPDATE_FEATURES] = "A_UPDATE_FEATURES"; Controller_::fillWithDefaultActions(actions); Controller_::sendActionsToController(mLane, actions); Path path; const std::string config_path = path.Expand("Composer.xml"); const std::string state_name = "Composer"; View::WindowAttributes wa; View::queryWindowAttributes(wa); Controller_::StateInsertion si(config_path, state_name, generateHandle(), true, wa); mLane.emit(ID::CE_LOAD_STATE, si); }
LLWorkerThread::handle_t LLWorkerThread::addWorkRequest(LLWorkerClass* workerclass, S32 param, U32 priority) { handle_t handle = generateHandle(); WorkRequest* req = new WorkRequest(handle, priority, workerclass, param); bool res = addRequest(req); if (!res) { llwarns << "add called after LLWorkerThread::cleanupClass()" << llendl; req->deleteRequest(); handle = nullHandle(); } return handle; }
LLVFSThread::handle_t LLVFSThread::write(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, U8* buffer, S32 offset, S32 numbytes, U32 flags) { handle_t handle = generateHandle(); Request* req = new Request(handle, 0, flags, FILE_WRITE, vfs, file_id, file_type, buffer, offset, numbytes); bool res = addRequest(req); if (!res) { LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL; req->deleteRequest(); handle = nullHandle(); } return handle; }
LLVFSThread::handle_t LLVFSThread::read(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, U8* buffer, S32 offset, S32 numbytes, U32 priority, U32 flags) { handle_t handle = generateHandle(); priority = llmax(priority, (U32)PRIORITY_LOW); // All reads are at least PRIORITY_LOW Request* req = new Request(handle, priority, flags, FILE_READ, vfs, file_id, file_type, buffer, offset, numbytes); bool res = addRequest(req); if (!res) { LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL; req->deleteRequest(); handle = nullHandle(); } return handle; }
LLLFSThread::handle_t LLLFSThread::write(const std::string& filename, U8* buffer, S32 offset, S32 numbytes, Responder* responder, U32 priority) { handle_t handle = generateHandle(); if (priority == 0) priority = PRIORITY_LOW | priorityCounter(); Request* req = new Request(this, handle, priority, FILE_WRITE, filename, buffer, offset, numbytes, responder); bool res = addRequest(req); if (!res) { llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl; } return handle; }
LLLFSThread::handle_t LLLFSThread::read(const std::string& filename, /* Flawfinder: ignore */ U8* buffer, S32 offset, S32 numbytes, Responder* responder, U32 priority) { handle_t handle = generateHandle(); if (priority == 0) priority = PRIORITY_NORMAL | priorityCounter(); else if (priority < PRIORITY_LOW) priority |= PRIORITY_LOW; // All reads are at least PRIORITY_LOW Request* req = new Request(this, handle, priority, FILE_READ, filename, buffer, offset, numbytes, responder); bool res = addRequest(req); if (!res) { llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl; } return handle; }
S32 LLVFSThread::readImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAssetType::EType file_type, U8* buffer, S32 offset, S32 numbytes) { handle_t handle = generateHandle(); Request* req = new Request(handle, PRIORITY_IMMEDIATE, 0, FILE_READ, vfs, file_id, file_type, buffer, offset, numbytes); S32 res = addRequest(req) ? 1 : 0; if (res == 0) { LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL; req->deleteRequest(); } else { llverify(waitForResult(handle, false) == true); res = req->getBytesRead(); completeRequest(handle); } return res; }
void WeaponRack::fireRocket() { // No target? if (mTarget == NULL_HANDLE) return; // Out of ammo? if (mRocketAmmo < 1) return; const f32 spawnDistance = 5.0f; const f32 startImpulse = 50.0f; --mRocketAmmo; Location spawnLocation; calculateSpawnLocation(spawnLocation, spawnDistance); v3 startVelocity; calculateVelocity(startImpulse, startVelocity, true); static size_t count = 0; ++count; std::stringstream ss; ss << "Rocket " << count; Loader::ObjectParameter op; op.mHandle = generateHandle(); op.mName = ss.str(); op.mType = "Rocket"; op.mLocation = spawnLocation; op.mLinearVelocity = startVelocity; emit<SectorEvent>(ID::S_CREATE_GO, op); emit<GameObjectEvent>(ID::GOE_AUTONAVIGATE, mTarget, op.mHandle); updateGuiAmmo(); }