![]() |
|
Images look completely wrong - color depth problem? |
Michael Faerber
Member #4,800
July 2004
![]() |
I'm loading and drawing an image with this code: // setting up gfx mode set_colov_conv(COLORCONV_TOTAL); // ... banana = load_bitmap("media/banana.pcx", NULL); // ... stretch_sprite(buffer, banana, 0, 0, SCREEN_W, SCREEN_H); However, when it shows the image, all colors are plain wrong. Any idea? -- |
Matthew Leverton
Supreme Loser
January 1999
![]() |
You are setting color depth, setting the graphics mode, and then loading bitmaps, right? |
Michael Faerber
Member #4,800
July 2004
![]() |
No - first the graphics mode, then the color depth, then the color conversion, then the bitmaps loading. -- |
Richard Phipps
Member #1,632
November 2001
![]() |
Do it like this: set_color_depth(32); if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0) { abort_on_error("Couldn't set a 32 bit color resolution"); }
|
Kauhiz
Member #4,798
July 2004
|
You should do it in the order ML said -- color depth first. edit: beaten by Phipps --- |
Michael Faerber
Member #4,800
July 2004
![]() |
Thanks a lot! I've tried that before, but with set_color_depth(bitmap_color_depth(screen)), which works when called AFTER the gfx initialisation, but crashes when called BEFORE the gfx initialisation. [EDIT] -- |
Richard Phipps
Member #1,632
November 2001
![]() |
BAF
Member #2,981
December 2002
![]() |
desktop_color_depth() gets the desktop's depth. |
|