mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Remove logs
This commit is contained in:
@@ -120,10 +120,7 @@ bool GpFileStream_Web_StaticMemFile::SeekCurrent(GpFilePos_t loc)
|
||||
bool GpFileStream_Web_StaticMemFile::SeekEnd(GpUFilePos_t loc)
|
||||
{
|
||||
if (loc > m_size)
|
||||
{
|
||||
fprintf(stderr, "SeekEnd failed: Loc %i size %i\n", static_cast<int>(loc), static_cast<int>(m_size));
|
||||
return false;
|
||||
}
|
||||
|
||||
m_offset = m_size - loc;
|
||||
return true;
|
||||
@@ -375,7 +372,6 @@ bool GpFileSystem_Web::FileExists(PortabilityLayer::VirtualDirectory_t virtualDi
|
||||
|
||||
bool GpFileSystem_Web::FileLocked(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &exists)
|
||||
{
|
||||
fprintf(stderr, "FileLocked %s\n", path);
|
||||
if (const GpFileSystem_Web_Resources::FileCatalog *catalog = GetCatalogForVirtualDirectory(virtualDirectory))
|
||||
{
|
||||
for (size_t i = 0; i < catalog->m_numEntries; i++)
|
||||
@@ -407,31 +403,21 @@ bool GpFileSystem_Web::FileLocked(PortabilityLayer::VirtualDirectory_t virtualDi
|
||||
|
||||
GpIOStream *GpFileSystem_Web::OpenFileNested(PortabilityLayer::VirtualDirectory_t virtualDirectory, char const* const* subPaths, size_t numSubPaths, bool writeAccess, GpFileCreationDisposition_t createDisposition)
|
||||
{
|
||||
fprintf(stderr, "OpenFileNested %i %s subPaths %i\n", static_cast<int>(virtualDirectory), subPaths[0], static_cast<int>(numSubPaths));
|
||||
if (numSubPaths == 1)
|
||||
{
|
||||
fprintf(stderr, "Only one subpath\n");
|
||||
if (const GpFileSystem_Web_Resources::FileCatalog *catalog = GetCatalogForVirtualDirectory(virtualDirectory))
|
||||
{
|
||||
fprintf(stderr, "Catalog matched. %i entries. %i size %i size0\n", static_cast<int>(catalog->m_numEntries), static_cast<int>(catalog->m_size), static_cast<int>(catalog->m_size0));
|
||||
for (size_t i = 0; i < catalog->m_numEntries; i++)
|
||||
{
|
||||
const GpFileSystem_Web_Resources::FileCatalogEntry &entry = catalog->m_entries[i];
|
||||
fprintf(stderr, "Comparing '%s' to '%s'\n", subPaths[0], entry.m_fileName);
|
||||
if (!strcmp(subPaths[0], entry.m_fileName))
|
||||
{
|
||||
fprintf(stderr, "File name matched\n");
|
||||
return new GpFileStream_Web_StaticMemFile(entry.m_data, entry.m_size);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "Catalog had no match\n");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "More paths, falling through...\n");
|
||||
|
||||
const char *mode = nullptr;
|
||||
bool canWrite = false;
|
||||
bool needResetPosition = false;
|
||||
@@ -494,7 +480,6 @@ GpIOStream *GpFileSystem_Web::OpenFileNested(PortabilityLayer::VirtualDirectory_
|
||||
|
||||
bool GpFileSystem_Web::DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &existed)
|
||||
{
|
||||
fprintf(stderr, "Delete file %s\n", path);
|
||||
if (const GpFileSystem_Web_Resources::FileCatalog *catalog = GetCatalogForVirtualDirectory(virtualDirectory))
|
||||
return false;
|
||||
|
||||
@@ -620,20 +605,10 @@ IGpDirectoryCursor *GpFileSystem_Web::ScanDirectoryNested(PortabilityLayer::Virt
|
||||
const GpFileSystem_Web_Resources::FileCatalog *GpFileSystem_Web::GetCatalogForVirtualDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory)
|
||||
{
|
||||
if (virtualDirectory == PortabilityLayer::VirtualDirectories::kApplicationData)
|
||||
{
|
||||
fprintf(stderr, "%i == %i\n", static_cast<int>(virtualDirectory), static_cast<int>(PortabilityLayer::VirtualDirectories::kApplicationData));
|
||||
fprintf(stderr, "%i size\n", GpFileSystem_Web_Resources::ApplicationData::GetCatalog().m_size);
|
||||
fprintf(stderr, "First name: %s\n", GpFileSystem_Web_Resources::ApplicationData::GetCatalog().m_entries[0].m_fileName);
|
||||
return &GpFileSystem_Web_Resources::ApplicationData::GetCatalog();
|
||||
}
|
||||
fprintf(stderr, "%i != %i\n", static_cast<int>(virtualDirectory), static_cast<int>(PortabilityLayer::VirtualDirectories::kApplicationData));
|
||||
|
||||
if (virtualDirectory == PortabilityLayer::VirtualDirectories::kGameData)
|
||||
{
|
||||
fprintf(stderr, "%i == %i\n", static_cast<int>(virtualDirectory), static_cast<int>(PortabilityLayer::VirtualDirectories::kGameData));
|
||||
return &GpFileSystem_Web_Resources::GameData::GetCatalog();
|
||||
}
|
||||
fprintf(stderr, "%i != %i\n", static_cast<int>(virtualDirectory), static_cast<int>(PortabilityLayer::VirtualDirectories::kGameData));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
@@ -100,8 +100,6 @@ namespace PortabilityLayer
|
||||
if (!stream)
|
||||
return nullptr;
|
||||
|
||||
fprintf(stderr, "Composite file opened\n");
|
||||
|
||||
ZipFileProxy *zipFile = ZipFileProxy::Create(stream);
|
||||
if (!zipFile)
|
||||
{
|
||||
@@ -109,8 +107,6 @@ namespace PortabilityLayer
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Zip proxy created\n");
|
||||
|
||||
size_t metaIndex = 0;
|
||||
if (!zipFile->IndexFile("!!meta", metaIndex))
|
||||
{
|
||||
@@ -118,8 +114,6 @@ namespace PortabilityLayer
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Meta file indexed\n");
|
||||
|
||||
MacFilePropertiesSerialized mfps;
|
||||
|
||||
GpIOStream *metaStream = zipFile->OpenFile(metaIndex);
|
||||
@@ -130,8 +124,6 @@ namespace PortabilityLayer
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Meta data deserialized\n");
|
||||
|
||||
if (!metaStream->ReadExact(mfps.m_data, sizeof(mfps.m_data)))
|
||||
{
|
||||
metaStream->Close();
|
||||
@@ -160,8 +152,6 @@ namespace PortabilityLayer
|
||||
stream = nullptr;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Composite constructed\n");
|
||||
|
||||
CompositeFile *compositeFile = CompositeFileImpl::Create(dirID, filename, stream, zipFile, mfp, hasResources, hasData, hasData ? dataIndex : 0);
|
||||
if (!compositeFile)
|
||||
{
|
||||
|
@@ -185,11 +185,9 @@ namespace PortabilityLayer
|
||||
ZipFileProxy *proxy = nullptr;
|
||||
bool proxyIsShared = false;
|
||||
|
||||
fprintf(stderr, "Trying to open resource file\n");
|
||||
if (file->OpenResources(fStream, proxy, proxyIsShared) != PLErrors::kNone)
|
||||
return nullptr;
|
||||
|
||||
fprintf(stderr, "Creating resource archive\n");
|
||||
IResourceArchive *archive = ResourceArchiveZipFile::Create(proxy, proxyIsShared, fStream);
|
||||
if (!archive)
|
||||
{
|
||||
|
@@ -285,29 +285,17 @@ namespace PortabilityLayer
|
||||
MemoryManager *mm = MemoryManager::GetInstance();
|
||||
|
||||
if (!stream->SeekEnd(sizeof(ZipEndOfCentralDirectoryRecord)))
|
||||
{
|
||||
fprintf(stderr, "Seek end failed\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ZipEndOfCentralDirectoryRecord eocd;
|
||||
if (stream->Read(&eocd, sizeof(eocd)) != sizeof(eocd))
|
||||
{
|
||||
fprintf(stderr, "EOCD read failed\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (eocd.m_signature != ZipEndOfCentralDirectoryRecord::kSignature)
|
||||
{
|
||||
fprintf(stderr, "EOCD sig check failed\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!stream->SeekStart(eocd.m_centralDirStartOffset))
|
||||
{
|
||||
fprintf(stderr, "CDir seek failed\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const size_t centralDirSize = eocd.m_centralDirectorySizeBytes;
|
||||
void *centralDirImage = nullptr;
|
||||
@@ -330,8 +318,6 @@ namespace PortabilityLayer
|
||||
|
||||
if (stream->Read(centralDirImage, centralDirSize) != centralDirSize)
|
||||
{
|
||||
fprintf(stderr, "CDir image read failed\n");
|
||||
|
||||
mm->Release(centralDirFiles);
|
||||
mm->Release(centralDirImage);
|
||||
return nullptr;
|
||||
@@ -348,8 +334,6 @@ namespace PortabilityLayer
|
||||
{
|
||||
if (centralDirEnd - centralDirCursor < sizeof(ZipCentralDirectoryFileHeader))
|
||||
{
|
||||
fprintf(stderr, "CDir read failed point 1\n");
|
||||
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
@@ -361,24 +345,18 @@ namespace PortabilityLayer
|
||||
|
||||
if (centralDirHeader.m_signature != ZipCentralDirectoryFileHeader::kSignature)
|
||||
{
|
||||
fprintf(stderr, "CDir read failed point 2\n");
|
||||
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (centralDirEnd - centralDirCursor < centralDirHeader.m_fileNameLength)
|
||||
{
|
||||
fprintf(stderr, "CDir read failed point 3\n");
|
||||
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!CheckAndFixFileName(centralDirCursor, centralDirHeader.m_fileNameLength))
|
||||
{
|
||||
fprintf(stderr, "CDir read failed point 4\n");
|
||||
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
@@ -387,8 +365,6 @@ namespace PortabilityLayer
|
||||
|
||||
if (centralDirEnd - centralDirCursor < centralDirHeader.m_extraFieldLength)
|
||||
{
|
||||
fprintf(stderr, "CDir read failed point 5\n");
|
||||
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
@@ -397,8 +373,6 @@ namespace PortabilityLayer
|
||||
|
||||
if (centralDirEnd - centralDirCursor < centralDirHeader.m_commentLength)
|
||||
{
|
||||
fprintf(stderr, "CDir read failed point 6\n");
|
||||
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
@@ -422,8 +396,6 @@ namespace PortabilityLayer
|
||||
{
|
||||
if (ZipDirectorySortPredicate(centralDirFiles + (i - 1), centralDirFiles + i) == 0)
|
||||
{
|
||||
fprintf(stderr, "File names were duplicated\n");
|
||||
|
||||
// Duplicate file names
|
||||
mm->Release(centralDirFiles);
|
||||
mm->Release(centralDirImage);
|
||||
|
Reference in New Issue
Block a user