+ detect,default constants

This commit is contained in:
peter 1999-01-25 20:31:30 +00:00
parent 06e8a03894
commit 725887d0ba

View File

@ -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:
@ -77,7 +77,6 @@ interface
{ --------------------------------------------------------------------- { ---------------------------------------------------------------------
Constants Constants
---------------------------------------------------------------------} ---------------------------------------------------------------------}
const const
@ -130,7 +129,6 @@ const
NormWidth = 1; NormWidth = 1;
ThickWidth = 3; ThickWidth = 3;
const
LeftText = 0; LeftText = 0;
CenterText = 1; CenterText = 1;
RightText = 2; RightText = 2;
@ -139,7 +137,6 @@ const
BaseLine = 3; BaseLine = 3;
LeadLine = 4; LeadLine = 4;
const
{ Error codes } { Error codes }
grOK = 0; grOK = 0;
grNoInitGraph = -1; grNoInitGraph = -1;
@ -156,15 +153,19 @@ const
grIOerror = -12; grIOerror = -12;
grInvalidFont = -13; grInvalidFont = -13;
grInvalidFontNum = -14; grInvalidFontNum = -14;
{ graphic drivers }
CurrentDriver = -128;
Detect = 0;
{ graph modes }
Default = 0;
{ --------------------------------------------------------------------- { ---------------------------------------------------------------------
Types Types
---------------------------------------------------------------------} ---------------------------------------------------------------------}
Type Type
FillPatternType = array[1..8] of byte; FillPatternType = array[1..8] of byte;
@ -240,12 +241,12 @@ Type
---------------------------------------------------------------------} ---------------------------------------------------------------------}
{ Retrieving coordinates } { Retrieving coordinates }
function GetX: Integer; function GetX: Integer;
function GetY: Integer; function GetY: Integer;
{ Pixel-oriented routines } { Pixel-oriented routines }
procedure PutPixel(X, Y: Integer; Pixel: Word); procedure PutPixel(X, Y: Integer; Pixel: Word);
function GetPixel(X, Y: Integer): Word; function GetPixel(X, Y: Integer): Word;
{ Line-oriented primitives } { Line-oriented primitives }
procedure SetWriteMode(WriteMode: Integer); procedure SetWriteMode(WriteMode: Integer);
@ -269,7 +270,7 @@ procedure FloodFill(X, Y: Integer; Border: Word);
{ Nonlinearly bounded primitives } { Nonlinearly bounded primitives }
procedure Arc(X, Y: Integer; StAngle, EndAngle, Radius: Word); procedure Arc(X, Y: Integer; StAngle, EndAngle, Radius: Word);
procedure GetArcCoords(var ArcCoords: ArcCoordsType); procedure GetArcCoords(var ArcCoords: ArcCoordsType);
procedure Circle(X, Y: Integer; Radius: Word); procedure Circle(X, Y: Integer; Radius: Word);
procedure Ellipse(X, Y: Integer; StAngle, EndAngle: Word; XRadius, YRadius : Word); procedure Ellipse(X, Y: Integer; StAngle, EndAngle: Word; XRadius, YRadius : Word);
procedure FillEllipse(X, Y: Integer; XRadius, YRadius : Word); procedure FillEllipse(X, Y: Integer; XRadius, YRadius : Word);
@ -430,7 +431,7 @@ uses Objects, Linux;
{$linklib vgagl} {$linklib vgagl}
{$linklib c} {$linklib c}
Const Const
{ Text } { Text }
WRITEMODE_OVERWRITE = 0; WRITEMODE_OVERWRITE = 0;
@ -545,7 +546,7 @@ var
ThePalette : PaletteType; ThePalette : PaletteType;
TheTextSettings : TextSettingsType; TheTextSettings : TextSettingsType;
TheFillSettings : FillSettingsType; TheFillSettings : FillSettingsType;
const const
BgiColors: array[0..15] of LongInt BgiColors: array[0..15] of LongInt
= ($000000, $000080, $008000, $008080, = ($000000, $000080, $008000, $008080,
@ -642,7 +643,7 @@ type
Width, Height: Integer; Width, Height: Integer;
Data: record end; Data: record end;
end; end;
{ Storing screen regions } { Storing screen regions }
type type
@ -1203,12 +1204,12 @@ end;
---------------------------------------------------------------------} ---------------------------------------------------------------------}
function GetX: Integer; function GetX: Integer;
begin begin
GetX := CurX - DrawDelta.X GetX := CurX - DrawDelta.X
end; end;
function GetY: Integer; function GetY: Integer;
begin begin
GetY := CurY - DrawDelta.Y GetY := CurY - DrawDelta.Y
end; end;
@ -1220,7 +1221,7 @@ begin
then gl_setpixel(X + DrawDelta.X, Y + DrawDelta.Y, Pixel) then gl_setpixel(X + DrawDelta.X, Y + DrawDelta.Y, Pixel)
end; end;
function GetPixel(X, Y: Integer): Word; function GetPixel(X, Y: Integer): Word;
begin begin
if NoGraphics if NoGraphics
then GetPixel := 0 then GetPixel := 0
@ -1361,7 +1362,7 @@ end;
Var LastArcCoords : ArcCoordsType; Var LastArcCoords : ArcCoordsType;
procedure SetArcCoords (X,y,xradius,yradius,Stangle,endangle : integer); procedure SetArcCoords (X,y,xradius,yradius,Stangle,endangle : integer);
begin begin
LastArcCoords.X:=X; LastArcCoords.X:=X;
@ -1373,7 +1374,7 @@ begin
end; end;
procedure GetArcCoords(var ArcCoords: ArcCoordsType); procedure GetArcCoords(var ArcCoords: ArcCoordsType);
begin begin
ArcCoords:=LastArcCoords; ArcCoords:=LastArcCoords;
@ -1396,7 +1397,7 @@ procedure Ellipse(X, Y: Integer;
Var I : longint; Var I : longint;
tmpang : real; tmpang : real;
begin begin
SetArcCoords (X,Y,xradius,yradius,Stangle,EndAngle); SetArcCoords (X,Y,xradius,yradius,Stangle,EndAngle);
For i:= StAngle To EndAngle Do For i:= StAngle To EndAngle Do
@ -1413,7 +1414,7 @@ procedure FillEllipse(X, Y: Integer; XRadius, YRadius : Word);
Var I,tmpcolor : longint; Var I,tmpcolor : longint;
tmpang : real; tmpang : real;
tmpx,tmpy : Integer; tmpx,tmpy : Integer;
begin begin
tmpcolor:=Thecolor; tmpcolor:=Thecolor;
SetColor(TheFillColor); SetColor(TheFillColor);
@ -1450,7 +1451,7 @@ procedure Sector(X, Y: Integer;
Var I,tmpcolor : longint; Var I,tmpcolor : longint;
tmpang : real; tmpang : real;
ac : arccoordstype; ac : arccoordstype;
begin begin
tmpcolor:=Thecolor; tmpcolor:=Thecolor;
SetColor(TheFillColor); SetColor(TheFillColor);
@ -1499,7 +1500,7 @@ begin
getmaxcolor:=16; getmaxcolor:=16;
end; end;
procedure GetImage(x1, y1, x2, y2: Integer; var BitMap); procedure GetImage(x1, y1, x2, y2: Integer; var BitMap);
var var
SaveClipRect: TRect; SaveClipRect: TRect;
begin begin
@ -1569,7 +1570,7 @@ Procedure DetectGraph (Var Driver,Mode : Integer);
begin begin
Driver:=9; Driver:=9;
Mode:=vga_getdefaultmode; Mode:=vga_getdefaultmode;
If Mode=-1 then mode:=0; If Mode=-1 then mode:=0;
end; end;
@ -1583,7 +1584,7 @@ var
begin begin
If Mode=0 then If Mode=0 then
VgaMode := vga_getdefaultmode VgaMode := vga_getdefaultmode
else else
VGAMode :=Mode; VGAMode :=Mode;
if (VgaMode = -1) then VgaMode := G320X200X256; if (VgaMode = -1) then VgaMode := G320X200X256;
if (not vga_hasmode(VgaMode)) if (not vga_hasmode(VgaMode))
@ -1754,7 +1755,7 @@ end;
Procedure RestoreCRTmode; Procedure RestoreCRTmode;
begin begin
vga_setmode(GTEXT); vga_setmode(GTEXT);
end; end;
Procedure SetActivePage (Page : Word); Procedure SetActivePage (Page : Word);
@ -1788,7 +1789,10 @@ end.
{ {
$Log$ $Log$
Revision 1.9 1998-09-13 19:22:06 michael Revision 1.10 1999-01-25 20:31:30 peter
+ detect,default constants
Revision 1.9 1998/09/13 19:22:06 michael
+ Implemented dummies for all missing functions + Implemented dummies for all missing functions
Revision 1.8 1998/09/11 09:24:55 michael Revision 1.8 1998/09/11 09:24:55 michael