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.54 by root, Wed Apr 19 23:37:48 2006 UTC vs.
Revision 1.55 by root, Thu Apr 20 08:11:56 2006 UTC

933 cell->darkness = -1; 933 cell->darkness = -1;
934 } 934 }
935} 935}
936 936
937SV * 937SV *
938mapmap (CFClient::Map self, int w, int h) 938mapmap (CFClient::Map self, int x0, int y0, int w, int h)
939 CODE: 939 CODE:
940{ 940{
941 int x0, x1, x; 941 int x1, x;
942 int y0, y1, y; 942 int y1, y;
943 int z; 943 int z;
944 SV *map_sv = newSV (w * h * sizeof (uint32_t)); 944 SV *map_sv = newSV (w * h * sizeof (uint32_t));
945 uint32_t *map = (uint32_t *)SvPVX (map_sv); 945 uint32_t *map = (uint32_t *)SvPVX (map_sv);
946 946
947 SvPOK_only (map_sv); 947 SvPOK_only (map_sv);
948 SvCUR_set (map_sv, w * h * sizeof (uint32_t)); 948 SvCUR_set (map_sv, w * h * sizeof (uint32_t));
949 949
950 x0 = self->x - w / 2; x1 = x0 + w; 950 x0 += self->x; x1 = x0 + w;
951 y0 = self->y - h / 2; y1 = y0 + h; 951 y0 += self->y; y1 = y0 + h;
952 952
953 for (y = y0; y < y1; y++) 953 for (y = y0; y < y1; y++)
954 { 954 {
955 maprow *row = 0 <= y && y < self->rows 955 maprow *row = 0 <= y && y < self->rows
956 ? self->row + y 956 ? self->row + y
1096 *data++ = 0; /* version 0 format */ 1096 *data++ = 0; /* version 0 format */
1097 *data++ = w >> 8; *data++ = w; 1097 *data++ = w >> 8; *data++ = w;
1098 *data++ = h >> 8; *data++ = h; 1098 *data++ = h >> 8; *data++ = h;
1099 1099
1100 // we need to do this 'cause we don't keep an absolute coord system for rows 1100 // we need to do this 'cause we don't keep an absolute coord system for rows
1101 // TODO: treat rows as we treat 1101 // TODO: treat rows as we treat columns
1102 map_get_row (self, y0 + self->y - self->oy);//D 1102 map_get_row (self, y0 + self->y - self->oy);//D
1103 map_get_row (self, y0 + self->y - self->oy + h - 1);//D 1103 map_get_row (self, y0 + self->y - self->oy + h - 1);//D
1104 1104
1105 x0 += self->x - self->ox; 1105 x0 += self->x - self->ox;
1106 y0 += self->y - self->oy; 1106 y0 += self->y - self->oy;
1170 1170
1171 w = *data++ << 8; w |= *data++; 1171 w = *data++ << 8; w |= *data++;
1172 h = *data++ << 8; h |= *data++; 1172 h = *data++ << 8; h |= *data++;
1173 1173
1174 // we need to do this 'cause we don't keep an absolute coord system for rows 1174 // we need to do this 'cause we don't keep an absolute coord system for rows
1175 // TODO: treat rows as we treat 1175 // TODO: treat rows as we treat columns
1176 map_get_row (self, y0 + self->y - self->oy);//D 1176 map_get_row (self, y0 + self->y - self->oy);//D
1177 map_get_row (self, y0 + self->y - self->oy + h - 1);//D 1177 map_get_row (self, y0 + self->y - self->oy + h - 1);//D
1178 1178
1179 x0 += self->x - self->ox; 1179 x0 += self->x - self->ox;
1180 y0 += self->y - self->oy; 1180 y0 += self->y - self->oy;
1319 const_iv (GL_CONVOLUTION_2D), 1319 const_iv (GL_CONVOLUTION_2D),
1320 const_iv (GL_CONVOLUTION_BORDER_MODE), 1320 const_iv (GL_CONVOLUTION_BORDER_MODE),
1321 const_iv (GL_CONSTANT_BORDER), 1321 const_iv (GL_CONSTANT_BORDER),
1322 const_iv (GL_LINES), 1322 const_iv (GL_LINES),
1323 const_iv (GL_QUADS), 1323 const_iv (GL_QUADS),
1324 const_iv (GL_LINE_LOOP),
1324 const_iv (GL_PERSPECTIVE_CORRECTION_HINT), 1325 const_iv (GL_PERSPECTIVE_CORRECTION_HINT),
1325 const_iv (GL_FASTEST), 1326 const_iv (GL_FASTEST),
1326# undef const_iv 1327# undef const_iv
1327 }; 1328 };
1328 1329

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines