cache FName conversion for GetGlobalShader
This commit is contained in:
parent
b27d094def
commit
f522296970
3 changed files with 5 additions and 4 deletions
|
|
@ -1386,6 +1386,7 @@ void G_DoLoadLevel(const FString &nextmapname, int position, bool autosave, bool
|
|||
void FLevelLocals::DoLoadLevel(const FString &nextmapname, int position, bool autosave, bool newGame)
|
||||
{
|
||||
MapName = nextmapname;
|
||||
MapFName = MapName;
|
||||
int i;
|
||||
|
||||
if (NextSkill >= 0)
|
||||
|
|
|
|||
|
|
@ -540,6 +540,7 @@ public:
|
|||
int lumpnum;
|
||||
FString LevelName;
|
||||
FString MapName; // the lump name (E1M1, MAP01, etc)
|
||||
FName MapFName; // cache name index for lump
|
||||
FString NextMap; // go here when using the regular exit
|
||||
FString NextSecretMap; // map to go to when used secret exit
|
||||
FString AuthorName;
|
||||
|
|
|
|||
|
|
@ -92,11 +92,10 @@ const GlobalShaderDesc * GetGlobalShader(int shaderNum, PClass * curActor, Globa
|
|||
}
|
||||
}
|
||||
|
||||
FName MapName = level.MapName;
|
||||
shader = mapshaders[shaderNum].CheckKey(MapName);
|
||||
shader = mapshaders[shaderNum].CheckKey(level.MapFName);
|
||||
if(shader && shader->shaderindex > 0)
|
||||
{
|
||||
addr = {int16_t(shaderNum), 1, MapName.GetIndex()};
|
||||
addr = {int16_t(shaderNum), 1, level.MapFName.GetIndex()};
|
||||
return shader;
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +126,7 @@ const GlobalShaderDesc * GetGlobalShader(int shaderNum, PClass * curActor)
|
|||
|
||||
const GlobalShaderDesc * GetGlobalShader(GlobalShaderAddr index)
|
||||
{
|
||||
if(index.num > NUM_BUILTIN_SHADERS || index.type > 2) return &nullglobalshader;
|
||||
if(index.num >= NUM_BUILTIN_SHADERS || index.type > 2) return &nullglobalshader;
|
||||
|
||||
if(index.type == 0) return &globalshaders[index.num];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue