Cleanup: move texture nodes to C++

No functional changes are expected. The goal here is to make
further refactorings to the nodes system easier.
This commit is contained in:
2022-11-17 13:04:45 +01:00
parent dad8f4ac09
commit 576d99e59a
29 changed files with 119 additions and 112 deletions
+28 -28
View File
@@ -22,35 +22,35 @@ set(INC
set(SRC
nodes/node_texture_at.c
nodes/node_texture_bricks.c
nodes/node_texture_checker.c
nodes/node_texture_combine_color.c
nodes/node_texture_common.c
nodes/node_texture_compose.c
nodes/node_texture_coord.c
nodes/node_texture_curves.c
nodes/node_texture_decompose.c
nodes/node_texture_distance.c
nodes/node_texture_hueSatVal.c
nodes/node_texture_image.c
nodes/node_texture_invert.c
nodes/node_texture_math.c
nodes/node_texture_mixRgb.c
nodes/node_texture_output.c
nodes/node_texture_proc.c
nodes/node_texture_rotate.c
nodes/node_texture_scale.c
nodes/node_texture_separate_color.c
nodes/node_texture_texture.c
nodes/node_texture_translate.c
nodes/node_texture_valToNor.c
nodes/node_texture_valToRgb.c
nodes/node_texture_viewer.c
node_texture_tree.c
node_texture_util.c
nodes/node_texture_at.cc
nodes/node_texture_bricks.cc
nodes/node_texture_checker.cc
nodes/node_texture_combine_color.cc
nodes/node_texture_common.cc
nodes/node_texture_compose.cc
nodes/node_texture_coord.cc
nodes/node_texture_curves.cc
nodes/node_texture_decompose.cc
nodes/node_texture_distance.cc
nodes/node_texture_hueSatVal.cc
nodes/node_texture_image.cc
nodes/node_texture_invert.cc
nodes/node_texture_math.cc
nodes/node_texture_mixRgb.cc
nodes/node_texture_output.cc
nodes/node_texture_proc.cc
nodes/node_texture_rotate.cc
nodes/node_texture_scale.cc
nodes/node_texture_separate_color.cc
nodes/node_texture_texture.cc
nodes/node_texture_translate.cc
nodes/node_texture_valToNor.cc
nodes/node_texture_valToRgb.cc
nodes/node_texture_viewer.cc
node_texture_tree.cc
node_texture_util.cc
node_texture_util.h
node_texture_util.hh
)
set(LIB
@@ -26,7 +26,7 @@
#include "NOD_texture.h"
#include "node_common.h"
#include "node_exec.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include "node_util.h"
#include "DEG_depsgraph.h"
@@ -106,7 +106,7 @@ static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
bNode *node, *node_next;
/* replace muted nodes and reroute nodes by internal links */
for (node = localtree->nodes.first; node; node = node_next) {
for (node = static_cast<bNode *>(localtree->nodes.first); node; node = node_next) {
node_next = node->next;
if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
@@ -137,8 +137,7 @@ bNodeTreeType *ntreeType_Texture;
void register_node_tree_type_tex(void)
{
bNodeTreeType *tt = ntreeType_Texture = MEM_callocN(sizeof(bNodeTreeType),
"texture node tree type");
bNodeTreeType *tt = ntreeType_Texture = MEM_cnew<bNodeTreeType>("texture node tree type");
tt->type = NTREE_TEXTURE;
strcpy(tt->idname, "TextureNodeTree");
@@ -173,7 +172,7 @@ bNodeThreadStack *ntreeGetThreadStack(bNodeTreeExec *exec, int thread)
}
if (!nts) {
nts = MEM_callocN(sizeof(bNodeThreadStack), "bNodeThreadStack");
nts = MEM_cnew<bNodeThreadStack>("bNodeThreadStack");
nts->stack = (bNodeStack *)MEM_dupallocN(exec->stack);
nts->used = true;
BLI_addtail(lb, nts);
@@ -226,9 +225,9 @@ bNodeTreeExec *ntreeTexBeginExecTree_internal(bNodeExecContext *context,
exec = ntree_exec_begin(context, ntree, parent_key);
/* allocate the thread stack listbase array */
exec->threadstack = MEM_callocN(BLENDER_MAX_THREADS * sizeof(ListBase), "thread stack array");
exec->threadstack = MEM_cnew_array<ListBase>(BLENDER_MAX_THREADS, "thread stack array");
for (node = exec->nodetree->nodes.first; node; node = node->next) {
for (node = static_cast<bNode *>(exec->nodetree->nodes.first); node; node = node->next) {
node->need_exec = 1;
}
@@ -267,7 +266,8 @@ static void tex_free_delegates(bNodeTreeExec *exec)
int th, a;
for (th = 0; th < BLENDER_MAX_THREADS; th++) {
for (nts = exec->threadstack[th].first; nts; nts = nts->next) {
for (nts = static_cast<bNodeThreadStack *>(exec->threadstack[th].first); nts;
nts = nts->next) {
for (ns = nts->stack, a = 0; a < exec->stacksize; a++, ns++) {
if (ns->data && !ns->is_copy) {
MEM_freeN(ns->data);
@@ -286,7 +286,8 @@ void ntreeTexEndExecTree_internal(bNodeTreeExec *exec)
tex_free_delegates(exec);
for (a = 0; a < BLENDER_MAX_THREADS; a++) {
for (nts = exec->threadstack[a].first; nts; nts = nts->next) {
for (nts = static_cast<bNodeThreadStack *>(exec->threadstack[a].first); nts;
nts = nts->next) {
if (nts->stack) {
MEM_freeN(nts->stack);
}
@@ -21,7 +21,7 @@
* over other previous ones.
*/
#include "node_texture_util.h"
#include "node_texture_util.hh"
bool tex_node_poll_default(bNodeType *UNUSED(ntype),
bNodeTree *ntree,
@@ -51,7 +51,7 @@ static void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, sh
static void tex_input(float *out, int num, bNodeStack *in, TexParams *params, short thread)
{
TexDelegate *dg = in->data;
TexDelegate *dg = static_cast<TexDelegate *>(in->data);
if (dg) {
tex_call_delegate(dg, in->vec, params, thread);
@@ -118,10 +118,11 @@ void tex_output(bNode *node,
if (!out->data) {
/* Freed in tex_end_exec (node.cc) */
dg = out->data = MEM_mallocN(sizeof(TexDelegate), "tex delegate");
dg = MEM_new<TexDelegate>("tex delegate");
out->data = dg;
}
else {
dg = out->data;
dg = static_cast<TexDelegate *>(out->data);
}
dg->cdata = cdata;
@@ -135,7 +136,7 @@ void tex_output(bNode *node,
void ntreeTexCheckCyclics(struct bNodeTree *ntree)
{
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
for (node = static_cast<bNode *>(ntree->nodes.first); node; node = node->next) {
if (node->type == TEX_NODE_TEXTURE && node->id) {
/* custom2 stops the node from rendering */
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate inputs[] = {
{SOCK_RGBA, N_("Texture"), 0.0f, 0.0f, 0.0f, 1.0f},
@@ -35,7 +35,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_at(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
@@ -96,7 +96,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_bricks(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {
@@ -47,7 +47,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_checker(void)
@@ -7,7 +7,7 @@
#include "BLI_listbase.h"
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate inputs[] = {
{SOCK_FLOAT, N_("Red"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
@@ -60,7 +60,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_combine_color(void)
@@ -14,7 +14,7 @@
#include "NOD_common.h"
#include "node_common.h"
#include "node_exec.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include "RNA_access.h"
@@ -65,9 +65,10 @@ static void group_copy_inputs(bNode *gnode, bNodeStack **in, bNodeStack *gstack)
bNodeStack *ns;
int a;
for (node = ngroup->nodes.first; node; node = node->next) {
for (node = static_cast<bNode *>(ngroup->nodes.first); node; node = node->next) {
if (node->type == NODE_GROUP_INPUT) {
for (sock = node->outputs.first, a = 0; sock; sock = sock->next, a++) {
for (sock = static_cast<bNodeSocket *>(node->outputs.first), a = 0; sock;
sock = sock->next, a++) {
if (in[a]) { /* shouldn't need to check this T36694. */
ns = node_get_socket_stack(gstack, sock);
if (ns) {
@@ -89,9 +90,10 @@ static void group_copy_outputs(bNode *gnode, bNodeStack **out, bNodeStack *gstac
bNodeStack *ns;
int a;
for (node = ngroup->nodes.first; node; node = node->next) {
for (node = static_cast<bNode *>(ngroup->nodes.first); node; node = node->next) {
if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) {
for (sock = node->inputs.first, a = 0; sock; sock = sock->next, a++) {
for (sock = static_cast<bNodeSocket *>(node->inputs.first), a = 0; sock;
sock = sock->next, a++) {
if (out[a]) { /* shouldn't need to check this T36694. */
ns = node_get_socket_stack(gstack, sock);
if (ns) {
@@ -111,7 +113,7 @@ static void group_execute(void *data,
struct bNodeStack **in,
struct bNodeStack **out)
{
bNodeTreeExec *exec = execdata->data;
bNodeTreeExec *exec = static_cast<bNodeTreeExec *>(execdata->data);
bNodeThreadStack *nts;
if (!exec) {
@@ -123,7 +125,7 @@ static void group_execute(void *data,
*/
{
bNode *inode;
for (inode = exec->nodetree->nodes.first; inode; inode = inode->next) {
for (inode = static_cast<bNode *>(exec->nodetree->nodes.first); inode; inode = inode->next) {
inode->need_exec = 1;
}
}
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate inputs[] = {
{SOCK_FLOAT, N_("Red"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_UNSIGNED},
@@ -35,7 +35,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_compose(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate outputs[] = {
{SOCK_VECTOR, N_("Coordinates")},
@@ -26,7 +26,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &vectorfn, data);
tex_output(node, execdata, in, out[0], &vectorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_coord(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
/* **************** CURVE Time ******************** */
@@ -23,8 +23,9 @@ static void time_colorfn(
fac = (p->cfra - node->custom1) / (float)(node->custom2 - node->custom1);
}
BKE_curvemapping_init(node->storage);
fac = BKE_curvemapping_evaluateF(node->storage, 0, fac);
CurveMapping *mapping = static_cast<CurveMapping *>(node->storage);
BKE_curvemapping_init(mapping);
fac = BKE_curvemapping_evaluateF(mapping, 0, fac);
out[0] = CLAMPIS(fac, 0.0f, 1.0f);
}
@@ -35,7 +36,7 @@ static void time_exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &time_colorfn, data);
tex_output(node, execdata, in, out[0], &time_colorfn, static_cast<TexCallData *>(data));
}
static void time_init(bNodeTree *UNUSED(ntree), bNode *node)
@@ -76,7 +77,7 @@ static void rgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in,
float cin[4];
tex_input_rgba(cin, in[0], p, thread);
BKE_curvemapping_evaluateRGBF(node->storage, out, cin);
BKE_curvemapping_evaluateRGBF(static_cast<CurveMapping *>(node->storage), out, cin);
out[3] = cin[3];
}
@@ -87,7 +88,7 @@ static void rgb_exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &rgb_colorfn, data);
tex_output(node, execdata, in, out[0], &rgb_colorfn, static_cast<TexCallData *>(data));
}
static void rgb_init(bNodeTree *UNUSED(ntree), bNode *node)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {
@@ -52,10 +52,11 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &valuefn_r, data);
tex_output(node, execdata, in, out[1], &valuefn_g, data);
tex_output(node, execdata, in, out[2], &valuefn_b, data);
tex_output(node, execdata, in, out[3], &valuefn_a, data);
TexCallData *tex_call_data = static_cast<TexCallData *>(data);
tex_output(node, execdata, in, out[0], &valuefn_r, tex_call_data);
tex_output(node, execdata, in, out[1], &valuefn_g, tex_call_data);
tex_output(node, execdata, in, out[2], &valuefn_b, tex_call_data);
tex_output(node, execdata, in, out[3], &valuefn_a, tex_call_data);
}
void register_node_type_tex_decompose(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {
@@ -37,7 +37,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &valuefn, data);
tex_output(node, execdata, in, out[0], &valuefn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_distance(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate inputs[] = {
{SOCK_FLOAT, N_("Hue"), 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, PROP_NONE},
@@ -84,7 +84,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_hue_sat(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate outputs[] = {
{SOCK_RGBA, N_("Image")},
@@ -77,12 +77,12 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
static void init(bNodeTree *UNUSED(ntree), bNode *node)
{
ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user");
ImageUser *iuser = MEM_cnew<ImageUser>("node image user");
node->storage = iuser;
iuser->sfra = 1;
iuser->flag |= IMA_ANIM_ALWAYS;
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
/* **************** INVERT ******************** */
static bNodeSocketTemplate inputs[] = {
@@ -40,7 +40,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_invert(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
/* **************** SCALAR MATH ******************** */
static bNodeSocketTemplate inputs[] = {
@@ -312,7 +312,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &valuefn, data);
tex_output(node, execdata, in, out[0], &valuefn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_math(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
/* **************** MIX RGB ******************** */
static bNodeSocketTemplate inputs[] = {
@@ -46,7 +46,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_mix_rgb(void)
@@ -8,7 +8,7 @@
#include "BLI_string.h"
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
/* **************** COMPOSITE ******************** */
static bNodeSocketTemplate inputs[] = {
@@ -116,7 +116,7 @@ check_index:
static void init(bNodeTree *UNUSED(ntree), bNode *node)
{
TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output");
TexNodeOutput *tno = MEM_cnew<TexNodeOutput>("TEX_output");
node->storage = tno;
strcpy(tno->name, "Default");
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include "RE_texture.h"
@@ -55,7 +55,7 @@ typedef void (*MapFn)(Tex *tex, bNodeStack **in, TexParams *p, const short threa
static void texfn(
float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
{
Tex tex = *((Tex *)(node->storage));
Tex tex = blender::dna::shallow_copy(*((Tex *)(node->storage)));
float col1[4], col2[4];
tex_input_rgba(col1, in[0], p, thread);
tex_input_rgba(col2, in[1], p, thread);
@@ -69,7 +69,7 @@ static int count_outputs(bNode *node)
{
bNodeSocket *sock;
int num = 0;
for (sock = node->outputs.first; sock; sock = sock->next) {
for (sock = static_cast<bNodeSocket *>(node->outputs.first); sock; sock = sock->next) {
num++;
}
return num;
@@ -98,7 +98,7 @@ static int count_outputs(bNode *node)
{ \
int outs = count_outputs(node); \
if (outs >= 1) { \
tex_output(node, execdata, in, out[0], &name##_colorfn, data); \
tex_output(node, execdata, in, out[0], &name##_colorfn, static_cast<TexCallData *>(data)); \
} \
}
@@ -234,7 +234,7 @@ ProcDef(stucci);
static void init(bNodeTree *UNUSED(ntree), bNode *node)
{
Tex *tex = MEM_callocN(sizeof(Tex), "Tex");
Tex *tex = static_cast<Tex *>(MEM_callocN(sizeof(Tex), "Tex"));
node->storage = tex;
BKE_texture_default(tex);
@@ -8,7 +8,7 @@
#include <math.h>
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate inputs[] = {
{SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f},
@@ -72,7 +72,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_rotate(void)
@@ -5,7 +5,7 @@
* \ingroup texnodes
*/
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {
@@ -45,7 +45,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_scale(void)
@@ -7,7 +7,7 @@
#include "BLI_listbase.h"
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {
@@ -83,10 +83,11 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &valuefn_r, data);
tex_output(node, execdata, in, out[1], &valuefn_g, data);
tex_output(node, execdata, in, out[2], &valuefn_b, data);
tex_output(node, execdata, in, out[3], &valuefn_a, data);
TexCallData *tex_call_data = static_cast<TexCallData *>(data);
tex_output(node, execdata, in, out[0], &valuefn_r, tex_call_data);
tex_output(node, execdata, in, out[1], &valuefn_g, tex_call_data);
tex_output(node, execdata, in, out[2], &valuefn_b, tex_call_data);
tex_output(node, execdata, in, out[3], &valuefn_a, tex_call_data);
}
void register_node_type_tex_separate_color(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include "RE_texture.h"
@@ -69,7 +69,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_texture(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {
@@ -41,7 +41,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &colorfn, data);
tex_output(node, execdata, in, out[0], &colorfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_translate(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
static bNodeSocketTemplate inputs[] = {
{SOCK_FLOAT, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
@@ -57,7 +57,7 @@ static void exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &normalfn, data);
tex_output(node, execdata, in, out[0], &normalfn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_valtonor(void)
@@ -7,7 +7,7 @@
#include "IMB_colormanagement.h"
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
/* **************** VALTORGB ******************** */
static bNodeSocketTemplate valtorgb_in[] = {
@@ -24,7 +24,7 @@ static void valtorgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack *
if (node->storage) {
float fac = tex_input_value(in[0], p, thread);
BKE_colorband_evaluate(node->storage, fac, out);
BKE_colorband_evaluate(static_cast<const ColorBand *>(node->storage), fac, out);
}
}
@@ -35,7 +35,7 @@ static void valtorgb_exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &valtorgb_colorfn, data);
tex_output(node, execdata, in, out[0], &valtorgb_colorfn, static_cast<TexCallData *>(data));
}
static void valtorgb_init(bNodeTree *UNUSED(ntree), bNode *node)
@@ -82,7 +82,7 @@ static void rgbtobw_exec(void *data,
bNodeStack **in,
bNodeStack **out)
{
tex_output(node, execdata, in, out[0], &rgbtobw_valuefn, data);
tex_output(node, execdata, in, out[0], &rgbtobw_valuefn, static_cast<TexCallData *>(data));
}
void register_node_type_tex_rgbtobw(void)
@@ -6,7 +6,7 @@
*/
#include "NOD_texture.h"
#include "node_texture_util.h"
#include "node_texture_util.hh"
#include <math.h>
static bNodeSocketTemplate inputs[] = {