Cocoa Port: Do some minor code cleanup.
This commit is contained in:
parent
2746427dd7
commit
3a63db2086
|
@ -722,10 +722,9 @@
|
||||||
pthread_rwlock_unlock(self.rwlockProducer);
|
pthread_rwlock_unlock(self.rwlockProducer);
|
||||||
|
|
||||||
#ifdef MSB_FIRST
|
#ifdef MSB_FIRST
|
||||||
uint32_t *bitmapDataEnd = bitmapData + (w * h);
|
for (size_t i = 0; i < w * h; i++)
|
||||||
while (bitmapData < bitmapDataEnd)
|
|
||||||
{
|
{
|
||||||
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
|
bitmapData[i] = LE_TO_LOCAL_32(bitmapData[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -412,17 +412,15 @@ static NSMutableDictionary *saveTypeValues = nil;
|
||||||
return newImage;
|
return newImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSUInteger w = ROM_ICON_WIDTH;
|
|
||||||
NSUInteger h = ROM_ICON_HEIGHT;
|
|
||||||
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
|
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
|
||||||
pixelsWide:w
|
pixelsWide:ROM_ICON_WIDTH
|
||||||
pixelsHigh:h
|
pixelsHigh:ROM_ICON_HEIGHT
|
||||||
bitsPerSample:8
|
bitsPerSample:8
|
||||||
samplesPerPixel:4
|
samplesPerPixel:4
|
||||||
hasAlpha:YES
|
hasAlpha:YES
|
||||||
isPlanar:NO
|
isPlanar:NO
|
||||||
colorSpaceName:NSCalibratedRGBColorSpace
|
colorSpaceName:NSCalibratedRGBColorSpace
|
||||||
bytesPerRow:w * 4
|
bytesPerRow:ROM_ICON_WIDTH * 4
|
||||||
bitsPerPixel:32];
|
bitsPerPixel:32];
|
||||||
|
|
||||||
if(imageRep == nil)
|
if(imageRep == nil)
|
||||||
|
@ -436,10 +434,9 @@ static NSMutableDictionary *saveTypeValues = nil;
|
||||||
RomIconToRGBA8888(bitmapData);
|
RomIconToRGBA8888(bitmapData);
|
||||||
|
|
||||||
#ifdef MSB_FIRST
|
#ifdef MSB_FIRST
|
||||||
uint32_t *bitmapDataEnd = bitmapData + (w * h);
|
for (size_t i = 0; i < ROM_ICON_WIDTH * ROM_ICON_HEIGHT; i++)
|
||||||
while (bitmapData < bitmapDataEnd)
|
|
||||||
{
|
{
|
||||||
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
|
bitmapData[i] = LE_TO_LOCAL_32(bitmapData[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,9 @@
|
||||||
ColorspaceConvertBuffer888XTo8888Opaque<false, true>((const uint32_t *)[self runFilter], bitmapData, w * h);
|
ColorspaceConvertBuffer888XTo8888Opaque<false, true>((const uint32_t *)[self runFilter], bitmapData, w * h);
|
||||||
|
|
||||||
#ifdef MSB_FIRST
|
#ifdef MSB_FIRST
|
||||||
uint32_t *bitmapDataEnd = bitmapData + (w * h);
|
for (size_t i = 0; i < w * h; i++)
|
||||||
while (bitmapData < bitmapDataEnd)
|
|
||||||
{
|
{
|
||||||
*bitmapData++ = CFSwapInt32LittleToHost(*bitmapData);
|
bitmapData[i] = LE_TO_LOCAL_32(bitmapData[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue