File diff r7017:bb9ddc04ae4f → r7018:50bc56022ec1
src/gfx.cpp
Show inline comments
 
@@ -662,14 +662,14 @@ void GfxInitPalettes()
 

	
 
	DoPaletteAnimations();
 
	_pal_first_dirty = 0;
 
	_pal_count_dirty = 255;
 
}
 

	
 
#define EXTR(p, q) (((uint16)(_timer_counter * (p)) * (q)) >> 16)
 
#define EXTR2(p, q) (((uint16)(~_timer_counter * (p)) * (q)) >> 16)
 
#define EXTR(p, q) (((uint16)(_palette_animation_counter * (p)) * (q)) >> 16)
 
#define EXTR2(p, q) (((uint16)(~_palette_animation_counter * (p)) * (q)) >> 16)
 

	
 
void DoPaletteAnimations()
 
{
 
	Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
 
	const Colour *s;
 
	Colour *d;
 
@@ -678,16 +678,16 @@ void DoPaletteAnimations()
 
	 * 245-254 for DOS and 217-226 for Windows.  */
 
	const ExtraPaletteValues *ev = &_extra_palette_values;
 
	int c = _use_dos_palette ? 38 : 28;
 
	Colour old_val[38];
 
	uint i;
 
	uint j;
 
	uint old_tc = _timer_counter;
 
	uint old_tc = _palette_animation_counter;
 

	
 
	if (blitter != NULL && blitter->UsePaletteAnimation() == Blitter::PALETTE_ANIMATION_NONE) {
 
		_timer_counter = 0;
 
		_palette_animation_counter = 0;
 
	}
 

	
 
	d = &_cur_palette[217];
 
	memcpy(old_val, d, c * sizeof(*old_val));
 

	
 
	/* Dark blue water */
 
@@ -724,13 +724,13 @@ void DoPaletteAnimations()
 
		j++;
 
		if (j == 7) j = 0;
 
	}
 

	
 
	/* Radio tower blinking */
 
	{
 
		byte i = (_timer_counter >> 1) & 0x7F;
 
		byte i = (_palette_animation_counter >> 1) & 0x7F;
 
		byte v;
 

	
 
		(v = 255, i < 0x3f) ||
 
		(v = 128, i < 0x4A || i >= 0x75) ||
 
		(v = 20);
 
		d->r = v;
 
@@ -776,13 +776,13 @@ void DoPaletteAnimations()
 
			j += 3;
 
			if (j >= 15) j -= 15;
 
		}
 
	}
 

	
 
	if (blitter != NULL && blitter->UsePaletteAnimation() == Blitter::PALETTE_ANIMATION_NONE) {
 
		_timer_counter = old_tc;
 
		_palette_animation_counter = old_tc;
 
	} else {
 
		if (memcmp(old_val, &_cur_palette[217], c * sizeof(*old_val)) != 0) {
 
			_pal_first_dirty = 217;
 
			_pal_count_dirty = c;
 
		}
 
	}