… | |
… | |
345 | } smooth_key; |
345 | } smooth_key; |
346 | |
346 | |
347 | static void |
347 | static void |
348 | smooth_or_bits (HV *hv, smooth_key *key, IV bits) |
348 | smooth_or_bits (HV *hv, smooth_key *key, IV bits) |
349 | { |
349 | { |
350 | SV **sv = hv_fetch (hv, (char *)key, sizeof (key), 1); |
350 | SV **sv = hv_fetch (hv, (char *)key, sizeof (*key), 1); |
351 | |
351 | |
352 | if (SvIOK (*sv)) |
352 | if (SvIOK (*sv)) |
353 | SvIV_set (*sv, SvIVX (*sv) | bits); |
353 | SvIV_set (*sv, SvIVX (*sv) | bits); |
354 | else |
354 | else |
355 | sv_setiv (*sv, bits); |
355 | sv_setiv (*sv, bits); |
… | |
… | |
1460 | } |
1460 | } |
1461 | else if (cmd == 6) // monster width |
1461 | else if (cmd == 6) // monster width |
1462 | cell->stat_width = *data++ + 1; |
1462 | cell->stat_width = *data++ + 1; |
1463 | else if (cmd == 0x47) |
1463 | else if (cmd == 0x47) |
1464 | { |
1464 | { |
1465 | if (*data == 8) |
1465 | if (*data == 4) |
1466 | ; // decode player uuid |
1466 | ; // decode player count |
1467 | |
1467 | |
1468 | data += *data + 1; |
1468 | data += *data + 1; |
1469 | } |
1469 | } |
1470 | else if (cmd == 8) // cell flags |
1470 | else if (cmd == 8) // cell flags |
1471 | cell->flags = *data++; |
1471 | cell->flags = *data++; |
… | |
… | |
1712 | } |
1712 | } |
1713 | } |
1713 | } |
1714 | } |
1714 | } |
1715 | } |
1715 | } |
1716 | |
1716 | |
1717 | // go through all smoothlevels, lowest to highest, then draw |
1717 | // go through all smoothlevels, lowest to highest, then draw. |
1718 | // this is basically counting sort |
1718 | // this is basically counting sort |
1719 | { |
1719 | { |
1720 | int w, b; |
1720 | int w, b; |
1721 | |
1721 | |
1722 | for (w = 0; w < 256 / 32; ++w) |
1722 | for (w = 0; w < 256 / 32; ++w) |