2 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL/BL DUAL LICENSE BLOCK *****
28 /** \file blender/editors/interface/resources.c
29 * \ingroup edinterface
36 #include "MEM_guardedalloc.h"
38 #include "DNA_curve_types.h"
39 #include "DNA_userdef_types.h"
40 #include "DNA_screen_types.h"
41 #include "DNA_space_types.h"
42 #include "DNA_windowmanager_types.h"
44 #include "BLI_blenlib.h"
45 #include "BLI_utildefines.h"
48 #include "BKE_DerivedMesh.h"
49 #include "BKE_global.h"
51 #include "BKE_texture.h"
56 #include "UI_interface.h"
57 #include "UI_interface_icons.h"
59 #include "interface_intern.h"
61 /* global for themes */
62 typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
64 static bTheme *theme_active=NULL;
65 static int theme_spacetype= SPACE_VIEW3D;
66 static int theme_regionid= RGN_TYPE_WINDOW;
68 void ui_resources_init(void)
70 UI_icons_init(BIFICONID_LAST);
73 void ui_resources_free(void)
79 /* ******************************************************** */
81 /* ******************************************************** */
83 const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
86 static char error[4]={240, 0, 240, 255};
87 static char alert[4]={240, 60, 60, 255};
88 static char headerdesel[4]={0,0,0,255};
90 const char *cp= error;
94 // first check for ui buttons theme
95 if(colorid < TH_THEMEUI) {
140 ts= &btheme->tuserpref;
143 ts= &btheme->tconsole;
164 if(theme_regionid==RGN_TYPE_WINDOW)
166 else if(theme_regionid==RGN_TYPE_CHANNELS)
168 else if(theme_regionid==RGN_TYPE_HEADER)
174 if(theme_regionid==RGN_TYPE_WINDOW)
176 else if(theme_regionid==RGN_TYPE_CHANNELS)
178 else if(theme_regionid==RGN_TYPE_HEADER)
184 if(theme_regionid==RGN_TYPE_WINDOW)
186 else if(theme_regionid==RGN_TYPE_CHANNELS)
187 cp= ts->list_text_hi;
188 else if(theme_regionid==RGN_TYPE_HEADER)
189 cp= ts->header_text_hi;
191 cp= ts->button_text_hi;
194 if(theme_regionid==RGN_TYPE_WINDOW)
196 else if(theme_regionid==RGN_TYPE_CHANNELS)
198 else if(theme_regionid==RGN_TYPE_HEADER)
199 cp= ts->header_title;
201 cp= ts->button_title;
205 cp= ts->header; break;
207 /* we calculate a dynamic builtin header deselect color, also for pulldowns... */
209 headerdesel[0]= cp[0]>10?cp[0]-10:0;
210 headerdesel[1]= cp[1]>10?cp[1]-10:0;
211 headerdesel[2]= cp[2]>10?cp[2]-10:0;
215 cp= ts->header_text; break;
216 case TH_HEADER_TEXT_HI:
217 cp= ts->header_text_hi; break;
220 cp= ts->panel; break;
222 cp= ts->panel_text; break;
223 case TH_PANEL_TEXT_HI:
224 cp= ts->panel_text_hi; break;
227 cp= ts->button; break;
228 case TH_BUTBACK_TEXT:
229 cp= ts->button_text; break;
230 case TH_BUTBACK_TEXT_HI:
231 cp= ts->button_text_hi; break;
234 cp= ts->shade1; break;
236 cp= ts->shade2; break;
238 cp= ts->hilite; break;
247 cp= ts->speaker; break;
249 cp= ts->select; break;
251 cp= ts->active; break;
253 cp= ts->group; break;
254 case TH_GROUP_ACTIVE:
255 cp= ts->group_active; break;
257 cp= ts->transform; break;
259 cp= ts->vertex; break;
260 case TH_VERTEX_SELECT:
261 cp= ts->vertex_select; break;
263 cp= &ts->vertex_size; break;
264 case TH_OUTLINE_WIDTH:
265 cp= &ts->outline_width; break;
269 cp= ts->edge_select; break;
271 cp= ts->edge_seam; break;
273 cp= ts->edge_sharp; break;
275 cp= ts->edge_crease; break;
276 case TH_EDITMESH_ACTIVE:
277 cp= ts->editmesh_active; break;
278 case TH_EDGE_FACESEL:
279 cp= ts->edge_facesel; break;
283 cp= ts->face_select; break;
285 cp= ts->face_dot; break;
286 case TH_FACEDOT_SIZE:
287 cp= &ts->facedot_size; break;
288 case TH_DRAWEXTRA_EDGELEN:
289 cp= ts->extra_edge_len; break;
290 case TH_DRAWEXTRA_FACEAREA:
291 cp= ts->extra_face_area; break;
292 case TH_DRAWEXTRA_FACEANG:
293 cp= ts->extra_face_angle; break;
295 cp= ts->normal; break;
297 cp= ts->vertex_normal; break;
299 cp= ts->bone_solid; break;
301 cp= ts->bone_pose; break;
303 cp= ts->strip; break;
304 case TH_STRIP_SELECT:
305 cp= ts->strip_select; break;
307 cp= ts->cframe; break;
309 cp= ts->nurb_uline; break;
311 cp= ts->nurb_vline; break;
312 case TH_NURB_SEL_ULINE:
313 cp= ts->nurb_sel_uline; break;
314 case TH_NURB_SEL_VLINE:
315 cp= ts->nurb_sel_vline; break;
316 case TH_ACTIVE_SPLINE:
317 cp= ts->act_spline; break;
318 case TH_LASTSEL_POINT:
319 cp= ts->lastsel_point; break;
321 cp= ts->handle_free; break;
323 cp= ts->handle_auto; break;
324 case TH_HANDLE_AUTOCLAMP:
325 cp= ts->handle_auto_clamped; break;
327 cp= ts->handle_vect; break;
328 case TH_HANDLE_ALIGN:
329 cp= ts->handle_align; break;
330 case TH_HANDLE_SEL_FREE:
331 cp= ts->handle_sel_free; break;
332 case TH_HANDLE_SEL_AUTO:
333 cp= ts->handle_sel_auto; break;
334 case TH_HANDLE_SEL_AUTOCLAMP:
335 cp= ts->handle_sel_auto_clamped; break;
336 case TH_HANDLE_SEL_VECT:
337 cp= ts->handle_sel_vect; break;
338 case TH_HANDLE_SEL_ALIGN:
339 cp= ts->handle_sel_align; break;
342 cp= ts->syntaxb; break;
344 cp= ts->syntaxv; break;
346 cp= ts->syntaxc; break;
348 cp= ts->syntaxl; break;
350 cp= ts->syntaxn; break;
353 cp= ts->syntaxl; break;
355 cp= ts->syntaxn; break;
356 case TH_NODE_OPERATOR:
357 cp= ts->syntaxb; break;
358 case TH_NODE_CONVERTOR:
359 cp= ts->syntaxv; break;
361 cp= ts->syntaxc; break;
362 case TH_NODE_CURVING:
363 cp= &ts->noodle_curving; break;
366 cp= ts->movie; break;
368 cp= ts->image; break;
370 cp= ts->scene; break;
372 cp= ts->audio; break;
374 cp= ts->effect; break;
376 cp= ts->plugin; break;
377 case TH_SEQ_TRANSITION:
378 cp= ts->transition; break;
382 case TH_CONSOLE_OUTPUT:
383 cp= ts->console_output; break;
384 case TH_CONSOLE_INPUT:
385 cp= ts-> console_input; break;
386 case TH_CONSOLE_INFO:
387 cp= ts->console_info; break;
388 case TH_CONSOLE_ERROR:
389 cp= ts->console_error; break;
390 case TH_CONSOLE_CURSOR:
391 cp= ts->console_cursor; break;
393 case TH_HANDLE_VERTEX:
394 cp= ts->handle_vertex;
396 case TH_HANDLE_VERTEX_SELECT:
397 cp= ts->handle_vertex_select;
399 case TH_HANDLE_VERTEX_SIZE:
400 cp= &ts->handle_vertex_size;
403 case TH_DOPESHEET_CHANNELOB:
406 case TH_DOPESHEET_CHANNELSUBOB:
407 cp= ts->ds_subchannel;
410 case TH_PREVIEW_BACK:
411 cp= ts->preview_back;
414 case TH_STITCH_PREVIEW_FACE:
415 cp = ts->preview_stitch_face;
418 case TH_STITCH_PREVIEW_EDGE:
419 cp = ts->preview_stitch_edge;
422 case TH_STITCH_PREVIEW_VERT:
423 cp = ts->preview_stitch_vert;
426 case TH_STITCH_PREVIEW_STITCHABLE:
427 cp = ts->preview_stitch_stitchable;
430 case TH_STITCH_PREVIEW_UNSTITCHABLE:
431 cp = ts->preview_stitch_unstitchable;
433 case TH_STITCH_PREVIEW_ACTIVE:
434 cp = ts->preview_stitch_active;
436 case TH_MARKER_OUTLINE:
437 cp= ts->marker_outline; break;
439 cp= ts->marker; break;
441 cp= ts->act_marker; break;
443 cp= ts->sel_marker; break;
444 case TH_BUNDLE_SOLID:
445 cp= ts->bundle_solid; break;
447 cp= ts->dis_marker; break;
449 cp= ts->path_before; break;
451 cp= ts->path_after; break;
453 cp= ts->camera_path; break;
455 cp= ts->lock_marker; break;
461 case TH_SELECT_HIGHLIGHT:
462 cp= ts->selected_highlight;
468 return (unsigned char *)cp;
471 /* use this call to init new bone color sets in Theme */
472 static void ui_theme_init_boneColorSets(bTheme *btheme)
476 /* define default color sets - currently we only define 15 of these, though that should be ample */
478 rgba_char_args_set(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
479 rgba_char_args_set(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
480 rgba_char_args_set(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
482 rgba_char_args_set(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
483 rgba_char_args_set(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);
484 rgba_char_args_set(btheme->tarm[1].active, 0xfa, 0x99, 0x00, 255);
486 rgba_char_args_set(btheme->tarm[2].solid, 0x1e, 0x91, 0x09, 255);
487 rgba_char_args_set(btheme->tarm[2].select, 0x59, 0xb7, 0x0b, 255);
488 rgba_char_args_set(btheme->tarm[2].active, 0x83, 0xef, 0x1d, 255);
490 rgba_char_args_set(btheme->tarm[3].solid, 0x0a, 0x36, 0x94, 255);
491 rgba_char_args_set(btheme->tarm[3].select, 0x36, 0x67, 0xdf, 255);
492 rgba_char_args_set(btheme->tarm[3].active, 0x5e, 0xc1, 0xef, 255);
494 rgba_char_args_set(btheme->tarm[4].solid, 0xa9, 0x29, 0x4e, 255);
495 rgba_char_args_set(btheme->tarm[4].select, 0xc1, 0x41, 0x6a, 255);
496 rgba_char_args_set(btheme->tarm[4].active, 0xf0, 0x5d, 0x91, 255);
498 rgba_char_args_set(btheme->tarm[5].solid, 0x43, 0x0c, 0x78, 255);
499 rgba_char_args_set(btheme->tarm[5].select, 0x54, 0x3a, 0xa3, 255);
500 rgba_char_args_set(btheme->tarm[5].active, 0x87, 0x64, 0xd5, 255);
502 rgba_char_args_set(btheme->tarm[6].solid, 0x24, 0x78, 0x5a, 255);
503 rgba_char_args_set(btheme->tarm[6].select, 0x3c, 0x95, 0x79, 255);
504 rgba_char_args_set(btheme->tarm[6].active, 0x6f, 0xb6, 0xab, 255);
506 rgba_char_args_set(btheme->tarm[7].solid, 0x4b, 0x70, 0x7c, 255);
507 rgba_char_args_set(btheme->tarm[7].select, 0x6a, 0x86, 0x91, 255);
508 rgba_char_args_set(btheme->tarm[7].active, 0x9b, 0xc2, 0xcd, 255);
510 rgba_char_args_set(btheme->tarm[8].solid, 0xf4, 0xc9, 0x0c, 255);
511 rgba_char_args_set(btheme->tarm[8].select, 0xee, 0xc2, 0x36, 255);
512 rgba_char_args_set(btheme->tarm[8].active, 0xf3, 0xff, 0x00, 255);
514 rgba_char_args_set(btheme->tarm[9].solid, 0x1e, 0x20, 0x24, 255);
515 rgba_char_args_set(btheme->tarm[9].select, 0x48, 0x4c, 0x56, 255);
516 rgba_char_args_set(btheme->tarm[9].active, 0xff, 0xff, 0xff, 255);
518 rgba_char_args_set(btheme->tarm[10].solid, 0x6f, 0x2f, 0x6a, 255);
519 rgba_char_args_set(btheme->tarm[10].select, 0x98, 0x45, 0xbe, 255);
520 rgba_char_args_set(btheme->tarm[10].active, 0xd3, 0x30, 0xd6, 255);
522 rgba_char_args_set(btheme->tarm[11].solid, 0x6c, 0x8e, 0x22, 255);
523 rgba_char_args_set(btheme->tarm[11].select, 0x7f, 0xb0, 0x22, 255);
524 rgba_char_args_set(btheme->tarm[11].active, 0xbb, 0xef, 0x5b, 255);
526 rgba_char_args_set(btheme->tarm[12].solid, 0x8d, 0x8d, 0x8d, 255);
527 rgba_char_args_set(btheme->tarm[12].select, 0xb0, 0xb0, 0xb0, 255);
528 rgba_char_args_set(btheme->tarm[12].active, 0xde, 0xde, 0xde, 255);
530 rgba_char_args_set(btheme->tarm[13].solid, 0x83, 0x43, 0x26, 255);
531 rgba_char_args_set(btheme->tarm[13].select, 0x8b, 0x58, 0x11, 255);
532 rgba_char_args_set(btheme->tarm[13].active, 0xbd, 0x6a, 0x11, 255);
534 rgba_char_args_set(btheme->tarm[14].solid, 0x08, 0x31, 0x0e, 255);
535 rgba_char_args_set(btheme->tarm[14].select, 0x1c, 0x43, 0x0b, 255);
536 rgba_char_args_set(btheme->tarm[14].active, 0x34, 0x62, 0x2b, 255);
538 /* reset flags too */
539 for (i = 0; i < 20; i++)
540 btheme->tarm[i].flag = 0;
543 /* use this call to init new variables in themespace, if they're same for all */
544 static void ui_theme_init_new_do(ThemeSpace *ts)
546 rgba_char_args_test_set(ts->header_text, 0, 0, 0, 255);
547 rgba_char_args_test_set(ts->header_title, 0, 0, 0, 255);
548 rgba_char_args_test_set(ts->header_text_hi, 255, 255, 255, 255);
550 rgba_char_args_test_set(ts->panel_text, 0, 0, 0, 255);
551 rgba_char_args_test_set(ts->panel_title, 0, 0, 0, 255);
552 rgba_char_args_test_set(ts->panel_text_hi, 255, 255, 255, 255);
554 rgba_char_args_test_set(ts->button, 145, 145, 145, 245);
555 rgba_char_args_test_set(ts->button_title, 0, 0, 0, 255);
556 rgba_char_args_test_set(ts->button_text, 0, 0, 0, 255);
557 rgba_char_args_test_set(ts->button_text_hi, 255, 255, 255, 255);
559 rgba_char_args_test_set(ts->list, 165, 165, 165, 255);
560 rgba_char_args_test_set(ts->list_title, 0, 0, 0, 255);
561 rgba_char_args_test_set(ts->list_text, 0, 0, 0, 255);
562 rgba_char_args_test_set(ts->list_text_hi, 255, 255, 255, 255);
565 static void ui_theme_init_new(bTheme *btheme)
567 ui_theme_init_new_do(&btheme->tbuts);
568 ui_theme_init_new_do(&btheme->tv3d);
569 ui_theme_init_new_do(&btheme->tfile);
570 ui_theme_init_new_do(&btheme->tipo);
571 ui_theme_init_new_do(&btheme->tinfo);
572 ui_theme_init_new_do(&btheme->tact);
573 ui_theme_init_new_do(&btheme->tnla);
574 ui_theme_init_new_do(&btheme->tseq);
575 ui_theme_init_new_do(&btheme->tima);
576 ui_theme_init_new_do(&btheme->text);
577 ui_theme_init_new_do(&btheme->toops);
578 ui_theme_init_new_do(&btheme->ttime);
579 ui_theme_init_new_do(&btheme->tnode);
580 ui_theme_init_new_do(&btheme->tlogic);
581 ui_theme_init_new_do(&btheme->tuserpref);
582 ui_theme_init_new_do(&btheme->tconsole);
583 ui_theme_init_new_do(&btheme->tclip);
588 /* initialize default theme
589 * Note: when you add new colors, created & saved themes need initialized
590 * use function below, init_userdef_do_versions()
592 void ui_theme_init_default(void)
596 /* we search for the theme with name Default */
597 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
598 if(strcmp("Default", btheme->name)==0) break;
602 btheme= MEM_callocN(sizeof(bTheme), "theme");
603 BLI_addtail(&U.themes, btheme);
604 strcpy(btheme->name, "Default");
607 UI_SetTheme(0, 0); // make sure the global used in this file is set
610 ui_widget_color_init(&btheme->tui);
611 btheme->tui.iconfile[0]= 0;
612 btheme->tui.panel.show_header = FALSE;
613 rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
615 /* Bone Color Sets */
616 ui_theme_init_boneColorSets(btheme);
618 /* common (new) variables */
619 ui_theme_init_new(btheme);
622 rgba_char_args_set_fl(btheme->tv3d.back, 0.225, 0.225, 0.225, 1.0);
623 rgba_char_args_set(btheme->tv3d.text, 0, 0, 0, 255);
624 rgba_char_args_set(btheme->tv3d.text_hi, 255, 255, 255, 255);
626 rgba_char_args_set_fl(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0);
627 rgba_char_args_set_fl(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0);
628 rgba_char_args_set(btheme->tv3d.panel, 165, 165, 165, 127);
630 rgba_char_args_set(btheme->tv3d.shade1, 160, 160, 160, 100);
631 rgba_char_args_set(btheme->tv3d.shade2, 0x7f, 0x70, 0x70, 100);
633 rgba_char_args_set_fl(btheme->tv3d.grid, 0.251, 0.251, 0.251, 1.0);
634 rgba_char_args_set(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
635 rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
636 rgba_char_args_set(btheme->tv3d.speaker, 0, 0, 0, 255);
637 rgba_char_args_set(btheme->tv3d.select, 241, 88, 0, 255);
638 rgba_char_args_set(btheme->tv3d.active, 255, 170, 64, 255);
639 rgba_char_args_set(btheme->tv3d.group, 8, 48, 8, 255);
640 rgba_char_args_set(btheme->tv3d.group_active, 85, 187, 85, 255);
641 rgba_char_args_set(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
642 rgba_char_args_set(btheme->tv3d.vertex, 0, 0, 0, 255);
643 rgba_char_args_set(btheme->tv3d.vertex_select, 255, 133, 0, 255);
644 btheme->tv3d.vertex_size= 3;
645 btheme->tv3d.outline_width= 1;
646 rgba_char_args_set(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255);
647 rgba_char_args_set(btheme->tv3d.edge_select, 255, 160, 0, 255);
648 rgba_char_args_set(btheme->tv3d.edge_seam, 219, 37, 18, 255);
649 rgba_char_args_set(btheme->tv3d.edge_facesel, 75, 75, 75, 255);
650 rgba_char_args_set(btheme->tv3d.face, 0, 0, 0, 18);
651 rgba_char_args_set(btheme->tv3d.face_select, 255, 133, 0, 60);
652 rgba_char_args_set(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
653 rgba_char_args_set(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
654 rgba_char_args_set(btheme->tv3d.face_dot, 255, 133, 0, 255);
655 rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
656 rgba_char_args_set_fl(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
657 rgba_char_args_set(btheme->tv3d.edge_sharp, 0, 255, 255, 255);
658 rgba_char_args_set(btheme->tv3d.header_text, 0, 0, 0, 255);
659 rgba_char_args_set(btheme->tv3d.header_text_hi, 255, 255, 255, 255);
660 rgba_char_args_set(btheme->tv3d.button_text, 0, 0, 0, 255);
661 rgba_char_args_set(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
662 rgba_char_args_set(btheme->tv3d.button_title, 0, 0, 0, 255);
663 rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255);
665 btheme->tv3d.facedot_size= 4;
667 rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
668 rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 32, 0, 255);
669 rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 0, 128, 255);
671 rgba_char_args_set(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
673 rgba_char_args_set(btheme->tv3d.nurb_uline, 0x90, 0x90, 0x00, 255);
674 rgba_char_args_set(btheme->tv3d.nurb_vline, 0x80, 0x30, 0x60, 255);
675 rgba_char_args_set(btheme->tv3d.nurb_sel_uline, 0xf0, 0xff, 0x40, 255);
676 rgba_char_args_set(btheme->tv3d.nurb_sel_vline, 0xf0, 0x90, 0xa0, 255);
678 rgba_char_args_set(btheme->tv3d.handle_free, 0, 0, 0, 255);
679 rgba_char_args_set(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255);
680 rgba_char_args_set(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255);
681 rgba_char_args_set(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255);
682 rgba_char_args_set(btheme->tv3d.handle_sel_free, 0, 0, 0, 255);
683 rgba_char_args_set(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
684 rgba_char_args_set(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
685 rgba_char_args_set(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
687 rgba_char_args_set(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
688 rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
690 rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
691 rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw
693 rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
694 rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
697 /* to have something initialized */
698 btheme->tbuts= btheme->tv3d;
700 rgba_char_args_set_fl(btheme->tbuts.back, 0.45, 0.45, 0.45, 1.0);
701 rgba_char_args_set(btheme->tbuts.panel, 0x82, 0x82, 0x82, 255);
704 btheme->tipo= btheme->tv3d;
705 rgba_char_args_set_fl(btheme->tipo.back, 0.42, 0.42, 0.42, 1.0);
706 rgba_char_args_set_fl(btheme->tipo.list, 0.4, 0.4, 0.4, 1.0);
707 rgba_char_args_set(btheme->tipo.grid, 94, 94, 94, 255);
708 rgba_char_args_set(btheme->tipo.panel, 255, 255, 255, 150);
709 rgba_char_args_set(btheme->tipo.shade1, 150, 150, 150, 100); /* scrollbars */
710 rgba_char_args_set(btheme->tipo.shade2, 0x70, 0x70, 0x70, 100);
711 rgba_char_args_set(btheme->tipo.vertex, 0, 0, 0, 255);
712 rgba_char_args_set(btheme->tipo.vertex_select, 255, 133, 0, 255);
713 rgba_char_args_set(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255);
714 btheme->tipo.vertex_size= 3;
716 rgba_char_args_set(btheme->tipo.handle_vertex, 0, 0, 0, 255);
717 rgba_char_args_set(btheme->tipo.handle_vertex_select, 255, 133, 0, 255);
718 rgba_char_args_set(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
719 rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
720 btheme->tipo.handle_vertex_size= 4;
722 rgba_char_args_set(btheme->tipo.ds_channel, 82, 96, 110, 255);
723 rgba_char_args_set(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
724 rgba_char_args_set(btheme->tipo.group, 79, 101, 73, 255);
725 rgba_char_args_set(btheme->tipo.group_active, 135, 177, 125, 255);
728 btheme->tact= btheme->tipo;
729 rgba_char_args_set(btheme->tact.strip, 12, 10, 10, 128);
730 rgba_char_args_set(btheme->tact.strip_select, 255, 140, 0, 255);
733 btheme->tnla= btheme->tact;
736 /* to have something initialized */
737 btheme->tfile= btheme->tv3d;
738 rgba_char_args_set_fl(btheme->tfile.back, 0.3, 0.3, 0.3, 1);
739 rgba_char_args_set_fl(btheme->tfile.panel, 0.3, 0.3, 0.3, 1);
740 rgba_char_args_set_fl(btheme->tfile.list, 0.4, 0.4, 0.4, 1);
741 rgba_char_args_set(btheme->tfile.text, 250, 250, 250, 255);
742 rgba_char_args_set(btheme->tfile.text_hi, 15, 15, 15, 255);
743 rgba_char_args_set(btheme->tfile.panel, 145, 145, 145, 255); // bookmark/ui regions
744 rgba_char_args_set(btheme->tfile.active, 130, 130, 130, 255); // selected files
745 rgba_char_args_set(btheme->tfile.hilite, 255, 140, 25, 255); // selected files
747 rgba_char_args_set(btheme->tfile.grid, 250, 250, 250, 255);
748 rgba_char_args_set(btheme->tfile.image, 250, 250, 250, 255);
749 rgba_char_args_set(btheme->tfile.movie, 250, 250, 250, 255);
750 rgba_char_args_set(btheme->tfile.scene, 250, 250, 250, 255);
754 btheme->tseq= btheme->tv3d;
755 rgba_char_args_set(btheme->tseq.back, 116, 116, 116, 255);
756 rgba_char_args_set(btheme->tseq.movie, 81, 105, 135, 255);
757 rgba_char_args_set(btheme->tseq.image, 109, 88, 129, 255);
758 rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255);
759 rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255);
760 rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255);
761 rgba_char_args_set(btheme->tseq.plugin, 126, 126, 80, 255);
762 rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
763 rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
767 btheme->tima= btheme->tv3d;
768 rgba_char_args_set(btheme->tima.back, 53, 53, 53, 255);
769 rgba_char_args_set(btheme->tima.vertex, 0, 0, 0, 255);
770 rgba_char_args_set(btheme->tima.vertex_select, 255, 133, 0, 255);
771 btheme->tima.vertex_size= 3;
772 btheme->tima.facedot_size= 3;
773 rgba_char_args_set(btheme->tima.face, 255, 255, 255, 10);
774 rgba_char_args_set(btheme->tima.face_select, 255, 133, 0, 60);
775 rgba_char_args_set(btheme->tima.editmesh_active, 255, 255, 255, 128);
776 rgba_char_args_set_fl(btheme->tima.preview_back, 0.45, 0.45, 0.45, 1.0);
777 rgba_char_args_set_fl(btheme->tima.preview_stitch_face, 0.5, 0.5, 0.0, 0.2);
778 rgba_char_args_set_fl(btheme->tima.preview_stitch_edge, 1.0, 0.0, 1.0, 0.2);
779 rgba_char_args_set_fl(btheme->tima.preview_stitch_vert, 0.0, 0.0, 1.0, 0.2);
780 rgba_char_args_set_fl(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
781 rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
784 btheme->text= btheme->tv3d;
785 rgba_char_args_set(btheme->text.back, 153, 153, 153, 255);
786 rgba_char_args_set(btheme->text.shade1, 143, 143, 143, 255);
787 rgba_char_args_set(btheme->text.shade2, 0xc6, 0x77, 0x77, 255);
788 rgba_char_args_set(btheme->text.hilite, 255, 0, 0, 255);
790 /* syntax highlighting */
791 rgba_char_args_set(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
792 rgba_char_args_set(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
793 rgba_char_args_set(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
794 rgba_char_args_set(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
795 rgba_char_args_set(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
798 btheme->toops= btheme->tv3d;
799 rgba_char_args_set_fl(btheme->toops.back, 0.45, 0.45, 0.45, 1.0);
801 rgba_char_args_set_fl(btheme->toops.match, 0.2, 0.5, 0.2, 0.3); /* highlighting search match - soft green*/
802 rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
805 btheme->tinfo= btheme->tv3d;
806 rgba_char_args_set_fl(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
808 /* space user preferences */
809 btheme->tuserpref= btheme->tv3d;
810 rgba_char_args_set_fl(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
813 btheme->tconsole= btheme->tv3d;
814 rgba_char_args_set(btheme->tconsole.back, 0, 0, 0, 255);
815 rgba_char_args_set(btheme->tconsole.console_output, 96, 128, 255, 255);
816 rgba_char_args_set(btheme->tconsole.console_input, 255, 255, 255, 255);
817 rgba_char_args_set(btheme->tconsole.console_info, 0, 170, 0, 255);
818 rgba_char_args_set(btheme->tconsole.console_error, 220, 96, 96, 255);
819 rgba_char_args_set(btheme->tconsole.console_cursor, 220, 96, 96, 255);
822 btheme->ttime= btheme->tv3d;
823 rgba_char_args_set_fl(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
824 rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
825 rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); // sliders
827 /* space node, re-uses syntax color storage */
828 btheme->tnode= btheme->tv3d;
829 rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255);
830 rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */
831 rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in/output */
832 rgba_char_args_set(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */
833 rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
834 rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
835 btheme->tnode.noodle_curving = 5;
838 btheme->tlogic= btheme->tv3d;
839 rgba_char_args_set(btheme->tlogic.back, 100, 100, 100, 255);
842 btheme->tclip= btheme->tv3d;
844 rgba_char_args_set(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
845 rgba_char_args_set(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
846 rgba_char_args_set(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
847 rgba_char_args_set(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
848 rgba_char_args_set(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
849 rgba_char_args_set(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
850 rgba_char_args_set(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
851 rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
852 rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
853 rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
854 rgba_char_args_set(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
855 rgba_char_args_set(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
856 btheme->tclip.handle_vertex_size= 4;
860 void UI_SetTheme(int spacetype, int regionid)
862 if(spacetype==0) { // called for safety, when delete themes
863 theme_active= U.themes.first;
864 theme_spacetype= SPACE_VIEW3D;
865 theme_regionid= RGN_TYPE_WINDOW;
868 // later on, a local theme can be found too
869 theme_active= U.themes.first;
870 theme_spacetype= spacetype;
871 theme_regionid= regionid;
875 bTheme *UI_GetTheme()
877 return U.themes.first;
880 // for space windows only
881 void UI_ThemeColor(int colorid)
883 const unsigned char *cp;
885 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
891 void UI_ThemeColor4(int colorid)
893 const unsigned char *cp;
895 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
900 // set the color with offset for shades
901 void UI_ThemeColorShade(int colorid, int offset)
904 const unsigned char *cp;
906 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
907 r= offset + (int) cp[0];
909 g= offset + (int) cp[1];
911 b= offset + (int) cp[2];
913 //glColor3ub(r, g, b);
914 glColor4ub(r, g, b, cp[3]);
916 void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
919 const unsigned char *cp;
921 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
922 r= coloffset + (int) cp[0];
924 g= coloffset + (int) cp[1];
926 b= coloffset + (int) cp[2];
928 a= alphaoffset + (int) cp[3];
930 glColor4ub(r, g, b, a);
933 // blend between to theme colors, and set it
934 void UI_ThemeColorBlend(int colorid1, int colorid2, float fac)
937 const unsigned char *cp1, *cp2;
939 cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
940 cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
942 CLAMP(fac, 0.0f, 1.0f);
943 r= floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
944 g= floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
945 b= floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
950 // blend between to theme colors, shade it, and set it
951 void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
954 const unsigned char *cp1, *cp2;
956 cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
957 cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
959 CLAMP(fac, 0.0f, 1.0f);
960 r= offset+floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
961 g= offset+floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
962 b= offset+floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
971 // blend between to theme colors, shade it, and set it
972 void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset)
975 const unsigned char *cp1, *cp2;
977 cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
978 cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
980 CLAMP(fac, 0.0f, 1.0f);
981 r= offset+floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
982 g= offset+floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
983 b= offset+floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
984 a= alphaoffset + floorf((1.0f-fac)*cp1[3] + fac*cp2[3]);
991 glColor4ub(r, g, b, a);
995 // get individual values, not scaled
996 float UI_GetThemeValuef(int colorid)
998 const unsigned char *cp;
1000 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1001 return ((float)cp[0]);
1005 // get individual values, not scaled
1006 int UI_GetThemeValue(int colorid)
1008 const unsigned char *cp;
1010 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1011 return ((int) cp[0]);
1016 // get the color, range 0.0-1.0
1017 void UI_GetThemeColor3fv(int colorid, float *col)
1019 const unsigned char *cp;
1021 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1022 col[0]= ((float)cp[0])/255.0f;
1023 col[1]= ((float)cp[1])/255.0f;
1024 col[2]= ((float)cp[2])/255.0f;
1027 // get the color, range 0.0-1.0, complete with shading offset
1028 void UI_GetThemeColorShade3fv(int colorid, int offset, float *col)
1031 const unsigned char *cp;
1033 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1035 r= offset + (int) cp[0];
1037 g= offset + (int) cp[1];
1039 b= offset + (int) cp[2];
1042 col[0]= ((float)r)/255.0f;
1043 col[1]= ((float)g)/255.0f;
1044 col[2]= ((float)b)/255.0f;
1047 // get the color, in char pointer
1048 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
1050 const unsigned char *cp;
1052 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1058 // get the color, in char pointer
1059 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
1061 const unsigned char *cp;
1063 cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1070 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4])
1072 const unsigned char *cp;
1074 cp= UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
1081 // blends and shades between two char color pointers
1082 void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset)
1085 CLAMP(fac, 0.0f, 1.0f);
1086 r= offset+floorf((1.0f-fac)*cp1[0] + fac*cp2[0]);
1087 g= offset+floorf((1.0f-fac)*cp1[1] + fac*cp2[1]);
1088 b= offset+floorf((1.0f-fac)*cp1[2] + fac*cp2[2]);
1090 r= r<0?0:(r>255?255:r);
1091 g= g<0?0:(g>255?255:g);
1092 b= b<0?0:(b>255?255:b);
1094 glColor3ub(r, g, b);
1097 void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], int offset)
1101 r= offset+(int)cp[0];
1102 g= offset+(int)cp[1];
1103 b= offset+(int)cp[2];
1114 // get a 3 byte color, blended and shaded between two other char color pointers
1115 void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset)
1119 CLAMP(fac, 0.0f, 1.0f);
1120 r= offset+floor((1.0f-fac)*cp1[0] + fac*cp2[0]);
1121 g= offset+floor((1.0f-fac)*cp1[1] + fac*cp2[1]);
1122 b= offset+floor((1.0f-fac)*cp1[2] + fac*cp2[2]);
1133 void UI_ThemeClearColor(int colorid)
1137 UI_GetThemeColor3fv(colorid, col);
1138 glClearColor(col[0], col[1], col[2], 0.0);
1141 void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], const char axis)
1146 dst_col[0]= src_col[0]>219?255:src_col[0]+36;
1147 dst_col[1]= src_col[1]<26?0:src_col[1]-26;
1148 dst_col[2]= src_col[2]<26?0:src_col[2]-26;
1151 dst_col[0]= src_col[0]<46?0:src_col[0]-36;
1152 dst_col[1]= src_col[1]>189?255:src_col[1]+66;
1153 dst_col[2]= src_col[2]<46?0:src_col[2]-36;
1156 dst_col[0]= src_col[0]<26?0:src_col[0]-26;
1157 dst_col[1]= src_col[1]<26?0:src_col[1]-26;
1158 dst_col[2]= src_col[2]>209?255:src_col[2]+46;
1161 BLI_assert(!"invalid axis arg");
1165 /* ************************************************************* */
1167 /* patching UserDef struct and Themes */
1168 void init_userdef_do_versions(void)
1170 Main *bmain= G.main;
1173 /* the UserDef struct is not corrected with do_versions() .... ugh! */
1174 if(U.wheellinescroll == 0) U.wheellinescroll = 3;
1175 if(U.menuthreshold1==0) {
1176 U.menuthreshold1= 5;
1177 U.menuthreshold2= 2;
1179 if(U.tb_leftmouse==0) {
1183 if(U.mixbufsize==0) U.mixbufsize= 2048;
1184 if (strcmp(U.tempdir, "/") == 0) {
1185 BLI_system_temporary_dir(U.tempdir);
1187 if (U.autokey_mode == 0) {
1188 /* 'add/replace' but not on */
1191 if (U.savetime <= 0) {
1193 // XXX error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
1195 /* transform widget settings */
1196 if(U.tw_hotspot==0) {
1198 U.tw_size= 20; // percentage of window size
1199 U.tw_handlesize= 16; // percentage of widget radius
1201 if(U.pad_rot_angle==0)
1202 U.pad_rot_angle= 15;
1204 /* signal for derivedmesh to use colorband */
1205 /* run in case this was on and is now off in the user prefs [#28096] */
1206 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
1208 if (bmain->versionfile <= 191) {
1209 BLI_strncpy(U.plugtexdir, U.textudir, sizeof(U.plugtexdir));
1210 strcpy(U.sounddir, "/");
1213 /* patch to set Dupli Armature */
1214 if (bmain->versionfile < 220) {
1215 U.dupflag |= USER_DUP_ARM;
1218 /* added seam, normal color, undo */
1219 if (bmain->versionfile <= 234) {
1222 U.uiflag |= USER_GLOBALUNDO;
1223 if (U.undosteps==0) U.undosteps=32;
1225 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1226 /* check for alpha==0 is safe, then color was never set */
1227 if(btheme->tv3d.edge_seam[3]==0) {
1228 rgba_char_args_set(btheme->tv3d.edge_seam, 230, 150, 50, 255);
1230 if(btheme->tv3d.normal[3]==0) {
1231 rgba_char_args_set(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
1233 if(btheme->tv3d.vertex_normal[3]==0) {
1234 rgba_char_args_set(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
1236 if(btheme->tv3d.face_dot[3]==0) {
1237 rgba_char_args_set(btheme->tv3d.face_dot, 255, 138, 48, 255);
1238 btheme->tv3d.facedot_size= 4;
1242 if (bmain->versionfile <= 235) {
1243 /* illegal combo... */
1244 if (U.flag & USER_LMOUSESELECT)
1245 U.flag &= ~USER_TWOBUTTONMOUSE;
1247 if (bmain->versionfile <= 236) {
1249 /* new space type */
1250 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1251 /* check for alpha==0 is safe, then color was never set */
1252 if(btheme->ttime.back[3]==0) {
1253 // copied from ui_theme_init_default
1254 btheme->ttime= btheme->tv3d;
1255 rgba_char_args_set_fl(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
1256 rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
1257 rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); // sliders
1259 if(btheme->text.syntaxn[3]==0) {
1260 rgba_char_args_set(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
1261 rgba_char_args_set(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
1262 rgba_char_args_set(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
1263 rgba_char_args_set(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
1264 rgba_char_args_set(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
1268 if (bmain->versionfile <= 237) {
1271 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1272 /* check for alpha==0 is safe, then color was never set */
1273 if(btheme->tv3d.bone_solid[3]==0) {
1274 rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
1275 rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80);
1279 if (bmain->versionfile <= 238) {
1282 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1283 /* check for alpha==0 is safe, then color was never set */
1284 if(btheme->tnla.strip[3]==0) {
1285 rgba_char_args_set(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255);
1286 rgba_char_args_set(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255);
1290 if (bmain->versionfile <= 239) {
1293 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1294 /* Lamp theme, check for alpha==0 is safe, then color was never set */
1295 if(btheme->tv3d.lamp[3]==0) {
1296 rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
1297 /* TEMPORAL, remove me! (ton) */
1298 U.uiflag |= USER_PLAINMENUS;
1302 if(U.obcenter_dia==0) U.obcenter_dia= 6;
1304 if (bmain->versionfile <= 241) {
1306 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1307 /* Node editor theme, check for alpha==0 is safe, then color was never set */
1308 if(btheme->tnode.syntaxn[3]==0) {
1309 /* re-uses syntax color storage */
1310 btheme->tnode= btheme->tv3d;
1311 rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255);
1312 rgba_char_args_set(btheme->tnode.syntaxl, 150, 150, 150, 255); /* TH_NODE, backdrop */
1313 rgba_char_args_set(btheme->tnode.syntaxn, 129, 131, 144, 255); /* in/output */
1314 rgba_char_args_set(btheme->tnode.syntaxb, 127,127,127, 255); /* operator */
1315 rgba_char_args_set(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */
1316 rgba_char_args_set(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */
1318 /* Group theme colors */
1319 if(btheme->tv3d.group[3]==0) {
1320 rgba_char_args_set(btheme->tv3d.group, 0x0C, 0x30, 0x0C, 255);
1321 rgba_char_args_set(btheme->tv3d.group_active, 0x66, 0xFF, 0x66, 255);
1323 /* Sequence editor theme*/
1324 if(btheme->tseq.movie[3]==0) {
1325 rgba_char_args_set(btheme->tseq.movie, 81, 105, 135, 255);
1326 rgba_char_args_set(btheme->tseq.image, 109, 88, 129, 255);
1327 rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255);
1328 rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255);
1329 rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255);
1330 rgba_char_args_set(btheme->tseq.plugin, 126, 126, 80, 255);
1331 rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
1332 rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
1336 /* set defaults for 3D View rotating axis indicator */
1337 /* since size can't be set to 0, this indicates it's not saved in startup.blend */
1338 if (U.rvisize == 0) {
1341 U.uiflag |= USER_SHOW_ROTVIEWICON;
1345 if (bmain->versionfile <= 242) {
1348 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1349 /* long keyframe color */
1350 /* check for alpha==0 is safe, then color was never set */
1351 if(btheme->tact.strip[3]==0) {
1352 rgba_char_args_set(btheme->tv3d.edge_sharp, 255, 32, 32, 255);
1353 rgba_char_args_set(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 204);
1354 rgba_char_args_set(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 204);
1357 /* IPO-Editor - Vertex Size*/
1358 if(btheme->tipo.vertex_size == 0) {
1359 btheme->tipo.vertex_size= 3;
1363 if (bmain->versionfile <= 243) {
1364 /* set default number of recently-used files (if not set) */
1365 if (U.recent_files == 0) U.recent_files = 10;
1367 if (bmain->versionfile < 245 || (bmain->versionfile == 245 && bmain->subversionfile < 3)) {
1369 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1370 rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
1372 if(U.coba_weight.tot==0)
1373 init_colorband(&U.coba_weight, 1);
1375 if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 11)) {
1377 for (btheme= U.themes.first; btheme; btheme= btheme->next) {
1378 /* these should all use the same color */
1379 rgba_char_args_set(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
1380 rgba_char_args_set(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255);
1381 rgba_char_args_set(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255);
1382 rgba_char_args_set(btheme->tnla.cframe, 0x60, 0xc0, 0x40, 255);
1383 rgba_char_args_set(btheme->tseq.cframe, 0x60, 0xc0, 0x40, 255);
1384 //rgba_char_args_set(btheme->tsnd.cframe, 0x60, 0xc0, 0x40, 255); Not needed anymore
1385 rgba_char_args_set(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255);
1388 if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 13)) {
1390 for (btheme= U.themes.first; btheme; btheme= btheme->next) {
1391 /* action channel groups (recolor anyway) */
1392 rgba_char_args_set(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
1393 rgba_char_args_set(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
1395 /* bone custom-color sets */
1396 if (btheme->tarm[0].solid[3] == 0)
1397 ui_theme_init_boneColorSets(btheme);
1400 if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 16)) {
1401 U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE;
1403 if ((bmain->versionfile < 247) || (bmain->versionfile == 247 && bmain->subversionfile <= 2)) {
1407 for (btheme= U.themes.first; btheme; btheme= btheme->next) {
1410 /* IPO Editor: Handles/Vertices */
1411 col = btheme->tipo.vertex;
1412 rgba_char_args_set(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255);
1413 col = btheme->tipo.vertex_select;
1414 rgba_char_args_set(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255);
1415 btheme->tipo.handle_vertex_size= btheme->tipo.vertex_size;
1417 /* Sequence/Image Editor: colors for GPencil text */
1418 col = btheme->tv3d.bone_pose;
1419 rgba_char_args_set(btheme->tseq.bone_pose, col[0], col[1], col[2], 255);
1420 rgba_char_args_set(btheme->tima.bone_pose, col[0], col[1], col[2], 255);
1421 col = btheme->tv3d.vertex_select;
1422 rgba_char_args_set(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
1425 if (bmain->versionfile < 250) {
1428 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1429 /* this was not properly initialized in 2.45 */
1430 if(btheme->tima.face_dot[3]==0) {
1431 rgba_char_args_set(btheme->tima.editmesh_active, 255, 255, 255, 128);
1432 rgba_char_args_set(btheme->tima.face_dot, 255, 133, 0, 255);
1433 btheme->tima.facedot_size= 2;
1436 /* DopeSheet - (Object) Channel color */
1437 rgba_char_args_set(btheme->tact.ds_channel, 82, 96, 110, 255);
1438 rgba_char_args_set(btheme->tact.ds_subchannel, 124, 137, 150, 255);
1439 /* DopeSheet - Group Channel color (saner version) */
1440 rgba_char_args_set(btheme->tact.group, 79, 101, 73, 255);
1441 rgba_char_args_set(btheme->tact.group_active, 135, 177, 125, 255);
1443 /* Graph Editor - (Object) Channel color */
1444 rgba_char_args_set(btheme->tipo.ds_channel, 82, 96, 110, 255);
1445 rgba_char_args_set(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
1446 /* Graph Editor - Group Channel color */
1447 rgba_char_args_set(btheme->tipo.group, 79, 101, 73, 255);
1448 rgba_char_args_set(btheme->tipo.group_active, 135, 177, 125, 255);
1450 /* Nla Editor - (Object) Channel color */
1451 rgba_char_args_set(btheme->tnla.ds_channel, 82, 96, 110, 255);
1452 rgba_char_args_set(btheme->tnla.ds_subchannel, 124, 137, 150, 255);
1453 /* NLA Editor - New Strip colors */
1454 rgba_char_args_set(btheme->tnla.strip, 12, 10, 10, 128);
1455 rgba_char_args_set(btheme->tnla.strip_select, 255, 140, 0, 255);
1458 /* adjust grease-pencil distances */
1459 U.gp_manhattendist= 1;
1460 U.gp_euclideandist= 2;
1462 /* adjust default interpolation for new IPO-curves */
1463 U.ipo_new= BEZT_IPO_BEZ;
1466 if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 1)) {
1469 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1471 /* common (new) variables, it checks for alpha==0 */
1472 ui_theme_init_new(btheme);
1474 if(btheme->tui.wcol_num.outline[3]==0)
1475 ui_widget_color_init(&btheme->tui);
1477 /* Logic editor theme, check for alpha==0 is safe, then color was never set */
1478 if(btheme->tlogic.syntaxn[3]==0) {
1479 /* re-uses syntax color storage */
1480 btheme->tlogic= btheme->tv3d;
1481 rgba_char_args_set(btheme->tlogic.back, 100, 100, 100, 255);
1484 rgba_char_args_set_fl(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
1485 rgba_char_args_set_fl(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
1489 if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 3)) {
1490 /* new audio system */
1491 if(U.audiochannels == 0)
1492 U.audiochannels = 2;
1493 if(U.audiodevice == 0) {
1501 if(U.audioformat == 0)
1502 U.audioformat = 0x24;
1503 if(U.audiorate == 0)
1504 U.audiorate = 44100;
1507 if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 5))
1508 U.gameflags |= USER_DISABLE_VBO;
1510 if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 8)) {
1513 for(km=U.user_keymaps.first; km; km=km->next) {
1514 if (strcmp(km->idname, "Armature_Sketch")==0)
1515 strcpy(km->idname, "Armature Sketch");
1516 else if (strcmp(km->idname, "View3D")==0)
1517 strcpy(km->idname, "3D View");
1518 else if (strcmp(km->idname, "View3D Generic")==0)
1519 strcpy(km->idname, "3D View Generic");
1520 else if (strcmp(km->idname, "EditMesh")==0)
1521 strcpy(km->idname, "Mesh");
1522 else if (strcmp(km->idname, "TimeLine")==0)
1523 strcpy(km->idname, "Timeline");
1524 else if (strcmp(km->idname, "UVEdit")==0)
1525 strcpy(km->idname, "UV Editor");
1526 else if (strcmp(km->idname, "Animation_Channels")==0)
1527 strcpy(km->idname, "Animation Channels");
1528 else if (strcmp(km->idname, "GraphEdit Keys")==0)
1529 strcpy(km->idname, "Graph Editor");
1530 else if (strcmp(km->idname, "GraphEdit Generic")==0)
1531 strcpy(km->idname, "Graph Editor Generic");
1532 else if (strcmp(km->idname, "Action_Keys")==0)
1533 strcpy(km->idname, "Dopesheet");
1534 else if (strcmp(km->idname, "NLA Data")==0)
1535 strcpy(km->idname, "NLA Editor");
1536 else if (strcmp(km->idname, "Node Generic")==0)
1537 strcpy(km->idname, "Node Editor");
1538 else if (strcmp(km->idname, "Logic Generic")==0)
1539 strcpy(km->idname, "Logic Editor");
1540 else if (strcmp(km->idname, "File")==0)
1541 strcpy(km->idname, "File Browser");
1542 else if (strcmp(km->idname, "FileMain")==0)
1543 strcpy(km->idname, "File Browser Main");
1544 else if (strcmp(km->idname, "FileButtons")==0)
1545 strcpy(km->idname, "File Browser Buttons");
1546 else if (strcmp(km->idname, "Buttons Generic")==0)
1547 strcpy(km->idname, "Property Editor");
1550 if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 16)) {
1551 if(U.wmdrawmethod == USER_DRAW_TRIPLE)
1552 U.wmdrawmethod = USER_DRAW_AUTOMATIC;
1555 if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 3)) {
1556 if (U.flag & USER_LMOUSESELECT)
1557 U.flag &= ~USER_TWOBUTTONMOUSE;
1559 if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 4)) {
1562 /* default new handle type is auto handles */
1563 U.keyhandles_new = HD_AUTO;
1565 /* init new curve colors */
1566 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1567 /* init colors used for handles in 3D-View */
1568 rgba_char_args_set(btheme->tv3d.handle_free, 0, 0, 0, 255);
1569 rgba_char_args_set(btheme->tv3d.handle_auto, 0x90, 0x90, 0x00, 255);
1570 rgba_char_args_set(btheme->tv3d.handle_vect, 0x40, 0x90, 0x30, 255);
1571 rgba_char_args_set(btheme->tv3d.handle_align, 0x80, 0x30, 0x60, 255);
1572 rgba_char_args_set(btheme->tv3d.handle_sel_free, 0, 0, 0, 255);
1573 rgba_char_args_set(btheme->tv3d.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
1574 rgba_char_args_set(btheme->tv3d.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
1575 rgba_char_args_set(btheme->tv3d.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
1576 rgba_char_args_set(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
1578 /* same colors again for Graph Editor... */
1579 rgba_char_args_set(btheme->tipo.handle_free, 0, 0, 0, 255);
1580 rgba_char_args_set(btheme->tipo.handle_auto, 0x90, 0x90, 0x00, 255);
1581 rgba_char_args_set(btheme->tipo.handle_vect, 0x40, 0x90, 0x30, 255);
1582 rgba_char_args_set(btheme->tipo.handle_align, 0x80, 0x30, 0x60, 255);
1583 rgba_char_args_set(btheme->tipo.handle_sel_free, 0, 0, 0, 255);
1584 rgba_char_args_set(btheme->tipo.handle_sel_auto, 0xf0, 0xff, 0x40, 255);
1585 rgba_char_args_set(btheme->tipo.handle_sel_vect, 0x40, 0xc0, 0x30, 255);
1586 rgba_char_args_set(btheme->tipo.handle_sel_align, 0xf0, 0x90, 0xa0, 255);
1589 rgba_char_args_set_fl(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
1592 if (bmain->versionfile <= 252) {
1595 /* init new curve colors */
1596 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1597 if (btheme->tv3d.lastsel_point[3] == 0)
1598 rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
1601 if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) {
1604 /* interface_widgets.c */
1605 struct uiWidgetColors wcol_progress= {
1607 {190, 190, 190, 255},
1608 {100, 100, 100, 180},
1612 {255, 255, 255, 255},
1618 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1619 /* init progress bar theme */
1620 btheme->tui.wcol_progress= wcol_progress;
1624 if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 2)) {
1626 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1627 rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
1628 rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 32, 0, 255);
1629 rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 0, 128, 255);
1633 if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 4)) {
1635 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1636 if((btheme->tv3d.outline_width) == 0) btheme->tv3d.outline_width= 1;
1640 if (bmain->versionfile < 257) {
1641 /* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */
1642 U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
1645 if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 2)) {
1647 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1648 btheme->tnode.noodle_curving = 5;
1652 if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 1)) {
1655 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1656 btheme->tv3d.speaker[3] = 255;
1660 if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 3)) {
1663 /* if new keyframes handle default is stuff "auto", make it "auto-clamped" instead
1664 * was changed in 260 as part of GSoC11, but version patch was wrong
1666 if (U.keyhandles_new == HD_AUTO)
1667 U.keyhandles_new = HD_AUTO_ANIM;
1669 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1670 if(btheme->tv3d.bundle_solid[3] == 0)
1671 rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
1673 if(btheme->tv3d.camera_path[3] == 0)
1674 rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
1676 if((btheme->tclip.back[3]) == 0) {
1677 btheme->tclip= btheme->tv3d;
1679 rgba_char_args_set(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
1680 rgba_char_args_set(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
1681 rgba_char_args_set(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
1682 rgba_char_args_set(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
1683 rgba_char_args_set(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
1684 rgba_char_args_set(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
1685 rgba_char_args_set(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
1686 rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
1687 rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
1688 rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
1689 rgba_char_args_set(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
1690 rgba_char_args_set(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
1691 btheme->tclip.handle_vertex_size= 4;
1694 /* auto-clamped handles -> based on auto */
1695 if(btheme->tipo.handle_auto_clamped[3] == 0)
1696 rgba_char_args_set(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
1697 if(btheme->tipo.handle_sel_auto_clamped[3] == 0)
1698 rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
1701 /* enable (Cycles) addon by default */
1702 if(!BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module))) {
1703 bAddon *baddon= MEM_callocN(sizeof(bAddon), "bAddon");
1704 BLI_strncpy(baddon->module, "cycles", sizeof(baddon->module));
1705 BLI_addtail(&U.addons, baddon);
1709 if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 5)) {
1712 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1713 rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
1714 btheme->tui.icon_alpha= 1.0;
1718 if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 4)) {
1720 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1721 rgba_char_args_set_fl(btheme->tima.preview_stitch_face, 0.071, 0.259, 0.694, 0.150);
1722 rgba_char_args_set_fl(btheme->tima.preview_stitch_edge, 1.0, 0.522, 0.0, 0.7);
1723 rgba_char_args_set_fl(btheme->tima.preview_stitch_vert, 1.0, 0.522, 0.0, 0.5);
1724 rgba_char_args_set_fl(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
1725 rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
1726 rgba_char_args_set_fl(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140);
1728 rgba_char_args_set_fl(btheme->toops.match, 0.2, 0.5, 0.2, 0.3);
1729 rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
1732 U.use_16bit_textures = 1;
1735 if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) {
1737 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1738 if (btheme->tui.wcol_menu_item.item[3] == 255)
1739 rgba_char_args_set(btheme->tui.wcol_menu_item.item, 172, 172, 172, 128);
1743 if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 3)) {
1745 for(btheme= U.themes.first; btheme; btheme= btheme->next) {
1746 if (btheme->tui.wcol_tooltip.inner[3] == 0) {
1747 btheme->tui.wcol_tooltip = btheme->tui.wcol_menu_back;
1752 /* GL Texture Garbage Collection (variable abused above!) */
1753 if (U.textimeout == 0) {
1754 U.texcollectrate = 60;
1757 if (U.memcachelimit <= 0) {
1758 U.memcachelimit = 32;
1760 if (U.frameserverport == 0) {
1761 U.frameserverport = 8080;
1763 if (U.dbl_click_time == 0) {
1764 U.dbl_click_time = 350;
1766 if (U.anim_player_preset == 0) {
1767 U.anim_player_preset = 1;
1769 if (U.scrcastfps == 0) {
1773 if (U.v2d_min_gridsize == 0) {
1774 U.v2d_min_gridsize= 35;
1776 if (U.dragthreshold == 0 )
1778 if (U.widget_unit==0)
1779 U.widget_unit= (U.dpi * 20 + 36)/72;
1780 if (U.anisotropic_filter <= 0)
1781 U.anisotropic_filter = 1;
1783 if (U.ndof_sensitivity == 0.0f) {
1784 U.ndof_sensitivity = 1.0f;
1785 U.ndof_flag = NDOF_LOCK_HORIZON |
1786 NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
1788 if (U.tweak_threshold == 0 )
1789 U.tweak_threshold= 10;
1791 /* funny name, but it is GE stuff, moves userdef stuff to engine */
1792 // XXX space_set_commmandline_options();
1793 /* this timer uses U */
1794 // XXX reset_autosave();