comparison libass/ass_render.c @ 23175:55a6114fd7d6

Minor code simplification.
author eugeni
date Tue, 01 May 2007 15:21:34 +0000
parents 29b5596adecd
children 134a2baca452
comparison
equal deleted inserted replaced
23174:29b5596adecd 23175:55a6114fd7d6
392 bitmap_hash_val_t hash_val; 392 bitmap_hash_val_t hash_val;
393 ass_image_t* head; 393 ass_image_t* head;
394 ass_image_t** tail = &head; 394 ass_image_t** tail = &head;
395 395
396 for (i = 0; i < text_info->length; ++i) { 396 for (i = 0; i < text_info->length; ++i) {
397 if (text_info->glyphs[i].glyph && text_info->glyphs[i].bm == 0) { 397 glyph_info_t* info = text_info->glyphs + i;
398 if ((text_info->glyphs[i].symbol == '\n') || (text_info->glyphs[i].symbol == 0)) 398 if (info->glyph && info->bm == 0) {
399 if ((info->symbol == '\n') || (info->symbol == 0))
399 continue; 400 continue;
400 error = glyph_to_bitmap(ass_renderer->synth_priv, 401 error = glyph_to_bitmap(ass_renderer->synth_priv,
401 text_info->glyphs[i].glyph, text_info->glyphs[i].outline_glyph, 402 info->glyph, info->outline_glyph,
402 &text_info->glyphs[i].bm, &text_info->glyphs[i].bm_o, 403 &info->bm, &info->bm_o,
403 &text_info->glyphs[i].bm_s, text_info->glyphs[i].be); 404 &info->bm_s, info->be);
404 if (error) 405 if (error)
405 text_info->glyphs[i].symbol = 0; 406 info->symbol = 0;
406 407
407 // cache 408 // cache
408 hash_val.bm_o = text_info->glyphs[i].bm_o; 409 hash_val.bm_o = info->bm_o;
409 hash_val.bm = text_info->glyphs[i].bm; 410 hash_val.bm = info->bm;
410 hash_val.bm_s = text_info->glyphs[i].bm_s; 411 hash_val.bm_s = info->bm_s;
411 cache_add_bitmap(&(text_info->glyphs[i].hash_key), &hash_val); 412 cache_add_bitmap(&(info->hash_key), &hash_val);
412 } 413 }
413 } 414 }
414 415
415 for (i = 0; i < text_info->length; ++i) { 416 for (i = 0; i < text_info->length; ++i) {
416 if (text_info->glyphs[i].glyph) 417 glyph_info_t* info = text_info->glyphs + i;
417 FT_Done_Glyph(text_info->glyphs[i].glyph); 418 if (info->glyph)
418 if (text_info->glyphs[i].outline_glyph) 419 FT_Done_Glyph(info->glyph);
419 FT_Done_Glyph(text_info->glyphs[i].outline_glyph); 420 if (info->outline_glyph)
421 FT_Done_Glyph(info->outline_glyph);
420 } 422 }
421 423
422 for (i = 0; i < text_info->length; ++i) { 424 for (i = 0; i < text_info->length; ++i) {
423 glyph_info_t* info = text_info->glyphs + i; 425 glyph_info_t* info = text_info->glyphs + i;
424 if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm_s || (info->shadow == 0)) 426 if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm_s || (info->shadow == 0))