Hires GPI and the GPH file

Posted by petrus 
Re: Hires GPI and the GPH file
Date: October 12, 2020 03:28PM
Posted by: 32BOBO32
You are doing a really nice and great work which will allow all of us to use hi res GPI for next years =)
Thanks petrus!

Samuele Pinna
32BOBO32
Re: Hires GPI and the GPH file
Date: October 12, 2020 10:07PM
Posted by: petrus
GPHUpdater v.0912

The new version of GPHUpdater is ready for download.
It has added the support or stretching/compressing GPI file images by changing the width resp. height dimension values.
Example of GPH.INI specifications (omit \ before Size):
[Vars]
drivers = 33,55,56,60-64,66,68,70,72,74,75,193,268-273,304 
trackmaps = 14-30
...
[\Size] 
%drivers%  = 512x512, 0.75
%trackmaps% =       , 0.75
This will create a GPH file with hires driver images. Driver and trackmap images will have a compressed size: the width is set to 0.75 (=3/4) of the original value which is perfect as compensation for a widescreen stretch. The trackmaps width x height is not specified and will therefore not be changed.
The log file will document the result:
drivers
ID    Offset  width height  asp.ratio  dimh  dimv       width height asp.ratio  v_dim h_dim   vres  hres
0021  000648  0100  0100    256x256    3F80  3F80  ==>  0200  0200   512x512          3FAA    1     0.75
...
trackmaps
ID    Offset  width height  asp.ratio  dimh  dimv       width height asp.ratio  v_dim h_dim   vres  hres
000E  0002DE  0100  0100    256x256    3F80  3F80  ==>                                3FAA    1     0.75
...
The new horizontal dimension floating point value 3FAA was created in these cases. The vres and hres columns show the rounded quotients of v_dim/dimv and h_dim/dimh as a control.

To change the height dimension also, you write the factor as third parameter in the "Size" section, e.g.
33 = , 0.5, 0.5
will compress the driver01 image to the upper left quarter of the original image display area.

I have added some checking routines, so you will be warned more often if your INI file input is not valid.


petrus' gpaedia files



Edited 2 time(s). Last edit at 10/13/2020 12:04PM by petrus.
Re: Hires GPI and the GPH file
Date: October 13, 2020 10:10AM
Posted by: Turbo Lover
Great stuff petrus.



My Grand Prix 4 Files

I'm a total dick. How many people can say that?
Re: Hires GPI and the GPH file
Date: October 16, 2020 02:09PM
Posted by: petrus
Hires GPI Tips

Hires sizes

A hires GPI size twice as large (x2) as the original GP4 size will usually be okay. In special cases x4 (example: logos) or even x8 (example: teamart helmets) can be considered. A hires 4:3 format for a HD (1920x1080) screen would be 1280x960, which is just twice as large as 640x480.
Sometimes the GPI file is not shown in his original size but is stretched. This is for example the case with teamart logos and helmets. Here the size of the part of the screen used by the GPI should give a good estimate.
It is unreasonable to use larger sizes. They will not enhance the display but use unnecessary large disk space.

GP4 does not always use the values from the GPH file. For example the trackmaps corner number GPI files 155-174 have a standard size of 32x32. You may try to change their size in the GPH file, but GP4 always uses 32x32 and ignores the updated sizes.

GPI creating programs

To create GPI files from a TGA images you can use GPIBrowser 1.2 by Lo2k or Slimtex, included in the ZAZ tools. GPI files created with these programs from the same TGA are identical. GPIBrowser does only accept 32bit uncompressed TGA and will display a message if the format is different. Slimtex can work with RLE compressed TGA files also.

GPIBrowser does only work inside a GP4 environment. It uses the GPH file to get resp. set the GPI sizes. Therefore if you copy a GPI file that does not have the size given to its ID in the GPH file into the image folder GPIBrowser is working with, you will get an exception error. To make the program work again, you will have to update the GPH file with the correct values.
If a TGA file is put into the browser, all sizes are taken, the preview image is visible and the GPH file will be updated accordingly.
But the GPI may be displayed incorrectly in GP4 all the same. The GPI (back) to TGA conversion does work properly, so you will get a valid TGA file even if the size is not a standard one.

Slimtex can work with files in any chosen folder. It does not use the GPH file. The Slimtex GPI-Viewer does only accept a widht/height that does already exist in GP4. All other GPI files will have a corrupted display. Though the viewer does not show the GPI correctly, the program may still create a usable GPI file (example: gridcar 400x99). But if the not standard GPI is converted back to TGA a default 512x512 size is taken and the image most probably remains corrupted.

Tests

driver
ID	widthxheight	gpibrowser	slimtex-gpi2tga		GP4_dsp
33	512x512	(x2)	0200 0200	512x512 okay		okay	
33	412x412		019c 019c	512x512 corrupt		defect: smaller 412 size?
33	640x640		0280 0280	512x512 corrupt		defect: smaller 1/4?

logo
ID	widthxheight	gpibrowser	slimtex-gpi2tga		GP4_dsp
51	256x192	(x2)	0100 00c0	256x192 okay		okay
51	512x384	(x4)	0200 0180	512x512	(out of range)	okay
				
gridcar
ID	widthxheight	gpibrowser	slimtex-gpi2tga		GP4_dsp
178	400x100 (x2)	0190 0064 	512x512	corrupt		okay						
178	400x99	(x2-1)	0190 0063	512x512	corrupt rev.	okay
						
weather
ID	widthxheight	gpibrowser	slimtex-gpi2tga		GP4_dsp
124	320x256 (x2)	0140 0100	512x512 corrupt rev.	okay			   	
124	640x512 (x4)	0280 0200	512x512 corrupt		okay


petrus' gpaedia files
Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, Vader, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy