Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.6 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. //#include "studio.h"
  7. #include "studio.h"
  8. #include "datacache/imdlcache.h"
  9. #include "istudiorender.h"
  10. #include "tier3/tier3.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include "tier0/memdbgon.h"
  13. //-----------------------------------------------------------------------------
  14. // FIXME: This trashy glue code is really not acceptable. Figure out a way of making it unnecessary.
  15. //-----------------------------------------------------------------------------
  16. const studiohdr_t *studiohdr_t::FindModel( void **cache, char const *pModelName ) const
  17. {
  18. MDLHandle_t handle = g_pMDLCache->FindMDL( pModelName );
  19. *cache = (void*)(uintp)handle;
  20. return g_pMDLCache->GetStudioHdr( handle );
  21. }
  22. virtualmodel_t *studiohdr_t::GetVirtualModel( void ) const
  23. {
  24. return g_pMDLCache->GetVirtualModel( VoidPtrToMDLHandle( VirtualModel() ) );
  25. }
  26. byte *studiohdr_t::GetAnimBlock( int i, bool preloadIfMissing ) const
  27. {
  28. return g_pMDLCache->GetAnimBlock( VoidPtrToMDLHandle( VirtualModel() ), i, preloadIfMissing );
  29. }
  30. // Shame that this code is duplicated... :(
  31. bool studiohdr_t::hasAnimBlockBeenPreloaded( int i ) const
  32. {
  33. return g_pMDLCache->HasAnimBlockBeenPreloaded( VoidPtrToMDLHandle( VirtualModel() ), i );
  34. }
  35. int studiohdr_t::GetAutoplayList( unsigned short **pOut ) const
  36. {
  37. return g_pMDLCache->GetAutoplayList( VoidPtrToMDLHandle( VirtualModel() ), pOut );
  38. }
  39. const studiohdr_t *virtualgroup_t::GetStudioHdr( void ) const
  40. {
  41. return g_pMDLCache->GetStudioHdr( VoidPtrToMDLHandle( cache ) );
  42. }