Simplify skin functions#210
Simplify skin functions#210robalni wants to merge 2 commits intoblue-nebula:masterfrom robalni:skin-functions
Conversation
| int w = max(x2-x1, 2), h = max(y2-y1, 2), tw = size ? size : t->w, th = size ? size : t->h; | ||
| float pw = tw*0.25f, ph = th*0.25f, qw = tw*0.5f, qh = th*0.5f, px = 0, py = 0, tx = 0, ty = 0; | ||
| if(w < qw) | ||
| int width = max(x2 - x1, 2); |
There was a problem hiding this comment.
it'd be awesome if you could change max and min to std::max and std::min c:
| if(w < qw) | ||
| int width = max(x2 - x1, 2); | ||
| int height = max(y2 - y1, 2); | ||
| int tw = size ? size : t->w; |
There was a problem hiding this comment.
please write size != 0 ? ... instead of just size ? ...
|
Isn't the drawskin() function supposed to use some kind of 9-split and repeat it based on that? Instead of just plain stretching/repeating |
|
Yes, it still splits it in 9. It's just the center piece that is stretched now instead of repeated. |
|
I think that's not how you're supposed to do that, ideally it repeats it so it can give ideal results |
|
Doesn't that just depend on what skin you have? Some skins look better stretched and some repeated. |
|
yeah, but usually you design your skins in a way so they look the best when repeated, e.g. if you have a low-res skin, stretched will make it look very pixelated |
This change makes the code easier to read. It changes behaviour of drawskin slightly; now it stretches the image instead of repeating it but that should not be visible with default skin.