Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions mp/src/public/sentence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void CSentence::ParsePlaintext( CUtlBuffer& buf )
text[ 0 ] = 0;
while ( 1 )
{
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( !stricmp( token, "}" ) )
break;

Expand All @@ -473,19 +473,19 @@ void CSentence::ParseWords( CUtlBuffer& buf )

while ( 1 )
{
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( !stricmp( token, "}" ) )
break;

if ( stricmp( token, "WORD" ) )
break;

buf.GetString( token );
buf.GetString( token, sizeof(token) );
Q_strncpy( word, token, sizeof( word ) );

buf.GetString( token );
buf.GetString( token, sizeof(token) );
start = atof( token );
buf.GetString( token );
buf.GetString( token, sizeof(token) );
end = atof( token );

CWordTag *wt = new CWordTag( word );
Expand All @@ -495,13 +495,13 @@ void CSentence::ParseWords( CUtlBuffer& buf )

AddWordTag( wt );

buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( stricmp( token, "{" ) )
break;

while ( 1 )
{
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( !stricmp( token, "}" ) )
break;

Expand All @@ -513,13 +513,13 @@ void CSentence::ParseWords( CUtlBuffer& buf )

code = atoi( token );

buf.GetString( token );
buf.GetString( token, sizeof(token) );
Q_strncpy( phonemename, token, sizeof( phonemename ) );
buf.GetString( token );
buf.GetString( token, sizeof(token) );
start = atof( token );
buf.GetString( token );
buf.GetString( token, sizeof(token) );
end = atof( token );
buf.GetString( token );
buf.GetString( token, sizeof(token) );
volume = atof( token );

CPhonemeTag *pt = new CPhonemeTag();
Expand All @@ -539,13 +539,13 @@ void CSentence::ParseEmphasis( CUtlBuffer& buf )
char token[ 4096 ];
while ( 1 )
{
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( !stricmp( token, "}" ) )
break;

char t[ 256 ];
Q_strncpy( t, token, sizeof( t ) );
buf.GetString( token );
buf.GetString( token, sizeof(token) );

char value[ 256 ];
Q_strncpy( value, token, sizeof( value ) );
Expand Down Expand Up @@ -573,15 +573,15 @@ void CSentence::ParseCloseCaption( CUtlBuffer& buf )
// PHRASE char streamlength "streambytes" starttime endtime
// PHRASE unicode streamlength "streambytes" starttime endtime
// }
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( !stricmp( token, "}" ) )
break;

buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( stricmp( token, "{" ) )
break;

buf.GetString( token );
buf.GetString( token, sizeof(token) );
while ( 1 )
{
if ( !stricmp( token, "}" ) )
Expand All @@ -596,7 +596,7 @@ void CSentence::ParseCloseCaption( CUtlBuffer& buf )

memset( cc_stream, 0, sizeof( cc_stream ) );

buf.GetString( token );
buf.GetString( token, sizeof(token) );
Q_strncpy( cc_type, token, sizeof( cc_type ) );

bool unicode = false;
Expand All @@ -609,7 +609,7 @@ void CSentence::ParseCloseCaption( CUtlBuffer& buf )
Assert( 0 );
}

buf.GetString( token );
buf.GetString( token, sizeof(token) );
cc_length = atoi( token );
Assert( cc_length >= 0 && cc_length < sizeof( cc_stream ) );
// Skip space
Expand All @@ -619,10 +619,10 @@ void CSentence::ParseCloseCaption( CUtlBuffer& buf )

// Skip space
buf.GetChar();
buf.GetString( token );
buf.GetString( token );
buf.GetString( token, sizeof(token) );
buf.GetString( token, sizeof(token) );

buf.GetString( token );
buf.GetString( token, sizeof(token) );
}
}
}
Expand All @@ -632,7 +632,7 @@ void CSentence::ParseOptions( CUtlBuffer& buf )
char token[ 4096 ];
while ( 1 )
{
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( !stricmp( token, "}" ) )
break;

Expand All @@ -642,7 +642,7 @@ void CSentence::ParseOptions( CUtlBuffer& buf )
char key[ 256 ];
Q_strncpy( key, token, sizeof( key ) );
char value[ 256 ];
buf.GetString( token );
buf.GetString( token, sizeof(token) );
Q_strncpy( value, token, sizeof( value ) );

if ( !strcmpi( key, "voice_duck" ) )
Expand All @@ -668,14 +668,14 @@ void CSentence::ParseDataVersionOnePointZero( CUtlBuffer& buf )

while ( 1 )
{
buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( strlen( token ) <= 0 )
break;

char section[ 256 ];
Q_strncpy( section, token, sizeof( section ) );

buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( stricmp( token, "{" ) )
break;

Expand Down Expand Up @@ -1042,12 +1042,12 @@ void CSentence::InitFromBuffer( CUtlBuffer& buf )
Reset();

char token[ 4096 ];
buf.GetString( token );
buf.GetString( token, sizeof(token) );

if ( stricmp( token, "VERSION" ) )
return;

buf.GetString( token );
buf.GetString( token, sizeof(token) );
if ( atof( token ) == 1.0f )
{
ParseDataVersionOnePointZero( buf );
Expand Down