Changeset 157
- Timestamp:
- Mar 15, 2006, 12:45:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_api/macosx/TorrentCell.m
r156 r157 153 153 - (void) buildAdvancedBar 154 154 { 155 int h, w, end, pixelsPerRow; 156 uint32_t * p; 157 uint32_t * colors; 155 int h, w, end, pixelsPerRow; 156 uint32_t * p, * colors; 157 uint8_t * bitmapData = [fBitmap bitmapData]; 158 int bytesPerRow = [fBitmap bytesPerRow]; 158 159 159 160 fPieces = malloc( fWidth ); … … 170 171 171 172 /* First two lines: dark blue to show progression */ 172 p = (uint32_t *) [fBitmap bitmapData];173 p += 1;174 173 end = lrintf( floor( [fTorrent progress] * ( fWidth - 2 ) ) ); 175 174 for( h = 0; h < 2; h++ ) 176 175 { 176 p = (uint32_t *) ( bitmapData + h * bytesPerRow ) + 1; 177 177 for( w = 0; w < end; w++ ) 178 178 { … … 183 183 p[w] = htonl( kBack[h] ); 184 184 } 185 p += pixelsPerRow;186 185 } 187 186 … … 192 191 /* Point to pixel ( 2 + w, 2 ). We will then draw 193 192 "vertically" */ 194 p = (uint32_t *) ( [fBitmap bitmapData] + 195 2 * [fBitmap bytesPerRow] ); 196 p += 1 + w; 193 p = (uint32_t *) ( bitmapData + 2 * bytesPerRow ) + 1 + w; 197 194 198 195 if( fPieces[w] < 0 ) … … 219 216 for( h = 2; h < BAR_HEIGHT; h++ ) 220 217 { 221 p[0] 222 p += pixelsPerRow;218 p[0] = htonl( colors[h] ); 219 p = (uint32_t *) ( (uint8_t *) p + bytesPerRow ); 223 220 } 224 221 }
Note: See TracChangeset
for help on using the changeset viewer.