summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimagepreview.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-03-29 01:30:16 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-04-01 19:30:51 +0300
commit18ef2e3b2ba5a6f0ac397fe6f0652c5b55bdaea8 (patch)
tree41849544b4751e3b92be64397553214b0d28c90a /indra/newview/llfloaterimagepreview.cpp
parent43e605b8339105151fa7e97b27359d87479a3461 (diff)
viewer#1081 Account for 2K texture upload price in material and texture upload
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r--indra/newview/llfloaterimagepreview.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index ba0f97e2e1..68dd7bfdd6 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -34,6 +34,7 @@
#include "llimagepng.h"
#include "llagent.h"
+#include "llagentbenefits.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
@@ -144,6 +145,26 @@ BOOL LLFloaterImagePreview::postBuild()
return TRUE;
}
+
+//-----------------------------------------------------------------------------
+// getExpectedUploadCost()
+//-----------------------------------------------------------------------------
+S32 LLFloaterImagePreview::getExpectedUploadCost() const
+{
+ if (mRawImagep.notNull())
+ {
+ if (mRawImagep->getWidth() * mRawImagep->getHeight() > LLAgentBenefits::MIN_2K_TEXTURE_AREA)
+ {
+ return LLAgentBenefitsMgr::current().get2KTextureUploadCost();
+ }
+ else
+ {
+ return LLAgentBenefitsMgr::current().getTextureUploadCost();
+ }
+ }
+ return 0;
+}
+
//-----------------------------------------------------------------------------
// LLFloaterImagePreview()
//-----------------------------------------------------------------------------