| 130 | } |
| 131 | |
| 132 | void CLevelDialog::OnOK() { |
| 133 | // if there's a current selection for each of the dropdown lists, set each room's properties via |
| 134 | // the selected room list. |
| 135 | CComboBox *cbox = (CComboBox *)GetDlgItem(IDC_ENVAUD_LIST); |
| 136 | CString selection; |
| 137 | int i; |
| 138 | room *rp; |
| 139 | |
| 140 | if (cbox->GetCurSel() != CB_ERR) { |
| 141 | uint8_t env_reverb = 0; |
| 142 | |
| 143 | cbox->GetLBText(cbox->GetCurSel(), selection); |
| 144 | for (i = 0; i < N_ENVAUDIO_PRESETS; i++) { |
| 145 | if (selection == EnvAudio_PresetNames[i]) { |
| 146 | env_reverb = i; |
| 147 | break; |
| 148 | } |
| 149 | } |
| 150 | if (i == N_ENVAUDIO_PRESETS) { |
| 151 | Int3(); // Samir! |
| 152 | } |
| 153 | |
| 154 | if (N_selected_rooms) { |
| 155 | for (i = 0; i < N_selected_rooms; i++) { |
| 156 | rp = &Rooms[Selected_rooms[i]]; |
| 157 | rp->env_reverb = env_reverb; |
| 158 | } |
| 159 | } else { |
| 160 | Curroomp->env_reverb = env_reverb; |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | cbox = (CComboBox *)GetDlgItem(IDC_AMBIENT_SOUND); |
| 165 | if (cbox->GetCurSel() != CB_ERR) { |
| 166 | int amb_sound = -1; |
| 167 | |
| 168 | cbox->GetLBText(cbox->GetCurSel(), selection); |
| 169 | if (selection != NULL_NAME) { |
| 170 | for (i = 0; i < Num_ambient_sound_patterns; i++) { |
| 171 | if (Ambient_sound_patterns[i].name[0]) { |
| 172 | if (selection == AmbientSoundPatternName(i)) { |
| 173 | amb_sound = i; |
| 174 | break; |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | if (i == Num_ambient_sound_patterns) { |
| 179 | Int3(); // Samir! |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | if (N_selected_rooms) { |
| 184 | for (i = 0; i < N_selected_rooms; i++) { |
| 185 | rp = &Rooms[Selected_rooms[i]]; |
| 186 | rp->ambient_sound = amb_sound; |
| 187 | } |
| 188 | } else { |
| 189 | Curroomp->ambient_sound = amb_sound; |
nothing calls this directly
no test coverage detected