Opened 11 years ago

Closed 8 years ago

#37453 closed defect (fixed)

libsdl_image: unknown Graphical glitches and image non-display in SDL based games

Reported by: macports@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: libsdl_image

Description

I am encountering non-display of images (leaving black screens) and image display corruption in SDL based games. Text is displayed fine. Clean build of ports from a fresh MacPorts installation.

MacOSX 10.5.8 / XCode 3.1.4.

This was first seen in a build of widelands trunk, but is not widelands specific. SDLInvaders is a quick-to-compile easily seen example (screenshot attached of game after bypassing the wholly black menu).

Macports tree r87590 is working fine. Macports tree r95100 and later have been confirmed as exhibiting the issues.

I am narrowing down the point at which the breakage happens in order to identify specific port(s), but felt it was worth filing this ticket now.

Attachments (1)

SDLInvaders r95100.png (22.6 KB) - added by macports@… 11 years ago.
Screenshot of SDLInvaders showing image corruption towards bottom of sprites.

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by macports@…

Attachment: SDLInvaders r95100.png added

Screenshot of SDLInvaders showing image corruption towards bottom of sprites.

comment:1 Changed 11 years ago by macports@…

Issue narrowed down to starting with r89083, the upgrade of libsdl_image to version 1.2.11.

comment:2 Changed 11 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to jmr@…
Port: libsdl_image added; libsdl libsdl_img removed
Status: newassigned
Summary: *sdl* @ unknown Graphical glitches and image non-display in SDL based gameslibsdl_image: unknown Graphical glitches and image non-display in SDL based games

I can't reproduce the problem on 10.7.5/x86_64.

comment:3 Changed 11 years ago by macports@…

Thanks for looking (and the ticket field updates - I didn't know I wouldn't be able to change them).

I suspect the problem may be with the actual changes in libsdl_image rather than the port file packaging, and there is some bug that is triggered by the 10.5.8 compilers (I tried gcc4.0 and gcc4.2) that isn't triggered by the 10.7.5 compilers. I'll search and compile the upstream changesets between 1.2.10 and 1.2.11 and see which one the problem lies within.

comment:4 Changed 11 years ago by jmroot (Joshua Root)

OK, thanks. Certainly if it's an upstream issue, let's try to get the fix in upstream.

comment:5 Changed 11 years ago by macports@…

Changeset 292 is to blame.

http://hg.libsdl.org/SDL_image/rev/5953114c0d27

Now to work out what is wrong with it...

comment:6 Changed 11 years ago by macports@…

I have found upstream issue http://bugzilla.libsdl.org/show_bug.cgi?id=1413

The workaround, for MacOSX 10.5 at least, seems to be to compile libsdl_image with --disable-imageio, like r91944 did for Tiger.

configure.args  --disable-sdltest \
                --disable-imageio \
                --enable-jpg-shared=false \
                --enable-png-shared=false \
                --enable-tif-shared=false

comment:7 Changed 11 years ago by jmroot (Joshua Root)

Hmm, the only obvious options are:

  • there's a bug in ImageIO on 10.5 that only appears when using a custom calibrated colour space, or
  • the compiler does something weird in the conversion of integer constants to float, and the bogus values cause problems later. You could test this one by changing "1" to "1.0f" and so on.

comment:8 Changed 11 years ago by macports@…

On changing the matrix and whitepoint, the library works without obvious error (but the colors may be wrong - I am not a colorspace expert). See attachment 1005 on the upstream bug.

comment:9 Changed 8 years ago by ttimo@…

This is still an issue - can we get --disable-imageio added to the portfile? The fix is trivial, I've verified it works here. See https://www.reddit.com/r/pygame/comments/436gt1/fixing_pygame_on_os_x_el_capitan/

comment:10 Changed 8 years ago by jmroot (Joshua Root)

Changeset 292 was eventually reverted upstream for SDL2, so I guess we can do that too.

comment:11 Changed 8 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.