mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 06:08:16 +02:00
* Handle video initialization failure.
git-svn-id: trunk@3843 -
This commit is contained in:
parent
85937fa706
commit
6de9a0ffb2
16
fv/app.pas
16
fv/app.pas
@ -971,16 +971,24 @@ END;
|
||||
{ Init -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22Oct99 LdB }
|
||||
{---------------------------------------------------------------------------}
|
||||
CONSTRUCTOR TApplication.Init;
|
||||
|
||||
BEGIN
|
||||
{ InitMemory;} { Start memory up }
|
||||
InitResource;
|
||||
initkeyboard;
|
||||
Drivers.InitVideo; { Start video up }
|
||||
if not Drivers.InitVideo then { Start video up }
|
||||
begin
|
||||
donekeyboard;
|
||||
{Initresource might have failed.}
|
||||
if strings<>nil then
|
||||
writeln(strings^.get(sVideoFailed));
|
||||
halt(1);
|
||||
end;
|
||||
Drivers.InitEvents; { Start event drive }
|
||||
Drivers.InitSysError; { Start system error }
|
||||
InitHistory; { Start history up }
|
||||
InitResource;
|
||||
InitMsgBox;
|
||||
Inherited Init; { Call ancestor }
|
||||
InitMsgBox;
|
||||
{ init mouse and cursor }
|
||||
Video.SetCursorType(crHidden);
|
||||
Mouse.SetMouseXY(1,1);
|
||||
@ -993,12 +1001,12 @@ DESTRUCTOR TApplication.Done;
|
||||
BEGIN
|
||||
Inherited Done; { Call ancestor }
|
||||
DoneHistory; { Close history }
|
||||
DoneResource;
|
||||
Drivers.DoneSysError; { Close system error }
|
||||
Drivers.DoneEvents; { Close event drive }
|
||||
drivers.donevideo;
|
||||
{ DoneMemory;} { Close memory }
|
||||
donekeyboard;
|
||||
DoneResource;
|
||||
END;
|
||||
|
||||
{--TApplication-------------------------------------------------------------}
|
||||
|
@ -488,7 +488,7 @@ Initializes the video manager, Saves the current screen mode in
|
||||
StartupMode, and switches to the mode indicated by ScreenMode.
|
||||
19May98 LdB
|
||||
---------------------------------------------------------------------}
|
||||
PROCEDURE InitVideo;
|
||||
function InitVideo:boolean;
|
||||
|
||||
{-DoneVideo---------------------------------------------------------
|
||||
Terminates the video manager by restoring the initial screen mode
|
||||
@ -1304,10 +1304,12 @@ end;
|
||||
{---------------------------------------------------------------------------}
|
||||
{ InitVideo -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Nov99 LdB }
|
||||
{---------------------------------------------------------------------------}
|
||||
PROCEDURE InitVideo;
|
||||
VAR
|
||||
StoreScreenMode : TVideoMode;
|
||||
BEGIN
|
||||
function InitVideo:boolean;
|
||||
|
||||
var StoreScreenMode : TVideoMode;
|
||||
|
||||
begin
|
||||
initvideo:=false;
|
||||
if VideoInitialized then
|
||||
begin
|
||||
StoreScreenMode:=ScreenMode;
|
||||
@ -1317,6 +1319,8 @@ BEGIN
|
||||
StoreScreenMode.Col:=0;
|
||||
|
||||
Video.InitVideo;
|
||||
if video.errorcode<>viook then
|
||||
exit;
|
||||
GetVideoMode(StartupScreenMode);
|
||||
GetVideoMode(ScreenMode);
|
||||
{$ifdef win32}
|
||||
@ -1338,7 +1342,8 @@ BEGIN
|
||||
ScreenWidth:=Video.ScreenWidth;
|
||||
ScreenHeight:=Video.ScreenHeight;
|
||||
VideoInitialized:=true;
|
||||
END;
|
||||
initvideo:=true;
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------}
|
||||
{ DoneVideo -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 19May98 LdB }
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ Strings }
|
||||
sVideoFailed = 0; {Video initialization failed.}
|
||||
sButtonDefault = 1; { Button default }
|
||||
sButtonDisabled = 2; { Button disabled }
|
||||
sButtonNormal = 3; { Button normal }
|
||||
|
@ -3,8 +3,9 @@ type standard_string=record
|
||||
text:Pchar;
|
||||
end;
|
||||
|
||||
const standard_string_count=106;
|
||||
const standard_string_count=107;
|
||||
standard_strings:array[0..standard_string_count-1] of standard_string=(
|
||||
(nr:sVideoFailed;text:'Video initialization failed.'),
|
||||
(nr:sButtonDefault;text:'Button default'),
|
||||
(nr:sButtonDisabled;text:'Button disabled'),
|
||||
(nr:sButtonNormal;text:'Button normal'),
|
||||
|
Loading…
Reference in New Issue
Block a user