Ticket #8604: sky-control.patch
File sky-control.patch, 4.5 KB (added by , 18 years ago) |
---|
-
engines/sky/control.h
203 203 uint16 handleClick(ConResource *pButton); 204 204 uint16 doMusicSlide(void); 205 205 uint16 doSpeedSlide(void); 206 uint16 toggleFx(ConResource *pButton);206 void toggleFx(void); 207 207 uint16 toggleText(void); 208 208 void toggleMusic(void); 209 209 uint16 shiftDown(uint8 speed); -
engines/sky/sky.cpp
357 357 if (ConfMan.getBool("sfx_mute")) { 358 358 SkyEngine::_systemVars.systemFlags |= SF_FX_OFF; 359 359 } 360 if (ConfMan.getBool("music_mute")) { 361 SkyEngine::_systemVars.systemFlags |= SF_MUS_OFF; 362 } 360 363 _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); 361 364 _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); 362 365 _floppyIntro = ConfMan.getBool("alt_intro"); -
engines/sky/control.cpp
284 284 _savePanButton = createResource( _sprites.button, 3, 0, 58, 39, 48, SAVE_GAME_PANEL, MAINPANEL); 285 285 _dosPanButton = createResource( _sprites.button, 3, 0, 58, 59, 93, QUIT_TO_DOS, MAINPANEL); 286 286 _restartPanButton = createResource( _sprites.button, 3, 0, 58, 79, 94, RESTART, MAINPANEL); 287 if (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) 288 _fxPanButton = createResource( _sprites.button, 3, 0, 58, 99, 87, TOGGLE_FX, MAINPANEL); 289 else 290 _fxPanButton = createResource( _sprites.button, 3, 2, 58, 99, 86, TOGGLE_FX, MAINPANEL); 287 _fxPanButton = createResource( _sprites.button, 3, 0, 58, 99, 90, TOGGLE_FX, MAINPANEL); 291 288 292 289 if (SkyEngine::isCDVersion()) { // CD Version: Toggle text/speech 293 _musicPanButton = createResource( 290 _musicPanButton = createResource( _sprites.button, 3, 0, 58, 119, 52, TOGGLE_TEXT, MAINPANEL); 294 291 } else { // disk version: toggle music on/off 295 _musicPanButton = createResource( 292 _musicPanButton = createResource( _sprites.button, 3, 0, 58, 119, 91, TOGGLE_MS, MAINPANEL); 296 293 } 297 294 _bodge = createResource( _sprites.musicBodge, 2, 1, 98, 115, 0, DO_NOTHING, MAINPANEL); 298 295 _yesNo = createResource( _sprites.yesNo, 1, 0, -2, 40, 0, DO_NOTHING, MAINPANEL); … … 573 570 _mouseClicked = true; 574 571 return doMusicSlide(); 575 572 case TOGGLE_FX: 576 return toggleFx(pButton); 573 animClick(pButton); 574 toggleFx(); 575 return TOGGLED; 577 576 case TOGGLE_MS: 578 577 animClick(pButton); 579 578 toggleMusic(); … … 647 646 wantMouse = MOUSE_NORMAL; 648 647 } 649 648 _mouseClicked = false; 649 _skyMouse->spriteMouse(MOUSE_NORMAL, 0, 0); 650 650 if (dlgTextDat) 651 651 free(dlgTextDat); 652 652 delete dlgText; … … 708 708 return SPEED_CHANGED; 709 709 } 710 710 711 uint16 Control::toggleFx(ConResource *pButton) {711 void Control::toggleFx(void) { 712 712 713 713 SkyEngine::_systemVars.systemFlags ^= SF_FX_OFF; 714 714 if (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) { 715 pButton->_curSprite = 0;716 pButton->_text = 0x7000 + 87;717 715 _statusBar->setToText(0x7000 + 87); 718 716 } else { 719 pButton->_curSprite = 2;720 pButton->_text = 0x7000 + 86;721 717 _statusBar->setToText(0x7000 + 86); 722 718 } 723 719 724 720 ConfMan.setBool("sfx_mute", (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) != 0); 725 726 pButton->drawToScreen(WITH_MASK);727 buttonControl(pButton);728 _system->updateScreen();729 return TOGGLED;730 721 } 731 722 732 723 uint16 Control::toggleText(void) { … … 758 749 759 750 void Control::toggleMusic(void) { 760 751 752 SkyEngine::_systemVars.systemFlags ^= SF_MUS_OFF; 761 753 if (SkyEngine::_systemVars.systemFlags & SF_MUS_OFF) { 762 SkyEngine::_systemVars.systemFlags &= ~SF_MUS_OFF;763 _skyMusic->startMusic(SkyEngine::_systemVars.currentMusic);764 _statusBar->setToText(0x7000 + 88);765 } else {766 SkyEngine::_systemVars.systemFlags |= SF_MUS_OFF;767 754 _skyMusic->startMusic(0); 768 755 _statusBar->setToText(0x7000 + 89); 756 } else { 757 _skyMusic->startMusic(SkyEngine::_systemVars.currentMusic); 758 _statusBar->setToText(0x7000 + 88); 769 759 } 760 761 ConfMan.setBool("music_mute", (SkyEngine::_systemVars.systemFlags & SF_MUS_OFF) != 0); 770 762 } 771 763 772 764 uint16 Control::shiftDown(uint8 speed) {