mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Initial Mapbase commit (squashed from mapbase-beta)
This commit is contained in:
@@ -986,6 +986,57 @@ void UTIL_StringToColor32( color32 *color, const char *pString )
|
||||
color->a = tmp[3];
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
void UTIL_StringToFloatArray_PreserveArray( float *pVector, int count, const char *pString )
|
||||
{
|
||||
char *pstr, *pfront, tempString[128];
|
||||
int j;
|
||||
|
||||
Q_strncpy( tempString, pString, sizeof(tempString) );
|
||||
pstr = pfront = tempString;
|
||||
|
||||
for ( j = 0; j < count; j++ ) // lifted from pr_edict.c
|
||||
{
|
||||
pVector[j] = atof( pfront );
|
||||
|
||||
// skip any leading whitespace
|
||||
while ( *pstr && *pstr <= ' ' )
|
||||
pstr++;
|
||||
|
||||
// skip to next whitespace
|
||||
while ( *pstr && *pstr > ' ' )
|
||||
pstr++;
|
||||
|
||||
if (!*pstr)
|
||||
break;
|
||||
|
||||
pstr++;
|
||||
pfront = pstr;
|
||||
}
|
||||
}
|
||||
|
||||
void UTIL_StringToIntArray_PreserveArray( int *pVector, int count, const char *pString )
|
||||
{
|
||||
char *pstr, *pfront, tempString[128];
|
||||
int j;
|
||||
|
||||
Q_strncpy( tempString, pString, sizeof(tempString) );
|
||||
pstr = pfront = tempString;
|
||||
|
||||
for ( j = 0; j < count; j++ ) // lifted from pr_edict.c
|
||||
{
|
||||
pVector[j] = atoi( pfront );
|
||||
|
||||
while ( *pstr && *pstr != ' ' )
|
||||
pstr++;
|
||||
if (!*pstr)
|
||||
break;
|
||||
pstr++;
|
||||
pfront = pstr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _XBOX
|
||||
void UTIL_DecodeICE( unsigned char * buffer, int size, const unsigned char *key)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user