mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
Simplify fade code.
svn-id: r42654
This commit is contained in:
parent
64ebb586cd
commit
227f4a575f
@ -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;
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user