Cleanup: use 'r_' prefix for output arguments, order last
Also clarify some naming.
This commit is contained in:
parent
2c2bd7d1e3
commit
3b5031f1cb
|
@ -717,11 +717,11 @@ extern GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int
|
|||
/**
|
||||
* Gets the current swap interval for #swapBuffers.
|
||||
* \param windowhandle: The handle to the window
|
||||
* \param intervalOut: pointer to location to return swap interval
|
||||
* \param r_interval: pointer to location to return swap interval
|
||||
* (left untouched if there is an error)
|
||||
* \return A boolean success indicator of if swap interval was successfully read.
|
||||
*/
|
||||
extern GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *intervalOut);
|
||||
extern GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *r_interval);
|
||||
|
||||
/**
|
||||
* Activates the drawing context of this window.
|
||||
|
|
|
@ -715,11 +715,11 @@ GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int interv
|
|||
return window->setSwapInterval(interval);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *intervalOut)
|
||||
GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *r_interval)
|
||||
{
|
||||
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
|
||||
|
||||
return window->getSwapInterval(*intervalOut);
|
||||
return window->getSwapInterval(*r_interval);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
|
||||
|
|
|
@ -316,8 +316,8 @@ bool BKE_library_ID_is_indirectly_used(struct Main *bmain, void *idv);
|
|||
*/
|
||||
void BKE_library_ID_test_usages(struct Main *bmain,
|
||||
void *idv,
|
||||
bool *is_used_local,
|
||||
bool *is_used_linked);
|
||||
bool *r_is_used_local,
|
||||
bool *r_is_used_linked);
|
||||
|
||||
/**
|
||||
* Tag all unused IDs (a.k.a 'orphaned').
|
||||
|
|
|
@ -46,21 +46,21 @@ struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip,
|
|||
int postprocess_flag);
|
||||
struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip,
|
||||
const struct MovieClipUser *user,
|
||||
float loc[2],
|
||||
float *scale,
|
||||
float *angle,
|
||||
int postprocess_flag);
|
||||
int postprocess_flag,
|
||||
float r_loc[2],
|
||||
float *r_scale,
|
||||
float *r_angle);
|
||||
struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip,
|
||||
const struct MovieClipUser *user,
|
||||
int flag,
|
||||
int cache_flag);
|
||||
void BKE_movieclip_get_size(struct MovieClip *clip,
|
||||
const struct MovieClipUser *user,
|
||||
int *width,
|
||||
int *height);
|
||||
int *r_width,
|
||||
int *r_height);
|
||||
void BKE_movieclip_get_size_fl(struct MovieClip *clip,
|
||||
const struct MovieClipUser *user,
|
||||
float size[2]);
|
||||
float r_size[2]);
|
||||
int BKE_movieclip_get_duration(struct MovieClip *clip);
|
||||
float BKE_movieclip_get_fps(struct MovieClip *clip);
|
||||
void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy);
|
||||
|
|
|
@ -219,7 +219,7 @@ static Collection *gpencil_get_parent_collection(Scene *scene, Object *ob)
|
|||
return mycol;
|
||||
}
|
||||
static int gpencil_get_stroke_material_fromcurve(
|
||||
Main *bmain, Object *ob_gp, Object *ob_cu, bool *do_stroke, bool *do_fill)
|
||||
Main *bmain, Object *ob_gp, Object *ob_cu, bool *r_do_stroke, bool *r_do_fill)
|
||||
{
|
||||
Curve *cu = (Curve *)ob_cu->data;
|
||||
|
||||
|
@ -234,21 +234,21 @@ static int gpencil_get_stroke_material_fromcurve(
|
|||
* If the has only one material, if the name contains "_stroke",
|
||||
* it's used as a stroke, otherwise as fill. */
|
||||
if (ob_cu->totcol >= 2) {
|
||||
*do_stroke = true;
|
||||
*do_fill = true;
|
||||
*r_do_stroke = true;
|
||||
*r_do_fill = true;
|
||||
mat_curve_fill = BKE_object_material_get(ob_cu, 1);
|
||||
mat_curve_stroke = BKE_object_material_get(ob_cu, 2);
|
||||
}
|
||||
else if (ob_cu->totcol == 1) {
|
||||
mat_curve_stroke = BKE_object_material_get(ob_cu, 1);
|
||||
if ((mat_curve_stroke) && (strstr(mat_curve_stroke->id.name, "_stroke") != nullptr)) {
|
||||
*do_stroke = true;
|
||||
*do_fill = false;
|
||||
*r_do_stroke = true;
|
||||
*r_do_fill = false;
|
||||
mat_curve_fill = nullptr;
|
||||
}
|
||||
else {
|
||||
*do_stroke = false;
|
||||
*do_fill = true;
|
||||
*r_do_stroke = false;
|
||||
*r_do_fill = true;
|
||||
/* Invert materials. */
|
||||
mat_curve_fill = mat_curve_stroke;
|
||||
mat_curve_stroke = nullptr;
|
||||
|
@ -256,7 +256,7 @@ static int gpencil_get_stroke_material_fromcurve(
|
|||
}
|
||||
else {
|
||||
/* No materials in the curve. */
|
||||
*do_fill = false;
|
||||
*r_do_fill = false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -268,11 +268,11 @@ static int gpencil_get_stroke_material_fromcurve(
|
|||
}
|
||||
|
||||
int r_idx = gpencil_check_same_material_color(
|
||||
ob_gp, color_stroke, color_fill, *do_stroke, *do_fill, &mat_gp);
|
||||
ob_gp, color_stroke, color_fill, *r_do_stroke, *r_do_fill, &mat_gp);
|
||||
|
||||
if ((ob_gp->totcol < r_idx) || (r_idx < 0)) {
|
||||
mat_gp = gpencil_add_from_curve_material(
|
||||
bmain, ob_gp, color_stroke, color_fill, *do_stroke, *do_fill, &r_idx);
|
||||
bmain, ob_gp, color_stroke, color_fill, *r_do_stroke, *r_do_fill, &r_idx);
|
||||
}
|
||||
|
||||
/* Set fill and stroke depending of curve type (3D or 2D). */
|
||||
|
|
|
@ -4828,17 +4828,16 @@ void BKE_image_pool_free(ImagePool *pool)
|
|||
}
|
||||
|
||||
BLI_INLINE ImBuf *image_pool_find_item(
|
||||
ImagePool *pool, Image *image, int entry, int index, bool *found)
|
||||
ImagePool *pool, Image *image, int entry, int index, bool *r_found)
|
||||
{
|
||||
*found = false;
|
||||
|
||||
LISTBASE_FOREACH (ImagePoolItem *, item, &pool->image_buffers) {
|
||||
if (item->image == image && item->entry == entry && item->index == index) {
|
||||
*found = true;
|
||||
*r_found = true;
|
||||
return item->ibuf;
|
||||
}
|
||||
}
|
||||
|
||||
*r_found = false;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -238,80 +238,80 @@ static AdrBit2Path *adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *to
|
|||
/* ADRCODE to RNA-Path Conversion Code - Standard */
|
||||
|
||||
/* Object types */
|
||||
static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *ob_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
case OB_LOC_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "location";
|
||||
case OB_LOC_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "location";
|
||||
case OB_LOC_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "location";
|
||||
case OB_DLOC_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "delta_location";
|
||||
case OB_DLOC_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "delta_location";
|
||||
case OB_DLOC_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "delta_location";
|
||||
|
||||
case OB_ROT_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "rotation_euler";
|
||||
case OB_ROT_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "rotation_euler";
|
||||
case OB_ROT_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "rotation_euler";
|
||||
case OB_DROT_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "delta_rotation_euler";
|
||||
case OB_DROT_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "delta_rotation_euler";
|
||||
case OB_DROT_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "delta_rotation_euler";
|
||||
|
||||
case OB_SIZE_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "scale";
|
||||
case OB_SIZE_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "scale";
|
||||
case OB_SIZE_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "scale";
|
||||
case OB_DSIZE_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "delta_scale";
|
||||
case OB_DSIZE_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "delta_scale";
|
||||
case OB_DSIZE_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "delta_scale";
|
||||
case OB_COL_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "color";
|
||||
case OB_COL_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "color";
|
||||
case OB_COL_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "color";
|
||||
case OB_COL_A:
|
||||
*array_index = 3;
|
||||
*r_array_index = 3;
|
||||
return "color";
|
||||
#if 0
|
||||
case OB_PD_FSTR:
|
||||
|
@ -353,54 +353,54 @@ static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
/* PoseChannel types
|
||||
* NOTE: pchan name comes from 'actname' added earlier...
|
||||
*/
|
||||
static const char *pchan_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *pchan_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
case AC_QUAT_W:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "rotation_quaternion";
|
||||
case AC_QUAT_X:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "rotation_quaternion";
|
||||
case AC_QUAT_Y:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "rotation_quaternion";
|
||||
case AC_QUAT_Z:
|
||||
*array_index = 3;
|
||||
*r_array_index = 3;
|
||||
return "rotation_quaternion";
|
||||
|
||||
case AC_EUL_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "rotation_euler";
|
||||
case AC_EUL_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "rotation_euler";
|
||||
case AC_EUL_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "rotation_euler";
|
||||
|
||||
case AC_LOC_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "location";
|
||||
case AC_LOC_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "location";
|
||||
case AC_LOC_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "location";
|
||||
|
||||
case AC_SIZE_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "scale";
|
||||
case AC_SIZE_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "scale";
|
||||
case AC_SIZE_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "scale";
|
||||
}
|
||||
|
||||
|
@ -410,10 +410,10 @@ static const char *pchan_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
}
|
||||
|
||||
/* Constraint types */
|
||||
static const char *constraint_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *constraint_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
|
@ -431,7 +431,7 @@ static const char *constraint_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
* NOTE: as we don't have access to the keyblock where the data comes from (for now),
|
||||
* we'll just use numerical indices for now...
|
||||
*/
|
||||
static char *shapekey_adrcodes_to_paths(ID *id, int adrcode, int * /*array_index*/)
|
||||
static char *shapekey_adrcodes_to_paths(ID *id, int adrcode, int * /*r_array_index*/)
|
||||
{
|
||||
static char buf[128];
|
||||
|
||||
|
@ -461,7 +461,7 @@ static char *shapekey_adrcodes_to_paths(ID *id, int adrcode, int * /*array_index
|
|||
}
|
||||
|
||||
/* MTex (Texture Slot) types */
|
||||
static const char *mtex_adrcodes_to_paths(int adrcode, int * /*array_index*/)
|
||||
static const char *mtex_adrcodes_to_paths(int adrcode, int * /*r_array_index*/)
|
||||
{
|
||||
const char *base = nullptr, *prop = nullptr;
|
||||
static char buf[128];
|
||||
|
@ -581,10 +581,10 @@ static const char *mtex_adrcodes_to_paths(int adrcode, int * /*array_index*/)
|
|||
}
|
||||
|
||||
/* Texture types */
|
||||
static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *texture_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
|
@ -607,16 +607,16 @@ static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
|
||||
/* voronoi */
|
||||
case TE_VNW1:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "feature_weights";
|
||||
case TE_VNW2:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "feature_weights";
|
||||
case TE_VNW3:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "feature_weights";
|
||||
case TE_VNW4:
|
||||
*array_index = 3;
|
||||
*r_array_index = 3;
|
||||
return "feature_weights";
|
||||
case TE_VNMEXP:
|
||||
return "minkovsky_exponent";
|
||||
|
@ -649,13 +649,13 @@ static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
return "gain";
|
||||
|
||||
case TE_COL_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "rgb_factor";
|
||||
case TE_COL_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "rgb_factor";
|
||||
case TE_COL_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "rgb_factor";
|
||||
|
||||
case TE_BRIGHT:
|
||||
|
@ -668,41 +668,41 @@ static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
}
|
||||
|
||||
/* Material Types */
|
||||
static const char *material_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *material_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
case MA_COL_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "diffuse_color";
|
||||
case MA_COL_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "diffuse_color";
|
||||
case MA_COL_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "diffuse_color";
|
||||
|
||||
case MA_SPEC_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "specular_color";
|
||||
case MA_SPEC_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "specular_color";
|
||||
case MA_SPEC_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "specular_color";
|
||||
|
||||
case MA_MIR_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "mirror_color";
|
||||
case MA_MIR_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "mirror_color";
|
||||
case MA_MIR_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "mirror_color";
|
||||
|
||||
case MA_ALPHA:
|
||||
|
@ -754,17 +754,17 @@ static const char *material_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
return "halo.add";
|
||||
|
||||
default: /* for now, we assume that the others were MTex channels */
|
||||
return mtex_adrcodes_to_paths(adrcode, array_index);
|
||||
return mtex_adrcodes_to_paths(adrcode, r_array_index);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Camera Types */
|
||||
static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *camera_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
|
@ -806,10 +806,10 @@ static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
}
|
||||
|
||||
/* Light Types */
|
||||
static const char *light_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *light_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
|
@ -817,13 +817,13 @@ static const char *light_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
return "energy";
|
||||
|
||||
case LA_COL_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "color";
|
||||
case LA_COL_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "color";
|
||||
case LA_COL_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "color";
|
||||
|
||||
case LA_DIST:
|
||||
|
@ -843,7 +843,7 @@ static const char *light_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
return "halo_intensity";
|
||||
|
||||
default: /* for now, we assume that the others were MTex channels */
|
||||
return mtex_adrcodes_to_paths(adrcode, array_index);
|
||||
return mtex_adrcodes_to_paths(adrcode, r_array_index);
|
||||
}
|
||||
|
||||
/* unrecognized adrcode, or not-yet-handled ones! */
|
||||
|
@ -851,10 +851,10 @@ static const char *light_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
}
|
||||
|
||||
/* Sound Types */
|
||||
static const char *sound_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *sound_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
|
@ -877,30 +877,30 @@ static const char *sound_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
}
|
||||
|
||||
/* World Types */
|
||||
static const char *world_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *world_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
case WO_HOR_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "horizon_color";
|
||||
case WO_HOR_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "horizon_color";
|
||||
case WO_HOR_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "horizon_color";
|
||||
case WO_ZEN_R:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "zenith_color";
|
||||
case WO_ZEN_G:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "zenith_color";
|
||||
case WO_ZEN_B:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "zenith_color";
|
||||
|
||||
case WO_EXPOS:
|
||||
|
@ -916,17 +916,17 @@ static const char *world_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
return "mist.height";
|
||||
|
||||
default: /* for now, we assume that the others were MTex channels */
|
||||
return mtex_adrcodes_to_paths(adrcode, array_index);
|
||||
return mtex_adrcodes_to_paths(adrcode, r_array_index);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Particle Types */
|
||||
static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
|
||||
static const char *particle_adrcodes_to_paths(int adrcode, int *r_array_index)
|
||||
{
|
||||
/* Set array index like this in-case nothing sets it correctly. */
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
|
||||
/* result depends on adrcode */
|
||||
switch (adrcode) {
|
||||
|
@ -945,13 +945,13 @@ static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
case PART_LENGTH:
|
||||
return "settings.length";
|
||||
case PART_GRAV_X:
|
||||
*array_index = 0;
|
||||
*r_array_index = 0;
|
||||
return "settings.acceleration";
|
||||
case PART_GRAV_Y:
|
||||
*array_index = 1;
|
||||
*r_array_index = 1;
|
||||
return "settings.acceleration";
|
||||
case PART_GRAV_Z:
|
||||
*array_index = 2;
|
||||
*r_array_index = 2;
|
||||
return "settings.acceleration";
|
||||
case PART_KINK_AMP:
|
||||
return "settings.kink_amplitude";
|
||||
|
@ -1015,7 +1015,7 @@ static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
* - blocktype, adrcode - determines setting to get
|
||||
* - actname, constname, seq - used to build path
|
||||
* Output:
|
||||
* - array_index - index in property's array (if applicable) to use
|
||||
* - r_array_index - index in property's array (if applicable) to use
|
||||
* - return - the allocated path...
|
||||
*/
|
||||
static char *get_rna_access(ID *id,
|
||||
|
@ -1024,7 +1024,7 @@ static char *get_rna_access(ID *id,
|
|||
char actname[],
|
||||
char constname[],
|
||||
Sequence *seq,
|
||||
int *array_index)
|
||||
int *r_array_index)
|
||||
{
|
||||
DynStr *path = BLI_dynstr_new();
|
||||
const char *propname = nullptr;
|
||||
|
@ -1125,8 +1125,8 @@ static char *get_rna_access(ID *id,
|
|||
*/
|
||||
if ((propname == nullptr) && (blocktype > 0)) {
|
||||
/* nothing was found, so exit */
|
||||
if (array_index) {
|
||||
*array_index = 0;
|
||||
if (r_array_index) {
|
||||
*r_array_index = 0;
|
||||
}
|
||||
|
||||
BLI_dynstr_free(path);
|
||||
|
@ -1134,8 +1134,8 @@ static char *get_rna_access(ID *id,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (array_index) {
|
||||
*array_index = dummy_index;
|
||||
if (r_array_index) {
|
||||
*r_array_index = dummy_index;
|
||||
}
|
||||
|
||||
/* 'buf' _must_ be initialized in this block */
|
||||
|
@ -1193,7 +1193,7 @@ static char *get_rna_access(ID *id,
|
|||
BLI_dynstr_append(path, propname);
|
||||
|
||||
/* if there was no array index pointer provided, add it to the path */
|
||||
if (array_index == nullptr) {
|
||||
if (r_array_index == nullptr) {
|
||||
SNPRINTF(buf, "[\"%d\"]", dummy_index);
|
||||
BLI_dynstr_append(path, buf);
|
||||
}
|
||||
|
|
|
@ -641,34 +641,35 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **
|
|||
return static_cast<char *>(kb->data);
|
||||
}
|
||||
|
||||
/* currently only the first value of 'ofs' may be set. */
|
||||
static bool key_pointer_size(const Key *key, const int mode, int *poinsize, int *ofs, int *step)
|
||||
/* currently only the first value of 'r_ofs' may be set. */
|
||||
static bool key_pointer_size(
|
||||
const Key *key, const int mode, int *r_poinsize, int *r_ofs, int *r_step)
|
||||
{
|
||||
if (key->from == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*step = 1;
|
||||
*r_step = 1;
|
||||
|
||||
switch (GS(key->from->name)) {
|
||||
case ID_ME:
|
||||
*ofs = sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
*poinsize = *ofs;
|
||||
*r_ofs = sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
*r_poinsize = *r_ofs;
|
||||
break;
|
||||
case ID_LT:
|
||||
*ofs = sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
*poinsize = *ofs;
|
||||
*r_ofs = sizeof(float[KEYELEM_FLOAT_LEN_COORD]);
|
||||
*r_poinsize = *r_ofs;
|
||||
break;
|
||||
case ID_CU_LEGACY:
|
||||
if (mode == KEY_MODE_BPOINT) {
|
||||
*ofs = sizeof(float[KEYELEM_FLOAT_LEN_BPOINT]);
|
||||
*step = KEYELEM_ELEM_LEN_BPOINT;
|
||||
*r_ofs = sizeof(float[KEYELEM_FLOAT_LEN_BPOINT]);
|
||||
*r_step = KEYELEM_ELEM_LEN_BPOINT;
|
||||
}
|
||||
else {
|
||||
*ofs = sizeof(float[KEYELEM_FLOAT_LEN_BEZTRIPLE]);
|
||||
*step = KEYELEM_ELEM_LEN_BEZTRIPLE;
|
||||
*r_ofs = sizeof(float[KEYELEM_FLOAT_LEN_BEZTRIPLE]);
|
||||
*r_step = KEYELEM_ELEM_LEN_BEZTRIPLE;
|
||||
}
|
||||
*poinsize = sizeof(float[KEYELEM_ELEM_SIZE_CURVE]);
|
||||
*r_poinsize = sizeof(float[KEYELEM_ELEM_SIZE_CURVE]);
|
||||
break;
|
||||
default:
|
||||
BLI_assert_msg(0, "invalid 'key->from' ID type");
|
||||
|
|
|
@ -653,7 +653,10 @@ bool BKE_library_ID_is_indirectly_used(Main *bmain, void *idv)
|
|||
return library_ID_is_used(bmain, idv, true);
|
||||
}
|
||||
|
||||
void BKE_library_ID_test_usages(Main *bmain, void *idv, bool *is_used_local, bool *is_used_linked)
|
||||
void BKE_library_ID_test_usages(Main *bmain,
|
||||
void *idv,
|
||||
bool *r_is_used_local,
|
||||
bool *r_is_used_linked)
|
||||
{
|
||||
IDUsersIter iter;
|
||||
ListBase *lb_array[INDEX_ID_MAX];
|
||||
|
@ -683,8 +686,8 @@ void BKE_library_ID_test_usages(Main *bmain, void *idv, bool *is_used_local, boo
|
|||
}
|
||||
}
|
||||
|
||||
*is_used_local = (iter.count_direct != 0);
|
||||
*is_used_linked = (iter.count_indirect != 0);
|
||||
*r_is_used_local = (iter.count_direct != 0);
|
||||
*r_is_used_linked = (iter.count_indirect != 0);
|
||||
}
|
||||
|
||||
/* ***** IDs usages.checking/tagging. ***** */
|
||||
|
|
|
@ -1427,10 +1427,10 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip,
|
|||
|
||||
ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip,
|
||||
const MovieClipUser *user,
|
||||
float loc[2],
|
||||
float *scale,
|
||||
float *angle,
|
||||
const int postprocess_flag)
|
||||
const int postprocess_flag,
|
||||
float r_loc[2],
|
||||
float *r_scale,
|
||||
float *r_angle)
|
||||
{
|
||||
ImBuf *ibuf, *stableibuf = nullptr;
|
||||
int framenr = user->framenr;
|
||||
|
@ -1450,29 +1450,29 @@ ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip,
|
|||
stableibuf = put_stabilized_frame_to_cache(clip, user, ibuf, framenr, postprocess_flag);
|
||||
}
|
||||
|
||||
if (loc) {
|
||||
copy_v2_v2(loc, cache->stabilized.loc);
|
||||
if (r_loc) {
|
||||
copy_v2_v2(r_loc, cache->stabilized.loc);
|
||||
}
|
||||
|
||||
if (scale) {
|
||||
*scale = cache->stabilized.scale;
|
||||
if (r_scale) {
|
||||
*r_scale = cache->stabilized.scale;
|
||||
}
|
||||
|
||||
if (angle) {
|
||||
*angle = cache->stabilized.angle;
|
||||
if (r_angle) {
|
||||
*r_angle = cache->stabilized.angle;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (loc) {
|
||||
zero_v2(loc);
|
||||
if (r_loc) {
|
||||
zero_v2(r_loc);
|
||||
}
|
||||
|
||||
if (scale) {
|
||||
*scale = 1.0f;
|
||||
if (r_scale) {
|
||||
*r_scale = 1.0f;
|
||||
}
|
||||
|
||||
if (angle) {
|
||||
*angle = 0.0f;
|
||||
if (r_angle) {
|
||||
*r_angle = 0.0f;
|
||||
}
|
||||
|
||||
stableibuf = ibuf;
|
||||
|
@ -1498,22 +1498,25 @@ bool BKE_movieclip_has_frame(MovieClip *clip, const MovieClipUser *user)
|
|||
return false;
|
||||
}
|
||||
|
||||
void BKE_movieclip_get_size(MovieClip *clip, const MovieClipUser *user, int *width, int *height)
|
||||
void BKE_movieclip_get_size(MovieClip *clip,
|
||||
const MovieClipUser *user,
|
||||
int *r_width,
|
||||
int *r_height)
|
||||
{
|
||||
/* TODO(sergey): Support reading sequences of different resolution. */
|
||||
if (clip->lastsize[0] != 0 && clip->lastsize[1] != 0) {
|
||||
*width = clip->lastsize[0];
|
||||
*height = clip->lastsize[1];
|
||||
*r_width = clip->lastsize[0];
|
||||
*r_height = clip->lastsize[1];
|
||||
}
|
||||
else {
|
||||
ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user);
|
||||
|
||||
if (ibuf && ibuf->x && ibuf->y) {
|
||||
real_ibuf_size(clip, user, ibuf, width, height);
|
||||
real_ibuf_size(clip, user, ibuf, r_width, r_height);
|
||||
}
|
||||
else {
|
||||
*width = clip->lastsize[0];
|
||||
*height = clip->lastsize[1];
|
||||
*r_width = clip->lastsize[0];
|
||||
*r_height = clip->lastsize[1];
|
||||
}
|
||||
|
||||
if (ibuf) {
|
||||
|
@ -1521,13 +1524,13 @@ void BKE_movieclip_get_size(MovieClip *clip, const MovieClipUser *user, int *wid
|
|||
}
|
||||
}
|
||||
}
|
||||
void BKE_movieclip_get_size_fl(MovieClip *clip, const MovieClipUser *user, float size[2])
|
||||
void BKE_movieclip_get_size_fl(MovieClip *clip, const MovieClipUser *user, float r_size[2])
|
||||
{
|
||||
int width, height;
|
||||
BKE_movieclip_get_size(clip, user, &width, &height);
|
||||
|
||||
size[0] = float(width);
|
||||
size[1] = float(height);
|
||||
r_size[0] = float(width);
|
||||
r_size[1] = float(height);
|
||||
}
|
||||
|
||||
int BKE_movieclip_get_duration(MovieClip *clip)
|
||||
|
@ -1550,7 +1553,7 @@ float BKE_movieclip_get_fps(MovieClip *clip)
|
|||
}
|
||||
short frs_sec;
|
||||
float frs_sec_base;
|
||||
if (IMB_anim_get_fps(clip->anim, &frs_sec, &frs_sec_base, true)) {
|
||||
if (IMB_anim_get_fps(clip->anim, true, &frs_sec, &frs_sec_base)) {
|
||||
return float(frs_sec) / frs_sec_base;
|
||||
}
|
||||
return 0.0f;
|
||||
|
|
|
@ -1876,7 +1876,7 @@ static int ptcache_old_elemsize(PTCacheID *pid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void ptcache_find_frames_around(PTCacheID *pid, uint frame, int *fra1, int *fra2)
|
||||
static void ptcache_find_frames_around(PTCacheID *pid, uint frame, int *r_fra1, int *r_fra2)
|
||||
{
|
||||
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
|
||||
int cfra1 = frame, cfra2 = frame + 1;
|
||||
|
@ -1898,12 +1898,12 @@ static void ptcache_find_frames_around(PTCacheID *pid, uint frame, int *fra1, in
|
|||
}
|
||||
|
||||
if (cfra1 && !cfra2) {
|
||||
*fra1 = 0;
|
||||
*fra2 = cfra1;
|
||||
*r_fra1 = 0;
|
||||
*r_fra2 = cfra1;
|
||||
}
|
||||
else {
|
||||
*fra1 = cfra1;
|
||||
*fra2 = cfra2;
|
||||
*r_fra1 = cfra1;
|
||||
*r_fra2 = cfra2;
|
||||
}
|
||||
}
|
||||
else if (pid->cache->mem_cache.first) {
|
||||
|
@ -1924,12 +1924,12 @@ static void ptcache_find_frames_around(PTCacheID *pid, uint frame, int *fra1, in
|
|||
}
|
||||
|
||||
if (!pm2) {
|
||||
*fra1 = 0;
|
||||
*fra2 = pm->frame;
|
||||
*r_fra1 = 0;
|
||||
*r_fra2 = pm->frame;
|
||||
}
|
||||
else {
|
||||
*fra1 = pm->frame;
|
||||
*fra2 = pm2->frame;
|
||||
*r_fra1 = pm->frame;
|
||||
*r_fra2 = pm2->frame;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -896,14 +896,14 @@ bool BLI_path_parent_dir_until_exists(char *dir)
|
|||
/**
|
||||
* Looks for a sequence of "#" characters in the last slash-separated component of `path`,
|
||||
* returning the indexes of the first and one past the last character in the sequence in
|
||||
* `char_start` and `char_end` respectively.
|
||||
* `r_char_start` and `r_char_end` respectively.
|
||||
*
|
||||
* \param char_start: The first `#` character.
|
||||
* \param char_end: The last `#` character +1.
|
||||
* \param r_char_start: The first `#` character.
|
||||
* \param r_char_end: The last `#` character +1.
|
||||
*
|
||||
* \return true if a frame sequence range was found.
|
||||
*/
|
||||
static bool path_frame_chars_find_range(const char *path, int *char_start, int *char_end)
|
||||
static bool path_frame_chars_find_range(const char *path, int *r_char_start, int *r_char_end)
|
||||
{
|
||||
uint ch_sta, ch_end, i;
|
||||
/* Insert current frame: `file###` -> `file001`. */
|
||||
|
@ -925,13 +925,13 @@ static bool path_frame_chars_find_range(const char *path, int *char_start, int *
|
|||
}
|
||||
|
||||
if (ch_end) {
|
||||
*char_start = ch_sta;
|
||||
*char_end = ch_end;
|
||||
*r_char_start = ch_sta;
|
||||
*r_char_end = ch_end;
|
||||
return true;
|
||||
}
|
||||
|
||||
*char_start = -1;
|
||||
*char_end = -1;
|
||||
*r_char_start = -1;
|
||||
*r_char_end = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -650,22 +650,22 @@ void SMAABlendingWeightCalculationOperation::get_area_of_interest(const int /*in
|
|||
/*-----------------------------------------------------------------------------*/
|
||||
/* Diagonal Search Functions */
|
||||
|
||||
int SMAABlendingWeightCalculationOperation::search_diag1(int x, int y, int dir, bool *found)
|
||||
int SMAABlendingWeightCalculationOperation::search_diag1(int x, int y, int dir, bool *r_found)
|
||||
{
|
||||
float e[4];
|
||||
int end = x + SMAA_MAX_SEARCH_STEPS_DIAG * dir;
|
||||
*found = false;
|
||||
*r_found = false;
|
||||
|
||||
while (x != end) {
|
||||
x += dir;
|
||||
y -= dir;
|
||||
sample_image_fn_(x, y, e);
|
||||
if (e[1] == 0.0f) {
|
||||
*found = true;
|
||||
*r_found = true;
|
||||
break;
|
||||
}
|
||||
if (e[0] == 0.0f) {
|
||||
*found = true;
|
||||
*r_found = true;
|
||||
return (dir < 0) ? x : x - dir;
|
||||
}
|
||||
}
|
||||
|
@ -673,23 +673,23 @@ int SMAABlendingWeightCalculationOperation::search_diag1(int x, int y, int dir,
|
|||
return x - dir;
|
||||
}
|
||||
|
||||
int SMAABlendingWeightCalculationOperation::search_diag2(int x, int y, int dir, bool *found)
|
||||
int SMAABlendingWeightCalculationOperation::search_diag2(int x, int y, int dir, bool *r_found)
|
||||
{
|
||||
float e[4];
|
||||
int end = x + SMAA_MAX_SEARCH_STEPS_DIAG * dir;
|
||||
*found = false;
|
||||
*r_found = false;
|
||||
|
||||
while (x != end) {
|
||||
x += dir;
|
||||
y += dir;
|
||||
sample_image_fn_(x, y, e);
|
||||
if (e[1] == 0.0f) {
|
||||
*found = true;
|
||||
*r_found = true;
|
||||
break;
|
||||
}
|
||||
sample_image_fn_(x + 1, y, e);
|
||||
if (e[0] == 0.0f) {
|
||||
*found = true;
|
||||
*r_found = true;
|
||||
return (dir > 0) ? x : x - dir;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,8 +98,8 @@ class SMAABlendingWeightCalculationOperation : public MultiThreadedOperation {
|
|||
/**
|
||||
* These functions allows to perform diagonal pattern searches.
|
||||
*/
|
||||
int search_diag1(int x, int y, int dir, bool *found);
|
||||
int search_diag2(int x, int y, int dir, bool *found);
|
||||
int search_diag1(int x, int y, int dir, bool *r_found);
|
||||
int search_diag2(int x, int y, int dir, bool *r_found);
|
||||
/**
|
||||
* This searches for diagonal patterns and returns the corresponding weights.
|
||||
*/
|
||||
|
|
|
@ -238,10 +238,10 @@ static void OVERLAY_cache_init(void *vedata)
|
|||
OVERLAY_volume_cache_init(data);
|
||||
}
|
||||
|
||||
BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object *ob, void *vedata, bool *do_init)
|
||||
BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object *ob, void *vedata, bool *r_do_init)
|
||||
{
|
||||
OVERLAY_DupliData **dupli_data = (OVERLAY_DupliData **)DRW_duplidata_get(vedata);
|
||||
*do_init = false;
|
||||
*r_do_init = false;
|
||||
if (!ELEM(ob->type, OB_MESH, OB_SURF, OB_LATTICE, OB_CURVES_LEGACY, OB_FONT)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -250,11 +250,11 @@ BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object *ob, void *vedata, bo
|
|||
if (*dupli_data == nullptr) {
|
||||
*dupli_data = static_cast<OVERLAY_DupliData *>(
|
||||
MEM_callocN(sizeof(OVERLAY_DupliData), __func__));
|
||||
*do_init = true;
|
||||
*r_do_init = true;
|
||||
}
|
||||
else if ((*dupli_data)->base_flag != ob->base_flag) {
|
||||
/* Select state might have change, reinitialize. */
|
||||
*do_init = true;
|
||||
*r_do_init = true;
|
||||
}
|
||||
return *dupli_data;
|
||||
}
|
||||
|
|
|
@ -66,14 +66,14 @@ bool ED_space_clip_maskedit_mask_poll(bContext *C);
|
|||
* - Mask has visible and editable splines. */
|
||||
bool ED_space_clip_maskedit_mask_visible_splines_poll(bContext *C);
|
||||
|
||||
void ED_space_clip_get_size(const SpaceClip *sc, int *width, int *height);
|
||||
void ED_space_clip_get_size_fl(const SpaceClip *sc, float size[2]);
|
||||
void ED_space_clip_get_size(const SpaceClip *sc, int *r_width, int *r_height);
|
||||
void ED_space_clip_get_size_fl(const SpaceClip *sc, float r_size[2]);
|
||||
void ED_space_clip_get_zoom(const SpaceClip *sc,
|
||||
const ARegion *region,
|
||||
float *zoomx,
|
||||
float *zoomy);
|
||||
void ED_space_clip_get_aspect(const SpaceClip *sc, float *aspx, float *aspy);
|
||||
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *aspx, float *aspy);
|
||||
float *r_zoomx,
|
||||
float *r_zoomy);
|
||||
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy);
|
||||
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *r_aspx, float *r_aspy);
|
||||
|
||||
/**
|
||||
* Return current frame number in clip space.
|
||||
|
|
|
@ -170,7 +170,7 @@ void ED_fileselect_activate_by_id(SpaceFile *sfile, ID *asset_id, bool deferred)
|
|||
void ED_fileselect_deselect_all(SpaceFile *sfile);
|
||||
void ED_fileselect_activate_by_relpath(SpaceFile *sfile, const char *relative_path);
|
||||
|
||||
void ED_fileselect_window_params_get(const wmWindow *win, int win_size[2], bool *is_maximized);
|
||||
void ED_fileselect_window_params_get(const wmWindow *win, int r_win_size[2], bool *r_is_maximized);
|
||||
|
||||
/**
|
||||
* Return the File Browser area in which \a file_operator is active.
|
||||
|
|
|
@ -55,23 +55,23 @@ void ED_operatormacros_mask();
|
|||
|
||||
/* `mask_query.cc` */
|
||||
|
||||
void ED_mask_get_size(ScrArea *area, int *width, int *height);
|
||||
void ED_mask_zoom(ScrArea *area, ARegion *region, float *zoomx, float *zoomy);
|
||||
void ED_mask_get_aspect(ScrArea *area, ARegion *region, float *aspx, float *aspy);
|
||||
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height);
|
||||
void ED_mask_zoom(ScrArea *area, ARegion *region, float *r_zoomx, float *r_zoomy);
|
||||
void ED_mask_get_aspect(ScrArea *area, ARegion *region, float *r_aspx, float *r_aspy);
|
||||
|
||||
void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *scalex, float *scaley);
|
||||
void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *r_scalex, float *r_scaley);
|
||||
/**
|
||||
* Takes `event->mval`.
|
||||
*/
|
||||
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2]);
|
||||
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float r_co[2]);
|
||||
|
||||
/**
|
||||
* \param x/y: input, mval space.
|
||||
* \param xr/yr: output, mask point space.
|
||||
*/
|
||||
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr);
|
||||
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y);
|
||||
void ED_mask_point_pos__reverse(
|
||||
ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr);
|
||||
ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y);
|
||||
|
||||
void ED_mask_cursor_location_get(ScrArea *area, float cursor[2]);
|
||||
bool ED_mask_selected_minmax(const bContext *C,
|
||||
|
|
|
@ -38,13 +38,18 @@ void ED_imapaint_bucket_fill(bContext *C, float color[3], wmOperator *op, const
|
|||
|
||||
/* `paint_image_proj.cc` */
|
||||
|
||||
void ED_paint_data_warning(ReportList *reports, bool uvs, bool mat, bool tex, bool stencil);
|
||||
void ED_paint_data_warning(
|
||||
ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil);
|
||||
/**
|
||||
* Make sure that active object has a material,
|
||||
* and assign UVs and image layers if they do not exist.
|
||||
*/
|
||||
bool ED_paint_proj_mesh_data_check(
|
||||
Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil);
|
||||
bool ED_paint_proj_mesh_data_check(Scene *scene,
|
||||
Object *ob,
|
||||
bool *r_has_uvs,
|
||||
bool *r_has_mat,
|
||||
bool *r_has_tex,
|
||||
bool *r_has_stencil);
|
||||
|
||||
/* `image_undo.cc` */
|
||||
|
||||
|
|
|
@ -484,40 +484,40 @@ bool ED_mask_feather_find_nearest(const bContext *C,
|
|||
return false;
|
||||
}
|
||||
|
||||
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2])
|
||||
void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float r_co[2])
|
||||
{
|
||||
if (area) {
|
||||
switch (area->spacetype) {
|
||||
case SPACE_CLIP: {
|
||||
SpaceClip *sc = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
ED_clip_mouse_pos(sc, region, mval, co);
|
||||
BKE_mask_coord_from_movieclip(sc->clip, &sc->user, co, co);
|
||||
ED_clip_mouse_pos(sc, region, mval, r_co);
|
||||
BKE_mask_coord_from_movieclip(sc->clip, &sc->user, r_co, r_co);
|
||||
break;
|
||||
}
|
||||
case SPACE_SEQ: {
|
||||
UI_view2d_region_to_view(®ion->v2d, mval[0], mval[1], &co[0], &co[1]);
|
||||
UI_view2d_region_to_view(®ion->v2d, mval[0], mval[1], &r_co[0], &r_co[1]);
|
||||
break;
|
||||
}
|
||||
case SPACE_IMAGE: {
|
||||
SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
|
||||
ED_image_mouse_pos(sima, region, mval, co);
|
||||
BKE_mask_coord_from_image(sima->image, &sima->iuser, co, co);
|
||||
ED_image_mouse_pos(sima, region, mval, r_co);
|
||||
BKE_mask_coord_from_image(sima->image, &sima->iuser, r_co, r_co);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* possible other spaces from which mask editing is available */
|
||||
BLI_assert(0);
|
||||
zero_v2(co);
|
||||
zero_v2(r_co);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BLI_assert(0);
|
||||
zero_v2(co);
|
||||
zero_v2(r_co);
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr)
|
||||
void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y)
|
||||
{
|
||||
float co[2];
|
||||
|
||||
|
@ -550,12 +550,12 @@ void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *
|
|||
zero_v2(co);
|
||||
}
|
||||
|
||||
*xr = co[0];
|
||||
*yr = co[1];
|
||||
*r_x = co[0];
|
||||
*r_y = co[1];
|
||||
}
|
||||
|
||||
void ED_mask_point_pos__reverse(
|
||||
ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr)
|
||||
ScrArea *area, ARegion *region, float x, float y, float *r_x, float *r_y)
|
||||
{
|
||||
float co[2];
|
||||
|
||||
|
@ -592,8 +592,8 @@ void ED_mask_point_pos__reverse(
|
|||
zero_v2(co);
|
||||
}
|
||||
|
||||
*xr = co[0];
|
||||
*yr = co[1];
|
||||
*r_x = co[0];
|
||||
*r_y = co[1];
|
||||
}
|
||||
|
||||
static void handle_position_for_minmax(const MaskSplinePoint *point,
|
||||
|
@ -679,103 +679,103 @@ bool ED_mask_selected_minmax(const bContext *C,
|
|||
/** \name Generic 2D View Queries
|
||||
* \{ */
|
||||
|
||||
void ED_mask_get_size(ScrArea *area, int *width, int *height)
|
||||
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height)
|
||||
{
|
||||
if (area && area->spacedata.first) {
|
||||
switch (area->spacetype) {
|
||||
case SPACE_CLIP: {
|
||||
SpaceClip *sc = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
ED_space_clip_get_size(sc, width, height);
|
||||
ED_space_clip_get_size(sc, r_width, r_height);
|
||||
break;
|
||||
}
|
||||
case SPACE_SEQ: {
|
||||
// Scene *scene = CTX_data_scene(C);
|
||||
// BKE_render_resolution(&scene->r, false, width, height);
|
||||
// BKE_render_resolution(&scene->r, false, r_width, r_height);
|
||||
break;
|
||||
}
|
||||
case SPACE_IMAGE: {
|
||||
SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
|
||||
ED_space_image_get_size(sima, width, height);
|
||||
ED_space_image_get_size(sima, r_width, r_height);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* possible other spaces from which mask editing is available */
|
||||
BLI_assert(0);
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
*r_width = 0;
|
||||
*r_height = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BLI_assert(0);
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
*r_width = 0;
|
||||
*r_height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mask_zoom(ScrArea *area, ARegion *region, float *zoomx, float *zoomy)
|
||||
void ED_mask_zoom(ScrArea *area, ARegion *region, float *r_zoomx, float *r_zoomy)
|
||||
{
|
||||
if (area && area->spacedata.first) {
|
||||
switch (area->spacetype) {
|
||||
case SPACE_CLIP: {
|
||||
SpaceClip *sc = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
ED_space_clip_get_zoom(sc, region, zoomx, zoomy);
|
||||
ED_space_clip_get_zoom(sc, region, r_zoomx, r_zoomy);
|
||||
break;
|
||||
}
|
||||
case SPACE_SEQ: {
|
||||
*zoomx = *zoomy = 1.0f;
|
||||
*r_zoomx = *r_zoomy = 1.0f;
|
||||
break;
|
||||
}
|
||||
case SPACE_IMAGE: {
|
||||
SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
|
||||
ED_space_image_get_zoom(sima, region, zoomx, zoomy);
|
||||
ED_space_image_get_zoom(sima, region, r_zoomx, r_zoomy);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* possible other spaces from which mask editing is available */
|
||||
BLI_assert(0);
|
||||
*zoomx = *zoomy = 1.0f;
|
||||
*r_zoomx = *r_zoomy = 1.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BLI_assert(0);
|
||||
*zoomx = *zoomy = 1.0f;
|
||||
*r_zoomx = *r_zoomy = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mask_get_aspect(ScrArea *area, ARegion * /*region*/, float *aspx, float *aspy)
|
||||
void ED_mask_get_aspect(ScrArea *area, ARegion * /*region*/, float *r_aspx, float *r_aspy)
|
||||
{
|
||||
if (area && area->spacedata.first) {
|
||||
switch (area->spacetype) {
|
||||
case SPACE_CLIP: {
|
||||
SpaceClip *sc = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
ED_space_clip_get_aspect(sc, aspx, aspy);
|
||||
ED_space_clip_get_aspect(sc, r_aspx, r_aspy);
|
||||
break;
|
||||
}
|
||||
case SPACE_SEQ: {
|
||||
*aspx = *aspy = 1.0f; /* MASKTODO - render aspect? */
|
||||
*r_aspx = *r_aspy = 1.0f; /* MASKTODO - render aspect? */
|
||||
break;
|
||||
}
|
||||
case SPACE_IMAGE: {
|
||||
SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
|
||||
ED_space_image_get_aspect(sima, aspx, aspy);
|
||||
ED_space_image_get_aspect(sima, r_aspx, r_aspy);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* possible other spaces from which mask editing is available */
|
||||
BLI_assert(0);
|
||||
*aspx = *aspy = 1.0f;
|
||||
*r_aspx = *r_aspy = 1.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BLI_assert(0);
|
||||
*aspx = *aspy = 1.0f;
|
||||
*r_aspx = *r_aspy = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *scalex, float *scaley)
|
||||
void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *r_scalex, float *r_scaley)
|
||||
{
|
||||
if (area && area->spacedata.first) {
|
||||
switch (area->spacetype) {
|
||||
|
@ -783,38 +783,38 @@ void ED_mask_pixelspace_factor(ScrArea *area, ARegion *region, float *scalex, fl
|
|||
SpaceClip *sc = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
float aspx, aspy;
|
||||
|
||||
UI_view2d_scale_get(®ion->v2d, scalex, scaley);
|
||||
UI_view2d_scale_get(®ion->v2d, r_scalex, r_scaley);
|
||||
ED_space_clip_get_aspect(sc, &aspx, &aspy);
|
||||
|
||||
*scalex *= aspx;
|
||||
*scaley *= aspy;
|
||||
*r_scalex *= aspx;
|
||||
*r_scaley *= aspy;
|
||||
break;
|
||||
}
|
||||
case SPACE_SEQ: {
|
||||
*scalex = *scaley = 1.0f; /* MASKTODO? */
|
||||
*r_scalex = *r_scaley = 1.0f; /* MASKTODO? */
|
||||
break;
|
||||
}
|
||||
case SPACE_IMAGE: {
|
||||
SpaceImage *sima = static_cast<SpaceImage *>(area->spacedata.first);
|
||||
float aspx, aspy;
|
||||
|
||||
UI_view2d_scale_get(®ion->v2d, scalex, scaley);
|
||||
UI_view2d_scale_get(®ion->v2d, r_scalex, r_scaley);
|
||||
ED_space_image_get_aspect(sima, &aspx, &aspy);
|
||||
|
||||
*scalex *= aspx;
|
||||
*scaley *= aspy;
|
||||
*r_scalex *= aspx;
|
||||
*r_scaley *= aspy;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
/* possible other spaces from which mask editing is available */
|
||||
BLI_assert(0);
|
||||
*scalex = *scaley = 1.0f;
|
||||
*r_scalex = *r_scaley = 1.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
BLI_assert(0);
|
||||
*scalex = *scaley = 1.0f;
|
||||
*r_scalex = *r_scaley = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6396,28 +6396,33 @@ void PAINT_OT_image_from_view(wmOperatorType *ot)
|
|||
* Data generation for projective texturing *
|
||||
* *******************************************/
|
||||
|
||||
void ED_paint_data_warning(ReportList *reports, bool uvs, bool mat, bool tex, bool stencil)
|
||||
void ED_paint_data_warning(
|
||||
ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil)
|
||||
{
|
||||
BKE_reportf(reports,
|
||||
RPT_WARNING,
|
||||
"Missing%s%s%s%s detected!",
|
||||
!uvs ? TIP_(" UVs,") : "",
|
||||
!mat ? TIP_(" Materials,") : "",
|
||||
!tex ? TIP_(" Textures (or linked),") : "",
|
||||
!stencil ? TIP_(" Stencil,") : "");
|
||||
!has_uvs ? TIP_(" UVs,") : "",
|
||||
!has_mat ? TIP_(" Materials,") : "",
|
||||
!has_tex ? TIP_(" Textures (or linked),") : "",
|
||||
!has_stencil ? TIP_(" Stencil,") : "");
|
||||
}
|
||||
|
||||
bool ED_paint_proj_mesh_data_check(
|
||||
Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
|
||||
bool ED_paint_proj_mesh_data_check(Scene *scene,
|
||||
Object *ob,
|
||||
bool *r_has_uvs,
|
||||
bool *r_has_mat,
|
||||
bool *r_has_tex,
|
||||
bool *r_has_stencil)
|
||||
{
|
||||
Mesh *me;
|
||||
int layernum;
|
||||
ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
|
||||
Brush *br = BKE_paint_brush(&imapaint->paint);
|
||||
bool hasmat = true;
|
||||
bool hastex = true;
|
||||
bool hasstencil = true;
|
||||
bool hasuvs = true;
|
||||
bool has_mat = true;
|
||||
bool has_tex = true;
|
||||
bool has_stencil = true;
|
||||
bool has_uvs = true;
|
||||
|
||||
imapaint->missing_data = 0;
|
||||
|
||||
|
@ -6426,19 +6431,19 @@ bool ED_paint_proj_mesh_data_check(
|
|||
if (imapaint->mode == IMAGEPAINT_MODE_MATERIAL) {
|
||||
/* no material, add one */
|
||||
if (ob->totcol == 0) {
|
||||
hasmat = false;
|
||||
hastex = false;
|
||||
has_mat = false;
|
||||
has_tex = false;
|
||||
}
|
||||
else {
|
||||
/* there may be material slots but they may be empty, check */
|
||||
hasmat = false;
|
||||
hastex = false;
|
||||
has_mat = false;
|
||||
has_tex = false;
|
||||
|
||||
for (int i = 1; i < ob->totcol + 1; i++) {
|
||||
Material *ma = BKE_object_material_get(ob, i);
|
||||
|
||||
if (ma && !ID_IS_LINKED(ma) && !ID_IS_OVERRIDE_LIBRARY(ma)) {
|
||||
hasmat = true;
|
||||
has_mat = true;
|
||||
if (ma->texpaintslot == nullptr) {
|
||||
/* refresh here just in case */
|
||||
BKE_texpaint_slot_refresh_cache(scene, ma, ob);
|
||||
|
@ -6448,7 +6453,7 @@ bool ED_paint_proj_mesh_data_check(
|
|||
!ID_IS_LINKED(ma->texpaintslot[ma->paint_active_slot].ima) &&
|
||||
!ID_IS_OVERRIDE_LIBRARY(ma->texpaintslot[ma->paint_active_slot].ima))
|
||||
{
|
||||
hastex = true;
|
||||
has_tex = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -6457,7 +6462,7 @@ bool ED_paint_proj_mesh_data_check(
|
|||
}
|
||||
else if (imapaint->mode == IMAGEPAINT_MODE_IMAGE) {
|
||||
if (imapaint->canvas == nullptr || ID_IS_LINKED(imapaint->canvas)) {
|
||||
hastex = false;
|
||||
has_tex = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6465,7 +6470,7 @@ bool ED_paint_proj_mesh_data_check(
|
|||
layernum = CustomData_number_of_layers(&me->loop_data, CD_PROP_FLOAT2);
|
||||
|
||||
if (layernum == 0) {
|
||||
hasuvs = false;
|
||||
has_uvs = false;
|
||||
}
|
||||
|
||||
/* Make sure we have a stencil to paint on! */
|
||||
|
@ -6473,37 +6478,37 @@ bool ED_paint_proj_mesh_data_check(
|
|||
imapaint->flag |= IMAGEPAINT_PROJECT_LAYER_STENCIL;
|
||||
|
||||
if (imapaint->stencil == nullptr) {
|
||||
hasstencil = false;
|
||||
has_stencil = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasuvs) {
|
||||
if (!has_uvs) {
|
||||
imapaint->missing_data |= IMAGEPAINT_MISSING_UVS;
|
||||
}
|
||||
if (!hasmat) {
|
||||
if (!has_mat) {
|
||||
imapaint->missing_data |= IMAGEPAINT_MISSING_MATERIAL;
|
||||
}
|
||||
if (!hastex) {
|
||||
if (!has_tex) {
|
||||
imapaint->missing_data |= IMAGEPAINT_MISSING_TEX;
|
||||
}
|
||||
if (!hasstencil) {
|
||||
if (!has_stencil) {
|
||||
imapaint->missing_data |= IMAGEPAINT_MISSING_STENCIL;
|
||||
}
|
||||
|
||||
if (uvs) {
|
||||
*uvs = hasuvs;
|
||||
if (r_has_uvs) {
|
||||
*r_has_uvs = has_uvs;
|
||||
}
|
||||
if (mat) {
|
||||
*mat = hasmat;
|
||||
if (r_has_mat) {
|
||||
*r_has_mat = has_mat;
|
||||
}
|
||||
if (tex) {
|
||||
*tex = hastex;
|
||||
if (r_has_tex) {
|
||||
*r_has_tex = has_tex;
|
||||
}
|
||||
if (stencil) {
|
||||
*stencil = hasstencil;
|
||||
if (r_has_stencil) {
|
||||
*r_has_stencil = has_stencil;
|
||||
}
|
||||
|
||||
return hasuvs && hasmat && hastex && hasstencil;
|
||||
return has_uvs && has_mat && has_tex && has_stencil;
|
||||
}
|
||||
|
||||
/* Add layer operator */
|
||||
|
|
|
@ -108,7 +108,7 @@ struct PaintStroke {
|
|||
float last_tablet_event_pressure;
|
||||
|
||||
float zoom_2d;
|
||||
int pen_flip;
|
||||
bool pen_flip;
|
||||
|
||||
/* Tilt, as read from the event. */
|
||||
float x_tilt;
|
||||
|
|
|
@ -827,7 +827,7 @@ void uiTemplateMovieclipInformation(uiLayout *layout,
|
|||
if (clip->anim != nullptr) {
|
||||
short frs_sec;
|
||||
float frs_sec_base;
|
||||
if (IMB_anim_get_fps(clip->anim, &frs_sec, &frs_sec_base, true)) {
|
||||
if (IMB_anim_get_fps(clip->anim, true, &frs_sec, &frs_sec_base)) {
|
||||
ofs += BLI_snprintf_rlen(
|
||||
str + ofs, sizeof(str) - ofs, TIP_(", %.2f fps"), float(frs_sec) / frs_sec_base);
|
||||
}
|
||||
|
|
|
@ -143,58 +143,61 @@ bool ED_space_clip_maskedit_mask_visible_splines_poll(bContext *C)
|
|||
/** \name Common Editing Functions
|
||||
* \{ */
|
||||
|
||||
void ED_space_clip_get_size(const SpaceClip *sc, int *width, int *height)
|
||||
void ED_space_clip_get_size(const SpaceClip *sc, int *r_width, int *r_height)
|
||||
{
|
||||
if (sc->clip) {
|
||||
BKE_movieclip_get_size(sc->clip, &sc->user, width, height);
|
||||
BKE_movieclip_get_size(sc->clip, &sc->user, r_width, r_height);
|
||||
}
|
||||
else {
|
||||
*width = *height = IMG_SIZE_FALLBACK;
|
||||
*r_width = *r_height = IMG_SIZE_FALLBACK;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_space_clip_get_size_fl(const SpaceClip *sc, float size[2])
|
||||
void ED_space_clip_get_size_fl(const SpaceClip *sc, float r_size[2])
|
||||
{
|
||||
int size_i[2];
|
||||
ED_space_clip_get_size(sc, &size_i[0], &size_i[1]);
|
||||
size[0] = size_i[0];
|
||||
size[1] = size_i[1];
|
||||
r_size[0] = size_i[0];
|
||||
r_size[1] = size_i[1];
|
||||
}
|
||||
|
||||
void ED_space_clip_get_zoom(const SpaceClip *sc, const ARegion *region, float *zoomx, float *zoomy)
|
||||
void ED_space_clip_get_zoom(const SpaceClip *sc,
|
||||
const ARegion *region,
|
||||
float *r_zoomx,
|
||||
float *r_zoomy)
|
||||
{
|
||||
int width, height;
|
||||
|
||||
ED_space_clip_get_size(sc, &width, &height);
|
||||
|
||||
*zoomx = float(BLI_rcti_size_x(®ion->winrct) + 1) /
|
||||
(BLI_rctf_size_x(®ion->v2d.cur) * width);
|
||||
*zoomy = float(BLI_rcti_size_y(®ion->winrct) + 1) /
|
||||
(BLI_rctf_size_y(®ion->v2d.cur) * height);
|
||||
*r_zoomx = float(BLI_rcti_size_x(®ion->winrct) + 1) /
|
||||
(BLI_rctf_size_x(®ion->v2d.cur) * width);
|
||||
*r_zoomy = float(BLI_rcti_size_y(®ion->winrct) + 1) /
|
||||
(BLI_rctf_size_y(®ion->v2d.cur) * height);
|
||||
}
|
||||
|
||||
void ED_space_clip_get_aspect(const SpaceClip *sc, float *aspx, float *aspy)
|
||||
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy)
|
||||
{
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
|
||||
if (clip) {
|
||||
BKE_movieclip_get_aspect(clip, aspx, aspy);
|
||||
BKE_movieclip_get_aspect(clip, r_aspx, r_aspy);
|
||||
}
|
||||
else {
|
||||
*aspx = *aspy = 1.0f;
|
||||
*r_aspx = *r_aspy = 1.0f;
|
||||
}
|
||||
|
||||
if (*aspx < *aspy) {
|
||||
*aspy = *aspy / *aspx;
|
||||
*aspx = 1.0f;
|
||||
if (*r_aspx < *r_aspy) {
|
||||
*r_aspy = *r_aspy / *r_aspx;
|
||||
*r_aspx = 1.0f;
|
||||
}
|
||||
else {
|
||||
*aspx = *aspx / *aspy;
|
||||
*aspy = 1.0f;
|
||||
*r_aspx = *r_aspx / *r_aspy;
|
||||
*r_aspy = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *aspx, float *aspy)
|
||||
void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *r_aspx, float *r_aspy)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
|
@ -206,25 +209,25 @@ void ED_space_clip_get_aspect_dimension_aware(const SpaceClip *sc, float *aspx,
|
|||
*/
|
||||
|
||||
if (!sc->clip) {
|
||||
*aspx = 1.0f;
|
||||
*aspy = 1.0f;
|
||||
*r_aspx = 1.0f;
|
||||
*r_aspy = 1.0f;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ED_space_clip_get_aspect(sc, aspx, aspy);
|
||||
ED_space_clip_get_aspect(sc, r_aspx, r_aspy);
|
||||
BKE_movieclip_get_size(sc->clip, &sc->user, &w, &h);
|
||||
|
||||
*aspx *= float(w);
|
||||
*aspy *= float(h);
|
||||
*r_aspx *= float(w);
|
||||
*r_aspy *= float(h);
|
||||
|
||||
if (*aspx < *aspy) {
|
||||
*aspy = *aspy / *aspx;
|
||||
*aspx = 1.0f;
|
||||
if (*r_aspx < *r_aspy) {
|
||||
*r_aspy = *r_aspy / *r_aspx;
|
||||
*r_aspx = 1.0f;
|
||||
}
|
||||
else {
|
||||
*aspx = *aspx / *aspy;
|
||||
*aspy = 1.0f;
|
||||
*r_aspx = *r_aspx / *r_aspy;
|
||||
*r_aspy = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,7 +267,7 @@ ImBuf *ED_space_clip_get_stable_buffer(const SpaceClip *sc,
|
|||
ImBuf *ibuf;
|
||||
|
||||
ibuf = BKE_movieclip_get_stable_ibuf(
|
||||
sc->clip, &sc->user, loc, scale, angle, sc->postproc_flag);
|
||||
sc->clip, &sc->user, sc->postproc_flag, loc, scale, angle);
|
||||
|
||||
if (ibuf && (ibuf->byte_buffer.data || ibuf->float_buffer.data)) {
|
||||
return ibuf;
|
||||
|
|
|
@ -623,15 +623,15 @@ void ED_fileselect_deselect_all(SpaceFile *sfile)
|
|||
* may also be remembered, but only conditionally. */
|
||||
#define PARAMS_FLAGS_REMEMBERED (FILE_HIDE_DOT)
|
||||
|
||||
void ED_fileselect_window_params_get(const wmWindow *win, int win_size[2], bool *is_maximized)
|
||||
void ED_fileselect_window_params_get(const wmWindow *win, int r_win_size[2], bool *r_is_maximized)
|
||||
{
|
||||
/* Get DPI/pixel-size independent size to be stored in preferences. */
|
||||
WM_window_set_dpi(win); /* Ensure the DPI is taken from the right window. */
|
||||
|
||||
win_size[0] = WM_window_pixels_x(win) / UI_SCALE_FAC;
|
||||
win_size[1] = WM_window_pixels_y(win) / UI_SCALE_FAC;
|
||||
r_win_size[0] = WM_window_pixels_x(win) / UI_SCALE_FAC;
|
||||
r_win_size[1] = WM_window_pixels_y(win) / UI_SCALE_FAC;
|
||||
|
||||
*is_maximized = WM_window_is_maximized(win);
|
||||
*r_is_maximized = WM_window_is_maximized(win);
|
||||
}
|
||||
|
||||
static bool file_select_use_default_display_type(const SpaceFile *sfile)
|
||||
|
|
|
@ -2305,9 +2305,9 @@ static bool image_should_be_saved_when_modified(Image *ima)
|
|||
return !ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE);
|
||||
}
|
||||
|
||||
static bool image_should_be_saved(Image *ima, bool *is_format_writable)
|
||||
static bool image_should_be_saved(Image *ima, bool *r_is_format_writable)
|
||||
{
|
||||
if (BKE_image_is_dirty_writable(ima, is_format_writable) &&
|
||||
if (BKE_image_is_dirty_writable(ima, r_is_format_writable) &&
|
||||
ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_TILED))
|
||||
{
|
||||
return image_should_be_saved_when_modified(ima);
|
||||
|
|
|
@ -2034,15 +2034,15 @@ static TreeElement *do_outliner_select_walk(SpaceOutliner *space_outliner,
|
|||
|
||||
/* Find the active element to walk from, or set one if none exists.
|
||||
* Changed is set to true if the active element is found, or false if it was set */
|
||||
static TreeElement *find_walk_select_start_element(SpaceOutliner *space_outliner, bool *changed)
|
||||
static TreeElement *find_walk_select_start_element(SpaceOutliner *space_outliner, bool *r_changed)
|
||||
{
|
||||
TreeElement *active_te = outliner_find_element_with_flag(&space_outliner->tree, TSE_ACTIVE);
|
||||
*changed = false;
|
||||
*r_changed = false;
|
||||
|
||||
/* If no active element exists, use the first element in the tree */
|
||||
if (!active_te) {
|
||||
active_te = static_cast<TreeElement *>(space_outliner->tree.first);
|
||||
*changed = true;
|
||||
*r_changed = true;
|
||||
}
|
||||
|
||||
/* If the active element is not visible, activate the first visible parent element */
|
||||
|
@ -2050,7 +2050,7 @@ static TreeElement *find_walk_select_start_element(SpaceOutliner *space_outliner
|
|||
while (!outliner_is_element_visible(active_te)) {
|
||||
active_te = active_te->parent;
|
||||
}
|
||||
*changed = true;
|
||||
*r_changed = true;
|
||||
}
|
||||
|
||||
return active_te;
|
||||
|
|
|
@ -196,7 +196,7 @@ static float update_overlay_strip_position_data(bContext *C, const int mval[2])
|
|||
|
||||
if (strip_len < 1) {
|
||||
/* Only check if there is a strip already under the mouse cursor. */
|
||||
coords->is_intersecting = find_nearest_seq(scene, ®ion->v2d, &hand, mval);
|
||||
coords->is_intersecting = find_nearest_seq(scene, ®ion->v2d, mval, &hand);
|
||||
}
|
||||
else {
|
||||
/* Check if there is a strip that would intersect with the new strip(s). */
|
||||
|
@ -543,7 +543,7 @@ static void prefetch_data_fn(void *custom_data, wmJobWorkerStatus * /*worker_sta
|
|||
g_drop_coords.strip_len = IMB_anim_get_duration(anim, IMB_TC_NONE);
|
||||
short frs_sec;
|
||||
float frs_sec_base;
|
||||
if (IMB_anim_get_fps(anim, &frs_sec, &frs_sec_base, true)) {
|
||||
if (IMB_anim_get_fps(anim, true, &frs_sec, &frs_sec_base)) {
|
||||
g_drop_coords.playback_rate = float(frs_sec) / frs_sec_base;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -235,7 +235,7 @@ void SEQUENCER_OT_select_side(wmOperatorType *ot);
|
|||
void SEQUENCER_OT_select_box(wmOperatorType *ot);
|
||||
void SEQUENCER_OT_select_inverse(wmOperatorType *ot);
|
||||
void SEQUENCER_OT_select_grouped(wmOperatorType *ot);
|
||||
Sequence *find_nearest_seq(const Scene *scene, const View2D *v2d, int *hand, const int mval[2]);
|
||||
Sequence *find_nearest_seq(const Scene *scene, const View2D *v2d, const int mval[2], int *r_hand);
|
||||
|
||||
/* `sequencer_add.cc` */
|
||||
|
||||
|
|
|
@ -75,9 +75,8 @@ void ED_sequencer_special_preview_set(bContext *C, const int mval[2])
|
|||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
int hand;
|
||||
Sequence *seq;
|
||||
seq = find_nearest_seq(scene, ®ion->v2d, &hand, mval);
|
||||
int hand_dummy;
|
||||
Sequence *seq = find_nearest_seq(scene, ®ion->v2d, mval, &hand_dummy);
|
||||
sequencer_special_update_set(seq);
|
||||
}
|
||||
|
||||
|
|
|
@ -690,7 +690,7 @@ int sequencer_retiming_key_select_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* Click on strip, do strip selection. */
|
||||
const Sequence *seq_click_exact = find_nearest_seq(scene, UI_view2d_fromcontext(C), &hand, mval);
|
||||
const Sequence *seq_click_exact = find_nearest_seq(scene, UI_view2d_fromcontext(C), mval, &hand);
|
||||
if (seq_click_exact != nullptr && key == nullptr) {
|
||||
SEQ_retiming_selection_clear(ed);
|
||||
return sequencer_select_exec(C, op);
|
||||
|
|
|
@ -292,7 +292,7 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Sequence *find_nearest_seq(const Scene *scene, const View2D *v2d, int *hand, const int mval[2])
|
||||
Sequence *find_nearest_seq(const Scene *scene, const View2D *v2d, const int mval[2], int *r_hand)
|
||||
{
|
||||
Sequence *seq;
|
||||
Editing *ed = SEQ_editing_get(scene);
|
||||
|
@ -300,7 +300,7 @@ Sequence *find_nearest_seq(const Scene *scene, const View2D *v2d, int *hand, con
|
|||
float pixelx;
|
||||
float handsize;
|
||||
float displen;
|
||||
*hand = SEQ_SIDE_NONE;
|
||||
*r_hand = SEQ_SIDE_NONE;
|
||||
|
||||
if (ed == nullptr) {
|
||||
return nullptr;
|
||||
|
@ -345,10 +345,10 @@ Sequence *find_nearest_seq(const Scene *scene, const View2D *v2d, int *hand, con
|
|||
}
|
||||
|
||||
if (handsize + SEQ_time_left_handle_frame_get(scene, seq) >= x) {
|
||||
*hand = SEQ_SIDE_LEFT;
|
||||
*r_hand = SEQ_SIDE_LEFT;
|
||||
}
|
||||
else if (-handsize + SEQ_time_right_handle_frame_get(scene, seq) <= x) {
|
||||
*hand = SEQ_SIDE_RIGHT;
|
||||
*r_hand = SEQ_SIDE_RIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ int sequencer_select_exec(bContext *C, wmOperator *op)
|
|||
seq = seq_select_seq_from_preview(C, mval, toggle, extend, center);
|
||||
}
|
||||
else {
|
||||
seq = find_nearest_seq(scene, v2d, &handle_clicked, mval);
|
||||
seq = find_nearest_seq(scene, v2d, mval, &handle_clicked);
|
||||
}
|
||||
|
||||
/* NOTE: `side_of_frame` and `linked_time` functionality is designed to be shared on one keymap,
|
||||
|
@ -1249,7 +1249,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, cons
|
|||
int selected, hand;
|
||||
|
||||
/* This works like UV, not mesh. */
|
||||
mouse_seq = find_nearest_seq(scene, v2d, &hand, event->mval);
|
||||
mouse_seq = find_nearest_seq(scene, v2d, event->mval, &hand);
|
||||
if (!mouse_seq) {
|
||||
return OPERATOR_FINISHED; /* User error as with mesh?? */
|
||||
}
|
||||
|
@ -1759,7 +1759,7 @@ static int sequencer_box_select_invoke(bContext *C, wmOperator *op, const wmEven
|
|||
int hand_dummy;
|
||||
int mval[2];
|
||||
WM_event_drag_start_mval(event, region, mval);
|
||||
Sequence *seq = find_nearest_seq(scene, v2d, &hand_dummy, mval);
|
||||
Sequence *seq = find_nearest_seq(scene, v2d, mval, &hand_dummy);
|
||||
if (seq != nullptr) {
|
||||
return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
|
|
|
@ -1009,7 +1009,7 @@ bool GPU_texture_has_signed_format(const GPUTexture *tex);
|
|||
* \a size is expected to be a pointer to a vector of dimension matching the texture's dimension
|
||||
* (including the array dimension).
|
||||
*/
|
||||
void GPU_texture_get_mipmap_size(GPUTexture *texture, int mip_level, int *size);
|
||||
void GPU_texture_get_mipmap_size(GPUTexture *texture, int mip_level, int *r_size);
|
||||
|
||||
/** \} */
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class DummyContext : public Context {
|
|||
void flush() override {}
|
||||
void finish() override {}
|
||||
|
||||
void memory_statistics_get(int * /*total_mem*/, int * /*free_mem*/) override {}
|
||||
void memory_statistics_get(int * /*r_total_mem*/, int * /*r_free_mem*/) override {}
|
||||
|
||||
void debug_group_begin(const char *, int) override {}
|
||||
void debug_group_end() override {}
|
||||
|
|
|
@ -223,9 +223,9 @@ bool GPU_mem_stats_supported()
|
|||
return GCaps.mem_stats_support;
|
||||
}
|
||||
|
||||
void GPU_mem_stats_get(int *totalmem, int *freemem)
|
||||
void GPU_mem_stats_get(int *r_totalmem, int *r_freemem)
|
||||
{
|
||||
Context::get()->memory_statistics_get(totalmem, freemem);
|
||||
Context::get()->memory_statistics_get(r_totalmem, r_freemem);
|
||||
}
|
||||
|
||||
bool GPU_stereo_quadbuffer_support()
|
||||
|
|
|
@ -81,7 +81,7 @@ class Context {
|
|||
/* Will wait until the GPU has finished executing all command. */
|
||||
virtual void finish() = 0;
|
||||
|
||||
virtual void memory_statistics_get(int *total_mem, int *free_mem) = 0;
|
||||
virtual void memory_statistics_get(int *r_total_mem, int *r_free_mem) = 0;
|
||||
|
||||
virtual void debug_group_begin(const char *, int){};
|
||||
virtual void debug_group_end(){};
|
||||
|
|
|
@ -286,7 +286,7 @@ bool MTLCommandBufferManager::end_active_command_encoder()
|
|||
}
|
||||
|
||||
id<MTLRenderCommandEncoder> MTLCommandBufferManager::ensure_begin_render_command_encoder(
|
||||
MTLFrameBuffer *ctx_framebuffer, bool force_begin, bool *new_pass)
|
||||
MTLFrameBuffer *ctx_framebuffer, bool force_begin, bool *r_new_pass)
|
||||
{
|
||||
/* Ensure valid frame-buffer. */
|
||||
BLI_assert(ctx_framebuffer != nullptr);
|
||||
|
@ -356,11 +356,11 @@ id<MTLRenderCommandEncoder> MTLCommandBufferManager::ensure_begin_render_command
|
|||
render_pass_state_.reset_state();
|
||||
|
||||
/* Return true as new pass started. */
|
||||
*new_pass = true;
|
||||
*r_new_pass = true;
|
||||
}
|
||||
else {
|
||||
/* No new pass. */
|
||||
*new_pass = false;
|
||||
*r_new_pass = false;
|
||||
}
|
||||
|
||||
BLI_assert(active_render_command_encoder_ != nil);
|
||||
|
|
|
@ -640,7 +640,7 @@ class MTLCommandBufferManager {
|
|||
bool end_active_command_encoder();
|
||||
id<MTLRenderCommandEncoder> ensure_begin_render_command_encoder(MTLFrameBuffer *ctx_framebuffer,
|
||||
bool force_begin,
|
||||
bool *new_pass);
|
||||
bool *r_new_pass);
|
||||
id<MTLBlitCommandEncoder> ensure_begin_blit_encoder();
|
||||
id<MTLComputeCommandEncoder> ensure_begin_compute_encoder();
|
||||
|
||||
|
@ -771,7 +771,7 @@ class MTLContext : public Context {
|
|||
void flush() override;
|
||||
void finish() override;
|
||||
|
||||
void memory_statistics_get(int *total_mem, int *free_mem) override;
|
||||
void memory_statistics_get(int *r_total_mem, int *r_free_mem) override;
|
||||
|
||||
static MTLContext *get()
|
||||
{
|
||||
|
|
|
@ -456,11 +456,11 @@ void MTLContext::finish()
|
|||
this->main_command_buffer.submit(true);
|
||||
}
|
||||
|
||||
void MTLContext::memory_statistics_get(int *total_mem, int *free_mem)
|
||||
void MTLContext::memory_statistics_get(int *r_total_mem, int *r_free_mem)
|
||||
{
|
||||
/* TODO(Metal): Implement. */
|
||||
*total_mem = 0;
|
||||
*free_mem = 0;
|
||||
*r_total_mem = 0;
|
||||
*r_free_mem = 0;
|
||||
}
|
||||
|
||||
void MTLContext::framebuffer_bind(MTLFrameBuffer *framebuffer)
|
||||
|
|
|
@ -112,7 +112,7 @@ class GLContext : public Context {
|
|||
void flush() override;
|
||||
void finish() override;
|
||||
|
||||
void memory_statistics_get(int *total_mem, int *free_mem) override;
|
||||
void memory_statistics_get(int *r_total_mem, int *r_free_mem) override;
|
||||
|
||||
static GLContext *get()
|
||||
{
|
||||
|
|
|
@ -410,7 +410,10 @@ double IMD_anim_get_offset(struct anim *anim);
|
|||
* Return the fps contained in movie files (function rval is false,
|
||||
* and frs_sec and frs_sec_base untouched if none available!)
|
||||
*/
|
||||
bool IMB_anim_get_fps(struct anim *anim, short *frs_sec, float *frs_sec_base, bool no_av_base);
|
||||
bool IMB_anim_get_fps(const struct anim *anim,
|
||||
bool no_av_base,
|
||||
short *r_frs_sec,
|
||||
float *r_frs_sec_base);
|
||||
|
||||
/**
|
||||
* \attention Defined in `anim_movie.cc`.
|
||||
|
|
|
@ -1649,33 +1649,33 @@ double IMD_anim_get_offset(anim *anim)
|
|||
return anim->start_offset;
|
||||
}
|
||||
|
||||
bool IMB_anim_get_fps(anim *anim, short *frs_sec, float *frs_sec_base, bool no_av_base)
|
||||
bool IMB_anim_get_fps(const anim *anim, bool no_av_base, short *r_frs_sec, float *r_frs_sec_base)
|
||||
{
|
||||
double frs_sec_base_double;
|
||||
if (anim->frs_sec) {
|
||||
if (anim->frs_sec > SHRT_MAX) {
|
||||
/* We cannot store original rational in our short/float format,
|
||||
* we need to approximate it as best as we can... */
|
||||
*frs_sec = SHRT_MAX;
|
||||
*r_frs_sec = SHRT_MAX;
|
||||
frs_sec_base_double = anim->frs_sec_base * double(SHRT_MAX) / double(anim->frs_sec);
|
||||
}
|
||||
else {
|
||||
*frs_sec = anim->frs_sec;
|
||||
*r_frs_sec = anim->frs_sec;
|
||||
frs_sec_base_double = anim->frs_sec_base;
|
||||
}
|
||||
#ifdef WITH_FFMPEG
|
||||
if (no_av_base) {
|
||||
*frs_sec_base = float(frs_sec_base_double / AV_TIME_BASE);
|
||||
*r_frs_sec_base = float(frs_sec_base_double / AV_TIME_BASE);
|
||||
}
|
||||
else {
|
||||
*frs_sec_base = float(frs_sec_base_double);
|
||||
*r_frs_sec_base = float(frs_sec_base_double);
|
||||
}
|
||||
#else
|
||||
UNUSED_VARS(no_av_base);
|
||||
*frs_sec_base = float(frs_sec_base_double);
|
||||
*r_frs_sec_base = float(frs_sec_base_double);
|
||||
#endif
|
||||
BLI_assert(*frs_sec > 0);
|
||||
BLI_assert(*frs_sec_base > 0.0f);
|
||||
BLI_assert(*r_frs_sec > 0);
|
||||
BLI_assert(*r_frs_sec_base > 0.0f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1262,7 +1262,7 @@ static AviMovie *alloc_proxy_output_avi(
|
|||
short frs_sec = 25;
|
||||
float frs_sec_base = 1.0;
|
||||
|
||||
IMB_anim_get_fps(anim, &frs_sec, &frs_sec_base, false);
|
||||
IMB_anim_get_fps(anim, false, &frs_sec, &frs_sec_base);
|
||||
|
||||
x = width;
|
||||
y = height;
|
||||
|
|
|
@ -125,7 +125,7 @@ static void *imb_gpu_get_data(const ImBuf *ibuf,
|
|||
const int rescale_size[2],
|
||||
const bool store_premultiplied,
|
||||
bool *r_freedata,
|
||||
eGPUDataFormat *out_data_format)
|
||||
eGPUDataFormat *r_data_format)
|
||||
{
|
||||
bool is_float_rect = (ibuf->float_buffer.data != nullptr);
|
||||
const bool is_grayscale = imb_is_grayscale_texture_format_compatible(ibuf);
|
||||
|
@ -252,7 +252,7 @@ static void *imb_gpu_get_data(const ImBuf *ibuf,
|
|||
}
|
||||
}
|
||||
|
||||
*out_data_format = (is_float_rect) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
|
||||
*r_data_format = (is_float_rect) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
|
||||
return data_rect;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,33 +35,33 @@ bool ExtraTags::addTag(std::string tag, std::string data)
|
|||
return true;
|
||||
}
|
||||
|
||||
int ExtraTags::asInt(std::string tag, bool *ok)
|
||||
int ExtraTags::asInt(std::string tag, bool *r_ok)
|
||||
{
|
||||
if (tags.find(tag) == tags.end()) {
|
||||
*ok = false;
|
||||
*r_ok = false;
|
||||
return -1;
|
||||
}
|
||||
*ok = true;
|
||||
*r_ok = true;
|
||||
return atoi(tags[tag].c_str());
|
||||
}
|
||||
|
||||
float ExtraTags::asFloat(std::string tag, bool *ok)
|
||||
float ExtraTags::asFloat(std::string tag, bool *r_ok)
|
||||
{
|
||||
if (tags.find(tag) == tags.end()) {
|
||||
*ok = false;
|
||||
*r_ok = false;
|
||||
return -1.0f;
|
||||
}
|
||||
*ok = true;
|
||||
*r_ok = true;
|
||||
return float(atof(tags[tag].c_str()));
|
||||
}
|
||||
|
||||
std::string ExtraTags::asString(std::string tag, bool *ok)
|
||||
std::string ExtraTags::asString(std::string tag, bool *r_ok)
|
||||
{
|
||||
if (tags.find(tag) == tags.end()) {
|
||||
*ok = false;
|
||||
*r_ok = false;
|
||||
return "";
|
||||
}
|
||||
*ok = true;
|
||||
*r_ok = true;
|
||||
return tags[tag];
|
||||
}
|
||||
|
||||
|
|
|
@ -57,9 +57,9 @@ class ExtraTags {
|
|||
std::map<std::string, std::string> tags;
|
||||
|
||||
/** Get text data for tag as an int. */
|
||||
int asInt(std::string tag, bool *ok);
|
||||
int asInt(std::string tag, bool *r_ok);
|
||||
/** Get text data for tag as a float. */
|
||||
float asFloat(std::string tag, bool *ok);
|
||||
float asFloat(std::string tag, bool *r_ok);
|
||||
/** Get text data for tag as a string. */
|
||||
std::string asString(std::string tag, bool *ok);
|
||||
std::string asString(std::string tag, bool *r_ok);
|
||||
};
|
||||
|
|
|
@ -70,7 +70,7 @@ static void node_geo_exec(GeoNodeExecParams params)
|
|||
|
||||
short fps_sec = 0;
|
||||
float fps_sec_base = 0.0f;
|
||||
IMB_anim_get_fps(anim, &fps_sec, &fps_sec_base, true);
|
||||
IMB_anim_get_fps(anim, true, &fps_sec, &fps_sec_base);
|
||||
fps = float(fps_sec) / fps_sec_base;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -686,7 +686,7 @@ PyTypeObject BGL_bufferType = {
|
|||
};
|
||||
|
||||
static Buffer *BGL_MakeBuffer_FromData(
|
||||
PyObject *parent, int type, int ndimensions, int *dimensions, void *buf)
|
||||
PyObject *parent, int type, int ndimensions, const int *dimensions, void *buf)
|
||||
{
|
||||
Buffer *buffer = (Buffer *)PyObject_NEW(Buffer, &BGL_bufferType);
|
||||
|
||||
|
@ -702,7 +702,7 @@ static Buffer *BGL_MakeBuffer_FromData(
|
|||
return buffer;
|
||||
}
|
||||
|
||||
Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuffer)
|
||||
Buffer *BGL_MakeBuffer(int type, int ndimensions, const int *dimensions, const void *initbuffer)
|
||||
{
|
||||
Buffer *buffer;
|
||||
void *buf = nullptr;
|
||||
|
|
|
@ -21,7 +21,10 @@ PyObject *BPyInit_bgl(void);
|
|||
* \param initbuffer: When not NULL holds a contiguous buffer
|
||||
* with the correct format from which the buffer will be initialized
|
||||
*/
|
||||
struct _Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuffer);
|
||||
struct _Buffer *BGL_MakeBuffer(int type,
|
||||
int ndimensions,
|
||||
const int *dimensions,
|
||||
const void *initbuffer);
|
||||
|
||||
int BGL_typeSize(int type);
|
||||
|
||||
|
|
|
@ -185,12 +185,12 @@ static AnimationEvalContext seq_prefetch_anim_eval_context(PrefetchJob *pfjob)
|
|||
return BKE_animsys_eval_context_construct(pfjob->depsgraph, seq_prefetch_cfra(pfjob));
|
||||
}
|
||||
|
||||
void seq_prefetch_get_time_range(Scene *scene, int *start, int *end)
|
||||
void seq_prefetch_get_time_range(Scene *scene, int *r_start, int *r_end)
|
||||
{
|
||||
PrefetchJob *pfjob = seq_prefetch_job_get(scene);
|
||||
|
||||
*start = pfjob->cfra;
|
||||
*end = seq_prefetch_cfra(pfjob);
|
||||
*r_start = pfjob->cfra;
|
||||
*r_end = seq_prefetch_cfra(pfjob);
|
||||
}
|
||||
|
||||
static void seq_prefetch_free_depsgraph(PrefetchJob *pfjob)
|
||||
|
|
|
@ -18,7 +18,7 @@ struct Sequence;
|
|||
void seq_prefetch_start(const SeqRenderData *context, float timeline_frame);
|
||||
void seq_prefetch_free(Scene *scene);
|
||||
bool seq_prefetch_job_is_running(Scene *scene);
|
||||
void seq_prefetch_get_time_range(Scene *scene, int *start, int *end);
|
||||
void seq_prefetch_get_time_range(Scene *scene, int *r_start, int *r_end);
|
||||
/**
|
||||
* For cache context swapping.
|
||||
*/
|
||||
|
|
|
@ -1209,7 +1209,7 @@ static ImBuf *seq_render_movie_strip(const SeqRenderData *context,
|
|||
if (sanim && sanim->anim) {
|
||||
short fps_denom;
|
||||
float fps_num;
|
||||
IMB_anim_get_fps(sanim->anim, &fps_denom, &fps_num, true);
|
||||
IMB_anim_get_fps(sanim->anim, true, &fps_denom, &fps_num);
|
||||
seq->strip->stripdata->orig_fps = fps_denom / fps_num;
|
||||
}
|
||||
seq->strip->stripdata->orig_width = ibuf->x;
|
||||
|
@ -1224,7 +1224,7 @@ static ImBuf *seq_get_movieclip_ibuf(Sequence *seq, MovieClipUser user)
|
|||
ImBuf *ibuf = nullptr;
|
||||
float tloc[2], tscale, tangle;
|
||||
if (seq->clip_flag & SEQ_MOVIECLIP_RENDER_STABILIZED) {
|
||||
ibuf = BKE_movieclip_get_stable_ibuf(seq->clip, &user, tloc, &tscale, &tangle, 0);
|
||||
ibuf = BKE_movieclip_get_stable_ibuf(seq->clip, &user, 0, tloc, &tscale, &tangle);
|
||||
}
|
||||
else {
|
||||
ibuf = BKE_movieclip_get_ibuf_flag(seq->clip, &user, seq->clip->flag, MOVIECLIP_CACHE_SKIP);
|
||||
|
|
|
@ -435,7 +435,7 @@ Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
|
|||
short fps_denom;
|
||||
float fps_num;
|
||||
|
||||
IMB_anim_get_fps(anim_arr[0], &fps_denom, &fps_num, true);
|
||||
IMB_anim_get_fps(anim_arr[0], true, &fps_denom, &fps_num);
|
||||
|
||||
video_fps = fps_denom / fps_num;
|
||||
|
||||
|
@ -485,7 +485,7 @@ Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
|
|||
|
||||
short frs_sec;
|
||||
float frs_sec_base;
|
||||
if (IMB_anim_get_fps(anim_arr[0], &frs_sec, &frs_sec_base, true)) {
|
||||
if (IMB_anim_get_fps(anim_arr[0], true, &frs_sec, &frs_sec_base)) {
|
||||
seq->media_playback_rate = float(frs_sec) / frs_sec_base;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ float SEQ_time_sequence_get_fps(Scene *scene, Sequence *seq)
|
|||
}
|
||||
short frs_sec;
|
||||
float frs_sec_base;
|
||||
if (IMB_anim_get_fps(strip_anim->anim, &frs_sec, &frs_sec_base, true)) {
|
||||
if (IMB_anim_get_fps(strip_anim->anim, true, &frs_sec, &frs_sec_base)) {
|
||||
return float(frs_sec) / frs_sec_base;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1754,7 +1754,7 @@ bool WM_event_is_xr(const wmEvent *event);
|
|||
* If this is a tablet event, return tablet pressure and set `*pen_flip`
|
||||
* to 1 if the eraser tool is being used, 0 otherwise.
|
||||
*/
|
||||
float WM_event_tablet_data(const wmEvent *event, int *pen_flip, float tilt[2]);
|
||||
float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2]);
|
||||
bool WM_event_is_tablet(const wmEvent *event);
|
||||
|
||||
int WM_event_absolute_delta_x(const wmEvent *event);
|
||||
|
|
|
@ -560,15 +560,15 @@ float wm_pressure_curve(float pressure)
|
|||
return pressure;
|
||||
}
|
||||
|
||||
float WM_event_tablet_data(const wmEvent *event, int *pen_flip, float tilt[2])
|
||||
float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2])
|
||||
{
|
||||
if (tilt) {
|
||||
tilt[0] = event->tablet.x_tilt;
|
||||
tilt[1] = event->tablet.y_tilt;
|
||||
if (r_tilt) {
|
||||
r_tilt[0] = event->tablet.x_tilt;
|
||||
r_tilt[1] = event->tablet.y_tilt;
|
||||
}
|
||||
|
||||
if (pen_flip) {
|
||||
(*pen_flip) = (event->tablet.active == EVT_TABLET_ERASER);
|
||||
if (r_pen_flip) {
|
||||
(*r_pen_flip) = (event->tablet.active == EVT_TABLET_ERASER);
|
||||
}
|
||||
|
||||
return event->tablet.pressure;
|
||||
|
|
|
@ -1923,7 +1923,7 @@ static bool wm_main_playanim_intern(int argc, const char **argv, PlayArgs *args_
|
|||
short frs_sec = 25;
|
||||
float frs_sec_base = 1.0;
|
||||
|
||||
IMB_anim_get_fps(anim_movie, &frs_sec, &frs_sec_base, true);
|
||||
IMB_anim_get_fps(anim_movie, true, &frs_sec, &frs_sec_base);
|
||||
|
||||
g_playanim.fps_movie = double(frs_sec) / double(frs_sec_base);
|
||||
/* Enforce same fps for movie as sound. */
|
||||
|
|
|
@ -2414,9 +2414,9 @@ void wm_window_set_swap_interval(wmWindow *win, int interval)
|
|||
GHOST_SetSwapInterval(static_cast<GHOST_WindowHandle>(win->ghostwin), interval);
|
||||
}
|
||||
|
||||
bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut)
|
||||
bool wm_window_get_swap_interval(wmWindow *win, int *r_interval)
|
||||
{
|
||||
return GHOST_GetSwapInterval(static_cast<GHOST_WindowHandle>(win->ghostwin), intervalOut);
|
||||
return GHOST_GetSwapInterval(static_cast<GHOST_WindowHandle>(win->ghostwin), r_interval);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -104,7 +104,7 @@ void wm_window_get_position(wmWindow *win, int *r_pos_x, int *r_pos_y);
|
|||
*/
|
||||
void wm_window_swap_buffers(wmWindow *win);
|
||||
void wm_window_set_swap_interval(wmWindow *win, int interval);
|
||||
bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut);
|
||||
bool wm_window_get_swap_interval(wmWindow *win, int *r_interval);
|
||||
|
||||
bool wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y) ATTR_WARN_UNUSED_RESULT;
|
||||
void wm_cursor_position_from_ghost_screen_coords(wmWindow *win, int *r_x, int *r_y);
|
||||
|
|
Loading…
Reference in New Issue