From 6e86581e13b9784214237b7358bbd382be209d51 Mon Sep 17 00:00:00 2001 From: "nathan@daedalus" Date: Sun, 8 Apr 2012 14:40:58 -0500 Subject: [PATCH] - Adding a check in the AxiosTimer update to only tick if the game is active --- axios.suo | Bin 208384 -> 211968 bytes axios/Axios_settings.cs | 3 +++ axios/Engine/AxiosTimer.cs | 26 ++++++++++++++------------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/axios.suo b/axios.suo index 3e6dab3cc86dc11142064a87e1712046d4c9be22..c551a9ae1ad36f1b645593c2934ecdb07e83f5bc 100644 GIT binary patch delta 2679 zcmc&$eQZVMA9&vUSr9CI)$i`f&QhHddxM<8!$>&An z>~GWNA~}OdN0}?PXfvky$fimQ**;_8^s8`2WS^FpFoJNFjdhldnLH9`7rQWQYG-dM z?D3>Y3*!tP(R2w-!eQZn5X2{b3XiV{3qc_uR0(^8LDHN<7+^!4jV$lA26SBq6?~tT z-@~fUMV(p@Du{nfU`@88B+1>e8Q;AI9d;t)vlqtkV4$z5z$$uF3{c>=fgV zRUHEuiGNl7l*lgF^F~8z{YBdT0)c1A;)lf?W@U=NK5`7&Gpyf}==)z2ze($lzDApm z53PGcWFDoRh3g`!kBRLlh~KR{mLm;&A%0}TY0%sW3c@D$Hjf1lHH+)n4p*V3upkPc(4z2?g;Zr=co?=TbeW}`9ENt_p@-e_ z51xcsNdo7h#E`?siLZe=+VH@?H$4sQ3XQOy2n`t`hNGm|lU*jG@J>pvU;c6wx**T+ z_r6jUDR>&eNppauE%4afrw-=xC(q-Q0&J*%fa;2@#L1do7` z^N_%;H$*p1R7!QK6+}P5v(-I42`xYu%P0#!2eGB2dk+_wDR?|U78)xS=2kvV^|r$F zCHR%7;3rOdIQfh8&Bd((-gyZ&v)CRRM$4rlB|qjCcBr|6`HmP-_iLDiC#h~a#yH0~4L#AP4aFG9a+44I%l(4`I8=CUz~y#5J*ubgacGvvgV<5D+H8kLS$NDy+Fe zcTKeBu|Vr`D!O}VyPr)SZ03eba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Zc+i7)3%i^t^IN> zV&&JCq!|hk>qTR({ivY*L$s6kKf0OwZ^ZGL9D|s=N*?w6FKCcxuXbgvn7Klwm_zha z!e)OV4_jI>t_o<+(}jZe*&fl_dzkwUSon9Am5QNJGN``aPzKFD_D0cak&AIV?f;#F zxLuRD_%W5>%6zf)6nXCrt&!V2iR#L?X`L*deMokwj%#$eb3;GA$7kUH48U`65T1t@ z;6-=|4#6ON8xDi^EzdzV@;id~%W#d47bTqV4@Ev~pImoQhn~!>M>f{T&*_Tv+E(!* z?_aQ*yL38n-j264w7`u*jEcevno4J9S>(JHp6|LYg=aOFqJs}=9o#1m;r+Nb@s=X3 n)3Ms;Qz-m5B14cN`cGqIryDH1qhTRVFH*N&rg0`F@|o{HOueRJ diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index c291a56..1b826a0 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -59,6 +59,9 @@ * 1.0.1.2 - 4/1/2012 * - Making AxiosTimer inheirt from AxiosGameObject for it to be casted properly * + * 1.0.1.3 - 4/7/2012 + * - Adding a check in the AxiosTimer update to only tick if the game is active + * */ using System.Reflection; diff --git a/axios/Engine/AxiosTimer.cs b/axios/Engine/AxiosTimer.cs index d5e4302..582f1c7 100644 --- a/axios/Engine/AxiosTimer.cs +++ b/axios/Engine/AxiosTimer.cs @@ -37,25 +37,27 @@ namespace Axios.Engine public override void Update(AxiosGameScreen gameScreen, GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { - - if (_enabled) + if (gameScreen.IsActive) //only "tick" if the window has focus - otherwise the Timer will play catchup { - if (gameTime.TotalGameTime - lastTick >= interval) + if (_enabled) { - if (Tick != null) + if (gameTime.TotalGameTime - lastTick >= interval) { - //EventArgs e = new EventArgs(); - - Tick(this, null); - } + if (Tick != null) + { + //EventArgs e = new EventArgs(); + Tick(this, null); + } + + lastTick = gameTime.TotalGameTime; + } + } + else + { lastTick = gameTime.TotalGameTime; } } - else - { - lastTick = gameTime.TotalGameTime; - } } public override void LoadContent(AxiosGameScreen gameScreen)