Patch #34204: [Render Animation] Fails with "Error: Specified sample_fmt is not suppo...
[blender.git] / source / blender / blenkernel / intern / font.c
index a7805d1f19a1d03461a612e59520337160a6b1cb..b3edeb67928355faa610ad118e8bb3c0598243d3 100644 (file)
@@ -101,9 +101,9 @@ void BKE_vfont_free(struct VFont *vf)
 static void *builtin_font_data = NULL;
 static int builtin_font_size = 0;
 
 static void *builtin_font_data = NULL;
 static int builtin_font_size = 0;
 
-int  BKE_vfont_is_builtin(struct VFont *vfont)
+bool BKE_vfont_is_builtin(struct VFont *vfont)
 {
 {
-       return (strcmp(vfont->name, FO_BUILTIN_NAME) == 0);
+       return STREQ(vfont->name, FO_BUILTIN_NAME);
 }
 
 void BKE_vfont_builtin_register(void *mem, int size)
 }
 
 void BKE_vfont_builtin_register(void *mem, int size)
@@ -188,18 +188,14 @@ VFont *BKE_vfont_load(Main *bmain, const char *name)
        PackedFile *temp_pf = NULL;
        int is_builtin;
        
        PackedFile *temp_pf = NULL;
        int is_builtin;
        
-       if (strcmp(name, FO_BUILTIN_NAME) == 0) {
+       if (STREQ(name, FO_BUILTIN_NAME)) {
                BLI_strncpy(filename, name, sizeof(filename));
                
                pf = get_builtin_packedfile();
                is_builtin = TRUE;
        }
        else {
                BLI_strncpy(filename, name, sizeof(filename));
                
                pf = get_builtin_packedfile();
                is_builtin = TRUE;
        }
        else {
-               char dir[FILE_MAXDIR];
-               
-               BLI_strncpy(dir, name, sizeof(dir));
-               BLI_splitdirstring(dir, filename);
-
+               BLI_split_file_part(name, filename, sizeof(filename));
                pf = newPackedFile(NULL, name, bmain->name);
                temp_pf = newPackedFile(NULL, name, bmain->name);
                
                pf = newPackedFile(NULL, name, bmain->name);
                temp_pf = newPackedFile(NULL, name, bmain->name);
                
@@ -671,7 +667,7 @@ makebreak:
 
                        yof -= linedist;
 
 
                        yof -= linedist;
 
-                       maxlen = maxf(maxlen, (xof - tb->x / cu->fsize));
+                       maxlen = max_ff(maxlen, (xof - tb->x / cu->fsize));
                        linedata[lnr] = xof - tb->x / cu->fsize;
                        linedata2[lnr] = cnr;
                        linedata3[lnr] = tb->w / cu->fsize;
                        linedata[lnr] = xof - tb->x / cu->fsize;
                        linedata2[lnr] = cnr;
                        linedata3[lnr] = tb->w / cu->fsize;
@@ -947,10 +943,13 @@ makebreak:
                        ct = chartransdata;
                        for (i = 0; i < slen; i++) {
                                if (ct->linenr == lnr) {
                        ct = chartransdata;
                        for (i = 0; i < slen; i++) {
                                if (ct->linenr == lnr) {
-                                       if (ct->charnr == cnr) break;
-                                       if ( (ct + 1)->charnr == 0) break;
+                                       if ((ct->charnr == cnr) || ((ct + 1)->charnr == 0)) {
+                                               break;
+                                       }
+                               }
+                               else if (ct->linenr > lnr) {
+                                       break;
                                }
                                }
-                               else if (ct->linenr > lnr) break;
                                cu->pos++;
                                ct++;
                        }
                                cu->pos++;
                                ct++;
                        }
@@ -962,9 +961,9 @@ makebreak:
                float si, co;
                
                ct = chartransdata + cu->pos;
                float si, co;
                
                ct = chartransdata + cu->pos;
-               si = (float)sin(ct->rot);
-               co = (float)cos(ct->rot);
-                               
+               si = sinf(ct->rot);
+               co = cosf(ct->rot);
+
                f = cu->editfont->textcurs[0];
                
                f[0] = cu->fsize * (-0.1f * co + ct->xof);
                f = cu->editfont->textcurs[0];
                
                f[0] = cu->fsize * (-0.1f * co + ct->xof);