Skip to content

Commit

Permalink
Merge pull request #318 from dlamkins/fix/relative-mouse
Browse files Browse the repository at this point in the history
0.6.1 Fixes
  • Loading branch information
greaka authored Oct 15, 2020
2 parents d697793 + 7bb82c0 commit 703cdf9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 8 additions & 1 deletion Blish HUD/GameServices/GameIntegration/AudioIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ public override void Update(GameTime gameTime) {
if (_timeSinceCheck > CHECK_INTERVAL) {
_timeSinceCheck -= CHECK_INTERVAL;

_audioPeakBuffer.PushValue(_processMeterInformation.GetPeakValue());
try {
_audioPeakBuffer.PushValue(_processMeterInformation.GetPeakValue());
} catch (Exception e) {
// Punish audio clock for 10 seconds
_timeSinceCheck = -10000;

Logger.Debug(e, "Getting meter volume failed.");
}

_averageGameVolume = null;
}
Expand Down
10 changes: 4 additions & 6 deletions Blish HUD/GameServices/Input/Mouse/MouseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,14 @@ public void Update() {

var rawMouseState = Mouse.GetState();

this.State = new MouseState(
(int) (this.PositionRaw.X / GameService.Graphics.UIScaleMultiplier),
(int) (this.PositionRaw.Y / GameService.Graphics.UIScaleMultiplier),
_mouseEvent?.WheelDelta ?? 0,
this.State = new MouseState((int) (rawMouseState.X / GameService.Graphics.UIScaleMultiplier),
(int) (rawMouseState.Y / GameService.Graphics.UIScaleMultiplier),
_mouseEvent?.WheelDelta ?? 0,
rawMouseState.LeftButton,
rawMouseState.MiddleButton,
rawMouseState.RightButton,
rawMouseState.XButton1,
rawMouseState.XButton2
);
rawMouseState.XButton2);

// Handle mouse moved
if (prevMouseState.Position != this.State.Position) {
Expand Down

0 comments on commit 703cdf9

Please sign in to comment.