diff options
author | Chris Want <cwant@ualberta.ca> | 2006-11-22 18:53:46 +0300 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2006-11-22 18:53:46 +0300 |
commit | 0b0c8c92441aeb0a21aec52de8689e8000495e0e (patch) | |
tree | cd8d830fee68535c88547c7ab0a1a34d3bde90e9 /source/blender/blenkernel | |
parent | bb7ad80269d76cba98a90c8bf95e2cc47f88820c (diff) |
=Texture Plugins=
Added a callback instance_init() so that any particular instance of a
texture plugin can initialize data. Updated the clouds2 and tile example
plugins to have a (dummy) call back.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_plugin_types.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_plugin_types.h b/source/blender/blenkernel/BKE_plugin_types.h index 338cfee7291..2b7c6c06832 100644 --- a/source/blender/blenkernel/BKE_plugin_types.h +++ b/source/blender/blenkernel/BKE_plugin_types.h @@ -65,6 +65,7 @@ typedef struct _PluginInfo { void (*callback)(int); TexDoit tex_doit; SeqDoit seq_doit; + void (*instance_init)(void *); } PluginInfo; #endif diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 3f78ad3a1d6..62ac911bea7 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -136,6 +136,7 @@ void open_plugin_tex(PluginTex *pit) info_func= (int (*)(PluginInfo *))PIL_dynlib_find_symbol(pit->handle, "plugin_getinfo"); if (!test_dlerr(pit->name, "plugin_getinfo")) { + info->instance_init = NULL; info_func(info); @@ -148,6 +149,7 @@ void open_plugin_tex(PluginTex *pit) pit->varstr= info->varstr; pit->result= info->result; pit->cfra= info->cfra; + pit->instance_init = info->instance_init; if (info->init) info->init(); } MEM_freeN(info); @@ -191,6 +193,9 @@ PluginTex *add_plugin_tex(char *str) *((int *)(pit->data+a))= (int) varstr->def; } + if (pit->instance_init) + pit->instance_init((void *) pit->data); + return pit; } |