Author Topic: makeobj has problems with indexed graphics  (Read 405 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki

makeobj has problems with indexed graphics
« 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.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15458
  • Total likes: 378
  • Helpful: 171
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: makeobj has problems with indexed graphics
« Reply #1 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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: makeobj has problems with indexed graphics
« Reply #2 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.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15458
  • Total likes: 378
  • Helpful: 171
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: makeobj has problems with indexed graphics
« Reply #3 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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2593
  • Total likes: 289
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: makeobj has problems with indexed graphics
« Reply #4 on: April 09, 2017, 02:30:13 PM »
I can reproduce, but I get a crash even reverting that commit.

Edit:
Fixed in r8199
« Last Edit: April 09, 2017, 05:03:22 PM by An_dz »

Offline Vladki

Re: makeobj has problems with indexed graphics
« Reply #5 on: April 10, 2017, 08:56:54 PM »
Thank you, it works now