* Fixed SetRGBPalette and GetRGBPalette (hopefully; not tested)

This commit is contained in:
sg 2000-02-06 11:26:45 +00:00
parent 40276150c5
commit a6a748cc9a

View File

@ -354,7 +354,7 @@ end;
procedure libvga_setrgbpaletteproc(ColorNum, RedValue, GreenValue, BlueValue: Integer); procedure libvga_setrgbpaletteproc(ColorNum, RedValue, GreenValue, BlueValue: Integer);
begin begin
vga_setpalette(ColorNum,RedValue,GreenValue,BlueValue); vga_setpalette(ColorNum,RedValue shr 2,GreenValue shr 2,BlueValue shr 2);
end; end;
procedure libvga_getrgbpaletteproc (ColorNum: integer; procedure libvga_getrgbpaletteproc (ColorNum: integer;
@ -364,9 +364,9 @@ Var R,G,B : longint;
begin begin
vga_getpalette(ColorNum,R,G,B); vga_getpalette(ColorNum,R,G,B);
RedValue:=R; RedValue:=R * 255 div 63;
GreenValue:=G; GreenValue:=G * 255 div 63;
BlueValue:=B; BlueValue:=B * 255 div 63;
end; end;
{************************************************************************} {************************************************************************}
@ -450,7 +450,10 @@ end;
{ {
$Log$ $Log$
Revision 1.7 2000-02-06 01:48:55 sg Revision 1.8 2000-02-06 11:26:45 sg
* Fixed SetRGBPalette and GetRGBPalette (hopefully; not tested)
Revision 1.7 2000/02/06 01:48:55 sg
* Fixed the default palette. libsvga works with a RGB range from 0-63, not * Fixed the default palette. libsvga works with a RGB range from 0-63, not
0-255! 0-255!
* PutPixel fixed (pixels didn't get drawn before) * PutPixel fixed (pixels didn't get drawn before)