diff options
Diffstat (limited to 'source/blender/src/usiblender.c')
-rw-r--r-- | source/blender/src/usiblender.c | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index f019d299654..7de866ccfb7 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -34,8 +34,6 @@ #include <stdio.h> #include <string.h> -#include "GL/glew.h" - #ifdef WIN32 #include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ #ifndef _WIN32_IE @@ -69,6 +67,7 @@ #include "DNA_sound_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "DNA_text_types.h" #include "BKE_blender.h" #include "BKE_curve.h" @@ -81,6 +80,7 @@ #include "BKE_mball.h" #include "BKE_node.h" #include "BKE_packedFile.h" +#include "BKE_suggestions.h" #include "BKE_texture.h" #include "BKE_utildefines.h" #include "BKE_pointcache.h" @@ -149,6 +149,9 @@ #include "reeb.h" +#include "GPU_extensions.h" +#include "GPU_draw.h" + /***/ /* define for setting colors in theme below */ @@ -479,7 +482,33 @@ static void init_userdef_file(void) if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) { U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE; } - + if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile <= 2)) { + bTheme *btheme; + + /* adjust themes */ + for (btheme= U.themes.first; btheme; btheme= btheme->next) { + char *col; + + /* IPO Editor: Handles/Vertices */ + col = btheme->tipo.vertex; + SETCOL(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255); + col = btheme->tipo.vertex_select; + SETCOL(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255); + btheme->tipo.handle_vertex_size= btheme->tipo.vertex_size; + + /* Sequence/Image Editor: colors for GPencil text */ + col = btheme->tv3d.bone_pose; + SETCOL(btheme->tseq.bone_pose, col[0], col[1], col[2], 255); + SETCOL(btheme->tima.bone_pose, col[0], col[1], col[2], 255); + col = btheme->tv3d.vertex_select; + SETCOL(btheme->tseq.vertex_select, col[0], col[1], col[2], 255); + } + + /* define grease-pencil distances */ + U.gp_manhattendist= 3; + U.gp_euclideandist= 20; + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; @@ -569,8 +598,9 @@ void BIF_read_file(char *name) if (retval!=0) G.relbase_valid = 1; undo_editmode_clear(); + undo_imagepaint_clear(); BKE_reset_undo(); - BKE_write_undo("original"); /* save current state */ + BKE_write_undo("Original"); /* save current state */ refresh_interface_font(); } @@ -642,8 +672,9 @@ int BIF_read_homefile(int from_memory) init_userdef_file(); undo_editmode_clear(); + undo_imagepaint_clear(); BKE_reset_undo(); - BKE_write_undo("original"); /* save current state */ + BKE_write_undo("Original"); /* save current state */ /* if from memory, need to refresh python scripts */ if (from_memory) { @@ -1041,8 +1072,9 @@ void BIF_init(void) BIF_filelist_init_icons(); - init_gl_stuff(); /* drawview.c, after homefile */ - glewInit(); + GPU_state_init(); + GPU_extensions_init(); + readBlog(); BLI_strncpy(G.lib, G.sce, FILE_MAX); } @@ -1055,6 +1087,7 @@ extern ListBase editelems; void exit_usiblender(void) { struct TmpFont *tf; + int totblock; BIF_clear_tempfiles(); @@ -1103,7 +1136,7 @@ void exit_usiblender(void) free_ipocopybuf(); free_actcopybuf(); free_vertexpaint(); - free_imagepaint(); + free_texttools(); /* editnurb can remain to exist outside editmode */ freeNurblist(&editNurb); @@ -1121,6 +1154,7 @@ void exit_usiblender(void) sound_exit_audio(); if(G.listener) MEM_freeN(G.listener); + GPU_extensions_exit(); libtiff_exit(); @@ -1130,6 +1164,7 @@ void exit_usiblender(void) /* undo free stuff */ undo_editmode_clear(); + undo_imagepaint_clear(); BKE_undo_save_quit(); // saves quit.blend if global undo is on BKE_reset_undo(); @@ -1155,6 +1190,7 @@ void exit_usiblender(void) BLI_freelistN(&U.themes); BIF_preview_free_dbase(); + totblock= MEM_get_memory_blocks_in_use(); if(totblock!=0) { printf("Error Totblock: %d\n",totblock); MEM_printmemlist(); |