-
Notifications
You must be signed in to change notification settings - Fork 238
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
Aggregate SDL_Surface
s and their scale in RenSurface
#1429
Conversation
src/renwindow.h
Outdated
@@ -6,19 +6,17 @@ struct RenWindow { | |||
#ifdef LITE_USE_SDL_RENDERER | |||
SDL_Renderer *renderer; | |||
SDL_Texture *texture; | |||
SDL_Surface *surface; | |||
int surface_scale; | |||
RenSurface rs; |
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.
wouldn't the name surface
be better to keep?
The previous type was a pointer, no wrong structure dereferencing should cause an invalid compile due here.
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.
wouldn't the name
surface
be better to keep?
It's mostly to distinguish it from the SDL surface underneath, so we avoid RenWindow.surface.surface
.
The previous type was a pointer, no wrong structure dereferencing should cause an invalid compile due here.
What do you mean?
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's mostly to distinguish it from the SDL surface underneath, so we avoid
RenWindow.surface.surface
.
fair.
But I feel like the name rs
is a bit undescriptive.
What do you mean?
Ignore it. Just Connecting dots that don't need connecting
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.
But I feel like the name
rs
is a bit undescriptive.
Yeah that's fair.
What name should we use? We could even change the name of the underlying SDL_Surface.
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.
I think it's fine; but if you must, you could simply use rensurface
; that's extremely clear, and falls in line with the normal coding practice of capitalizing the class, and lower-casing the instance.
SDL_Surface *surface; | ||
int surface_scale; |
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.
RenSurface
appears to only be a combination of surface
and surface_scale
with a changed datatype for scales.
Does this make working with surfaces independently easier?
Does it only affect the use of the SDL Renderer?
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.
Yes, it dissociates the surface from the window scale.
At the moment only using the SDL Renderer we get a scale that might be not 1, yeah.
I think in the future, when we refactor how we scale, we'll just not need to have a scale variable here, so then we might just replace RenSurface
with SDL_Surface
.
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.
Ah, alright.
Is switching to a fixed point number going to introduce any problems?
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.
Hopefully not.
This change was done thinking about future fractional scaling support. But considering that we might just scrap the whole surface scale concept, I should probably just revert this to be an int
like before.
e1c85ef
to
78eb3de
Compare
Reverted back to |
78eb3de
to
d47c262
Compare
No description provided.