--- deliantra/Deliantra-Client/Client.xs 2006/04/14 11:32:21 1.36 +++ deliantra/Deliantra-Client/Client.xs 2006/04/14 23:32:28 1.38 @@ -393,13 +393,13 @@ 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)); @@ -415,10 +415,10 @@ 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 (); } @@ -580,7 +580,7 @@ } void -draw (CFClient::Map self, int x0, int y0, int sw, int sh) +draw (CFClient::Map self, int shift_x, int shift_y, int x0, int y0, int sw, int sh) PPCODE: { int sw4 = (sw + 3) & ~3; @@ -590,13 +590,19 @@ SvPOK_only (darkness_sv); SvCUR_set (darkness_sv, sw4 * sh); - int vx = self->vx = self->w >= sw - ? self->x + (self->w - sw) / 2 - : MIN (self->x, MAX (self->x + self->w - sw + 1, self->vx)); - - int vy = self->vy = self->h >= sh - ? self->y + (self->h - sh) / 2 - : MIN (self->y, MAX (self->y + self->h - sh + 1, self->vy)); + int vx = self->x + (self->w - sw) / 2 - shift_x; + int vy = self->y + (self->h - sh) / 2 - shift_y; + + if (0) + { + int vx = self->vx = self->w >= sw + ? self->x + (self->w - sw) / 2 + : MIN (self->x, MAX (self->x + self->w - sw + 1, self->vx)); + + int vy = self->vy = self->h >= sh + ? self->y + (self->h - sh) / 2 + : MIN (self->y, MAX (self->y + self->h - sh + 1, self->vy)); + } glColor4ub (255, 255, 255, 255);