mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
Update usage of LastIndexOf
Now that LastIndexOf works properly, update the code that uses it to find OBJ models Also, make UE1 model finder use LastIndexOf
This commit is contained in:
parent
a38b0813cf
commit
55d1613ea4
1 changed files with 4 additions and 4 deletions
|
@ -420,7 +420,7 @@ static unsigned FindModel(const char * path, const char * modelfile)
|
||||||
FMemLump lumpd = Wads.ReadLump(lump);
|
FMemLump lumpd = Wads.ReadLump(lump);
|
||||||
char * buffer = (char*)lumpd.GetMem();
|
char * buffer = (char*)lumpd.GetMem();
|
||||||
|
|
||||||
if ( (size_t)fullname.IndexOf("_d.3d") == fullname.Len()-5 )
|
if ( (size_t)fullname.LastIndexOf("_d.3d") == fullname.Len()-5 )
|
||||||
{
|
{
|
||||||
FString anivfile = fullname.GetChars();
|
FString anivfile = fullname.GetChars();
|
||||||
anivfile.Substitute("_d.3d","_a.3d");
|
anivfile.Substitute("_d.3d","_a.3d");
|
||||||
|
@ -429,7 +429,7 @@ static unsigned FindModel(const char * path, const char * modelfile)
|
||||||
model = new FUE1Model;
|
model = new FUE1Model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( (size_t)fullname.IndexOf("_a.3d") == fullname.Len()-5 )
|
else if ( (size_t)fullname.LastIndexOf("_a.3d") == fullname.Len()-5 )
|
||||||
{
|
{
|
||||||
FString datafile = fullname.GetChars();
|
FString datafile = fullname.GetChars();
|
||||||
datafile.Substitute("_a.3d","_d.3d");
|
datafile.Substitute("_a.3d","_d.3d");
|
||||||
|
@ -438,8 +438,8 @@ static unsigned FindModel(const char * path, const char * modelfile)
|
||||||
model = new FUE1Model;
|
model = new FUE1Model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( (size_t)fullname.LastIndexOf(".obj") == fullname.Len() - 1 )
|
else if ( (size_t)fullname.LastIndexOf(".obj") == fullname.Len() - 4 )
|
||||||
{ // LastIndexOf works differently than it does in JavaScript
|
{
|
||||||
model = new FOBJModel;
|
model = new FOBJModel;
|
||||||
}
|
}
|
||||||
else if (!memcmp(buffer, "DMDM", 4))
|
else if (!memcmp(buffer, "DMDM", 4))
|
||||||
|
|
Loading…
Reference in a new issue