Prepare for deprecations in OBS 31

See https://github.com/obsproject/obs-studio/pull/11164
This commit is contained in:
WarmUpTill 2024-08-25 12:49:13 +02:00 committed by WarmUpTill
parent c1ac9bb890
commit 354880ad52
5 changed files with 27 additions and 8 deletions

View File

@ -430,8 +430,7 @@ if(NOT OS_WINDOWS)
target_compile_options(
${LIB_NAME}
PUBLIC -Wno-error=unused-parameter -Wno-error=conversion -Wno-error=shadow
-Wno-error=float-conversion -Wno-error=enum-conversion
-Wno-error=deprecated-declarations)
-Wno-error=float-conversion -Wno-error=enum-conversion)
endif()
# --- End of section ---

View File

@ -93,7 +93,11 @@ static void reset(obs_sceneitem_t *item)
info.bounds_type = OBS_BOUNDS_NONE;
info.bounds_alignment = OBS_ALIGN_CENTER;
vec2_set(&info.bounds, 0.0f, 0.0f);
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 1, 0))
obs_sceneitem_set_info2(item, &info);
#else
obs_sceneitem_set_info(item, &info);
#endif
obs_sceneitem_crop crop = {};
obs_sceneitem_set_crop(item, &crop);
@ -140,7 +144,11 @@ static void centerAlign(obs_sceneitem_t *item, obs_bounds_type boundsType)
itemInfo.bounds_type = boundsType;
itemInfo.bounds_alignment = OBS_ALIGN_CENTER;
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 1, 0))
obs_sceneitem_set_info2(item, &itemInfo);
#else
obs_sceneitem_set_info(item, &itemInfo);
#endif
}
enum class CenterType {
@ -241,7 +249,11 @@ void MacroActionSceneTransform::Transform(obs_scene_item *item)
case Action::MANUAL_TRANSFORM:
ApplySettings(_transformString); // Resolves variables
obs_sceneitem_defer_update_begin(item);
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 1, 0))
obs_sceneitem_set_info2(item, &_info);
#else
obs_sceneitem_set_info(item, &_info);
#endif
obs_sceneitem_set_crop(item, &_crop);
obs_sceneitem_defer_update_end(item);
break;

View File

@ -15,7 +15,11 @@ std::string GetSceneItemTransform(obs_scene_item *item)
{
struct obs_transform_info info;
struct obs_sceneitem_crop crop;
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 1, 0))
obs_sceneitem_get_info2(item, &info);
#else
obs_sceneitem_get_info(item, &info);
#endif
obs_sceneitem_get_crop(item, &crop);
auto size = getSceneItemSize(item);

View File

@ -181,7 +181,11 @@ void SetTransformSetting(obs_scene_item *source,
struct obs_transform_info info = {};
struct obs_sceneitem_crop crop = {};
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 1, 0))
obs_sceneitem_get_info2(source, &info);
#else
obs_sceneitem_get_info(source, &info);
#endif
obs_sceneitem_get_crop(source, &crop);
if (id == "alignment") {
@ -260,7 +264,11 @@ void SetTransformSetting(obs_scene_item *source,
}
obs_sceneitem_defer_update_begin(source);
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 1, 0))
obs_sceneitem_set_info2(source, &info);
#else
obs_sceneitem_set_info(source, &info);
#endif
obs_sceneitem_set_crop(source, &crop);
obs_sceneitem_defer_update_end(source);
obs_sceneitem_force_update_transform(source);

View File

@ -26,12 +26,8 @@ if(OS_WINDOWS)
else()
target_compile_options(
libremidi
PUBLIC -Wno-error=conversion
-Wno-error=unused-result
-Wno-error=shadow
-Wno-error=unused-parameter
-Wno-error=unused-variable
-Wno-error=deprecated-declarations
PUBLIC -Wno-error=conversion -Wno-error=unused-result -Wno-error=shadow
-Wno-error=unused-parameter -Wno-error=unused-variable
-Wno-error=sign-compare)
if(OS_MACOS)
target_compile_options(libremidi PUBLIC -Wno-error=vla-extension)