--- deliantra/Deliantra-Client/Client.xs 2006/04/17 06:50:26 1.43 +++ deliantra/Deliantra-Client/Client.xs 2006/04/17 21:52:42 1.47 @@ -49,7 +49,14 @@ * reasonably well with bitstream vera */ PangoFontDescription *font = pango_context_get_font_description (context); - pango_font_description_set_absolute_size (font, self->base_height * (PANGO_SCALE * 8 / 10)); + + int height = self->base_height * (PANGO_SCALE * 8 / 10); + + if (pango_font_description_get_size (font) != height) + { + pango_font_description_set_absolute_size (font, height); + pango_layout_context_changed (self->pl); + } } static void @@ -85,7 +92,6 @@ typedef struct map { int x, y, w, h; - int dx, dy; /* delayed map scrolling */ int ox, oy; /* offset to virtual global coordinate system */ int faces; mapface *face; @@ -394,6 +400,14 @@ pango_layout_set_markup (self->pl, text, textlen); } +SV * +get_text (CFClient::Layout self) + CODE: + RETVAL = newSVpv (pango_layout_get_text (self->pl), 0); + SvUTF8_on (RETVAL); + OUTPUT: + RETVAL + void set_height (CFClient::Layout self, int base_height) CODE: @@ -598,26 +612,18 @@ scroll (CFClient::Map self, int dx, int dy) CODE: { - self->dx += dx; self->ox += dx; - self->dy += dy; self->oy += dy; -} - -void -map1a_update (CFClient::Map self, SV *data_) - CODE: -{ - if (self->dx > 0) - map_blank (self, self->x, self->y, self->dx - 1, self->h); - else if (self->dx < 0) - map_blank (self, self->x + self->w + self->dx + 1, self->y, 1 - self->dx, self->h); - - if (self->dy > 0) - map_blank (self, self->x, self->y, self->w, self->dy - 1); - else if (self->dy < 0) - map_blank (self, self->x, self->y + self->h + self->dy + 1, self->w, 1 - self->dy); + if (dx > 0) + map_blank (self, self->x, self->y, dx - 1, self->h); + else if (dx < 0) + map_blank (self, self->x + self->w + dx + 1, self->y, 1 - dx, self->h); + + if (dy > 0) + map_blank (self, self->x, self->y, self->w, dy - 1); + else if (dy < 0) + map_blank (self, self->x, self->y + self->h + dy + 1, self->w, 1 - dy); - self->x += self->dx; self->dx = 0; - self->y += self->dy; self->dy = 0; + self->ox += dx; self->x += dx; + self->oy += dy; self->y += dy; while (self->y < 0) { @@ -626,7 +632,12 @@ self->rows += MAP_EXTEND_Y; self->y += MAP_EXTEND_Y; } +} +void +map1a_update (CFClient::Map self, SV *data_) + CODE: +{ uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); uint8_t *data_end = (uint8_t *)SvEND (data_); @@ -641,14 +652,14 @@ if (flags & 15) { - if (cell->darkness < 0) // && x < self->w && y < self->h) + if (cell->darkness < 0) { cell->darkness = 0; cell->face [0] = 0; cell->face [1] = 0; cell->face [2] = 0; } - + cell->darkness = flags & 8 ? *data++ : 255; //TODO: don't trust server data to be in-range(!)