Cleanup: Formatting
Run `make format` after the library update in the previous commit.
This commit is contained in:
@@ -593,7 +593,7 @@ typedef enum {
|
||||
} GHOST_TKey;
|
||||
|
||||
#define GHOST_KEY_MODIFIER_NUM ((_GHOST_KEY_MODIFIER_MAX - _GHOST_KEY_MODIFIER_MIN) + 1)
|
||||
#define GHOST_KEY_MODIFIER_TO_INDEX(key) ((unsigned int)(key)-_GHOST_KEY_MODIFIER_MIN)
|
||||
#define GHOST_KEY_MODIFIER_TO_INDEX(key) ((unsigned int)(key) - _GHOST_KEY_MODIFIER_MIN)
|
||||
#define GHOST_KEY_MODIFIER_FROM_INDEX(key) \
|
||||
(GHOST_TKey)(((unsigned int)(key) + _GHOST_KEY_MODIFIER_MIN))
|
||||
#define GHOST_KEY_MODIFIER_CHECK(key) (GHOST_KEY_MODIFIER_TO_INDEX(key) < GHOST_KEY_MODIFIER_NUM)
|
||||
@@ -825,22 +825,24 @@ typedef struct {
|
||||
|
||||
#define GHOST_CONTEXT_PARAMS_NONE \
|
||||
{ \
|
||||
/*is_stereo_visual*/ false, /*is_debug*/ false, /*vsync*/ GHOST_kVSyncModeUnset, \
|
||||
/*is_stereo_visual*/ false, \
|
||||
/*is_debug*/ false, \
|
||||
/*vsync*/ GHOST_kVSyncModeUnset, \
|
||||
}
|
||||
|
||||
#define GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS_OFFSCREEN(gpu_settings) \
|
||||
{ \
|
||||
/*is_stereo_visual*/ false, \
|
||||
/*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), \
|
||||
/*vsync*/ GHOST_kVSyncModeUnset, \
|
||||
/*is_stereo_visual*/ false, \
|
||||
/*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), \
|
||||
/*vsync*/ GHOST_kVSyncModeUnset, \
|
||||
}
|
||||
|
||||
#define GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS(gpu_settings) \
|
||||
{ \
|
||||
/*is_stereo_visual*/ (((gpu_settings).flags & GHOST_gpuStereoVisual) != 0), \
|
||||
/*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), /*vsync*/ \
|
||||
(((gpu_settings).flags & GHOST_gpuVSyncIsOverridden) ? (gpu_settings).vsync : \
|
||||
GHOST_kVSyncModeUnset), \
|
||||
/*is_stereo_visual*/ (((gpu_settings).flags & GHOST_gpuStereoVisual) != 0), \
|
||||
/*is_debug*/ (((gpu_settings).flags & GHOST_gpuDebugContext) != 0), /*vsync*/ \
|
||||
(((gpu_settings).flags & GHOST_gpuVSyncIsOverridden) ? (gpu_settings).vsync : \
|
||||
GHOST_kVSyncModeUnset), \
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -869,7 +871,9 @@ typedef struct {
|
||||
|
||||
#define GHOST_WINDOW_HDR_INFO_NONE \
|
||||
{ \
|
||||
/*hdr_enabled*/ false, /*wide_gamut_enabled*/ false, /*sdr_white_level*/ 1.0f, \
|
||||
/*hdr_enabled*/ false, \
|
||||
/*wide_gamut_enabled*/ false, \
|
||||
/*sdr_white_level*/ 1.0f, \
|
||||
}
|
||||
|
||||
#ifdef WITH_VULKAN_BACKEND
|
||||
|
||||
@@ -177,5 +177,5 @@ class GHOST_ContextMTL : public GHOST_Context {
|
||||
void metalInitFramebuffer();
|
||||
void metalUpdateFramebuffer();
|
||||
void metalSwapBuffers();
|
||||
void initClear(){};
|
||||
void initClear() {};
|
||||
};
|
||||
|
||||
@@ -41,10 +41,7 @@ static const char *ndof_progress_string[] = {
|
||||
};
|
||||
|
||||
/* Printable values for #NDOF_ButtonT enum (keep aligned) */
|
||||
#define MAP_ENTRY(button) \
|
||||
{ \
|
||||
GHOST_##button, #button \
|
||||
}
|
||||
#define MAP_ENTRY(button) {GHOST_##button, #button}
|
||||
static const std::map<GHOST_NDOF_ButtonT, const char *> ndof_button_names = {
|
||||
/* Disable wrapping, it makes it difficult to read. */
|
||||
/* clang-format off */
|
||||
|
||||
@@ -149,7 +149,7 @@ struct GWL_Output {
|
||||
class GHOST_SystemWayland : public GHOST_System {
|
||||
public:
|
||||
GHOST_SystemWayland(bool background);
|
||||
GHOST_SystemWayland() : GHOST_SystemWayland(true){};
|
||||
GHOST_SystemWayland() : GHOST_SystemWayland(true) {};
|
||||
|
||||
~GHOST_SystemWayland() override;
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ void GHOST_XrAction::updateState(XrSession session,
|
||||
(std::string("Failed to get state for vector2f action \"") + action_name + "\".")
|
||||
.data());
|
||||
if (state.isActive) {
|
||||
memcpy(((float(*)[2])states_)[subaction_idx], &state.currentState, sizeof(float[2]));
|
||||
memcpy(((float (*)[2])states_)[subaction_idx], &state.currentState, sizeof(float[2]));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -219,13 +219,13 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
|
||||
GL_RGB10_A2,
|
||||
GL_RGBA16,
|
||||
# endif
|
||||
GL_RGBA16F,
|
||||
GL_RGBA16F,
|
||||
# if 1
|
||||
GL_RGB10_A2,
|
||||
GL_RGBA16,
|
||||
GL_RGB10_A2,
|
||||
GL_RGBA16,
|
||||
# endif
|
||||
GL_RGBA8,
|
||||
GL_SRGB8_ALPHA8,
|
||||
GL_RGBA8,
|
||||
GL_SRGB8_ALPHA8,
|
||||
};
|
||||
|
||||
std::optional result = choose_swapchain_format_from_candidates(gpu_binding_formats,
|
||||
|
||||
@@ -139,13 +139,13 @@ std::optional<int64_t> GHOST_XrGraphicsBindingD3D::chooseSwapchainFormat(
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM,
|
||||
#endif
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
#if 1
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM,
|
||||
#endif
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
|
||||
};
|
||||
|
||||
std::optional result = choose_swapchain_format_from_candidates(gpu_binding_formats,
|
||||
|
||||
Reference in New Issue
Block a user