@@ -11,7 +11,7 @@ namespace TSMapEditor.UI
1111{
1212 class OverlayFrameSelectorFrame
1313 {
14- public OverlayFrameSelectorFrame ( Point location , Point offset , Point size , int overlayFrameIndex , Texture2D texture )
14+ public OverlayFrameSelectorFrame ( Point location , Point offset , Point size , int overlayFrameIndex , PositionedTexture texture )
1515 {
1616 Location = location ;
1717 Offset = offset ;
@@ -24,7 +24,7 @@ public OverlayFrameSelectorFrame(Point location, Point offset, Point size, int o
2424 public Point Offset { get ; set ; }
2525 public Point Size { get ; set ; }
2626 public int OverlayFrameIndex { get ; set ; }
27- public Texture2D Texture { get ; set ; }
27+ public PositionedTexture Texture { get ; set ; }
2828 }
2929
3030 public class OverlayFrameSelector : XNAPanel
@@ -241,8 +241,8 @@ private void RefreshGraphics()
241241 if ( frame == null )
242242 continue ;
243243
244- int width = frame . Texture . Width ;
245- int height = frame . Texture . Height ;
244+ int width = frame . SourceRectangle . Width ;
245+ int height = frame . SourceRectangle . Height ;
246246
247247 if ( x + width > usableWidth )
248248 {
@@ -255,7 +255,7 @@ private void RefreshGraphics()
255255 tilesOnCurrentLine . Clear ( ) ;
256256 }
257257
258- var tileDisplayTile = new OverlayFrameSelectorFrame ( new Point ( x , y ) , new Point ( 0 , 0 ) , new Point ( width , height ) , i , frame . Texture ) ;
258+ var tileDisplayTile = new OverlayFrameSelectorFrame ( new Point ( x , y ) , new Point ( 0 , 0 ) , new Point ( width , height ) , i , frame ) ;
259259 framesInView . Add ( tileDisplayTile ) ;
260260
261261 if ( height > currentLineHeight )
@@ -341,8 +341,8 @@ public override void Draw(GameTime gameTime)
341341 palettedDrawEffect . Parameters [ "PaletteTexture" ] . SetValue ( currentOverlayShape . GetPaletteTexture ( ) ) ;
342342 palettedDrawEffect . Parameters [ "Lighting" ] . SetValue ( Vector4 . One ) ;
343343
344- DrawTexture ( frame . Texture , new Rectangle ( frame . Location . X + frame . Offset . X ,
345- viewY + frame . Location . Y + frame . Offset . Y , frame . Texture . Width , frame . Texture . Height ) , Color . White ) ;
344+ DrawTexture ( frame . Texture . Texture , frame . Texture . SourceRectangle , new Rectangle ( frame . Location . X + frame . Offset . X ,
345+ viewY + frame . Location . Y + frame . Offset . Y , frame . Texture . SourceRectangle . Width , frame . Texture . SourceRectangle . Height ) , Color . White ) ;
346346 }
347347
348348 Renderer . PopSettings ( ) ;
0 commit comments