[AD] bug? blit_[to/from]_hdc() |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
using Wip 4.1.0 [20020713], MSVC 6, win2k sp2, 16bit desktop, gfxcard =
GeForce2MX.
Here's what i do...
// create a 16bit map.
BITMAP* map16 = CreateBitmapEx(16,100,100);
// grab a 100x100 from hdc, onto map.
blit_from_hdc( hdc, map16, 0, 0, 0, 0, 100, 100 );
// blit the map back to the same spot.
blit_to_hdc( map16, hdc, 0, 0, 0, 0, 100, 100 );
What happens:
the screen colours change, the green channel is out by 4.
say i have some desktop colours [r,g,b] 45,181,23
i run this code (above), and i get [r,g,b] 45,177,23
i tried running set_gdi_color_format() late into
my program, and it did not help, i also tried calling it
as the next statement after allegro_init()
just as the documenation describing the
set_gdi_color_format() says to, and still it did
not help.
the only thing that i could find that did not seem right was
in /allegro4.1.0/src/win/gdi.c in method func named
BYTE get_dib(BITMAP * bitmap)
the code for 15bit packed pixel conversion, and the code for 16bit packed
pixel conversion looks very similar.
maybe the shifting is off by one or maybe 2 in this case, coz isn't the
green channel a different size for 15bit and 16bit code ?
aj.