RCS file: /cvsroot/scummvm/scummvm/scumm/insane/insane.cpp,v
retrieving revision 1.57
diff -u -r1.57 insane.cpp
|
|
|
619 | 619 | } |
620 | 620 | |
621 | 621 | void Insane::smush_warpMouse(int x, int y, int buttons) { |
622 | | _vm->_system->warpMouse(x, y); |
| 622 | _player->warpMouse(x, y, buttons); |
623 | 623 | } |
624 | 624 | |
625 | 625 | void Insane::putActors(void) { |
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.cpp,v
retrieving revision 1.157
diff -u -r1.157 smush_player.cpp
|
|
|
696 | 696 | _deltaPal[i] = b.getWord(); |
697 | 697 | } |
698 | 698 | readPalette(_pal, b); |
699 | | setPalette(_pal); |
| 699 | setDirtyColors(0, 255); |
700 | 700 | } else if (b.getSize() == 6) { |
701 | 701 | |
702 | 702 | b.getWord(); |
… |
… |
|
706 | 706 | for (int i = 0; i < 0x300; i++) { |
707 | 707 | _pal[i] = delta_color(_pal[i], _deltaPal[i]); |
708 | 708 | } |
709 | | setPalette(_pal); |
| 709 | setDirtyColors(0, 255); |
710 | 710 | } else { |
711 | 711 | error("SmushPlayer::handleDeltaPalette() Wrong size for DeltaPalette"); |
712 | 712 | } |
… |
… |
|
717 | 717 | debugC(DEBUG_SMUSH, "SmushPlayer::handleNewPalette()"); |
718 | 718 | |
719 | 719 | readPalette(_pal, b); |
720 | | setPalette(_pal); |
| 720 | setDirtyColors(0, 255); |
721 | 721 | } |
722 | 722 | |
723 | 723 | void smush_decode_codec1(byte *dst, byte *src, int left, int top, int height, int width, int dstWidth); |
… |
… |
|
970 | 970 | _nbframes = b.getWord(); |
971 | 971 | b.getWord(); |
972 | 972 | readPalette(_pal, b); |
973 | | setPalette(_pal); |
| 973 | setDirtyColors(0, 255); |
974 | 974 | } |
975 | 975 | |
976 | 976 | void SmushPlayer::setupAnim(const char *file) { |
… |
… |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | void SmushPlayer::setPalette(const byte *palette) { |
1058 | | byte palette_colors[1024]; |
1059 | | byte *p = palette_colors; |
1060 | | |
1061 | | for (int i = 0; i != 256; ++i) { |
1062 | | *p++ = _pal[i * 3 + 0] = *palette++; // red |
1063 | | *p++ = _pal[i * 3 + 1] = *palette++; // green |
1064 | | *p++ = _pal[i * 3 + 2] = *palette++; // blue |
1065 | | *p++ = 0; |
1066 | | } |
1067 | | |
1068 | | _vm->_system->setPalette(palette_colors, 0, 256); |
| 1058 | memcpy(_pal, palette, 0x300); |
| 1059 | setDirtyColors(0, 255); |
1069 | 1060 | } |
1070 | 1061 | |
1071 | 1062 | void SmushPlayer::setPaletteValue(int n, byte r, byte g, byte b) { |
1072 | 1063 | _pal[n * 3 + 0] = r; |
1073 | 1064 | _pal[n * 3 + 1] = g; |
1074 | 1065 | _pal[n * 3 + 2] = b; |
| 1066 | setDirtyColors(n, n); |
| 1067 | } |
| 1068 | |
| 1069 | void SmushPlayer::setDirtyColors(int min, int max) { |
| 1070 | if (_palDirtyMin > min) |
| 1071 | _palDirtyMin = min; |
| 1072 | if (_palDirtyMax < max) |
| 1073 | _palDirtyMax = max; |
| 1074 | } |
1075 | 1075 | |
1076 | | _vm->_system->setPalette(_pal, n, 1); |
| 1076 | void SmushPlayer::warpMouse(int x, int y, int buttons) { |
| 1077 | _warpNeeded = true; |
| 1078 | _warpX = x; |
| 1079 | _warpY = y; |
| 1080 | _warpButtons = buttons; |
1077 | 1081 | } |
1078 | 1082 | |
1079 | 1083 | void SmushPlayer::updateScreen() { |
… |
… |
|
1129 | 1133 | #endif |
1130 | 1134 | |
1131 | 1135 | uint32 end_time, start_time = _vm->_system->getMillis(); |
1132 | | _vm->_system->copyRectToScreen(_dst, _width, 0, 0, _width, _height); |
1133 | 1136 | _updateNeeded = true; |
1134 | 1137 | end_time = _vm->_system->getMillis(); |
1135 | 1138 | debugC(DEBUG_SMUSH, "Smush stats: updateScreen( %03d )", end_time - start_time); |
… |
… |
|
1215 | 1218 | tryCmpFile(filename); |
1216 | 1219 | |
1217 | 1220 | _updateNeeded = false; |
| 1221 | _warpNeeded = false; |
| 1222 | _palDirtyMin = 256; |
| 1223 | _palDirtyMax = -1; |
1218 | 1224 | |
1219 | 1225 | // Hide mouse |
1220 | 1226 | bool oldMouseState = _vm->_system->showMouse(false); |
… |
… |
|
1230 | 1236 | } |
1231 | 1237 | |
1232 | 1238 | for (;;) { |
| 1239 | if (_warpNeeded) { |
| 1240 | _vm->_system->warpMouse(_warpX, _warpY); |
| 1241 | _warpNeeded = false; |
| 1242 | } |
1233 | 1243 | _vm->parseEvents(); |
1234 | 1244 | _vm->processKbd(true); |
| 1245 | if (_palDirtyMax >= _palDirtyMin) { |
| 1246 | byte palette_colors[1024]; |
| 1247 | byte *p = palette_colors; |
| 1248 | |
| 1249 | for (int i = _palDirtyMin; i <= _palDirtyMax; i++) { |
| 1250 | byte *data = _pal + i * 3; |
| 1251 | |
| 1252 | *p++ = data[0]; |
| 1253 | *p++ = data[1]; |
| 1254 | *p++ = data[2]; |
| 1255 | *p++ = 0; |
| 1256 | } |
| 1257 | |
| 1258 | _vm->_system->setPalette(palette_colors, _palDirtyMin, _palDirtyMax - _palDirtyMin + 1); |
| 1259 | |
| 1260 | _palDirtyMax = -1; |
| 1261 | _palDirtyMin = 256; |
| 1262 | } |
1235 | 1263 | if (_updateNeeded) { |
1236 | 1264 | |
1237 | 1265 | uint32 end_time, start_time; |
1238 | 1266 | |
1239 | 1267 | start_time = _vm->_system->getMillis(); |
| 1268 | _vm->_system->copyRectToScreen(_dst, _width, 0, 0, _width, _height); |
1240 | 1269 | _vm->_system->updateScreen(); |
1241 | 1270 | _updateNeeded = false; |
1242 | 1271 | #ifdef _WIN32_WCE |
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.h,v
retrieving revision 1.45
diff -u -r1.45 smush_player.h
|
|
|
73 | 73 | |
74 | 74 | byte *_dst; |
75 | 75 | bool _updateNeeded; |
| 76 | bool _warpNeeded; |
| 77 | int _palDirtyMin, _palDirtyMax; |
| 78 | int _warpX, _warpY; |
| 79 | int _warpButtons; |
76 | 80 | bool _insanity; |
77 | 81 | bool _middleAudio; |
78 | 82 | #ifdef _WIN32_WCE |
… |
… |
|
88 | 92 | ~SmushPlayer(); |
89 | 93 | |
90 | 94 | void play(const char *filename, int32 offset = 0, int32 startFrame = 0); |
| 95 | void warpMouse(int x, int y, int buttons); |
91 | 96 | |
92 | 97 | protected: |
93 | 98 | SmushFont *_sf[5]; |
… |
… |
|
98 | 103 | void insanity(bool); |
99 | 104 | void setPalette(const byte *palette); |
100 | 105 | void setPaletteValue(int n, byte r, byte g, byte b); |
| 106 | void setDirtyColors(int min, int max); |
101 | 107 | void seekSan(const char *file, int32 pos, int32 contFrame); |
102 | 108 | const char *getString(int id); |
103 | 109 | |