Simplify fade code.

svn-id: r42654
This commit is contained in:
Travis Howell 2009-07-22 09:52:44 +00:00
parent 64ebb586cd
commit 227f4a575f
2 changed files with 9 additions and 14 deletions

View File

@ -871,13 +871,11 @@ void AGOSEngine::slowFadeIn() {
_fastFadeInFlag &= ~0x8000;
_paletteFlag = false;
memset(_videoBuf1, 0, 1024);
memcpy(_currentPalette, _displayPalette, 1024);
memcpy(_videoBuf1 + 1024, _displayPalette, 1024);
memset(_currentPalette, 0, sizeof(_currentPalette));
for (c = 255; c >= 0; c -= 4) {
src = _videoBuf1 + 1024;
dst = _videoBuf1;
src = _displayPalette;
dst = _currentPalette;
for (p = _fastFadeInFlag; p !=0 ; p -= 3) {
if (src[0] >= c)
@ -889,7 +887,7 @@ void AGOSEngine::slowFadeIn() {
src += 4;
dst += 4;
}
_system->setPalette(_videoBuf1, 0, _fastFadeCount);
_system->setPalette(_currentPalette, 0, _fastFadeCount);
delay(5);
}
_fastFadeInFlag = 0;

View File

@ -576,18 +576,15 @@ void AGOSEngine_Simon1::os1_specialFade() {
// 187: fade to black
uint i;
memcpy(_videoBuf1, _currentPalette, 4 * 256);
for (i = 32; i != 0; --i) {
paletteFadeOut(_videoBuf1, 32, 8);
paletteFadeOut(_videoBuf1 + 4 * 48, 144, 8);
paletteFadeOut(_videoBuf1 + 4 * 208, 48, 8);
_system->setPalette(_videoBuf1, 0, 256);
paletteFadeOut(_currentPalette, 32, 8);
paletteFadeOut(_currentPalette + 4 * 48, 144, 8);
paletteFadeOut(_currentPalette + 4 * 208, 48, 8);
_system->setPalette(_currentPalette, 0, 256);
delay(5);
}
memcpy(_currentPalette, _videoBuf1, 1024);
memcpy(_displayPalette, _videoBuf1, 1024);
memcpy(_displayPalette, _currentPalette, 1024);
}
void AGOSEngine::scriptMouseOff() {