summaryrefslogtreecommitdiff
path: root/hammer/modelfactory.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/modelfactory.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'hammer/modelfactory.cpp')
-rw-r--r--hammer/modelfactory.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/hammer/modelfactory.cpp b/hammer/modelfactory.cpp
new file mode 100644
index 0000000..122a113
--- /dev/null
+++ b/hammer/modelfactory.cpp
@@ -0,0 +1,47 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+//
+//-----------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "stdafx.h"
+#include "MapStudioModel.h"
+#include "ModelFactory.h"
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : eModelType -
+// pszModelData -
+// Output :
+//-----------------------------------------------------------------------------
+CMapClass *CModelFactory::CreateModel(ModelType_t eModelType, const char *pszModelData)
+{
+ switch (eModelType)
+ {
+ case ModelTypeStudio:
+ {
+ int nLen = strlen(pszModelData);
+ if ((nLen > 4) && (!stricmp(&pszModelData[nLen - 4], ".mdl")))
+ {
+ CMapStudioModel *pModel = new CMapStudioModel(pszModelData);
+ return(pModel);
+ }
+ break;
+ }
+
+ default:
+ {
+ break;
+ }
+ }
+
+ return(NULL);
+}