Removed lcArray.

This commit is contained in:
Leonardo Zide 2024-05-13 19:59:37 -07:00
parent 274b5816f5
commit 4e27344f39
6 changed files with 9 additions and 14 deletions

View file

@ -3631,7 +3631,7 @@ bool lcBlenderPreferences::ExtractAddon(const QString FileName, QString& Result)
int Extracted = 0;
for (int FileIdx = 0; FileIdx < ZipFile.mFiles.GetSize(); FileIdx++)
for (quint32 FileIdx = 0; FileIdx < ZipFile.mFiles.size(); FileIdx++)
{
ZipFileInfo FileInfo(ZipFile.mFiles[FileIdx]);
quint32 Mode = FileInfo.ZipInfo.external_fa;
@ -3742,7 +3742,7 @@ bool lcBlenderPreferences::ExtractAddon(const QString FileName, QString& Result)
}
if (!Ok)
Result = tr("%1 of %2 files extracted.").arg(Extracted).arg(ZipFile.mFiles.GetSize());
Result = tr("%1 of %2 files extracted.").arg(Extracted).arg(ZipFile.mFiles.size());
return Ok;
}

View file

@ -379,7 +379,7 @@ bool lcPiecesLibrary::OpenArchive(std::unique_ptr<lcFile> File, lcZipFileType Zi
std::unique_ptr<lcLibrarySource> Source(new lcLibrarySource);
Source->Type = ZipFileType != lcZipFileType::StudStyle ? lcLibrarySourceType::Library : lcLibrarySourceType::StudStyle;
for (int FileIdx = 0; FileIdx < ZipFile->mFiles.GetSize(); FileIdx++)
for (quint32 FileIdx = 0; FileIdx < ZipFile->mFiles.size(); FileIdx++)
{
lcZipFileInfo& FileInfo = ZipFile->mFiles[FileIdx];
char NameBuffer[LC_PIECE_NAME_LEN];

View file

@ -1515,8 +1515,6 @@ lcMesh* lcSynthInfo::CreateMesh(const std::vector<lcPieceControlPoint>& ControlP
AddParts(File, MeshData, Sections);
File.WriteU8(0);
lcArray<lcMeshLoaderTextureMap> TextureStack;
File.Seek(0, SEEK_SET);
lcMeshLoader MeshLoader(MeshData, false, nullptr, false);

View file

@ -352,12 +352,12 @@ bool lcZipFile::ReadCentralDir()
quint64 PosInCentralDir = mCentralDirOffset;
mFile->Seek(PosInCentralDir + mBytesBeforeZipFile, SEEK_SET);
mFiles.AllocGrow((int)mNumEntries);
mFiles.reserve(mNumEntries);
for (quint64 FileNum = 0; FileNum < mNumEntries; FileNum++)
{
quint32 Magic, Number32;
lcZipFileInfo& FileInfo = mFiles.Add();
lcZipFileInfo& FileInfo = mFiles.emplace_back();
long Seek = 0;
FileInfo.write_buffer = nullptr;
@ -569,7 +569,7 @@ bool lcZipFile::ReadCentralDir()
bool lcZipFile::ExtractFile(const char* FileName, lcMemFile& File, quint32 MaxLength)
{
for (int FileIdx = 0; FileIdx < mFiles.GetSize(); FileIdx++)
for (quint32 FileIdx = 0; FileIdx < mFiles.size(); FileIdx++)
{
lcZipFileInfo& FileInfo = mFiles[FileIdx];
@ -580,7 +580,7 @@ bool lcZipFile::ExtractFile(const char* FileName, lcMemFile& File, quint32 MaxLe
return false;
}
bool lcZipFile::ExtractFile(int FileIndex, lcMemFile& File, quint32 MaxLength)
bool lcZipFile::ExtractFile(quint32 FileIndex, lcMemFile& File, quint32 MaxLength)
{
QMutexLocker Lock(&mMutex);

View file

@ -1,7 +1,5 @@
#pragma once
#include "lc_array.h"
#ifdef DeleteFile
#undef DeleteFile
#endif
@ -61,10 +59,10 @@ public:
bool OpenRead(std::unique_ptr<lcFile> File);
bool OpenWrite(const QString& FileName);
bool ExtractFile(int FileIndex, lcMemFile& File, quint32 MaxLength = 0xffffffff);
bool ExtractFile(quint32 FileIndex, lcMemFile& File, quint32 MaxLength = 0xffffffff);
bool ExtractFile(const char* FileName, lcMemFile& File, quint32 MaxLength = 0xffffffff);
lcArray<lcZipFileInfo> mFiles;
std::vector<lcZipFileInfo> mFiles;
protected:
bool Open();

View file

@ -86,7 +86,6 @@ void PieceInfo::SetModel(lcModel* Model, bool UpdateMesh, Project* CurrentProjec
}
lcLibraryMeshData MeshData;
lcArray<lcMeshLoaderTextureMap> TextureStack;
PieceFile.Seek(0, SEEK_SET);
lcMeshLoader MeshLoader(MeshData, true, CurrentProject, SearchProjectFolder);