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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-17 14:35:20 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-17 14:35:20 +0300
commit2eeef0ba7b5a0c3f2117ba04ef2accf892418e13 (patch)
tree7f82cf9f1e614acddf185cb3be64305e8e5f7c4b /source
parent30d01cf24021fa36bb65c9ba67c5a4c8222a4354 (diff)
Remove some unfinished code I accidentally commit for render thread safety.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_material.h2
-rw-r--r--source/blender/blenkernel/intern/material.c22
-rw-r--r--source/blender/editors/render/render_preview.c12
3 files changed, 5 insertions, 31 deletions
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index ccac17e9d97..7ec5d172130 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -77,8 +77,6 @@ int material_in_material(struct Material *parmat, struct Material *mat);
void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col);
-struct Material *copy_material_for_render(struct Material *ma);
-
/* copy/paste */
void clear_matcopybuf(void);
void free_matcopybuf(void);
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 9cc154a3c2c..27b46c40d28 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -204,27 +204,23 @@ Material *add_material(char *name)
return ma;
}
-static Material *copy_material_intern(Material *ma, int for_render)
+Material *copy_material(Material *ma)
{
Material *man;
int a;
man= copy_libblock(ma);
- if(for_render)
- BLI_remlink(&G.main->mat, man);
- if(!for_render) {
#if 0 // XXX old animation system
- id_us_plus((ID *)man->ipo);
+ id_us_plus((ID *)man->ipo);
#endif // XXX old animation system
- id_us_plus((ID *)man->group);
- }
+ id_us_plus((ID *)man->group);
for(a=0; a<MAX_MTEX; a++) {
if(ma->mtex[a]) {
man->mtex[a]= MEM_mallocN(sizeof(MTex), "copymaterial");
memcpy(man->mtex[a], ma->mtex[a], sizeof(MTex));
- if(!for_render) id_us_plus((ID *)man->mtex[a]->tex);
+ id_us_plus((ID *)man->mtex[a]->tex);
}
}
@@ -242,16 +238,6 @@ static Material *copy_material_intern(Material *ma, int for_render)
return man;
}
-Material *copy_material_for_render(Material *ma)
-{
- return copy_material_intern(ma, 1);
-}
-
-Material *copy_material(Material *ma)
-{
- return copy_material_intern(ma, 0);
-}
-
void make_local_material(Material *ma)
{
Object *ob;
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 76ed438ae41..1563c5a8e1d 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -884,16 +884,9 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
char name[32];
int sizex;
- if(GS(id->name) == ID_MA)
- id= (ID*)copy_material_for_render((Material*)id);
-
/* get the stuff from the builtin preview dbase */
sce= preview_prepare_scene(sp->scene, id, idtype, sp); // XXX sizex
- if(sce==NULL) {
- if(GS(id->name) == ID_MA)
- free_material((Material*)id);
- return;
- }
+ if(sce==NULL) return;
if(!split || first) sprintf(name, "Preview %p", sp->owner);
else sprintf(name, "SecondPreview %p", sp->owner);
@@ -961,9 +954,6 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
/* unassign the pointers, reset vars */
preview_prepare_scene(sp->scene, NULL, GS(id->name), NULL);
-
- if(GS(id->name) == ID_MA)
- free_material((Material*)id);
}
/* runs inside thread for material and icons */