[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57076] trunk/blender/source/blender: code cleanup: remove old/unused bmesh bevel transform mode, remove commented character list UI widget and the members these used in 'G ' global.

Campbell Barton ideasman42 at gmail.com
Tue May 28 15:01:31 CEST 2013


Revision: 57076
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57076
Author:   campbellbarton
Date:     2013-05-28 13:01:31 +0000 (Tue, 28 May 2013)
Log Message:
-----------
code cleanup: remove old/unused bmesh bevel transform mode, remove commented character list UI widget and the members these used in 'G' global.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_bmesh.h
    trunk/blender/source/blender/blenkernel/BKE_global.h
    trunk/blender/source/blender/blenkernel/intern/blender.c
    trunk/blender/source/blender/blenkernel/intern/bmfont.c
    trunk/blender/source/blender/editors/include/ED_transform.h
    trunk/blender/source/blender/editors/interface/interface_draw.c
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform.h
    trunk/blender/source/blender/editors/transform/transform_ops.c

Modified: trunk/blender/source/blender/blenkernel/BKE_bmesh.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_bmesh.h	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/blenkernel/BKE_bmesh.h	2013-05-28 13:01:31 UTC (rev 57076)
@@ -90,16 +90,6 @@
 	int len;
 } BME_TransData_Head;
 
-/* this is no longer used */
-typedef struct BME_Glob { /* stored in Global G for Transform() purposes */
-	struct BMesh *bm;
-	BME_TransData_Head *td;
-	struct TransInfo *Trans; /* a pointer to the global Trans struct */
-	int imval[2]; /* for restoring original mouse co when initTransform() is called multiple times */
-	int options;
-	int res;
-} BME_Glob;
-
 struct BME_TransData *BME_get_transdata(struct BME_TransData_Head *td, struct BMVert *v);
 void BME_free_transdata(struct BME_TransData_Head *td);
 struct BMesh *BME_bevel(struct BMesh *bm, float value, int res, int options, int defgrp_index, float angle,

Modified: trunk/blender/source/blender/blenkernel/BKE_global.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_global.h	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/blenkernel/BKE_global.h	2013-05-28 13:01:31 UTC (rev 57076)
@@ -55,18 +55,21 @@
 	/* strings: lastsaved */
 	char ima[1024], lib[1024]; /* 1024 = FILE_MAX */
 
-	/* flag: if != 0 G.main->name contains valid relative base path */
-	int relbase_valid;
+	/* when set: G.main->name contains valid relative base path */
+	bool relbase_valid;
+	bool file_loaded;
+	bool save_over;
 
 	/* strings of recent opened files */
 	struct ListBase recent_files;
 
 	/* has escape been pressed or Ctrl+C pressed in background mode, used for render quit */
-	short is_break;
+	bool is_break;
 
-	short moving, file_loaded;
-	char background;
-	char factory_startup;
+	bool background;
+	bool factory_startup;
+
+	short moving;
 	short winpos, displaymode;  /* used to be in Render */
 
 	/* to indicate render is busy, prevent renderwindow events etc */
@@ -82,25 +85,12 @@
 	/* debug flag, G_DEBUG, G_DEBUG_PYTHON & friends, set python or command line args */
 	int debug;
 
-	/* Used for BMesh transformations */
-	struct BME_Glob *editBMesh;
+	bool have_quicktime;
 
-	/* Frank's variables */
-	int save_over;
-
-	/* Rob's variables (keep here for WM recode) */
-	int have_quicktime;
-	int ui_international;
-	int charstart;
-	int charmin;
-	int charmax;
-	struct VFont *selfont;
-	struct ListBase ttfdata;
-
 	/* this variable is written to / read from FileGlobal->fileflags */
 	int fileflags;
 
-	/* save the allowed windowstate of blender when using -W or -w */
+	/* save the allowed windowstate of blender when using -W or -w (GHOST_TWindowState) */
 	int windowstate;
 } Global;
 

Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/blender.c	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/blenkernel/intern/blender.c	2013-05-28 13:01:31 UTC (rev 57076)
@@ -150,10 +150,6 @@
 	G.windowstate = 0;
 #endif
 
-	G.charstart = 0x0000;
-	G.charmin = 0x0000;
-	G.charmax = 0xffff;
-
 #ifndef WITH_PYTHON_SECURITY /* default */
 	G.f |= G_SCRIPT_AUTOEXEC;
 #else

Modified: trunk/blender/source/blender/blenkernel/intern/bmfont.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/bmfont.c	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/blenkernel/intern/bmfont.c	2013-05-28 13:01:31 UTC (rev 57076)
@@ -50,12 +50,15 @@
 #include <stdio.h>
 
 #include "MEM_guardedalloc.h"
-#include "BKE_global.h"
 #include "IMB_imbuf_types.h"
 
 #include "BKE_bmfont.h"
 #include "BKE_bmfont_types.h"
 
+#include "BLI_utildefines.h"
+
+#include "BKE_global.h"
+
 void printfGlyph(bmGlyph *glyph)
 {
 	printf("unicode: %d '%c'\n", glyph->unicode, glyph->unicode);

Modified: trunk/blender/source/blender/editors/include/ED_transform.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_transform.h	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/editors/include/ED_transform.h	2013-05-28 13:01:31 UTC (rev 57076)
@@ -80,7 +80,7 @@
 	TFM_TIME_EXTEND,
 	TFM_TIME_DUPLICATE,
 	TFM_BAKE_TIME,
-	TFM_BEVEL,
+	TFM_DEPRECATED,  /* was BEVEL */
 	TFM_BWEIGHT,
 	TFM_ALIGN,
 	TFM_EDGE_SLIDE,

Modified: trunk/blender/source/blender/editors/interface/interface_draw.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_draw.c	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/editors/interface/interface_draw.c	2013-05-28 13:01:31 UTC (rev 57076)
@@ -442,177 +442,6 @@
 #endif
 }
 
-#if 0
-#ifdef WITH_INTERNATIONAL
-static void ui_draw_but_CHARTAB(uiBut *but)
-{
-	/* XXX 2.50 bad global access */
-	/* Some local variables */
-	float sx, sy, ex, ey;
-	float width, height;
-	float butw, buth;
-	int x, y, cs;
-	wchar_t wstr[2];
-	unsigned char ustr[16];
-	PackedFile *pf;
-	int result = 0;
-	int charmax = G.charmax;
-	
-	/* FO_BUILTIN_NAME font in use. There are TTF FO_BUILTIN_NAME and non-TTF FO_BUILTIN_NAME fonts */
-	if (BKE_vfont_is_builtin(G.selfont)) {
-		if (G.ui_international == TRUE) {
-			charmax = 0xff;
-		}
-		else {
-			charmax = 0xff;
-		}
-	}
-
-	/* Category list exited without selecting the area */
-	if (G.charmax == 0)
-		charmax = G.charmax = 0xffff;
-
-	/* Calculate the size of the button */
-	width  = abs(BLI_rcti_size_x(rect));
-	height = abs(BLI_rcti_size_y(rect));
-	
-	butw = floor(width / 12);
-	buth = floor(height / 6);
-	
-	/* Initialize variables */
-	sx = rect->xmin;
-	ex = rect->xmin + butw;
-	sy = rect->ymin + height - buth;
-	ey = rect->ymin + height;
-
-	cs = G.charstart;
-
-	/* Set the font, in case it is not FO_BUILTIN_NAME font */
-	if (G.selfont && BKE_vfont_is_builtin(G.selfont) == FALSE) {
-		/* Is the font file packed, if so then use the packed file */
-		if (G.selfont->packedfile) {
-			pf = G.selfont->packedfile;
-			FTF_SetFont(pf->data, pf->size, 14.0);
-		}
-		else {
-			char tmpStr[256];
-			int err;
-
-			BLI_strncpy(tmpStr, G.selfont->name, sizeof(tmpStr));
-			BLI_path_abs(tmpStr, G.main->name);
-			err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0);
-		}
-	}
-	else {
-		if (G.ui_international == TRUE) {
-			FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 14.0);
-		}
-	}
-
-	/* Start drawing the button itself */
-	glShadeModel(GL_SMOOTH);
-
-	glColor3ub(200,  200,  200);
-	glRectf((rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax));
-
-	glColor3ub(0,  0,  0);
-	for (y = 0; y < 6; y++) {
-		/* Do not draw more than the category allows */
-		if (cs > charmax) break;
-
-		for (x = 0; x < 12; x++)
-		{
-			/* Do not draw more than the category allows */
-			if (cs > charmax) break;
-
-			/* Draw one grid cell */
-			glBegin(GL_LINE_LOOP);
-			glVertex2f(sx, sy);
-			glVertex2f(ex, sy);
-			glVertex2f(ex, ey);
-			glVertex2f(sx, ey);
-			glEnd();
-
-			/* Draw character inside the cell */
-			memset(wstr, 0, sizeof(wchar_t) * 2);
-			memset(ustr, 0, 16);
-
-			/* Set the font to be either unicode or FO_BUILTIN_NAME */
-			wstr[0] = cs;
-			if (BKE_vfont_is_builtin(G.selfont) == FALSE) {
-				BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
-			}
-			else {
-				if (G.ui_international == TRUE) {
-					BLI_strncpy_wchar_as_utf8((char *)ustr, (wchar_t *)wstr, sizeof(ustr));
-				}
-				else {
-					ustr[0] = cs;
-					ustr[1] = 0;
-				}
-			}
-
-			if ((G.selfont && (BKE_vfont_is_builtin(G.selfont) == FALSE)) ||
-			    (G.selfont && (BKE_vfont_is_builtin(G.selfont) == TRUE) && G.ui_international == TRUE))
-			{
-				float wid;
-				float llx, lly, llz, urx, ury, urz;
-				float dx, dy;
-				float px, py;
-	
-				/* Calculate the position */
-				wid = FTF_GetStringWidth((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
-				FTF_GetBoundingBox((char *) ustr, &llx, &lly, &llz, &urx, &ury, &urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
-				dx = urx - llx;
-				dy = ury - lly;
-
-				/* This isn't fully functional since the but->aspect isn't working like I suspected */
-				px = sx + ((butw / but->aspect) - dx) / 2;
-				py = sy + ((buth / but->aspect) - dy) / 2;
-
-				/* Set the position and draw the character */
-				ui_rasterpos_safe(px, py, but->aspect);
-				FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
-			}
-			else {
-				ui_rasterpos_safe(sx + butw / 2, sy + buth / 2, but->aspect);
-				UI_DrawString(but->font, (char *) ustr, 0);
-			}
-
-			/* Calculate the next position and character */
-			sx += butw;
-			ex += butw;
-			cs++;
-		}
-		/* Add the y position and reset x position */
-		sy -= buth; 
-		ey -= buth;
-		sx = rect->xmin;
-		ex = rect->xmin + butw;
-	}
-	glShadeModel(GL_FLAT);
-
-	/* Return Font Settings to original */
-	if (U.fontsize && U.fontname[0]) {
-		result = FTF_SetFont((unsigned char *)U.fontname, 0, U.fontsize);
-	}
-	else if (U.fontsize) {
-		result = FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize);
-	}
-
-	if (result == 0) {
-		result = FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 11);
-	}
-	
-	/* resets the font size */
-	if (G.ui_international == TRUE) {
-		// uiSetCurFont(but->block, UI_HELV);
-	}
-}
-
-#endif /* WITH_INTERNATIONAL */
-#endif
-
 static void draw_scope_end(const rctf *rect, GLint *scissor)
 {
 	float scaler_x1, scaler_x2;

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2013-05-28 12:00:36 UTC (rev 57075)
+++ trunk/blender/source/blender/editors/transform/transform.c	2013-05-28 13:01:31 UTC (rev 57076)
@@ -2050,9 +2050,6 @@
 		case TFM_MIRROR:
 			initMirror(t);
 			break;
-		case TFM_BEVEL:
-			initBevel(t);
-			break;
 		case TFM_BWEIGHT:
 			initBevelWeight(t);
 			break;
@@ -4455,121 +4452,6 @@
 	return 1;
 }
 
-/* ************************** BEVEL **************************** */
-
-void initBevel(TransInfo *t)
-{
-	t->transform = Bevel;
-	t->handleEvent = handleEventBevel;
-
-	initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE);
-
-	t->mode = TFM_BEVEL;
-	t->flag |= T_NO_CONSTRAINT;
-	t->num.flag |= NUM_NO_NEGATIVE;
-
-	t->idx_max = 0;
-	t->num.idx_max = 0;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list