flightscreen is not a valid bmp file
flightscreen is not a valid bmp file
- JeremyaFr
- Posts: 3989
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Using a resolution whose the width is not a multiple of 4 (such as 1366x768), when you take a screenshot via the in-game feature, the generated flightscreen is an invalid bmp file.
-
- Posts: 239
- Joined: Mon Jan 19, 2009 11:45 am
Do you have a sample bmp at hand? Is this in 16 bit or 32 bit mode?
My first theory was that it has to do with the alignment requirements of bmp (line start must be aligned to a multiple of 4 bytes which the game designers probably wouldn't have thought of), however for your resolution that shouldn't happen unless the game writes 3 bytes/pixel data.
My first theory was that it has to do with the alignment requirements of bmp (line start must be aligned to a multiple of 4 bytes which the game designers probably wouldn't have thought of), however for your resolution that shouldn't happen unless the game writes 3 bytes/pixel data.
- JeremyaFr
- Posts: 3989
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Here is the files:
flightscreens.zip
It happens in 16-bit and 32-bit modes.
I think the game generates a 24-bit RGB bmp file.
flightscreens.zip
It happens in 16-bit and 32-bit modes.
I think the game generates a 24-bit RGB bmp file.
-
- Posts: 239
- Joined: Mon Jan 19, 2009 11:45 am
Ok, it's indeed the alignment issue.
GIMP for example can open then though, they are just distorted.
Opening them as RAW files in any image editor should also allow you to see that all the data is there in principle.
What basically needs to be done is to write (width modulo 4) extra bytes at the end of each line.
Or change it to produce RGBA bmps...
GIMP for example can open then though, they are just distorted.
Opening them as RAW files in any image editor should also allow you to see that all the data is there in principle.
What basically needs to be done is to write (width modulo 4) extra bytes at the end of each line.
Or change it to produce RGBA bmps...
-
- Posts: 239
- Joined: Mon Jan 19, 2009 11:45 am
It might be easier to create a small tool to fix it rather than try to patch the binary.
Or convince your favourite image editor to handle these kind of broken files, I suspect they are not that uncommon.
Or convince your favourite image editor to handle these kind of broken files, I suspect they are not that uncommon.
- JeremyaFr
- Posts: 3989
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
Here is a patch to create bmp in 32 bits instead of 24 bits:
These modifications are compatible with or without the 32bitmode patch.
Here is a patch to create bmp in 32 bits instead of 24 bits:
Code: Select all
; properties section
At offset 136CDA, replace 740140 with 909090
At offset 136D00, replace 18 with 20
; 16-bit section
At offset 136B2E, replace 03 with 04
At offset 136B35, replace 0F8C50FFFFFFF6C3017445 with 9090909090909090909090
At offset 136B56, replace 6A0056E8C237FFFF0FBFC083C408 with 8B44245C3BD80F8C29FFFFFFEB21
; 8-bit or 32-bit section
At offset 136C3B, replace 03 with 04
At offset 136C43, replace 7C8CF6C3017447 with 90909090909090
At offset 136C60, replace 6A0056E8B836FFFF0FBFC083C408 with 8B44245C3BD80F8C65FFFFFFEB23