Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load game menu: animated image missing, purple mess. #359

Closed
aapo opened this issue May 22, 2012 · 11 comments
Closed

Load game menu: animated image missing, purple mess. #359

aapo opened this issue May 22, 2012 · 11 comments
Labels

Comments

@aapo
Copy link

aapo commented May 22, 2012

Git 0f519d8 on ARM-Linux (Maemo5)

Loading menu should show animated icon for saved game, but it shows purple rectangle.
http://imagepaste.nullnetwork.net/viewimage.php?id=3944

@clintbellanger
Copy link
Owner

I suspect this is going to be in GameStateLoad::loadPreview

Double check usage of SDL_SetColorKey on the layers and the composite images. Check the default behavior in the SDL docs.

@clintbellanger
Copy link
Owner

aapo, can you test to see if this was an issue before Git 0f519d8?

If the error was introduced in that commit, it'll have to be related to the way headers are handled. E.g. maybe we can't use forward declaration because something important was in one particular header.

@igorko
Copy link
Collaborator

igorko commented May 22, 2012

It's ARM. So forwarding could work in very different way.

@aapo
Copy link
Author

aapo commented May 22, 2012

It happens also older commits, e.g. ba2037f

I think it is some old library my system. (SDL or png)

@clintbellanger
Copy link
Owner

When you play the game, do you see ugly purple squares anywhere else?

If not, it's probably a logic bug somewhere in this one function (maybe assumptions that work on most but not all systems)

@aapo
Copy link
Author

aapo commented May 22, 2012

No there are no purple anywhere else.

Purple is this image: flare/mods/fantasycore/images/avatar/preview_background.png
If it is removed (or shrinked to the 1x1px) the slot is empty.

So GameStateLoad::loadPreview+SDL_SetColorKey might be good guess.

@pennomi
Copy link
Collaborator

pennomi commented May 30, 2012

I compiled Flare on a Raspberry Pi (also an ARM processor); it had the same issue.

Also, sometimes creatures were missing, though that might be attributed to the ridiculously slow processor and low memory. (I was getting around 5-10 FPS...)

@igorko
Copy link
Collaborator

igorko commented Jun 19, 2012

Does it still happen?

@clintbellanger
Copy link
Owner

Note that images/avatar/preview_background.png is no longer needed thanks to the separate preview images that now exist. If we clean up GameStateLoad::loadPreview() we should also be able to fix this issue.

@clintbellanger
Copy link
Owner

I did some cleanup of the menu, now possible with the separate preview images.

I'm assuming this will fix the issue. If not, please comment and I'll reopen the issue.

@clintbellanger
Copy link
Owner

Ah, found the actual issue.

In GameStateLoad I was formatting the "magic pink" transparency by the Screen's format instead of the image file's format. The image files are 32 bit. If the screen was anything less than 32 bit, or some other format (e.g. different endian) it would cause this mess.

The latest check-in should solve it. Tested via Remote Desktop with reduced color depth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants