Cleanup: comments (mainly long lines)

Comments after code can cause awkward line breaks.
This commit is contained in:
2019-04-21 13:44:06 +10:00
parent 9d72efe108
commit 93c19a5a2c
14 changed files with 134 additions and 85 deletions

View File

@@ -325,22 +325,25 @@ void BKE_edges_sharp_from_angle_set(const struct MVert *mverts,
* References a contiguous loop-fan with normal offset vars.
*/
typedef struct MLoopNorSpace {
float vec_lnor[3]; /* Automatically computed loop normal. */
float vec_ref[3]; /* Reference vector, orthogonal to vec_lnor. */
float vec_ortho[3]; /* Third vector, orthogonal to vec_lnor and vec_ref. */
float
ref_alpha; /* Reference angle, around vec_ortho, in ]0, pi] range (0.0 marks that space as invalid). */
float
ref_beta; /* Reference angle, around vec_lnor, in ]0, 2pi] range (0.0 marks that space as invalid). */
/* All loops using this lnor space (i.e. smooth fan of loops),
/** Automatically computed loop normal. */
float vec_lnor[3];
/** Reference vector, orthogonal to vec_lnor. */
float vec_ref[3];
/** Third vector, orthogonal to vec_lnor and vec_ref. */
float vec_ortho[3];
/** Reference angle, around vec_ortho, in ]0, pi] range (0.0 marks that space as invalid). */
float ref_alpha;
/** Reference angle, around vec_lnor, in ]0, 2pi] range (0.0 marks that space as invalid). */
float ref_beta;
/** All loops using this lnor space (i.e. smooth fan of loops),
* as (depending on owning MLoopNorSpaceArrary.data_type):
* - Indices (uint_in_ptr), or
* - BMLoop pointers. */
struct LinkNode *loops;
char flags;
void *
user_data; /* To be used for extended processing related to loop normal spaces (aka smooth fans). */
/** To be used for extended processing related to loop normal spaces (aka smooth fans). */
void *user_data;
} MLoopNorSpace;
/**
* MLoopNorSpace.flags

View File

@@ -1404,8 +1404,9 @@ static void followpath_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *
mul_m4_m4m4(cob->matrix, ct->matrix, obmat);
/* un-apply scaling caused by path */
if ((data->followflag & FOLLOWPATH_RADIUS) ==
0) { /* XXX - assume that scale correction means that radius will have some scale error in it - Campbell */
if ((data->followflag & FOLLOWPATH_RADIUS) == 0) {
/* XXX: Assume that scale correction means that radius
* will have some scale error in it - Campbell. */
float obsize[3];
mat4_to_size(obsize, cob->matrix);

View File

@@ -145,14 +145,18 @@ typedef struct IDRemap {
Main *bmain; /* Only used to trigger depsgraph updates in the right bmain. */
ID *old_id;
ID *new_id;
ID *id; /* The ID in which we are replacing old_id by new_id usages. */
/** The ID in which we are replacing old_id by new_id usages. */
ID *id;
short flag;
/* 'Output' data. */
short status;
int skipped_direct; /* Number of direct usecases that could not be remapped (e.g.: obdata when in edit mode). */
int skipped_indirect; /* Number of indirect usecases that could not be remapped. */
int skipped_refcounted; /* Number of skipped usecases that refcount the datablock. */
/** Number of direct usecases that could not be remapped (e.g.: obdata when in edit mode). */
int skipped_direct;
/** Number of indirect usecases that could not be remapped. */
int skipped_indirect;
/** Number of skipped usecases that refcount the datablock. */
int skipped_refcounted;
} IDRemap;
/* IDRemap->flag enums defined in BKE_library.h */

View File

@@ -445,13 +445,16 @@ static int mesh_remap_interp_poly_data_get(const MPoly *mp,
return sources_num;
}
/* Little helper when dealing with source islands */
/** Little helper when dealing with source islands */
typedef struct IslandResult {
float
factor; /* A factor, based on which best island for a given set of elements will be selected. */
int index_src; /* Index of the source. */
float hit_dist; /* The actual hit distance. */
float hit_point[3]; /* The hit point, if relevant. */
/** A factor, based on which best island for a given set of elements will be selected. */
float factor;
/** Index of the source. */
int index_src;
/** The actual hit distance. */
float hit_dist;
/** The hit point, if relevant. */
float hit_point[3];
} IslandResult;
/* Note about all bvh/raycasting stuff below:

View File

@@ -66,9 +66,10 @@
typedef struct DupliContext {
Depsgraph *depsgraph;
Collection
*collection; /* XXX child objects are selected from this group if set, could be nicer */
Object *obedit; /* Only to check if the object is in edit-mode. */
/** XXX child objects are selected from this group if set, could be nicer. */
Collection *collection;
/** Only to check if the object is in edit-mode. */
Object *obedit;
Scene *scene;
ViewLayer *view_layer;
@@ -80,7 +81,7 @@ typedef struct DupliContext {
const struct DupliGenerator *gen;
/* result containers */
/** Result containers. */
ListBase *duplilist; /* legacy doubly-linked list */
} DupliContext;

View File

@@ -505,8 +505,8 @@ static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim)
/**
* Do a full rebuild with on Mesh data structure.
*
* \note Unlike mpoly/mloop/verts, looptri is **totally owned** by PBVH (which means it may rewrite it if needed,
* see #BKE_pbvh_apply_vertCos().
* \note Unlike mpoly/mloop/verts, looptri is **totally owned** by PBVH
* (which means it may rewrite it if needed, see #BKE_pbvh_apply_vertCos().
*/
void BKE_pbvh_build_mesh(PBVH *bvh,
const MPoly *mpoly,

View File

@@ -26,8 +26,9 @@
* \ingroup Node
*/
class DilateErodeNode : public Node {
NodeBlurData
m_alpha_blur; /* only used for blurring alpha, since the dilate/erode node doesn't have this */
/** only used for blurring alpha, since the dilate/erode node doesn't have this. */
NodeBlurData m_alpha_blur;
public:
DilateErodeNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;

View File

@@ -92,38 +92,64 @@ typedef struct EEVEE_LightBake {
struct Main *bmain;
EEVEE_ViewLayerData *sldata;
LightProbe **probe; /* Current probe being rendered. */
GPUTexture *rt_color; /* Target cube color texture. */
GPUTexture *rt_depth; /* Target cube depth texture. */
GPUFrameBuffer *rt_fb[6]; /* Target cube framebuffers. */
GPUFrameBuffer *store_fb; /* Storage framebuffer. */
int rt_res; /* Cube render target resolution. */
/** Current probe being rendered. */
LightProbe **probe;
/** Target cube color texture. */
GPUTexture *rt_color;
/** Target cube depth texture. */
GPUTexture *rt_depth;
/** Target cube framebuffers. */
GPUFrameBuffer *rt_fb[6];
/** Storage framebuffer. */
GPUFrameBuffer *store_fb;
/** Cube render target resolution. */
int rt_res;
/* Shared */
int layer; /* Target layer to store the data to. */
float samples_ct, invsamples_ct; /* Sample count for the convolution. */
float lod_factor; /* Sampling bias during convolution step. */
float lod_max; /* Max cubemap LOD to sample when convolving. */
int cube_len, grid_len; /* Number of probes to render + world probe. */
/** Target layer to store the data to. */
int layer;
/** Sample count for the convolution. */
float samples_ct, invsamples_ct;
/** Sampling bias during convolution step. */
float lod_factor;
/** Max cubemap LOD to sample when convolving. */
float lod_max;
/** Number of probes to render + world probe. */
int cube_len, grid_len;
/* Irradiance grid */
EEVEE_LightGrid *grid; /* Current probe being rendered (UBO data). */
int irr_cube_res; /* Target cubemap at MIP 0. */
int irr_size[3]; /* Size of the irradiance texture. */
int total_irr_samples; /* Total for all grids */
int grid_sample; /* Nth sample of the current grid being rendered. */
int grid_sample_len; /* Total number of samples for the current grid. */
int grid_curr; /* Nth grid in the cache being rendered. */
int bounce_curr, bounce_len; /* The current light bounce being evaluated. */
float vis_res; /* Resolution of the Visibility shadowmap. */
GPUTexture *grid_prev; /* Result of previous light bounce. */
LightProbe **grid_prb; /* Pointer to the id.data of the probe object. */
/** Current probe being rendered (UBO data). */
EEVEE_LightGrid *grid;
/** Target cubemap at MIP 0. */
int irr_cube_res;
/** Size of the irradiance texture. */
int irr_size[3];
/** Total for all grids */
int total_irr_samples;
/** Nth sample of the current grid being rendered. */
int grid_sample;
/** Total number of samples for the current grid. */
int grid_sample_len;
/** Nth grid in the cache being rendered. */
int grid_curr;
/** The current light bounce being evaluated. */
int bounce_curr, bounce_len;
/** Resolution of the Visibility shadowmap. */
float vis_res;
/** Result of previous light bounce. */
GPUTexture *grid_prev;
/** Pointer to the id.data of the probe object. */
LightProbe **grid_prb;
/* Reflection probe */
EEVEE_LightProbe *cube; /* Current probe being rendered (UBO data). */
int ref_cube_res; /* Target cubemap at MIP 0. */
int cube_offset; /* Index of the current cube. */
LightProbe **cube_prb; /* Pointer to the id.data of the probe object. */
/** Current probe being rendered (UBO data). */
EEVEE_LightProbe *cube;
/** Target cubemap at MIP 0. */
int ref_cube_res;
/** Index of the current cube. */
int cube_offset;
/** Pointer to the id.data of the probe object. */
LightProbe **cube_prb;
/* Dummy Textures */
struct GPUTexture *dummy_color, *dummy_depth;
@@ -133,15 +159,18 @@ typedef struct EEVEE_LightBake {
short *stop, *do_update;
float *progress;
bool resource_only; /* For only handling the resources. */
/** For only handling the resources. */
bool resource_only;
bool own_resources;
bool
own_light_cache; /* If the lightcache was created for baking, it's first owned by the baker. */
int delay; /* ms. delay the start of the baking to not slowdown interactions (TODO remove) */
int frame; /* Scene frame to bake. */
/** If the lightcache was created for baking, it's first owned by the baker. */
bool own_light_cache;
/** ms. delay the start of the baking to not slowdown interactions (TODO remove) */
int delay;
/** Scene frame to bake. */
int frame;
void *gl_context,
*gpu_context; /* If running in parallel (in a separate thread), use this context. */
/** If running in parallel (in a separate thread), use this context. */
void *gl_context, *gpu_context;
ThreadMutex *mutex;
} EEVEE_LightBake;

View File

@@ -253,10 +253,12 @@ struct DRWShadingGroup {
};
};
DRWState state_extra; /* State changes for this batch only (or'd with the pass's state) */
DRWState
state_extra_disable; /* State changes for this batch only (and'd with the pass's state) */
uint stencil_mask; /* Stencil mask to use for stencil test / write operations */
/** State changes for this batch only (or'd with the pass's state) */
DRWState state_extra;
/** State changes for this batch only (and'd with the pass's state) */
DRWState state_extra_disable;
/** Stencil mask to use for stencil test / write operations */
uint stencil_mask;
DRWShadingGroupType type;
/* Builtin matrices locations */
@@ -395,10 +397,11 @@ typedef struct DRWManager {
/* gl_context serves as the offset for clearing only
* the top portion of the struct so DO NOT MOVE IT! */
void *gl_context; /* Unique ghost context used by the draw manager. */
/** Unique ghost context used by the draw manager. */
void *gl_context;
GPUContext *gpu_context;
TicketMutex
*gl_context_mutex; /* Mutex to lock the drw manager and avoid concurrent context usage. */
/** Mutex to lock the drw manager and avoid concurrent context usage. */
TicketMutex *gl_context_mutex;
/** GPU Resource State: Memory storage between drawing. */
struct {

View File

@@ -617,9 +617,9 @@ static void draw_clipping_setup_from_view(void)
float F = -1.0f, N; /* square distance of far and near point to origin */
float f, n; /* distance of far and near point to z axis. f is always > 0 but n can be < 0 */
float e, s; /* far and near clipping distance (<0) */
float
c; /* slope of center line = distance of far clipping center to z axis / far clipping distance */
float z; /* projection of sphere center on z axis (<0) */
float c; /* slope of center line = distance of far clipping center
* to z axis / far clipping distance. */
float z; /* projection of sphere center on z axis (<0) */
/* Find farthest corner and center of far clip plane. */
float corner[3] = {1.0f, 1.0f, 1.0f}; /* in clip space */

View File

@@ -431,8 +431,8 @@ typedef struct PointerPropertyRNA {
PropPointerGetFunc get;
PropPointerSetFunc set;
PropPointerTypeFunc typef;
PropPointerPollFunc
poll; /* unlike operators, 'set' can still run if poll fails, used for filtering display */
/** unlike operators, 'set' can still run if poll fails, used for filtering display. */
PropPointerPollFunc poll;
struct StructRNA *type;
} PointerPropertyRNA;

View File

@@ -5250,7 +5250,9 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna)
# if 0 /* TODO */
{DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"},
# endif
# if 0 /* XXX When SkinModifier is enabled, it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
/* XXX When SkinModifier is enabled,
* it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
# if 0
{DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"},
# endif
{DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"},

View File

@@ -40,11 +40,12 @@ struct bNodeTree;
/* Node execution data */
typedef struct bNodeExec {
struct bNode *node; /* backpointer to node */
/** Backpointer to node. */
struct bNode *node;
bNodeExecData data;
NodeFreeExecFunction
freeexecfunc; /* free function, stored in exec itself to avoid dangling node pointer access */
/** Free function, stored in exec itself to avoid dangling node pointer access. */
NodeFreeExecFunction freeexecfunc;
} bNodeExec;
/* Execution Data for each instance of node tree execution */

View File

@@ -54,20 +54,21 @@
#include "bpy_rna.h"
typedef struct IDUserMapData {
/* place-holder key only used for lookups to avoid creating new data only for lookups
/** Place-holder key only used for lookups to avoid creating new data only for lookups
* (never return its contents) */
PyObject *py_id_key_lookup_only;
/* we loop over data-blocks that this ID points to (do build a reverse lookup table) */
/** We loop over data-blocks that this ID points to (do build a reverse lookup table) */
PyObject *py_id_curr;
ID *id_curr;
/* filter the values we add into the set */
/** Filter the values we add into the set. */
BLI_bitmap *types_bitmap;
PyObject *user_map; /* set to fill in as we iterate */
bool
is_subset; /* true when we're only mapping a subset of all the ID's (subset arg is passed) */
/** Set to fill in as we iterate. */
PyObject *user_map;
/** true when we're only mapping a subset of all the ID's (subset arg is passed). */
bool is_subset;
} IDUserMapData;
static int id_code_as_index(const short idcode)