From 331eb81e09d78e51b4b3b4af687a4eb0ac6b5d81 Mon Sep 17 00:00:00 2001 From: Rob Haarsma Date: Mon, 12 May 2003 14:23:03 +0000 Subject: [PATCH] modified so .Blanguages and .bfont get loaded from .blender dir. the path to the selected ui font gets stored in the U.fontdir userprefs. fixed a fullscreen thingie for windows. --- source/blender/makesdna/DNA_userdef_types.h | 16 ++++++++-------- source/blender/src/language.c | 20 +++++++++++++++----- source/blender/src/usiblender.c | 15 +++++++++++++-- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 05d5aba8746..2d2ba593513 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -38,14 +38,14 @@ typedef struct UserDef { short flag, dupflag; int savetime; - char tempdir[64]; - char fontdir[64]; - char renderdir[64]; - char textudir[64]; - char plugtexdir[64]; - char plugseqdir[64]; - char pythondir[64]; - char sounddir[64]; + char tempdir[160]; // FILE_MAXDIR length + char fontdir[160]; + char renderdir[160]; + char textudir[160]; + char plugtexdir[160]; + char plugseqdir[160]; + char pythondir[160]; + char sounddir[160]; short versions, vrmlflag; // tmp for export, will be replaced by strubi int gameflags; int wheellinescroll; diff --git a/source/blender/src/language.c b/source/blender/src/language.c index da8e333798b..bb1ca0b8705 100644 --- a/source/blender/src/language.c +++ b/source/blender/src/language.c @@ -140,6 +140,8 @@ void set_interface_font(char *str) { lang_setlanguage(); BLI_split_dirfile(str, di, U.fontname); + if(strlen(di) < FILE_MAXDIR) strcpy(U.fontdir, di); + G.ui_international = TRUE; } else { sprintf(U.fontname, "Invalid font."); @@ -168,7 +170,7 @@ void start_interface_font(void) { U.language= 0; U.fontsize= 11; U.encoding= 0; - sprintf(U.fontname, ".bfont.ttf\0"); + sprintf(U.fontname, ".blender/.bfont.ttf\0"); result = FTF_SetFont(U.fontname, U.fontsize); } @@ -180,6 +182,8 @@ void start_interface_font(void) { } else { printf("no font found for international support\n"); G.ui_international = FALSE; + U.transopts &= ~TR_ALL; + U.fontsize = 0; } allqueue(REDRAWALL, 0); @@ -253,12 +257,18 @@ int read_languagefile(void) { lines= BLI_read_file_as_lines(name); if(lines == NULL) { - /* If not found in home, try current dir */ - strcpy(name, ".Blanguages"); + /* If not found in home, try .blender dir */ + strcpy(name, ".blender\\.Blanguages"); lines= BLI_read_file_as_lines(name); + if(lines == NULL) { - error("File \".Blanguages\" not found"); - return 0; + /* If not found in .blender, try current dir */ + strcpy(name, ".Blanguages"); + lines= BLI_read_file_as_lines(name); + if(lines == NULL) { + error("File \".Blanguages\" not found"); + return 0; + } } } diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index ace9e2c4a92..f474fcdbf42 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -167,6 +167,11 @@ int BIF_read_homefile(void) char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR]; char *home= BLI_gethome(); int success; + static int screenmode = -1; + +#ifdef _WIN32 // FULLSCREEN + screenmode = U.uiflag & FLIPFULLSCREEN; +#endif BLI_make_file_string(G.sce, tstr, home, ".B.blend"); strcpy(scestr, G.sce); /* temporal store */ @@ -194,7 +199,11 @@ int BIF_read_homefile(void) case G_WINDOWSTATE_BORDER: /* force with borders */ U.uiflag &= ~FLIPFULLSCREEN; } - mainwindow_toggle_fullscreen ((U.uiflag & FLIPFULLSCREEN)); + + if(screenmode != (U.uiflag & FLIPFULLSCREEN)) { + mainwindow_toggle_fullscreen ((U.uiflag & FLIPFULLSCREEN)); + screenmode = (U.uiflag & FLIPFULLSCREEN); + } #endif if (BLI_streq(U.tempdir, "/")) { @@ -218,10 +227,12 @@ int BIF_read_homefile(void) U.vrmlflag= USERDEF_VRML_LAYERS; } - /* startup 2.26 with aa fonts ! */ +#ifndef __sgi + /* startup 2.26 with aa fonts ! */ if (G.main->versionfile <= 225) { U.transopts |= TR_ALL; } +#endif space_set_commmandline_options();