Re: [AD] PALETTE and RGB* (part 2) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> Ok, now, we're talking about 4.2 (possibly 4.0) so we don't want to
> break anything.
I don't think we should modify the 4.0 API to this extent at this point.
> So I'm tentatively changing my proposal to make all functions
> consistently use "RGB *" syntax instead of "PALETTE". How's that?
The cleanest method I think. For reference, that of the Win32 API:
UINT SetPaletteEntries(
HPALETTE hpal, // handle to logical palette
UINT iStart, // index of first entry to set
UINT cEntries, // number of entries to set
CONST PALETTEENTRY *lppe // array of palette entries
);
> However, if you create a single RGB struct¹ and it also gets tagged as a
> "RGB *" value, and it gets passed (accidentally or otherwise) to a
> function expecting a full palette, you will get a crash instead of a
> run-time type error.
Hey! That's the C language:-)
- Eric