-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[rcore] Use FLAG_*
macros where possible
#5169
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
base: master
Are you sure you want to change the base?
Conversation
3255f2b
to
4fbf247
Compare
4fbf247
to
70a06f9
Compare
FLAG_*
macros where possible
@JohnnyCena123 I've been thinking about this update and I'm merging it but I'm concerned about the macro So, code needs to be updated from: if (FLAG_CHECK(CORE.Window.flags, FLAG_WINDOW_MINIMIZED) > 0) { } to if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED)) { } or depending the case if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED)) { } Please, could you review it? |
@JohnnyCena123 Did you see my previous message? I can implement it if you can't. |
sorry, I must've missed it. I will do that tomorrow if I remember |
@raysan5 i remembered! |
38410b5
to
a49f79b
Compare
{ | ||
RGFW_window_setFloating(platform.window, RGFW_TRUE); | ||
} | ||
if (flags & FLAG_WINDOW_ALWAYS_RUN) |
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.
Why is this check removed?
{ | ||
RGFW_window_setFloating(platform.window, RGFW_FALSE); | ||
} | ||
if (flags & FLAG_WINDOW_ALWAYS_RUN) |
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.
Why is this check removed?
if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_RESIZABLE)) FLAG_SET(flags, RGFW_windowNoResize); | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_TRANSPARENT)) FLAG_SET(flags, RGFW_windowTransparent); | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE)) FLAG_SET(flags, RGFW_windowFullscreen); | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIDDEN)) FLAG_SET(flags, RGFW_windowHide); |
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, I prefer to avoid this kind of alignments, one space after the condition is ok.
{ | ||
SDL_SetWindowAlwaysOnTop(platform.window, SDL_FALSE); | ||
} | ||
if (flags & FLAG_WINDOW_ALWAYS_RUN) |
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.
Why is this check removed?
{ | ||
SDL_SetWindowAlwaysOnTop(platform.window, SDL_FALSE); | ||
} | ||
if (flags & FLAG_WINDOW_ALWAYS_RUN) |
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.
Why is this check removed?
CORE.Window.resizedLastFrame = false; | ||
|
||
if ((CORE.Window.eventWaiting) || (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0))) | ||
if ((CORE.Window.eventWaiting) || FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED) && !FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_ALWAYS_RUN)) |
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.
WARNING: Second conditions must be between brakets!
if ((CORE.Window.flags & FLAG_WINDOW_UNFOCUSED) > 0) | ||
//if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIDDEN)) FLAG_SET(flags, SDL_WINDOW_HIDDEN); | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_UNDECORATED)) FLAG_SET(flags, SDL_WINDOW_BORDERLESS); | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_RESIZABLE)) FLAG_SET(flags, SDL_WINDOW_RESIZABLE); |
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, avoid alignment.
FLAG_CLEAR(flags, SDL_WINDOW_INPUT_FOCUS); | ||
FLAG_CLEAR(flags, SDL_WINDOW_MOUSE_FOCUS); | ||
} | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_TOPMOST)) FLAG_SET(flags, SDL_WINDOW_ALWAYS_ON_TOP); |
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, avoid alignment
} | ||
|
||
const bool allowInterlaced = CORE.Window.flags & FLAG_INTERLACED_HINT; | ||
const bool allowInterlaced = FLAG_IS_SET(CORE.Window.flags. FLAG_INTERLACED_HINT); |
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.
This point seems it must be a comma.
@JohnnyCena123 Added some code reviews. Did you test the changes? There is a windows_config_flags example to test some of them... |
No description provided.