(API Change) Rename obs_sceneitem_info structure

Change obs_sceneitem_info structure to obs_transform_info - this
structure will not just be used with scene items in the future.
This commit is contained in:
jp9000 2014-08-01 23:33:45 -07:00
parent 2f21e2a450
commit 24bd82a09c
4 changed files with 20 additions and 20 deletions

View file

@ -837,7 +837,7 @@ void obs_sceneitem_get_bounds(obs_sceneitem_t item, struct vec2 *bounds)
}
void obs_sceneitem_get_info(obs_sceneitem_t item,
struct obs_sceneitem_info *info)
struct obs_transform_info *info)
{
if (item && info) {
info->pos = item->pos;
@ -851,7 +851,7 @@ void obs_sceneitem_get_info(obs_sceneitem_t item,
}
void obs_sceneitem_set_info(obs_sceneitem_t item,
const struct obs_sceneitem_info *info)
const struct obs_transform_info *info)
{
if (item && info) {
item->pos = info->pos;

View file

@ -106,7 +106,7 @@ enum obs_bounds_type {
OBS_BOUNDS_MAX_ONLY, /**< no scaling, maximum size only */
};
struct obs_sceneitem_info {
struct obs_transform_info {
struct vec2 pos;
float rot;
struct vec2 scale;
@ -827,9 +827,9 @@ EXPORT uint32_t obs_sceneitem_get_bounds_alignment(obs_sceneitem_t item);
EXPORT void obs_sceneitem_get_bounds(obs_sceneitem_t item, struct vec2 *bounds);
EXPORT void obs_sceneitem_get_info(obs_sceneitem_t item,
struct obs_sceneitem_info *info);
struct obs_transform_info *info);
EXPORT void obs_sceneitem_set_info(obs_sceneitem_t item,
const struct obs_sceneitem_info *info);
const struct obs_transform_info *info);
EXPORT void obs_sceneitem_get_draw_transform(obs_sceneitem_t item,
struct matrix4 *transform);

View file

@ -2124,7 +2124,7 @@ void OBSBasic::on_actionResetTransform_triggered()
if (!obs_sceneitem_selected(item))
return true;
obs_sceneitem_info info;
obs_transform_info info;
vec2_set(&info.pos, 0.0f, 0.0f);
vec2_set(&info.scale, 1.0f, 1.0f);
info.rot = 0.0f;
@ -2272,7 +2272,7 @@ static bool CenterAlignSelectedItems(obs_scene_t scene, obs_sceneitem_t item,
obs_video_info ovi;
obs_get_video_info(&ovi);
obs_sceneitem_info itemInfo;
obs_transform_info itemInfo;
vec2_set(&itemInfo.pos, 0.0f, 0.0f);
vec2_set(&itemInfo.scale, 1.0f, 1.0f);
itemInfo.alignment = OBS_ALIGN_LEFT | OBS_ALIGN_TOP;

View file

@ -180,7 +180,7 @@ void OBSBasicTransform::RefreshControls()
if (!item)
return;
obs_sceneitem_info osi;
obs_transform_info osi;
obs_sceneitem_get_info(item, &osi);
obs_source_t source = obs_sceneitem_getsource(item);
@ -241,20 +241,20 @@ void OBSBasicTransform::OnControlChanged()
double width = double(obs_source_getwidth(source));
double height = double(obs_source_getheight(source));
obs_sceneitem_info osi;
osi.pos.x = float(ui->positionX->value());
osi.pos.y = float(ui->positionY->value());
osi.rot = float(ui->rotation->value());
osi.scale.x = float(ui->sizeX->value() / width);
osi.scale.y = float(ui->sizeY->value() / height);
osi.alignment = listToAlign[ui->align->currentIndex()];
obs_transform_info oti;
oti.pos.x = float(ui->positionX->value());
oti.pos.y = float(ui->positionY->value());
oti.rot = float(ui->rotation->value());
oti.scale.x = float(ui->sizeX->value() / width);
oti.scale.y = float(ui->sizeY->value() / height);
oti.alignment = listToAlign[ui->align->currentIndex()];
osi.bounds_type = (obs_bounds_type)ui->boundsType->currentIndex();
osi.bounds_alignment = listToAlign[ui->boundsAlign->currentIndex()];
osi.bounds.x = float(ui->boundsWidth->value());
osi.bounds.y = float(ui->boundsHeight->value());
oti.bounds_type = (obs_bounds_type)ui->boundsType->currentIndex();
oti.bounds_alignment = listToAlign[ui->boundsAlign->currentIndex()];
oti.bounds.x = float(ui->boundsWidth->value());
oti.bounds.y = float(ui->boundsHeight->value());
ignoreTransformSignal = true;
obs_sceneitem_set_info(item, &osi);
obs_sceneitem_set_info(item, &oti);
ignoreTransformSignal = false;
}