瀏覽代碼

+ also preserve the CGA background color in the go32v2 IDE

git-svn-id: trunk@29086 -
nickysn 10 年之前
父節點
當前提交
c53c4702b6
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      ide/fpusrscr.pas

+ 6 - 0
ide/fpusrscr.pas

@@ -184,6 +184,7 @@ type
       GraphModeName : string;
       GraphModeName : string;
       GraphXres,GraphYres : longint;
       GraphXres,GraphYres : longint;
       GraphBuffer : pointer;
       GraphBuffer : pointer;
+      GraphCGABkColor: Integer;
       ConsoleGraphDriver, ConsoleGraphMode : smallint;
       ConsoleGraphDriver, ConsoleGraphMode : smallint;
 {$endif USE_GRAPH_SWITCH}
 {$endif USE_GRAPH_SWITCH}
       function    GetLineStartOfs(Line: integer): word;
       function    GetLineStartOfs(Line: integer): word;
@@ -530,6 +531,7 @@ begin
                     2: GraphMode:=CGAC3;
                     2: GraphMode:=CGAC3;
                     3: GraphMode:=CGAC1;
                     3: GraphMode:=CGAC1;
                   end;
                   end;
+                  GraphCGABkColor:=Mem[$40:$66] and $0F;
                 end;
                 end;
            $6 : begin
            $6 : begin
                   GraphDriver:=Graph.CGA;
                   GraphDriver:=Graph.CGA;
@@ -607,6 +609,10 @@ begin
       Graph.InitGraph(ConsoleGraphDriver,ConsoleGraphMode,'');
       Graph.InitGraph(ConsoleGraphDriver,ConsoleGraphMode,'');
       if graphresult=grOk then
       if graphresult=grOk then
         begin
         begin
+          if (ConsoleGraphDriver=CGA) and
+             (ConsoleGraphMode>=CGAC0) and
+             (ConsoleGraphMode<=CGAC3) then
+            SetBkColor(GraphCGABkColor);
           PutImage(0,0,GraphBuffer^,CopyPut);
           PutImage(0,0,GraphBuffer^,CopyPut);
           FreeMem(GraphBuffer,GraphImageSize);
           FreeMem(GraphBuffer,GraphImageSize);
           GraphBuffer:=nil;
           GraphBuffer:=nil;