hedgewars/uLandPainted.pas
changeset 10131 4b4a043111f4
parent 10108 c68cf030eded
child 10243 9a3ba4e76e38
equal deleted inserted replaced
10130:a9d509848390 10131:4b4a043111f4
    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;
       
    36     PPointRec = ^PointRec;
    36 
    37 
    37 type
    38 type
    38     PPointEntry = ^PointEntry;
    39     PPointEntry = ^PointEntry;
    39     PointEntry = record
    40     PointEntry = record
    40         point: PointRec;
    41         point: PointRec;
    43 
    44 
    44 var pointsListHead, pointsListLast: PPointEntry;
    45 var pointsListHead, pointsListLast: PPointEntry;
    45 
    46 
    46 procedure chDraw(var s: shortstring);
    47 procedure chDraw(var s: shortstring);
    47 var rec: PointRec;
    48 var rec: PointRec;
    48     prec: ^PointRec;
    49     prec: PPointRec;
    49     pe: PPointEntry;
    50     pe: PPointEntry;
    50     i, l: byte;
    51     i, l: byte;
    51 begin
    52 begin
    52     i:= 1;
    53     i:= 1;
    53     l:= length(s);
    54     l:= length(s);
    54     while i < l do
    55     while i < l do
    55         begin
    56         begin
    56         prec:= @s[i];
    57         prec:= PPointRec(@s[i]);
    57         rec:= prec^;
    58         rec:= prec^;
    58         rec.X:= SDLNet_Read16(@rec.X);
    59         rec.X:= SDLNet_Read16(@rec.X);
    59         rec.Y:= SDLNet_Read16(@rec.Y);
    60         rec.Y:= SDLNet_Read16(@rec.Y);
    60         if rec.X < -318 then rec.X:= -318;
    61         if rec.X < -318 then rec.X:= -318;
    61         if rec.X > 4096+318 then rec.X:= 4096+318;
    62         if rec.X > 4096+318 then rec.X:= 4096+318;