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:
authorKent Mein <mein@cs.umn.edu>2008-04-18 23:10:03 +0400
committerKent Mein <mein@cs.umn.edu>2008-04-18 23:10:03 +0400
commit981d380fc4704d56522dce0a8c2642b86a6458e0 (patch)
treee4f6aca0d12ccc30bf8c620dd945d5324b75271f /source/blender/render
parent4147a5a33d57178914227a45ddd1afb1746cdc49 (diff)
This is an expanded patch of this:
[#8067] external texture plugin thread-safe modifications Submitted By: David Anderson (davywavy) It makes it so the "result" array is passed in, instead of a global var. I expanded the patch so it will play nice with older plugins that are not thread safe as well. I also updated the existing plugins in the release, so they are thread safe. --------------- What do people think of this.... ------------------ This should maybe be talked about in the functionality board or something, but what do people think of adding in default texture/sequence plugins. or making a seperate tree like lib for plugins. The reason I ask is we have had a couple of upgrades to the plugin system. (supporting float buffers for sequencer, and this one for textures) http://www.cs.umn.edu/~mein/blender/plugins does not store revisions of plugins I just make sure they work with the latest version. This is getting messy. I haven't upgraded a lot of them to use floats (I know, I'm lazy, and now this will also make modifications to the plugins) It would be nice to have some of the standard ones under revision control. We also seem to be having an explosion of platforms supported. It would be nice to have platform maintainers compiling plugins as well for releases. (Its getting to be more work for me to keep up with things...) I'll go back to my corner now and be quite. ;) Kent
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/texture.c47
1 files changed, 38 insertions, 9 deletions
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 737b1d2d747..0a72f976825 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -721,30 +721,59 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
{
PluginTex *pit;
int rgbnor=0;
+ float result[ 8 ];
texres->tin= 0.0;
pit= tex->plugin;
if(pit && pit->doit) {
if(texres->nor) {
- VECCOPY(pit->result+5, texres->nor);
+ if (pit->version < 6) {
+ VECCOPY(pit->result+5, texres->nor);
+ } else {
+ VECCOPY(result+5, texres->nor);
+ }
+ }
+ if (pit->version < 6) {
+ if(osatex) rgbnor= ((TexDoitold)pit->doit)(tex->stype,
+ pit->data, texvec, dxt, dyt);
+ else rgbnor= ((TexDoitold)pit->doit)(tex->stype,
+ pit->data, texvec, 0, 0);
+ } else {
+ if(osatex) rgbnor= ((TexDoit)pit->doit)(tex->stype,
+ pit->data, texvec, dxt, dyt, result);
+ else rgbnor= ((TexDoit)pit->doit)(tex->stype,
+ pit->data, texvec, 0, 0, result);
}
- if(osatex) rgbnor= ((TexDoit)pit->doit)(tex->stype, pit->data, texvec, dxt, dyt);
- else rgbnor= ((TexDoit)pit->doit)(tex->stype, pit->data, texvec, 0, 0);
- texres->tin= pit->result[0];
+ if (pit->version < 6) {
+ texres->tin = pit->result[0];
+ } else {
+ texres->tin = result[0];
+ }
if(rgbnor & TEX_NOR) {
if(texres->nor) {
- VECCOPY(texres->nor, pit->result+5);
+ if (pit->version < 6) {
+ VECCOPY(texres->nor, pit->result+5);
+ } else {
+ VECCOPY(texres->nor, result+5);
+ }
}
}
if(rgbnor & TEX_RGB) {
- texres->tr= pit->result[1];
- texres->tg= pit->result[2];
- texres->tb= pit->result[3];
- texres->ta= pit->result[4];
+ if (pit->version < 6) {
+ texres->tr = pit->result[1];
+ texres->tg = pit->result[2];
+ texres->tb = pit->result[3];
+ texres->ta = pit->result[4];
+ } else {
+ texres->tr = result[1];
+ texres->tg = result[2];
+ texres->tb = result[3];
+ texres->ta = result[4];
+ }
BRICONTRGB;
}