From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: WHAT'S GOING ON!!??!?!! Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <20000824060250 DOT 22366 DOT qmail AT web511 DOT mail DOT yahoo DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 40 X-Trace: +r2abg1/s482paHQLUbWgH/ftRl6GqIytIdJP/jR8C5aQu7O3d0uggJdhWtv/E/E7Rq/SFJsutvf!4ilw25dVTmkGbgQ8Xe/mYC3mzQ+zVY33Wee0SCn51ChuViAY2bB1LNMjuCtWCA4K3BWbDehSXJaf!Ky4= X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Fri, 25 Aug 2000 07:42:20 GMT Distribution: world Date: Fri, 25 Aug 2000 07:42:20 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Wed, 23 Aug 2000 23:02:50 -0700 (PDT), Chris Amos wrote: >> > set_gfx_mode(GFX_AUTODETECT,640, 480,0,0); >> > set_color_depth(16); >> > bmp = load_bitmap("Tile1.bmp", pal); >> > draw_sprite(screen, bmp, 0, 0); >> >> You get weird colored garbage because you're not drawing with the >> right palette. Also, if you're putting multiple images on one >> 256-color screen, make sure they have the same palette. > >What are you talking about? There are no Palettes in 16 bit mode. But you're not running in 16-bit mode. Because you set the color depth after you set the graphics mode, you're running in the default 8-bit mode. >The pics are 24 bit, so shouldnt the Allegro routines >automaticly convert the pic to 16 bits per pixel? It's automatically converting to 8 bits per pixel in a "332" (8 levels red, 8 levels green, 4 levels blue) palette. Because you're in 8-bit mode and have not set the palette to the 332 palette returned by load_bitmap(), you're getting funky colors. To solve the problem, move set_color_depth() above set_gfx_mode. And make sure the output from set_gfx_mode() is non-negative; if it's negative, Allegro couldn't find a suitable graphics mode, the display is still in text mode, and any attempts to draw to `screen' will cause a SIGSEGV. -- MS (n) 1. A debilitating and surprisingly widespread affliction that renders the sufferer barely able to perform the simplest task. 2. A disease, multiple sclerosis (see). This is McAfee VirusScan. Add these two lines to your signature to prevent the spread of signature viruses. http://www.mcafee.com/