Browse Source

Fix compilation of graph unit for msdos OS target

git-svn-id: trunk@36630 -
pierre 8 years ago
parent
commit
91995c004c
1 changed files with 14 additions and 0 deletions
  1. 14 0
      packages/graph/src/inc/gtext.inc

+ 14 - 0
packages/graph/src/inc/gtext.inc

@@ -227,7 +227,13 @@ end;
     function unpack(buf: pchar; index: smallint; var Stroke: TStrokes): smallint;
     function unpack(buf: pchar; index: smallint; var Stroke: TStrokes): smallint;
 
 
      var
      var
+{$ifdef CPU16}
+      { TStrokes is too big for small MSDOS Stacks,
+        use individual TStroke instead }
+      spo : TStroke; 
+{$else}
       po: TStrokes;
       po: TStrokes;
+{$endif}
       num_ops: smallint;
       num_ops: smallint;
       opcode, i, opc: word;
       opcode, i, opc: word;
       counter: smallint;
       counter: smallint;
@@ -251,12 +257,20 @@ end;
 
 
        for i:=0 to num_ops-1 do    {    /* For each opcode in buffer    */ }
        for i:=0 to num_ops-1 do    {    /* For each opcode in buffer    */ }
          Begin
          Begin
+{$ifdef CPU16}
+           opc := decode(buf[counter], buf[counter+1], Stroke[lindex].x, Stroke[lindex].y);  {* Decode the data field   *}
+           inc(counter,2);
+	   Stroke[lindex].opcode := opc;
+{$else}
            opc := decode(buf[counter], buf[counter+1], po[lindex].x, po[lindex].y);  {* Decode the data field   *}
            opc := decode(buf[counter], buf[counter+1], po[lindex].x, po[lindex].y);  {* Decode the data field   *}
            inc(counter,2);
            inc(counter,2);
            po[lindex].opcode := opc;      {* Save the opcode            *}
            po[lindex].opcode := opc;      {* Save the opcode            *}
+{$endif}
            Inc(lindex);
            Inc(lindex);
          end;
          end;
+{$ifndef CPU16}
        Stroke:=po;
        Stroke:=po;
+{$endif}
        unpack := num_ops;       {* return OPS count             *}
        unpack := num_ops;       {* return OPS count             *}
      end;
      end;