diff options
author | Oliver Kiehl | 2003-01-19 15:39:54 +0000 |
---|---|---|
committer | Oliver Kiehl | 2003-01-19 15:39:54 +0000 |
commit | 85ed389cbb161d7868204174ccfbb452354e6cc0 (patch) | |
tree | 2ea8076938d77322ecc704e810bb506efc13cf30 /simon | |
parent | ad55540f52fe8f30fb11af583b812f728e5a82e3 (diff) | |
download | scummvm-rg350-85ed389cbb161d7868204174ccfbb452354e6cc0.tar.gz scummvm-rg350-85ed389cbb161d7868204174ccfbb452354e6cc0.tar.bz2 scummvm-rg350-85ed389cbb161d7868204174ccfbb452354e6cc0.zip |
added missing function
svn-id: r6517
Diffstat (limited to 'simon')
-rw-r--r-- | simon/simon.cpp | 41 | ||||
-rw-r--r-- | simon/simon.h | 1 |
2 files changed, 34 insertions, 8 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index 414c38edcb..ac1b253a96 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -4608,19 +4608,44 @@ void SimonState::dx_update_screen_and_palette() void SimonState::realizePalette() { if (_palette_color_count & 0x8000) { - if (_debugMode) - warning("realizePalette subroutine unimplemented"); - _palette_color_count = 0; + realizePalette_unk(); } else { - _video_var_9 = false; - memcpy(_palette_backup, _palette, 256 * 4); + _video_var_9 = false; + memcpy(_palette_backup, _palette, 256 * 4); - _system->set_palette(_palette, 0, _palette_color_count); - _palette_color_count = 0; + _system->set_palette(_palette, 0, _palette_color_count); + _palette_color_count = 0; } - } +void SimonState::realizePalette_unk() +{ + uint8 *src; + byte *dst; + uint8 palette_unk[768]; + + _palette_color_count &= 0x7fff; + memset(_video_buf_1, 0, 768); + _video_var_9 = false; + memcpy(_palette_backup, _palette, 768); + memcpy(palette_unk, _palette, 768); + + int i, j; + for (i = 255; i >= 0; i -= 4) { + src = palette_unk; + dst = _video_buf_1; + + for (j = _palette_color_count; j >= 0; j--) { + if (*src >= i) + *dst += 4; + dst++; + src++; + } + _system->set_palette(_video_buf_1, 0, _video_num_pal_colors); + delay(5); + } + _palette_color_count = 0; +} void SimonState::go() { diff --git a/simon/simon.h b/simon/simon.h index 036e35bd50..e63bc251d0 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -778,6 +778,7 @@ public: void scroll_timeout(); void hitarea_stuff_helper_2(); void realizePalette(); + void realizePalette_unk(); void vc_kill_thread(uint file, uint sprite); |