hedgewars/uLandPainted.pas
changeset 9472 265e5997580e
parent 9080 9b42757d7e71
child 9998 736015b847e3
equal deleted inserted replaced
9470:9ed07a96349d 9472:265e5997580e
    25 procedure Draw;
    25 procedure Draw;
    26 procedure initModule;
    26 procedure initModule;
    27 procedure freeModule;
    27 procedure freeModule;
    28 
    28 
    29 implementation
    29 implementation
    30 uses uLandGraphics, uConsts, uVariables, uUtils, SDLh, uCommands, uDebug;
    30 uses uLandGraphics, uConsts, uVariables, uUtils, SDLh, uCommands, uDebug, uScript;
    31 
    31 
    32 type PointRec = packed record
    32 type PointRec = packed record
    33     X, Y: SmallInt;
    33     X, Y: SmallInt;
    34     flags: byte;
    34     flags: byte;
    35     end;
    35     end;
    86     prevPoint.X:= 0;
    86     prevPoint.X:= 0;
    87     prevPoint.Y:= 0;
    87     prevPoint.Y:= 0;
    88     radius:= 0;
    88     radius:= 0;
    89 
    89 
    90     pe:= pointsListHead;
    90     pe:= pointsListHead;
    91     TryDo((pe = nil) or (pe^.point.flags and $80 <> 0), 'Corrupted draw data', true);
    91     while (pe <> nil) and (pe^.point.flags and $80 = 0) do
       
    92         begin
       
    93         ScriptCall('onSpecialPoint', pe^.point.X, pe^.point.Y, pe^.point.flags);
       
    94         pe:= pe^.next;
       
    95         end;
    92 
    96 
    93     while(pe <> nil) do
    97     while(pe <> nil) do
    94         begin
    98         begin
    95         if (pe^.point.flags and $80 <> 0) then
    99         if (pe^.point.flags and $80 <> 0) then
    96             begin
   100             begin
   108             DrawThickLine(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color);
   112             DrawThickLine(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color);
   109             FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color)
   113             FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color)
   110             end;
   114             end;
   111 
   115 
   112         prevPoint:= pe^.point;
   116         prevPoint:= pe^.point;
   113         pe:= pe^.next;  
   117         pe:= pe^.next;
   114         end;
   118         end;
   115 end;
   119 end;
   116 
   120 
   117 procedure initModule;
   121 procedure initModule;
   118 begin
   122 begin