From 2e9a6c24150b7ce7999088c35096fedd05e972c1 Mon Sep 17 00:00:00 2001 From: Thomas Kain Date: Fri, 7 Aug 2026 18:57:54 -0400 Subject: [PATCH] Add raw scene file support to TF player model panel --- .../client/tf/vgui/tf_playermodelpanel.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/game/client/tf/vgui/tf_playermodelpanel.cpp b/src/game/client/tf/vgui/tf_playermodelpanel.cpp index 53715b62e66..abc67473ff6 100644 --- a/src/game/client/tf/vgui/tf_playermodelpanel.cpp +++ b/src/game/client/tf/vgui/tf_playermodelpanel.cpp @@ -29,6 +29,10 @@ #include "halloween/tf_weapon_spellbook.h" #include "matsys_controls/matsyscontrols.h" +#ifdef MAPBASE +#include "filesystem.h" +#endif + // memdbgon must be the last include file in a .cpp file!!! #include @@ -406,6 +410,26 @@ CChoreoScene *LoadSceneForModel( const char *filename, IChoreoEventCallback *pCa V_SetExtension( loadfile, ".vcd", sizeof( loadfile ) ); V_FixSlashes( loadfile ); +#ifdef MAPBASE + // + // Raw scene file support + // + char *pBuffer = NULL; + size_t bufsize = scenefilecache->GetSceneBufferSize( loadfile ); + if ( bufsize > 0 ) + { + pBuffer = new char[ bufsize ]; + if ( !scenefilecache->GetSceneData( filename, (byte *)pBuffer, bufsize ) ) + { + delete[] pBuffer; + return NULL; + } + } + else if ( !filesystem->ReadFileEx( loadfile, NULL, (void **)&pBuffer, true ) ) + { + return NULL; + } +#else char *pBuffer = NULL; size_t bufsize = scenefilecache->GetSceneBufferSize( loadfile ); if ( bufsize <= 0 ) @@ -417,6 +441,7 @@ CChoreoScene *LoadSceneForModel( const char *filename, IChoreoEventCallback *pCa delete[] pBuffer; return NULL; } +#endif CChoreoScene *pScene; if ( IsBufferBinaryVCD( pBuffer, bufsize ) )