(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
06-08-24 08:52 PM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Layering via BitBlt
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
HyperHacker
Posts: 3119/5072
It's GBA but I believe the same rules apply.
sloat
Posts: 18/20
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.
interdpth
Posts: 237/362
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
HyperHacker
Posts: 3115/5072
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.
interdpth
Posts: 236/362
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
Posts: 3108/5072
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
Posts: 235/362
Ok, exactly how do I go about doing it though?
HyperHacker
Posts: 3102/5072
Use TransparentBlt.
interdpth
Posts: 233/362
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

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.012 seconds; used 350.73 kB (max 392.98 kB)