? palManipulateInit_new.diff
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.235
diff -u -r2.235 gfx.cpp
|
|
|
2916 | 2916 | _palManipCounter = time; |
2917 | 2917 | } |
2918 | 2918 | |
| 2919 | void ScummEngine::palManipulateInit_new(int palindex, int start, int end, int time) { |
| 2920 | byte *pal, *target, *between; |
| 2921 | const byte *new_pal; |
| 2922 | int i; |
| 2923 | |
| 2924 | new_pal = getPalettePtr(palindex); |
| 2925 | |
| 2926 | new_pal+=start*3; |
| 2927 | |
| 2928 | _palManipStart = start; |
| 2929 | _palManipEnd = end; |
| 2930 | _palManipCounter = 0; |
| 2931 | |
| 2932 | if (!_palManipPalette) |
| 2933 | _palManipPalette = (byte *)calloc(0x300, 1); |
| 2934 | if (!_palManipIntermediatePal) |
| 2935 | _palManipIntermediatePal = (byte *)calloc(0x600, 1); |
| 2936 | |
| 2937 | pal = _currentPalette + start * 3; |
| 2938 | target = _palManipPalette + start * 3; |
| 2939 | between = _palManipIntermediatePal + start * 6; |
| 2940 | |
| 2941 | for (i = start; i < end; ++i) { |
| 2942 | *target++ = *new_pal++; |
| 2943 | *target++ = *new_pal++; |
| 2944 | *target++ = *new_pal++; |
| 2945 | *(uint16 *)between = ((uint16) *pal++) << 8; |
| 2946 | between += 2; |
| 2947 | *(uint16 *)between = ((uint16) *pal++) << 8; |
| 2948 | between += 2; |
| 2949 | *(uint16 *)between = ((uint16) *pal++) << 8; |
| 2950 | between += 2; |
| 2951 | } |
| 2952 | |
| 2953 | _palManipCounter = time; |
| 2954 | } |
| 2955 | |
| 2956 | |
2919 | 2957 | void ScummEngine::palManipulate() { |
2920 | 2958 | byte *target, *pal, *between; |
2921 | 2959 | int i, j; |
… |
… |
|
2969 | 3007 | } |
2970 | 3008 | |
2971 | 3009 | void ScummEngine::setupShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) { |
2972 | | const byte *basepal = getPalettePtr(); |
| 3010 | const byte *basepal = getPalettePtr(_curPalIndex); |
2973 | 3011 | const byte *pal = basepal; |
2974 | 3012 | const byte *compareptr; |
2975 | 3013 | byte *table = _shadowPalette; |
… |
… |
|
3054 | 3092 | |
3055 | 3093 | int i, j; |
3056 | 3094 | |
3057 | | palPtr = getPalettePtr(); |
| 3095 | palPtr = getPalettePtr(_curPalIndex); |
3058 | 3096 | |
3059 | 3097 | for (i = 0; i < 256; i++) |
3060 | 3098 | _proc_special_palette[i] = i; |
… |
… |
|
3103 | 3141 | int j; |
3104 | 3142 | int color; |
3105 | 3143 | |
3106 | | cptr = getPalettePtr() + startColor * 3; |
| 3144 | cptr = getPalettePtr(_curPalIndex) + startColor * 3; |
3107 | 3145 | cur = _currentPalette + startColor * 3; |
3108 | 3146 | |
3109 | 3147 | for (j = startColor; j <= endColor; j++) { |
… |
… |
|
3163 | 3201 | byte *cur; |
3164 | 3202 | int j; |
3165 | 3203 | |
3166 | | cptr = getPalettePtr() + startColor * 3; |
| 3204 | cptr = getPalettePtr(_curPalIndex) + startColor * 3; |
3167 | 3205 | cur = _currentPalette + startColor * 3; |
3168 | 3206 | |
3169 | 3207 | for (j = startColor; j <= endColor; j++) { |
… |
… |
|
3330 | 3368 | const byte *pals; |
3331 | 3369 | |
3332 | 3370 | _curPalIndex = palindex; |
3333 | | pals = getPalettePtr(); |
| 3371 | pals = getPalettePtr(_curPalIndex); |
3334 | 3372 | setPaletteFromPtr(pals); |
3335 | 3373 | } |
3336 | 3374 | |
… |
… |
|
3354 | 3392 | return offs + READ_LE_UINT32(offs + idx * sizeof(uint32)); |
3355 | 3393 | } |
3356 | 3394 | |
3357 | | const byte *ScummEngine::getPalettePtr() { |
| 3395 | const byte *ScummEngine::getPalettePtr(int palindex) { |
3358 | 3396 | const byte *cptr; |
3359 | 3397 | |
3360 | 3398 | cptr = getResourceAddress(rtRoom, _roomResource); |
… |
… |
|
3362 | 3400 | if (_CLUT_offs) { |
3363 | 3401 | cptr += _CLUT_offs; |
3364 | 3402 | } else { |
3365 | | cptr = findPalInPals(cptr + _PALS_offs, _curPalIndex); |
| 3403 | cptr = findPalInPals(cptr + _PALS_offs, palindex); |
3366 | 3404 | } |
3367 | 3405 | assert(cptr); |
3368 | 3406 | return cptr; |
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.218
diff -u -r1.218 script_v6.cpp
|
|
|
1589 | 1589 | c = pop(); |
1590 | 1590 | b = pop(); |
1591 | 1591 | a = pop(); |
1592 | | palManipulateInit(a, b, c, d); |
| 1592 | palManipulateInit_new(a, b, c, d); |
1593 | 1593 | break; |
1594 | 1594 | |
1595 | 1595 | case 187: // SO_CYCLE_SPEED |
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.333
diff -u -r1.333 scumm.h
|
|
|
827 | 827 | void clampCameraPos(Common::Point *pt); |
828 | 828 | void actorFollowCamera(int act); |
829 | 829 | |
830 | | const byte *getPalettePtr(); |
| 830 | const byte *getPalettePtr(int palindex); |
831 | 831 | void setupAmigaPalette(); |
832 | 832 | void setupEGAPalette(); |
833 | 833 | void setupV1ManiacPalette(); |
… |
… |
|
843 | 843 | void cyclePalette(); |
844 | 844 | void stopCycle(int i); |
845 | 845 | void palManipulateInit(int start, int end, int string_id, int time); |
| 846 | void palManipulateInit_new(int palindex, int start, int end, int time); |
846 | 847 | void palManipulate(); |
847 | 848 | public: |
848 | 849 | int remapPaletteColor(int r, int g, int b, uint threshold); // Used by Actor::remapActorPalette |