I had no much time to see this stuff, however I was trying to parameterize the function that draws airlines, to remove those horrible spikes.

The idea is to sum normal and tangent vectors in the vertexes of the arcs in order to find a sort of 45° vector, then shrink those vectors to not make a too "large" curve. Essentially I removed the 4 parameters that were defining fixed starting and ending directions for curves, and now it's the function itself that calculates those directions.

I tested it on two maps and seems to me giving better visual results, so I post here the code of the new function so whoever wants can give a try.

You also have to change the calls to draw_bezier(), removing the four parameters = 50, and of course fix simgraph.h changing the method's signature.

`void draw_bezier(KOORD_VAL Ax, KOORD_VAL Ay, KOORD_VAL Bx, KOORD_VAL By, const PLAYER_COLOR_VAL colore,short draw, short dontDraw)`

{

KOORD_VAL Cx,Cy,Dx,Dy;

//part changed

KOORD_VAL normalX,normalY,directionX,directionY;

normalX=(Ay-By)>>4;

normalY=(Bx-Ax)>>4;

directionX=(Bx-Ax)>>4;

directionY=(By-Ay)>>4;

Cx=Ax+normalX+directionX;

Cy=Ay+normalY+directionY;

Dx=Bx+normalX-directionX;

Dy=By+normalY-directionY;

//end of changes

int a,b,rx,ry,oldx,oldy;

//fixed point: we cycle between 0 and 32, rather than 0 and 1

for (int t=0;t<=32;t++)

{

a = t;

b = 32 - t;

if (t>0)

{

oldx=rx;

oldy=ry;

}

rx = Ax*b*b*b + 3*Cx*b*b*a + 3*Dx*b*a*a + Bx*a*a*a;

ry = Ay*b*b*b + 3*Cy*b*b*a + 3*Dy*b*a*a + By*a*a*a;

//fixed point: due to cycling between 0 and 32 (2<<5), we divide by 32^3=2>>15 because of cubic interpolation

if (t>0)

if (!draw && !dontDraw)

display_direct_line(rx>>15,ry>>15,oldx>>15,oldy>>15,colore);

else

display_direct_line_dotted(rx>>15,ry>>15,oldx>>15,oldy>>15,draw,dontDraw,colore);

}

}