The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Vladki on April 08, 2017, 10:07:05 PM

Title: makeobj has problems with indexed graphics
Post by: Vladki on April 08, 2017, 10:07:05 PM
I have noticed that simutrans-extended sgfaults with pak128.CS compiled with latest makeobj-extended. Fortunately I had an older compiled version that worked fine, so I was able to find the guilty pak to be: ground.LightTexture.pak. This was taken unmodified from pak128, and is also identical to the one in pak128.britain-ex. Even after taking this one form older compile, I had bad artifacts on the screen, traced to ground.Borders.pak, ground.SlopeTrans.pak, and ground.Marker.pak.
All of them were take from pak128... Finally I found out that the main difference to pak128-britain was, that the png files for these paks were indexed in pak128.CS, while they are 8-bit/color RGB in pak128.britain-ex

borders.png:          PNG image data, 1152 x 384, 2-bit colormap, non-interlaced
marker.png:           PNG image data, 1152 x 768, 2-bit colormap, non-interlaced
texture-lightmap.png: PNG image data, 1920 x 640, 8-bit colormap, non-interlaced
texture-slope.png:    PNG image data, 512 x 512, 2-bit colormap, non-interlaced

So, one can guess that 8-bit colormap segfaults, while 2-bit colormap only has bad display.
Unfortunately there is 113 colormap pictures in pak128.CS :(

I suspect this commit to be the culprit:

commit d7df9629691c07f057f2b01416e40f77f3a3197c
Author: James E. Petts <jamespetts@yahoo.com>
Date:   Thu Apr 6 12:58:26 2017 +0100

    ADD: Makeobj support for indexed graphics with transparency (An-dz, from Standard)

I have tried compiling pak128.CS with one commit older (1c6595ffc9f38c62eabb632e552ed64c00138e51) and it works fine.
Title: Re: makeobj has problems with indexed graphics
Post by: jamespetts on April 08, 2017, 10:10:03 PM
Hmm - odd: this is just integrating a change from Standard. Have you tried the Standard nightly makeobj to see whether the behaviour is the same there?
Title: Re: makeobj has problems with indexed graphics
Post by: Vladki on April 09, 2017, 12:55:01 PM
Oh yes, the problem is in standard as well. I went back to r8170, and that one compiles good pakset. So it is indeed the patch taken from standard.
Title: Re: makeobj has problems with indexed graphics
Post by: jamespetts on April 09, 2017, 12:58:13 PM
I have moved this to the Standard bug reports forum given that it can be reproduced there.
Title: Re: makeobj has problems with indexed graphics
Post by: An_dz on April 09, 2017, 02:30:13 PM
I can reproduce, but I get a crash even reverting that commit.

Edit:
Fixed in r8199
Title: Re: makeobj has problems with indexed graphics
Post by: Vladki on April 10, 2017, 08:56:54 PM
Thank you, it works now