--- deliantra/Deliantra-Client/Client.xs 2006/04/13 23:42:14 1.33 +++ deliantra/Deliantra-Client/Client.xs 2006/04/14 14:55:27 1.37 @@ -39,7 +39,7 @@ substitute_func (FcPattern *pattern, gpointer data) { FcPatternAddBool (pattern, FC_HINTING , 1); - FcPatternAddBool (pattern, FC_AUTOHINT, 1); + FcPatternAddBool (pattern, FC_AUTOHINT, 0); } static void @@ -287,6 +287,16 @@ Safefree (self); void +set_text (CFClient::Layout self, SV *text_) + CODE: +{ + STRLEN textlen; + char *text = SvPVutf8 (text_, textlen); + + pango_layout_set_text (self->pl, text, textlen); +} + +void set_markup (CFClient::Layout self, SV *text_) CODE: { @@ -383,14 +393,15 @@ MODULE = CFClient PACKAGE = CFClient::Texture void -draw_quad (SV *self, double x, double y, double w = 0, double h = 0) +draw_quad (SV *self, float x, float y, float w = 0, float h = 0) PROTOTYPE: $$$;$$ CODE: { HV *hv = (HV *)SvRV (self); - double s = SvNV (*hv_fetch (hv, "s", 1, 1)); - double t = SvNV (*hv_fetch (hv, "t", 1, 1)); + float s = SvNV (*hv_fetch (hv, "s", 1, 1)); + float t = SvNV (*hv_fetch (hv, "t", 1, 1)); int name = SvIV (*hv_fetch (hv, "name", 4, 1)); + int wrap_mode = SvIV (*hv_fetch (hv, "wrap_mode", 9, 1)); if (items < 5) { @@ -399,11 +410,15 @@ } glBindTexture (GL_TEXTURE_2D, name); + if (wrap_mode) { + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + } glBegin (GL_QUADS); - glTexCoord2d (0, 0); glVertex2d (x , y ); - glTexCoord2d (0, t); glVertex2d (x , y + h); - glTexCoord2d (s, t); glVertex2d (x + w, y + h); - glTexCoord2d (s, 0); glVertex2d (x + w, y ); + glTexCoord2f (0, 0); glVertex2f (x , y ); + glTexCoord2f (0, t); glVertex2f (x , y + h); + glTexCoord2f (s, t); glVertex2f (x + w, y + h); + glTexCoord2f (s, 0); glVertex2f (x + w, y ); glEnd (); } @@ -570,7 +585,7 @@ { int sw4 = (sw + 3) & ~3; SV *darkness_sv = sv_2mortal (newSV (sw4 * sh)); - uint8_t *darkness = SvPVX (darkness_sv); + uint8_t *darkness = (uint8_t *)SvPVX (darkness_sv); SvPOK_only (darkness_sv); SvCUR_set (darkness_sv, sw4 * sh); @@ -638,12 +653,12 @@ glEnd (); + glDisable (GL_TEXTURE_2D); + glDisable (GL_BLEND); + EXTEND (SP, 3); PUSHs (sv_2mortal (newSViv (sw4))); PUSHs (sv_2mortal (newSViv (sh))); PUSHs (darkness_sv); - - glDisable (GL_TEXTURE_2D); - glDisable (GL_BLEND); }