--- deliantra/Deliantra-Client/rendercache.c 2007/08/12 12:14:01 1.6 +++ deliantra/Deliantra-Client/rendercache.c 2008/01/13 08:31:45 1.9 @@ -1,7 +1,7 @@ typedef struct { GLenum mode; GLenum format; // 0, GL_T2F_V3F, GL_V2F - GLint texname; + GLuint texname; unsigned char r, g, b, a; } rc_key_t; @@ -12,7 +12,7 @@ typedef SV rc_array_t; static rc_t * -rc_alloc () +rc_alloc (void) { rc_t *rc = g_slice_new0 (rc_t); rc->hv = newHV (); @@ -78,24 +78,27 @@ static void rc_glyph (rc_array_t *arr, int u, int v, int w, int h, int x, int y) { - U8 *c; - STRLEN len = SvCUR (arr); - SvGROW (arr, len + 2 * 2 + 1 * 4); - c = (U8 *)SvEND (arr); - - x += w; - y += h; - - *c++ = u; - *c++ = v; - *c++ = w; - *c++ = h; - - // use ber-encoding for up to 14 bits (16k) - *c = 0x80 | (x >> 7); c += (x >> 7) ? 1 : 0; *c++ = x & 0x7f; - *c = 0x80 | (y >> 7); c += (y >> 7) ? 1 : 0; *c++ = y & 0x7f; + if (w && h) + { + U8 *c; + STRLEN len = SvCUR (arr); + SvGROW (arr, len + 2 * 2 + 1 * 4); + c = (U8 *)SvEND (arr); + + x += w; + y += h; + + *c++ = u; + *c++ = v; + *c++ = w; + *c++ = h; + + // use ber-encoding for up to 14 bits (16k) + *c = 0x80 | (x >> 7); c += (x >> 7) ? 1 : 0; *c++ = x & 0x7f; + *c = 0x80 | (y >> 7); c += (y >> 7) ? 1 : 0; *c++ = y & 0x7f; - SvCUR_set (arr, c - (U8 *)SvPVX (arr)); + SvCUR_set (arr, c - (U8 *)SvPVX (arr)); + } } static void