--- deliantra/Deliantra-Client/Client.xs 2006/06/15 15:33:57 1.117 +++ deliantra/Deliantra-Client/Client.xs 2006/06/18 19:13:19 1.120 @@ -1235,8 +1235,8 @@ { flags = (data [0] << 8) + data [1]; data += 2; - x = ((flags >> 10) & 63) + self->x; - y = ((flags >> 4) & 63) + self->y; + x = self->x + ((flags >> 10) & 63); + y = self->y + ((flags >> 4) & 63); cell = map_get_cell (self, x, y); @@ -1343,8 +1343,8 @@ int last_name; mapface face; - vx = self->x + (self->w - sw + 1) / 2 - shift_x; - vy = self->y + (self->h - sh + 1) / 2 - shift_y; + vx = self->x + self->w / 2 - sw / 2 - shift_x; + vy = self->y + self->h / 2 - sh / 2 - shift_y; /* int vx = self->vx = self->w >= sw @@ -1449,16 +1449,19 @@ { unsigned char m = data [x + y * w]; - float *c = color [m & 15]; - - float tx1 = m & 0x40 ? 0.5 : m & 0x80 ? 0.25 : 0.; - float tx2 = tx1 + 0.25; - - glColor4f (c[0], c[1], c[2], 0.75); - glTexCoord2f (tx1, 0.); glVertex2i (x , y ); - glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); - glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); - glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); + if (m) + { + float *c = color [m & 15]; + + float tx1 = m & 0x40 ? 0.5 : 0.; + float tx2 = tx1 + 0.5; + + glColor4f (c[0], c[1], c[2], 0.75); + glTexCoord2f (tx1, 0.); glVertex2i (x , y ); + glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); + glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); + glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); + } } glEnd (); @@ -1714,6 +1717,8 @@ const_iv (GL_ALPHA_TEST), const_iv (GL_NORMALIZE), const_iv (GL_RESCALE_NORMAL), + const_iv (GL_FRONT), + const_iv (GL_BACK), const_iv (GL_AND), const_iv (GL_ONE), const_iv (GL_ZERO), @@ -1845,6 +1850,10 @@ void glLoadIdentity () +void glDrawBuffer (int buffer) + +void glReadBuffer (int buffer) + # near_ and far_ are due to microsofts buggy "c" compiler void glFrustum (double left, double right, double bottom, double top, double near_, double far_)