[Bf-blender-cvs] [ade786b] asset-experiments: Some cleanup and reducing diff from master.

Bastien Montagne noreply at git.blender.org
Tue May 12 17:01:46 CEST 2015


Commit: ade786b30cf7de92560ff3c39b3908ef02ec9bd9
Author: Bastien Montagne
Date:   Tue May 12 17:00:12 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rBade786b30cf7de92560ff3c39b3908ef02ec9bd9

Some cleanup and reducing diff from master.

===================================================================

M	intern/guardedalloc/intern/mallocn_guarded_impl.c
M	source/blender/blenkernel/intern/icons.c
M	source/blender/editors/include/UI_interface_icons.h
M	source/blender/editors/interface/interface_icons.c
M	source/blender/imbuf/intern/thumbs.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_ID.c
M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c
index b449f82..88d6f35 100644
--- a/intern/guardedalloc/intern/mallocn_guarded_impl.c
+++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c
@@ -76,7 +76,7 @@
  * memory block was allocated and print this trace for all
  * unfreed blocks.
  */
-#define DEBUG_BACKTRACE
+//#define DEBUG_BACKTRACE
 
 #ifdef DEBUG_BACKTRACE
 #  define BACKTRACE_SIZE 100
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 379d4b6..508fd68 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -37,7 +37,6 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "DNA_brush_types.h"
 #include "DNA_group_types.h"
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
@@ -45,6 +44,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_texture_types.h"
 #include "DNA_world_types.h"
+#include "DNA_brush_types.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_ghash.h"
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index aa2c6e4..0551378 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -81,10 +81,6 @@ int UI_iconfile_get_index(const char *filename);
 
 struct PreviewImage *UI_icon_to_preview(int icon_id);
 
-#if 0
-struct ImBuf *UI_icon_to_imbuf(int icon_id);
-#endif
-
 int UI_rnaptr_icon_get(struct bContext *C, struct PointerRNA *ptr, int rnaicon, const bool big);
 
 #endif /*  __UI_INTERFACE_ICONS_H__ */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 0f33ab3..a84d4f3 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1039,72 +1039,6 @@ PreviewImage *UI_icon_to_preview(int icon_id)
 	return NULL;
 }
 
-#if 0  /* Unused in the end, is it worth keeping it still? */
-/* Shall always return straight alpha! */
-ImBuf *UI_icon_to_imbuf(int icon_id)
-{
-	Icon *icon = BKE_icon_get(icon_id);
-	DrawInfo *di;
-	ImBuf *imbuf = NULL;
-
-	if (!icon) {
-		return imbuf;
-	}
-
-	di = (DrawInfo *)icon->drawinfo;
-	if (!di) {
-		return imbuf;
-	}
-
-	if (di->type == ICON_TYPE_VECTOR) {
-		/* vector icons use the uiBlock transformation, they are not drawn
-		 * with untransformed coordinates like the other icons */
-		/* TODO */
-	}
-	else if (di->type == ICON_TYPE_TEXTURE) {
-		/* We have to go searching in OpenGL texture... */
-		ImBuf *icons = IMB_allocImBuf(icongltex.w, icongltex.h, 32, IB_rect);
-
-		glEnable(GL_TEXTURE_2D);
-		glBindTexture(GL_TEXTURE_2D, icongltex.id);
-
-		glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, icons->rect);
-
-		glBindTexture(GL_TEXTURE_2D, 0);
-		glDisable(GL_TEXTURE_2D);
-
-		imbuf = IMB_allocImBuf(di->data.texture.w, di->data.texture.h, 32, IB_rect);
-		IMB_rectcpy(imbuf, icons, 0, 0, di->data.texture.x, di->data.texture.y, di->data.texture.w, di->data.texture.h);
-		IMB_unpremultiply_alpha(imbuf);  /* those were premultiplied in init_internal_icons() */
-
-		IMB_freeImBuf(icons);
-	}
-	else if (di->type == ICON_TYPE_BUFFER) {
-		/* it is a builtin icon */
-		IconImage *iimg = di->data.buffer.image;
-#ifndef WITH_HEADLESS
-		icon_verify_datatoc(iimg);
-#endif
-
-		if (iimg->rect) {
-			imbuf = IMB_allocImBuf(iimg->w, iimg->h, 32, IB_rect);
-			memcpy(imbuf->rect, iimg->rect, sizeof(unsigned int) * imbuf->x * imbuf->y);
-			IMB_unpremultiply_alpha(imbuf);  /* those were premultiplied in init_internal_icons() */
-		}
-	}
-	else if (di->type == ICON_TYPE_PREVIEW) {
-		PreviewImage *pi = BKE_previewimg_get((ID *)icon->obj);
-
-		if (pi && pi->rect[ICON_SIZE_ICON]) {
-			imbuf = IMB_allocImBuf(pi->w[ICON_SIZE_ICON], pi->h[ICON_SIZE_ICON], 32, IB_rect);
-			memcpy(imbuf->rect, pi->rect[ICON_SIZE_ICON], sizeof(unsigned int) * imbuf->x * imbuf->y);
-		}
-	}
-
-	return imbuf;
-}
-#endif
-
 static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh,
                            unsigned int *rect, float alpha, const float rgb[3], const bool is_preview)
 {
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 7ad88d3..8d5ed03 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -47,8 +47,6 @@
 #include "IMB_thumbs.h"
 #include "IMB_metadata.h"
 
-#include "../../editors/include/UI_interface_icons.h"
-
 #include <ctype.h>
 #include <string.h>
 #include <time.h>
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 08309e1..6bf1a3d 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -67,6 +67,7 @@ struct MovieClipScopes;
 struct Mask;
 struct BLI_mempool;
 
+
 /* SpaceLink (Base) ==================================== */
 
 /**
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 7820fef..965d1d9 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -460,7 +460,6 @@ extern StructRNA RNA_PointLamp;
 extern StructRNA RNA_PointerProperty;
 extern StructRNA RNA_Pose;
 extern StructRNA RNA_PoseBone;
-extern StructRNA RNA_Preview;
 extern StructRNA RNA_Property;
 extern StructRNA RNA_PropertyGroup;
 extern StructRNA RNA_PropertyGroupItem;
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index c2e3d7f..cebf3e6 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -577,7 +577,6 @@ static int rna_ImagePreview_icon_id_get(PointerRNA *ptr)
 	/* Using a callback here allows us to only generate icon matching that preview when icon_id is requested. */
 	return BKE_icon_preview_ensure((PreviewImage *)(ptr->data));
 }
-
 static void rna_ImagePreview_icon_reload(PreviewImage *prv)
 {
 	/* will lazy load on next use, but only in case icon is not user-modified! */
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 5239b73..e352e63 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -75,7 +75,6 @@
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
 #include "BKE_icons.h"
-#include "BKE_idcode.h"
 #include "BKE_idprop.h"
 #include "BKE_image.h"
 #include "BKE_library.h"
@@ -89,6 +88,8 @@
 #include "BKE_unit.h"
 #include "BKE_utildefines.h"
 
+#include "BKE_idcode.h"
+
 #include "BIF_gl.h"
 #include "BIF_glutil.h" /* for paint cursor */
 #include "BLF_api.h"
@@ -2647,12 +2648,14 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
 		return OPERATOR_CANCELLED;
 	}
 
+
 	/* from here down, no error returns */
 
 	/* now we have or selected, or an indicated file */
 	if (RNA_boolean_get(op->ptr, "autoselect"))
 		BKE_scene_base_deselect_all(scene);
 
+	
 	flag = wm_link_append_flag(op);
 
 	/* sanity checks for flag */




More information about the Bf-blender-cvs mailing list