diff -ur ScummVM-cvs20030519/scummvm/simon/simon.cpp ScummVM-cvs20030519+hack/scummvm/simon/simon.cpp
old
|
new
|
|
4634 | 4634 | } |
4635 | 4635 | |
4636 | 4636 | void SimonState::realizePalette() { |
| 4637 | _video_var_9 = false; |
| 4638 | memcpy(_palette_backup, _palette, 256 * 4); |
| 4639 | |
4637 | 4640 | if (_palette_color_count & 0x8000) { |
4638 | | realizePalette_unk(); |
| 4641 | fadeUpPalette(); |
4639 | 4642 | } else { |
4640 | | _video_var_9 = false; |
4641 | | memcpy(_palette_backup, _palette, 256 * 4); |
4642 | | |
4643 | 4643 | _system->set_palette(_palette, 0, _palette_color_count); |
4644 | | _palette_color_count = 0; |
4645 | 4644 | } |
| 4645 | |
| 4646 | _palette_color_count = 0; |
4646 | 4647 | } |
4647 | 4648 | |
4648 | | void SimonState::realizePalette_unk() { |
4649 | | // Function is disabled since it causes text display problems. |
4650 | | // Only used in Simon the Sorcerer 2 when Simon rides lion to Goblin Camp |
4651 | | #if 0 |
4652 | | uint8 *src; |
4653 | | byte *dst; |
4654 | | uint8 palette_unk[768]; |
| 4649 | void SimonState::fadeUpPalette() { |
| 4650 | bool done; |
4655 | 4651 | |
4656 | | _palette_color_count &= 0x7fff; |
4657 | | memset(_video_buf_1, 0, 768); |
4658 | | _video_var_9 = false; |
4659 | | memcpy(_palette_backup, _palette, 768); |
4660 | | memcpy(palette_unk, _palette, 768); |
| 4652 | _palette_color_count = (_palette_color_count & 0x7fff) / 4; |
| 4653 | |
| 4654 | memset(_video_buf_1, 0, _palette_color_count * sizeof(uint32)); |
| 4655 | |
| 4656 | // This function is used by Simon 2 when riding the lion to the goblin |
| 4657 | // camp. Note that _palette_color_count is not 1024 in this scene, so |
| 4658 | // only part of the palette is faded up. But apparently that's enough, |
| 4659 | // as long as we make sure that the remaining palette colours aren't |
| 4660 | // completely ignored. |
| 4661 | |
| 4662 | if (_palette_color_count < _video_num_pal_colors) |
| 4663 | memcpy(_video_buf_1 + _palette_color_count * sizeof(uint32), |
| 4664 | _palette + _palette_color_count * sizeof(uint32), |
| 4665 | (_video_num_pal_colors - _palette_color_count) * sizeof(uint32)); |
4661 | 4666 | |
4662 | | int i, j; |
4663 | | for (i = 255; i >= 0; i -= 4) { |
4664 | | src = palette_unk; |
| 4667 | do { |
| 4668 | uint8 *src; |
| 4669 | byte *dst; |
| 4670 | int i; |
| 4671 | |
| 4672 | done = true; |
| 4673 | src = _palette; |
4665 | 4674 | dst = _video_buf_1; |
4666 | 4675 | |
4667 | | for (j = _palette_color_count; j >= 0; j--) { |
4668 | | if (*src >= i) |
4669 | | *dst += 4; |
4670 | | dst++; |
4671 | | src++; |
| 4676 | for (i = 0; i < _palette_color_count; i++) { |
| 4677 | if (src[0] > dst[0]) { |
| 4678 | if (dst[0] > src[0] - 4) |
| 4679 | dst[0] = src[0]; |
| 4680 | else |
| 4681 | dst[0] += 4; |
| 4682 | done = false; |
| 4683 | } |
| 4684 | if (src[1] > dst[1]) { |
| 4685 | if (dst[1] > src[1] - 4) |
| 4686 | dst[1] = src[1]; |
| 4687 | else |
| 4688 | dst[1] += 4; |
| 4689 | done = false; |
| 4690 | } |
| 4691 | if (src[2] > dst[2]) { |
| 4692 | if (dst[2] > src[2] - 4) |
| 4693 | dst[2] = src[2]; |
| 4694 | else |
| 4695 | dst[2] += 4; |
| 4696 | done = false; |
| 4697 | } |
| 4698 | dst += 4; |
| 4699 | src += 4; |
4672 | 4700 | } |
| 4701 | |
4673 | 4702 | _system->set_palette(_video_buf_1, 0, _video_num_pal_colors); |
| 4703 | _system->update_screen(); |
4674 | 4704 | delay(5); |
4675 | | } |
4676 | | #endif |
4677 | | _palette_color_count = 0; |
| 4705 | } while (!done); |
4678 | 4706 | } |
4679 | 4707 | |
4680 | 4708 | void SimonState::go() { |
diff -ur ScummVM-cvs20030519/scummvm/simon/simon.h ScummVM-cvs20030519+hack/scummvm/simon/simon.h
old
|
new
|
|
776 | 776 | void scroll_timeout(); |
777 | 777 | void hitarea_stuff_helper_2(); |
778 | 778 | void realizePalette(); |
779 | | void realizePalette_unk(); |
| 779 | void fadeUpPalette(); |
780 | 780 | |
781 | 781 | void vc_kill_thread(uint file, uint sprite); |
782 | 782 | |