xPoints[1] = baseX + halfRoadWidth; yPoints[1] = baseY + hexSideByCos30; xPoints[2] = baseX - halfRoadWidth; yPoints[2] = baseY + hexSideByCos30; xPoints[3] = baseX - halfRoadWidth;;
xPoints[1] = baseX + halfRoadWidth[zoom]; yPoints[1] = baseY + hexSideByCos30[zoom]; xPoints[2] = baseX - halfRoadWidth[zoom]; yPoints[2] = baseY + hexSideByCos30[zoom]; xPoints[3] = baseX - halfRoadWidth[zoom];
    private void paintRoads (Graphics g){        int exits = 0;        int baseX, baseY, x, y;        int [] xPoints = new int[4];        int [] yPoints = new int[4];        Color oldColor = g.getColor();        g.setColor(m_terrainColors[Terrain.ROAD]);        for (Enumeration enum = roadHexIndexes.elements(); enum.hasMoreElements(); ){            int[] hex = (int[])enum.nextElement();            x = hex[0];            y = hex[1];            baseX = x *(hexSide + hexSideBySin30) + leftMargin + hexSide;            baseY = (2*y + 1 + x%2)* hexSideByCos30 + topMargin;            exits = hex[2];            // Is there a North exit?            if ( 0 != (exits & 0x0001) ) {                xPoints[0] = baseX - halfRoadWidth ;                yPoints[0] = baseY;                xPoints[1] = baseX - halfRoadWidth;                yPoints[1] = baseY - hexSideByCos30;                xPoints[2] = baseX + halfRoadWidth;                yPoints[2] = baseY - hexSideByCos30;                xPoints[3] = baseX + halfRoadWidth;                yPoints[3] = baseY;                g.drawPolygon(xPoints,yPoints,4);                g.fillPolygon(xPoints,yPoints,4);            }            // Is there a North-East exit?            if ( 0 != (exits & 0x0002) ) {                xPoints[0] = baseX - halfRoadWidthBySin30;                yPoints[0] = baseY - halfRoadWidthByCos30;                xPoints[1] = (int) Math.round(baseX + 3*hexSide/4 - halfRoadWidthBySin30);                yPoints[1] = (int) Math.round(baseY - hexSideByCos30/2 - halfRoadWidthByCos30);                xPoints[2] = xPoints[1] + 2 * halfRoadWidthBySin30;                yPoints[2] = yPoints[1] + 2 * halfRoadWidthByCos30;                xPoints[3] = baseX + halfRoadWidthBySin30;                yPoints[3] = baseY + halfRoadWidthByCos30;                g.drawPolygon(xPoints,yPoints,4);                g.fillPolygon(xPoints,yPoints,4);            }                  // Is there a South-East exit?            if ( 0 != (exits & 0x0004) ) {                xPoints[0] = baseX + halfRoadWidthBySin30;                yPoints[0] = baseY - halfRoadWidthByCos30;                xPoints[1] = (int) Math.round(baseX + 3*hexSide/4 + halfRoadWidthBySin30);                yPoints[1] = (int) Math.round(baseY + hexSideByCos30/2 - halfRoadWidthByCos30);                xPoints[2] = xPoints[1] - 2 * halfRoadWidthBySin30;                yPoints[2] = yPoints[1] + 2 * halfRoadWidthByCos30;                xPoints[3] = baseX - halfRoadWidthBySin30;                yPoints[3] = baseY + halfRoadWidthByCos30;                g.drawPolygon(xPoints,yPoints,4);                g.fillPolygon(xPoints,yPoints,4);            }            // Is there a South exit?            if ( 0 != (exits & 0x0008) ) {                xPoints[0] = baseX + halfRoadWidth;                yPoints[0] = baseY;                xPoints[1] = baseX + halfRoadWidth;                yPoints[1] = baseY + hexSideByCos30;                xPoints[2] = baseX - halfRoadWidth;                yPoints[2] = baseY + hexSideByCos30;                xPoints[3] = baseX - halfRoadWidth;;                yPoints[3] = baseY;                g.drawPolygon(xPoints,yPoints,4);                g.fillPolygon(xPoints,yPoints,4);            }            // Is there a South-West exit?            if ( 0 != (exits & 0x0010) ) {                xPoints[0] = baseX + halfRoadWidthBySin30;                yPoints[0] = baseY + halfRoadWidthByCos30;                xPoints[1] = (int) Math.round(baseX - 3*hexSide/4 + halfRoadWidthBySin30);                yPoints[1] = (int) Math.round(baseY + hexSideByCos30/2 + halfRoadWidthByCos30);                xPoints[2] = xPoints[1] - 2*halfRoadWidthBySin30;                yPoints[2] = yPoints[1] - 2*halfRoadWidthByCos30;                xPoints[3] = baseX - halfRoadWidthBySin30;                yPoints[3] = baseY - halfRoadWidthByCos30;                g.drawPolygon(xPoints,yPoints,4);                g.fillPolygon(xPoints,yPoints,4);            }            // Is there a North-West exit?            if ( 0 != (exits & 0x0020) ) {                xPoints[0] = baseX - halfRoadWidthBySin30;                yPoints[0] = baseY + halfRoadWidthByCos30;                xPoints[1] = (int) Math.round(baseX - 3*hexSide/4 - halfRoadWidthBySin30);                yPoints[1] = (int) Math.round(baseY - hexSideByCos30/2 + halfRoadWidthByCos30);                xPoints[2] = xPoints[1] + 2*halfRoadWidthBySin30;;                yPoints[2] = yPoints[1] - 2*halfRoadWidthByCos30;;                xPoints[3] = baseX + halfRoadWidthBySin30;                yPoints[3] = baseY - halfRoadWidthByCos30;                g.drawPolygon(xPoints,yPoints,4);                g.fillPolygon(xPoints,yPoints,4);            }        }