Add raw scene file support to GetSceneDuration()

This commit is contained in:
ALLEN-PC\acj30 2024-03-07 00:13:41 -06:00 committed by Blixibon
parent b19f329d5f
commit f5db760a66

View File

@ -5298,6 +5298,23 @@ float GetSceneDuration( char const *pszScene )
{
msecs = cachedData.msecs;
}
#ifdef MAPBASE
else
{
// Raw scene file support
void *pBuffer = NULL;
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, true ))
{
g_TokenProcessor.SetBuffer((char*)pBuffer);
CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf );
g_TokenProcessor.SetBuffer(NULL);
float flDuration = pScene->GetDuration();
delete pScene;
return flDuration;
}
}
#endif
return (float)msecs * 0.001f;
}