Mail Archives: djgpp/1996/05/30/23:33:01
Xref: | news2.mv.net comp.os.msdos.djgpp:4404
|
From: | jlawlor AT gulf DOT uvic DOT ca (Jonathan Lawlor)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Mixing two palettes with allegro
|
Date: | Thu, 30 May 1996 19:03:42 GMT
|
Organization: | University of Victoria
|
Lines: | 28
|
Message-ID: | <4okrg6$16v8@uvaix3e1.comp.UVic.CA>
|
References: | <4ojrcc$36t AT groa DOT uct DOT ac DOT za>
|
NNTP-Posting-Host: | pt8r61.clh.uvic.ca
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
dnunez AT cs DOT uct DOT ac DOT za (David Nunez) wrote:
>Ok, here's the story:
>I want to make a picture viewer, with a nice gui like set of controls. I want to setthe first 128 colours of my palette (working with 320x200x256) to those
>of the pic I load in, and the other 128 I want to use for my gui and po
>ther stuff. I tried making a RGB pal[256] and the a for loop that copied first
>the 128 colours of my pic to the first 128 of pal, and then copied the
>128 of the gui to the last 128 of pal using a simple
> for (int k = 0; k < 128; k++) //no typos -- new editor(sorry)+
> pal[k] = pic_palette[k];
> for (int k = 128; k < 256; k++)
> pal[k] = gui_palette[k-128]; //i
>All this gave me was a really wierd set of palette type animation on the screen
>All the colours went crazy, changing all the time. Then when it was all over,
>the colours were all screwed up. Any suggestions?
>(PS. to make a pointer which uses colours say 127&128 instread of the
>default colours, do I just define my own custom pointer?)
What about the pixels in the orriginal picture that are referencing
palette entries > 128? You've just set them to other colors (gui).
You need to reduce the amount of colors in your orriginal picture,
or match the pixels in the picture to the colors in the gui palette.
- Raw text -