Mail Archives: djgpp/1996/06/01/16:48:14
Xref: | news2.mv.net comp.os.msdos.djgpp:4444
|
From: | dnunez AT cs DOT uct DOT ac DOT za (David Nunez)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Mixing two palettes with allegro
|
Date: | 30 May 1996 09:56:28 GMT
|
Organization: | University of Cape Town
|
Lines: | 28
|
Message-ID: | <4ojrcc$36t@groa.uct.ac.za>
|
NNTP-Posting-Host: | cs.uct.ac.za
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
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?)
Sorry about the tons of typos - I'm getting used to vi still.
Cheers.
--
Dave Nunez - dnunez AT cs DOT uct DOT ac DOT za VISIT THE SICK PUPPY HOMEPAGE!
---- Come see my homepage!! ---- for flight sims, military aviation, etc.
http://www.cs.uct.ac.za/~dnunez http://www.cs.uct.ac.za/~dnunez/sp.html
- Raw text -