(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-14-24 12:20 PM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Layering via BitBlt New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
interdpth

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6294 days
Last view: 6294 days
Posted on 08-29-06 06:51 PM Link | Quote
Ok, well i'm working on a level editor and now I got to the part where I need to work with Layers. I'm not sure the Raster Operations to use, i'm using Sourcepaint since sourcecopy kills the other layers

I'm working with 3 layers

I know which layer needs to go on top of which but i'm not sure how to go about it because some turn out out to be transparent which is not what I need so anyhelp?

Here's the pic if anyone is interested




(edited by interdpth on 08-29-06 05:59 PM)
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6295 days
Last view: 6295 days
Posted on 08-29-06 08:38 PM Link | Quote
Use TransparentBlt.
interdpth

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6294 days
Last view: 6294 days
Posted on 08-29-06 10:50 PM Link | Quote
Ok, exactly how do I go about doing it though?
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6295 days
Last view: 6295 days
Posted on 08-30-06 04:05 AM Link | Quote
BitBlt the lowest layer onto your window, then TransparentBlt the next highest layers on in order of depth. Or better, do all this on a temporary buffer and then BitBlt that to the window to reduce flicker.
interdpth

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6294 days
Last view: 6294 days
Posted on 08-30-06 06:37 PM Link | Quote
Can I see a code example or something, I know how to regluar bitblt, but this kind of confuses me, seeing as how I have to give a color instead of an operation.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6295 days
Last view: 6295 days
Posted on 08-30-06 07:54 PM Link | Quote
The colour is just whatever colour you don't want to be copied. Fill layer 2 with that colour, draw things on each layer, BitBlt layer 1 to the window, then TransparentBlt layer 2 to it specifying that colour. You should see layer 2 overtop of layer 1.
TransparentBlt works almost exactly the same as BitBlt, I don't know how you can be so confused about it.


(edited by HyperHacker on 08-30-06 06:55 PM)
interdpth

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6294 days
Last view: 6294 days
Posted on 08-30-06 08:06 PM Link | Quote
The reason I don't get is this is because I have 3 seperate functions drawing to the HDC. all using bitblt and SRCPAINT. My first attempt at the transparentblit just killed the other layers besides the one i was transparentblitting so that's why I don't get it
sloat



 





Since: 11-18-05
From: Delaware, US

Last post: 6397 days
Last view: 6397 days
Posted on 08-31-06 12:34 AM Link | Quote
If it's that confusing, just don't use BitBlt at all then. Clear the background using ExtFloodFill or FillRect (whichever works better for you), and just use TransparentBlt to do all your drawing.

Chances are it won't show up properly anyway since, IIRC, the SNES uses the palette index to indicate transparency and not the color value. Probably the best solution would be to do masking for each tile, and draw each with BitBlt using a SRCAND-SRCPAINT double blit. Another solution would be to change the color value of palette index 0 to something that isn't in the game...then you can use TransparentBlt with no ill effects.

Generating masks on the fly and changing pixel colors present their own problems -- the most noticable would be how slow the pixel manipulation functions are. Unless you're prepared to jump in to the fun fun world of DIBs, you should stick with broken rendering, or...

Using a separate, static bitmap mask would work. But then, that's another file to add to your project.

btw, TransparentBlt hates Windows 98. It will cause huge memory leaks, and may not even work at all.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6295 days
Last view: 6295 days
Posted on 08-31-06 12:45 AM Link | Quote
It's GBA but I believe the same rules apply.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - Programming - Layering via BitBlt |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.013 seconds; used 389.02 kB (max 475.60 kB)