Lower case file names for linux.

This commit is contained in:
leo 2012-10-04 21:08:05 +00:00
parent 0b348af6a7
commit b1c1c6bf11

View file

@ -319,10 +319,14 @@ bool lcPiecesLibrary::LoadPiece(PieceInfo* Info)
} }
else else
{ {
char Name[LC_PIECE_NAME_LEN];
strcpy(Name, Info->m_strName);
strlwr(Name);
char FileName[LC_MAXPATH]; char FileName[LC_MAXPATH];
lcDiskFile PieceFile; lcDiskFile PieceFile;
sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Info->m_strName); sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Name);
if (!PieceFile.Open(FileName, "rt")) if (!PieceFile.Open(FileName, "rt"))
return false; return false;
@ -443,13 +447,17 @@ bool lcPiecesLibrary::LoadPrimitive(int PrimitiveIndex)
} }
else else
{ {
char Name[LC_PIECE_NAME_LEN];
strcpy(Name, Primitive->mName);
strlwr(Name);
char FileName[LC_MAXPATH]; char FileName[LC_MAXPATH];
lcDiskFile PrimFile; lcDiskFile PrimFile;
if (Primitive->mSubFile) if (Primitive->mSubFile)
sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Primitive->mName); sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Name);
else else
sprintf(FileName, "%sp/%s.dat", mLibraryPath, Primitive->mName); sprintf(FileName, "%sp/%s.dat", mLibraryPath, Name);
if (!PrimFile.Open(FileName, "rt")) if (!PrimFile.Open(FileName, "rt"))
return false; return false;
@ -549,13 +557,17 @@ bool lcPiecesLibrary::ReadMeshData(lcFile& File, const lcMatrix44& CurrentTransf
} }
else else
{ {
char Name[LC_PIECE_NAME_LEN];
strcpy(Name, Primitive->mName);
strlwr(Name);
char FileName[LC_MAXPATH]; char FileName[LC_MAXPATH];
lcDiskFile IncludeFile; lcDiskFile IncludeFile;
if (Primitive->mSubFile) if (Primitive->mSubFile)
sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Primitive->mName); sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Name);
else else
sprintf(FileName, "%sp/%s.dat", mLibraryPath, Primitive->mName); sprintf(FileName, "%sp/%s.dat", mLibraryPath, Name);
if (!IncludeFile.Open(FileName, "rt")) if (!IncludeFile.Open(FileName, "rt"))
continue; continue;
@ -586,10 +598,14 @@ bool lcPiecesLibrary::ReadMeshData(lcFile& File, const lcMatrix44& CurrentTransf
} }
else else
{ {
char Name[LC_PIECE_NAME_LEN];
strcpy(Name, Info->m_strName);
strlwr(Name);
char FileName[LC_MAXPATH]; char FileName[LC_MAXPATH];
lcDiskFile IncludeFile; lcDiskFile IncludeFile;
sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Info->m_strName); sprintf(FileName, "%sparts/%s.dat", mLibraryPath, Name);
if (!IncludeFile.Open(FileName, "rt")) if (!IncludeFile.Open(FileName, "rt"))
break; break;