-
-
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?
Changes from 4 commits
70a06f9
bcde288
fa4f7a2
c10e307
b079182
a49f79b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -796,10 +796,10 @@ int InitPlatform(void) | |
//AConfiguration_getScreenLong(platform.app->config); | ||
|
||
// Set some default window flags | ||
CORE.Window.flags &= ~FLAG_WINDOW_HIDDEN; // false | ||
CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // false | ||
CORE.Window.flags |= FLAG_WINDOW_MAXIMIZED; // true | ||
CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; // false | ||
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_HIDDEN); // false | ||
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MINIMIZED); // false | ||
FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // true | ||
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // false | ||
//---------------------------------------------------------------------------- | ||
|
||
// Initialize App command system | ||
|
@@ -883,11 +883,11 @@ void ClosePlatform(void) | |
static int InitGraphicsDevice(void) | ||
{ | ||
CORE.Window.fullscreen = true; | ||
CORE.Window.flags |= FLAG_FULLSCREEN_MODE; | ||
FLAG_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE); | ||
|
||
EGLint samples = 0; | ||
EGLint sampleBuffer = 0; | ||
if (CORE.Window.flags & FLAG_MSAA_4X_HINT) | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_MSAA_4X_HINT)) | ||
{ | ||
samples = 4; | ||
sampleBuffer = 1; | ||
|
@@ -992,7 +992,7 @@ static int InitGraphicsDevice(void) | |
|
||
CORE.Window.ready = true; | ||
|
||
if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) MinimizeWindow(); | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED)) MinimizeWindow(); | ||
|
||
return 0; | ||
} | ||
|
@@ -1059,7 +1059,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) | |
// Set font white rectangle for shapes drawing, so shapes and text can be batched together | ||
// WARNING: rshapes module is required, if not available, default internal white rectangle is used | ||
Rectangle rec = GetFontDefault().recs[95]; | ||
if (CORE.Window.flags & FLAG_MSAA_4X_HINT) | ||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_MSAA_4X_HINT)) | ||
{ | ||
// NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering | ||
SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 }); | ||
|
@@ -1102,14 +1102,14 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) | |
case APP_CMD_GAINED_FOCUS: | ||
{ | ||
platform.appEnabled = true; | ||
CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; | ||
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); | ||
//ResumeMusicStream(); | ||
} break; | ||
case APP_CMD_PAUSE: break; | ||
case APP_CMD_LOST_FOCUS: | ||
{ | ||
platform.appEnabled = false; | ||
CORE.Window.flags |= FLAG_WINDOW_UNFOCUSED; | ||
FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); | ||
//PauseMusicStream(); | ||
} break; | ||
case APP_CMD_TERM_WINDOW: | ||
|
@@ -1187,8 +1187,8 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) | |
|
||
if (type == AINPUT_EVENT_TYPE_MOTION) | ||
{ | ||
if (((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) || | ||
((source & AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD)) | ||
if ((FLAG_IS_SET(source, AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) || | ||
(FLAG_IS_SET(source, AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD)) | ||
{ | ||
// For now we'll assume a single gamepad which we "detect" on its input event | ||
CORE.Input.Gamepad.ready[0] = true; | ||
|
@@ -1251,8 +1251,8 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) | |
//int32_t AKeyEvent_getMetaState(event); | ||
|
||
// Handle gamepad button presses and releases | ||
if (((source & AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) || | ||
((source & AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD)) | ||
if ((FLAG_IS_SET(source, AINPUT_SOURCE_JOYSTICK) == AINPUT_SOURCE_JOYSTICK) || | ||
|
||
(FLAG_IS_SET(source, AINPUT_SOURCE_GAMEPAD) == AINPUT_SOURCE_GAMEPAD)) | ||
{ | ||
// For now we'll assume a single gamepad which we "detect" on its input event | ||
CORE.Input.Gamepad.ready[0] = true; | ||
|
Large diffs are not rendered by default.
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.
Is it needed the extra
==
check if we already check for the flag set?