~armagetronad-sty-0.3/armagetronad/armagetronad-v2sty

« back to all changes in this revision

Viewing changes to src/tools/tString.cpp

  • Committer: Kyle
  • Date: 2009-08-15 03:21:08 UTC
  • mfrom: (861.4.33 trunk)
  • Revision ID: racingmasterweb@gmail.com-20090815032108-q0orgxturbb413tt
merging with trunk r923

Show diffs side-by-side

added added

removed removed

Lines of Context:
1529
1529
{
1530
1530
    // st_Breakpoint();
1531
1531
    tString ret;
1532
 
 
1533
1532
    int len = strlen(c);
1534
 
 
1535
1533
    bool removed = false;
1536
 
 
 
1534
    
1537
1535
    // walk through string
1538
1536
    while (*c!='\0'){
1539
1537
        // skip color codes
1540
1538
        if (*c=='0' && len >= 2 && c[1]=='x')
1541
1539
        {
1542
 
        if( len >= 8 && darkonly && strncmp( c, "0xRESETT", 8 ) != 0 )
1543
 
        {
1544
 
        tColor colorToFilter;
1545
 
        colorToFilter = tColor( c );
1546
 
        if ( !colorToFilter.IsDark() )
1547
 
        {
1548
 
                ret << c[0] << c[1] << c[2] << c[3] << c[4] << c[5] << c[6] << c[7];
1549
 
        }
1550
 
        else
1551
 
        {
 
1540
            if( len >= 8 && darkonly )
 
1541
            {
 
1542
                tColor colorToFilter( c );
 
1543
                if ( !colorToFilter.IsDark() || strncmp( c, "0xRESETT", 8 ) == 0 )
 
1544
                    ret << c[0] << c[1] << c[2] << c[3] << c[4] << c[5] << c[6] << c[7];
 
1545
                else
1552
1546
                    removed = true;
1553
 
        }
1554
 
        c   += 8;
1555
 
        len -= 8;
1556
 
        }
1557
 
        else if( len >= 8 )
 
1547
 
 
1548
                c   += 8;
 
1549
                len -= 8;       
 
1550
            }
 
1551
            else if( len >= 8 )
1558
1552
            {
1559
1553
                c   += 8;
1560
1554
                len -= 8;