mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
* fixed problem with new modes system (reported by Vladimir Ravodin) (merged)
This commit is contained in:
parent
e0e6efbd3f
commit
bd745d3e82
@ -2303,7 +2303,12 @@ end;
|
|||||||
|
|
||||||
{ _GraphResult is now already set to grOK by DetectGraph }
|
{ _GraphResult is now already set to grOK by DetectGraph }
|
||||||
IntCurrentDriver := GraphDriver;
|
IntCurrentDriver := GraphDriver;
|
||||||
IntCurrentNewDriver := GraphDriver;
|
|
||||||
|
if (graphDriver >= lowNewDriver) and
|
||||||
|
(graphDriver <= highNewDriver) then
|
||||||
|
IntCurrentNewDriver := GraphDriver
|
||||||
|
else IntCurrentNewDriver := -1;
|
||||||
|
|
||||||
{ Actually set the graph mode...}
|
{ Actually set the graph mode...}
|
||||||
if firstCallOfInitgraph then
|
if firstCallOfInitgraph then
|
||||||
begin
|
begin
|
||||||
@ -2324,7 +2329,12 @@ end;
|
|||||||
begin
|
begin
|
||||||
_GraphResult := grOK;
|
_GraphResult := grOK;
|
||||||
IntCurrentDriver := GraphDriver;
|
IntCurrentDriver := GraphDriver;
|
||||||
IntCurrentNewDriver := GraphDriver;
|
|
||||||
|
if (graphDriver >= lowNewDriver) and
|
||||||
|
(graphDriver <= highNewDriver) then
|
||||||
|
IntCurrentNewDriver := GraphDriver
|
||||||
|
else IntCurrentNewDriver := -1;
|
||||||
|
|
||||||
if firstCallOfInitgraph then
|
if firstCallOfInitgraph then
|
||||||
begin
|
begin
|
||||||
SaveVideoState;
|
SaveVideoState;
|
||||||
@ -2441,7 +2451,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2000-12-07 17:19:47 jonas
|
Revision 1.6 2001-04-14 16:06:03 jonas
|
||||||
|
* fixed problem with new modes system (reported by Vladimir Ravodin) (merged)
|
||||||
|
|
||||||
|
Revision 1.5 2000/12/07 17:19:47 jonas
|
||||||
* new constant handling: from now on, hex constants >$7fffffff are
|
* new constant handling: from now on, hex constants >$7fffffff are
|
||||||
parsed as unsigned constants (otherwise, $80000000 got sign extended
|
parsed as unsigned constants (otherwise, $80000000 got sign extended
|
||||||
and became $ffffffff80000000), all constants in the longint range
|
and became $ffffffff80000000), all constants in the longint range
|
||||||
|
@ -406,6 +406,7 @@ end;
|
|||||||
procedure SetGraphMode(mode: smallint);
|
procedure SetGraphMode(mode: smallint);
|
||||||
var
|
var
|
||||||
modeinfo: PModeInfo;
|
modeinfo: PModeInfo;
|
||||||
|
usedDriver: Integer;
|
||||||
begin
|
begin
|
||||||
{ check if the mode exists... }
|
{ check if the mode exists... }
|
||||||
{ Depending on the modenumber, we search using the old or new }
|
{ Depending on the modenumber, we search using the old or new }
|
||||||
@ -417,12 +418,19 @@ end;
|
|||||||
detectMode:
|
detectMode:
|
||||||
begin
|
begin
|
||||||
mode := -32767;
|
mode := -32767;
|
||||||
|
usedDriver := IntcurrentNewDriver;
|
||||||
modeInfo := searchmode(IntcurrentNewDriver,mode);
|
modeInfo := searchmode(IntcurrentNewDriver,mode);
|
||||||
end;
|
end;
|
||||||
lowNewMode..highNewMode:
|
lowNewMode..highNewMode:
|
||||||
modeInfo := searchmode(IntcurrentNewDriver,mode);
|
begin
|
||||||
|
usedDriver := IntcurrentNewDriver;
|
||||||
|
modeInfo := searchmode(IntcurrentNewDriver,mode);
|
||||||
|
end;
|
||||||
else
|
else
|
||||||
modeinfo := searchmode(IntcurrentDriver,mode);
|
begin
|
||||||
|
usedDriver := IntcurrentDriver;
|
||||||
|
modeinfo := searchmode(IntcurrentDriver,mode);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
if not assigned(modeinfo) then
|
if not assigned(modeinfo) then
|
||||||
begin
|
begin
|
||||||
@ -434,8 +442,6 @@ end;
|
|||||||
end;
|
end;
|
||||||
{ reset all hooks...}
|
{ reset all hooks...}
|
||||||
DefaultHooks;
|
DefaultHooks;
|
||||||
{ arccall not reset - tested against VGA BGI driver }
|
|
||||||
{ Setup all hooks if none, keep old defaults...}
|
|
||||||
|
|
||||||
{ required hooks - returns error if no hooks to these }
|
{ required hooks - returns error if no hooks to these }
|
||||||
{ routines. }
|
{ routines. }
|
||||||
@ -531,7 +537,7 @@ end;
|
|||||||
OutTextXY:=modeInfo^.OutTextXY;
|
OutTextXY:=modeInfo^.OutTextXY;
|
||||||
|
|
||||||
IntCurrentMode := modeinfo^.ModeNumber;
|
IntCurrentMode := modeinfo^.ModeNumber;
|
||||||
IntCurrentDriver := modeinfo^.DriverNumber;
|
IntCurrentDriver := usedDriver;
|
||||||
{$ifdef logging}
|
{$ifdef logging}
|
||||||
logln('Entering mode '+strf(intCurrentMode)+' of driver '+strf(intCurrentDriver));
|
logln('Entering mode '+strf(intCurrentMode)+' of driver '+strf(intCurrentDriver));
|
||||||
{$endif logging}
|
{$endif logging}
|
||||||
@ -592,7 +598,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2001-04-13 23:49:48 peter
|
Revision 1.6 2001-04-14 16:06:03 jonas
|
||||||
|
* fixed problem with new modes system (reported by Vladimir Ravodin) (merged)
|
||||||
|
|
||||||
|
Revision 1.5 2001/04/13 23:49:48 peter
|
||||||
* fixes for the stricter compiler
|
* fixes for the stricter compiler
|
||||||
|
|
||||||
Revision 1.4 2000/08/12 12:27:14 jonas
|
Revision 1.4 2000/08/12 12:27:14 jonas
|
||||||
|
Loading…
Reference in New Issue
Block a user