code cleanup: remove old/unused bmesh bevel transform mode, remove commented character list UI widget and the members these used in 'G' global.
This commit is contained in:
@@ -442,177 +442,6 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user