* SetBkColor and GetBkColor made hookable

git-svn-id: trunk@15986 -
This commit is contained in:
nickysn 2010-09-14 22:11:41 +00:00
parent 988ac8d28a
commit 4f754e4a68
3 changed files with 18 additions and 5 deletions

View File

@ -1254,6 +1254,8 @@ end;
procedure OutTextXYDefault(x,y : smallint;const TextString : string);forward;
procedure CircleDefault(X, Y: smallint; Radius:Word);forward;
procedure SetBkColorDefault(ColorNum: Word);forward;
function GetBkColorDefault: Word;forward;
{$i palette.inc}
@ -1292,6 +1294,8 @@ end;
VLine := {$ifdef fpc}@{$endif}VLineDefault;
OuttextXY := {$ifdef fpc}@{$endif}OuttextXYDefault;
Circle := {$ifdef fpc}@{$endif}CircleDefault;
SetBkColor := {$ifdef fpc}@{$endif}SetBkColorDefault;
GetBkColor := {$ifdef fpc}@{$endif}GetBkColorDefault;
end;
Procedure InitVars;
@ -1686,14 +1690,14 @@ end;
GetColor := CurrentColor;
end;
function GetBkColor: Word;
function GetBkColorDefault: Word;
Begin
GetBkColor := CurrentBkColor;
GetBkColorDefault := CurrentBkColor;
end;
procedure SetBkColor(ColorNum: Word);
procedure SetBkColorDefault(ColorNum: Word);
{ Background color means background screen color in this case, and it is }
{ INDEPENDANT of the viewport settings, so we must clear the whole screen }
{ with the color. }

View File

@ -589,6 +589,9 @@ TYPE
CircleProc = procedure(X, Y: smallint; Radius:Word);
SetBkColorProc = procedure(ColorNum: Word);
GetBkColorProc = function: Word;
TYPE
{-----------------------------------}
@ -639,6 +642,8 @@ TYPE
Circle : CircleProc;
InitMode : InitModeProc;
OutTextXY : OutTextXYProc;
SetBKColor : SetBkColorProc;
GetBKColor : GetBkColorProc;
next: PModeInfo;
end;
@ -665,6 +670,8 @@ VAR
GetRGBPalette : GetRGBPaletteProc;
SetAllPalette : SetAllPaletteProc;
OutTextXY : OutTextXYProc;
SetBkColor : SetBkColorProc;
GetBkColor : GetBkColorProc;
GraphFreeMemPtr: graphfreememprc;
GraphGetMemPtr : graphgetmemprc;
@ -769,9 +776,7 @@ Function GetDriverName: string;
function GetDirectVideo: boolean;
{ -------------------- Color/Palette ------------------------------- }
procedure SetBkColor(ColorNum: Word);
function GetColor: Word;
function GetBkColor: Word;
procedure SetColor(Color: Word);
function GetMaxColor: word;

View File

@ -524,6 +524,10 @@ end;
SetActivePage := modeInfo^.SetActivePage;
if assigned(modeInfo^.OutTextXY) then
OutTextXY:=modeInfo^.OutTextXY;
if assigned(modeInfo^.SetBkColor) then
SetBkColor:=modeInfo^.SetBkColor;
if assigned(modeInfo^.GetBkColor) then
GetBkColor:=modeInfo^.GetBkColor;
IntCurrentMode := modeinfo^.ModeNumber;
{ fix by nickysn: always set *both* IntCurrentDriver and IntCurrentNewDriver to the