Changeset 5943


Ignore:
Timestamp:
May 27, 2008, 5:08:09 AM (14 years ago)
Author:
livings124
Message:

no need to have the bitmap as an instance variable since it is no longer saving colors between reload

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.h

    r5940 r5943  
    4040   
    4141    NSColor * fGrayColor, * fBlueColor, * fBlue1Color, * fBlue2Color, * fBlue3Color, * fBlue4Color, * fOrangeColor;
    42    
    43     NSBitmapImageRep * fBitmap;
    4442}
    4543
  • trunk/macosx/TorrentCell.m

    r5942 r5943  
    116116    TorrentCell * copy = [super copyWithZone: zone];
    117117   
    118     copy->fBitmap = nil;
    119    
    120118    copy->fGrayGradient = [fGrayGradient retain];
    121119    copy->fLightGrayGradient = [fLightGrayGradient retain];
     
    133131- (void) dealloc
    134132{
    135     [fBitmap release];
    136    
    137133    [fGrayGradient release];
    138134    [fLightGrayGradient release];
     
    592588    else
    593589    {
    594         [fBitmap release];
    595         fBitmap = nil;
    596590        [[self representedObject] setPreviousAmountFinished: NULL];
    597591       
     
    737731- (void) drawPiecesBar: (NSRect) barRect
    738732{
    739     if (!fBitmap)
    740         fBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
    741             pixelsWide: MAX_PIECES pixelsHigh: 1 bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES
    742             isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 0];
     733    NSBitmapImageRep * bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
     734                                    pixelsWide: MAX_PIECES pixelsHigh: 1 bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES
     735                                    isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 0];
    743736   
    744737    Torrent * torrent = [self representedObject];
     
    774767       
    775768        //it's faster to just set color instead of checking previous color
    776         [fBitmap setColor: pieceColor atX: i y: 0];
     769        [bitmap setColor: pieceColor atX: i y: 0];
    777770    }
    778771   
     
    780773   
    781774    //actually draw image
    782     [fBitmap drawInRect: barRect];
     775    [bitmap drawInRect: barRect];
     776   
     777    [bitmap release];
     778    bitmap = nil;
    783779}
    784780
Note: See TracChangeset for help on using the changeset viewer.