// static glue void LLFloaterAuction::onClickResetParcel(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); if (self) { self->doResetParcel(); } }
// static void LLFloaterAuction::onClickSnapshot(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); LLPointer<LLImageRaw> raw = new LLImageRaw; gForceRenderLandFence = self->childGetValue("fence_check").asBoolean(); BOOL success = gViewerWindow->rawSnapshot(raw, gViewerWindow->getWindowWidthScaled(), gViewerWindow->getWindowHeightScaled(), TRUE, FALSE, FALSE, FALSE); gForceRenderLandFence = FALSE; if (success) { self->mTransactionID.generate(); self->mImageID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID()); if(!gSavedSettings.getBOOL("QuietSnapshotsToDisk")) { gViewerWindow->playSnapshotAnimAndSound(); } llinfos << "Writing TGA..." << llendl; LLPointer<LLImageTGA> tga = new LLImageTGA; tga->encode(raw); LLVFile::writeFile(tga->getData(), tga->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_IMAGE_TGA); raw->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT); llinfos << "Writing J2C..." << llendl; LLPointer<LLImageJ2C> j2c = new LLImageJ2C; j2c->encode(raw, 0.0f); LLVFile::writeFile(j2c->getData(), j2c->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_TEXTURE); self->mImage = LLViewerTextureManager::getLocalTexture((LLImageRaw*)raw, FALSE); gGL.getTexUnit(0)->bind(self->mImage); self->mImage->setAddressMode(LLTexUnit::TAM_CLAMP); } else { llwarns << "Unable to take snapshot" << llendl; } }
// static void LLFloaterAuction::onClickOK(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); if(self->mImageID.notNull()) { LLSD parcel_name = self->childGetValue("parcel_text"); // create the asset std::string* name = new std::string(parcel_name.asString()); gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_IMAGE_TGA, &auction_tga_upload_done, (void*)name, FALSE); self->getWindow()->incBusyCount(); std::string* j2c_name = new std::string(parcel_name.asString()); gAssetStorage->storeAssetData(self->mTransactionID, LLAssetType::AT_TEXTURE, &auction_j2c_upload_done, (void*)j2c_name, FALSE); self->getWindow()->incBusyCount(); LLNotifyBox::showXml("UploadingAuctionSnapshot"); } LLMessageSystem* msg = gMessageSystem; msg->newMessage("ViewerStartAuction"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("ParcelData"); msg->addS32("LocalID", self->mParcelID); msg->addUUID("SnapshotID", self->mImageID); msg->sendReliable(self->mParcelHost); // clean up floater, and get out self->mImageID.setNull(); self->mImage = NULL; self->mParcelID = -1; self->mParcelHost.invalidate(); self->close(); }
// static void LLFloaterAuction::onClickSnapshot(void* data) { LLFloaterAuction* self = (LLFloaterAuction*)(data); LLPointer<LLImageRaw> raw = new LLImageRaw; gForceRenderLandFence = self->childGetValue("fence_check").asBoolean(); BOOL success = gViewerWindow->rawSnapshot(raw, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), TRUE, FALSE, FALSE); gForceRenderLandFence = FALSE; if (success) { self->mTransactionID.generate(); self->mImageID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID()); gViewerWindow->playSnapshotAnimAndSound(); llinfos << "Writing TGA..." << llendl; LLPointer<LLImageTGA> tga = new LLImageTGA; tga->encode(raw); LLVFile::writeFile(tga->getData(), tga->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_IMAGE_TGA); raw->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT); llinfos << "Writing J2C..." << llendl; LLPointer<LLImageJ2C> j2c = new LLImageJ2C; j2c->encode(raw); LLVFile::writeFile(j2c->getData(), j2c->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_TEXTURE); self->mImage = new LLImageGL((LLImageRaw*)raw, FALSE); self->mImage->bind(); self->mImage->setClamp(TRUE, TRUE); } else { llwarns << "Unable to take snapshot" << llendl; } }