Mode 1024x768 does not work in Graph unit
Original Reporter info from Mantis: kudrna
-
Reporter name: Pavel Kudrna
Original Reporter info from Mantis: kudrna
- Reporter name: Pavel Kudrna
Description:
The MaxY value in
packages\graph\src\win32\graph.pp line 2193 is specified as
mode.MaxY := 768;
but the correct value should be one less, i.e. 767.
The test program below gives "Error number -10, error text: Invalid graphics mode." for grMode value m1024x768 but works well m800x600 and m640x480.
After the suggested change in graph.pp the mode m1024x768 is accepted.
Steps to reproduce:
Program Test1024x768;
Var grDriver,grMode,grError: SmallInt;
BEGIN
grDriver:=D8bit;
grMode:=m1024x768; // fails bust both m640x480 and m800x600 work well
InitGraph(grDriver,grMode,'');
grError:=GraphResult;
if grError<>GrOk then WriteLn( 'InitGraph error number ', grError,
', error text: ', GraphErrorMsg(grError) '.'
);
Write(); ReadLn;
END.
Additional information:
I suggest to write all the MaxX and MaxY constants in graph.pp this way:
mode.MaxX := 1024-1;
mode.MaxY := 768-1;
Another minor problem is that the mode names are often longer than 18
characters specified for ModeName item in
packages\graph\src\inc\graphh.inc line 622:
ModeName: String[18];
and are truncated.
E.g. in line 2220 in graph.pp the constant is 25 characters:
mode.ModeName:='1280 x 1024 x 16 Win32GUI';
Probably the string space should be increased rather than to shorten most of the mode name strings.
Mantis conversion info:
- Mantis ID: 34661
- OS: Windows
- Platform: Windows
- Version: 3.0.4
- Fixed in version: 3.3.1
- Fixed in revision: 40511 (#5e22121c)
- Target version: 3.2.0