Commit bebda484 authored by engineer_apple's avatar engineer_apple

Changes in 1.6 TA

	- implemented isALoadableFileFormat ( File *file ) for the Archive Loader


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2209 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 7b5c07e9
Changes in 1.6 TA
- PixelBlend16 and PixelBlend16_simd are working for the new rules;-)
- implemented isALoadableFileFormat ( File *file ) for the Archive Loader
Changes in 1.6 TA
- PixelBlend16 and PixelBlend16_simd are working for the new rules.
- bugfix. CLightSceneNode didn't correctly update it's attributes
Lighting Linear Attenuation. = 1.f / radius
......@@ -148,7 +150,7 @@ Changes in version 1.6, TA
Basically the FileSystem is divided into two regions. Native and Virtual.
Native means using the backend OS.
Virtual means only use currently attach IArchives.
Virtual means only use currently attached IArchives.
Browsing
each FileSystem has it's own workdirectory and it's own methods to
......
......@@ -168,6 +168,27 @@ bool CFileSystem::registerFileArchive( const core::string<c16>& filename, bool i
}
}
// try to load archive based on content
if ( 0 == archive )
{
io::IReadFile* file = createAndOpenFile(filename);
if ( file )
{
for ( i = 0; i < ArchiveLoader.size(); ++i)
{
file->seek ( 0 );
if ( ArchiveLoader[i]->isALoadableFileFormat( file ) )
{
file->seek ( 0 );
archive = ArchiveLoader[i]->createArchive( file, ignoreCase, ignorePaths );
if (archive)
break;
}
}
file->drop ();
}
}
if ( archive )
{
FileArchive.push_back ( archive );
......
......@@ -73,7 +73,11 @@ IFileArchive* CArchiveLoaderPAK::createArchive(io::IReadFile* file, bool ignoreC
\return True if file seems to be loadable. */
bool CArchiveLoaderPAK::isALoadableFileFormat(io::IReadFile* file) const
{
return false;
SPAKFileHeader header;
file->read( &header.tag, 4 );
return header.tag[0] == 'P' && header.tag[1] == 'A';
}
......
......@@ -81,7 +81,13 @@ IFileArchive* CArchiveLoaderZIP::createArchive(io::IReadFile* file, bool ignoreC
\return True if file seems to be loadable. */
bool CArchiveLoaderZIP::isALoadableFileFormat(io::IReadFile* file) const
{
return false;
SZIPFileHeader header;
file->read( &header.Sig, 4 );
#ifdef __BIG_ENDIAN__
os::Byteswap::byteswap(header.Sig);
#endif
return header.Sig == 0x04034b50;
}
/*
......@@ -186,6 +192,11 @@ bool CZipReader::scanLocalHeader2()
c8 *c;
File->read( &temp.header.Sig, 4 );
#ifdef __BIG_ENDIAN__
os::Byteswap::byteswap(temp.header.Sig);
#endif
sprintf ( buf, "sig: %08x,%s,", temp.header.Sig, sigName ( temp.header.Sig ) );
OutputDebugStringA ( buf );
......
Test suite pass at GMT Tue Feb 10 22:17:38 2009
Test suite pass at GMT Wed Feb 11 13:57:44 2009
......@@ -200,6 +200,10 @@
RelativePath=".\drawRectOutline.cpp"
>
</File>
<File
RelativePath=".\enumerateImageManipulators.cpp"
>
</File>
<File
RelativePath=".\exports.cpp"
>
......@@ -264,6 +268,10 @@
RelativePath=".\testDimension2d.cpp"
>
</File>
<File
RelativePath=".\testGeometryCreator.cpp"
>
</File>
<File
RelativePath=".\testUtils.cpp"
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment