mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-05-15 16:22:28 +03:00
Add raw scene file support to GetSceneDuration()
This commit is contained in:
parent
b19f329d5f
commit
f5db760a66
@ -5298,6 +5298,23 @@ float GetSceneDuration( char const *pszScene )
|
|||||||
{
|
{
|
||||||
msecs = cachedData.msecs;
|
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;
|
return (float)msecs * 0.001f;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user