Closed WaywardHeart closed 2 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.
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.
Could you rebase this, now that https://github.com/mkxp-z/mkxp-z/pull/82 is merged?
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.
@WaywardHeart Can you apply the fix from https://github.com/mkxp-z/mkxp-z/pull/91#issuecomment-2004462744 to this PR as well?
@Splendide-Imaginarius Done. I made a few other changes, too.
SDL_SoftStretchLinear
, so now text will still get smoothed if it somehow ends up big enough to hit that code path. That function will see more use when I get around to working on my megasurface PR again.gl.unpack_subimage
when it's available now.shader.setSource()
out of the surface block. Since the lack of that call never caused problems before I assume it's always initialized to the proper value by default, but someone who knows more about shaders than me saw fit to put that function in the drawText function so now we're always using it there.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?
@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 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.
It turns out transparency didn't work with subImageFix on, either, it just wan't set to crash there.