RCS file: /cvsroot/scummvm/scummvm/scumm/palette.cpp,v
retrieving revision 2.47
diff -u -r2.47 palette.cpp
|
|
|
606 | 606 | } |
607 | 607 | |
608 | 608 | if (_gameId == GID_SAMNMAX) { |
609 | | for (i = 0; i < 256; i++) |
| 609 | for (i = 0; i < 256; i++) { |
610 | 610 | _shadowPalette[i] = i; |
| 611 | } |
| 612 | for (i = start; i < end; i++) { |
| 613 | int r = (int) ((pal[0] >> 2) * redScale) >> 8; |
| 614 | int g = (int) ((pal[1] >> 2) * greenScale) >> 8; |
| 615 | int b = (int) ((pal[2] >> 2) * blueScale) >> 8; |
| 616 | pal += 3; |
| 617 | |
| 618 | uint8 bestitem = 0; |
| 619 | uint bestsum = 32000; |
| 620 | |
| 621 | compareptr = basepal + startColor * 3; |
| 622 | for (int j = startColor; j <= endColor; j++, compareptr += 3) { |
| 623 | int ar = compareptr[0] >> 2; |
| 624 | int ag = compareptr[1] >> 2; |
| 625 | int ab = compareptr[2] >> 2; |
| 626 | |
| 627 | uint sum = ABS(ar - r) + ABS(ag - g) + ABS(ab - b); |
| 628 | |
| 629 | if (sum < bestsum) { |
| 630 | bestsum = sum; |
| 631 | bestitem = j; |
| 632 | } |
| 633 | } |
| 634 | *table++ = bestitem; |
| 635 | } |
| 636 | return; |
611 | 637 | } |
612 | 638 | |
613 | 639 | for (i = start; i < end; i++) { |