src/sound.cpp
changeset 6891 824359de2f5e
parent 6853 011888c570df
child 7570 5d5d9b6af0ef
equal deleted inserted replaced
6890:bebf22f6c449 6891:824359de2f5e
   209 				IS_INSIDE_1D(y, vp->virtual_top, vp->virtual_height)) {
   209 				IS_INSIDE_1D(y, vp->virtual_top, vp->virtual_height)) {
   210 			int left = (x - vp->virtual_left);
   210 			int left = (x - vp->virtual_left);
   211 
   211 
   212 			StartSound(
   212 			StartSound(
   213 				sound,
   213 				sound,
   214 				left / (vp->virtual_width / ((PANNING_LEVELS << 1) + 1)) - PANNING_LEVELS,
   214 				left / max(1, vp->virtual_width / ((PANNING_LEVELS << 1) + 1)) - PANNING_LEVELS,
   215 				(GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom]) >> 15
   215 				(GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom]) >> 15
   216 			);
   216 			);
   217 			return;
   217 			return;
   218 		}
   218 		}
   219 	}
   219 	}