summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authortiter <[email protected]>2006-02-17 07:35:53 +0000
committertiter <[email protected]>2006-02-17 07:35:53 +0000
commitf2d6457b5e4951bf5cc8d4d005e5ef82b5e6eda9 (patch)
tree8863051085bca826606c7b64e7d2f190312db111 /macosx
parent340068111b89d7f84755eb2ff89c35eff01f5a71 (diff)
Fixed an endianness issue in Dock badging
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@27 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/Controller.mm19
1 files changed, 11 insertions, 8 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 7a4e9a7aa..cdbdddba6 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -182,6 +182,9 @@ static int FormatSettings[3][4] =
NSData * tiff;
NSBitmapImageRep * bmp;
uint32_t * pen;
+ uint32_t black = htonl( 0x000000FF );
+ uint32_t red = htonl( 0xFF0000FF );
+ uint32_t white = htonl( 0xFFFFFFFF );
int row_start, row_end;
int i, j;
@@ -210,34 +213,34 @@ static int FormatSettings[3][4] =
pen = (uint32_t *) ( [bmp bitmapData] + i * [bmp bytesPerRow] );
for( j = 0; j < (int) [bmp size].width; j++ )
{
- pen[j] = 0x000000FF; /* Black */
+ pen[j] = black;
}
}
for( i = row_start + 2; i < row_end - 2; i++ )
{
pen = (uint32_t *) ( [bmp bitmapData] + i * [bmp bytesPerRow] );
- pen[0] = 0x000000FF;
- pen[1] = 0x000000FF;
+ pen[0] = black;
+ pen[1] = black;
for( j = 2; j < (int) [bmp size].width - 2; j++ )
{
if( j < 2 + (int) ( ( [bmp size].width - 4.0 ) * progress ) )
{
- pen[j] = 0xFF0000FF; /* Red */
+ pen[j] = red;
}
else
{
- pen[j] = 0xFFFFFFFF; /* White */
+ pen[j] = white;
}
}
- pen[j] = 0x000000FF;
- pen[j+1] = 0x000000FF;
+ pen[j] = black;
+ pen[j+1] = black;
}
for( i = row_end - 2; i < row_end; i++ )
{
pen = (uint32_t *) ( [bmp bitmapData] + i * [bmp bytesPerRow] );
for( j = 0; j < (int) [bmp size].width; j++ )
{
- pen[j] = 0x000000FF; /* Black */
+ pen[j] = black;
}
}