@@ -34,52 +34,52 @@ public partial class Animation
3434
3535 private long mUpperTimer ;
3636
37- public AnimationBase MyBase ;
37+ public AnimationDescriptor Descriptor ;
3838
39- public Animation ( AnimationBase animBase , bool loopForever )
39+ public Animation ( AnimationDescriptor animationDescriptor , bool loopForever )
4040 {
41- MyBase = animBase ;
42- mLowerLoop = animBase . Lower . LoopCount ;
43- mUpperLoop = animBase . Upper . LoopCount ;
44- mLowerTimer = Timing . Global . MillisecondsUtc + animBase . Lower . FrameSpeed ;
45- mUpperTimer = Timing . Global . MillisecondsUtc + animBase . Upper . FrameSpeed ;
41+ Descriptor = animationDescriptor ;
42+ mLowerLoop = animationDescriptor . Lower . LoopCount ;
43+ mUpperLoop = animationDescriptor . Upper . LoopCount ;
44+ mLowerTimer = Timing . Global . MillisecondsUtc + animationDescriptor . Lower . FrameSpeed ;
45+ mUpperTimer = Timing . Global . MillisecondsUtc + animationDescriptor . Upper . FrameSpeed ;
4646 mInfiniteLoop = loopForever ;
4747 }
4848
4949 public void Draw ( RenderTarget2D target , bool upper = false , bool alternate = false )
5050 {
51- if ( ! upper && alternate != MyBase . Lower . AlternateRenderLayer )
51+ if ( ! upper && alternate != Descriptor . Lower . AlternateRenderLayer )
5252 {
5353 return ;
5454 }
5555
56- if ( upper && alternate != MyBase . Upper . AlternateRenderLayer )
56+ if ( upper && alternate != Descriptor . Upper . AlternateRenderLayer )
5757 {
5858 return ;
5959 }
6060
6161 if ( ! upper )
6262 {
6363 //Draw Lower
64- var tex = GameContentManager . GetTexture ( GameContentManager . TextureType . Animation , MyBase . Lower . Sprite ) ;
64+ var tex = GameContentManager . GetTexture ( GameContentManager . TextureType . Animation , Descriptor . Lower . Sprite ) ;
6565 if ( mShowLower )
6666 {
67- if ( mLowerFrame >= MyBase . Lower . FrameCount )
67+ if ( mLowerFrame >= Descriptor . Lower . FrameCount )
6868 {
6969 return ;
7070 }
7171
7272 if ( tex != null )
7373 {
74- if ( MyBase . Lower . XFrames > 0 && MyBase . Lower . YFrames > 0 )
74+ if ( Descriptor . Lower . XFrames > 0 && Descriptor . Lower . YFrames > 0 )
7575 {
76- var frameWidth = ( int ) tex . Width / MyBase . Lower . XFrames ;
77- var frameHeight = ( int ) tex . Height / MyBase . Lower . YFrames ;
76+ var frameWidth = ( int ) tex . Width / Descriptor . Lower . XFrames ;
77+ var frameHeight = ( int ) tex . Height / Descriptor . Lower . YFrames ;
7878 Core . Graphics . DrawTexture (
7979 tex ,
8080 new RectangleF (
81- mLowerFrame % MyBase . Lower . XFrames * frameWidth ,
82- ( float ) Math . Floor ( ( double ) mLowerFrame / MyBase . Lower . XFrames ) * frameHeight ,
81+ mLowerFrame % Descriptor . Lower . XFrames * frameWidth ,
82+ ( float ) Math . Floor ( ( double ) mLowerFrame / Descriptor . Lower . XFrames ) * frameHeight ,
8383 frameWidth , frameHeight
8484 ) ,
8585 new RectangleF (
@@ -93,36 +93,36 @@ public void Draw(RenderTarget2D target, bool upper = false, bool alternate = fal
9393 Options . Instance . Map . MapWidth * Options . Instance . Map . TileWidth -
9494 Core . Graphics . CurrentView . Left +
9595 ( int ) mRenderX +
96- MyBase . Lower . Lights [ mLowerFrame ] . OffsetX ,
96+ Descriptor . Lower . Lights [ mLowerFrame ] . OffsetX ,
9797 Options . Instance . Map . MapHeight * Options . Instance . Map . TileHeight -
9898 Core . Graphics . CurrentView . Top +
9999 ( int ) mRenderY +
100- MyBase . Lower . Lights [ mLowerFrame ] . OffsetY , MyBase . Lower . Lights [ mLowerFrame ]
100+ Descriptor . Lower . Lights [ mLowerFrame ] . OffsetY , Descriptor . Lower . Lights [ mLowerFrame ]
101101 ) ;
102102 }
103103 }
104104 else
105105 {
106106 //Draw Upper
107- var tex = GameContentManager . GetTexture ( GameContentManager . TextureType . Animation , MyBase . Upper . Sprite ) ;
107+ var tex = GameContentManager . GetTexture ( GameContentManager . TextureType . Animation , Descriptor . Upper . Sprite ) ;
108108 if ( mShowUpper )
109109 {
110- if ( mUpperFrame >= MyBase . Upper . FrameCount )
110+ if ( mUpperFrame >= Descriptor . Upper . FrameCount )
111111 {
112112 return ;
113113 }
114114
115115 if ( tex != null )
116116 {
117- if ( MyBase . Upper . XFrames > 0 && MyBase . Upper . YFrames > 0 )
117+ if ( Descriptor . Upper . XFrames > 0 && Descriptor . Upper . YFrames > 0 )
118118 {
119- var frameWidth = ( int ) tex . Width / MyBase . Upper . XFrames ;
120- var frameHeight = ( int ) tex . Height / MyBase . Upper . YFrames ;
119+ var frameWidth = ( int ) tex . Width / Descriptor . Upper . XFrames ;
120+ var frameHeight = ( int ) tex . Height / Descriptor . Upper . YFrames ;
121121 Core . Graphics . DrawTexture (
122122 tex ,
123123 new RectangleF (
124- mUpperFrame % MyBase . Upper . XFrames * frameWidth ,
125- ( float ) Math . Floor ( ( double ) mUpperFrame / MyBase . Upper . XFrames ) * frameHeight ,
124+ mUpperFrame % Descriptor . Upper . XFrames * frameWidth ,
125+ ( float ) Math . Floor ( ( double ) mUpperFrame / Descriptor . Upper . XFrames ) * frameHeight ,
126126 frameWidth , frameHeight
127127 ) ,
128128 new RectangleF (
@@ -136,11 +136,11 @@ public void Draw(RenderTarget2D target, bool upper = false, bool alternate = fal
136136 Options . Instance . Map . MapWidth * Options . Instance . Map . TileWidth -
137137 Core . Graphics . CurrentView . Left +
138138 ( int ) mRenderX +
139- MyBase . Upper . Lights [ mUpperFrame ] . OffsetX ,
139+ Descriptor . Upper . Lights [ mUpperFrame ] . OffsetX ,
140140 Options . Instance . Map . MapHeight * Options . Instance . Map . TileHeight -
141141 Core . Graphics . CurrentView . Top +
142142 ( int ) mRenderY +
143- MyBase . Upper . Lights [ mUpperFrame ] . OffsetY , MyBase . Upper . Lights [ mUpperFrame ]
143+ Descriptor . Upper . Lights [ mUpperFrame ] . OffsetY , Descriptor . Upper . Lights [ mUpperFrame ]
144144 ) ;
145145 }
146146 }
@@ -158,15 +158,15 @@ public void Update()
158158 if ( mLowerTimer < Timing . Global . MillisecondsUtc && mShowLower )
159159 {
160160 mLowerFrame ++ ;
161- if ( mLowerFrame >= MyBase . Lower . FrameCount )
161+ if ( mLowerFrame >= Descriptor . Lower . FrameCount )
162162 {
163163 mLowerLoop -- ;
164164 mLowerFrame = 0 ;
165165 if ( mLowerLoop < 0 )
166166 {
167167 if ( mInfiniteLoop )
168168 {
169- mLowerLoop = MyBase . Lower . LoopCount ;
169+ mLowerLoop = Descriptor . Lower . LoopCount ;
170170 }
171171 else
172172 {
@@ -175,21 +175,21 @@ public void Update()
175175 }
176176 }
177177
178- mLowerTimer = Timing . Global . MillisecondsUtc + MyBase . Lower . FrameSpeed ;
178+ mLowerTimer = Timing . Global . MillisecondsUtc + Descriptor . Lower . FrameSpeed ;
179179 }
180180
181181 if ( mUpperTimer < Timing . Global . MillisecondsUtc && mShowUpper )
182182 {
183183 mUpperFrame ++ ;
184- if ( mUpperFrame >= MyBase . Upper . FrameCount )
184+ if ( mUpperFrame >= Descriptor . Upper . FrameCount )
185185 {
186186 mUpperLoop -- ;
187187 mUpperFrame = 0 ;
188188 if ( mUpperLoop < 0 )
189189 {
190190 if ( mInfiniteLoop )
191191 {
192- mUpperLoop = MyBase . Upper . LoopCount ;
192+ mUpperLoop = Descriptor . Upper . LoopCount ;
193193 }
194194 else
195195 {
@@ -198,7 +198,7 @@ public void Update()
198198 }
199199 }
200200
201- mUpperTimer = Timing . Global . MillisecondsUtc + MyBase . Upper . FrameSpeed ;
201+ mUpperTimer = Timing . Global . MillisecondsUtc + Descriptor . Upper . FrameSpeed ;
202202 }
203203 }
204204
0 commit comments