* Bugfix if getimage / putimage, format was not standard with FPC

graph.
This commit is contained in:
carl 1999-11-12 02:13:01 +00:00
parent 254c43d6b7
commit 4d3b187b4c

View File

@ -92,7 +92,7 @@ Const
GLASTMODE = 49; GLASTMODE = 49;
ModeNames: array[0..GLastMode] of PChar = ModeNames: array[0..GLastMode] of PChar =
('[]', {Let GGI choose a default mode} ('[]', {Let GGI choose a default mode}
'S320x200[GT_4BIT]', 'S320x200[GT_4BIT]',
'S640x200[GT_4BIT]', 'S640x200[GT_4BIT]',
'S640x350[GT_4BIT]', 'S640x350[GT_4BIT]',
@ -161,13 +161,13 @@ type
end; end;
TGGIGraphType = LongWord; TGGIGraphType = LongWord;
TGGIAttr = LongWord; TGGIAttr = LongWord;
TGGIMode = record // requested by user and changed by driver TGGIMode = record // requested by user and changed by driver
Frames: LongInt; // frames needed Frames: LongInt; // frames needed
Visible: TGGICoord; // vis. pixels, may change slightly Visible: TGGICoord; // vis. pixels, may change slightly
Virt: TGGICoord; // virtual pixels, may change Virt: TGGICoord; // virtual pixels, may change
Size: TGGICoord; // size of visible in mm Size: TGGICoord; // size of visible in mm
GraphType: TGGIGraphType; // which mode ? GraphType: TGGIGraphType; // which mode ?
dpp: TGGICoord; // dots per pixel dpp: TGGICoord; // dots per pixel
end; end;
const const
@ -243,7 +243,7 @@ begin
if ClipCoords then begin if ClipCoords then begin
ClipCoords := (y < StartXViewPort) or (x > (StartXViewPort + ViewWidth)); ClipCoords := (y < StartXViewPort) or (x > (StartXViewPort + ViewWidth));
ClipCoords := ClipCoords or ClipCoords := ClipCoords or
((y < StartYViewPort) or (y > (StartYViewPort + ViewHeight))); ((y < StartYViewPort) or (y > (StartYViewPort + ViewHeight)));
ClipCoords := not ClipCoords; ClipCoords := not ClipCoords;
end; end;
end; end;
@ -256,19 +256,19 @@ begin
CurCol := ggiMapColor(Visual, BgiColors[CurrentColor]); CurCol := ggiMapColor(Visual, BgiColors[CurrentColor]);
case CurrentWriteMode of case CurrentWriteMode of
XORPut: begin XORPut: begin
{ getpixel wants local/relative coordinates } { getpixel wants local/relative coordinates }
ggiGetPixel(Visual, x-StartXViewPort, y-StartYViewPort, Color); ggiGetPixel(Visual, x-StartXViewPort, y-StartYViewPort, Color);
Color := CurCol xor Color; Color := CurCol xor Color;
end; end;
OrPut: begin OrPut: begin
{ getpixel wants local/relative coordinates } { getpixel wants local/relative coordinates }
ggiGetPixel(Visual, x-StartXViewPort, y-StartYViewPort, Color); ggiGetPixel(Visual, x-StartXViewPort, y-StartYViewPort, Color);
Color := CurCol or Color; Color := CurCol or Color;
end; end;
AndPut: begin AndPut: begin
{ getpixel wants local/relative coordinates } { getpixel wants local/relative coordinates }
ggiGetPixel(Visual, x-StartXViewPort, y-StartYViewPort, Color); ggiGetPixel(Visual, x-StartXViewPort, y-StartYViewPort, Color);
Color := CurCol and Color; Color := CurCol and Color;
end; end;
NotPut: NotPut:
Color := not Color; Color := not Color;
@ -303,9 +303,10 @@ end;
type type
PBitmap = ^TBitmap; PBitmap = ^TBitmap;
TBitmap = record TBitmap = record
Width, Height: Integer; Width, Height: longint;
Data: record end; reserved : longint;
end; Data: record end;
end;
procedure ggi_putimageproc (X,Y: Integer; var Bitmap; BitBlt: Word); procedure ggi_putimageproc (X,Y: Integer; var Bitmap; BitBlt: Word);
begin begin
@ -383,7 +384,7 @@ begin
end; end;
procedure ggi_getrgbpaletteproc (ColorNum: integer; procedure ggi_getrgbpaletteproc (ColorNum: integer;
var RedValue, GreenValue, BlueValue: Integer); var RedValue, GreenValue, BlueValue: Integer);
Var Col : TGGIColor; Var Col : TGGIColor;
@ -418,7 +419,7 @@ function QueryAdapterInfo:PModeInfo;
var var
ModeInfo: TGGIMode; ModeInfo: TGGIMode;
procedure AddGGIMode(i: Integer); // i is the mode number procedure AddGGIMode(i: Integer); // i is the mode number
var var
mode: TModeInfo; mode: TModeInfo;
begin begin
@ -499,7 +500,11 @@ end;
{ {
$Log$ $Log$
Revision 1.4 1999-11-10 10:54:24 sg Revision 1.5 1999-11-12 02:13:01 carl
* Bugfix if getimage / putimage, format was not standard with FPC
graph.
Revision 1.4 1999/11/10 10:54:24 sg
* Fixed a LOT of bugs: * Fixed a LOT of bugs:
* - Default mode should be determined by GGI now * - Default mode should be determined by GGI now
* - Colors are working (only the 16 standard VGA colors, though) * - Colors are working (only the 16 standard VGA colors, though)