unzip.h/.cpp - unzGoToFirstFile/unzGoToNextFile retrieves information
about the current file, so it is possible to remove redundant calls
to unzGetCurrentFileInfo and speed up general execution.
unzip.h/.cpp are modified accordingly by creation unzGoToFirstFile64
and unzGoToNextFile64 with file info (unz_file_info64) and name as
possible output parameters.
ZipFile::setFilter (it is used to create a file list at ZipFile
constructor) - redundant calls to unzGetCurrentFileInfo64 are removed,
so briefly the time required to generate a zip file list is something
like 1 average old unzLocateFile call.
A fix for changes at 75ae8d2201
- unzOpenCurrentFile3 has set pfile_in_zip_read_info->crc32_wait
just in case if Zip file has unknown structure / might not be
unpacked, so almost any unpacked file was considered as having
UNZ_CRCERROR.
Open APK file just once and cache a file list information (name and
position inside archive). Also a general ZipFile helper class is
created to read multiple files from Zip archives - might be used
for another platforms if needed.
Previously it was so for each separate file access operation:
- Open zip archive, initially parse its structure (unzOpen)
- Locate the particular file there by a linear search through
full archive (unzLocateFile).
So if file does not exist - still an archive has to be handled
fully, even slower than a file exists.
- Read file.
- Close zip archive
After this commit:
- Once - open zip/apk file and collect file list information
(average consumed time - the same like a search for 2 different
files by unzLocateFile)
- When needed - directly retrieve file position inside the archive,
setting it up to the zip reader and reading file
ZipFile class is located in support/zip_support/ZipUtils.h and .cpp
to prevent creation of a new files and adding them to multiple
project files.
1. update all copyright from 2010-2011 to 2010-2012 cocos2d-x.org
2. update COCOS2D_VERSION to 0x00020003
3. update const char* cocos2dVersion() to "cocos2d-2.0-x-2.0.3"
with four spaces. Also,
1. Used macro NS_CC_BEGIN instead of namespace cocos2d {, NS_CC_END instead
of }.
2. Removed some unused files.
3. Renamed the name of some folders, for example,
"test.android"-->"proj.android" .