--- deliantra/Deliantra-Client/Client.xs 2006/08/14 03:04:17 1.139 +++ deliantra/Deliantra-Client/Client.xs 2006/08/18 01:01:00 1.141 @@ -157,8 +157,6 @@ if (!rect.width) rect.width = 1; if (!rect.height) rect.height = 1; - rect.width = (rect.width + 3) & ~3; - *w = rect.width; *h = rect.height; } @@ -1264,7 +1262,7 @@ } void -map1a_update (CFPlus::Map self, SV *data_) +map1a_update (CFPlus::Map self, SV *data_, int extmap) CODE: { uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); @@ -1291,7 +1289,29 @@ cell->face [2] = 0; } - cell->darkness = flags & 8 ? *data++ : 255; + if (flags & 8) + { + fprintf (stderr, "oi\n");//D + if (extmap) + { + uint8_t ext, cmd; + + do + { + + ext = *data++; + cmd = ext & 0x7f; + + fprintf (stderr, "extcmd = %x\n", ext);//D + + if (ext < 4) + cell->darkness = 255 - ext * 64; + } + while (cmd & 0x80); + } + else + cell->darkness = flags & 8 ? *data++ : 255; + } //TODO: don't trust server data to be in-range(!)