Mail Archives: djgpp/1999/02/09/14:21:05
From: | "Attala" <atle DOT knutsen AT c2i DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Allegro help
|
Date: | Tue, 9 Feb 1999 19:55:35 +0100
|
Organization: | Tele2 Norway Public Access
|
Lines: | 39
|
Message-ID: | <79q0gk$18g$1@romeo.dax.net>
|
NNTP-Posting-Host: | mp-217-240-212.daxnet.no
|
X-Newsreader: | Microsoft Outlook Express 4.72.3110.5
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I have a big problem with colors and palettes.
I have a sprite and a background which both use the same palette made in the
windows paint program. I put them both in a datafile (using "Grabber"), and
read the palette from the background picture. Everything looks fine in
Grabber, but when I use them in my program the colors are always wrong. When
I use set_palette the colors change, but never the way they are supposed to.
Please help me, this is very frustrating.
Here's the code for the graphic settings:
#include "allegro.h"
#include "spill.h"
int x = 400;
int y = 300;
int aninr = 3;
int next;
int a;
char string[100];
BITMAP *tank;
DATAFILE *data;
int main()
{
allegro_init();
install_keyboard();
clear_keybuf();
next = FALSE;
set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0);
data = load_datafile("spill1.dat");
aninr = 3;
a = 0;
set_palette(data[palette001].dat);
tank = create_bitmap(800, 600);
- Raw text -