+ 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; Procedure InitVideo;
begin begin
If Not VideoInitialized then if not VideoInitialized then
begin begin
If Assigned(CurrentVideoDriver.InitDriver) then if Assigned(CurrentVideoDriver.InitDriver) then
CurrentVideoDriver.InitDriver; CurrentVideoDriver.InitDriver;
VideoInitialized:=True; if errorcode=viook then
if NextVideoModeSet then begin
SetVideoMode(NextVideoMode) VideoInitialized:=true;
else if NextVideoModeSet then
AssignVideoBuf(0,0); SetVideoMode(NextVideoMode)
ClearScreen; else
AssignVideoBuf(0,0);
ClearScreen;
end;
end; end;
end; end;

View File

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