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.42 by root, Sun Apr 16 07:25:29 2006 UTC vs.
Revision 1.44 by root, Mon Apr 17 07:30:20 2006 UTC

578 tex->g = g; 578 tex->g = g;
579 tex->b = b; 579 tex->b = b;
580 tex->a = a; 580 tex->a = a;
581} 581}
582 582
583void
584scroll (CFClient::Map self, int dx, int dy)
585 CODE:
586{
587 if (dx > 0)
588 map_blank (self, self->x, self->y, dx - 1, self->h);
589 else if (dx < 0)
590 map_blank (self, self->x + self->w + dx + 1, self->y, 1 - dx, self->h);
591
592 if (dy > 0)
593 map_blank (self, self->x, self->y, self->w, dy - 1);
594 else if (dy < 0)
595 map_blank (self, self->x, self->y + self->h + dy + 1, self->w, 1 - dy);
596
597 self->x += dx; self->ox += dx;
598 self->y += dy; self->oy += dy;
599
600 while (self->y < 0)
601 {
602 Prepend (maprow, self->row, self->rows, MAP_EXTEND_Y);
603
604 self->rows += MAP_EXTEND_Y;
605 self->y += MAP_EXTEND_Y;
606 }
607}
608
609int 583int
610ox (CFClient::Map self) 584ox (CFClient::Map self)
611 ALIAS: 585 ALIAS:
612 oy = 1 586 oy = 1
613 CODE: 587 CODE:
618 } 592 }
619 OUTPUT: 593 OUTPUT:
620 RETVAL 594 RETVAL
621 595
622void 596void
597scroll (CFClient::Map self, int dx, int dy)
598 CODE:
599{
600 if (dx > 0)
601 map_blank (self, self->x, self->y, dx - 1, self->h);
602 else if (dx < 0)
603 map_blank (self, self->x + self->w + dx + 1, self->y, 1 - dx, self->h);
604
605 if (dy > 0)
606 map_blank (self, self->x, self->y, self->w, dy - 1);
607 else if (dy < 0)
608 map_blank (self, self->x, self->y + self->h + dy + 1, self->w, 1 - dy);
609
610 self->ox += dx; self->x += dx;
611 self->oy += dy; self->y += dy;
612
613 while (self->y < 0)
614 {
615 Prepend (maprow, self->row, self->rows, MAP_EXTEND_Y);
616
617 self->rows += MAP_EXTEND_Y;
618 self->y += MAP_EXTEND_Y;
619 }
620}
621
622void
623map1a_update (CFClient::Map self, SV *data_) 623map1a_update (CFClient::Map self, SV *data_)
624 CODE: 624 CODE:
625{ 625{
626 uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); 626 uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_);
627 uint8_t *data_end = (uint8_t *)SvEND (data_); 627 uint8_t *data_end = (uint8_t *)SvEND (data_);
628 628
629 while (data < data_end) 629 while (data < data_end)
630 { 630 {
631 int flags = (data [0] << 8) + data [1]; data += 2; 631 int flags = (data [0] << 8) + data [1]; data += 2;
632 632
633 int x = ((flags >> 10) & 63) + self->x; 633 int x = ((flags >> 10) & 63) + self->x;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines