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.

47 lines
1.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "stdafx.h"
  14. #include "MapStudioModel.h"
  15. #include "ModelFactory.h"
  16. //-----------------------------------------------------------------------------
  17. // Purpose:
  18. // Input : eModelType -
  19. // pszModelData -
  20. // Output :
  21. //-----------------------------------------------------------------------------
  22. CMapClass *CModelFactory::CreateModel(ModelType_t eModelType, const char *pszModelData)
  23. {
  24. switch (eModelType)
  25. {
  26. case ModelTypeStudio:
  27. {
  28. int nLen = strlen(pszModelData);
  29. if ((nLen > 4) && (!stricmp(&pszModelData[nLen - 4], ".mdl")))
  30. {
  31. CMapStudioModel *pModel = new CMapStudioModel(pszModelData);
  32. return(pModel);
  33. }
  34. break;
  35. }
  36. default:
  37. {
  38. break;
  39. }
  40. }
  41. return(NULL);
  42. }