comparison gui/mplayer/gui_common.c @ 32969:ad1a232df994

Make slabel work. It is amazing that so far no skin is using a slabel (static label), but the reason is quite simple. Former versions of the GUI crashed when rendering a slabel. The current GUI recognizes the malloc error but can't render the slabel due to (probable) lack of memory. An item that shall be fnt-rendered must have a valid item width. Additionally, a break was missing which caused a slabel that would have been already handled to erroneously run through the dlabel handling as well.
author ib
date Tue, 08 Mar 2011 15:29:19 +0000
parents 1fa7a299b1b4
children 3673c28ce811
comparison
equal deleted inserted replaced
32968:1fa7a299b1b4 32969:ad1a232df994
429 PutImage(&item->Bitmap, item->x, item->y, item->numphases, item->numphases * (1.0f - item->value / 100.0f)); 429 PutImage(&item->Bitmap, item->x, item->y, item->numphases, item->numphases * (1.0f - item->value / 100.0f));
430 PutImage(&item->Mask, item->x, item->y + (item->height - item->pheight) * (1.0f - item->value / 100.0f), 3, ofs); 430 PutImage(&item->Mask, item->x, item->y + (item->height - item->pheight) * (1.0f - item->value / 100.0f), 3, ofs);
431 break; 431 break;
432 432
433 case itSLabel: 433 case itSLabel:
434 if (item->width == -1)
435 item->width = fntTextWidth(item->fontid, item->label);
434 image = fntRender(item, 0, item->label); 436 image = fntRender(item, 0, item->label);
435 if (image) 437 if (image)
436 PutImage(image, item->x, item->y, 1, 0); 438 PutImage(image, item->x, item->y, 1, 0);
439 break;
437 440
438 case itDLabel: 441 case itDLabel:
439 { 442 {
440 int x; 443 int x;
441 unsigned int d; 444 unsigned int d;