diff options
author | Jacek Antonelli | 2008-08-15 23:44:49 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:49 -0500 |
commit | c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd (patch) | |
tree | 49f225d319b111f30f113c4cf7728565afa52132 /linden/indra/llvfs/llvfs.cpp | |
parent | Second Life viewer sources 1.13.2.15 (diff) | |
download | meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.zip meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.gz meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.bz2 meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.xz |
Second Life viewer sources 1.13.3.2
Diffstat (limited to 'linden/indra/llvfs/llvfs.cpp')
-rw-r--r-- | linden/indra/llvfs/llvfs.cpp | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/linden/indra/llvfs/llvfs.cpp b/linden/indra/llvfs/llvfs.cpp index ed1c313..bb211df 100644 --- a/linden/indra/llvfs/llvfs.cpp +++ b/linden/indra/llvfs/llvfs.cpp | |||
@@ -1957,6 +1957,60 @@ void LLVFS::dumpStatistics() | |||
1957 | } | 1957 | } |
1958 | 1958 | ||
1959 | // Debug Only! | 1959 | // Debug Only! |
1960 | LLString get_extension(LLAssetType::EType type) | ||
1961 | { | ||
1962 | LLString extension; | ||
1963 | switch(type) | ||
1964 | { | ||
1965 | case LLAssetType::AT_TEXTURE: | ||
1966 | extension = ".jp2"; // ".j2c"; // IrfanView recognizes .jp2 -sjb | ||
1967 | break; | ||
1968 | case LLAssetType::AT_SOUND: | ||
1969 | extension = ".ogg"; | ||
1970 | break; | ||
1971 | case LLAssetType::AT_SOUND_WAV: | ||
1972 | extension = ".wav"; | ||
1973 | break; | ||
1974 | case LLAssetType::AT_TEXTURE_TGA: | ||
1975 | extension = ".tga"; | ||
1976 | break; | ||
1977 | case LLAssetType::AT_IMAGE_JPEG: | ||
1978 | extension = ".jpeg"; | ||
1979 | break; | ||
1980 | case LLAssetType::AT_ANIMATION: | ||
1981 | extension = ".lla"; | ||
1982 | break; | ||
1983 | default: | ||
1984 | extension = ".data"; | ||
1985 | break; | ||
1986 | } | ||
1987 | return extension; | ||
1988 | } | ||
1989 | |||
1990 | void LLVFS::listFiles() | ||
1991 | { | ||
1992 | lockData(); | ||
1993 | |||
1994 | for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it) | ||
1995 | { | ||
1996 | LLVFSFileSpecifier file_spec = it->first; | ||
1997 | LLVFSFileBlock *file_block = it->second; | ||
1998 | S32 length = file_block->mLength; | ||
1999 | S32 size = file_block->mSize; | ||
2000 | if (length != BLOCK_LENGTH_INVALID && size > 0) | ||
2001 | { | ||
2002 | LLUUID id = file_spec.mFileID; | ||
2003 | LLString extension = get_extension(file_spec.mFileType); | ||
2004 | llinfos << " File: " << id | ||
2005 | << " Type: " << LLAssetType::getDesc(file_spec.mFileType) | ||
2006 | << " Size: " << size | ||
2007 | << llendl; | ||
2008 | } | ||
2009 | } | ||
2010 | |||
2011 | unlockData(); | ||
2012 | } | ||
2013 | |||
1960 | #include "llapr.h" | 2014 | #include "llapr.h" |
1961 | void LLVFS::dumpFiles() | 2015 | void LLVFS::dumpFiles() |
1962 | { | 2016 | { |
@@ -1978,16 +2032,8 @@ void LLVFS::dumpFiles() | |||
1978 | getData(id, type, buffer, 0, size); | 2032 | getData(id, type, buffer, 0, size); |
1979 | lockData(); | 2033 | lockData(); |
1980 | 2034 | ||
1981 | LLString extention = ".data"; | 2035 | LLString extension = get_extension(type); |
1982 | switch(type) | 2036 | LLString filename = id.getString() + extension; |
1983 | { | ||
1984 | case LLAssetType::AT_TEXTURE: | ||
1985 | extention = ".jp2"; // ".j2c"; // IrfanView recognizes .jp2 -sjb | ||
1986 | break; | ||
1987 | default: | ||
1988 | break; | ||
1989 | } | ||
1990 | LLString filename = id.getString() + extention; | ||
1991 | llinfos << " Writing " << filename << llendl; | 2037 | llinfos << " Writing " << filename << llendl; |
1992 | apr_file_t* file = ll_apr_file_open(filename, LL_APR_WB); | 2038 | apr_file_t* file = ll_apr_file_open(filename, LL_APR_WB); |
1993 | ll_apr_file_write(file, buffer, size); | 2039 | ll_apr_file_write(file, buffer, size); |