Initial Mapbase commit (squashed from mapbase-beta)

This commit is contained in:
Blixibon
2019-08-31 19:28:20 +00:00
parent 0d8dceea43
commit 3d464bc051
816 changed files with 105527 additions and 957 deletions

View File

@@ -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)
{