Ignore:
Timestamp:
Jun 10, 2008, 9:13:33 PM (14 years ago)
Author:
livings124
Message:

remember the previous color of the pieces view as much as possible to avoid excessive drawing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r6125 r6127  
    736736   
    737737    int pieceCount = MIN([torrent pieceCount], MAX_PIECES);
    738     float * piecePercent = malloc(pieceCount * sizeof(float)),
     738    float * piecesPercent = malloc(pieceCount * sizeof(float)),
    739739        * previousPiecePercent = [torrent getPreviousAmountFinished];
    740     [torrent getAmountFinished: piecePercent size: pieceCount];
     740    [torrent getAmountFinished: piecesPercent size: pieceCount];
    741741   
    742742    NSBitmapImageRep * bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
     
    748748    {
    749749        NSColor * pieceColor;
    750         if (piecePercent[i] == 1.0 && previousPiecePercent != NULL && previousPiecePercent[i] < 1.0)
     750        if (piecesPercent[i] == 1.0 && previousPiecePercent != NULL && previousPiecePercent[i] < 1.0)
    751751            pieceColor = [NSColor orangeColor];
    752752        else
    753             pieceColor = [[NSColor whiteColor] blendedColorWithFraction: piecePercent[i] ofColor: fBluePieceColor];
     753            pieceColor = [[NSColor whiteColor] blendedColorWithFraction: piecesPercent[i] ofColor: fBluePieceColor];
    754754       
    755755        //it's faster to just set color instead of checking previous color
     
    757757    }
    758758   
    759     [torrent setPreviousAmountFinished: piecePercent]; //holds onto piecePercent, so no need to release it here
     759    [torrent setPreviousAmountFinished: piecesPercent]; //holds onto piecePercent, so no need to release it here
    760760   
    761761    //actually draw image
Note: See TracChangeset for help on using the changeset viewer.