--- deliantra/Deliantra-Client/Client.xs 2006/04/16 07:25:29 1.42 +++ deliantra/Deliantra-Client/Client.xs 2006/04/17 09:33:11 1.45 @@ -580,6 +580,19 @@ tex->a = a; } +int +ox (CFClient::Map self) + ALIAS: + oy = 1 + CODE: + switch (ix) + { + case 0: RETVAL = self->ox; break; + case 1: RETVAL = self->oy; break; + } + OUTPUT: + RETVAL + void scroll (CFClient::Map self, int dx, int dy) CODE: @@ -594,8 +607,8 @@ else if (dy < 0) map_blank (self, self->x, self->y + self->h + dy + 1, self->w, 1 - dy); - self->x += dx; self->ox += dx; - self->y += dy; self->oy += dy; + self->ox += dx; self->x += dx; + self->oy += dy; self->y += dy; while (self->y < 0) { @@ -606,26 +619,13 @@ } } -int -ox (CFClient::Map self) - ALIAS: - oy = 1 - CODE: - switch (ix) - { - case 0: RETVAL = self->ox; break; - case 1: RETVAL = self->oy; break; - } - OUTPUT: - RETVAL - void map1a_update (CFClient::Map self, SV *data_) CODE: { uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); uint8_t *data_end = (uint8_t *)SvEND (data_); - + while (data < data_end) { int flags = (data [0] << 8) + data [1]; data += 2; @@ -637,14 +637,14 @@ if (flags & 15) { - if (cell->darkness < 0) // && x < self->w && y < self->h) + if (cell->darkness < 0) { cell->darkness = 0; cell->face [0] = 0; cell->face [1] = 0; cell->face [2] = 0; } - + cell->darkness = flags & 8 ? *data++ : 255; //TODO: don't trust server data to be in-range(!)