浏览代码

* avoid division by zero if no screen information is available on startup

git-svn-id: trunk@33462 -
Tomas Hajny 9 年之前
父节点
当前提交
29cf2c9ed7
共有 1 个文件被更改,包括 16 次插入8 次删除
  1. 16 8
      packages/fv/src/app.pas

+ 16 - 8
packages/fv/src/app.pas

@@ -807,17 +807,25 @@ BEGIN
     video unit capabilities, the mono modus can't be handled
   }
   Drivers.DetectVideo;
-  if (ScreenMode.Col div ScreenMode.Row<2) then
-    ShadowSize.X := 1
-  else
+{ ScreenMode.Row may be 0 if there's no console on startup }
+  if ScreenMode.Row = 0 then
+   begin
     ShadowSize.X := 2;
-
+    AppPalette := apColor;
+   end
+  else
+   begin
+    if (ScreenMode.Col div ScreenMode.Row<2) then
+     ShadowSize.X := 1
+    else
+     ShadowSize.X := 2;
+    if ScreenMode.color then
+     AppPalette := apColor
+    else
+     AppPalette := apBlackWhite;
+   end;
   ShadowSize.Y := 1;
   ShowMarkers := False;
-  if ScreenMode.color then
-    AppPalette := apColor
-  else
-    AppPalette := apBlackWhite;
   Buffer := Views.PVideoBuf(VideoBuf);
 END;