-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify skin functions #210
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.