Browse Source

Added missing functions so mandel compiles and runs

michael 27 years ago
parent
commit
7683c16b17
1 changed files with 69 additions and 3 deletions
  1. 69 3
      rtl/linux/graph.pp

+ 69 - 3
rtl/linux/graph.pp

@@ -35,7 +35,7 @@ unit Graph;
                               declarations here so it can be used independently
                               declarations here so it can be used independently
                               of the svgalib unit. Removed things that are NOT
                               of the svgalib unit. Removed things that are NOT
                               part of Borland's Graph from the unit interface.
                               part of Borland's Graph from the unit interface.
-
+  
 
 
   License Conditions:
   License Conditions:
 
 
@@ -139,7 +139,25 @@ const
   BaseLine      = 3;
   BaseLine      = 3;
   LeadLine      = 4;
   LeadLine      = 4;
 
 
-
+const
+  { Error codes }
+  grOK             = 0;
+  grNoInitGraph    = -1;
+  grNotDetected    = -2;
+  grFileNotFound   = -3;
+  grInvalidDriver  = -4;
+  grNoLOadMem      = -5;
+  grNoScanMem      = -6;
+  grNoFloodMem     = -7;
+  grFontNotFound   = -8;
+  grNoFontMem      = -9;
+  grInvalidmode    = -10;
+  grError          = -11;
+  grIOerror        = -12;
+  grInvalidFont    = -13;
+  grInvalidFontNum = -14;
+  
+  
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
    Types
    Types
@@ -263,6 +281,7 @@ procedure Sector(X, Y: Integer; StAngle, EndAngle, XRadius, YRadius: Word);
 { Color routines }
 { Color routines }
 procedure SetBkColor(ColorNum: Word);
 procedure SetBkColor(ColorNum: Word);
 procedure SetColor(Color: Word);
 procedure SetColor(Color: Word);
+function  GetMaxColor : Word;
 
 
 { Bitmap utilities }
 { Bitmap utilities }
 procedure GetImage(x1, y1, x2, y2: Integer; var BitMap);
 procedure GetImage(x1, y1, x2, y2: Integer; var BitMap);
@@ -278,6 +297,7 @@ procedure SetUserCharSize(MultX, DivX, MultY, DivY: Word);
 
 
 { Graph clipping method }
 { Graph clipping method }
 procedure SetViewPort(x1, y1, x2, y2: Integer; Clip: Boolean);
 procedure SetViewPort(x1, y1, x2, y2: Integer; Clip: Boolean);
+Procedure ClearViewPort;
 
 
 { Init/Done }
 { Init/Done }
 procedure InitVideo;
 procedure InitVideo;
@@ -294,6 +314,9 @@ function GetMAxY : Integer;
 Procedure DetectGraph (Var Driver,Mode : Integer);
 Procedure DetectGraph (Var Driver,Mode : Integer);
 Procedure InitGraph (Var Driver,Mode : Integer;DriverPath : String);
 Procedure InitGraph (Var Driver,Mode : Integer;DriverPath : String);
 Procedure CloseGraph;
 Procedure CloseGraph;
+Function GraphResult : Integer;
+Procedure GraphDefaults ;
+Function GraphErrorMsg (Errcode : Integer) : String;
 
 
 const
 const
   NoGraphics: Boolean = false;
   NoGraphics: Boolean = false;
@@ -624,6 +647,8 @@ begin
                                  BgiColors[i] and 255)
                                  BgiColors[i] and 255)
 end;
 end;
 
 
+
+
 procedure InitVideo;
 procedure InitVideo;
 var
 var
   VgaMode: Integer;
   VgaMode: Integer;
@@ -889,13 +914,28 @@ begin
   GetAspect := 1.0
   GetAspect := 1.0
 end; { GetAspect }
 end; { GetAspect }
 
 
+Var LastViewPort : ViewPortType;
+
 procedure SetViewPort(x1, y1, x2, y2: Integer; Clip: Boolean);
 procedure SetViewPort(x1, y1, x2, y2: Integer; Clip: Boolean);
 begin
 begin
+  LastViewPort.X1:=X1;
+  LastViewPort.Y1:=Y1;
+  LastViewPort.X2:=X2;
+  LastViewPort.Y2:=Y2;
+  LastViewPort.Clip:=Clip;
   SetDrawOrigin(x1, y1);
   SetDrawOrigin(x1, y1);
   if Clip then SetClipRect(x1, y1, x2+1, y2+1)
   if Clip then SetClipRect(x1, y1, x2+1, y2+1)
   else SetClipRect(0, 0, SizeX, SizeY)
   else SetClipRect(0, 0, SizeX, SizeY)
 end;
 end;
 
 
+
+Procedure ClearViewPort;
+
+begin
+  With LastViewPort do
+  gl_fillbox(X1,Y1,X2-X1,Y2-Y1,BackColor);
+end;
+
 { VGAMEM }
 { VGAMEM }
 
 
 type
 type
@@ -1392,6 +1432,11 @@ begin
   TheColor := ColorTable[Color];
   TheColor := ColorTable[Color];
 end;
 end;
 
 
+function getmaxcolor : Word;
+
+begin
+  getmaxcolor:=16;
+end;
 
 
 procedure GetImage(x1, y1, x2, y2: Integer; var BitMap);        
 procedure GetImage(x1, y1, x2, y2: Integer; var BitMap);        
 var
 var
@@ -1511,6 +1556,24 @@ begin
   DoneVideo;
   DoneVideo;
 end;
 end;
 
 
+Function GraphResult : Integer;
+
+begin
+  GraphResult:=0;
+end;
+
+Procedure GraphDefaults ;
+
+begin
+end;
+
+Function GraphErrorMsg (Errcode : Integer) : String;
+
+begin
+  GraphErrorMsg:='';
+end;
+
+
 begin
 begin
 
 
   { Give up root permissions if we are root.  }
   { Give up root permissions if we are root.  }
@@ -1519,7 +1582,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-08-24 08:23:47  michael
+  Revision 1.8  1998-09-11 09:24:55  michael
+  Added missing functions so mandel compiles and runs
+
+  Revision 1.7  1998/08/24 08:23:47  michael
   Better initgraph handling.
   Better initgraph handling.
 
 
   Revision 1.6  1998/08/14 09:20:36  michael
   Revision 1.6  1998/08/14 09:20:36  michael