Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-01 07:03:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-01 07:03:12 +0300
commitf7d98d358290c1a8c6ddbfc8e3d9be3673779ee8 (patch)
treef14fe669046f1f6dc8e268a23896091e6035fb7e /source/blender/render
parent635754a8768c8dde48e671ed8fe512c9f7367e45 (diff)
Cleanup: rename externtex to RE_texture_evaluate
- Pass in return arguments last. - Pass in RGBA as a vector. - Use boolean return argument.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/extern/include/RE_render_ext.h22
-rw-r--r--source/blender/render/intern/source/render_texture.c35
2 files changed, 29 insertions, 28 deletions
diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h
index bca3b749192..bdf81354b8d 100644
--- a/source/blender/render/extern/include/RE_render_ext.h
+++ b/source/blender/render/extern/include/RE_render_ext.h
@@ -33,18 +33,16 @@ struct ImagePool;
struct MTex;
/* render_texture.c */
-/* used by particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */
-int externtex(const struct MTex *mtex,
- const float vec[3],
- float *tin,
- float *tr,
- float *tg,
- float *tb,
- float *ta,
- const int thread,
- struct ImagePool *pool,
- const bool skip_load_image,
- const bool texnode_preview);
+bool RE_texture_evaluate(const struct MTex *mtex,
+ const float vec[3],
+ const int thread,
+ struct ImagePool *pool,
+ const bool skip_load_image,
+ const bool texnode_preview,
+ /* Return arguments. */
+ float *r_intensity,
+ float r_rgba[4]) ATTR_NONNULL(1, 2, 7, 8);
+
void texture_rgb_blend(
float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype);
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype);
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index eabba94ef29..123d384bed6 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -1724,17 +1724,20 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen
/* ------------------------------------------------------------------------- */
-int externtex(const MTex *mtex,
- const float vec[3],
- float *tin,
- float *tr,
- float *tg,
- float *tb,
- float *ta,
- const int thread,
- struct ImagePool *pool,
- const bool skip_load_image,
- const bool texnode_preview)
+/**
+ * \param pool: Thread pool, may be NULL.
+ *
+ * \return True if the texture has color, otherwise false.
+ */
+bool RE_texture_evaluate(const MTex *mtex,
+ const float vec[3],
+ const int thread,
+ struct ImagePool *pool,
+ const bool skip_load_image,
+ const bool texnode_preview,
+ /* Return arguments. */
+ float *r_intensity,
+ float r_rgba[4])
{
Tex *tex;
TexResult texr;
@@ -1796,11 +1799,11 @@ int externtex(const MTex *mtex,
texr.tb = mtex->b;
}
- *tin = texr.tin;
- *tr = texr.tr;
- *tg = texr.tg;
- *tb = texr.tb;
- *ta = texr.ta;
+ *r_intensity = texr.tin;
+ r_rgba[0] = texr.tr;
+ r_rgba[1] = texr.tg;
+ r_rgba[2] = texr.tb;
+ r_rgba[3] = texr.ta;
return (rgb != 0);
}