mkxp-z / mkxp-z

Open-source cross-platform player for (some) RPG Maker XP / VX / VX Ace games. A very heavily modified fork of mkxp. RGSS on steroids with a stupid name.
https://github.com/mkxp-z/mkxp-z/wiki
GNU General Public License v2.0
141 stars 39 forks source link

Enable transparent blitting from megatextures. #98

Closed WaywardHeart closed 2 months ago

WaywardHeart commented 8 months ago

It turns out transparency didn't work with subImageFix on, either, it just wan't set to crash there.

WaywardHeart commented 8 months ago

Went ahead and rebased it onto #82 so people could see the current version of the code, since I've understandably been working under the expectation that those features would be available. I did my best to merge drawText's version of the code in, and changed the GLMeta::blitRectangle call in the "Fast blit" section to the three argument version, since the two argument version changes destRects dimensions to sourceRect's, which could not possibly have been intended.

WaywardHeart commented 5 months ago

It's been a while since I really touched this, but I think the only meaningful change was handling rects with negative dimensions, because SDL doesn't support those.

Splendide-Imaginarius commented 3 months ago

Could you rebase this, now that https://github.com/mkxp-z/mkxp-z/pull/82 is merged?

WaywardHeart commented 3 months ago

Done. I had a bug fix that I've needed to get around to pushing, anyway. TEX::setSmooth needed to be called after the texture was bound.

Splendide-Imaginarius commented 3 months ago

@WaywardHeart Can you apply the fix from https://github.com/mkxp-z/mkxp-z/pull/91#issuecomment-2004462744 to this PR as well?

WaywardHeart commented 3 months ago

@Splendide-Imaginarius Done. I made a few other changes, too.

Splendide-Imaginarius commented 3 months ago

Nice work @WaywardHeart, I'll give the updated PR a try soon.

I turned the smooth setting into an optional parameter for stretchBlt instead of having it on the private struct. Since you're in the process of making the smoothScaling setting apply to blits, too, we could change that to default to true if smoothScaling is non-zero.

Yes I would be very interested in a follow-up PR that makes the bitmapSmoothScaling and bitmapSmoothScalingDown configs apply to stretchBlt.

Are there any other things you want to change in this PR before I consider it for merging?

WaywardHeart commented 3 months ago

@Splendide-Imaginarius I'm not seeing anything else that can be done for this. Unless you or someone else can find a problem then it should be ready.

Splendide-Imaginarius commented 3 months ago

@Splendide-Imaginarius I'm not seeing anything else that can be done for this. Unless you or someone else can find a problem then it should be ready.

Alright then. I'll try to test it out soon; I don't expect to find anything that blocks a merge.