Cleanup: Clang tidy
Addressed almost all warnings except for replacing defines with enums and variable assignment in if statements.
This commit is contained in:
parent
31f2242691
commit
2652029f3b
|
@ -73,7 +73,7 @@ static eThumbStatus extract_png_from_blend_file(const char *src_blend, const cha
|
|||
|
||||
std::optional<blender::Vector<uint8_t>> png_buf_opt = blendthumb_create_png_data_from_thumb(
|
||||
&thumb);
|
||||
if (png_buf_opt == std::nullopt) {
|
||||
if (!png_buf_opt) {
|
||||
err = BT_ERROR;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1258,7 +1258,7 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph,
|
|||
float *weights[DATAMAX] = {nullptr};
|
||||
|
||||
MeshPairRemap geom_map[DATAMAX] = {{0}};
|
||||
bool geom_map_init[DATAMAX] = {0};
|
||||
bool geom_map_init[DATAMAX] = {false};
|
||||
ListBase lay_map = {nullptr};
|
||||
bool changed = false;
|
||||
bool is_modifier = false;
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* \ingroup bke
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
@ -231,10 +231,10 @@ IDTypeInfo IDType_ID_KE = {
|
|||
#define KEY_MODE_BEZTRIPLE 2
|
||||
|
||||
/* Internal use only. */
|
||||
typedef struct WeightsArrayCache {
|
||||
struct WeightsArrayCache {
|
||||
int num_defgroup_weights;
|
||||
float **defgroup_weights;
|
||||
} WeightsArrayCache;
|
||||
};
|
||||
|
||||
void BKE_key_free_data(Key *key)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
/* Allow using deprecated functionality for .blend file I/O. */
|
||||
#define DNA_DEPRECATED_ALLOW
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "CLG_log.h"
|
||||
|
||||
|
@ -400,7 +400,7 @@ void BKE_view_layer_base_deselect_all(const Scene *scene, ViewLayer *view_layer)
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, Base *selbase)
|
||||
void BKE_view_layer_base_select_and_set_active(ViewLayer *view_layer, Base *selbase)
|
||||
{
|
||||
view_layer->basact = selbase;
|
||||
if ((selbase->flag & BASE_SELECTABLE) != 0) {
|
||||
|
@ -780,12 +780,12 @@ void BKE_layer_collection_resync_allow(void)
|
|||
no_resync = false;
|
||||
}
|
||||
|
||||
typedef struct LayerCollectionResync {
|
||||
struct LayerCollectionResync *prev, *next;
|
||||
struct LayerCollectionResync {
|
||||
LayerCollectionResync *prev, *next;
|
||||
|
||||
/* Temp data used to generate a queue during valid layer search. See
|
||||
* #layer_collection_resync_find. */
|
||||
struct LayerCollectionResync *queue_next;
|
||||
LayerCollectionResync *queue_next;
|
||||
|
||||
/* LayerCollection and Collection wrapped by this data. */
|
||||
LayerCollection *layer;
|
||||
|
@ -793,7 +793,7 @@ typedef struct LayerCollectionResync {
|
|||
|
||||
/* Hierarchical relationships in the old, existing ViewLayer state (except for newly created
|
||||
* layers). */
|
||||
struct LayerCollectionResync *parent_layer_resync;
|
||||
LayerCollectionResync *parent_layer_resync;
|
||||
ListBase children_layer_resync;
|
||||
|
||||
/* This layer still points to a valid collection. */
|
||||
|
@ -809,7 +809,7 @@ typedef struct LayerCollectionResync {
|
|||
* OR
|
||||
* This layer has already been re-used to match the new collections hierarchy. */
|
||||
bool is_used;
|
||||
} LayerCollectionResync;
|
||||
};
|
||||
|
||||
static LayerCollectionResync *layer_collection_resync_create_recurse(
|
||||
LayerCollectionResync *parent_layer_resync, LayerCollection *layer, BLI_mempool *mempool)
|
||||
|
@ -969,12 +969,12 @@ static void layer_collection_resync_unused_layers_free(ViewLayer *view_layer,
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_view_layer_need_resync_tag(struct ViewLayer *view_layer)
|
||||
void BKE_view_layer_need_resync_tag(ViewLayer *view_layer)
|
||||
{
|
||||
view_layer->flag |= VIEW_LAYER_OUT_OF_SYNC;
|
||||
}
|
||||
|
||||
void BKE_view_layer_synced_ensure(const Scene *scene, struct ViewLayer *view_layer)
|
||||
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
|
||||
{
|
||||
if (view_layer->flag & VIEW_LAYER_OUT_OF_SYNC) {
|
||||
BKE_layer_collection_sync(scene, view_layer);
|
||||
|
@ -1599,7 +1599,7 @@ bool BKE_base_is_visible(const View3D *v3d, const Base *base)
|
|||
return base->flag & BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT;
|
||||
}
|
||||
|
||||
bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *ob)
|
||||
bool BKE_object_is_visible_in_viewport(const View3D *v3d, const Object *ob)
|
||||
{
|
||||
BLI_assert(v3d != nullptr);
|
||||
|
||||
|
@ -1988,10 +1988,10 @@ bool BKE_scene_has_object(Scene *scene, Object *ob)
|
|||
/** \name Private Iterator Helpers
|
||||
* \{ */
|
||||
|
||||
typedef struct LayerObjectBaseIteratorData {
|
||||
struct LayerObjectBaseIteratorData {
|
||||
const View3D *v3d;
|
||||
Base *base;
|
||||
} LayerObjectBaseIteratorData;
|
||||
};
|
||||
|
||||
static bool object_bases_iterator_is_valid(const View3D *v3d, Base *base, const int flag)
|
||||
{
|
||||
|
@ -2207,7 +2207,7 @@ void BKE_view_layer_visible_bases_iterator_end(BLI_Iterator *iter)
|
|||
/** \name BKE_view_layer_bases_in_mode_iterator
|
||||
* \{ */
|
||||
|
||||
static bool base_is_in_mode(struct ObjectsInModeIteratorData *data, Base *base)
|
||||
static bool base_is_in_mode(ObjectsInModeIteratorData *data, Base *base)
|
||||
{
|
||||
return (base->object->type == data->object_type) &&
|
||||
(base->object->mode & data->object_mode) != 0;
|
||||
|
@ -2215,7 +2215,7 @@ static bool base_is_in_mode(struct ObjectsInModeIteratorData *data, Base *base)
|
|||
|
||||
void BKE_view_layer_bases_in_mode_iterator_begin(BLI_Iterator *iter, void *data_in)
|
||||
{
|
||||
struct ObjectsInModeIteratorData *data = static_cast<ObjectsInModeIteratorData *>(data_in);
|
||||
ObjectsInModeIteratorData *data = static_cast<ObjectsInModeIteratorData *>(data_in);
|
||||
Base *base = data->base_active;
|
||||
|
||||
/* In this case the result will always be empty, the caller must check for no mode. */
|
||||
|
@ -2241,7 +2241,7 @@ void BKE_view_layer_bases_in_mode_iterator_begin(BLI_Iterator *iter, void *data_
|
|||
|
||||
void BKE_view_layer_bases_in_mode_iterator_next(BLI_Iterator *iter)
|
||||
{
|
||||
struct ObjectsInModeIteratorData *data = static_cast<ObjectsInModeIteratorData *>(iter->data);
|
||||
ObjectsInModeIteratorData *data = static_cast<ObjectsInModeIteratorData *>(iter->data);
|
||||
Base *base = static_cast<Base *>(iter->current);
|
||||
|
||||
if (base == data->base_active) {
|
||||
|
@ -2309,9 +2309,7 @@ void BKE_base_eval_flags(Base *base)
|
|||
}
|
||||
}
|
||||
|
||||
static void layer_eval_view_layer(struct Depsgraph *depsgraph,
|
||||
struct Scene *scene,
|
||||
ViewLayer *view_layer)
|
||||
static void layer_eval_view_layer(Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer)
|
||||
{
|
||||
DEG_debug_print_eval(depsgraph, __func__, view_layer->name, view_layer);
|
||||
|
||||
|
@ -2327,9 +2325,7 @@ static void layer_eval_view_layer(struct Depsgraph *depsgraph,
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_layer_eval_view_layer_indexed(struct Depsgraph *depsgraph,
|
||||
struct Scene *scene,
|
||||
int view_layer_index)
|
||||
void BKE_layer_eval_view_layer_indexed(Depsgraph *depsgraph, Scene *scene, int view_layer_index)
|
||||
{
|
||||
BLI_assert(view_layer_index >= 0);
|
||||
ViewLayer *view_layer = static_cast<ViewLayer *>(
|
||||
|
@ -2502,7 +2498,7 @@ static void viewlayer_aov_active_set(ViewLayer *view_layer, ViewLayerAOV *aov)
|
|||
}
|
||||
}
|
||||
|
||||
struct ViewLayerAOV *BKE_view_layer_add_aov(struct ViewLayer *view_layer)
|
||||
ViewLayerAOV *BKE_view_layer_add_aov(ViewLayer *view_layer)
|
||||
{
|
||||
ViewLayerAOV *aov;
|
||||
aov = MEM_cnew<ViewLayerAOV>(__func__);
|
||||
|
@ -2557,9 +2553,7 @@ static void bke_view_layer_verify_aov_cb(void *userdata,
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_view_layer_verify_aov(struct RenderEngine *engine,
|
||||
struct Scene *scene,
|
||||
struct ViewLayer *view_layer)
|
||||
void BKE_view_layer_verify_aov(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
|
||||
{
|
||||
viewlayer_aov_make_name_unique(view_layer);
|
||||
|
||||
|
@ -2584,7 +2578,7 @@ bool BKE_view_layer_has_valid_aov(ViewLayer *view_layer)
|
|||
return false;
|
||||
}
|
||||
|
||||
ViewLayer *BKE_view_layer_find_with_aov(struct Scene *scene, struct ViewLayerAOV *aov)
|
||||
ViewLayer *BKE_view_layer_find_with_aov(Scene *scene, ViewLayerAOV *aov)
|
||||
{
|
||||
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
|
||||
if (BLI_findindex(&view_layer->aovs, aov) != -1) {
|
||||
|
@ -2625,8 +2619,7 @@ static void viewlayer_lightgroup_active_set(ViewLayer *view_layer, ViewLayerLigh
|
|||
}
|
||||
}
|
||||
|
||||
struct ViewLayerLightgroup *BKE_view_layer_add_lightgroup(struct ViewLayer *view_layer,
|
||||
const char *name)
|
||||
ViewLayerLightgroup *BKE_view_layer_add_lightgroup(ViewLayer *view_layer, const char *name)
|
||||
{
|
||||
ViewLayerLightgroup *lightgroup;
|
||||
lightgroup = MEM_cnew<ViewLayerLightgroup>(__func__);
|
||||
|
@ -2662,8 +2655,7 @@ void BKE_view_layer_set_active_lightgroup(ViewLayer *view_layer, ViewLayerLightg
|
|||
viewlayer_lightgroup_active_set(view_layer, lightgroup);
|
||||
}
|
||||
|
||||
ViewLayer *BKE_view_layer_find_with_lightgroup(struct Scene *scene,
|
||||
struct ViewLayerLightgroup *lightgroup)
|
||||
ViewLayer *BKE_view_layer_find_with_lightgroup(Scene *scene, ViewLayerLightgroup *lightgroup)
|
||||
{
|
||||
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
|
||||
if (BLI_findindex(&view_layer->lightgroups, lightgroup) != -1) {
|
||||
|
@ -2706,7 +2698,7 @@ void BKE_view_layer_rename_lightgroup(Scene *scene,
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_lightgroup_membership_get(struct LightgroupMembership *lgm, char *name)
|
||||
void BKE_lightgroup_membership_get(LightgroupMembership *lgm, char *name)
|
||||
{
|
||||
if (lgm != nullptr) {
|
||||
BLI_strncpy(name, lgm->name, sizeof(lgm->name));
|
||||
|
@ -2716,7 +2708,7 @@ void BKE_lightgroup_membership_get(struct LightgroupMembership *lgm, char *name)
|
|||
}
|
||||
}
|
||||
|
||||
int BKE_lightgroup_membership_length(struct LightgroupMembership *lgm)
|
||||
int BKE_lightgroup_membership_length(LightgroupMembership *lgm)
|
||||
{
|
||||
if (lgm != nullptr) {
|
||||
return strlen(lgm->name);
|
||||
|
@ -2724,7 +2716,7 @@ int BKE_lightgroup_membership_length(struct LightgroupMembership *lgm)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void BKE_lightgroup_membership_set(struct LightgroupMembership **lgm, const char *name)
|
||||
void BKE_lightgroup_membership_set(LightgroupMembership **lgm, const char *name)
|
||||
{
|
||||
if (name[0] != '\0') {
|
||||
if (*lgm == nullptr) {
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* \ingroup bke
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* \ingroup bke
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
|
||||
#include "CLG_log.h"
|
||||
|
||||
|
@ -1374,13 +1374,13 @@ static bNode *nodetree_uv_node_recursive(bNode *node)
|
|||
}
|
||||
|
||||
/** Bitwise filter for updating paint slots. */
|
||||
typedef enum ePaintSlotFilter {
|
||||
enum ePaintSlotFilter {
|
||||
PAINT_SLOT_IMAGE = 1 << 0,
|
||||
PAINT_SLOT_COLOR_ATTRIBUTE = 1 << 1,
|
||||
} ePaintSlotFilter;
|
||||
};
|
||||
ENUM_OPERATORS(ePaintSlotFilter, PAINT_SLOT_COLOR_ATTRIBUTE)
|
||||
|
||||
typedef bool (*ForEachTexNodeCallback)(bNode *node, void *userdata);
|
||||
using ForEachTexNodeCallback = bool (*)(bNode *node, void *userdata);
|
||||
static bool ntree_foreach_texnode_recursive(bNodeTree *nodetree,
|
||||
ForEachTexNodeCallback callback,
|
||||
void *userdata,
|
||||
|
|
|
@ -545,12 +545,12 @@ static void update_active_fdata_layers(Mesh &mesh, CustomData *fdata, CustomData
|
|||
}
|
||||
|
||||
if (CustomData_has_layer(ldata, CD_PROP_BYTE_COLOR)) {
|
||||
if (mesh.active_color_attribute != NULL) {
|
||||
if (mesh.active_color_attribute != nullptr) {
|
||||
act = CustomData_get_named_layer(ldata, CD_PROP_BYTE_COLOR, mesh.active_color_attribute);
|
||||
CustomData_set_layer_active(fdata, CD_MCOL, act);
|
||||
}
|
||||
|
||||
if (mesh.default_color_attribute != NULL) {
|
||||
if (mesh.default_color_attribute != nullptr) {
|
||||
act = CustomData_get_named_layer(ldata, CD_PROP_BYTE_COLOR, mesh.default_color_attribute);
|
||||
CustomData_set_layer_render(fdata, CD_MCOL, act);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ Mesh *BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(MirrorModifierData *mm
|
|||
BMIter viter;
|
||||
BMVert *v, *v_next;
|
||||
|
||||
BMeshCreateParams bmesh_create_params{0};
|
||||
BMeshCreateParams bmesh_create_params{false};
|
||||
|
||||
BMeshFromMeshParams bmesh_from_mesh_params{};
|
||||
bmesh_from_mesh_params.calc_face_normal = true;
|
||||
|
@ -89,7 +89,7 @@ void BKE_mesh_mirror_apply_mirror_on_axis(struct Main *bmain,
|
|||
const float dist)
|
||||
{
|
||||
BMeshCreateParams bmesh_create_params{};
|
||||
bmesh_create_params.use_toolflags = 1;
|
||||
bmesh_create_params.use_toolflags = true;
|
||||
|
||||
BMeshFromMeshParams bmesh_from_mesh_params{};
|
||||
bmesh_from_mesh_params.calc_face_normal = true;
|
||||
|
|
|
@ -500,7 +500,7 @@ static int get_levels_from_disps(Object *ob)
|
|||
continue;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
while (true) {
|
||||
int side = (1 << (totlvl - 1)) + 1;
|
||||
int lvl_totdisp = side * side;
|
||||
if (md->totdisp == lvl_totdisp) {
|
||||
|
@ -1079,7 +1079,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
|
|||
cddm,
|
||||
totlvl,
|
||||
false,
|
||||
0,
|
||||
false,
|
||||
mmd->uv_smooth == SUBSURF_UV_SMOOTH_NONE,
|
||||
has_mask,
|
||||
false,
|
||||
|
@ -1156,7 +1156,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
|
|||
cddm,
|
||||
mmd->totlvl,
|
||||
false,
|
||||
0,
|
||||
false,
|
||||
mmd->uv_smooth == SUBSURF_UV_SMOOTH_NONE,
|
||||
has_mask,
|
||||
false,
|
||||
|
|
|
@ -1784,10 +1784,8 @@ ListBase *object_duplilist_preview(Depsgraph *depsgraph,
|
|||
if (nmd_orig->runtime_eval_log == nullptr) {
|
||||
continue;
|
||||
}
|
||||
geo_log::GeoModifierLog *log = static_cast<geo_log::GeoModifierLog *>(
|
||||
nmd_orig->runtime_eval_log);
|
||||
if (const geo_log::ViewerNodeLog *viewer_log = log->find_viewer_node_log_for_path(
|
||||
*viewer_path)) {
|
||||
if (const geo_log::ViewerNodeLog *viewer_log =
|
||||
geo_log::GeoModifierLog::find_viewer_node_log_for_path(*viewer_path)) {
|
||||
ctx.preview_base_geometry = &viewer_log->geometry;
|
||||
make_duplis_geometry_set_impl(
|
||||
&ctx, viewer_log->geometry, ob_eval->object_to_world, true, ob_eval->type == OB_CURVES);
|
||||
|
|
|
@ -67,7 +67,7 @@ static const MeshUVVert &get_uv_vert(const MeshPrimitive &mesh_primitive, const
|
|||
return mesh_primitive.vertices[0];
|
||||
}
|
||||
|
||||
static const bool has_vertex(const MeshPrimitive &mesh_primitive, const MeshVertex &mesh_vertex)
|
||||
static bool has_vertex(const MeshPrimitive &mesh_primitive, const MeshVertex &mesh_vertex)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (mesh_primitive.vertices[i].vertex == &mesh_vertex) {
|
||||
|
@ -1162,7 +1162,7 @@ UVEdge *UVPrimitive::get_uv_edge(const MeshVertex *v1, const MeshVertex *v2) con
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
const bool UVPrimitive::contains_uv_vertex(const UVVertex *uv_vertex) const
|
||||
bool UVPrimitive::contains_uv_vertex(const UVVertex *uv_vertex) const
|
||||
{
|
||||
for (UVEdge *edge : edges) {
|
||||
if (std::find(edge->vertices.begin(), edge->vertices.end(), uv_vertex) !=
|
||||
|
@ -1303,7 +1303,7 @@ static void add_uv_island(UVIslandsMask::Tile &tile,
|
|||
const UVIsland &uv_island,
|
||||
int16_t island_index)
|
||||
{
|
||||
for (const VectorList<UVPrimitive>::UsedVector &uv_primitives : uv_island.uv_primitives)
|
||||
for (const VectorList<UVPrimitive>::UsedVector &uv_primitives : uv_island.uv_primitives) {
|
||||
for (const UVPrimitive &uv_primitive : uv_primitives) {
|
||||
const MeshPrimitive *mesh_primitive = uv_primitive.primitive;
|
||||
|
||||
|
@ -1338,6 +1338,7 @@ static void add_uv_island(UVIslandsMask::Tile &tile,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UVIslandsMask::add(const UVIslands &uv_islands)
|
||||
|
|
|
@ -168,7 +168,7 @@ struct UVPrimitive {
|
|||
UVEdge *get_uv_edge(const float2 uv1, const float2 uv2) const;
|
||||
UVEdge *get_uv_edge(const MeshVertex *v1, const MeshVertex *v2) const;
|
||||
|
||||
const bool contains_uv_vertex(const UVVertex *uv_vertex) const;
|
||||
bool contains_uv_vertex(const UVVertex *uv_vertex) const;
|
||||
const UVVertex *get_other_uv_vertex(const UVVertex *v1, const UVVertex *v2) const;
|
||||
|
||||
UVBorder extract_border() const;
|
||||
|
@ -232,7 +232,7 @@ struct UVBorder {
|
|||
/**
|
||||
* Calculate the outside angle of the given vert.
|
||||
*/
|
||||
float outside_angle(const UVBorderEdge &vert) const;
|
||||
float outside_angle(const UVBorderEdge &edge) const;
|
||||
|
||||
void update_indexes(uint64_t border_index);
|
||||
|
||||
|
|
|
@ -1525,7 +1525,7 @@ void BKE_shrinkwrap_mesh_nearest_surface_deform(bContext *C, Object *ob_source,
|
|||
{
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
Scene *sce = CTX_data_scene(C);
|
||||
ShrinkwrapModifierData ssmd = {{0}};
|
||||
ShrinkwrapModifierData ssmd = {{nullptr}};
|
||||
ModifierEvalContext ctx = {depsgraph, ob_source, ModifierApplyFlag(0)};
|
||||
int totvert;
|
||||
|
||||
|
@ -1546,7 +1546,7 @@ void BKE_shrinkwrap_mesh_nearest_surface_deform(bContext *C, Object *ob_source,
|
|||
|
||||
void BKE_shrinkwrap_remesh_target_project(Mesh *src_me, Mesh *target_me, Object *ob_target)
|
||||
{
|
||||
ShrinkwrapModifierData ssmd = {{0}};
|
||||
ShrinkwrapModifierData ssmd = {{nullptr}};
|
||||
int totvert;
|
||||
|
||||
ssmd.target = ob_target;
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* \ingroup bke
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/** \file
|
||||
* \ingroup bli
|
||||
*
|
||||
* \section aboutbli Blender LIbrary external interface
|
||||
* \section aboutbli Blender Library external interface
|
||||
*
|
||||
* \subsection about About the BLI module
|
||||
*
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
* For single linked lists see 'BLI_linklist.h'
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
* \ingroup blenloader
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <cerrno>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* open/close */
|
||||
#ifndef _WIN32
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "overlay_private.hh"
|
||||
|
||||
typedef struct OVERLAY_Shaders {
|
||||
struct OVERLAY_Shaders {
|
||||
GPUShader *antialiasing;
|
||||
GPUShader *armature_dof_wire;
|
||||
GPUShader *armature_dof_solid;
|
||||
|
@ -107,7 +107,7 @@ typedef struct OVERLAY_Shaders {
|
|||
GPUShader *wireframe_select;
|
||||
GPUShader *wireframe[2];
|
||||
GPUShader *xray_fade;
|
||||
} OVERLAY_Shaders;
|
||||
};
|
||||
|
||||
static struct {
|
||||
OVERLAY_Shaders sh_data[GPU_SHADER_CFG_LEN];
|
||||
|
@ -555,7 +555,7 @@ GPUShader *OVERLAY_shader_gpencil_canvas(void)
|
|||
/* TODO(fclem): Support Clipping? Everything is already setup but don't want to change behavior
|
||||
* without agreement of all gpencil module. */
|
||||
sh_data->gpencil_canvas = GPU_shader_create_from_info_name(
|
||||
0 ? "overlay_gpencil_canvas_clipped" : "overlay_gpencil_canvas");
|
||||
false ? "overlay_gpencil_canvas_clipped" : "overlay_gpencil_canvas");
|
||||
}
|
||||
return sh_data->gpencil_canvas;
|
||||
}
|
||||
|
@ -612,8 +612,8 @@ GPUShader *OVERLAY_shader_image(void)
|
|||
OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
|
||||
if (!sh_data->image) {
|
||||
/* TODO(fclem): Do we want to allow clipping reference images? */
|
||||
sh_data->image = GPU_shader_create_from_info_name(0 ? "overlay_image_clipped" :
|
||||
"overlay_image");
|
||||
sh_data->image = GPU_shader_create_from_info_name(false ? "overlay_image_clipped" :
|
||||
"overlay_image");
|
||||
}
|
||||
return sh_data->image;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
/** \name Internal Types
|
||||
* \{ */
|
||||
|
||||
typedef struct GpencilBatchCache {
|
||||
struct GpencilBatchCache {
|
||||
/** Instancing Data */
|
||||
GPUVertBuf *vbo;
|
||||
GPUVertBuf *vbo_col;
|
||||
|
@ -65,7 +65,7 @@ typedef struct GpencilBatchCache {
|
|||
bool is_dirty;
|
||||
/** Last cache frame */
|
||||
int cache_frame;
|
||||
} GpencilBatchCache;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
|
@ -175,16 +175,16 @@ void DRW_gpencil_batch_cache_free(bGPdata *gpd)
|
|||
* \{ */
|
||||
|
||||
/* MUST match the format below. */
|
||||
typedef struct gpStrokeVert {
|
||||
struct gpStrokeVert {
|
||||
/** Position and thickness packed in the same attribute. */
|
||||
float pos[3], thickness;
|
||||
/** Material Index, Stroke Index, Point Index, Packed aspect + hardness + rotation. */
|
||||
int32_t mat, stroke_id, point_id, packed_asp_hard_rot;
|
||||
/** UV and strength packed in the same attribute. */
|
||||
float uv_fill[2], u_stroke, strength;
|
||||
} gpStrokeVert;
|
||||
};
|
||||
|
||||
static GPUVertFormat *gpencil_stroke_format(void)
|
||||
static GPUVertFormat *gpencil_stroke_format()
|
||||
{
|
||||
static GPUVertFormat format = {0};
|
||||
if (format.attr_len == 0) {
|
||||
|
@ -196,12 +196,12 @@ static GPUVertFormat *gpencil_stroke_format(void)
|
|||
}
|
||||
|
||||
/* MUST match the format below. */
|
||||
typedef struct gpEditVert {
|
||||
struct gpEditVert {
|
||||
uint vflag;
|
||||
float weight;
|
||||
} gpEditVert;
|
||||
};
|
||||
|
||||
static GPUVertFormat *gpencil_edit_stroke_format(void)
|
||||
static GPUVertFormat *gpencil_edit_stroke_format()
|
||||
{
|
||||
static GPUVertFormat format = {0};
|
||||
if (format.attr_len == 0) {
|
||||
|
@ -212,12 +212,12 @@ static GPUVertFormat *gpencil_edit_stroke_format(void)
|
|||
}
|
||||
|
||||
/* MUST match the format below. */
|
||||
typedef struct gpEditCurveVert {
|
||||
struct gpEditCurveVert {
|
||||
float pos[3];
|
||||
uint32_t data;
|
||||
} gpEditCurveVert;
|
||||
};
|
||||
|
||||
static GPUVertFormat *gpencil_edit_curve_format(void)
|
||||
static GPUVertFormat *gpencil_edit_curve_format()
|
||||
{
|
||||
static GPUVertFormat format = {0};
|
||||
if (format.attr_len == 0) {
|
||||
|
@ -229,12 +229,12 @@ static GPUVertFormat *gpencil_edit_curve_format(void)
|
|||
}
|
||||
|
||||
/* MUST match the format below. */
|
||||
typedef struct gpColorVert {
|
||||
struct gpColorVert {
|
||||
float vcol[4]; /* Vertex color */
|
||||
float fcol[4]; /* Fill color */
|
||||
} gpColorVert;
|
||||
};
|
||||
|
||||
static GPUVertFormat *gpencil_color_format(void)
|
||||
static GPUVertFormat *gpencil_color_format()
|
||||
{
|
||||
static GPUVertFormat format = {0};
|
||||
if (format.attr_len == 0) {
|
||||
|
@ -250,7 +250,7 @@ static GPUVertFormat *gpencil_color_format(void)
|
|||
/** \name Vertex Buffers
|
||||
* \{ */
|
||||
|
||||
typedef struct gpIterData {
|
||||
struct gpIterData {
|
||||
bGPdata *gpd;
|
||||
gpStrokeVert *verts;
|
||||
gpColorVert *cols;
|
||||
|
@ -258,9 +258,9 @@ typedef struct gpIterData {
|
|||
int vert_len;
|
||||
int tri_len;
|
||||
int curve_len;
|
||||
} gpIterData;
|
||||
};
|
||||
|
||||
static GPUVertBuf *gpencil_dummy_buffer_get(void)
|
||||
static GPUVertBuf *gpencil_dummy_buffer_get()
|
||||
{
|
||||
GPUBatch *batch = DRW_gpencil_dummy_buffer_get();
|
||||
return batch->verts[0];
|
||||
|
@ -726,15 +726,15 @@ void DRW_cache_gpencil_sbuffer_clear(Object *ob)
|
|||
#define GP_EDIT_STROKE_END (1 << 4)
|
||||
#define GP_EDIT_POINT_DIMMED (1 << 5)
|
||||
|
||||
typedef struct gpEditIterData {
|
||||
struct gpEditIterData {
|
||||
gpEditVert *verts;
|
||||
int vgindex;
|
||||
} gpEditIterData;
|
||||
};
|
||||
|
||||
typedef struct gpEditCurveIterData {
|
||||
struct gpEditCurveIterData {
|
||||
gpEditCurveVert *verts;
|
||||
int vgindex;
|
||||
} gpEditCurveIterData;
|
||||
};
|
||||
|
||||
static uint32_t gpencil_point_edit_flag(const bool layer_lock,
|
||||
const bGPDspoint *pt,
|
||||
|
|
|
@ -932,7 +932,7 @@ static void gpencil_draw_basic_stroke(tGPDfill *tgpf,
|
|||
/* Help strokes are for display only and shouldn't render. */
|
||||
return;
|
||||
}
|
||||
else if (is_help) {
|
||||
if (is_help) {
|
||||
/* Color help strokes that won't affect fill or render separately from
|
||||
* extended strokes, as they will affect them. */
|
||||
copy_v4_v4(col, help_col);
|
||||
|
|
|
@ -739,7 +739,7 @@ static void ui_color_snap_hue(const enum eSnapType snap, float *r_hue)
|
|||
|
||||
static ListBase UIAfterFuncs = {nullptr, nullptr};
|
||||
|
||||
static uiAfterFunc *ui_afterfunc_new(void)
|
||||
static uiAfterFunc *ui_afterfunc_new()
|
||||
{
|
||||
uiAfterFunc *after = MEM_cnew<uiAfterFunc>(__func__);
|
||||
|
||||
|
@ -2795,7 +2795,7 @@ static void ui_but_copy(bContext *C, uiBut *but, const bool copy_array)
|
|||
}
|
||||
|
||||
if (is_buf_set) {
|
||||
WM_clipboard_text_set(buf, 0);
|
||||
WM_clipboard_text_set(buf, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2864,7 +2864,7 @@ static void ui_but_paste(bContext *C, uiBut *but, uiHandleButtonData *data, cons
|
|||
MEM_freeN((void *)buf_paste);
|
||||
}
|
||||
|
||||
void ui_but_clipboard_free(void)
|
||||
void ui_but_clipboard_free()
|
||||
{
|
||||
BKE_curvemapping_free_data(&but_copypaste_curve);
|
||||
BKE_curveprofile_free_data(&but_copypaste_profile);
|
||||
|
@ -3301,7 +3301,7 @@ static bool ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, const in
|
|||
MEM_mallocN(sizeof(char) * (sellen + 1), "ui_textedit_copypaste"));
|
||||
|
||||
BLI_strncpy(buf, data->str + but->selsta, sellen + 1);
|
||||
WM_clipboard_text_set(buf, 0);
|
||||
WM_clipboard_text_set(buf, false);
|
||||
MEM_freeN(buf);
|
||||
|
||||
/* for cut only, delete the selection afterwards */
|
||||
|
|
|
@ -142,8 +142,8 @@ struct IconType {
|
|||
/* ******************* STATIC LOCAL VARS ******************* */
|
||||
/* Static here to cache results of icon directory scan, so it's not
|
||||
* scanning the file-system each time the menu is drawn. */
|
||||
static ListBase iconfilelist = {NULL, NULL};
|
||||
static IconTexture icongltex = {{NULL, NULL}, 0, 0, 0, 0.0f, 0.0f};
|
||||
static ListBase iconfilelist = {nullptr, nullptr};
|
||||
static IconTexture icongltex = {{nullptr, nullptr}, 0, 0, 0, 0.0f, 0.0f};
|
||||
|
||||
#ifndef WITH_HEADLESS
|
||||
|
||||
|
@ -170,7 +170,7 @@ static DrawInfo *def_internal_icon(
|
|||
{
|
||||
Icon *new_icon = MEM_cnew<Icon>(__func__);
|
||||
|
||||
new_icon->obj = NULL; /* icon is not for library object */
|
||||
new_icon->obj = nullptr; /* icon is not for library object */
|
||||
new_icon->id_type = 0;
|
||||
|
||||
DrawInfo *di = MEM_cnew<DrawInfo>(__func__);
|
||||
|
@ -222,14 +222,14 @@ static void def_internal_vicon(int icon_id, VectorDrawFunc drawFunc)
|
|||
{
|
||||
Icon *new_icon = MEM_cnew<Icon>("texicon");
|
||||
|
||||
new_icon->obj = NULL; /* icon is not for library object */
|
||||
new_icon->obj = nullptr; /* icon is not for library object */
|
||||
new_icon->id_type = 0;
|
||||
|
||||
DrawInfo *di = MEM_cnew<DrawInfo>("drawinfo");
|
||||
di->type = ICON_TYPE_VECTOR;
|
||||
di->data.vector.func = drawFunc;
|
||||
|
||||
new_icon->drawinfo_free = NULL;
|
||||
new_icon->drawinfo_free = nullptr;
|
||||
new_icon->drawinfo = di;
|
||||
|
||||
BKE_icon_set(icon_id, new_icon);
|
||||
|
@ -486,7 +486,7 @@ static void vicon_strip_color_draw_library_data_indirect(
|
|||
aspect,
|
||||
ICON_INDIRECT_DATA_ALPHA * alpha,
|
||||
0.0f,
|
||||
NULL,
|
||||
nullptr,
|
||||
false,
|
||||
UI_NO_ICON_OVERLAY_TEXT);
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ static void vicon_strip_color_draw_library_data_override_noneditable(
|
|||
aspect,
|
||||
ICON_INDIRECT_DATA_ALPHA * alpha * 0.75f,
|
||||
0.0f,
|
||||
NULL,
|
||||
nullptr,
|
||||
false,
|
||||
UI_NO_ICON_OVERLAY_TEXT);
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ static void vicon_gplayer_color_draw(Icon *icon, int x, int y, int w, int h)
|
|||
immUnbindProgram();
|
||||
}
|
||||
|
||||
static void init_brush_icons(void)
|
||||
static void init_brush_icons()
|
||||
{
|
||||
|
||||
# define INIT_BRUSH_ICON(icon_id, name) \
|
||||
|
@ -538,7 +538,7 @@ static void init_brush_icons(void)
|
|||
const int size = datatoc_##name##_png_size; \
|
||||
DrawInfo *di; \
|
||||
\
|
||||
di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_BUFFER, 0); \
|
||||
di = def_internal_icon(nullptr, icon_id, 0, 0, w, ICON_TYPE_BUFFER, 0); \
|
||||
di->data.buffer.image->datatoc_rect = rect; \
|
||||
di->data.buffer.image->datatoc_size = size; \
|
||||
} \
|
||||
|
@ -617,7 +617,7 @@ static void init_brush_icons(void)
|
|||
# undef INIT_BRUSH_ICON
|
||||
}
|
||||
|
||||
static DrawInfo *g_di_event_list = NULL;
|
||||
static DrawInfo *g_di_event_list = nullptr;
|
||||
|
||||
int UI_icon_from_event_type(short event_type, short event_value)
|
||||
{
|
||||
|
@ -672,13 +672,13 @@ int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[4])
|
|||
return UI_icon_from_event_type(kmi->type, kmi->val);
|
||||
}
|
||||
|
||||
static void init_event_icons(void)
|
||||
static void init_event_icons()
|
||||
{
|
||||
DrawInfo *di_next = NULL;
|
||||
DrawInfo *di_next = nullptr;
|
||||
|
||||
# define INIT_EVENT_ICON(icon_id, type, value) \
|
||||
{ \
|
||||
DrawInfo *di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_EVENT, 0); \
|
||||
DrawInfo *di = def_internal_icon(nullptr, icon_id, 0, 0, w, ICON_TYPE_EVENT, 0); \
|
||||
di->data.input.event_type = type; \
|
||||
di->data.input.event_value = value; \
|
||||
di->data.input.icon = icon_id; \
|
||||
|
@ -753,14 +753,14 @@ static void icon_verify_datatoc(IconImage *iimg)
|
|||
|
||||
if (iimg->datatoc_rect) {
|
||||
ImBuf *bbuf = IMB_ibImageFromMemory(
|
||||
iimg->datatoc_rect, iimg->datatoc_size, IB_rect, NULL, "<matcap icon>");
|
||||
iimg->datatoc_rect, iimg->datatoc_size, IB_rect, nullptr, "<matcap icon>");
|
||||
/* w and h were set on initialize */
|
||||
if (bbuf->x != iimg->h && bbuf->y != iimg->w) {
|
||||
IMB_scaleImBuf(bbuf, iimg->w, iimg->h);
|
||||
}
|
||||
|
||||
iimg->rect = bbuf->rect;
|
||||
bbuf->rect = NULL;
|
||||
bbuf->rect = nullptr;
|
||||
IMB_freeImBuf(bbuf);
|
||||
}
|
||||
}
|
||||
|
@ -847,31 +847,31 @@ static ImBuf *create_mono_icon_with_border(ImBuf *buf,
|
|||
return result;
|
||||
}
|
||||
|
||||
static void free_icons_textures(void)
|
||||
static void free_icons_textures()
|
||||
{
|
||||
if (icongltex.num_textures > 0) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (icongltex.tex[i]) {
|
||||
GPU_texture_free(icongltex.tex[i]);
|
||||
icongltex.tex[i] = NULL;
|
||||
icongltex.tex[i] = nullptr;
|
||||
}
|
||||
}
|
||||
icongltex.num_textures = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UI_icons_reload_internal_textures(void)
|
||||
void UI_icons_reload_internal_textures()
|
||||
{
|
||||
bTheme *btheme = UI_GetTheme();
|
||||
ImBuf *b16buf = NULL, *b32buf = NULL, *b16buf_border = NULL, *b32buf_border = NULL;
|
||||
ImBuf *b16buf = nullptr, *b32buf = nullptr, *b16buf_border = nullptr, *b32buf_border = nullptr;
|
||||
const float icon_border_intensity = btheme->tui.icon_border_intensity;
|
||||
const bool need_icons_with_border = icon_border_intensity > 0.0f;
|
||||
|
||||
if (b16buf == NULL) {
|
||||
if (b16buf == nullptr) {
|
||||
b16buf = IMB_ibImageFromMemory((const uchar *)datatoc_blender_icons16_png,
|
||||
datatoc_blender_icons16_png_size,
|
||||
IB_rect,
|
||||
NULL,
|
||||
nullptr,
|
||||
"<blender icons>");
|
||||
}
|
||||
if (b16buf) {
|
||||
|
@ -882,11 +882,11 @@ void UI_icons_reload_internal_textures(void)
|
|||
IMB_premultiply_alpha(b16buf);
|
||||
}
|
||||
|
||||
if (b32buf == NULL) {
|
||||
if (b32buf == nullptr) {
|
||||
b32buf = IMB_ibImageFromMemory((const uchar *)datatoc_blender_icons32_png,
|
||||
datatoc_blender_icons32_png_size,
|
||||
IB_rect,
|
||||
NULL,
|
||||
nullptr,
|
||||
"<blender icons>");
|
||||
}
|
||||
if (b32buf) {
|
||||
|
@ -906,26 +906,26 @@ void UI_icons_reload_internal_textures(void)
|
|||
|
||||
/* Note the filter and LOD bias were tweaked to better preserve icon
|
||||
* sharpness at different UI scales. */
|
||||
if (icongltex.tex[0] == NULL) {
|
||||
if (icongltex.tex[0] == nullptr) {
|
||||
icongltex.w = b32buf->x;
|
||||
icongltex.h = b32buf->y;
|
||||
icongltex.invw = 1.0f / b32buf->x;
|
||||
icongltex.invh = 1.0f / b32buf->y;
|
||||
|
||||
icongltex.tex[0] = GPU_texture_create_2d_ex(
|
||||
"icons", b32buf->x, b32buf->y, 2, GPU_RGBA8, GPU_TEXTURE_USAGE_SHADER_READ, NULL);
|
||||
"icons", b32buf->x, b32buf->y, 2, GPU_RGBA8, GPU_TEXTURE_USAGE_SHADER_READ, nullptr);
|
||||
GPU_texture_update_mipmap(icongltex.tex[0], 0, GPU_DATA_UBYTE, b32buf->rect);
|
||||
GPU_texture_update_mipmap(icongltex.tex[0], 1, GPU_DATA_UBYTE, b16buf->rect);
|
||||
}
|
||||
|
||||
if (need_icons_with_border && icongltex.tex[1] == NULL) {
|
||||
if (need_icons_with_border && icongltex.tex[1] == nullptr) {
|
||||
icongltex.tex[1] = GPU_texture_create_2d_ex("icons_border",
|
||||
b32buf_border->x,
|
||||
b32buf_border->y,
|
||||
2,
|
||||
GPU_RGBA8,
|
||||
GPU_TEXTURE_USAGE_SHADER_READ,
|
||||
NULL);
|
||||
nullptr);
|
||||
GPU_texture_update_mipmap(icongltex.tex[1], 0, GPU_DATA_UBYTE, b32buf_border->rect);
|
||||
GPU_texture_update_mipmap(icongltex.tex[1], 1, GPU_DATA_UBYTE, b16buf_border->rect);
|
||||
}
|
||||
|
@ -937,18 +937,18 @@ void UI_icons_reload_internal_textures(void)
|
|||
IMB_freeImBuf(b32buf_border);
|
||||
}
|
||||
|
||||
static void init_internal_icons(void)
|
||||
static void init_internal_icons()
|
||||
{
|
||||
# if 0 /* temp disabled */
|
||||
if ((btheme != NULL) && btheme->tui.iconfile[0]) {
|
||||
if ((btheme != nullptr) && btheme->tui.iconfile[0]) {
|
||||
char *icondir = BKE_appdir_folder_id(BLENDER_DATAFILES, "icons");
|
||||
char iconfilestr[FILE_MAX];
|
||||
|
||||
if (icondir) {
|
||||
BLI_path_join(iconfilestr, sizeof(iconfilestr), icondir, btheme->tui.iconfile);
|
||||
|
||||
/* if the image is missing bbuf will just be NULL */
|
||||
bbuf = IMB_loadiffname(iconfilestr, IB_rect, NULL);
|
||||
/* if the image is missing bbuf will just be nullptr */
|
||||
bbuf = IMB_loadiffname(iconfilestr, IB_rect, nullptr);
|
||||
|
||||
if (bbuf && (bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H)) {
|
||||
printf(
|
||||
|
@ -957,7 +957,7 @@ static void init_internal_icons(void)
|
|||
"Using built-in Icons instead\n",
|
||||
iconfilestr);
|
||||
IMB_freeImBuf(bbuf);
|
||||
bbuf = NULL;
|
||||
bbuf = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -975,7 +975,7 @@ static void init_internal_icons(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
def_internal_icon(NULL,
|
||||
def_internal_icon(nullptr,
|
||||
BIFICONID_FIRST + y * ICON_GRID_COLS + x,
|
||||
x * (ICON_GRID_W + ICON_GRID_MARGIN) + ICON_GRID_MARGIN,
|
||||
y * (ICON_GRID_H + ICON_GRID_MARGIN) + ICON_GRID_MARGIN,
|
||||
|
@ -1047,7 +1047,7 @@ static void init_iconfile_list(ListBase *list)
|
|||
BLI_listbase_clear(list);
|
||||
const char *icondir = BKE_appdir_folder_id(BLENDER_DATAFILES, "icons");
|
||||
|
||||
if (icondir == NULL) {
|
||||
if (icondir == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ static void init_iconfile_list(ListBase *list)
|
|||
# if 0
|
||||
int ifilex, ifiley;
|
||||
char iconfilestr[FILE_MAX + 16]; /* allow 256 chars for file+dir */
|
||||
ImBuf *bbuf = NULL;
|
||||
ImBuf *bbuf = nullptr;
|
||||
/* check to see if the image is the right size, continue if not */
|
||||
/* copying strings here should go ok, assuming that we never get back
|
||||
* a complete path to file longer than 256 chars */
|
||||
|
@ -1102,7 +1102,7 @@ static void init_iconfile_list(ListBase *list)
|
|||
}
|
||||
|
||||
BLI_filelist_free(dir, totfile);
|
||||
dir = NULL;
|
||||
dir = nullptr;
|
||||
}
|
||||
|
||||
static void free_iconfile_list(ListBase *list)
|
||||
|
@ -1114,7 +1114,7 @@ static void free_iconfile_list(ListBase *list)
|
|||
|
||||
#else
|
||||
|
||||
void UI_icons_reload_internal_textures(void)
|
||||
void UI_icons_reload_internal_textures()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1131,14 +1131,14 @@ int UI_iconfile_get_index(const char *filename)
|
|||
return 0;
|
||||
}
|
||||
|
||||
ListBase *UI_iconfile_list(void)
|
||||
ListBase *UI_iconfile_list()
|
||||
{
|
||||
ListBase *list = &(iconfilelist);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void UI_icons_free(void)
|
||||
void UI_icons_free()
|
||||
{
|
||||
#ifndef WITH_HEADLESS
|
||||
free_icons_textures();
|
||||
|
@ -1151,7 +1151,7 @@ void UI_icons_free_drawinfo(void *drawinfo)
|
|||
{
|
||||
DrawInfo *di = static_cast<DrawInfo *>(drawinfo);
|
||||
|
||||
if (di == NULL) {
|
||||
if (di == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1218,7 +1218,7 @@ int UI_icon_get_width(int icon_id)
|
|||
{
|
||||
Icon *icon = BKE_icon_get(icon_id);
|
||||
|
||||
if (icon == NULL) {
|
||||
if (icon == nullptr) {
|
||||
if (G.debug & G_DEBUG) {
|
||||
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
|
||||
}
|
||||
|
@ -1236,7 +1236,7 @@ int UI_icon_get_width(int icon_id)
|
|||
int UI_icon_get_height(int icon_id)
|
||||
{
|
||||
Icon *icon = BKE_icon_get(icon_id);
|
||||
if (icon == NULL) {
|
||||
if (icon == nullptr) {
|
||||
if (G.debug & G_DEBUG) {
|
||||
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
|
||||
}
|
||||
|
@ -1254,7 +1254,7 @@ int UI_icon_get_height(int icon_id)
|
|||
bool UI_icon_get_theme_color(int icon_id, uchar color[4])
|
||||
{
|
||||
Icon *icon = BKE_icon_get(icon_id);
|
||||
if (icon == NULL) {
|
||||
if (icon == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1325,7 +1325,7 @@ static void ui_studiolight_kill_icon_preview_job(wmWindowManager *wm, int icon_i
|
|||
{
|
||||
Icon *icon = BKE_icon_get(icon_id);
|
||||
WM_jobs_kill_type(wm, icon, WM_JOB_TYPE_STUDIOLIGHT);
|
||||
icon->obj = NULL;
|
||||
icon->obj = nullptr;
|
||||
}
|
||||
|
||||
static void ui_studiolight_free_function(StudioLight *sl, void *data)
|
||||
|
@ -1333,7 +1333,7 @@ static void ui_studiolight_free_function(StudioLight *sl, void *data)
|
|||
wmWindowManager *wm = static_cast<wmWindowManager *>(data);
|
||||
|
||||
/* Happens if job was canceled or already finished. */
|
||||
if (wm == NULL) {
|
||||
if (wm == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1357,26 +1357,26 @@ static void ui_studiolight_icon_job_end(void *customdata)
|
|||
Icon **tmp = (Icon **)customdata;
|
||||
Icon *icon = *tmp;
|
||||
StudioLight *sl = static_cast<StudioLight *>(icon->obj);
|
||||
BKE_studiolight_set_free_function(sl, &ui_studiolight_free_function, NULL);
|
||||
BKE_studiolight_set_free_function(sl, &ui_studiolight_free_function, nullptr);
|
||||
}
|
||||
|
||||
void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool big)
|
||||
{
|
||||
Icon *icon = BKE_icon_get(icon_id);
|
||||
|
||||
if (icon == NULL) {
|
||||
if (icon == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
DrawInfo *di = icon_ensure_drawinfo(icon);
|
||||
|
||||
if (di == NULL) {
|
||||
if (di == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (di->type) {
|
||||
case ICON_TYPE_PREVIEW: {
|
||||
ID *id = (icon->id_type != 0) ? static_cast<ID *>(icon->obj) : NULL;
|
||||
ID *id = (icon->id_type != 0) ? static_cast<ID *>(icon->obj) : nullptr;
|
||||
PreviewImage *prv = id ? BKE_previewimg_id_ensure(id) :
|
||||
static_cast<PreviewImage *>(icon->obj);
|
||||
/* Using jobs for screen previews crashes due to off-screen rendering.
|
||||
|
@ -1387,14 +1387,14 @@ void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool bi
|
|||
const int size = big ? ICON_SIZE_PREVIEW : ICON_SIZE_ICON;
|
||||
|
||||
if (id || (prv->tag & PRV_TAG_DEFFERED) != 0) {
|
||||
ui_id_preview_image_render_size(C, NULL, id, prv, size, use_jobs);
|
||||
ui_id_preview_image_render_size(C, nullptr, id, prv, size, use_jobs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ICON_TYPE_BUFFER: {
|
||||
if (icon->obj_type == ICON_DATA_STUDIOLIGHT) {
|
||||
if (di->data.buffer.image == NULL) {
|
||||
if (di->data.buffer.image == nullptr) {
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
StudioLight *sl = static_cast<StudioLight *>(icon->obj);
|
||||
BKE_studiolight_set_free_function(sl, &ui_studiolight_free_function, wm);
|
||||
|
@ -1418,7 +1418,7 @@ void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool bi
|
|||
WM_jobs_customdata_set(wm_job, tmp, MEM_freeN);
|
||||
WM_jobs_timer(wm_job, 0.01, 0, NC_WINDOW);
|
||||
WM_jobs_callbacks(
|
||||
wm_job, ui_studiolight_icon_job_exec, NULL, NULL, ui_studiolight_icon_job_end);
|
||||
wm_job, ui_studiolight_icon_job_exec, nullptr, nullptr, ui_studiolight_icon_job_end);
|
||||
WM_jobs_start(CTX_wm_manager(C), wm_job);
|
||||
}
|
||||
}
|
||||
|
@ -1452,7 +1452,7 @@ static void icon_set_image(const bContext *C,
|
|||
return;
|
||||
}
|
||||
|
||||
const bool delay = prv_img->rect[size] != NULL;
|
||||
const bool delay = prv_img->rect[size] != nullptr;
|
||||
icon_create_rect(prv_img, size);
|
||||
|
||||
if (use_job && (!id || BKE_previewimg_id_supports_jobs(id))) {
|
||||
|
@ -1472,14 +1472,14 @@ PreviewImage *UI_icon_to_preview(int icon_id)
|
|||
{
|
||||
Icon *icon = BKE_icon_get(icon_id);
|
||||
|
||||
if (icon == NULL) {
|
||||
return NULL;
|
||||
if (icon == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DrawInfo *di = (DrawInfo *)icon->drawinfo;
|
||||
|
||||
if (di == NULL) {
|
||||
return NULL;
|
||||
if (di == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (di->type == ICON_TYPE_PREVIEW) {
|
||||
|
@ -1496,7 +1496,7 @@ PreviewImage *UI_icon_to_preview(int icon_id)
|
|||
bbuf = IMB_ibImageFromMemory(di->data.buffer.image->datatoc_rect,
|
||||
di->data.buffer.image->datatoc_size,
|
||||
IB_rect,
|
||||
NULL,
|
||||
nullptr,
|
||||
__func__);
|
||||
if (bbuf) {
|
||||
PreviewImage *prv = BKE_previewimg_create();
|
||||
|
@ -1506,14 +1506,14 @@ PreviewImage *UI_icon_to_preview(int icon_id)
|
|||
prv->w[0] = bbuf->x;
|
||||
prv->h[0] = bbuf->y;
|
||||
|
||||
bbuf->rect = NULL;
|
||||
bbuf->rect = nullptr;
|
||||
IMB_freeImBuf(bbuf);
|
||||
|
||||
return prv;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void icon_draw_rect(float x,
|
||||
|
@ -1604,7 +1604,7 @@ static struct {
|
|||
bool enabled;
|
||||
} g_icon_draw_cache = {{{{{0}}}}};
|
||||
|
||||
void UI_icon_draw_cache_begin(void)
|
||||
void UI_icon_draw_cache_begin()
|
||||
{
|
||||
BLI_assert(g_icon_draw_cache.enabled == false);
|
||||
g_icon_draw_cache.enabled = true;
|
||||
|
@ -1668,7 +1668,7 @@ static void icon_draw_cache_flush_ex(bool only_full_caches)
|
|||
}
|
||||
}
|
||||
|
||||
void UI_icon_draw_cache_end(void)
|
||||
void UI_icon_draw_cache_end()
|
||||
{
|
||||
BLI_assert(g_icon_draw_cache.enabled == true);
|
||||
g_icon_draw_cache.enabled = false;
|
||||
|
@ -1860,7 +1860,7 @@ static void icon_draw_size(float x,
|
|||
Icon *icon = BKE_icon_get(icon_id);
|
||||
alpha *= btheme->tui.icon_alpha;
|
||||
|
||||
if (icon == NULL) {
|
||||
if (icon == nullptr) {
|
||||
if (G.debug & G_DEBUG) {
|
||||
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
|
||||
}
|
||||
|
@ -1907,7 +1907,7 @@ static void icon_draw_size(float x,
|
|||
/* This could re-generate often if rendered at different sizes in the one interface.
|
||||
* TODO(@campbellbarton): support caching multiple sizes. */
|
||||
ImBuf *ibuf = di->data.geom.image_cache;
|
||||
if ((ibuf == NULL) || (ibuf->x != w) || (ibuf->y != h) || (invert != geom_inverted)) {
|
||||
if ((ibuf == nullptr) || (ibuf->x != w) || (ibuf->y != h) || (invert != geom_inverted)) {
|
||||
if (ibuf) {
|
||||
IMB_freeImBuf(ibuf);
|
||||
}
|
||||
|
@ -1939,7 +1939,7 @@ static void icon_draw_size(float x,
|
|||
di->data.texture.w,
|
||||
di->data.texture.h,
|
||||
alpha,
|
||||
NULL,
|
||||
nullptr,
|
||||
false,
|
||||
text_overlay);
|
||||
}
|
||||
|
@ -2011,7 +2011,7 @@ static void icon_draw_size(float x,
|
|||
}
|
||||
}
|
||||
else if (di->type == ICON_TYPE_GPLAYER) {
|
||||
BLI_assert(icon->obj != NULL);
|
||||
BLI_assert(icon->obj != nullptr);
|
||||
|
||||
/* Just draw a colored rect - Like for vicon_colorset_draw() */
|
||||
#ifndef WITH_HEADLESS
|
||||
|
@ -2046,7 +2046,7 @@ void UI_icon_render_id(
|
|||
const bContext *C, Scene *scene, ID *id, const enum eIconSizes size, const bool use_job)
|
||||
{
|
||||
PreviewImage *pi = BKE_previewimg_id_ensure(id);
|
||||
if (pi == NULL) {
|
||||
if (pi == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2076,7 +2076,7 @@ static void ui_id_icon_render(const bContext *C, ID *id, bool use_jobs)
|
|||
}
|
||||
|
||||
for (int i = 0; i < NUM_ICON_SIZES; i++) {
|
||||
ui_id_preview_image_render_size(C, NULL, id, pi, i, use_jobs);
|
||||
ui_id_preview_image_render_size(C, nullptr, id, pi, i, use_jobs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2090,7 +2090,7 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id)
|
|||
}
|
||||
else {
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
const EnumPropertyItem *items = NULL;
|
||||
const EnumPropertyItem *items = nullptr;
|
||||
ePaintMode paint_mode = PAINT_MODE_INVALID;
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
char space_type = area->spacetype;
|
||||
|
@ -2130,7 +2130,8 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id)
|
|||
}
|
||||
|
||||
/* reset the icon */
|
||||
if ((ob != NULL) && (ob->mode & OB_MODE_ALL_PAINT_GPENCIL) && (br->gpencil_settings != NULL)) {
|
||||
if ((ob != nullptr) && (ob->mode & OB_MODE_ALL_PAINT_GPENCIL) &&
|
||||
(br->gpencil_settings != nullptr)) {
|
||||
switch (br->gpencil_settings->icon_id) {
|
||||
case GP_BRUSH_ICON_PENCIL:
|
||||
br->id.icon_id = ICON_GPBRUSH_PENCIL;
|
||||
|
@ -2264,7 +2265,7 @@ int ui_id_icon_get(const bContext *C, ID *id, const bool big)
|
|||
case ID_LA: /* fall through */
|
||||
iconid = BKE_icon_id_ensure(id);
|
||||
/* checks if not exists, or changed */
|
||||
UI_icon_render_id(C, NULL, id, big ? ICON_SIZE_PREVIEW : ICON_SIZE_ICON, true);
|
||||
UI_icon_render_id(C, nullptr, id, big ? ICON_SIZE_PREVIEW : ICON_SIZE_ICON, true);
|
||||
break;
|
||||
case ID_SCR:
|
||||
iconid = ui_id_screen_get_icon(C, id);
|
||||
|
@ -2306,7 +2307,7 @@ int UI_icon_from_library(const ID *id)
|
|||
|
||||
int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, const bool big)
|
||||
{
|
||||
ID *id = NULL;
|
||||
ID *id = nullptr;
|
||||
|
||||
if (!ptr->data) {
|
||||
return rnaicon;
|
||||
|
@ -2490,12 +2491,14 @@ int UI_icon_color_from_collection(const Collection *collection)
|
|||
|
||||
void UI_icon_draw(float x, float y, int icon_id)
|
||||
{
|
||||
UI_icon_draw_ex(x, y, icon_id, U.inv_dpi_fac, 1.0f, 0.0f, NULL, false, UI_NO_ICON_OVERLAY_TEXT);
|
||||
UI_icon_draw_ex(
|
||||
x, y, icon_id, U.inv_dpi_fac, 1.0f, 0.0f, nullptr, false, UI_NO_ICON_OVERLAY_TEXT);
|
||||
}
|
||||
|
||||
void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha)
|
||||
{
|
||||
UI_icon_draw_ex(x, y, icon_id, U.inv_dpi_fac, alpha, 0.0f, NULL, false, UI_NO_ICON_OVERLAY_TEXT);
|
||||
UI_icon_draw_ex(
|
||||
x, y, icon_id, U.inv_dpi_fac, alpha, 0.0f, nullptr, false, UI_NO_ICON_OVERLAY_TEXT);
|
||||
}
|
||||
|
||||
void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
|
||||
|
@ -2508,7 +2511,7 @@ void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alp
|
|||
ICON_SIZE_PREVIEW,
|
||||
size,
|
||||
false,
|
||||
NULL,
|
||||
nullptr,
|
||||
false,
|
||||
UI_NO_ICON_OVERLAY_TEXT);
|
||||
}
|
||||
|
@ -2554,7 +2557,7 @@ ImBuf *UI_icon_alert_imbuf_get(eAlertIcon icon)
|
|||
{
|
||||
#ifdef WITH_HEADLESS
|
||||
UNUSED_VARS(icon);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#else
|
||||
const int ALERT_IMG_SIZE = 256;
|
||||
icon = eAlertIcon(MIN2(icon, ALERT_ICON_MAX - 1));
|
||||
|
@ -2563,7 +2566,7 @@ ImBuf *UI_icon_alert_imbuf_get(eAlertIcon icon)
|
|||
ImBuf *ibuf = IMB_ibImageFromMemory((const uchar *)datatoc_alert_icons_png,
|
||||
datatoc_alert_icons_png_size,
|
||||
IB_rect,
|
||||
NULL,
|
||||
nullptr,
|
||||
"alert_icon");
|
||||
IMB_rect_crop(ibuf, &crop);
|
||||
IMB_premultiply_alpha(ibuf);
|
||||
|
|
|
@ -489,7 +489,7 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
|
|||
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (i != index) {
|
||||
RNA_property_boolean_set_index(ptr, prop, i, 0);
|
||||
RNA_property_boolean_set_index(ptr, prop, i, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ static void ui_item_array(uiLayout *layout,
|
|||
const PropertyType type = RNA_property_type(prop);
|
||||
const PropertySubType subtype = RNA_property_subtype(prop);
|
||||
|
||||
uiLayout *sub = ui_item_local_sublayout(layout, layout, 1);
|
||||
uiLayout *sub = ui_item_local_sublayout(layout, layout, true);
|
||||
UI_block_layout_set_current(block, sub);
|
||||
|
||||
/* create label */
|
||||
|
@ -773,7 +773,7 @@ static void ui_item_enum_expand_elem_exec(uiLayout *layout,
|
|||
const char *name = (!uiname || uiname[0]) ? item->name : "";
|
||||
const int icon = item->icon;
|
||||
const int value = item->value;
|
||||
const int itemw = ui_text_icon_width(block->curlayout, icon_only ? "" : name, icon, 0);
|
||||
const int itemw = ui_text_icon_width(block->curlayout, icon_only ? "" : name, icon, false);
|
||||
|
||||
uiBut *but;
|
||||
if (icon && name[0] && !icon_only) {
|
||||
|
@ -863,7 +863,7 @@ static void ui_item_enum_expand_exec(uiLayout *layout,
|
|||
UI_block_layout_set_current(block, layout);
|
||||
}
|
||||
else {
|
||||
UI_block_layout_set_current(block, ui_item_local_sublayout(layout, layout, 1));
|
||||
UI_block_layout_set_current(block, ui_item_local_sublayout(layout, layout, true));
|
||||
}
|
||||
|
||||
for (const EnumPropertyItem *item = item_array; item->identifier; item++) {
|
||||
|
@ -1186,7 +1186,7 @@ static void ui_item_disabled(uiLayout *layout, const char *name)
|
|||
name = "";
|
||||
}
|
||||
|
||||
const int w = ui_text_icon_width(layout, name, 0, 0);
|
||||
const int w = ui_text_icon_width(layout, name, 0, false);
|
||||
|
||||
uiBut *but = uiDefBut(
|
||||
block, UI_BTYPE_LABEL, 0, name, 0, 0, w, UI_UNIT_Y, nullptr, 0.0, 0.0, 0, 0, "");
|
||||
|
@ -1226,7 +1226,7 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
|
|||
UI_block_layout_set_current(block, layout);
|
||||
ui_block_new_button_group(block, uiButtonGroupFlag(0));
|
||||
|
||||
const int w = ui_text_icon_width(layout, name, icon, 0);
|
||||
const int w = ui_text_icon_width(layout, name, icon, false);
|
||||
|
||||
const eUIEmbossType prev_emboss = layout->emboss;
|
||||
if (flag & UI_ITEM_R_NO_BG) {
|
||||
|
@ -1365,7 +1365,7 @@ void uiItemFullO(uiLayout *layout,
|
|||
int flag,
|
||||
PointerRNA *r_opptr)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, {
|
||||
if (r_opptr) {
|
||||
|
@ -1440,7 +1440,7 @@ void uiItemEnumO(uiLayout *layout,
|
|||
const char *propname,
|
||||
int value)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
if (ot) {
|
||||
uiItemEnumO_ptr(layout, ot, name, icon, propname, value);
|
||||
|
@ -1620,7 +1620,7 @@ void uiItemsFullEnumO(uiLayout *layout,
|
|||
wmOperatorCallContext context,
|
||||
int flag)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
if (!ot || !ot->srna) {
|
||||
ui_item_disabled(layout, opname);
|
||||
|
@ -1694,7 +1694,7 @@ void uiItemEnumO_value(uiLayout *layout,
|
|||
const char *propname,
|
||||
int value)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
PointerRNA ptr;
|
||||
|
@ -1731,7 +1731,7 @@ void uiItemEnumO_string(uiLayout *layout,
|
|||
const char *propname,
|
||||
const char *value_str)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
PointerRNA ptr;
|
||||
|
@ -1787,7 +1787,7 @@ void uiItemBooleanO(uiLayout *layout,
|
|||
const char *propname,
|
||||
int value)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
PointerRNA ptr;
|
||||
|
@ -1811,7 +1811,7 @@ void uiItemIntO(uiLayout *layout,
|
|||
const char *propname,
|
||||
int value)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
PointerRNA ptr;
|
||||
|
@ -1835,7 +1835,7 @@ void uiItemFloatO(uiLayout *layout,
|
|||
const char *propname,
|
||||
float value)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
|
@ -1860,7 +1860,7 @@ void uiItemStringO(uiLayout *layout,
|
|||
const char *propname,
|
||||
const char *value)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
|
@ -2922,7 +2922,7 @@ void uiItemPointerR_prop(uiLayout *layout,
|
|||
uiBlock *block = uiLayoutGetBlock(layout);
|
||||
|
||||
int w, h;
|
||||
ui_item_rna_size(layout, name, icon, ptr, prop, 0, 0, false, &w, &h);
|
||||
ui_item_rna_size(layout, name, icon, ptr, prop, 0, false, false, &w, &h);
|
||||
w += UI_UNIT_X; /* X icon needs more space */
|
||||
uiBut *but = ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h, 0);
|
||||
|
||||
|
@ -3401,7 +3401,7 @@ void uiItemV(uiLayout *layout, const char *name, int icon, int argval)
|
|||
icon = ICON_BLANK1;
|
||||
}
|
||||
|
||||
const int w = ui_text_icon_width(layout, name, icon, 0);
|
||||
const int w = ui_text_icon_width(layout, name, icon, false);
|
||||
|
||||
if (icon && name[0]) {
|
||||
uiDefIconTextButI(block,
|
||||
|
@ -3592,7 +3592,7 @@ void uiItemMenuEnumFullO(uiLayout *layout,
|
|||
int icon,
|
||||
PointerRNA *r_opptr)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
UI_OPERATOR_ERROR_RET(ot, opname, return );
|
||||
|
||||
|
@ -4891,7 +4891,7 @@ uiLayout *uiLayoutRadial(uiLayout *layout)
|
|||
{
|
||||
/* radial layouts are only valid for radial menus */
|
||||
if (layout->root->type != UI_LAYOUT_PIEMENU) {
|
||||
return ui_item_local_sublayout(layout, layout, 0);
|
||||
return ui_item_local_sublayout(layout, layout, false);
|
||||
}
|
||||
|
||||
/* only one radial wheel per root layout is allowed, so check and return that, if it exists */
|
||||
|
|
|
@ -815,7 +815,7 @@ ARegion *ui_screen_region_find_mouse_over(bScreen *screen, const wmEvent *event)
|
|||
/** \name Manage Internal State
|
||||
* \{ */
|
||||
|
||||
void ui_interface_tag_script_reload_queries(void)
|
||||
void ui_interface_tag_script_reload_queries()
|
||||
{
|
||||
g_ot_tool_set_by_id = nullptr;
|
||||
}
|
||||
|
|
|
@ -363,7 +363,7 @@ int UI_fontstyle_height_max(const uiFontStyle *fs)
|
|||
|
||||
/* ************** init exit ************************ */
|
||||
|
||||
void uiStyleInit(void)
|
||||
void uiStyleInit()
|
||||
{
|
||||
const uiStyle *style = static_cast<uiStyle *>(U.uistyles.first);
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ static int template_search_textbut_width(PointerRNA *ptr, PropertyRNA *name_prop
|
|||
estimated_width, TEMPLATE_SEARCH_TEXTBUT_MIN_WIDTH, TEMPLATE_SEARCH_TEXTBUT_MIN_WIDTH * 3);
|
||||
}
|
||||
|
||||
static int template_search_textbut_height(void)
|
||||
static int template_search_textbut_height()
|
||||
{
|
||||
return TEMPLATE_SEARCH_TEXTBUT_HEIGHT;
|
||||
}
|
||||
|
@ -6681,7 +6681,7 @@ static uiBlock *component_menu(bContext *C, ARegion *region, void *args_v)
|
|||
UI_UNIT_Y,
|
||||
0,
|
||||
UI_style_get()),
|
||||
0);
|
||||
false);
|
||||
|
||||
uiItemR(layout, &args->ptr, args->propname, UI_ITEM_R_EXPAND, "", ICON_NONE);
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ void ui_textedit_undo_push(uiUndoStack_Text *stack, const char *text, int cursor
|
|||
BLI_addtail(&stack->states, stack->current);
|
||||
}
|
||||
|
||||
uiUndoStack_Text *ui_textedit_undo_stack_create(void)
|
||||
uiUndoStack_Text *ui_textedit_undo_stack_create()
|
||||
{
|
||||
uiUndoStack_Text *stack = MEM_new<uiUndoStack_Text>(__func__);
|
||||
stack->current = nullptr;
|
||||
|
|
|
@ -403,9 +403,9 @@ static struct {
|
|||
/* TODO: remove. */
|
||||
GPUVertFormat format;
|
||||
uint vflag_id;
|
||||
} g_ui_batch_cache = {0};
|
||||
} g_ui_batch_cache = {nullptr};
|
||||
|
||||
static GPUVertFormat *vflag_format(void)
|
||||
static GPUVertFormat *vflag_format()
|
||||
{
|
||||
if (g_ui_batch_cache.format.attr_len == 0) {
|
||||
GPUVertFormat *format = &g_ui_batch_cache.format;
|
||||
|
@ -444,7 +444,7 @@ static uint32_t set_roundbox_vertex(GPUVertBufRaw *vflag_step,
|
|||
return *data;
|
||||
}
|
||||
|
||||
GPUBatch *ui_batch_roundbox_widget_get(void)
|
||||
GPUBatch *ui_batch_roundbox_widget_get()
|
||||
{
|
||||
if (g_ui_batch_cache.roundbox_widget == nullptr) {
|
||||
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(vflag_format());
|
||||
|
@ -470,7 +470,7 @@ GPUBatch *ui_batch_roundbox_widget_get(void)
|
|||
return g_ui_batch_cache.roundbox_widget;
|
||||
}
|
||||
|
||||
GPUBatch *ui_batch_roundbox_shadow_get(void)
|
||||
GPUBatch *ui_batch_roundbox_shadow_get()
|
||||
{
|
||||
if (g_ui_batch_cache.roundbox_shadow == nullptr) {
|
||||
uint32_t last_data;
|
||||
|
@ -1132,7 +1132,7 @@ static struct {
|
|||
bool enabled;
|
||||
} g_widget_base_batch = {{{{0}}}};
|
||||
|
||||
void UI_widgetbase_draw_cache_flush(void)
|
||||
void UI_widgetbase_draw_cache_flush()
|
||||
{
|
||||
const float checker_params[3] = {
|
||||
UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, 8.0f};
|
||||
|
@ -1162,13 +1162,13 @@ void UI_widgetbase_draw_cache_flush(void)
|
|||
g_widget_base_batch.count = 0;
|
||||
}
|
||||
|
||||
void UI_widgetbase_draw_cache_begin(void)
|
||||
void UI_widgetbase_draw_cache_begin()
|
||||
{
|
||||
BLI_assert(g_widget_base_batch.enabled == false);
|
||||
g_widget_base_batch.enabled = true;
|
||||
}
|
||||
|
||||
void UI_widgetbase_draw_cache_end(void)
|
||||
void UI_widgetbase_draw_cache_end()
|
||||
{
|
||||
BLI_assert(g_widget_base_batch.enabled == true);
|
||||
g_widget_base_batch.enabled = false;
|
||||
|
@ -1183,7 +1183,7 @@ void UI_widgetbase_draw_cache_end(void)
|
|||
/* Disable cached/instanced drawing and enforce single widget drawing pipeline.
|
||||
* Works around interface artifacts happening on certain driver and hardware
|
||||
* configurations. */
|
||||
static bool draw_widgetbase_batch_skip_draw_cache(void)
|
||||
static bool draw_widgetbase_batch_skip_draw_cache()
|
||||
{
|
||||
/* MacOS is known to have issues on Mac Mini and MacBook Pro with Intel Iris GPU.
|
||||
* For example, T78307. */
|
||||
|
@ -5257,7 +5257,7 @@ void ui_draw_pie_center(uiBlock *block)
|
|||
GPU_matrix_pop();
|
||||
}
|
||||
|
||||
const uiWidgetColors *ui_tooltip_get_theme(void)
|
||||
const uiWidgetColors *ui_tooltip_get_theme()
|
||||
{
|
||||
uiWidgetType *wt = widget_type(UI_WTYPE_TOOLTIP);
|
||||
return wt->wcol_theme;
|
||||
|
|
|
@ -82,9 +82,9 @@ struct CursorSnapshot {
|
|||
int curve_preset;
|
||||
};
|
||||
|
||||
static TexSnapshot primary_snap = {0};
|
||||
static TexSnapshot secondary_snap = {0};
|
||||
static CursorSnapshot cursor_snap = {0};
|
||||
static TexSnapshot primary_snap = {nullptr};
|
||||
static TexSnapshot secondary_snap = {nullptr};
|
||||
static CursorSnapshot cursor_snap = {nullptr};
|
||||
|
||||
void paint_cursor_delete_textures(void)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ static void make_tex_snap(TexSnapshot *snap, ViewContext *vc, float zoom)
|
|||
snap->winy = vc->region->winy;
|
||||
}
|
||||
|
||||
typedef struct LoadTexData {
|
||||
struct LoadTexData {
|
||||
Brush *br;
|
||||
ViewContext *vc;
|
||||
|
||||
|
@ -132,11 +132,11 @@ typedef struct LoadTexData {
|
|||
uchar *buffer;
|
||||
bool col;
|
||||
|
||||
struct ImagePool *pool;
|
||||
ImagePool *pool;
|
||||
int size;
|
||||
float rotation;
|
||||
float radius;
|
||||
} LoadTexData;
|
||||
};
|
||||
|
||||
static void load_tex_task_cb_ex(void *__restrict userdata,
|
||||
const int j,
|
||||
|
@ -150,13 +150,13 @@ static void load_tex_task_cb_ex(void *__restrict userdata,
|
|||
uchar *buffer = data->buffer;
|
||||
const bool col = data->col;
|
||||
|
||||
struct ImagePool *pool = data->pool;
|
||||
ImagePool *pool = data->pool;
|
||||
const int size = data->size;
|
||||
const float rotation = data->rotation;
|
||||
const float radius = data->radius;
|
||||
|
||||
bool convert_to_linear = false;
|
||||
struct ColorSpace *colorspace = nullptr;
|
||||
ColorSpace *colorspace = nullptr;
|
||||
|
||||
const int thread_id = BLI_task_parallel_thread_id(tls);
|
||||
|
||||
|
@ -253,10 +253,10 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
|
|||
refresh = !target->overlay_texture || (invalid != 0) ||
|
||||
!same_tex_snap(target, mtex, vc, col, zoom);
|
||||
|
||||
init = (target->overlay_texture != 0);
|
||||
init = (target->overlay_texture != nullptr);
|
||||
|
||||
if (refresh) {
|
||||
struct ImagePool *pool = nullptr;
|
||||
ImagePool *pool = nullptr;
|
||||
/* Stencil is rotated later. */
|
||||
const float rotation = (mtex->brush_map_mode != MTEX_MAP_MODE_STENCIL) ? -mtex->rot : 0.0f;
|
||||
const float radius = BKE_brush_size_get(vc->scene, br) * zoom;
|
||||
|
@ -406,7 +406,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
|
|||
(overlay_flags & PAINT_OVERLAY_INVALID_CURVE) || cursor_snap.zoom != zoom ||
|
||||
cursor_snap.curve_preset != br->curve_preset;
|
||||
|
||||
init = (cursor_snap.overlay_texture != 0);
|
||||
init = (cursor_snap.overlay_texture != nullptr);
|
||||
|
||||
if (refresh) {
|
||||
int s, r;
|
||||
|
@ -1194,13 +1194,13 @@ static bool paint_use_2d_cursor(ePaintMode mode)
|
|||
return false;
|
||||
}
|
||||
|
||||
typedef enum PaintCursorDrawingType {
|
||||
enum PaintCursorDrawingType {
|
||||
PAINT_CURSOR_CURVE,
|
||||
PAINT_CURSOR_2D,
|
||||
PAINT_CURSOR_3D,
|
||||
} PaintCursorDrawingType;
|
||||
};
|
||||
|
||||
typedef struct PaintCursorContext {
|
||||
struct PaintCursorContext {
|
||||
bContext *C;
|
||||
ARegion *region;
|
||||
wmWindow *win;
|
||||
|
@ -1246,8 +1246,7 @@ typedef struct PaintCursorContext {
|
|||
|
||||
float final_radius;
|
||||
int pixel_radius;
|
||||
|
||||
} PaintCursorContext;
|
||||
};
|
||||
|
||||
static bool paint_cursor_context_init(bContext *C,
|
||||
const int x,
|
||||
|
@ -1895,7 +1894,7 @@ static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext)
|
|||
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
}
|
||||
|
||||
static void paint_cursor_restore_drawing_state(void)
|
||||
static void paint_cursor_restore_drawing_state()
|
||||
{
|
||||
immUnbindProgram();
|
||||
GPU_blend(GPU_BLEND_NONE);
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* \brief Functions to paint images in 2D and 3D.
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cfloat>
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
@ -194,7 +194,7 @@ BLI_INLINE uchar f_to_char(const float val)
|
|||
* their imbufs, etc, in 1 array, When using threads this array is copied for each thread
|
||||
* because 'partRedrawRect' and 'touch' values would not be thread safe.
|
||||
*/
|
||||
typedef struct ProjPaintImage {
|
||||
struct ProjPaintImage {
|
||||
Image *ima;
|
||||
ImageUser iuser;
|
||||
ImBuf *ibuf;
|
||||
|
@ -207,12 +207,12 @@ typedef struct ProjPaintImage {
|
|||
/** Store flag to enforce validation of undo rectangle. */
|
||||
bool **valid;
|
||||
bool touch;
|
||||
} ProjPaintImage;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle for stroke (operator customdata)
|
||||
*/
|
||||
typedef struct ProjStrokeHandle {
|
||||
struct ProjStrokeHandle {
|
||||
/* Support for painting from multiple views at once,
|
||||
* currently used to implement symmetry painting,
|
||||
* we can assume at least the first is set while painting. */
|
||||
|
@ -230,16 +230,16 @@ typedef struct ProjStrokeHandle {
|
|||
/* In ProjPaintState, only here for convenience */
|
||||
Scene *scene;
|
||||
Brush *brush;
|
||||
} ProjStrokeHandle;
|
||||
};
|
||||
|
||||
typedef struct LoopSeamData {
|
||||
struct LoopSeamData {
|
||||
float seam_uvs[2][2];
|
||||
float seam_puvs[2][2];
|
||||
float corner_dist_sq[2];
|
||||
} LoopSeamData;
|
||||
};
|
||||
|
||||
/* Main projection painting struct passed to all projection painting functions */
|
||||
typedef struct ProjPaintState {
|
||||
struct ProjPaintState {
|
||||
View3D *v3d;
|
||||
RegionView3D *rv3d;
|
||||
ARegion *region;
|
||||
|
@ -368,7 +368,7 @@ typedef struct ProjPaintState {
|
|||
/** must lock threads while accessing these. */
|
||||
int context_bucket_index;
|
||||
|
||||
struct CurveMapping *cavity_curve;
|
||||
CurveMapping *cavity_curve;
|
||||
BlurKernel *blurkernel;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
@ -436,23 +436,23 @@ typedef struct ProjPaintState {
|
|||
Material **mat_array;
|
||||
|
||||
bool use_colormanagement;
|
||||
} ProjPaintState;
|
||||
};
|
||||
|
||||
typedef union pixelPointer {
|
||||
union PixelPointer {
|
||||
/** float buffer. */
|
||||
float *f_pt;
|
||||
/** 2 ways to access a char buffer. */
|
||||
uint *uint_pt;
|
||||
uchar *ch_pt;
|
||||
} PixelPointer;
|
||||
};
|
||||
|
||||
typedef union pixelStore {
|
||||
union PixelStore {
|
||||
uchar ch[4];
|
||||
uint uint_;
|
||||
float f[4];
|
||||
} PixelStore;
|
||||
};
|
||||
|
||||
typedef struct ProjPixel {
|
||||
struct ProjPixel {
|
||||
/** the floating point screen projection of this pixel. */
|
||||
float projCoSS[2];
|
||||
float worldCoSS[3];
|
||||
|
@ -479,30 +479,30 @@ typedef struct ProjPixel {
|
|||
PixelPointer origColor;
|
||||
PixelStore newColor;
|
||||
PixelPointer pixel;
|
||||
} ProjPixel;
|
||||
};
|
||||
|
||||
typedef struct ProjPixelClone {
|
||||
struct ProjPixelClone {
|
||||
struct ProjPixel __pp;
|
||||
PixelStore clonepx;
|
||||
} ProjPixelClone;
|
||||
};
|
||||
|
||||
/* undo tile pushing */
|
||||
typedef struct {
|
||||
struct TileInfo {
|
||||
SpinLock *lock;
|
||||
bool masked;
|
||||
ushort tile_width;
|
||||
ImBuf **tmpibuf;
|
||||
ProjPaintImage *pjima;
|
||||
} TileInfo;
|
||||
};
|
||||
|
||||
typedef struct VertSeam {
|
||||
struct VertSeam {
|
||||
struct VertSeam *next, *prev;
|
||||
int tri;
|
||||
uint loop;
|
||||
float angle;
|
||||
bool normal_cw;
|
||||
float uv[2];
|
||||
} VertSeam;
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name MLoopTri accessor functions.
|
||||
|
@ -2030,14 +2030,14 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps,
|
|||
* the faces are already initialized in project_paint_delayed_face_init(...) */
|
||||
if (ibuf->rect_float) {
|
||||
if (!project_paint_PickColor(
|
||||
ps, co, ((ProjPixelClone *)projPixel)->clonepx.f, nullptr, 1)) {
|
||||
ps, co, ((ProjPixelClone *)projPixel)->clonepx.f, nullptr, true)) {
|
||||
/* zero alpha - ignore */
|
||||
((ProjPixelClone *)projPixel)->clonepx.f[3] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!project_paint_PickColor(
|
||||
ps, co, nullptr, ((ProjPixelClone *)projPixel)->clonepx.ch, 1)) {
|
||||
ps, co, nullptr, ((ProjPixelClone *)projPixel)->clonepx.ch, true)) {
|
||||
/* zero alpha - ignore */
|
||||
((ProjPixelClone *)projPixel)->clonepx.ch[3] = 0;
|
||||
}
|
||||
|
@ -3738,7 +3738,7 @@ static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmet
|
|||
|
||||
if (ps->source == PROJ_SRC_IMAGE_VIEW) {
|
||||
/* image stores camera data, tricky */
|
||||
IDProperty *idgroup = IDP_GetProperties(&ps->reproject_image->id, 0);
|
||||
IDProperty *idgroup = IDP_GetProperties(&ps->reproject_image->id, false);
|
||||
IDProperty *view_data = IDP_GetPropertyFromGroup(idgroup, PROJ_VIEW_DATA_ID);
|
||||
|
||||
const float *array = (float *)IDP_Array(view_data);
|
||||
|
@ -3750,7 +3750,7 @@ static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmet
|
|||
array += sizeof(viewmat) / sizeof(float);
|
||||
ps->clip_start = array[0];
|
||||
ps->clip_end = array[1];
|
||||
ps->is_ortho = array[2] ? 1 : 0;
|
||||
ps->is_ortho = bool(array[2]);
|
||||
|
||||
invert_m4_m4(viewinv, viewmat);
|
||||
}
|
||||
|
@ -4104,11 +4104,11 @@ static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *p
|
|||
return true;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
struct ProjPaintLayerClone {
|
||||
const MLoopUV *mloopuv_clone_base;
|
||||
const TexPaintSlot *slot_last_clone;
|
||||
const TexPaintSlot *slot_clone;
|
||||
} ProjPaintLayerClone;
|
||||
};
|
||||
|
||||
static void proj_paint_layer_clone_init(ProjPaintState *ps, ProjPaintLayerClone *layer_clone)
|
||||
{
|
||||
|
@ -4173,11 +4173,11 @@ static bool project_paint_clone_face_skip(ProjPaintState *ps,
|
|||
return false;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
struct ProjPaintFaceLookup {
|
||||
const bool *select_poly_orig;
|
||||
|
||||
const int *index_mp_to_orig;
|
||||
} ProjPaintFaceLookup;
|
||||
};
|
||||
|
||||
static void proj_paint_face_lookup_init(const ProjPaintState *ps, ProjPaintFaceLookup *face_lookup)
|
||||
{
|
||||
|
@ -4208,11 +4208,11 @@ static bool project_paint_check_face_sel(const ProjPaintState *ps,
|
|||
return true;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
struct ProjPaintFaceCoSS {
|
||||
const float *v1;
|
||||
const float *v2;
|
||||
const float *v3;
|
||||
} ProjPaintFaceCoSS;
|
||||
};
|
||||
|
||||
static void proj_paint_face_coSS_init(const ProjPaintState *ps,
|
||||
const MLoopTri *lt,
|
||||
|
@ -4255,11 +4255,11 @@ static bool project_paint_winclip(const ProjPaintState *ps, const ProjPaintFaceC
|
|||
}
|
||||
#endif /* PROJ_DEBUG_WINCLIP */
|
||||
|
||||
typedef struct PrepareImageEntry {
|
||||
struct PrepareImageEntry {
|
||||
struct PrepareImageEntry *next, *prev;
|
||||
Image *ima;
|
||||
ImageUser iuser;
|
||||
} PrepareImageEntry;
|
||||
};
|
||||
|
||||
static void project_paint_build_proj_ima(ProjPaintState *ps,
|
||||
MemArena *arena,
|
||||
|
@ -4278,7 +4278,7 @@ static void project_paint_build_proj_ima(ProjPaintState *ps,
|
|||
projIma->iuser = entry->iuser;
|
||||
int size;
|
||||
projIma->ima = entry->ima;
|
||||
projIma->touch = 0;
|
||||
projIma->touch = false;
|
||||
projIma->ibuf = BKE_image_acquire_ibuf(projIma->ima, &projIma->iuser, nullptr);
|
||||
if (projIma->ibuf == nullptr) {
|
||||
projIma->iuser.tile = 0;
|
||||
|
@ -4730,7 +4730,7 @@ static bool project_image_refresh_tagged(ProjPaintState *ps)
|
|||
}
|
||||
|
||||
/* clear for reuse */
|
||||
projIma->touch = 0;
|
||||
projIma->touch = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4810,7 +4810,7 @@ static bool project_bucket_iter_next(ProjPaintState *ps,
|
|||
}
|
||||
|
||||
/* Each thread gets one of these, also used as an argument to pass to project_paint_op */
|
||||
typedef struct ProjectHandle {
|
||||
struct ProjectHandle {
|
||||
/* args */
|
||||
ProjPaintState *ps;
|
||||
float prevmval[2];
|
||||
|
@ -4826,7 +4826,7 @@ typedef struct ProjectHandle {
|
|||
int thread_index;
|
||||
|
||||
struct ImagePool *pool;
|
||||
} ProjectHandle;
|
||||
};
|
||||
|
||||
static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float mask)
|
||||
{
|
||||
|
@ -5177,7 +5177,7 @@ static void do_projectpaint_thread(TaskPool *__restrict /*pool*/, void *ph_v)
|
|||
const float *lastpos = ((ProjectHandle *)ph_v)->prevmval;
|
||||
const float *pos = ((ProjectHandle *)ph_v)->mval;
|
||||
const int thread_index = ((ProjectHandle *)ph_v)->thread_index;
|
||||
struct ImagePool *pool = ((ProjectHandle *)ph_v)->pool;
|
||||
ImagePool *pool = ((ProjectHandle *)ph_v)->pool;
|
||||
/* Done with args from ProjectHandle */
|
||||
|
||||
LinkNode *node;
|
||||
|
@ -5257,7 +5257,7 @@ static void do_projectpaint_thread(TaskPool *__restrict /*pool*/, void *ph_v)
|
|||
last_index = projPixel->image_index;
|
||||
last_projIma = projImages + last_index;
|
||||
|
||||
last_projIma->touch = 1;
|
||||
last_projIma->touch = true;
|
||||
is_floatbuf = (last_projIma->ibuf->rect_float != nullptr);
|
||||
}
|
||||
/* end copy */
|
||||
|
@ -5484,7 +5484,7 @@ static void do_projectpaint_thread(TaskPool *__restrict /*pool*/, void *ph_v)
|
|||
last_index = projPixel->image_index;
|
||||
last_projIma = projImages + last_index;
|
||||
|
||||
last_projIma->touch = 1;
|
||||
last_projIma->touch = true;
|
||||
is_floatbuf = (last_projIma->ibuf->rect_float != nullptr);
|
||||
}
|
||||
/* end copy */
|
||||
|
@ -5606,7 +5606,7 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po
|
|||
TaskPool *task_pool = nullptr;
|
||||
int a, i;
|
||||
|
||||
struct ImagePool *image_pool;
|
||||
ImagePool *image_pool;
|
||||
|
||||
if (!project_bucket_iter_init(ps, pos)) {
|
||||
return touch_any;
|
||||
|
@ -5691,7 +5691,7 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po
|
|||
|
||||
/* move threaded bounds back into ps->projectPartialRedraws */
|
||||
for (i = 0; i < ps->image_tot; i++) {
|
||||
int touch = 0;
|
||||
int touch = false;
|
||||
for (a = 0; a < ps->thread_tot; a++) {
|
||||
touch |= int(partial_redraw_array_merge(ps->projImages[i].partRedrawRect,
|
||||
handles[a].projImages[i].partRedrawRect,
|
||||
|
@ -5699,7 +5699,7 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po
|
|||
}
|
||||
|
||||
if (touch) {
|
||||
ps->projImages[i].touch = 1;
|
||||
ps->projImages[i].touch = true;
|
||||
touch_any = 1;
|
||||
}
|
||||
}
|
||||
|
@ -5801,7 +5801,7 @@ void paint_proj_stroke(const bContext *C,
|
|||
/* clone gets special treatment here to avoid going through image initialization */
|
||||
if (ps_handle->is_clone_cursor_pick) {
|
||||
Scene *scene = ps_handle->scene;
|
||||
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
float *cursor = scene->cursor.location;
|
||||
|
@ -5880,21 +5880,21 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
|
|||
ps->canvas_ima = (!ps->do_material_slots) ? settings->imapaint.canvas : nullptr;
|
||||
ps->clone_ima = (!ps->do_material_slots) ? settings->imapaint.clone : nullptr;
|
||||
|
||||
ps->do_mask_cavity = (settings->imapaint.paint.flags & PAINT_USE_CAVITY_MASK) ? true : false;
|
||||
ps->do_mask_cavity = (settings->imapaint.paint.flags & PAINT_USE_CAVITY_MASK);
|
||||
ps->cavity_curve = settings->imapaint.paint.cavity_curve;
|
||||
|
||||
/* setup projection painting data */
|
||||
if (ps->tool != PAINT_TOOL_FILL) {
|
||||
ps->do_backfacecull = (settings->imapaint.flag & IMAGEPAINT_PROJECT_BACKFACE) ? false : true;
|
||||
ps->do_occlude = (settings->imapaint.flag & IMAGEPAINT_PROJECT_XRAY) ? false : true;
|
||||
ps->do_mask_normal = (settings->imapaint.flag & IMAGEPAINT_PROJECT_FLAT) ? false : true;
|
||||
ps->do_backfacecull = !(settings->imapaint.flag & IMAGEPAINT_PROJECT_BACKFACE);
|
||||
ps->do_occlude = !(settings->imapaint.flag & IMAGEPAINT_PROJECT_XRAY);
|
||||
ps->do_mask_normal = !(settings->imapaint.flag & IMAGEPAINT_PROJECT_FLAT);
|
||||
}
|
||||
else {
|
||||
ps->do_backfacecull = ps->do_occlude = ps->do_mask_normal = 0;
|
||||
}
|
||||
|
||||
if (ps->tool == PAINT_TOOL_CLONE) {
|
||||
ps->do_layer_clone = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE) ? 1 : 0;
|
||||
ps->do_layer_clone = (settings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE);
|
||||
}
|
||||
|
||||
ps->do_stencil_brush = (ps->brush && ps->brush->imagepaint_tool == PAINT_TOOL_MASK);
|
||||
|
@ -6124,7 +6124,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
idgroup = IDP_GetProperties(&image->id, 0);
|
||||
idgroup = IDP_GetProperties(&image->id, false);
|
||||
|
||||
if (idgroup) {
|
||||
view_data = IDP_GetPropertyTypeFromGroup(idgroup, PROJ_VIEW_DATA_ID, IDP_ARRAY);
|
||||
|
@ -6316,7 +6316,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
|
|||
/* now for the trickiness. store the view projection here!
|
||||
* re-projection will reuse this */
|
||||
IDPropertyTemplate val;
|
||||
IDProperty *idgroup = IDP_GetProperties(&image->id, 1);
|
||||
IDProperty *idgroup = IDP_GetProperties(&image->id, true);
|
||||
IDProperty *view_data;
|
||||
bool is_ortho;
|
||||
float *array;
|
||||
|
@ -6363,7 +6363,7 @@ void PAINT_OT_image_from_view(wmOperatorType *ot)
|
|||
* Data generation for projective texturing *
|
||||
* *******************************************/
|
||||
|
||||
void ED_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil)
|
||||
void ED_paint_data_warning(ReportList *reports, bool uvs, bool mat, bool tex, bool stencil)
|
||||
{
|
||||
BKE_reportf(reports,
|
||||
RPT_WARNING,
|
||||
|
@ -6939,8 +6939,11 @@ void PAINT_OT_add_texture_paint_slot(wmOperatorType *ot)
|
|||
"Generated Type",
|
||||
"Fill the image with a grid for UV map testing");
|
||||
|
||||
RNA_def_boolean(
|
||||
ot->srna, "float", 0, "32-bit Float", "Create image with 32-bit floating-point bit depth");
|
||||
RNA_def_boolean(ot->srna,
|
||||
"float",
|
||||
false,
|
||||
"32-bit Float",
|
||||
"Create image with 32-bit floating-point bit depth");
|
||||
|
||||
/* Color Attribute Properties */
|
||||
RNA_def_enum(ot->srna,
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* \ingroup spbuttons
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static Object *get_camera_with_movieclip(Scene *scene, const MovieClip *clip)
|
|||
{
|
||||
Object *camera = scene->camera;
|
||||
|
||||
if (camera != NULL && BKE_object_movieclip_get(scene, camera, false) == clip) {
|
||||
if (camera != nullptr && BKE_object_movieclip_get(scene, camera, false) == clip) {
|
||||
return camera;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ static Object *get_orientation_object(bContext *C)
|
|||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
Object *object = NULL;
|
||||
Object *object = nullptr;
|
||||
|
||||
if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
|
||||
object = get_camera_with_movieclip(scene, clip);
|
||||
|
@ -76,7 +76,7 @@ static Object *get_orientation_object(bContext *C)
|
|||
object = BKE_view_layer_active_object_get(view_layer);
|
||||
}
|
||||
|
||||
if (object != NULL && object->parent != NULL) {
|
||||
if (object != nullptr && object->parent != nullptr) {
|
||||
object = object->parent;
|
||||
}
|
||||
|
||||
|
@ -86,18 +86,18 @@ static Object *get_orientation_object(bContext *C)
|
|||
static bool set_orientation_poll(bContext *C)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
if (sc != NULL) {
|
||||
if (sc != nullptr) {
|
||||
const Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
if (clip != NULL) {
|
||||
if (clip != nullptr) {
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
|
||||
return true;
|
||||
}
|
||||
BKE_view_layer_synced_ensure(scene, view_layer);
|
||||
return BKE_view_layer_active_object_get(view_layer) != NULL;
|
||||
return BKE_view_layer_active_object_get(view_layer) != nullptr;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -122,7 +122,7 @@ static void object_solver_inverted_matrix(Scene *scene, Object *ob, float invmat
|
|||
bool found = false;
|
||||
LISTBASE_FOREACH (bConstraint *, con, &ob->constraints) {
|
||||
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||
if (cti == NULL) {
|
||||
if (cti == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
|
||||
|
@ -147,15 +147,15 @@ static Object *object_solver_camera(Scene *scene, Object *ob)
|
|||
{
|
||||
LISTBASE_FOREACH (bConstraint *, con, &ob->constraints) {
|
||||
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||
if (cti == NULL) {
|
||||
if (cti == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (cti->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
|
||||
bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data;
|
||||
return (data->camera != NULL) ? data->camera : scene->camera;
|
||||
return (data->camera != nullptr) ? data->camera : scene->camera;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static int set_origin_exec(bContext *C, wmOperator *op)
|
||||
|
@ -177,7 +177,7 @@ static int set_origin_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
Object *object = get_orientation_object(C);
|
||||
if (object == NULL) {
|
||||
if (object == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ static int set_origin_exec(bContext *C, wmOperator *op)
|
|||
DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -231,8 +231,11 @@ void CLIP_OT_set_origin(wmOperatorType *ot)
|
|||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
RNA_def_boolean(
|
||||
ot->srna, "use_median", 0, "Use Median", "Set origin to median point of selected bundles");
|
||||
RNA_def_boolean(ot->srna,
|
||||
"use_median",
|
||||
false,
|
||||
"Use Median",
|
||||
"Set origin to median point of selected bundles");
|
||||
}
|
||||
|
||||
/********************** set floor operator *********************/
|
||||
|
@ -366,7 +369,7 @@ static void set_axis(Scene *scene,
|
|||
}
|
||||
}
|
||||
|
||||
BKE_object_apply_mat4(ob, mat, 0, 0);
|
||||
BKE_object_apply_mat4(ob, mat, false, false);
|
||||
}
|
||||
|
||||
static int set_plane_exec(bContext *C, wmOperator *op)
|
||||
|
@ -375,7 +378,7 @@ static int set_plane_exec(bContext *C, wmOperator *op)
|
|||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
const MovieTrackingTrack *axis_track = NULL;
|
||||
const MovieTrackingTrack *axis_track = nullptr;
|
||||
Object *camera = get_camera_with_movieclip(scene, clip);
|
||||
int tot = 0;
|
||||
float vec[3][3], mat[4][4], obmat[4][4], newmat[4][4], orig[3] = {0.0f, 0.0f, 0.0f};
|
||||
|
@ -396,7 +399,7 @@ static int set_plane_exec(bContext *C, wmOperator *op)
|
|||
const MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
|
||||
Object *object = get_orientation_object(C);
|
||||
if (object == NULL) {
|
||||
if (object == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -453,17 +456,17 @@ static int set_plane_exec(bContext *C, wmOperator *op)
|
|||
BKE_object_to_mat4(object, obmat);
|
||||
mul_m4_m4m4(mat, mat, obmat);
|
||||
mul_m4_m4m4(newmat, rot, mat);
|
||||
BKE_object_apply_mat4(object, newmat, 0, 0);
|
||||
BKE_object_apply_mat4(object, newmat, false, false);
|
||||
|
||||
/* Make camera have positive z-coordinate. */
|
||||
if (object->loc[2] < 0) {
|
||||
invert_m4(rot);
|
||||
mul_m4_m4m4(newmat, rot, mat);
|
||||
BKE_object_apply_mat4(object, newmat, 0, 0);
|
||||
BKE_object_apply_mat4(object, newmat, false, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
BKE_object_apply_mat4(object, mat, 0, 0);
|
||||
BKE_object_apply_mat4(object, mat, false, false);
|
||||
}
|
||||
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
|
@ -479,7 +482,7 @@ static int set_plane_exec(bContext *C, wmOperator *op)
|
|||
DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -489,7 +492,7 @@ void CLIP_OT_set_plane(wmOperatorType *ot)
|
|||
static const EnumPropertyItem plane_items[] = {
|
||||
{0, "FLOOR", 0, "Floor", "Set floor plane"},
|
||||
{1, "WALL", 0, "Wall", "Set wall plane"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
|
@ -529,7 +532,7 @@ static int set_axis_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
object = get_orientation_object(C);
|
||||
if (object == NULL) {
|
||||
if (object == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -549,7 +552,7 @@ static int set_axis_exec(bContext *C, wmOperator *op)
|
|||
DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -559,7 +562,7 @@ void CLIP_OT_set_axis(wmOperatorType *ot)
|
|||
static const EnumPropertyItem axis_actions[] = {
|
||||
{0, "X", 0, "X", "Align bundle align X axis"},
|
||||
{1, "Y", 0, "Y", "Align bundle align Y axis"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
|
@ -590,7 +593,7 @@ static int do_set_scale(bContext *C, wmOperator *op, bool scale_solution, bool a
|
|||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *object = NULL;
|
||||
Object *object = nullptr;
|
||||
Object *camera = get_camera_with_movieclip(scene, clip);
|
||||
int tot = 0;
|
||||
float vec[2][3], mat[4][4], scale;
|
||||
|
@ -603,7 +606,7 @@ static int do_set_scale(bContext *C, wmOperator *op, bool scale_solution, bool a
|
|||
|
||||
if (!scale_solution && !apply_scale) {
|
||||
object = get_orientation_object(C);
|
||||
if (object == NULL) {
|
||||
if (object == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "No object to apply orientation on");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -638,7 +641,7 @@ static int do_set_scale(bContext *C, wmOperator *op, bool scale_solution, bool a
|
|||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
}
|
||||
else {
|
||||
if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
|
||||
|
@ -667,7 +670,7 @@ static int do_set_scale(bContext *C, wmOperator *op, bool scale_solution, bool a
|
|||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -723,9 +726,9 @@ void CLIP_OT_set_scale(wmOperatorType *ot)
|
|||
static bool set_solution_scale_poll(bContext *C)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
if (sc != NULL) {
|
||||
if (sc != nullptr) {
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
if (clip != NULL) {
|
||||
if (clip != nullptr) {
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
return (tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0;
|
||||
|
@ -785,15 +788,15 @@ void CLIP_OT_set_solution_scale(wmOperatorType *ot)
|
|||
static bool apply_solution_scale_poll(bContext *C)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
if (sc != NULL) {
|
||||
if (sc != nullptr) {
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
if (clip != NULL) {
|
||||
if (clip != nullptr) {
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
return (tracking_object->flag & TRACKING_OBJECT_CAMERA) != 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int apply_solution_scale_exec(bContext *C, wmOperator *op)
|
||||
|
|
|
@ -249,15 +249,15 @@ struct FileList {
|
|||
/* Set given path as root directory,
|
||||
* if last bool is true may change given string in place to a valid value.
|
||||
* Returns True if valid dir. */
|
||||
bool (*check_dir_fn)(struct FileList *, char *, const bool);
|
||||
bool (*check_dir_fn)(FileList *, char *, const bool);
|
||||
|
||||
/* Fill filelist (to be called by read job). */
|
||||
void (*read_job_fn)(struct FileListReadJob *, bool *, bool *, float *);
|
||||
void (*read_job_fn)(FileListReadJob *, bool *, bool *, float *);
|
||||
|
||||
/* Filter an entry of current filelist. */
|
||||
bool (*filter_fn)(struct FileListInternEntry *, const char *, FileListFilter *);
|
||||
bool (*filter_fn)(FileListInternEntry *, const char *, FileListFilter *);
|
||||
/* Executed before filtering individual items, to set up additional filter data. */
|
||||
void (*prepare_filter_fn)(const struct FileList *, FileListFilter *);
|
||||
void (*prepare_filter_fn)(const FileList *, FileListFilter *);
|
||||
|
||||
short tags; /* FileListTags */
|
||||
};
|
||||
|
@ -557,7 +557,7 @@ static int compare_extension(void *user_data, const void *a1, const void *a2)
|
|||
return compare_apply_inverted(compare_tiebreaker(entry1, entry2), sort_data);
|
||||
}
|
||||
|
||||
void filelist_sort(struct FileList *filelist)
|
||||
void filelist_sort(FileList *filelist)
|
||||
{
|
||||
if (filelist->flags & FL_NEED_SORTING) {
|
||||
int (*sort_cb)(void *, const void *, const void *) = nullptr;
|
||||
|
@ -590,7 +590,7 @@ void filelist_sort(struct FileList *filelist)
|
|||
}
|
||||
}
|
||||
|
||||
void filelist_setsorting(struct FileList *filelist, const short sort, bool invert_sort)
|
||||
void filelist_setsorting(FileList *filelist, const short sort, bool invert_sort)
|
||||
{
|
||||
const bool was_invert_sort = filelist->flags & FL_SORT_INVERT;
|
||||
|
||||
|
@ -1139,14 +1139,14 @@ void filelist_file_get_full_path(const FileList *filelist, const FileDirEntry *f
|
|||
BLI_path_join(r_path, FILE_MAX_LIBEXTRA, root, file->relpath);
|
||||
}
|
||||
|
||||
static FileDirEntry *filelist_geticon_get_file(struct FileList *filelist, const int index)
|
||||
static FileDirEntry *filelist_geticon_get_file(FileList *filelist, const int index)
|
||||
{
|
||||
BLI_assert(G.background == false);
|
||||
|
||||
return filelist_file(filelist, index);
|
||||
}
|
||||
|
||||
ImBuf *filelist_getimage(struct FileList *filelist, const int index)
|
||||
ImBuf *filelist_getimage(FileList *filelist, const int index)
|
||||
{
|
||||
FileDirEntry *file = filelist_geticon_get_file(filelist, index);
|
||||
|
||||
|
@ -1177,7 +1177,7 @@ ImBuf *filelist_geticon_image_ex(const FileDirEntry *file)
|
|||
return ibuf;
|
||||
}
|
||||
|
||||
ImBuf *filelist_geticon_image(struct FileList *filelist, const int index)
|
||||
ImBuf *filelist_geticon_image(FileList *filelist, const int index)
|
||||
{
|
||||
FileDirEntry *file = filelist_geticon_get_file(filelist, index);
|
||||
return filelist_geticon_image_ex(file);
|
||||
|
@ -1208,7 +1208,7 @@ static int filelist_geticon_ex(const FileList *filelist,
|
|||
}
|
||||
|
||||
/* If this path is in System list or path cache then use that icon. */
|
||||
struct FSMenu *fsmenu = ED_fsmenu_get();
|
||||
FSMenu *fsmenu = ED_fsmenu_get();
|
||||
FSMenuCategory categories[] = {
|
||||
FS_CATEGORY_SYSTEM,
|
||||
FS_CATEGORY_SYSTEM_BOOKMARKS,
|
||||
|
@ -1299,7 +1299,7 @@ static int filelist_geticon_ex(const FileList *filelist,
|
|||
return is_main ? ICON_FILE_BLANK : ICON_NONE;
|
||||
}
|
||||
|
||||
int filelist_geticon(struct FileList *filelist, const int index, const bool is_main)
|
||||
int filelist_geticon(FileList *filelist, const int index, const bool is_main)
|
||||
{
|
||||
FileDirEntry *file = filelist_geticon_get_file(filelist, index);
|
||||
|
||||
|
@ -1330,9 +1330,7 @@ static void parent_dir_until_exists_or_default_root(char *dir)
|
|||
}
|
||||
}
|
||||
|
||||
static bool filelist_checkdir_dir(struct FileList * /*filelist*/,
|
||||
char *r_dir,
|
||||
const bool do_change)
|
||||
static bool filelist_checkdir_dir(FileList * /*filelist*/, char *r_dir, const bool do_change)
|
||||
{
|
||||
if (do_change) {
|
||||
parent_dir_until_exists_or_default_root(r_dir);
|
||||
|
@ -1341,9 +1339,7 @@ static bool filelist_checkdir_dir(struct FileList * /*filelist*/,
|
|||
return BLI_is_dir(r_dir);
|
||||
}
|
||||
|
||||
static bool filelist_checkdir_lib(struct FileList * /*filelist*/,
|
||||
char *r_dir,
|
||||
const bool do_change)
|
||||
static bool filelist_checkdir_lib(FileList * /*filelist*/, char *r_dir, const bool do_change)
|
||||
{
|
||||
char tdir[FILE_MAX_LIBEXTRA];
|
||||
char *name;
|
||||
|
@ -1360,13 +1356,13 @@ static bool filelist_checkdir_lib(struct FileList * /*filelist*/,
|
|||
return is_valid;
|
||||
}
|
||||
|
||||
static bool filelist_checkdir_main(struct FileList *filelist, char *r_dir, const bool do_change)
|
||||
static bool filelist_checkdir_main(FileList *filelist, char *r_dir, const bool do_change)
|
||||
{
|
||||
/* TODO */
|
||||
return filelist_checkdir_lib(filelist, r_dir, do_change);
|
||||
}
|
||||
|
||||
static bool filelist_checkdir_main_assets(struct FileList * /*filelist*/,
|
||||
static bool filelist_checkdir_main_assets(FileList * /*filelist*/,
|
||||
char * /*r_dir*/,
|
||||
const bool /*do_change*/)
|
||||
{
|
||||
|
@ -1796,7 +1792,7 @@ static void filelist_clear_asset_library(FileList *filelist)
|
|||
file_delete_asset_catalog_filter_settings(&filelist->filter_data.asset_catalog_filter);
|
||||
}
|
||||
|
||||
void filelist_clear_ex(struct FileList *filelist,
|
||||
void filelist_clear_ex(FileList *filelist,
|
||||
const bool do_asset_library,
|
||||
const bool do_cache,
|
||||
const bool do_selection)
|
||||
|
@ -1873,7 +1869,7 @@ void filelist_clear_from_reset_tag(FileList *filelist)
|
|||
}
|
||||
}
|
||||
|
||||
void filelist_free(struct FileList *filelist)
|
||||
void filelist_free(FileList *filelist)
|
||||
{
|
||||
if (!filelist) {
|
||||
printf("Attempting to delete empty filelist.\n");
|
||||
|
@ -1901,7 +1897,7 @@ AssetLibrary *filelist_asset_library(FileList *filelist)
|
|||
return reinterpret_cast<::AssetLibrary *>(filelist->asset_library);
|
||||
}
|
||||
|
||||
void filelist_freelib(struct FileList *filelist)
|
||||
void filelist_freelib(FileList *filelist)
|
||||
{
|
||||
if (filelist->libfiledata) {
|
||||
BLO_blendhandle_close(filelist->libfiledata);
|
||||
|
@ -1909,7 +1905,7 @@ void filelist_freelib(struct FileList *filelist)
|
|||
filelist->libfiledata = nullptr;
|
||||
}
|
||||
|
||||
BlendHandle *filelist_lib(struct FileList *filelist)
|
||||
BlendHandle *filelist_lib(FileList *filelist)
|
||||
{
|
||||
return filelist->libfiledata;
|
||||
}
|
||||
|
@ -1964,12 +1960,12 @@ const char *filelist_dir(const FileList *filelist)
|
|||
return filelist->filelist.root;
|
||||
}
|
||||
|
||||
bool filelist_is_dir(struct FileList *filelist, const char *path)
|
||||
bool filelist_is_dir(FileList *filelist, const char *path)
|
||||
{
|
||||
return filelist->check_dir_fn(filelist, (char *)path, false);
|
||||
}
|
||||
|
||||
void filelist_setdir(struct FileList *filelist, char *r_dir)
|
||||
void filelist_setdir(FileList *filelist, char *r_dir)
|
||||
{
|
||||
const bool allow_invalid = filelist->asset_library_ref != nullptr;
|
||||
BLI_assert(strlen(r_dir) < FILE_MAX_LIBEXTRA);
|
||||
|
@ -1985,7 +1981,7 @@ void filelist_setdir(struct FileList *filelist, char *r_dir)
|
|||
}
|
||||
}
|
||||
|
||||
void filelist_setrecursion(struct FileList *filelist, const int recursion_level)
|
||||
void filelist_setrecursion(FileList *filelist, const int recursion_level)
|
||||
{
|
||||
if (filelist->max_recursion != recursion_level) {
|
||||
filelist->max_recursion = recursion_level;
|
||||
|
@ -2011,12 +2007,12 @@ void filelist_tag_force_reset_mainfiles(FileList *filelist)
|
|||
filelist->flags |= FL_FORCE_RESET_MAIN_FILES;
|
||||
}
|
||||
|
||||
bool filelist_is_ready(struct FileList *filelist)
|
||||
bool filelist_is_ready(FileList *filelist)
|
||||
{
|
||||
return (filelist->flags & FL_IS_READY) != 0;
|
||||
}
|
||||
|
||||
bool filelist_pending(struct FileList *filelist)
|
||||
bool filelist_pending(FileList *filelist)
|
||||
{
|
||||
return (filelist->flags & FL_IS_PENDING) != 0;
|
||||
}
|
||||
|
@ -2085,7 +2081,7 @@ static void filelist_file_release_entry(FileList *filelist, FileDirEntry *entry)
|
|||
filelist_entry_free(entry);
|
||||
}
|
||||
|
||||
FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index, const bool use_request)
|
||||
FileDirEntry *filelist_file_ex(FileList *filelist, const int index, const bool use_request)
|
||||
{
|
||||
FileDirEntry *ret = nullptr, *old;
|
||||
FileListEntryCache *cache = &filelist->filelist_cache;
|
||||
|
@ -2135,12 +2131,12 @@ FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index, const
|
|||
return ret;
|
||||
}
|
||||
|
||||
FileDirEntry *filelist_file(struct FileList *filelist, int index)
|
||||
FileDirEntry *filelist_file(FileList *filelist, int index)
|
||||
{
|
||||
return filelist_file_ex(filelist, index, true);
|
||||
}
|
||||
|
||||
int filelist_file_find_path(struct FileList *filelist, const char *filename)
|
||||
int filelist_file_find_path(FileList *filelist, const char *filename)
|
||||
{
|
||||
if (filelist->filelist.entries_filtered_num == FILEDIR_NBR_ENTRIES_UNSET) {
|
||||
return -1;
|
||||
|
@ -2247,9 +2243,7 @@ static bool filelist_file_cache_block_create(FileList *filelist,
|
|||
return false;
|
||||
}
|
||||
|
||||
static void filelist_file_cache_block_release(struct FileList *filelist,
|
||||
const int size,
|
||||
int cursor)
|
||||
static void filelist_file_cache_block_release(FileList *filelist, const int size, int cursor)
|
||||
{
|
||||
FileListEntryCache *cache = &filelist->filelist_cache;
|
||||
|
||||
|
@ -2272,7 +2266,7 @@ static void filelist_file_cache_block_release(struct FileList *filelist,
|
|||
}
|
||||
}
|
||||
|
||||
bool filelist_file_cache_block(struct FileList *filelist, const int index)
|
||||
bool filelist_file_cache_block(FileList *filelist, const int index)
|
||||
{
|
||||
FileListEntryCache *cache = &filelist->filelist_cache;
|
||||
const size_t cache_size = cache->size;
|
||||
|
@ -2856,7 +2850,7 @@ void filelist_entry_parent_select_set(FileList *filelist,
|
|||
}
|
||||
}
|
||||
|
||||
bool filelist_islibrary(struct FileList *filelist, char *dir, char **r_group)
|
||||
bool filelist_islibrary(FileList *filelist, char *dir, char **r_group)
|
||||
{
|
||||
return BLO_library_path_explode(filelist->filelist.root, dir, r_group, nullptr);
|
||||
}
|
||||
|
@ -2952,7 +2946,7 @@ static int filelist_readjob_list_dir(FileListReadJob *job_params,
|
|||
const char *main_name,
|
||||
const bool skip_currpar)
|
||||
{
|
||||
struct direntry *files;
|
||||
direntry *files;
|
||||
int entries_num = 0;
|
||||
/* Full path of the item. */
|
||||
char full_path[FILE_MAX];
|
||||
|
@ -3119,7 +3113,7 @@ static void filelist_readjob_list_lib_add_datablocks(FileListReadJob *job_params
|
|||
const char *group_name)
|
||||
{
|
||||
for (LinkNode *ln = datablock_infos; ln; ln = ln->next) {
|
||||
struct BLODataBlockInfo *datablock_info = static_cast<BLODataBlockInfo *>(ln->link);
|
||||
BLODataBlockInfo *datablock_info = static_cast<BLODataBlockInfo *>(ln->link);
|
||||
filelist_readjob_list_lib_add_datablock(
|
||||
job_params, entries, datablock_info, prefix_relpath_with_group_name, idcode, group_name);
|
||||
}
|
||||
|
@ -3155,14 +3149,14 @@ static FileListInternEntry *filelist_readjob_list_lib_navigate_to_parent_entry_c
|
|||
/**
|
||||
* Structure to keep the file indexer and its user data together.
|
||||
*/
|
||||
typedef struct FileIndexer {
|
||||
struct FileIndexer {
|
||||
const FileIndexerType *callbacks;
|
||||
|
||||
/**
|
||||
* User data. Contains the result of `callbacks.init_user_data`.
|
||||
*/
|
||||
void *user_data;
|
||||
} FileIndexer;
|
||||
};
|
||||
|
||||
static int filelist_readjob_list_lib_populate_from_index(FileListReadJob *job_params,
|
||||
ListBase *entries,
|
||||
|
@ -3196,7 +3190,7 @@ static std::optional<int> filelist_readjob_list_lib(FileListReadJob *job_params,
|
|||
|
||||
char dir[FILE_MAX_LIBEXTRA], *group;
|
||||
|
||||
struct BlendHandle *libfiledata = nullptr;
|
||||
BlendHandle *libfiledata = nullptr;
|
||||
|
||||
/* Check if the given root is actually a library. All folders are passed to
|
||||
* `filelist_readjob_list_lib` and based on the number of found entries `filelist_readjob_do`
|
||||
|
@ -3732,7 +3726,7 @@ static void filelist_readjob_main_assets_add_items(FileListReadJob *job_params,
|
|||
FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */
|
||||
|
||||
FileListInternEntry *entry;
|
||||
ListBase tmp_entries = {0};
|
||||
ListBase tmp_entries = {nullptr};
|
||||
ID *id_iter;
|
||||
int entries_num = 0;
|
||||
|
||||
|
|
|
@ -810,23 +810,23 @@ static void create_inspection_string_for_generic_value(const bNodeSocket &socket
|
|||
id_to_inspection_string(*static_cast<const ID *const *>(buffer), ID_OB);
|
||||
return;
|
||||
}
|
||||
else if (value_type.is<Material *>()) {
|
||||
if (value_type.is<Material *>()) {
|
||||
id_to_inspection_string(*static_cast<const ID *const *>(buffer), ID_MA);
|
||||
return;
|
||||
}
|
||||
else if (value_type.is<Tex *>()) {
|
||||
if (value_type.is<Tex *>()) {
|
||||
id_to_inspection_string(*static_cast<const ID *const *>(buffer), ID_TE);
|
||||
return;
|
||||
}
|
||||
else if (value_type.is<Image *>()) {
|
||||
if (value_type.is<Image *>()) {
|
||||
id_to_inspection_string(*static_cast<const ID *const *>(buffer), ID_IM);
|
||||
return;
|
||||
}
|
||||
else if (value_type.is<Collection *>()) {
|
||||
if (value_type.is<Collection *>()) {
|
||||
id_to_inspection_string(*static_cast<const ID *const *>(buffer), ID_GR);
|
||||
return;
|
||||
}
|
||||
else if (value_type.is<std::string>()) {
|
||||
if (value_type.is<std::string>()) {
|
||||
ss << *static_cast<const std::string *>(buffer) << TIP_(" (String)");
|
||||
return;
|
||||
}
|
||||
|
@ -1738,7 +1738,7 @@ static std::optional<std::chrono::nanoseconds> node_get_execution_time(
|
|||
if (node.type == NODE_GROUP_OUTPUT) {
|
||||
return tree_log->run_time_sum;
|
||||
}
|
||||
else if (node.is_frame()) {
|
||||
if (node.is_frame()) {
|
||||
/* Could be cached in the future if this recursive code turns out to be slow. */
|
||||
std::chrono::nanoseconds run_time{0};
|
||||
bool found_node = false;
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace blender::ed::outliner {
|
|||
/** \name Registration
|
||||
* \{ */
|
||||
|
||||
void outliner_operatortypes(void)
|
||||
void outliner_operatortypes()
|
||||
{
|
||||
WM_operatortype_append(OUTLINER_OT_highlight_update);
|
||||
WM_operatortype_append(OUTLINER_OT_item_activate);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* \ingroup edtransform
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <cfloat>
|
||||
|
||||
#include "PIL_time.h"
|
||||
|
||||
|
@ -398,7 +398,7 @@ static bool applyFaceProject(TransInfo *t, TransDataContainer *tc, TransData *td
|
|||
nullptr,
|
||||
mval_fl,
|
||||
nullptr,
|
||||
0,
|
||||
nullptr,
|
||||
loc,
|
||||
no);
|
||||
if (hit != SCE_SNAP_MODE_FACE_RAYCAST) {
|
||||
|
@ -467,7 +467,7 @@ static void applyFaceNearest(TransInfo *t, TransDataContainer *tc, TransData *td
|
|||
init_loc,
|
||||
nullptr,
|
||||
prev_loc,
|
||||
0,
|
||||
nullptr,
|
||||
snap_loc,
|
||||
snap_no);
|
||||
|
||||
|
@ -1382,7 +1382,7 @@ bool peelObjectsTransform(TransInfo *t,
|
|||
snap_object_params.snap_target_select = t->tsnap.target_select;
|
||||
snap_object_params.edit_mode_type = (t->flag & T_EDIT) != 0 ? SNAP_GEOM_EDIT : SNAP_GEOM_FINAL;
|
||||
|
||||
ListBase depths_peel = {0};
|
||||
ListBase depths_peel = {nullptr};
|
||||
ED_transform_snap_object_project_all_view3d_ex(t->tsnap.object_context,
|
||||
t->depsgraph,
|
||||
t->region,
|
||||
|
|
|
@ -364,7 +364,7 @@ void unpack_menu(bContext *C,
|
|||
uiPopupMenu *pup;
|
||||
uiLayout *layout;
|
||||
char line[FILE_MAX + 100];
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 1);
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, true);
|
||||
const char *blendfile_path = BKE_main_blendfile_path(bmain);
|
||||
|
||||
pup = UI_popup_menu_begin(C, IFACE_("Unpack File"), ICON_NONE);
|
||||
|
|
|
@ -284,10 +284,10 @@ static PyModuleDef module_definition = {
|
|||
/*m_doc*/ module_docstring,
|
||||
/*m_size*/ -1,
|
||||
/*m_methods*/ module_functions,
|
||||
/*m_slots*/ NULL,
|
||||
/*m_traverse*/ NULL,
|
||||
/*m_clear*/ NULL,
|
||||
/*m_free*/ NULL,
|
||||
/*m_slots*/ nullptr,
|
||||
/*m_traverse*/ nullptr,
|
||||
/*m_clear*/ nullptr,
|
||||
/*m_free*/ nullptr,
|
||||
};
|
||||
|
||||
//------------------- MODULE INITIALIZATION --------------------------------
|
||||
|
|
|
@ -516,10 +516,10 @@ static PyModuleDef module_definition = {
|
|||
/*m_doc*/ module_docstring,
|
||||
/*m_size*/ -1,
|
||||
/*m_methods*/ module_functions,
|
||||
/*m_slots*/ NULL,
|
||||
/*m_traverse*/ NULL,
|
||||
/*m_clear*/ NULL,
|
||||
/*m_free*/ NULL,
|
||||
/*m_slots*/ nullptr,
|
||||
/*m_traverse*/ nullptr,
|
||||
/*m_clear*/ nullptr,
|
||||
/*m_free*/ nullptr,
|
||||
};
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
|
|
@ -116,10 +116,10 @@ static PyModuleDef module_definition = {
|
|||
/*m_doc*/ module_docstring,
|
||||
/*m_size*/ -1,
|
||||
/*m_methods*/ module_functions,
|
||||
/*m_slots*/ NULL,
|
||||
/*m_traverse*/ NULL,
|
||||
/*m_clear*/ NULL,
|
||||
/*m_free*/ NULL,
|
||||
/*m_slots*/ nullptr,
|
||||
/*m_traverse*/ nullptr,
|
||||
/*m_clear*/ nullptr,
|
||||
/*m_free*/ nullptr,
|
||||
};
|
||||
|
||||
/*-----------------------BPy_IntegrationType type definition ------------------------------*/
|
||||
|
|
|
@ -57,8 +57,8 @@ static PyNumberMethods nature_as_number = {
|
|||
/*nb_inplace_floor_divide*/ nullptr,
|
||||
/*nb_inplace_true_divide*/ nullptr,
|
||||
/*nb_index*/ nullptr,
|
||||
/*nb_matrix_multiply*/ NULL,
|
||||
/*nb_inplace_matrix_multiply*/ NULL,
|
||||
/*nb_matrix_multiply*/ nullptr,
|
||||
/*nb_inplace_matrix_multiply*/ nullptr,
|
||||
};
|
||||
|
||||
/*-----------------------BPy_Nature docstring ------------------------------------*/
|
||||
|
|
|
@ -848,6 +848,8 @@ BLI_INLINE int lineart_line_isec_2d_ignore_line2pos(const double a1[2],
|
|||
#endif
|
||||
}
|
||||
|
||||
struct bGPDframe;
|
||||
struct bGPDlayer;
|
||||
struct Depsgraph;
|
||||
struct LineartGpencilModifierData;
|
||||
struct LineartData;
|
||||
|
@ -886,9 +888,7 @@ void MOD_lineart_finalize_chains(LineartData *ld);
|
|||
bool MOD_lineart_compute_feature_lines(struct Depsgraph *depsgraph,
|
||||
struct LineartGpencilModifierData *lmd,
|
||||
struct LineartCache **cached_result,
|
||||
bool enable_stroke_offset);
|
||||
|
||||
struct Scene;
|
||||
bool enable_stroke_depth_offset);
|
||||
|
||||
/**
|
||||
* This only gets initial "biggest" tile.
|
||||
|
@ -900,9 +900,6 @@ LineartBoundingArea *MOD_lineart_get_parent_bounding_area(LineartData *ld, doubl
|
|||
*/
|
||||
LineartBoundingArea *MOD_lineart_get_bounding_area(LineartData *ld, double x, double y);
|
||||
|
||||
struct bGPDframe;
|
||||
struct bGPDlayer;
|
||||
|
||||
/**
|
||||
* Wrapper for external calls.
|
||||
*/
|
||||
|
|
|
@ -111,7 +111,7 @@ static void lineart_free_bounding_area_memory(LineartBoundingArea *ba, bool recu
|
|||
|
||||
static void lineart_free_bounding_area_memories(LineartData *ld);
|
||||
|
||||
static LineartCache *lineart_init_cache(void);
|
||||
static LineartCache *lineart_init_cache();
|
||||
|
||||
static void lineart_discard_segment(LineartData *ld, LineartEdgeSegment *es)
|
||||
{
|
||||
|
@ -156,8 +156,8 @@ void lineart_edge_cut(LineartData *ld,
|
|||
uint32_t shadow_bits)
|
||||
{
|
||||
LineartEdgeSegment *i_seg, *prev_seg;
|
||||
LineartEdgeSegment *cut_start_before = 0, *cut_end_before = 0;
|
||||
LineartEdgeSegment *new_seg1 = 0, *new_seg2 = 0;
|
||||
LineartEdgeSegment *cut_start_before = nullptr, *cut_end_before = nullptr;
|
||||
LineartEdgeSegment *new_seg1 = nullptr, *new_seg2 = nullptr;
|
||||
int untouched = 0;
|
||||
|
||||
/* If for some reason the occlusion function may give a result that has zero length, or reversed
|
||||
|
@ -169,10 +169,10 @@ void lineart_edge_cut(LineartData *ld,
|
|||
return;
|
||||
}
|
||||
if (UNLIKELY(start != start)) {
|
||||
start = 0;
|
||||
start = 0.0;
|
||||
}
|
||||
if (UNLIKELY(end != end)) {
|
||||
end = 0;
|
||||
end = 0.0;
|
||||
}
|
||||
|
||||
if (start > end) {
|
||||
|
@ -472,7 +472,7 @@ void lineart_main_occlusion_begin(LineartData *ld)
|
|||
for (i = 0; i < thread_count; i++) {
|
||||
rti[i].thread_id = i;
|
||||
rti[i].ld = ld;
|
||||
BLI_task_pool_push(tp, (TaskRunFunction)lineart_occlusion_worker, &rti[i], 0, nullptr);
|
||||
BLI_task_pool_push(tp, (TaskRunFunction)lineart_occlusion_worker, &rti[i], false, nullptr);
|
||||
}
|
||||
BLI_task_pool_work_and_wait(tp);
|
||||
BLI_task_pool_free(tp);
|
||||
|
@ -2069,7 +2069,7 @@ static void lineart_geometry_object_load(LineartObjectInfo *ob_info,
|
|||
edge_feat_settings.userdata_chunk_size = sizeof(EdgeFeatReduceData);
|
||||
edge_feat_settings.func_reduce = feat_data_sum_reduce;
|
||||
|
||||
EdgeFeatData edge_feat_data = {0};
|
||||
EdgeFeatData edge_feat_data = {nullptr};
|
||||
edge_feat_data.ld = la_data;
|
||||
edge_feat_data.me = me;
|
||||
edge_feat_data.ob_eval = ob_info->original_ob_eval;
|
||||
|
@ -2553,7 +2553,7 @@ void lineart_main_load_geometries(Depsgraph *depsgraph,
|
|||
flags |= DEG_ITER_OBJECT_FLAG_DUPLI;
|
||||
}
|
||||
|
||||
DEGObjectIterSettings deg_iter_settings = {0};
|
||||
DEGObjectIterSettings deg_iter_settings = {nullptr};
|
||||
deg_iter_settings.depsgraph = depsgraph;
|
||||
deg_iter_settings.flags = flags;
|
||||
|
||||
|
@ -2599,7 +2599,7 @@ void lineart_main_load_geometries(Depsgraph *depsgraph,
|
|||
olti[i].ld = ld;
|
||||
olti[i].shadow_elns = shadow_elns;
|
||||
olti[i].thread_id = i;
|
||||
BLI_task_pool_push(tp, (TaskRunFunction)lineart_object_load_worker, &olti[i], 0, nullptr);
|
||||
BLI_task_pool_push(tp, (TaskRunFunction)lineart_object_load_worker, &olti[i], false, nullptr);
|
||||
}
|
||||
BLI_task_pool_work_and_wait(tp);
|
||||
BLI_task_pool_free(tp);
|
||||
|
@ -2863,7 +2863,7 @@ static bool lineart_triangle_edge_image_space_occlusion(const LineartTriangle *t
|
|||
if (!isec_e1 && !isec_e2 && !isec_e3) {
|
||||
/* And if both end point from the edge is outside of the triangle... */
|
||||
if ((!state_v1) && (!state_v2)) {
|
||||
return 0; /* We don't have any occlusion. */
|
||||
return false; /* We don't have any occlusion. */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3190,9 +3190,9 @@ static bool lineart_triangle_intersect_math(LineartTriangle *tri,
|
|||
|
||||
copy_v3_v3_db(v1, share->gloc);
|
||||
|
||||
if (!lineart_triangle_2v_intersection_math(sv1, sv2, t2, 0, v2)) {
|
||||
if (!lineart_triangle_2v_intersection_math(sv1, sv2, t2, nullptr, v2)) {
|
||||
lineart_triangle_get_other_verts(t2, share, &sv1, &sv2);
|
||||
if (lineart_triangle_2v_intersection_math(sv1, sv2, tri, 0, v2)) {
|
||||
if (lineart_triangle_2v_intersection_math(sv1, sv2, tri, nullptr, v2)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -3200,7 +3200,7 @@ static bool lineart_triangle_intersect_math(LineartTriangle *tri,
|
|||
else {
|
||||
/* If not sharing any points, then we need to try all the possibilities. */
|
||||
|
||||
if (lineart_triangle_2v_intersection_math(tri->v[0], tri->v[1], t2, 0, v1)) {
|
||||
if (lineart_triangle_2v_intersection_math(tri->v[0], tri->v[1], t2, nullptr, v1)) {
|
||||
next = v2;
|
||||
last = v1;
|
||||
}
|
||||
|
@ -3503,7 +3503,7 @@ void MOD_lineart_destroy_render_data(LineartGpencilModifierData *lmd)
|
|||
}
|
||||
}
|
||||
|
||||
static LineartCache *lineart_init_cache(void)
|
||||
static LineartCache *lineart_init_cache()
|
||||
{
|
||||
LineartCache *lc = static_cast<LineartCache *>(
|
||||
MEM_callocN(sizeof(LineartCache), "Lineart Cache"));
|
||||
|
@ -4425,7 +4425,7 @@ LineartBoundingArea *MOD_lineart_get_parent_bounding_area(LineartData *ld, doubl
|
|||
int col, row;
|
||||
|
||||
if (x > 1 || x < -1 || y > 1 || y < -1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
col = int((x + 1.0) / sp_w);
|
||||
|
@ -4519,8 +4519,14 @@ static void lineart_add_triangles_worker(TaskPool *__restrict /*pool*/, LineartI
|
|||
_dir_control++;
|
||||
for (co = x1; co <= x2; co++) {
|
||||
for (r = y1; r <= y2; r++) {
|
||||
lineart_bounding_area_link_triangle(
|
||||
ld, &ld->qtree.initials[r * ld->qtree.count_x + co], tri, 0, 1, 0, 1, th);
|
||||
lineart_bounding_area_link_triangle(ld,
|
||||
&ld->qtree.initials[r * ld->qtree.count_x + co],
|
||||
tri,
|
||||
nullptr,
|
||||
1,
|
||||
0,
|
||||
true,
|
||||
th);
|
||||
}
|
||||
}
|
||||
} /* Else throw away. */
|
||||
|
@ -4652,13 +4658,13 @@ void lineart_main_add_triangles(LineartData *ld)
|
|||
|
||||
/* Initialize per-thread data for thread task scheduling information and storing intersection
|
||||
* results. */
|
||||
LineartIsecData d = {0};
|
||||
LineartIsecData d = {nullptr};
|
||||
lineart_init_isec_thread(&d, ld, ld->thread_count);
|
||||
|
||||
TaskPool *tp = BLI_task_pool_create(nullptr, TASK_PRIORITY_HIGH);
|
||||
for (int i = 0; i < ld->thread_count; i++) {
|
||||
BLI_task_pool_push(
|
||||
tp, (TaskRunFunction)lineart_add_triangles_worker, &d.threads[i], 0, nullptr);
|
||||
tp, (TaskRunFunction)lineart_add_triangles_worker, &d.threads[i], false, nullptr);
|
||||
}
|
||||
BLI_task_pool_work_and_wait(tp);
|
||||
BLI_task_pool_free(tp);
|
||||
|
@ -4740,7 +4746,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
r1 = ratiod(fbcoord1[0], fbcoord2[0], rx);
|
||||
r2 = ratiod(fbcoord1[0], fbcoord2[0], ux);
|
||||
if (MIN2(r1, r2) > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* We reached the right side before the top side. */
|
||||
|
@ -4773,7 +4779,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
r1 = ratiod(fbcoord1[0], fbcoord2[0], rx);
|
||||
r2 = ratiod(fbcoord1[0], fbcoord2[0], bx);
|
||||
if (MIN2(r1, r2) > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (r1 <= r2) {
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->rp) {
|
||||
|
@ -4800,7 +4806,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
else {
|
||||
r1 = ratiod(fbcoord1[0], fbcoord2[0], self->r);
|
||||
if (r1 > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->rp) {
|
||||
ba = static_cast<LineartBoundingArea *>(lip->data);
|
||||
|
@ -4825,7 +4831,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
r1 = ratiod(fbcoord1[0], fbcoord2[0], lx);
|
||||
r2 = ratiod(fbcoord1[0], fbcoord2[0], ux);
|
||||
if (MIN2(r1, r2) > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (r1 <= r2) {
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->lp) {
|
||||
|
@ -4856,7 +4862,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
r1 = ratiod(fbcoord1[0], fbcoord2[0], lx);
|
||||
r2 = ratiod(fbcoord1[0], fbcoord2[0], bx);
|
||||
if (MIN2(r1, r2) > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (r1 <= r2) {
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->lp) {
|
||||
|
@ -4883,7 +4889,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
else {
|
||||
r1 = ratiod(fbcoord1[0], fbcoord2[0], self->l);
|
||||
if (r1 > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->lp) {
|
||||
ba = static_cast<LineartBoundingArea *>(lip->data);
|
||||
|
@ -4900,7 +4906,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
if (positive_y > 0) {
|
||||
r1 = ratiod(fbcoord1[1], fbcoord2[1], self->u);
|
||||
if (r1 > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->up) {
|
||||
ba = static_cast<LineartBoundingArea *>(lip->data);
|
||||
|
@ -4914,7 +4920,7 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
else if (positive_y < 0) {
|
||||
r1 = ratiod(fbcoord1[1], fbcoord2[1], self->b);
|
||||
if (r1 > 1) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
LISTBASE_FOREACH (LinkData *, lip, &self->bp) {
|
||||
ba = static_cast<LineartBoundingArea *>(lip->data);
|
||||
|
@ -4927,10 +4933,10 @@ LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *self,
|
|||
}
|
||||
else {
|
||||
/* Segment has no length. */
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -239,21 +239,21 @@ GPUTexture *GPU_texture_create_1d_ex(const char *name,
|
|||
int w,
|
||||
int mip_len,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const float *data);
|
||||
GPUTexture *GPU_texture_create_1d_array_ex(const char *name,
|
||||
int w,
|
||||
int h,
|
||||
int mip_len,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const float *data);
|
||||
GPUTexture *GPU_texture_create_2d_ex(const char *name,
|
||||
int w,
|
||||
int h,
|
||||
int mips,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const float *data);
|
||||
GPUTexture *GPU_texture_create_2d_array_ex(const char *name,
|
||||
int w,
|
||||
|
@ -261,7 +261,7 @@ GPUTexture *GPU_texture_create_2d_array_ex(const char *name,
|
|||
int d,
|
||||
int mip_len,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const float *data);
|
||||
GPUTexture *GPU_texture_create_3d_ex(const char *name,
|
||||
int w,
|
||||
|
@ -270,20 +270,20 @@ GPUTexture *GPU_texture_create_3d_ex(const char *name,
|
|||
int mip_len,
|
||||
eGPUTextureFormat texture_format,
|
||||
eGPUDataFormat data_format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const void *data);
|
||||
GPUTexture *GPU_texture_create_cube_ex(const char *name,
|
||||
int w,
|
||||
int mip_len,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const float *data);
|
||||
GPUTexture *GPU_texture_create_cube_array_ex(const char *name,
|
||||
int w,
|
||||
int d,
|
||||
int mip_len,
|
||||
eGPUTextureFormat format,
|
||||
eGPUTextureUsage usage_flags,
|
||||
eGPUTextureUsage usage,
|
||||
const float *data);
|
||||
|
||||
/* Standard texture functions. */
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* Intermediate node graph for generating GLSL shaders.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
|||
|
||||
/* Node Link Functions */
|
||||
|
||||
static GPUNodeLink *gpu_node_link_create(void)
|
||||
static GPUNodeLink *gpu_node_link_create()
|
||||
{
|
||||
GPUNodeLink *link = MEM_cnew<GPUNodeLink>("GPUNodeLink");
|
||||
link->users++;
|
||||
|
|
|
@ -213,7 +213,7 @@ struct GPUTexture **gpu_material_ramp_texture_row_set(struct GPUMaterial *mat,
|
|||
* Returns the address of the future pointer to sky_tex
|
||||
*/
|
||||
struct GPUTexture **gpu_material_sky_texture_layer_set(
|
||||
struct GPUMaterial *mat, int width, int height, const float *pixels, float *layer);
|
||||
struct GPUMaterial *mat, int width, int height, const float *pixels, float *row);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -643,9 +643,9 @@ void GLStateManager::issue_barrier(eGPUBarrier barrier_bits)
|
|||
|
||||
GLFence::~GLFence()
|
||||
{
|
||||
if (gl_sync_ != 0) {
|
||||
if (gl_sync_ != nullptr) {
|
||||
glDeleteSync(gl_sync_);
|
||||
gl_sync_ = 0;
|
||||
gl_sync_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -663,7 +663,7 @@ void GLFence::signal()
|
|||
void GLFence::wait()
|
||||
{
|
||||
/* Do not wait if fence does not yet exist. */
|
||||
if (gl_sync_ == 0) {
|
||||
if (gl_sync_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
glWaitSync(gl_sync_, 0, GL_TIMEOUT_IGNORED);
|
||||
|
|
|
@ -326,13 +326,13 @@ void GLTexture::update_sub(int offset[3],
|
|||
switch (dimensions) {
|
||||
default:
|
||||
case 1:
|
||||
glTexSubImage1D(target_, 0, offset[0], extent[0], gl_format, gl_type, 0);
|
||||
glTexSubImage1D(target_, 0, offset[0], extent[0], gl_format, gl_type, nullptr);
|
||||
break;
|
||||
case 2:
|
||||
glTexSubImage2D(target_, 0, UNPACK2(offset), UNPACK2(extent), gl_format, gl_type, 0);
|
||||
glTexSubImage2D(target_, 0, UNPACK2(offset), UNPACK2(extent), gl_format, gl_type, nullptr);
|
||||
break;
|
||||
case 3:
|
||||
glTexSubImage3D(target_, 0, UNPACK3(offset), UNPACK3(extent), gl_format, gl_type, 0);
|
||||
glTexSubImage3D(target_, 0, UNPACK3(offset), UNPACK3(extent), gl_format, gl_type, nullptr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -794,7 +794,7 @@ GLPixelBuffer::GLPixelBuffer(uint size) : PixelBuffer(size)
|
|||
size = max_ii(size, 32);
|
||||
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_id_);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, size, 0, GL_DYNAMIC_DRAW);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, size, nullptr, GL_DYNAMIC_DRAW);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ struct ImBuf *IMB_thumb_load_blend(const char *blen_path,
|
|||
/**
|
||||
* Special function for previewing fonts.
|
||||
*/
|
||||
struct ImBuf *IMB_thumb_load_font(const char *filepath, unsigned int x, unsigned int y);
|
||||
struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y);
|
||||
bool IMB_thumb_load_font_get_hash(char *r_hash);
|
||||
|
||||
/* Threading */
|
||||
|
|
|
@ -312,7 +312,7 @@ static PointerRNA rna_uiItemO(uiLayout *layout,
|
|||
{
|
||||
wmOperatorType *ot;
|
||||
|
||||
ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
if (!ot || !ot->srna) {
|
||||
RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
|
||||
return PointerRNA_NULL;
|
||||
|
@ -343,7 +343,7 @@ static PointerRNA rna_uiItemOMenuHold(uiLayout *layout,
|
|||
int icon_value,
|
||||
const char *menu)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
if (!ot || !ot->srna) {
|
||||
RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
|
||||
return PointerRNA_NULL;
|
||||
|
@ -381,7 +381,7 @@ static PointerRNA rna_uiItemMenuEnumO(uiLayout *layout,
|
|||
bool translate,
|
||||
int icon)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
|
||||
if (!ot || !ot->srna) {
|
||||
RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
|
||||
|
|
|
@ -147,7 +147,7 @@ static PointerRNA rna_gizmo_target_set_operator(wmGizmo *gz,
|
|||
{
|
||||
wmOperatorType *ot;
|
||||
|
||||
ot = WM_operatortype_find(opname, 0); /* print error next */
|
||||
ot = WM_operatortype_find(opname, false); /* print error next */
|
||||
if (!ot || !ot->srna) {
|
||||
BKE_reportf(
|
||||
reports, RPT_ERROR, "%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
|
||||
|
|
|
@ -78,7 +78,7 @@ static void requiredDataMask(ModifierData *md, CustomData_MeshMasks *r_cddata_ma
|
|||
}
|
||||
}
|
||||
|
||||
static bool dependsOnTime(struct Scene * /*scene*/, ModifierData *md)
|
||||
static bool dependsOnTime(Scene * /*scene*/, ModifierData *md)
|
||||
{
|
||||
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
||||
|
||||
|
@ -108,7 +108,7 @@ static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void
|
|||
walk(userData, ob, md, "texture");
|
||||
}
|
||||
|
||||
static bool isDisabled(const struct Scene * /*scene*/, ModifierData *md, bool /*useRenderParams*/)
|
||||
static bool isDisabled(const Scene * /*scene*/, ModifierData *md, bool /*useRenderParams*/)
|
||||
{
|
||||
DisplaceModifierData *dmd = (DisplaceModifierData *)md;
|
||||
return ((!dmd->texture && dmd->direction == MOD_DISP_DIR_RGB_XYZ) || dmd->strength == 0.0f);
|
||||
|
@ -142,10 +142,10 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
|
|||
}
|
||||
}
|
||||
|
||||
typedef struct DisplaceUserdata {
|
||||
struct DisplaceUserdata {
|
||||
/*const*/ DisplaceModifierData *dmd;
|
||||
struct Scene *scene;
|
||||
struct ImagePool *pool;
|
||||
Scene *scene;
|
||||
ImagePool *pool;
|
||||
const MDeformVert *dvert;
|
||||
float weight;
|
||||
int defgrp_index;
|
||||
|
@ -158,7 +158,7 @@ typedef struct DisplaceUserdata {
|
|||
MVert *mvert;
|
||||
const float (*vert_normals)[3];
|
||||
float (*vert_clnors)[3];
|
||||
} DisplaceUserdata;
|
||||
};
|
||||
|
||||
static void displaceModifier_do_task(void *__restrict userdata,
|
||||
const int iter,
|
||||
|
@ -381,7 +381,7 @@ static void deformVerts(ModifierData *md,
|
|||
|
||||
static void deformVertsEM(ModifierData *md,
|
||||
const ModifierEvalContext *ctx,
|
||||
struct BMEditMesh *editData,
|
||||
BMEditMesh *editData,
|
||||
Mesh *mesh,
|
||||
float (*vertexCos)[3],
|
||||
int verts_num)
|
||||
|
@ -444,7 +444,7 @@ static void panel_draw(const bContext *C, Panel *panel)
|
|||
uiItemS(layout);
|
||||
|
||||
col = uiLayoutColumn(layout, false);
|
||||
uiItemR(col, ptr, "direction", 0, 0, ICON_NONE);
|
||||
uiItemR(col, ptr, "direction", 0, nullptr, ICON_NONE);
|
||||
if (ELEM(RNA_enum_get(ptr, "direction"),
|
||||
MOD_DISP_DIR_X,
|
||||
MOD_DISP_DIR_Y,
|
||||
|
|
|
@ -350,7 +350,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
|
|||
* gives problems with float precision so its never closed. */
|
||||
if (fabsf(screw_ofs) <= (FLT_EPSILON * 100.0f) &&
|
||||
fabsf(fabsf(angle) - (float(M_PI) * 2.0f)) <= (FLT_EPSILON * 100.0f) && step_tot > 3) {
|
||||
close = 1;
|
||||
close = true;
|
||||
step_tot--;
|
||||
|
||||
maxVerts = totvert * step_tot; /* -1 because we're joining back up */
|
||||
|
@ -361,7 +361,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
|
|||
screw_ofs = 0.0f;
|
||||
}
|
||||
else {
|
||||
close = 0;
|
||||
close = false;
|
||||
if (step_tot < 2) {
|
||||
step_tot = 2;
|
||||
}
|
||||
|
@ -644,10 +644,10 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
|
|||
vf_best = vc_tmp->co[ltmd->axis];
|
||||
|
||||
if (vf_1 < vf_best && vf_best < vf_2) {
|
||||
ed_loop_flip = 0;
|
||||
ed_loop_flip = false;
|
||||
}
|
||||
else if (vf_1 > vf_best && vf_best > vf_2) {
|
||||
ed_loop_flip = 1;
|
||||
ed_loop_flip = true;
|
||||
}
|
||||
else {
|
||||
/* not so simple to work out which edge is higher */
|
||||
|
@ -657,20 +657,20 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
|
|||
normalize_v3(tmp_vec2);
|
||||
|
||||
if (tmp_vec1[ltmd->axis] < tmp_vec2[ltmd->axis]) {
|
||||
ed_loop_flip = 1;
|
||||
ed_loop_flip = true;
|
||||
}
|
||||
else {
|
||||
ed_loop_flip = 0;
|
||||
ed_loop_flip = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SV_IS_VALID(vc_tmp->v[0])) { /* Vertex only connected on 1 side. */
|
||||
// printf("Verts on ONE side (%i %i)\n", vc_tmp->v[0], vc_tmp->v[1]);
|
||||
if (tmpf1[ltmd->axis] < vc_tmp->co[ltmd->axis]) { /* best is above */
|
||||
ed_loop_flip = 1;
|
||||
ed_loop_flip = true;
|
||||
}
|
||||
else { /* best is below or even... in even case we can't know what to do. */
|
||||
ed_loop_flip = 0;
|
||||
ed_loop_flip = false;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ Mesh *MOD_deform_mesh_eval_get(Object *ob,
|
|||
&mesh_prior_modifiers->id,
|
||||
nullptr,
|
||||
(LIB_ID_COPY_LOCALIZE | LIB_ID_COPY_CD_REFERENCE));
|
||||
mesh->runtime->deformed_only = 1;
|
||||
mesh->runtime->deformed_only = true;
|
||||
}
|
||||
|
||||
if (em != nullptr) {
|
||||
|
|
|
@ -717,7 +717,7 @@ class GroupOutputDebugInfo : public lf::DummyDebugInfo {
|
|||
public:
|
||||
Vector<StringRef> socket_names;
|
||||
|
||||
std::string node_name() const
|
||||
std::string node_name() const override
|
||||
{
|
||||
return "Group Output";
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* \ingroup nodes
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <cctype>
|
||||
#include <climits>
|
||||
#include <cstring>
|
||||
|
||||
#include "DNA_node_types.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* \ingroup nodes
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
|
@ -132,7 +132,7 @@ static bool texture_node_tree_socket_type_valid(bNodeTreeType * /*ntreetype*/,
|
|||
|
||||
bNodeTreeType *ntreeType_Texture;
|
||||
|
||||
void register_node_tree_type_tex(void)
|
||||
void register_node_tree_type_tex()
|
||||
{
|
||||
bNodeTreeType *tt = ntreeType_Texture = MEM_cnew<bNodeTreeType>("texture node tree type");
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_at(void)
|
||||
void register_node_type_tex_at()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "NOD_texture.h"
|
||||
#include "node_texture_util.hh"
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
static bNodeSocketTemplate inputs[] = {
|
||||
{SOCK_RGBA, N_("Bricks 1"), 0.596f, 0.282f, 0.0f, 1.0f},
|
||||
|
@ -99,7 +99,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_bricks(void)
|
||||
void register_node_type_tex_bricks()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "NOD_texture.h"
|
||||
#include "node_texture_util.hh"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
static bNodeSocketTemplate inputs[] = {
|
||||
{SOCK_RGBA, N_("Color1"), 1.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -50,7 +50,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_checker(void)
|
||||
void register_node_type_tex_checker()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_combine_color(void)
|
||||
void register_node_type_tex_combine_color()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_compose(void)
|
||||
void register_node_type_tex_compose()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &vectorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_coord(void)
|
||||
void register_node_type_tex_coord()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ static void time_init(bNodeTree * /*ntree*/, bNode *node)
|
|||
node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
void register_node_type_tex_curve_time(void)
|
||||
void register_node_type_tex_curve_time()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
@ -96,7 +96,7 @@ static void rgb_init(bNodeTree * /*ntree*/, bNode *node)
|
|||
node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
void register_node_type_tex_curve_rgb(void)
|
||||
void register_node_type_tex_curve_rgb()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "NOD_texture.h"
|
||||
#include "node_texture_util.hh"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
static bNodeSocketTemplate inputs[] = {
|
||||
{SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -59,7 +59,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[3], &valuefn_a, tex_call_data);
|
||||
}
|
||||
|
||||
void register_node_type_tex_decompose(void)
|
||||
void register_node_type_tex_decompose()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_hue_sat(void)
|
||||
void register_node_type_tex_hue_sat()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ static void init(bNodeTree * /*ntree*/, bNode *node)
|
|||
iuser->flag |= IMA_ANIM_ALWAYS;
|
||||
}
|
||||
|
||||
void register_node_type_tex_image(void)
|
||||
void register_node_type_tex_image()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_invert(void)
|
||||
void register_node_type_tex_invert()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &valuefn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_math(void)
|
||||
void register_node_type_tex_math()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* \ingroup texnodes
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "NOD_texture.h"
|
||||
#include "node_texture_util.hh"
|
||||
|
@ -75,7 +75,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_rotate(void)
|
||||
void register_node_type_tex_rotate()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "node_texture_util.hh"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
static bNodeSocketTemplate inputs[] = {
|
||||
{SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -48,7 +48,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
|
||||
}
|
||||
|
||||
void register_node_type_tex_scale(void)
|
||||
void register_node_type_tex_scale()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "BLI_listbase.h"
|
||||
#include "NOD_texture.h"
|
||||
#include "node_texture_util.hh"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
static bNodeSocketTemplate inputs[] = {
|
||||
{SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -90,7 +90,7 @@ static void exec(void *data,
|
|||
tex_output(node, execdata, in, out[3], &valuefn_a, tex_call_data);
|
||||
}
|
||||
|
||||
void register_node_type_tex_separate_color(void)
|
||||
void register_node_type_tex_separate_color()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
* For a complete implementation example look at the Cycles Bake commit.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <climits>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
@ -74,31 +74,31 @@
|
|||
/* local include */
|
||||
#include "zbuf.h"
|
||||
|
||||
typedef struct BakeDataZSpan {
|
||||
struct BakeDataZSpan {
|
||||
BakePixel *pixel_array;
|
||||
int primitive_id;
|
||||
BakeImage *bk_image;
|
||||
ZSpan *zspan;
|
||||
float du_dx, du_dy;
|
||||
float dv_dx, dv_dy;
|
||||
} BakeDataZSpan;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wrapping up tangent space data
|
||||
*/
|
||||
typedef struct TSpace {
|
||||
struct TSpace {
|
||||
float tangent[3];
|
||||
float sign;
|
||||
} TSpace;
|
||||
};
|
||||
|
||||
typedef struct TriTessFace {
|
||||
struct TriTessFace {
|
||||
const MVert *mverts[3];
|
||||
const float *vert_normals[3];
|
||||
const TSpace *tspace[3];
|
||||
const float *loop_normal[3];
|
||||
float normal[3]; /* for flat faces */
|
||||
bool is_smooth;
|
||||
} TriTessFace;
|
||||
};
|
||||
|
||||
static void store_bake_pixel(void *handle, int x, int y, float u, float v)
|
||||
{
|
||||
|
@ -536,7 +536,7 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
|
|||
return triangles;
|
||||
}
|
||||
|
||||
bool RE_bake_pixels_populate_from_objects(struct Mesh *me_low,
|
||||
bool RE_bake_pixels_populate_from_objects(Mesh *me_low,
|
||||
BakePixel pixel_array_from[],
|
||||
BakePixel pixel_array_to[],
|
||||
BakeHighPolyData highpoly[],
|
||||
|
@ -547,7 +547,7 @@ bool RE_bake_pixels_populate_from_objects(struct Mesh *me_low,
|
|||
const float max_ray_distance,
|
||||
float mat_low[4][4],
|
||||
float mat_cage[4][4],
|
||||
struct Mesh *me_cage)
|
||||
Mesh *me_cage)
|
||||
{
|
||||
size_t i;
|
||||
int primitive_id;
|
||||
|
@ -968,7 +968,7 @@ void RE_bake_normal_world_to_object(const BakePixel pixel_array[],
|
|||
const size_t pixels_num,
|
||||
const int depth,
|
||||
float result[],
|
||||
struct Object *ob,
|
||||
Object *ob,
|
||||
const eBakeNormalSwizzle normal_swizzle[3])
|
||||
{
|
||||
size_t i;
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
|
||||
#include "DRW_engine.h"
|
||||
|
||||
#include "GPU_context.h"
|
||||
#include "WM_api.h"
|
||||
|
||||
#include "pipeline.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* \ingroup render
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
@ -40,26 +40,26 @@
|
|||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
typedef void (*MPassKnownData)(DerivedMesh *lores_dm,
|
||||
DerivedMesh *hires_dm,
|
||||
void *thread_data,
|
||||
void *bake_data,
|
||||
ImBuf *ibuf,
|
||||
const int face_index,
|
||||
const int lvl,
|
||||
const float st[2],
|
||||
float tangmat[3][3],
|
||||
const int x,
|
||||
const int y);
|
||||
using MPassKnownData = void (*)(DerivedMesh *lores_dm,
|
||||
DerivedMesh *hires_dm,
|
||||
void *thread_data,
|
||||
void *bake_data,
|
||||
ImBuf *ibuf,
|
||||
const int face_index,
|
||||
const int lvl,
|
||||
const float st[2],
|
||||
float tangmat[3][3],
|
||||
const int x,
|
||||
const int y);
|
||||
|
||||
typedef void *(*MInitBakeData)(MultiresBakeRender *bkr, ImBuf *ibuf);
|
||||
typedef void (*MFreeBakeData)(void *bake_data);
|
||||
using MInitBakeData = void *(*)(MultiresBakeRender *bkr, ImBuf *ibuf);
|
||||
using MFreeBakeData = void (*)(void *bake_data);
|
||||
|
||||
typedef struct MultiresBakeResult {
|
||||
struct MultiresBakeResult {
|
||||
float height_min, height_max;
|
||||
} MultiresBakeResult;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct MResolvePixelData {
|
||||
MVert *mvert;
|
||||
const float (*vert_normals)[3];
|
||||
MPoly *mpoly;
|
||||
|
@ -80,32 +80,32 @@ typedef struct {
|
|||
MPassKnownData pass_data;
|
||||
/* material aligned UV array */
|
||||
Image **image_array;
|
||||
} MResolvePixelData;
|
||||
};
|
||||
|
||||
typedef void (*MFlushPixel)(const MResolvePixelData *data, const int x, const int y);
|
||||
using MFlushPixel = void (*)(const MResolvePixelData *data, const int x, const int y);
|
||||
|
||||
typedef struct {
|
||||
struct MBakeRast {
|
||||
int w, h;
|
||||
char *texels;
|
||||
const MResolvePixelData *data;
|
||||
MFlushPixel flush_pixel;
|
||||
bool *do_update;
|
||||
} MBakeRast;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct MHeightBakeData {
|
||||
float *heights;
|
||||
DerivedMesh *ssdm;
|
||||
const int *orig_index_mp_to_orig;
|
||||
} MHeightBakeData;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct MNormalBakeData {
|
||||
const int *orig_index_mp_to_orig;
|
||||
} MNormalBakeData;
|
||||
};
|
||||
|
||||
typedef struct BakeImBufuserData {
|
||||
struct BakeImBufuserData {
|
||||
float *displacement_buffer;
|
||||
char *mask_buffer;
|
||||
} BakeImBufuserData;
|
||||
};
|
||||
|
||||
static void multiresbake_get_normal(const MResolvePixelData *data,
|
||||
const int tri_num,
|
||||
|
@ -334,13 +334,13 @@ static int multiresbake_test_break(MultiresBakeRender *bkr)
|
|||
|
||||
/* **** Threading routines **** */
|
||||
|
||||
typedef struct MultiresBakeQueue {
|
||||
struct MultiresBakeQueue {
|
||||
int cur_tri;
|
||||
int tot_tri;
|
||||
SpinLock spin;
|
||||
} MultiresBakeQueue;
|
||||
};
|
||||
|
||||
typedef struct MultiresBakeThread {
|
||||
struct MultiresBakeThread {
|
||||
/* this data is actually shared between all the threads */
|
||||
MultiresBakeQueue *queue;
|
||||
MultiresBakeRender *bkr;
|
||||
|
@ -353,7 +353,7 @@ typedef struct MultiresBakeThread {
|
|||
|
||||
/* displacement-specific data */
|
||||
float height_min, height_max;
|
||||
} MultiresBakeThread;
|
||||
};
|
||||
|
||||
static int multires_bake_queue_next_tri(MultiresBakeQueue *queue)
|
||||
{
|
||||
|
|
|
@ -984,7 +984,7 @@ const wmKeyMapItem *WM_modalkeymap_find_propvalue(const wmKeyMap *km, const int
|
|||
|
||||
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, 0);
|
||||
wmOperatorType *ot = WM_operatortype_find(opname, false);
|
||||
|
||||
if (ot) {
|
||||
ot->modalkeymap = km;
|
||||
|
|
Loading…
Reference in New Issue