mettli / guichan

Automatically exported from code.google.com/p/guichan
Other
0 stars 0 forks source link

Image not displaying when loaded from certain image files (GuiChan 0.8.1, SDL backend, Mac OS X 10.5) #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Some Images will not draw themselves when rendered in the draw() method of a 
subclass of 
Container, where the method is defined as:

void MyContainer::draw(gcn::Graphics *graphics)
{
    if (isOpaque())
    {
        graphics->drawImage(myImage_ptr, 0, 0);
    }

    drawChildren(graphics);
}

Attached are two images tested with this code. The image "game_screen.png" does 
not render. 
The image "button.png" does.

The application is using GuiChan v0.8.1, with the source code embedded directly 
in the project. 
The backend is SDL v. The application is run in windowed mode; the size of the 
window does not 
appear to affect whether the image is rendered or not. The operating system is 
Mac OS X 10.5.4.

Original issue reported on code.google.com by ajm...@ns.sympatico.ca on 2 Aug 2008 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
Just taking a short look at the images:

tlindeij@horst-dieter:Desktop$ file game_screen.png button.png 
game_screen.png: PNG image data, 800 x 600, 8-bit/color RGBA, non-interlaced
button.png:      PNG image data, 116 x 48, 8-bit/color RGB, non-interlaced

It seems the only significant difference is that game_screen.png has an alpha 
layer.
It shows up fine in eog or gimp though, so I guess there might be some endian
handling issues here. You don't seem to be using the alpha layer though, so 
maybe try
removing it, until the SDL backend is fixed?

However, nobody reported such problems in our project so far, and we also use 
SDL and
we do have a Mac version (and we use alpha-layered PNGs).

Original comment by b.lindeijer on 5 Aug 2008 at 8:37

GoogleCodeExporter commented 9 years ago
I've just confirmed the bug. At the moment I don't have a solution for it, but 
I'll
look into it. It seems that there is a problem when converting the surface to 
the
standard format as no alpha is present when converting the surface to display 
format.

Original comment by olof.nae...@gmail.com on 6 Aug 2008 at 2:37

GoogleCodeExporter commented 9 years ago
yes,i 've such problems,can you help me fixed it? thanks!
Attached are two images tested . The image "03.png" does not render. 
The image "04.png" does.

Original comment by Peter.C...@gmail.com on 28 Feb 2009 at 2:27

Attachments:

GoogleCodeExporter commented 9 years ago
The solution is to use the image that does render or provide a patch. I don't 
have 
time for Guichan at the moment I'm afraid.

Original comment by olof.nae...@gmail.com on 28 Feb 2009 at 4:57