public static CellStruct From3DCellsTo2DLeptons(CellStruct XY) { var p3 = From3DCellsTo3DLeptons(XY); var dx = -60 * p3.Y / 2 + 60 * p3.X / 2; var dy = 30 * p3.Y / 2 + 30 * p3.X / 2; return(new CellStruct(dx, dy)); }
internal CellClass GetCellAt(CellStruct xy) { if (xy.X < 0 || xy.X > 511 || xy.Y < 0 || xy.Y > 511) { throw new IndexOutOfRangeException(); } var idxCell = xy.X + (xy.Y << 9); return(Cells[idxCell]); }
public static CellStruct Position2DCellsTL(CellStruct XY) { var p2 = From3DCellsTo2DCells(XY); var w2 = FileFormats.Binary.TMP.TileWidth / 2; var h2 = FileFormats.Binary.TMP.TileHeight / 2; var x = p2.X - w2; var y = p2.Y - h2; return(new CellStruct(x, y)); }
internal bool DrawSubTile(int IsoTileTypeSubIndex, Helpers.ZBufferedTexture tex, CellStruct TopLeft, int CellLevel, bool highlight = false) { var t = getSubTile(IsoTileTypeSubIndex); var clipped = tex.CopyTexture(t.GetTextureStandalone(isoPAL), new CellStruct(TopLeft.X + t.Bounds.X, TopLeft.Y + t.Bounds.Y), CellLevel * 30, false); if (highlight) { t.Highlight(tex, TopLeft); } return(clipped); }
public CellStruct Position2DOnScreen(CellStruct XY) { XY.X -= ScreenBounds.Left; XY.Y -= ScreenBounds.Top; return XY; }
public static CellStruct Position2DCellsTL(CellStruct XY) { var p2 = From3DCellsTo2DCells(XY); var w2 = FileFormats.Binary.TMP.TileWidth / 2; var h2 = FileFormats.Binary.TMP.TileHeight / 2; var x = p2.X - w2; var y = p2.Y - h2; return new CellStruct(x, y); }
public static CoordStruct From3DCellsTo3DLeptons(CellStruct XY) { return new CoordStruct((XY.X << 8) + 128, (XY.Y << 8) + 128, 0); }
public static CellStruct From3DCellsTo2DLeptons(CellStruct XY) { var p3 = From3DCellsTo3DLeptons(XY); var dx = -60 * p3.Y / 2 + 60 * p3.X / 2; var dy = 30 * p3.Y / 2 + 30 * p3.X / 2; return new CellStruct(dx, dy); }
public static CellStruct From3DCellsTo2DCells(CellStruct XY) { var pl = From3DCellsTo2DLeptons(XY); return new CellStruct(pl.X / 256, pl.Y / 256); }
internal CellClass GetCellAt(CellStruct xy) { if (xy.X < 0 || xy.X > 511 || xy.Y < 0 || xy.Y > 511) { throw new IndexOutOfRangeException(); } var idxCell = xy.X + (xy.Y << 9); return Cells[idxCell]; }
internal bool DrawSubTile(int IsoTileTypeSubIndex, Helpers.ZBufferedTexture tex, CellStruct TopLeft, int CellLevel, bool highlight = false) { var t = getSubTile(IsoTileTypeSubIndex); var clipped = tex.CopyTexture(t.GetTextureStandalone(isoPAL), new CellStruct(TopLeft.X + t.Bounds.X, TopLeft.Y + t.Bounds.Y), CellLevel * 30, false); if (highlight) { t.Highlight(tex, TopLeft); } return clipped; }
public CellStruct Position2DOnScreen(CellStruct XY) { XY.X -= ScreenBounds.Left; XY.Y -= ScreenBounds.Top; return(XY); }
public static CellStruct From3DCellsTo2DCells(CellStruct XY) { var pl = From3DCellsTo2DLeptons(XY); return(new CellStruct(pl.X / 256, pl.Y / 256)); }
public static CoordStruct From3DCellsTo3DLeptons(CellStruct XY) { return(new CoordStruct((XY.X << 8) + 128, (XY.Y << 8) + 128, 0)); }