Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2009-08-05 22:59:09

Evan
Member
Registered: 2009-08-05
Posts: 9

Request: Alpha Channel PNGs

So from what I could gather saving PNGs into different formats with different backgrounds, Alpha channel on PNGs is being ignored. Would it be difficult to have the engine interpret 32Bit/Alpha Channel PNGs ?

Offline

#2 2009-08-06 03:02:47

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Request: Alpha Channel PNGs

Offline

#3 2009-08-06 19:00:21

Evan
Member
Registered: 2009-08-05
Posts: 9

Re: Request: Alpha Channel PNGs

Heya,

Thanks for the link. I've had a read through and looks like a small code change from blit to masked_blit, correct?

I downloaded the source and made small changes to the code in video.c , but i had a little trouble compiling it as I haven't compiled anything before.

I downloaded allegro and cygwin, tried to run ./configure, but I don't have enough knowledge to install allegro correctly, as it gives me an error that allegro and cmake can't be found. If I did compile it, I'd change the executable to something like OS_PNG.exe or something as a patch to put into an already existing copy of Open Sonic's folder.

Offline

#4 2009-08-10 07:09:15

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Request: Alpha Channel PNGs

Alpha Channel looks good, but I included that link to explain that this feature will make Open Sonic unplayable on old/slow platforms. Why don't we keep two versions of the game: one with and another without alpha channel support? Because we would have to maintain two versions of the graphics, and that's not practical. If somebody has a better and practical idea, please share it with us.

Evan wrote:

Thanks for the link. I've had a read through and looks like a small code change from blit to masked_blit, correct?

No, far from that.

Offline

#5 2009-11-19 10:19:33

Bertram
Member
Registered: 2009-11-19
Posts: 50

Re: Request: Alpha Channel PNGs

Hi,

First of all, I have to say I've been perfectly amazed by this project. Congratulations! wink

If somebody has a better and practical idea, please share it with us.

-> I don't know if this has been proposed already. That's why I'm gonna ask:

If you test the image's bit per pixel at loading, you could make :
32 bit PNG be handled based on transparency by the code while keeping the 24bits (and less) ones make use of the magic color.

This would be a nice feature to make use of.

A second option could be to add a flag into the lev files telling the transparency method for tilesets.

I hope this helped.

Best regards.

Offline

#6 2009-11-19 11:34:44

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Request: Alpha Channel PNGs

Ever since I stumbled upon this project I've thought it would be better off with 32 bit PNG's. First of all because more and more people upgrades to newer and better equipment. I've been in the situation where my gears was outdated, and I know how that feels. But: Limiting to 24 bit just so the game looks like the original idea is not a good option. If that's the case then I'm surprised you haven't decided to use 8bit bmp's to enable an MSDOS port of the game. The way I see it: Enable as many systems as possible and set a flag in the level file to determin what version to use. LODEF for 8bit tiles, MIDDEF for 16 bit tiles, HIDEF for 24bit tiles, and XHDEF for 32bit tiles with alpha channel. This way we can create quests which fits all players. So +10000000 for 32bit PNG's with alpha channel.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org