www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/21/18:16:27

From: Robin Burrows <rburrows AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem in Allegro
Date: Tue, 21 Apr 1998 23:10:02 +0100
Organization: Future View Internet Service
Lines: 40
Message-ID: <353D193A.7032@bigfoot.com>
References: <353cf9cf DOT 0 AT news DOT thefree DOT net>
Reply-To: rburrows AT bigfoot DOT com
NNTP-Posting-Host: 194.168.70.86
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Chris Bailey wrote:
> 
> I am using Allegro v3.0 and DJGPP to write a garden design package. The
> program I am writing obviously requires having many drawing objects on
> the screen at once (circles = trees, rectangles = sheds, polygons =
> ponds). If I use solid fill colours i.e. green tree, brown shed, there
> is no problem because the same pallete can be used throughout the
> garden. However I have decided to take it to another level where the
> objects aren't just coloured in with solid colours but a bitmap is tiled
> across the object. I know how to do this but it requires changing the
> pallete to the pallete that the bitmap is drawn in so that it displays
> correctly. When I do this it seems to change the colours of everything
> on the screen to the new pallete even though they aren't being re-drawn.
> How do I get around this?

If it's being displayed, it's using the palette, just because you're not
modifying it doesn't make any difference.
If you are using 256 colour mode, you have to make sure everything
visible on the screen is using the currently selected palette. The
easiest way to do this is to load all your bitmap graphics onto a single
picture in 24 bit (truecolour, doesn't use a palette) in a paint package
and then reduce colour depth to 256 colours and re-grab the graphics and
palette. There is also a utility on the allegro pages for making a
single palette from several pictures.
The other alternative is to use 15 bit colour or higher which doesn't
use a palette so the problem doesn't exist, although this is less
compatible than 256 colour mode.

> After drawing the circlefill using FOREST.BMP to tile it, the rectfill
> which was darkgray is now the corresponding colour in the FOREST.BMP's
> pallete even though it is not being redrawn.
> 
> I want to be able to draw several bitmaps on the screen using different
> palletes without the change affecting every other bitmap that is already
> on the screen.
> 
> Any help is greatly appreciated
> C. Bailey
> 
> Please eMail suggestions to chris DOT bailey AT softhome DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019