Add Game.Zoom for remaining engine stuff.

This commit is contained in:
Paul Chote
2013-09-27 18:14:44 +12:00
parent 3ae75362bb
commit fe8c80aca6
5 changed files with 11 additions and 5 deletions

View File

@@ -682,8 +682,9 @@ namespace OpenRA
Al.alSourcei(source, Al.AL_LOOPING, looping ? Al.AL_TRUE : Al.AL_FALSE);
Al.alSourcei(source, Al.AL_SOURCE_RELATIVE, relative ? 1 : 0);
Al.alSourcef(source, Al.AL_REFERENCE_DISTANCE, Game.viewport.WorldRect.Width / 8);
Al.alSourcef(source, Al.AL_MAX_DISTANCE, 2*Game.viewport.WorldRect.Width);
var width = Game.Renderer.Resolution.Width / (Game.Zoom * Game.CellSize);
Al.alSourcef(source, Al.AL_REFERENCE_DISTANCE, width / 8);
Al.alSourcef(source, Al.AL_MAX_DISTANCE, 2 * width);
Al.alSourcePlay(source);
}