diff -ur scummvm-20030118/common/scaler.cpp scummvm-20030118_tv2x/common/scaler.cpp
old
|
new
|
|
721 | 721 | unsigned int nextlineSrc = srcPitch / sizeof(short); |
722 | 722 | short *p = (short *)srcPtr; |
723 | 723 | |
724 | | unsigned nextlineDst = dstPitch / sizeof(short); |
| 724 | unsigned int nextlineDst = dstPitch / sizeof(short); |
725 | 725 | short *q = (short *)dstPtr; |
726 | 726 | |
727 | 727 | while (height--) { |
… |
… |
|
805 | 805 | } |
806 | 806 | |
807 | 807 | void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
808 | | int width, int height) |
| 808 | int width, int height) |
809 | 809 | { |
810 | | unsigned int nextlineSrc = srcPitch / sizeof(short); |
811 | | short *p = (short *)srcPtr; |
| 810 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
| 811 | uint16 *p = (uint16 *)srcPtr; |
812 | 812 | |
813 | | unsigned int nextlineDst = dstPitch / sizeof(short); |
814 | | short *q = (short *)dstPtr; |
| 813 | unsigned int nextlineDst = dstPitch / sizeof(uint16); |
| 814 | uint16 *q = (uint16 *)dstPtr; |
815 | 815 | |
816 | 816 | while(height--) { |
817 | 817 | for (int i = 0, j = 0; i < width; ++i, j += 2) { |
818 | | unsigned short p1 = *(p + i); |
819 | | unsigned short p2 = *(p + i + nextlineSrc); |
820 | | unsigned short pi = (unsigned short)((INTERPOLATE(p1, p2) & colorMask) >> 1); |
| 818 | uint16 p1 = *(p + i); |
| 819 | uint32 pi; |
| 820 | |
| 821 | pi = (((p1 & redblueMask) * 7) >> 3) & redblueMask; |
| 822 | pi |= (((p1 & greenMask) * 7) >> 3) & greenMask; |
821 | 823 | |
822 | 824 | *(q + j) = p1; |
823 | 825 | *(q + j + 1) = p1; |
824 | | *(q + j + nextlineDst) = pi; |
825 | | *(q + j + nextlineDst + 1) = pi; |
| 826 | *(q + j + nextlineDst) = (uint16)pi; |
| 827 | *(q + j + nextlineDst + 1) = (uint16)pi; |
826 | 828 | } |
827 | 829 | p += nextlineSrc; |
828 | 830 | q += nextlineDst << 1; |