no engine anymore

This commit is contained in:
2025-07-30 23:53:26 +03:00
parent 8a29e6b86f
commit 395ced9e28
159 changed files with 2767 additions and 9484 deletions

View File

@@ -1,16 +1,33 @@
#include "tier1/commandline.h"
#include "tier1/utlvector.h"
CUtlVector<char*> cl_params;
void ICommandLine::CreateCommandLine( int argc, char **argv )
class CCommandLine : public ICommandLine
{
cl_params.AppendTail(argv,argc);
public:
virtual void CreateCommandLine( int argc, char **argv ) override;
virtual bool CheckParam( const char *psz ) override;
virtual char *ParamValue( const char* psz, const char *szDefaultValue = 0 ) override;
virtual void AddParam( char *psz ) override;
virtual void RemoveParam( char *psz ) override;
virtual int ParamCount() override;
virtual int FindParam( const char *psz ) override;
virtual const char *GetParam(int nIndex) override;
private:
CUtlVector<char*> m_params;
};
void CCommandLine::CreateCommandLine( int argc, char **argv )
{
m_params.AppendTail(argv,argc);
}
bool ICommandLine::CheckParam( const char *psz )
bool CCommandLine::CheckParam( const char *psz )
{
for (auto szParam: cl_params) {
for (auto szParam: m_params) {
if (!V_strcmp(szParam, psz))
{
return true;
@@ -19,44 +36,49 @@ bool ICommandLine::CheckParam( const char *psz )
return false;
}
char *ICommandLine::ParamValue( const char *psz, const char *szDefaultValue )
char *CCommandLine::ParamValue( const char *psz, const char *szDefaultValue )
{
int i = 0;
for (auto szParam: cl_params) {
for (auto szParam: m_params) {
i++;
if (i>=cl_params.GetSize())
if (i>=m_params.GetSize())
break;
if (!V_strcmp(szParam, psz))
return cl_params[i];
return m_params[i];
}
return (char*)szDefaultValue;
}
void ICommandLine::AddParam( char *psz )
void CCommandLine::AddParam( char *psz )
{
m_params.AppendTail(psz);
}
void ICommandLine::RemoveParam( char *psz )
void CCommandLine::RemoveParam( char *psz )
{
}
int ICommandLine::ParamCount()
int CCommandLine::ParamCount()
{
return cl_params.GetSize();
return m_params.GetSize();
}
int ICommandLine::FindParam( const char *psz )
int CCommandLine::FindParam( const char *psz )
{
int i = 0;
for (auto szParam: cl_params) {
for (auto szParam: m_params) {
if (!V_strcmp(szParam, psz))
return i;
i++;
}
return 0;
}
const char *ICommandLine::GetParam(int nIndex)
const char *CCommandLine::GetParam(int nIndex)
{
return cl_params[nIndex];
return m_params[nIndex];
}
static ICommandLine g_CommandLine;
ICommandLine *CommandLine()
{
static CCommandLine s_CommandLine;
return &s_CommandLine;
}