summaryrefslogtreecommitdiff
path: root/packages/graph/src
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-09-12 17:05:44 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-09-12 17:05:44 +0000
commitcd1ecb41373cf1e966b07b31fce04d64cd76cd42 (patch)
tree94afa35283a781bee4bff4ae47849e5178b49485 /packages/graph/src
parentdcf9c43c99978cbbb7d0b01dd956056d1c79f19f (diff)
downloadfpc-cd1ecb41373cf1e966b07b31fce04d64cd76cd42.tar.gz
* always set both IntCurrentDriver and IntCurrentNewDriver to the correct old & new style driver numbers
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15973 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/graph/src')
-rw-r--r--packages/graph/src/inc/modes.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/graph/src/inc/modes.inc b/packages/graph/src/inc/modes.inc
index dbd03850ed..1d6d8b92f2 100644
--- a/packages/graph/src/inc/modes.inc
+++ b/packages/graph/src/inc/modes.inc
@@ -395,6 +395,7 @@ end;
var
modeinfo: PModeInfo;
usedDriver: Integer;
+ dummyNewModeNr: Integer;
begin
{ check if the mode exists... }
{ Depending on the modenumber, we search using the old or new }
@@ -525,7 +526,11 @@ end;
OutTextXY:=modeInfo^.OutTextXY;
IntCurrentMode := modeinfo^.ModeNumber;
- IntCurrentDriver := usedDriver;
+ { fix by nickysn: always set *both* IntCurrentDriver and IntCurrentNewDriver to the
+ *correct* old & new style driver numbers. Solves a lot of bugs, e.g. when using InitGraph
+ with a new style driver/mode and then later using SetGraphMode(GetGraphMode) }
+ IntCurrentDriver := modeinfo^.DriverNumber;
+ res2Mode(modeinfo^.maxx+1, modeinfo^.maxy+1, modeinfo^.maxColor, IntCurrentNewDriver, dummyNewModeNr);
{$ifdef logging}
logln('Entering mode '+strf(intCurrentMode)+' of driver '+strf(intCurrentDriver));
{$endif logging}