ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.44 by root, Mon Apr 17 07:30:20 2006 UTC vs.
Revision 1.46 by root, Mon Apr 17 19:20:59 2006 UTC

47{ 47{
48 /* use a random scale factor to account for unknown descenders, 0.8 works 48 /* use a random scale factor to account for unknown descenders, 0.8 works
49 * reasonably well with bitstream vera 49 * reasonably well with bitstream vera
50 */ 50 */
51 PangoFontDescription *font = pango_context_get_font_description (context); 51 PangoFontDescription *font = pango_context_get_font_description (context);
52 pango_font_description_set_absolute_size (font, self->base_height * (PANGO_SCALE * 8 / 10)); 52
53 int height = self->base_height * (PANGO_SCALE * 8 / 10);
54
55 if (pango_font_description_get_size (font) != height)
56 {
57 pango_font_description_set_absolute_size (font, height);
58 pango_layout_context_changed (self->pl);
59 }
53} 60}
54 61
55static void 62static void
56layout_get_pixel_size (CFClient__Layout self, int *w, int *h) 63layout_get_pixel_size (CFClient__Layout self, int *w, int *h)
57{ 64{
391 char *text = SvPVutf8 (text_, textlen); 398 char *text = SvPVutf8 (text_, textlen);
392 399
393 pango_layout_set_markup (self->pl, text, textlen); 400 pango_layout_set_markup (self->pl, text, textlen);
394} 401}
395 402
403SV *
404get_text (CFClient::Layout self)
405 CODE:
406 RETVAL = newSVpv (pango_layout_get_text (self), 0);
407 SvUTF8_on (RETVAL);
408 OUTPUT:
409 RETVAL
410
396void 411void
397set_height (CFClient::Layout self, int base_height) 412set_height (CFClient::Layout self, int base_height)
398 CODE: 413 CODE:
399 self->base_height = base_height; 414 self->base_height = base_height;
400 415
635 650
636 mapcell *cell = map_get_cell (self, x, y); 651 mapcell *cell = map_get_cell (self, x, y);
637 652
638 if (flags & 15) 653 if (flags & 15)
639 { 654 {
640 if (cell->darkness < 0) // && x < self->w && y < self->h) 655 if (cell->darkness < 0)
641 { 656 {
642 cell->darkness = 0; 657 cell->darkness = 0;
643 cell->face [0] = 0; 658 cell->face [0] = 0;
644 cell->face [1] = 0; 659 cell->face [1] = 0;
645 cell->face [2] = 0; 660 cell->face [2] = 0;
646 } 661 }
647 662
648 cell->darkness = flags & 8 ? *data++ : 255; 663 cell->darkness = flags & 8 ? *data++ : 255;
649 664
650 //TODO: don't trust server data to be in-range(!) 665 //TODO: don't trust server data to be in-range(!)
651 666
652 if (flags & 4) 667 if (flags & 4)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines