mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-27 02:51:40 +01:00
+ Correct behaviour when initialization fails.
git-svn-id: trunk@3841 -
This commit is contained in:
parent
542bb08ee4
commit
4a3248bc08
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user