gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > A transparency question

#168250 - Lazy1 - Fri Apr 17, 2009 12:28 am

I'm redoing my wolf3d port and I have run into a minor issue with the palette.
The way it's setup now is this:

Mode 5:
bg2 = 512x256 8bit: Used for menus and other things that were supposed to be drawn at 320x200
bg3 = 256x256 8bit: The game is drawn here

This setup allows the game to be rendered at 256x192 without me having to modify every screen to fit, however the wolf3d palette has black in the first palette slot.

What would happen was the pause screen for example would be messed up because the black border would be transparent.
My solution so far was to modify the drawing functions to choose the next darkest color instead which works fairly well but still seen as a dark blue.

It's just a minor issue but I wondered if there was another way to handle this?

#168251 - elhobbs - Fri Apr 17, 2009 1:29 am

in cquake I switched index 0 and 255 (which quake uses to mark transparency) for all of the framebuffer drawing (the color at 0 needs to be moved to 255 in the palette too). I also did this for sprite and transparent textures with the 3d hardware. I only set the index 0 transparent bit on these textures. since the main world textures are all solid I did not have to translate. I loaded these textures without the 0 index transparent bit set.

if you are doing all of the rendering in software then you will need to translate everything.

#168253 - Lazy1 - Fri Apr 17, 2009 1:52 am

Aha!
It works perfectly now :D thanks!

#168259 - mortys - Fri Apr 17, 2009 1:00 pm

@elhoobs
I now that i'm of topic but I was wondering if you're still working on cquake or that the project is droped ? However, thanks for the cool releases.

#168264 - elhobbs - Fri Apr 17, 2009 1:42 pm

mortys wrote:
@elhoobs
I now that i'm of topic but I was wondering if you're still working on cquake or that the project is droped ? However, thanks for the cool releases.
I have been working on another project, so I have not worked on it for a while. I did update the source to the latest libnds release plus a few other fixes and improvements, but I have not released it as it became unstable. I suspect the culprit is the new libnds, but I have not been able to conclusively isolate the issue. I did recently pass one of my suspicions on to wintermute, but I am not that savy at system level code to know if I am way off base or not. but, I am experiencing the same issue on my new project that I was experiencing with cquake and it uses a separate code base. that does not prove much of anything, but it doesn't disprove it either.

#168268 - mortys - Fri Apr 17, 2009 4:47 pm

@elhoobs
Great to hear even if this bug is a pity in the ass.
I hope that you find the bug and continue your new project and maybe CQuake. Waiting for your next works.

#168270 - Lazy1 - Fri Apr 17, 2009 8:07 pm

What issue?
The only problem I've had so far is that no$gba needs the arm9/arm7 bioses or using the keyboard code will crash.

#168272 - elhobbs - Fri Apr 17, 2009 9:19 pm

Lazy1 wrote:
What issue?
The only problem I've had so far is that no$gba needs the arm9/arm7 bioses or using the keyboard code will crash.
I sent you a pm