AGS: Implemented fade_interpolate

This commit is contained in:
Paul Gilbert 2021-09-25 09:54:22 -07:00
parent 6bbee47f71
commit c924c3e84e
2 changed files with 10 additions and 1 deletions

View file

@ -642,6 +642,7 @@ void ScummVMRendererGraphicsDriver::__fade_from_range(PALETTE source, PALETTE de
RenderToBackBuffer();
Present();
g_system->delayMillis(5);
sys_evt_process_pending();
if (_pollingCallback)
_pollingCallback();

View file

@ -196,7 +196,15 @@ void get_palette_range(PALETTE p, int from, int to) {
}
void fade_interpolate(AL_CONST PALETTE source, AL_CONST PALETTE dest, PALETTE output, int pos, int from, int to) {
warning("TODO: fade_interpolate");
assert(pos >= 0 && pos <= 64);
assert(from >= 0 && from < PAL_SIZE);
assert(to >= 0 && to < PAL_SIZE);
for (int c = from; c <= to; c++) {
output[c].r = ((int)source[c].r * (63 - pos) + (int)dest[c].r * pos) / 64;
output[c].g = ((int)source[c].g * (63 - pos) + (int)dest[c].g * pos) / 64;
output[c].b = ((int)source[c].b * (63 - pos) + (int)dest[c].b * pos) / 64;
}
}
void select_palette(AL_CONST PALETTE p) {