.DrawTwoFaceTile STA tileShapeOffset \ Set tileShapeOffset to the tile shape that's been \ amended to use as an offset into the tileShapeColour \ table TAX \ Set X to the tile shape so we can use it as an index \ into the tileShapeColour table LDA #%10000000 \ Set bit 7 and clear bit 6 of polygonType so the call STA polygonType \ to DrawPolygon draws the first triangle in the tile \ face LDA tileShapeColour,X \ Set polygonColours to the entry for this shape from STA polygonColours \ the tileShapeColour or tileShapeColour+16 table, so ww \ draw the first polygon in the correct colour JSR DrawPolygon \ Draw the first triangular face LDA tileShapeOffset \ Set polygonColours to the entry for this shape from EOR #16 \ the other tileShapeColour table (so if the previous TAX \ colour was from tileShapeColour then we pick the next LDA tileShapeColour,X \ colour from tileShapeColour+16) STA polygonColours LDA polygonType \ Set bit 6 of polygonType so both bits 6 and 7 are set, ORA #%01000000 \ so the call to DrawPolygon draws the second triangle STA polygonType \ in the tile face \ Fall into DrawPolygon to draw the second triangular \ faceName: DrawTwoFaceTile [Show more] Type: Subroutine Category: Drawing the landscape Summary: Draw a tile with two triangular (three-sided) facesContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawSlopingTile calls DrawTwoFaceTile * DrawTileAndObjects calls DrawTwoFaceTile
Arguments: A The shape of the tile to draw, amended to use as an offset into the tileShapeColour table Add 16 if either of these is true, so we use the colours from tileShapeColour+16: * viewingQuadrantOpp = 0 * viewingQuadrantOpp = 1, shape = 2, 3, 10, 11 triangleStartPoint The starting point to use when drawing the two triangles (0 or 1) * For shapes 4 or 12 = bit 0 of viewingQuadrantOpp * Otherwise: * 1 for shapes 6, 7, 14, 15 (viewer-relative) * 0 for all other shapes
[X]
Subroutine DrawPolygon (category: Drawing polygons)
Draw a polygon
[X]
Variable polygonColours in workspace Zero page
The colours of the polygon that's being drawn in the DrawPolygon routine
[X]
Variable polygonType in workspace Zero page
Bits 6 and 7 determine the type of polygon to draw in the DrawPolygon routine (the calling subroutine is in brackets)
[X]
Variable tileShapeColour (category: Drawing the landscape)
Tile colours by shape and the orientation of the viewer
[X]
Variable tileShapeOffset in workspace Zero page
The tile shape we are drawing, amended to use as an offset into the tileShapeColour table