summaryrefslogtreecommitdiff
path: root/indra/llappearance
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llappearance')
-rw-r--r--indra/llappearance/llavatarappearancedefines.cpp79
-rw-r--r--indra/llappearance/llavatarappearancedefines.h4
2 files changed, 81 insertions, 2 deletions
diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp
index b5282d4f6f..c9b975a9cc 100644
--- a/indra/llappearance/llavatarappearancedefines.cpp
+++ b/indra/llappearance/llavatarappearancedefines.cpp
@@ -26,9 +26,10 @@
#include "linden_common.h"
#include "llavatarappearancedefines.h"
+#include "indra_constants.h"
-const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 512;
-const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 512;
+const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024;
+const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024;
const S32 LLAvatarAppearanceDefines::IMPOSTOR_PERIOD = 2;
using namespace LLAvatarAppearanceDefines;
@@ -265,3 +266,77 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn
{
return getInstance()->getTexture(index)->mWearableType;
}
+
+// static
+BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id)
+{
+ if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER))
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// static
+EBakedTextureIndex LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(const LLUUID& id)
+{
+ if (id == IMG_USE_BAKED_EYES)
+ {
+ return BAKED_EYES;
+ }
+ else if (id == IMG_USE_BAKED_HAIR)
+ {
+ return BAKED_HAIR;
+ }
+ else if (id == IMG_USE_BAKED_HEAD)
+ {
+ return BAKED_HEAD;
+ }
+ else if (id == IMG_USE_BAKED_LOWER)
+ {
+ return BAKED_LOWER;
+ }
+ else if (id == IMG_USE_BAKED_SKIRT)
+ {
+ return BAKED_SKIRT;
+ }
+ else if (id == IMG_USE_BAKED_UPPER)
+ {
+ return BAKED_UPPER;
+ }
+
+ return BAKED_NUM_INDICES;
+}
+
+//static
+LLUUID LLAvatarAppearanceDictionary::localTextureIndexToMagicId(ETextureIndex t)
+{
+ LLUUID id = LLUUID::null;
+
+ switch (t)
+ {
+ case LLAvatarAppearanceDefines::TEX_HEAD_BAKED:
+ id = IMG_USE_BAKED_HEAD;
+ break;
+ case LLAvatarAppearanceDefines::TEX_UPPER_BAKED:
+ id = IMG_USE_BAKED_UPPER;
+ break;
+ case LLAvatarAppearanceDefines::TEX_LOWER_BAKED:
+ id = IMG_USE_BAKED_LOWER;
+ break;
+ case LLAvatarAppearanceDefines::TEX_EYES_BAKED:
+ id = IMG_USE_BAKED_EYES;
+ break;
+ case LLAvatarAppearanceDefines::TEX_SKIRT_BAKED:
+ id = IMG_USE_BAKED_SKIRT;
+ break;
+ case LLAvatarAppearanceDefines::TEX_HAIR_BAKED:
+ id = IMG_USE_BAKED_HAIR;
+ break;
+ default:
+ break;
+ }
+
+ return id;
+}
diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h
index d6223bb4d2..af94ea94f2 100644
--- a/indra/llappearance/llavatarappearancedefines.h
+++ b/indra/llappearance/llavatarappearancedefines.h
@@ -223,6 +223,10 @@ public:
// Given a texture entry, determine which wearable type owns it.
static LLWearableType::EType getTEWearableType(ETextureIndex index);
+ static BOOL isBakedImageId(const LLUUID& id);
+ static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);
+ static LLUUID localTextureIndexToMagicId(ETextureIndex t);
+
}; // End LLAvatarAppearanceDictionary
} // End namespace LLAvatarAppearanceDefines