|
@@ -1008,26 +1008,27 @@ void DoPaletteAnimations()
|
|
|
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
|
|
const Colour *s;
|
|
|
/* Amount of colors to be rotated.
|
|
|
* A few more for the DOS palette, because the water colors are
|
|
|
* 245-254 for DOS and 217-226 for Windows. */
|
|
|
const ExtraPaletteValues *ev = &_extra_palette_values;
|
|
|
int c = _use_dos_palette ? PALETTE_ANIM_SIZE_DOS : PALETTE_ANIM_SIZE_WIN;
|
|
|
const int colour_rotation_amount = _use_dos_palette ? PALETTE_ANIM_SIZE_DOS : PALETTE_ANIM_SIZE_WIN;
|
|
|
Colour old_val[PALETTE_ANIM_SIZE_DOS];
|
|
|
const int oldval_size = colour_rotation_amount * sizeof(*old_val);
|
|
|
uint i;
|
|
|
uint j;
|
|
|
uint old_tc = _palette_animation_counter;
|
|
|
|
|
|
if (blitter != NULL && blitter->UsePaletteAnimation() == Blitter::PALETTE_ANIMATION_NONE) {
|
|
|
_palette_animation_counter = 0;
|
|
|
}
|
|
|
|
|
|
Colour *palette_pos = &_cur_palette[PALETTE_ANIM_SIZE_START]; // Points to where animations are taking place on the palette
|
|
|
/* Makes a copy of the current anmation palette in old_val,
|
|
|
* so the work on the current palette could be compared, see if there has been any changes */
|
|
|
memcpy(old_val, palette_pos, c * sizeof(*old_val));
|
|
|
memcpy(old_val, palette_pos, oldval_size);
|
|
|
|
|
|
/* Dark blue water */
|
|
|
s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->dark_water_TOY : ev->dark_water;
|
|
|
j = EXTR(320, 5);
|
|
|
for (i = 0; i != 5; i++) {
|
|
|
*palette_pos++ = s[j];
|
|
@@ -1115,16 +1116,16 @@ void DoPaletteAnimations()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (blitter != NULL && blitter->UsePaletteAnimation() == Blitter::PALETTE_ANIMATION_NONE) {
|
|
|
_palette_animation_counter = old_tc;
|
|
|
} else {
|
|
|
if (memcmp(old_val, &_cur_palette[PALETTE_ANIM_SIZE_START], c * sizeof(*old_val)) != 0) {
|
|
|
if (memcmp(old_val, &_cur_palette[PALETTE_ANIM_SIZE_START], oldval_size) != 0) {
|
|
|
/* Did we changed anything on the palette? Seems so. Mark it as dirty */
|
|
|
_pal_first_dirty = PALETTE_ANIM_SIZE_START;
|
|
|
_pal_count_dirty = c;
|
|
|
_pal_count_dirty = colour_rotation_amount;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/** Initialize _stringwidth_table cache */
|