--- deliantra/Deliantra-Client/Client.xs 2006/08/13 16:29:36 1.136 +++ deliantra/Deliantra-Client/Client.xs 2006/08/18 01:01:00 1.141 @@ -146,12 +146,19 @@ static void layout_get_pixel_size (CFPlus__Layout self, int *w, int *h) { - pango_layout_get_pixel_size (self->pl, w, h); + PangoRectangle rect; - if (!*w) *w = 1; - if (!*h) *h = 1; + // get_pixel_* wrongly rounds down + pango_layout_get_extents (self->pl, 0, &rect); - *w = (*w + 3) & ~3; + rect.width = (rect.width + PANGO_SCALE - 1) / PANGO_SCALE; + rect.height = (rect.height + PANGO_SCALE - 1) / PANGO_SCALE; + + if (!rect.width) rect.width = 1; + if (!rect.height) rect.height = 1; + + *w = rect.width; + *h = rect.height; } typedef uint16_t mapface; @@ -1255,7 +1262,7 @@ } void -map1a_update (CFPlus::Map self, SV *data_) +map1a_update (CFPlus::Map self, SV *data_, int extmap) CODE: { uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); @@ -1282,7 +1289,29 @@ cell->face [2] = 0; } - cell->darkness = flags & 8 ? *data++ : 255; + if (flags & 8) + { + fprintf (stderr, "oi\n");//D + if (extmap) + { + uint8_t ext, cmd; + + do + { + + ext = *data++; + cmd = ext & 0x7f; + + fprintf (stderr, "extcmd = %x\n", ext);//D + + if (ext < 4) + cell->darkness = 255 - ext * 64; + } + while (cmd & 0x80); + } + else + cell->darkness = flags & 8 ? *data++ : 255; + } //TODO: don't trust server data to be in-range(!) @@ -1805,6 +1834,7 @@ const_iv (GL_CONVOLUTION_BORDER_MODE), const_iv (GL_CONSTANT_BORDER), const_iv (GL_LINES), + const_iv (GL_LINE_STRIP), const_iv (GL_LINE_LOOP), const_iv (GL_QUADS), const_iv (GL_QUAD_STRIP), @@ -2011,13 +2041,3 @@ void glCallList (int list) -int glX () - CODE: - GLdouble m[4][4]; - glGetDoublev (GL_MODELVIEW_MATRIX, m); - printf ("%f %f %f %f\n", m[0][0], m[0][1], m[0][2], m[0][3]); - printf ("%f %f %f %f\n", m[1][0], m[1][1], m[1][2], m[1][3]); - printf ("%f %f %f %f\n", m[2][0], m[2][1], m[2][2], m[2][3]); - printf ("%f %f %f %f\n", m[3][0], m[3][1], m[3][2], m[3][3]); - printf ("\n"); -