working on rendering
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
CUtlVector<CUtlString> tier1_CompiledFiles = {
|
||||
"tier1/interface.cpp",
|
||||
"tier1/appinit.cpp",
|
||||
"tier1/commandline.cpp",
|
||||
"tier1/utlbuffer.cpp",
|
||||
"tier1/utlmap.cpp",
|
||||
|
||||
13
tier1/appinit.cpp
Normal file
13
tier1/appinit.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "tier1/appinit.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "tier0/platform.h"
|
||||
|
||||
void AppInitializePath()
|
||||
{
|
||||
const char *szPath = Plat_GetExecutablePath();
|
||||
CUtlString szEnv = Plat_GetEnv("PATH");
|
||||
printf("%s\n",szEnv.GetString());
|
||||
szEnv.AppendTail(":");
|
||||
szEnv.AppendTail(szPath);
|
||||
Plat_SetEnv("PATH", szEnv);
|
||||
}
|
||||
@@ -27,3 +27,8 @@ void *CreateInterface( const char *szName, int *pReturnCode )
|
||||
*pReturnCode = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
CreateInterfaceFn Plat_GetInterfaceFactory( void *lib )
|
||||
{
|
||||
return (CreateInterfaceFn)Plat_GetProc(lib, "CreateInterface");
|
||||
}
|
||||
|
||||
@@ -62,16 +62,83 @@ void CUtlString::AppendAt( size_t nPosition, const char *psz )
|
||||
|
||||
void CUtlString::RemoveTail( size_t nCount )
|
||||
{
|
||||
|
||||
m_data.RemoveTail(nCount);
|
||||
m_data[m_data.GetSize()-1] = 0;
|
||||
}
|
||||
void CUtlString::RemoveHead( size_t nCount )
|
||||
{
|
||||
|
||||
m_data.RemoveHead(nCount);
|
||||
}
|
||||
void CUtlString::RemoveAt( size_t nPosition, size_t nCount )
|
||||
{
|
||||
|
||||
}
|
||||
CUtlString CUtlString::GetFileName()
|
||||
{
|
||||
CUtlString szFileName = GetString();
|
||||
|
||||
char *pLast = &m_data[GetLenght()-1];
|
||||
while (pLast != m_data.GetData())
|
||||
{
|
||||
if (*pLast=='/')
|
||||
break;
|
||||
pLast--;
|
||||
}
|
||||
|
||||
return pLast;
|
||||
}
|
||||
CUtlString CUtlString::GetDirectory()
|
||||
{
|
||||
if (GetLenght() == 0)
|
||||
return NULL;
|
||||
size_t iNumDeleted = 0;
|
||||
char *pLast = &m_data[GetLenght()-1];
|
||||
CUtlString szDirectory = GetString();
|
||||
while (pLast != m_data.GetData())
|
||||
{
|
||||
if (*pLast=='/')
|
||||
{
|
||||
iNumDeleted++;
|
||||
break;
|
||||
}
|
||||
pLast--;
|
||||
iNumDeleted++;
|
||||
}
|
||||
|
||||
szDirectory.RemoveTail(iNumDeleted);
|
||||
|
||||
return szDirectory;
|
||||
}
|
||||
CUtlString CUtlString::RemoveHeadFile()
|
||||
{
|
||||
size_t iLenght = GetLenght();
|
||||
size_t iNumDeleted = 0;
|
||||
char *pc = GetString();
|
||||
CUtlString szDirectory = pc;
|
||||
|
||||
if (GetLenght() == 0)
|
||||
return NULL;
|
||||
while ( iNumDeleted < iLenght )
|
||||
{
|
||||
if (*pc == '/')
|
||||
goto remove_slashes;
|
||||
pc++;
|
||||
iNumDeleted++;
|
||||
}
|
||||
return NULL;
|
||||
remove_slashes:
|
||||
while ( iNumDeleted < iLenght )
|
||||
{
|
||||
if (*pc != '/')
|
||||
{
|
||||
szDirectory.RemoveHead(iNumDeleted);
|
||||
return szDirectory;
|
||||
}
|
||||
pc++;
|
||||
iNumDeleted++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *CUtlString::GetString( void )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user