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.134 by root, Fri Aug 4 16:49:58 2006 UTC vs.
Revision 1.140 by root, Mon Aug 14 03:41:25 2006 UTC

144} 144}
145 145
146static void 146static void
147layout_get_pixel_size (CFPlus__Layout self, int *w, int *h) 147layout_get_pixel_size (CFPlus__Layout self, int *w, int *h)
148{ 148{
149 PangoRectangle rect;
150
151 // get_pixel_* wrongly rounds down
149 pango_layout_get_pixel_size (self->pl, w, h); 152 pango_layout_get_extents (self->pl, 0, &rect);
150 153
151 if (!*w) *w = 1; 154 rect.width = (rect.width + PANGO_SCALE - 1) / PANGO_SCALE;
152 if (!*h) *h = 1; 155 rect.height = (rect.height + PANGO_SCALE - 1) / PANGO_SCALE;
153 156
154 *w = (*w + 3) & ~3; 157 if (!rect.width) rect.width = 1;
158 if (!rect.height) rect.height = 1;
159
160 *w = rect.width;
161 *h = rect.height;
155} 162}
156 163
157typedef uint16_t mapface; 164typedef uint16_t mapface;
158 165
159typedef struct { 166typedef struct {
1025 PUSHs (sv_2mortal (newSViv (strong_pos.y / PANGO_SCALE))); 1032 PUSHs (sv_2mortal (newSViv (strong_pos.y / PANGO_SCALE)));
1026 PUSHs (sv_2mortal (newSViv (strong_pos.height / PANGO_SCALE))); 1033 PUSHs (sv_2mortal (newSViv (strong_pos.height / PANGO_SCALE)));
1027} 1034}
1028 1035
1029void 1036void
1030render (CFPlus::Layout self, float x, float y) 1037render (CFPlus::Layout self, float x, float y, int flags = 0)
1031 PPCODE: 1038 PPCODE:
1032 pango_opengl_render_layout_subpixel ( 1039 pango_opengl_render_layout_subpixel (
1033 self->pl, 1040 self->pl,
1034 x * PANGO_SCALE, y * PANGO_SCALE, 1041 x * PANGO_SCALE, y * PANGO_SCALE,
1035 self->r, self->g, self->b, self->a 1042 self->r, self->g, self->b, self->a,
1043 flags
1036 ); 1044 );
1037 1045
1038MODULE = CFPlus PACKAGE = CFPlus::Texture 1046MODULE = CFPlus PACKAGE = CFPlus::Texture
1039 1047
1040void 1048void
1802 const_iv (GL_SEPARABLE_2D), 1810 const_iv (GL_SEPARABLE_2D),
1803 const_iv (GL_CONVOLUTION_2D), 1811 const_iv (GL_CONVOLUTION_2D),
1804 const_iv (GL_CONVOLUTION_BORDER_MODE), 1812 const_iv (GL_CONVOLUTION_BORDER_MODE),
1805 const_iv (GL_CONSTANT_BORDER), 1813 const_iv (GL_CONSTANT_BORDER),
1806 const_iv (GL_LINES), 1814 const_iv (GL_LINES),
1815 const_iv (GL_LINE_STRIP),
1807 const_iv (GL_LINE_LOOP), 1816 const_iv (GL_LINE_LOOP),
1808 const_iv (GL_QUADS), 1817 const_iv (GL_QUADS),
1809 const_iv (GL_QUAD_STRIP), 1818 const_iv (GL_QUAD_STRIP),
1810 const_iv (GL_TRIANGLES), 1819 const_iv (GL_TRIANGLES),
1811 const_iv (GL_TRIANGLE_STRIP), 1820 const_iv (GL_TRIANGLE_STRIP),
2008 2017
2009void glEndList () 2018void glEndList ()
2010 2019
2011void glCallList (int list) 2020void glCallList (int list)
2012 2021
2013

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines