Browse Source

* fixed problem that occurred if the graphmode was initialized with
a new graphdriver, but then setgraphmode was called with as
parameter the result of getGraphMode (since that one returns an
old-style modenumber)

Jonas Maebe 25 years ago
parent
commit
732f06de57
1 changed files with 27 additions and 3 deletions
  1. 27 3
      rtl/inc/graph/modes.inc

+ 27 - 3
rtl/inc/graph/modes.inc

@@ -181,7 +181,10 @@ end;
       begin
       begin
         list := ModeList;
         list := ModeList;
         { go to the end of the list }
         { go to the end of the list }
-        while assigned(list^.next) do
+        while assigned(list^.next) and
+              ((list^.drivernumber < mode.drivernumber) or
+               ((list^.drivernumber = mode.drivernumber) and
+                (list^.modenumber < mode.modenumber))) do
           list:=list^.next;
           list:=list^.next;
         new(NewLst);
         new(NewLst);
         list^.next := NewLst;
         list^.next := NewLst;
@@ -417,7 +420,22 @@ end;
      modeinfo: PModeInfo;
      modeinfo: PModeInfo;
     begin
     begin
       { check if the mode exists... }
       { check if the mode exists... }
-      modeinfo := searchmode(IntcurrentNewDriver,mode);
+      { Depending on the modenumber, we search using the old or new }
+      { graphdriver number (because once we entered graphmode,      }
+      { getgraphmode() returns the old mode number and              }
+      { both setgraphmode(getgraphmode) and setgraphmode(mAAAxBBB)  }
+      { have to work (JM)                                           }
+      case mode of
+        detectMode:
+          begin
+            mode := -32767;
+            modeInfo := searchmode(IntcurrentNewDriver,mode);
+          end;
+        lowNewMode..highNewMode:
+          modeInfo := searchmode(IntcurrentNewDriver,mode);
+        else
+          modeinfo := searchmode(IntcurrentDriver,mode);
+      end;
       if not assigned(modeinfo) then
       if not assigned(modeinfo) then
         begin
         begin
 {$ifdef logging}
 {$ifdef logging}
@@ -573,7 +591,13 @@ end;
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.31  2000-07-07 17:29:30  jonas
+Revision 1.32  2000-07-08 06:24:21  jonas
+  * fixed problem that occurred if the graphmode was initialized with
+    a new graphdriver, but then setgraphmode was called with as
+    parameter the result of getGraphMode (since that one returns an
+    old-style modenumber)
+
+Revision 1.31  2000/07/07 17:29:30  jonas
   * fixed setgraphmode together with the new graphdrivers
   * fixed setgraphmode together with the new graphdrivers
 
 
 Revision 1.30  2000/07/05 13:07:48  jonas
 Revision 1.30  2000/07/05 13:07:48  jonas