Ticket #9080: walksound.patch
File walksound.patch, 2.6 KB (added by , 15 years ago) |
---|
-
engines/scumm/actor.cpp
1164 1164 1165 1165 stopActorMoving(); 1166 1166 _cost.soundCounter = 0; 1167 _cost.soundPos = 0; 1167 1168 1168 1169 if (_walkbox != kInvalidBox) { 1169 1170 byte flags = _vm->getBoxFlags(_walkbox); … … 1223 1224 } 1224 1225 _visible = false; 1225 1226 _cost.soundCounter = 0; 1227 _cost.soundPos = 0; 1226 1228 _needRedraw = false; 1227 1229 _needBgReset = true; 1228 1230 } … … 1269 1271 } 1270 1272 } 1271 1273 1274 // bits 0..5: sound, bit 6: ??? 1275 static const byte v0ActorSounds[24] = { 1276 0x06, // Syd 1277 0x06, // Razor 1278 0x06, // Dave 1279 0x06, // Michael 1280 0x06, // Bernard 1281 0x06, // Wendy 1282 0x00, // Jeff 1283 0x46, // ??? 1284 0x06, // Dr Fred 1285 0x06, // Nurse Edna 1286 0x06, // Weird Ed 1287 0x06, // Dead Cousin Ted 1288 0xFF, // Purple Tentacle 1289 0xFF, // Green Tentacle 1290 0x06, // Meteor 1291 0xC0, // Plant 1292 0x06, // ??? 1293 0x06, // ??? 1294 0x00, // ??? 1295 0xC0, // ??? 1296 0xC0, // ??? 1297 0x00, // ??? 1298 0x06, // Sandy 1299 0x06, // ??? 1300 }; 1301 1272 1302 /* Used in Scumm v5 only. Play sounds associated with actors */ 1273 1303 void ScummEngine::playActorSounds() { 1274 int i; 1304 int i, j; 1305 int sound; 1275 1306 1276 1307 for (i = 1; i < _numActors; i++) { 1277 1308 if (_actors[i]->_cost.soundCounter && _actors[i]->isInCurrentRoom() && _actors[i]->_sound) { 1278 1309 _currentScript = 0xFF; 1279 _sound->addSoundToQueue(_actors[i]->_sound[0]); 1280 for (i = 1; i < _numActors; i++) { 1281 _actors[i]->_cost.soundCounter = 0; 1310 if (_game.version == 0) { 1311 sound = v0ActorSounds[i - 1] & 0x3F; 1312 } else { 1313 sound = _actors[i]->_sound[0]; 1282 1314 } 1315 _sound->addSoundToQueue(sound); 1316 for (j = 1; j < _numActors; j++) { 1317 _actors[j]->_cost.soundCounter = 0; 1318 } 1283 1319 return; 1284 1320 } 1285 1321 } -
engines/scumm/actor.h
55 55 byte active[16]; 56 56 uint16 animCounter; 57 57 byte soundCounter; 58 byte soundPos; 58 59 uint16 stopped; 59 60 uint16 curpos[16]; 60 61 uint16 start[16]; -
engines/scumm/costume.cpp
1299 1299 frameUpdate(A, cmd); 1300 1300 } 1301 1301 1302 if (A->_moving && _vm->_currentRoom != 1 && _vm->_currentRoom != 44) { 1303 if (a->_cost.soundPos == 0) 1304 a->_cost.soundCounter++; 1305 a->_cost.soundPos = (a->_cost.soundPos + 1) % 3; 1306 } 1307 1302 1308 // increase each frame pos 1303 1309 for (int limb = 0; limb < 8; ++limb) { 1304 1310 if (a->_cost.curpos[limb] < a->_cost.end[limb])