summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2020-10-06 18:18:18 -0700
committerCallum Prentice <callum@gmail.com>2020-10-06 18:18:18 -0700
commita0ea119623b8bda445f86afdb0ea7b5833c8e171 (patch)
tree5080c5d902654307306e8a94a9f0ec94a432398f /indra/newview
parent56e30615530bf5d1c86fbafee89c9998a079e88f (diff)
Replace references to static writefile with write so we end up with only a single read and a single write function
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterauction.cpp8
-rw-r--r--indra/newview/llfloaterreporter.cpp6
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp3
3 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index 1b9814883e..9813156bf2 100644
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -201,7 +201,9 @@ void LLFloaterAuction::onClickSnapshot(void* data)
LLPointer<LLImageTGA> tga = new LLImageTGA;
tga->encode(raw);
- LLFileSystem::writeFile(tga->getData(), tga->getDataSize(), self->mImageID, LLAssetType::AT_IMAGE_TGA);
+
+ LLFileSystem tga_file(self->mImageID, LLAssetType::AT_IMAGE_TGA, LLFileSystem::WRITE);
+ tga_file.write(tga->getData(), tga->getDataSize());
raw->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
@@ -209,7 +211,9 @@ void LLFloaterAuction::onClickSnapshot(void* data)
LLPointer<LLImageJ2C> j2c = new LLImageJ2C;
j2c->encode(raw, 0.0f);
- LLFileSystem::writeFile(j2c->getData(), j2c->getDataSize(), self->mImageID, LLAssetType::AT_TEXTURE);
+
+ LLFileSystem j2c_file(self->mImageID, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE);
+ j2c_file.write(j2c->getData(), j2c->getDataSize());
self->mImage = LLViewerTextureManager::getLocalTexture((LLImageRaw*)raw, FALSE);
gGL.getTexUnit(0)->bind(self->mImage);
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 3ef80300ef..5d0e2bbc55 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -899,10 +899,8 @@ void LLFloaterReporter::takeScreenshot(bool use_prev_screenshot)
mResourceDatap->mAssetInfo.setDescription("screenshot_descr");
// store in cache
- LLFileSystem::writeFile(upload_data->getData(),
- upload_data->getDataSize(),
- mResourceDatap->mAssetInfo.mUuid,
- mResourceDatap->mAssetInfo.mType);
+ LLFileSystem j2c_file(mResourceDatap->mAssetInfo.mUuid, mResourceDatap->mAssetInfo.mType, LLFileSystem::WRITE);
+ j2c_file.write(upload_data->getData(), upload_data->getDataSize());
// store in the image list so it doesn't try to fetch from the server
LLPointer<LLViewerFetchedTexture> image_in_list =
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 795563e295..7255ab77a4 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -1005,7 +1005,8 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name)
if (formatted->encode(scaled, 0.0f))
{
- LLFileSystem::writeFile(formatted->getData(), formatted->getDataSize(), new_asset_id, LLAssetType::AT_TEXTURE);
+ LLFileSystem fmt_file(new_asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE);
+ fmt_file.write(formatted->getData(), formatted->getDataSize());
std::string pos_string;
LLAgentUI::buildLocationString(pos_string, LLAgentUI::LOCATION_FORMAT_FULL);
std::string who_took_it;