protected override void RenderTopCornerFace(TileDrawInfo drawInfo, int index) { float height = this.height + tileHeight; FastColour colour = lineMode ? new FastColour(150, 150, 150) : TerrainHelper.GetColour(drawInfo.CurrentTile.TerrainId); if (!lineMode) { vertices[index] = new Vertex(x + halfTileWidth, height, y, colour); vertices[index + 1] = new Vertex(x, z2, y + halfTileLength, colour); vertices[index + 2] = new Vertex(x + halfTileWidth, height, y + tileWidth, colour); vertices[index + 3] = new Vertex(x + halfTileWidth, height, y, colour); vertices[index + 4] = new Vertex(x + tileWidth, z1, y + halfTileLength, colour); vertices[index + 5] = new Vertex(x + halfTileWidth, height, y + tileWidth, colour); } else { vertices[index] = new Vertex(x + halfTileWidth, height, y, colour); vertices[index + 1] = new Vertex(x, z2, y + halfTileLength, colour); vertices[index + 2] = new Vertex(x + halfTileWidth, height, y + tileWidth, colour); vertices[index + 3] = new Vertex(x + tileWidth, z1, y + halfTileLength, colour); } drawInfo.TotalTriangles += 2; }
protected override void RenderStretchedFlatFace(TileDrawInfo drawInfo, int index) { FastColour colour = lineMode ? new FastColour(150, 150, 150) : TerrainHelper.GetColour(drawInfo.CurrentTile.TerrainId); if (!lineMode) { vertices[index] = new Vertex(x, z1, y + 0.5f, colour); vertices[index + 1] = new Vertex(x + 0.5f, z1, y, colour); vertices[index + 2] = new Vertex(x + stretchY, z2, y + stretchY - halfTileLength, colour); vertices[index + 3] = new Vertex(x + stretchY, z2, y + stretchY - halfTileLength, colour); vertices[index + 4] = new Vertex(x + stretchY - halfTileWidth, z2, y + stretchY, colour); vertices[index + 5] = new Vertex(x, z1, y + 0.5f, colour); } else { vertices[index] = new Vertex(x, z1, y + 0.5f, colour); vertices[index + 1] = new Vertex(x + 0.5f, z1, y, colour); vertices[index + 2] = new Vertex(x + stretchY, z2, y + stretchY - halfTileLength, colour); vertices[index + 3] = new Vertex(x + stretchY - halfTileWidth, z2, y + stretchY, colour); } drawInfo.TotalTriangles += 2; }
void RenderTopCornerFace(TileDrawInfo drawInfo, Vertex[] vertices, int index) { FastColour colour = TerrainHelper.GetColour(drawInfo.CurrentTile.TerrainId); vertices[index] = new Vertex(X + 0.5f, height, Y, colour); vertices[index + 1] = new Vertex(X, z2, Y + 0.5f, colour); vertices[index + 2] = new Vertex(X + 0.5f, height, Y + tileWidth, colour); vertices[index + 3] = new Vertex(X + 0.5f, height, Y, colour); vertices[index + 4] = new Vertex(X + tileWidth, z1, Y + 0.5f, colour); vertices[index + 5] = new Vertex(X + 0.5f, height, Y + tileWidth, colour); drawInfo.TotalTriangles += 2; }
protected override void RenderBottomCornerFace(TileDrawInfo drawInfo, int index) { FastColour colour = TerrainHelper.GetColour(drawInfo.CurrentTile.TerrainId); vertices[index] = new Vertex(x + 0.5f, height, y, colour); vertices[index + 1] = new Vertex(x, z2, y + 0.5f, colour); vertices[index + 2] = new Vertex(x + 0.5f, height, y + tileWidth, colour); vertices[index + 3] = new Vertex(x + 0.5f, height, y, colour); vertices[index + 4] = new Vertex(x + tileWidth, z1, y + 0.5f, colour); vertices[index + 5] = new Vertex(x + 0.5f, height, y + tileWidth, colour); drawInfo.TotalTriangles += 2; }
protected override void RenderTopCornerFaceRotated(TileDrawInfo drawInfo, int index) { float height = this.height + tileHeight; FastColour colour = TerrainHelper.GetColour(drawInfo.CurrentTile.TerrainId); vertices[index] = new Vertex(x, height, y + 0.5f, colour); vertices[index + 1] = new Vertex(x + 0.5f, z1, y, colour); vertices[index + 2] = new Vertex(x + tileWidth, height, y + 0.5f, colour); vertices[index + 3] = new Vertex(x + tileWidth, height, y + 0.5f, colour); vertices[index + 4] = new Vertex(x + 0.5f, z2, y + tileWidth, colour); vertices[index + 5] = new Vertex(x, height, y + 0.5f, colour); drawInfo.TotalTriangles += 2; }