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.133 by root, Sun Jul 30 13:16:44 2006 UTC vs.
Revision 1.139 by root, Mon Aug 14 03:04:17 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 rect.width = (rect.width + 3) & ~3;
161
162 *w = rect.width;
163 *h = rect.height;
155} 164}
156 165
157typedef uint16_t mapface; 166typedef uint16_t mapface;
158 167
159typedef struct { 168typedef struct {
512 SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0); 521 SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0);
513 SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE, 0); 522 SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE, 0);
514 SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0); 523 SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0);
515 524
516 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); 525 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
526#if SDL_VERSION_ATLEAST(1,2,10)
517 SDL_GL_SetAttribute (SDL_GL_ACCELERATED_VISUAL, 1); 527 SDL_GL_SetAttribute (SDL_GL_ACCELERATED_VISUAL, 1);
518 SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1); 528 SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1);
529#endif
519 530
520 SDL_EnableUNICODE (1); 531 SDL_EnableUNICODE (1);
521 SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); 532 SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
522 533
523 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); 534 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL);
1023 PUSHs (sv_2mortal (newSViv (strong_pos.y / PANGO_SCALE))); 1034 PUSHs (sv_2mortal (newSViv (strong_pos.y / PANGO_SCALE)));
1024 PUSHs (sv_2mortal (newSViv (strong_pos.height / PANGO_SCALE))); 1035 PUSHs (sv_2mortal (newSViv (strong_pos.height / PANGO_SCALE)));
1025} 1036}
1026 1037
1027void 1038void
1028render (CFPlus::Layout self, float x, float y) 1039render (CFPlus::Layout self, float x, float y, int flags = 0)
1029 PPCODE: 1040 PPCODE:
1030 pango_opengl_render_layout_subpixel ( 1041 pango_opengl_render_layout_subpixel (
1031 self->pl, 1042 self->pl,
1032 x * PANGO_SCALE, y * PANGO_SCALE, 1043 x * PANGO_SCALE, y * PANGO_SCALE,
1033 self->r, self->g, self->b, self->a 1044 self->r, self->g, self->b, self->a,
1045 flags
1034 ); 1046 );
1035 1047
1036MODULE = CFPlus PACKAGE = CFPlus::Texture 1048MODULE = CFPlus PACKAGE = CFPlus::Texture
1037 1049
1038void 1050void
1800 const_iv (GL_SEPARABLE_2D), 1812 const_iv (GL_SEPARABLE_2D),
1801 const_iv (GL_CONVOLUTION_2D), 1813 const_iv (GL_CONVOLUTION_2D),
1802 const_iv (GL_CONVOLUTION_BORDER_MODE), 1814 const_iv (GL_CONVOLUTION_BORDER_MODE),
1803 const_iv (GL_CONSTANT_BORDER), 1815 const_iv (GL_CONSTANT_BORDER),
1804 const_iv (GL_LINES), 1816 const_iv (GL_LINES),
1817 const_iv (GL_LINE_STRIP),
1805 const_iv (GL_LINE_LOOP), 1818 const_iv (GL_LINE_LOOP),
1806 const_iv (GL_QUADS), 1819 const_iv (GL_QUADS),
1807 const_iv (GL_QUAD_STRIP), 1820 const_iv (GL_QUAD_STRIP),
1808 const_iv (GL_TRIANGLES), 1821 const_iv (GL_TRIANGLES),
1809 const_iv (GL_TRIANGLE_STRIP), 1822 const_iv (GL_TRIANGLE_STRIP),
2006 2019
2007void glEndList () 2020void glEndList ()
2008 2021
2009void glCallList (int list) 2022void glCallList (int list)
2010 2023
2011

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines