1. Palette question.
Rob,
If you use read_bitmap to load a bitmap you get a palette and a 2d array....
If an element in the array has a value of 0, what is its RGB value? palette[1] ?
--
MrTrick
-------------------------------------------------------------------------------------
magnae clunes mihi placent, nec possum de hac re mentiri.
2. Re: Palette question.
----- Original Message -----
From: "Patrick Barnes"
Sent: Monday, November 22, 2004 7:48 PM
Subject: Palette question.
>
> Rob,
> If you use read_bitmap to load a bitmap you get a palette and a 2d array....
>
> If an element in the array has a value of 0, what is its RGB value? palette[1]
> ?
> --
> MrTrick
Eubots: You built the arena wrong.
It should be arena[height][width] then you can simply
use display_image() or most anything like it.
arena = repeat(repeat(0,width), height)
Answers:
Short: Yes.
Long: bmp = {palette, bitmap}
The palette is any length up to 256.
Indexes of 1 to 256
palette[1] = first
palette[256] = last
Element values are from 0-255
0 indexes palette[1]
15 indexes palette[15]
255 indexes palette[256]
unkmar
PS: DOS graphics stink, but if you must.
Then use either Hollow Horse Softwares Mode19.e
or mic's mode19.
PPS: If you will be loading the graphics lib repeatedly.
I suggest you get he modified version of Mode19.e from me.
The one in the archives has some memory leaks.
Euphoria should clean them up but... I wouldn't want to take
that chance.
3. Re: Palette question.
On Mon, 22 Nov 2004 20:43:01 -0500, Lucius Hilley
<l3euphoria at bellsouth.net> wrote:
>
> Eubots: You built the arena wrong.
> It should be arena[height][width] then you can simply
> use display_image() or most anything like it.
> arena = repeat(repeat(0,width), height)
No, I didn't... I deliberately made it so that a point at coordinate
{x,y} is referenced by arena[x][y].
> Element values are from 0-255
> 0 indexes palette[1]
> 15 indexes palette[15]
Don't you mean palette[16] ?
> 255 indexes palette[256]
> PS: DOS graphics stink, but if you must.
> Then use either Hollow Horse Softwares Mode19.e
> or mic's mode19.
Don't worry, I'm not using DOS at all. I am however using 16 or 256
color bitmaps to store the maps. Easier than writing my own file
format.
--
MrTrick