Re: [AD] select_palette/unselect_palette |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> unexpectedly began to show up in my profile. Odd.
> Probably an error, but here is this anyway.
I think we can do even better when in 8bpp mode.
--
Eric Botcazou
*** /home/eric/cvs/allegro/src/gfx.c Sun May 18 16:43:46 2003
--- allegro/src/gfx.c Tue Jun 24 14:20:25 2003
*************** void select_palette(AL_CONST PALETTE p)
*** 239,256 ****
for (c=0; c<256; c++) {
_prev_current_palette[c] = _current_palette[c];
- prev_palette_color[c] = palette_color[c];
- }
-
- _got_prev_current_palette = TRUE;
-
- for (c=0; c<256; c++) {
_current_palette[c] = p[c];
! if (_color_depth != 8)
palette_color[c] = makecol(_rgb_scale_6[p[c].r], _rgb_scale_6[p[c].g], _rgb_scale_6[p[c].b]);
}
_current_palette_changed = 0xFFFFFFFF & ~(1<<(_color_depth-1));
}
--- 239,256 ----
for (c=0; c<256; c++) {
_prev_current_palette[c] = _current_palette[c];
_current_palette[c] = p[c];
+ }
! if (_color_depth != 8) {
! for (c=0; c<256; c++) {
! prev_palette_color[c] = palette_color[c];
palette_color[c] = makecol(_rgb_scale_6[p[c].r], _rgb_scale_6[p[c].g], _rgb_scale_6[p[c].b]);
+ }
}
+ _got_prev_current_palette = TRUE;
+
_current_palette_changed = 0xFFFFFFFF & ~(1<<(_color_depth-1));
}
*************** void unselect_palette()
*** 263,272 ****
{
int c;
! for (c=0; c<256; c++) {
_current_palette[c] = _prev_current_palette[c];
! if (_color_depth != 8)
palette_color[c] = prev_palette_color[c];
}
--- 263,273 ----
{
int c;
! for (c=0; c<256; c++)
_current_palette[c] = _prev_current_palette[c];
! if (_color_depth != 8) {
! for (c=0; c<256; c++)
palette_color[c] = prev_palette_color[c];
}