Skip to content

Commit

Permalink
Removed lcArray.
Browse files Browse the repository at this point in the history
  • Loading branch information
leozide committed May 14, 2024
1 parent 274b581 commit 4e27344
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions common/lc_blenderpreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion common/lc_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 0 additions & 2 deletions common/lc_synth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions common/lc_zipfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];

Expand All @@ -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);

Expand Down
6 changes: 2 additions & 4 deletions common/lc_zipfile.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "lc_array.h"

#ifdef DeleteFile
#undef DeleteFile
#endif
Expand Down Expand Up @@ -61,10 +59,10 @@ class lcZipFile
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();
Expand Down
1 change: 0 additions & 1 deletion common/pieceinf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4e27344

Please sign in to comment.