+ Correct behaviour when initialization fails.

git-svn-id: trunk@3841 -
This commit is contained in:
daniel 2006-06-11 09:00:19 +00:00
parent 542bb08ee4
commit 4a3248bc08
2 changed files with 15 additions and 12 deletions

View File

@ -149,16 +149,19 @@ end;
Procedure InitVideo;
begin
If Not VideoInitialized then
if not VideoInitialized then
begin
If Assigned(CurrentVideoDriver.InitDriver) then
CurrentVideoDriver.InitDriver;
VideoInitialized:=True;
if NextVideoModeSet then
SetVideoMode(NextVideoMode)
else
AssignVideoBuf(0,0);
ClearScreen;
if Assigned(CurrentVideoDriver.InitDriver) then
CurrentVideoDriver.InitDriver;
if errorcode=viook then
begin
VideoInitialized:=true;
if NextVideoModeSet then
SetVideoMode(NextVideoMode)
else
AssignVideoBuf(0,0);
ClearScreen;
end;
end;
end;

View File

@ -1098,11 +1098,11 @@ begin
{$endif logging}
{ save new terminal characteristics and possible restore rawness }
videoInitDone;
decide_codepages;
end
else
ErrorCode:=errVioInit; { not a TTY }
decide_codepages;
end;
procedure SysDoneVideo;
@ -1234,7 +1234,7 @@ begin
the terminal window size.}
SysSetVideoMode:=false;
fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
if (mode.row=winsize.ws_row) and
if (mode.row=winsize.ws_row) and
(mode.col=winsize.ws_col) then
begin
screenwidth:=mode.col;