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.
This commit is contained in:
@@ -38,14 +38,14 @@
|
|||||||
typedef struct UserDef {
|
typedef struct UserDef {
|
||||||
short flag, dupflag;
|
short flag, dupflag;
|
||||||
int savetime;
|
int savetime;
|
||||||
char tempdir[64];
|
char tempdir[160]; // FILE_MAXDIR length
|
||||||
char fontdir[64];
|
char fontdir[160];
|
||||||
char renderdir[64];
|
char renderdir[160];
|
||||||
char textudir[64];
|
char textudir[160];
|
||||||
char plugtexdir[64];
|
char plugtexdir[160];
|
||||||
char plugseqdir[64];
|
char plugseqdir[160];
|
||||||
char pythondir[64];
|
char pythondir[160];
|
||||||
char sounddir[64];
|
char sounddir[160];
|
||||||
short versions, vrmlflag; // tmp for export, will be replaced by strubi
|
short versions, vrmlflag; // tmp for export, will be replaced by strubi
|
||||||
int gameflags;
|
int gameflags;
|
||||||
int wheellinescroll;
|
int wheellinescroll;
|
||||||
|
@@ -140,6 +140,8 @@ void set_interface_font(char *str) {
|
|||||||
lang_setlanguage();
|
lang_setlanguage();
|
||||||
BLI_split_dirfile(str, di, U.fontname);
|
BLI_split_dirfile(str, di, U.fontname);
|
||||||
|
|
||||||
|
if(strlen(di) < FILE_MAXDIR) strcpy(U.fontdir, di);
|
||||||
|
|
||||||
G.ui_international = TRUE;
|
G.ui_international = TRUE;
|
||||||
} else {
|
} else {
|
||||||
sprintf(U.fontname, "Invalid font.");
|
sprintf(U.fontname, "Invalid font.");
|
||||||
@@ -168,7 +170,7 @@ void start_interface_font(void) {
|
|||||||
U.language= 0;
|
U.language= 0;
|
||||||
U.fontsize= 11;
|
U.fontsize= 11;
|
||||||
U.encoding= 0;
|
U.encoding= 0;
|
||||||
sprintf(U.fontname, ".bfont.ttf\0");
|
sprintf(U.fontname, ".blender/.bfont.ttf\0");
|
||||||
|
|
||||||
result = FTF_SetFont(U.fontname, U.fontsize);
|
result = FTF_SetFont(U.fontname, U.fontsize);
|
||||||
}
|
}
|
||||||
@@ -180,6 +182,8 @@ void start_interface_font(void) {
|
|||||||
} else {
|
} else {
|
||||||
printf("no font found for international support\n");
|
printf("no font found for international support\n");
|
||||||
G.ui_international = FALSE;
|
G.ui_international = FALSE;
|
||||||
|
U.transopts &= ~TR_ALL;
|
||||||
|
U.fontsize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
allqueue(REDRAWALL, 0);
|
allqueue(REDRAWALL, 0);
|
||||||
@@ -253,12 +257,18 @@ int read_languagefile(void) {
|
|||||||
lines= BLI_read_file_as_lines(name);
|
lines= BLI_read_file_as_lines(name);
|
||||||
|
|
||||||
if(lines == NULL) {
|
if(lines == NULL) {
|
||||||
/* If not found in home, try current dir */
|
/* If not found in home, try .blender dir */
|
||||||
strcpy(name, ".Blanguages");
|
strcpy(name, ".blender\\.Blanguages");
|
||||||
lines= BLI_read_file_as_lines(name);
|
lines= BLI_read_file_as_lines(name);
|
||||||
|
|
||||||
if(lines == NULL) {
|
if(lines == NULL) {
|
||||||
error("File \".Blanguages\" not found");
|
/* If not found in .blender, try current dir */
|
||||||
return 0;
|
strcpy(name, ".Blanguages");
|
||||||
|
lines= BLI_read_file_as_lines(name);
|
||||||
|
if(lines == NULL) {
|
||||||
|
error("File \".Blanguages\" not found");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -167,6 +167,11 @@ int BIF_read_homefile(void)
|
|||||||
char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];
|
char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];
|
||||||
char *home= BLI_gethome();
|
char *home= BLI_gethome();
|
||||||
int success;
|
int success;
|
||||||
|
static int screenmode = -1;
|
||||||
|
|
||||||
|
#ifdef _WIN32 // FULLSCREEN
|
||||||
|
screenmode = U.uiflag & FLIPFULLSCREEN;
|
||||||
|
#endif
|
||||||
|
|
||||||
BLI_make_file_string(G.sce, tstr, home, ".B.blend");
|
BLI_make_file_string(G.sce, tstr, home, ".B.blend");
|
||||||
strcpy(scestr, G.sce); /* temporal store */
|
strcpy(scestr, G.sce); /* temporal store */
|
||||||
@@ -194,7 +199,11 @@ int BIF_read_homefile(void)
|
|||||||
case G_WINDOWSTATE_BORDER: /* force with borders */
|
case G_WINDOWSTATE_BORDER: /* force with borders */
|
||||||
U.uiflag &= ~FLIPFULLSCREEN;
|
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
|
#endif
|
||||||
|
|
||||||
if (BLI_streq(U.tempdir, "/")) {
|
if (BLI_streq(U.tempdir, "/")) {
|
||||||
@@ -218,10 +227,12 @@ int BIF_read_homefile(void)
|
|||||||
U.vrmlflag= USERDEF_VRML_LAYERS;
|
U.vrmlflag= USERDEF_VRML_LAYERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* startup 2.26 with aa fonts ! */
|
#ifndef __sgi
|
||||||
|
/* startup 2.26 with aa fonts ! */
|
||||||
if (G.main->versionfile <= 225) {
|
if (G.main->versionfile <= 225) {
|
||||||
U.transopts |= TR_ALL;
|
U.transopts |= TR_ALL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
space_set_commmandline_options();
|
space_set_commmandline_options();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user