The following commit has been merged in the master branch:
commit 79a8c8ee0be962b2fe114bb399ed7b9898cc44aa
Author: Robin Cornelius <[EMAIL PROTECTED]>
Date:   Mon Jun 9 19:47:04 2008 +0100

    Add texture cache patch

diff --git a/debian/patches/0000_no_texture_cache_madness.dpatch 
b/debian/patches/0000_no_texture_cache_madness.dpatch
new file mode 100755
index 0000000..b8cd7b3
--- /dev/null
+++ b/debian/patches/0000_no_texture_cache_madness.dpatch
@@ -0,0 +1,80 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## Less texture cache madness.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
[EMAIL PROTECTED]@
+
+diff --git a/indra/newview/lltexturecache.cpp 
b/indra/newview/lltexturecache.cpp
+index 8240f77..b2bd12c 100644
+--- a/indra/newview/lltexturecache.cpp
++++ b/indra/newview/lltexturecache.cpp
+@@ -477,12 +477,36 @@ bool LLTextureCacheRemoteWorker::doRead()
+                       }
+               }
+ #else
++              std::string filename = mCache->getTextureFileName(mID);
++              S32 filesize = ll_apr_file_size(filename+".j2c", 
mCache->getFileAPRPool());
++              if(filesize==0)
++              {
++                      mDataSize = -1;
++                      return true;
++              }
++
++              mReadData = new U8[mBytesToRead];
++              
++              S32 bytes_read = ll_apr_file_read_ex(filename+".j2c", 
mCache->getFileAPRPool(), mReadData, 0, mDataSize);
++              
++              if (bytes_read != mDataSize)
++              {
++                      llwarns << "LLTextureCacheWorker: "  << mID
++                                      << " incorrect number of bytes read 
from header: " << bytes_read
++                                      << " / " << mDataSize << llendl;
++                      mDataSize = -1; // failed
++                      return true;
++              }
++
++              return true;
++
++
+               llassert_always(idx >= 0);
+               llassert_always(mOffset < TEXTURE_CACHE_ENTRY_SIZE);
+               S32 offset = idx * TEXTURE_CACHE_ENTRY_SIZE + mOffset;
+               S32 size = TEXTURE_CACHE_ENTRY_SIZE - mOffset;
+               mReadData = new U8[size];
+-              S32 bytes_read = 
ll_apr_file_read_ex(mCache->mHeaderDataFileName, mCache->getFileAPRPool(),
++              bytes_read = ll_apr_file_read_ex(mCache->mHeaderDataFileName, 
mCache->getFileAPRPool(),
+                                                                               
         mReadData, offset, size);
+               if (bytes_read != size)
+               {
+@@ -617,6 +641,19 @@ bool LLTextureCacheRemoteWorker::doWrite()
+       S32 idx = -1;
+ 
+       // No LOCAL state for write()
++
++      std::string filename = mCache->getTextureFileName(mID);
++
++      S32 bytes_written = ll_apr_file_write_ex(filename+".j2c", 
mCache->getFileAPRPool(), mWriteData, 0, mDataSize);
++
++      if (bytes_written <= 0)
++      {
++              llwarns << "LLTextureCacheWorker: missing entry: " << mID << 
llendl;
++              mDataSize = -1; // failed
++              return true;
++      }
++
++      return true;
+       
+       if (mState == INIT)
+       {
+@@ -696,6 +733,9 @@ bool LLTextureCacheRemoteWorker::doWrite()
+               S32 bytes_written = 
ll_apr_file_write_ex(mCache->mHeaderDataFileName, mCache->getFileAPRPool(),
+                                                                               
                 mWriteData, offset, size);
+ 
++              
++
++
+               if (bytes_written <= 0)
+               {
+                       llwarns << "LLTextureCacheWorker: missing entry: " << 
mID << llendl;
diff --git a/debian/patches/00list b/debian/patches/00list
index a0a9136..d0c7088 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -96,3 +96,4 @@ VWR-1815_top_corner_fix.dpatch
 VWR-5697_fix_startup_paths.dpatch
 VWR-7271_fix_mutlist_for_amd64.dpatch
 0000_valgrind_wild_vars.dpatch
+0000_no_texture_cache_madness.dpatch

-- 
A client for connecting to 3D metaverses such as Linden Labs Secondlife(tm) and 
OpenSim grids

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to