src/gfx.cpp
branchnoai
changeset 9566 9936b201d53f
parent 9545 179f651eb116
child 6719 4cc327ad39d5
child 6974 24490c839582
child 9601 b499fdd106d5
equal deleted inserted replaced
9565:7237786c6197 9566:9936b201d53f
   546 	num = GB(tmp, 0, 16);
   546 	num = GB(tmp, 0, 16);
   547 
   547 
   548 	mt = GetCharacterHeight((FontSize)GB(tmp, 16, 16));
   548 	mt = GetCharacterHeight((FontSize)GB(tmp, 16, 16));
   549 	total_height = (num + 1) * mt;
   549 	total_height = (num + 1) * mt;
   550 
   550 
   551 	if (maxh != -1 && total_height > (uint)maxh) {
   551 	if (maxh != -1 && (int)total_height > maxh) {
       
   552 		/* Check there's room enough for at least one line. */
       
   553 		if (maxh < mt) return 0;
       
   554 
   552 		num = maxh / mt - 1;
   555 		num = maxh / mt - 1;
   553 		if (num < 1) return 0;
       
   554 
       
   555 		total_height = (num + 1) * mt;
   556 		total_height = (num + 1) * mt;
   556 	}
   557 	}
   557 
   558 
   558 	src = buffer;
   559 	src = buffer;
   559 
   560