summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-09-24 23:52:32 -0500
committerDave Parks <davep@lindenlab.com>2010-09-24 23:52:32 -0500
commit35c81f75ac9c134052debb21f6467012859a1fc6 (patch)
tree3b79d1b975ec7dc56aa78668282ac8895c675559 /indra
parent3e2eb3ee4fc9321682336edf37d92b0e05958621 (diff)
Fix for bad zipping of meshes and add mesh icon back to repository.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llcommon/llsdserialize.cpp53
-rwxr-xr-xindra/llinventory/llinventorytype.cpp104
-rwxr-xr-xindra/newview/app_settings/settings.xml2
-rwxr-xr-xindra/newview/llinventoryicon.cpp3
-rwxr-xr-xindra/newview/llinventoryicon.h1
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Mesh.pngbin0 -> 3263 bytes
6 files changed, 100 insertions, 63 deletions
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index fdeb93e27f..03d2b9c3fe 100755
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -2001,6 +2001,8 @@ std::string zip_llsd(LLSD& data)
LLSDSerialize::serialize(data, llsd_strm, LLSDSerialize::LLSD_BINARY);
+ const U32 CHUNK = 65536;
+
z_stream strm;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
@@ -2015,24 +2017,55 @@ std::string zip_llsd(LLSD& data)
std::string source = llsd_strm.str();
+ U8 out[CHUNK];
+
strm.avail_in = source.size();
strm.next_in = (U8*) source.data();
- U8* output = new U8[strm.avail_in];
- strm.avail_out = strm.avail_in;
- strm.next_out = output;
- ret = deflate(&strm, Z_FINISH);
- if (ret != Z_STREAM_END)
+ U8* output = NULL;
+
+ U32 cur_size = 0;
+
+ U32 have = 0;
+
+ do
{
- delete [] output;
- llwarns << "Failed to compress LLSD block." << llendl;
- return std::string();
+ strm.avail_out = CHUNK;
+ strm.next_out = out;
+
+ ret = deflate(&strm, Z_FINISH);
+ if (ret == Z_OK || ret == Z_STREAM_END)
+ { //copy result into output
+ if (strm.avail_out >= CHUNK)
+ {
+ llerrs << "WTF?" << llendl;
+ }
+
+ have = CHUNK-strm.avail_out;
+ output = (U8*) realloc(output, cur_size+have);
+ memcpy(output+cur_size, out, have);
+ cur_size += have;
+ }
+ else
+ {
+ free(output);
+ llwarns << "Failed to compress LLSD block." << llendl;
+ return std::string();
+ }
}
+ while (strm.avail_out == 0);
- std::string::size_type size = source.size()-strm.avail_out;
+ std::string::size_type size = cur_size;
std::string result((char*) output, size);
deflateEnd(&strm);
- delete [] output;
+ free(output);
+
+ std::istringstream test(result);
+ LLSD test_sd;
+ if (!unzip_llsd(test_sd, test, result.size()))
+ {
+ llerrs << "Invalid compression result!" << llendl;
+ }
return result;
}
diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp
index 5c5500b6f4..3ab88de390 100755
--- a/indra/llinventory/llinventorytype.cpp
+++ b/indra/llinventory/llinventorytype.cpp
@@ -98,58 +98,58 @@ LLInventoryDictionary::LLInventoryDictionary()
static const LLInventoryType::EType
DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
{
- LLInventoryType::IT_TEXTURE, // AT_TEXTURE
- LLInventoryType::IT_SOUND, // AT_SOUND
- LLInventoryType::IT_CALLINGCARD, // AT_CALLINGCARD
- LLInventoryType::IT_LANDMARK, // AT_LANDMARK
- LLInventoryType::IT_LSL, // AT_SCRIPT
- LLInventoryType::IT_WEARABLE, // AT_CLOTHING
- LLInventoryType::IT_OBJECT, // AT_OBJECT
- LLInventoryType::IT_NOTECARD, // AT_NOTECARD
- LLInventoryType::IT_CATEGORY, // AT_CATEGORY
- LLInventoryType::IT_NONE, // (null entry)
- LLInventoryType::IT_LSL, // AT_LSL_TEXT
- LLInventoryType::IT_LSL, // AT_LSL_BYTECODE
- LLInventoryType::IT_TEXTURE, // AT_TEXTURE_TGA
- LLInventoryType::IT_WEARABLE, // AT_BODYPART
- LLInventoryType::IT_CATEGORY, // AT_TRASH
- LLInventoryType::IT_CATEGORY, // AT_SNAPSHOT_CATEGORY
- LLInventoryType::IT_CATEGORY, // AT_LOST_AND_FOUND
- LLInventoryType::IT_SOUND, // AT_SOUND_WAV
- LLInventoryType::IT_NONE, // AT_IMAGE_TGA
- LLInventoryType::IT_NONE, // AT_IMAGE_JPEG
- LLInventoryType::IT_ANIMATION, // AT_ANIMATION
- LLInventoryType::IT_GESTURE, // AT_GESTURE
- LLInventoryType::IT_NONE, // AT_SIMSTATE
-
- LLInventoryType::IT_NONE, // AT_LINK
- LLInventoryType::IT_NONE, // AT_LINK_FOLDER
-
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_NONE, // AT_NONE
- LLInventoryType::IT_MESH // AT_MESH
+ LLInventoryType::IT_TEXTURE, // 0 AT_TEXTURE
+ LLInventoryType::IT_SOUND, // 1 AT_SOUND
+ LLInventoryType::IT_CALLINGCARD, // 2 AT_CALLINGCARD
+ LLInventoryType::IT_LANDMARK, // 3 AT_LANDMARK
+ LLInventoryType::IT_LSL, // 4 AT_SCRIPT
+ LLInventoryType::IT_WEARABLE, // 5 AT_CLOTHING
+ LLInventoryType::IT_OBJECT, // 6 AT_OBJECT
+ LLInventoryType::IT_NOTECARD, // 7 AT_NOTECARD
+ LLInventoryType::IT_CATEGORY, // 8 AT_CATEGORY
+ LLInventoryType::IT_NONE, // 9 (null entry)
+ LLInventoryType::IT_LSL, // 10 AT_LSL_TEXT
+ LLInventoryType::IT_LSL, // 11 AT_LSL_BYTECODE
+ LLInventoryType::IT_TEXTURE, // 12 AT_TEXTURE_TGA
+ LLInventoryType::IT_WEARABLE, // 13 AT_BODYPART
+ LLInventoryType::IT_CATEGORY, // 14 AT_TRASH
+ LLInventoryType::IT_CATEGORY, // 15 AT_SNAPSHOT_CATEGORY
+ LLInventoryType::IT_CATEGORY, // 16 AT_LOST_AND_FOUND
+ LLInventoryType::IT_SOUND, // 17 AT_SOUND_WAV
+ LLInventoryType::IT_NONE, // 18 AT_IMAGE_TGA
+ LLInventoryType::IT_NONE, // 19 AT_IMAGE_JPEG
+ LLInventoryType::IT_ANIMATION, // 20 AT_ANIMATION
+ LLInventoryType::IT_GESTURE, // 21 AT_GESTURE
+ LLInventoryType::IT_NONE, // 22 AT_SIMSTATE
+
+ LLInventoryType::IT_NONE, // 23 AT_LINK
+ LLInventoryType::IT_NONE, // 24 AT_LINK_FOLDER
+
+ LLInventoryType::IT_NONE, // 25 AT_NONE
+ LLInventoryType::IT_NONE, // 26 AT_NONE
+ LLInventoryType::IT_NONE, // 27 AT_NONE
+ LLInventoryType::IT_NONE, // 28 AT_NONE
+ LLInventoryType::IT_NONE, // 29 AT_NONE
+ LLInventoryType::IT_NONE, // 30 AT_NONE
+ LLInventoryType::IT_NONE, // 31 AT_NONE
+ LLInventoryType::IT_NONE, // 32 AT_NONE
+ LLInventoryType::IT_NONE, // 33 AT_NONE
+ LLInventoryType::IT_NONE, // 34 AT_NONE
+ LLInventoryType::IT_NONE, // 35 AT_NONE
+ LLInventoryType::IT_NONE, // 36 AT_NONE
+ LLInventoryType::IT_NONE, // 37 AT_NONE
+ LLInventoryType::IT_NONE, // 38 AT_NONE
+ LLInventoryType::IT_NONE, // 39 AT_NONE
+ LLInventoryType::IT_NONE, // 40 AT_NONE
+ LLInventoryType::IT_NONE, // 41 AT_NONE
+ LLInventoryType::IT_NONE, // 42 AT_NONE
+ LLInventoryType::IT_NONE, // 43 AT_NONE
+ LLInventoryType::IT_NONE, // 44 AT_NONE
+ LLInventoryType::IT_NONE, // 45 AT_NONE
+ LLInventoryType::IT_NONE, // 46 AT_NONE
+ LLInventoryType::IT_NONE, // 47 AT_NONE
+ LLInventoryType::IT_NONE, // 48 AT_NONE
+ LLInventoryType::IT_MESH // 49 AT_MESH
};
// static
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 96d2fd05e5..6ab232dd7c 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8017,7 +8017,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>1</integer>
+ <integer>0</integer>
</map>
<key>RenderHideGroupTitle</key>
<map>
diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp
index 2201481df3..ec46ea35af 100755
--- a/indra/newview/llinventoryicon.cpp
+++ b/indra/newview/llinventoryicon.cpp
@@ -90,6 +90,7 @@ LLIconDictionary::LLIconDictionary()
addEntry(LLInventoryIcon::ICONNAME_LINKITEM, new IconEntry("Inv_LinkItem"));
addEntry(LLInventoryIcon::ICONNAME_LINKFOLDER, new IconEntry("Inv_LinkItem"));
+ addEntry(LLInventoryIcon::ICONNAME_MESH, new IconEntry("Inv_Mesh"));
addEntry(LLInventoryIcon::ICONNAME_NONE, new IconEntry("NONE"));
}
@@ -161,6 +162,8 @@ const std::string& LLInventoryIcon::getIconName(LLAssetType::EType asset_type,
case LLAssetType::AT_OBJECT:
idx = ICONNAME_OBJECT;
break;
+ case LLAssetType::AT_MESH:
+ idx = ICONNAME_MESH;
default:
break;
}
diff --git a/indra/newview/llinventoryicon.h b/indra/newview/llinventoryicon.h
index 6e29012c4c..dc4491e7bf 100755
--- a/indra/newview/llinventoryicon.h
+++ b/indra/newview/llinventoryicon.h
@@ -78,6 +78,7 @@ public:
ICONNAME_LINKITEM,
ICONNAME_LINKFOLDER,
+ ICONNAME_MESH,
ICONNAME_COUNT,
diff --git a/indra/newview/skins/default/textures/icons/Inv_Mesh.png b/indra/newview/skins/default/textures/icons/Inv_Mesh.png
new file mode 100644
index 0000000000..f1f21f7941
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Mesh.png
Binary files differ