diff --git a/SpriteFontPlus/src/obj/Debug/net45/SpriteFontPlus.FNA.csprojAssemblyReference.cache b/SpriteFontPlus/src/obj/Debug/net45/SpriteFontPlus.FNA.csprojAssemblyReference.cache index 755190bc7d6fc7eb143014b3d52b86c8c5d33aa8..07612812874a527a77c5550d16896ba5a87dba91 GIT binary patch literal 7400 zc%1E7U2GiH6`q;>opq8;0)zw-VnYZCv1jbW>p&6<949VrY{&7s3B)+g-QBz1i|1#V znYFP4`Dr4B_Mrh%kce8T675S+DMgi_Z={N<_K6lXRgtLFO05Ve67X0mM9&$|tY>$2 zNF1gTNQ~ukXXf1d-S3=x?wK>Q9M5sw7jR&U#}Wa=kwKO>bW<-{((VdV3eqSsr%b6= zH)w0~L28&x*Sb40Qis$owYN6+RurpZ&~A-ZEQ2Vm&BK+P!t(p*?5I9PweDQ|wqmBZ zz1Y!F$h4DfB!-iZ@XW3C-|;GyS{Mij&fJc*&e>7sZmU>sW6G{Gh{aBeR#DaZ56abOet#}gn5 z@&L;j#F&-)45HE*-Iy}vL0!|OqI)enHkfjk)Uj1+mlc+iRp=sjN|`oNX0kK)NJX=l zN~J6{7*W_9LElIPMTsY2rc#JA_3xL^LW7#vUFySSoY&xNBFwf!{+6H7M>taVLtkAYwRd%XL%fmOeL) zVn&ImdLat`Qv%VV1zI-aCZ<_4W?0kI5Q-XPEI|-BG1*#=oGn4lDo8!1N!6S(I|R1x zeafO58jd-bN5OsY`d_YG_*>FW;Oj8mrcxY_wymt!-sNaxw=U9-)Q#8?D{8PP(W2I0 zh!@piLoZ@32FoHme-p+@iy1IBZu?`Iv*=E6*zOrt-XH#@ZgE2bBWF=-gix^(F?)uh8r&DkQ<3tN6@gfY6%{gRCi3M9G4dts)7vlPSprT< zJ<6mAUF_$vmCWk}nuEu1Vv5d|2{U5E%vwf*nOU4Fg(J(A9sm)Us#ffRB56>Sl*_ch z@reYMA6z6N2xyDI3qoB0B$IqHQ_V11kxf>N`KPdB5~F6-x<}^e=?1e(>aH6d<;*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fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -429,16 +429,6 @@ } - - protected void drawTileAt(int x, int y, int tileIndex, int height) - { - float maxdepth = ((this.squaresAcross + 1) + ((this.squaresDown + 1) * Tile.TileWidth)) * 10; - - float depthOffset = 0.7f - ((0 + (0 * Tile.TileWidth)) / maxdepth); - - drawTileAt(x, y, tileIndex, height, depthOffset); - } - protected Boolean cull(int gridX, int gridY) { int screenX = (gridX - gridY) * Tile.TileSpriteWidth / 2; @@ -451,6 +441,18 @@ && MathUtils.Between(original.Y, -Tile.TileSpriteHeight, FNAGame.height))); } + + protected void drawTileAt(int x, int y, int tileIndex, int height) + { + float maxdepth = ((this.squaresAcross + 1) + ((this.squaresDown + 1) * Tile.TileWidth)) * 10; + + float depthOffset = 0.7f - ((0 + (0 * Tile.TileWidth)) / maxdepth); + + drawTileAt(x, y, tileIndex, height, depthOffset); + } + + + protected void drawTileAt(int x, int y, int tileIndex, int height, float depth) { /* @@ -697,14 +699,14 @@ if (MathUtils.Between(this.mouseGrid.X, -1, this.simulation.map.MapWidth) && MathUtils.Between(this.mouseGrid.Y, -1, this.simulation.map.MapHeight)) { - OutlineSquare(this.mouseGrid.X, this.mouseGrid.Y, Color.Yellow, 1); + Tile.OutlineSquare(batch, this.mouseGrid.X, this.mouseGrid.Y, Color.Yellow, 1); } #if DEBUG - OutlineSquare(1, 1, Color.Red, 2); - OutlineSquare(3, 1, Color.Blue, 2); - OutlineSquare(5, 1, Color.Green, 2); - OutlineSquare(7, 1, Color.Orange, 2); + Tile.OutlineSquare(batch, 1, 1, Color.Red, 2); + Tile.OutlineSquare(batch, 3, 1, Color.Blue, 2); + Tile.OutlineSquare(batch, 5, 1, Color.Green, 2); + Tile.OutlineSquare(batch, 7, 1, Color.Orange, 2); #endif @@ -858,41 +860,5 @@ base.Draw(gameTime); } - private void OutlineSquare(float x, float y, Color color) - { - this.OutlineSquare(x, y, color, 1); - } - - private void OutlineSquare(float x, float y, Color color, int size) - { - Vector2 adjust2 = new Vector2(Tile.TileSpriteWidth / 2, Tile.TileSpriteHeight); //TODO figure out why this second value shouldn't be halved - - //Upper right - //float x = this.mouseGrid.X; - //float y = this.mouseGrid.Y; - Line.drawLine(batch, - new Vector2(((x - y) * Tile.TileSpriteWidth / 2), (x + y) * Tile.TileSpriteHeight / 2) + adjust2, - //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), - new Vector2(((x - y + size) * Tile.TileSpriteWidth / 2), (x + y + size) * Tile.TileSpriteHeight / 2) + adjust2, - color, 0.79f); - - //Bottom right - Line.drawLine(batch, - new Vector2(((x + size - y) * Tile.TileSpriteWidth / 2), (x + size + y) * Tile.TileSpriteHeight / 2) + adjust2, - //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), - new Vector2(((x + size - (y + size)) * Tile.TileSpriteWidth / 2), (x + size + (y + size)) * Tile.TileSpriteHeight / 2) + adjust2, - color, 0.79f); - //Bottom left - Line.drawLine(batch, - new Vector2(((x - (y + size)) * Tile.TileSpriteWidth / 2), (x + y + size) * Tile.TileSpriteHeight / 2) + adjust2, - //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), - new Vector2(((x + size - (y + size)) * Tile.TileSpriteWidth / 2), (x + size + (y + size)) * Tile.TileSpriteHeight / 2) + adjust2, - color, 0.79f); - //Upper left - Line.drawLine(batch, - new Vector2(((x - y) * Tile.TileSpriteWidth / 2), (x + y) * Tile.TileSpriteHeight / 2) + adjust2, - //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), - new Vector2(((x - (y + size)) * Tile.TileSpriteWidth / 2), (x + (y + size)) * Tile.TileSpriteHeight / 2) + adjust2, - color, 0.79f); - } + } diff --git a/isometric-park-fna/Tile.cs b/isometric-park-fna/Tile.cs --- a/isometric-park-fna/Tile.cs +++ b/isometric-park-fna/Tile.cs @@ -40,5 +40,46 @@ return new Rectangle(tileX * TileWidth, tileY * TileHeight, TileWidth, TileHeight*height); } + + + static public void OutlineSquare(SpriteBatch batch, float x, float y, Color color) + { + Tile.OutlineSquare(batch, x, y, color, 1); + } + + static public void OutlineSquare(SpriteBatch batch, float x, float y, Color color, int size) + { + Vector2 adjust2 = new Vector2(Tile.TileSpriteWidth / 2, Tile.TileSpriteHeight); //TODO figure out why this second value shouldn't be halved + + //Upper right + //float x = this.mouseGrid.X; + //float y = this.mouseGrid.Y; + + Line.drawLine(batch, + new Vector2(((x - y) * Tile.TileSpriteWidth / 2), (x + y) * Tile.TileSpriteHeight / 2) + adjust2, + //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), + new Vector2(((x - y + size) * Tile.TileSpriteWidth / 2), (x + y + size) * Tile.TileSpriteHeight / 2) + adjust2, + color, 0.79f); + + //Bottom right + Line.drawLine(batch, + new Vector2(((x + size - y) * Tile.TileSpriteWidth / 2), (x + size + y) * Tile.TileSpriteHeight / 2) + adjust2, + //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), + new Vector2(((x + size - (y + size)) * Tile.TileSpriteWidth / 2), (x + size + (y + size)) * Tile.TileSpriteHeight / 2) + adjust2, + color, 0.79f); + //Bottom left + Line.drawLine(batch, + new Vector2(((x - (y + size)) * Tile.TileSpriteWidth / 2), (x + y + size) * Tile.TileSpriteHeight / 2) + adjust2, + //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), + new Vector2(((x + size - (y + size)) * Tile.TileSpriteWidth / 2), (x + size + (y + size)) * Tile.TileSpriteHeight / 2) + adjust2, + color, 0.79f); + //Upper left + Line.drawLine(batch, + new Vector2(((x - y) * Tile.TileSpriteWidth / 2), (x + y) * Tile.TileSpriteHeight / 2) + adjust2, + //new Vector2(this.squaresAcross * Tile.TileSpriteWidth, (y+1) * Tile.TileSpriteHeight), + new Vector2(((x - (y + size)) * Tile.TileSpriteWidth / 2), (x + (y + size)) * Tile.TileSpriteHeight / 2) + adjust2, + color, 0.79f); + } + } }