Message-ID: <008601be48ad$3ae0b6a0$d3d80ad0@default> From: "Steve Axsom" To: Subject: Re: Need help with paletes Date: Mon, 25 Jan 1999 16:54:03 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Reply-To: djgpp AT delorie DOT com It did help =), but for the palete, I had to set the whole palete to the bitmaps palete (using set_palette(PALETTE *pal) ), or else it use the default palete when the image is displayed. I might need to explain a little more of my code, but is there a way of avoiding setting the whole palete? -Shane ----- Original Message ----- From: DeHackEd Newsgroups: comp.os.msdos.djgpp To: Sent: Sunday, January 24, 1999 7:53 PM Subject: Re: Need help with paletes >Assuming you are working in 8 bit graphics modes, you should just have to do >this: > >PALETTE pal; >BITMAP *bmp = load_bitmap("filename.here", pal); > >bmp will contain your picture and pal will contain it's palette. Paint, the >Windows pain editor, saved for me a 136 byte file. A palette, unless compressed >(which I doubt) needs to be at least 768 bytes (RBG * 256 plus any header or >spacer). > >Also for rotate_sprite, the angle is done using fixed notation. > >Example (requires floating point math): > >fixed degrees(float angle) >{ > return ftofix(angle/360.0*256.0); // float to fix conveter >} > >// 25 degrees >rotate_sprite(screen, bmp, x, y, degrees(25)); > >Hope this helps. > >---- >"DeHackEd" > >My Email address in the header is completely fake (spammers). Email me at this >address: >http://www.geocities.com/cgi-bin/homestead/mail.pl?dehacked > >Steve Axsom wrote in message >news:001901be47ef$796d13a0$b9d80ad0 AT default... >> I'm making a game in allegro and I'm trying to load bitmaps. Is there an >>easier way of setting the palletes then setting RGB for each color at a >>time? With the windows default bitmap editor, I've notice you can save >>palate files (.pal). Also, rotate_sprite doesn't seem to work, even with >>memory bitmaps. if anybody could give me a *simple* code for it, I'd be very >>greatful =). >> >> -Shane >> >> > > >