| 633 | } |
| 634 | |
| 635 | void DoUnLight(int nXPos, int nYPos, int nRadius) |
| 636 | { |
| 637 | int x, y, min_x, min_y, max_x, max_y; |
| 638 | |
| 639 | nRadius++; |
| 640 | min_y = nYPos - nRadius; |
| 641 | max_y = nYPos + nRadius; |
| 642 | min_x = nXPos - nRadius; |
| 643 | max_x = nXPos + nRadius; |
| 644 | |
| 645 | if (min_y < 0) { |
| 646 | min_y = 0; |
| 647 | } |
| 648 | if (max_y > MAXDUNY) { |
| 649 | max_y = MAXDUNY; |
| 650 | } |
| 651 | if (min_x < 0) { |
| 652 | min_x = 0; |
| 653 | } |
| 654 | if (max_x > MAXDUNX) { |
| 655 | max_x = MAXDUNX; |
| 656 | } |
| 657 | |
| 658 | for (y = min_y; y < max_y; y++) { |
| 659 | for (x = min_x; x < max_x; x++) { |
| 660 | if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY) { |
| 661 | dLight[x][y] = dPreLight[x][y]; |
| 662 | } |
| 663 | } |
| 664 | } |
| 665 | } |
| 666 | |
| 667 | void DoUnVision(int nXPos, int nYPos, int nRadius) |
| 668 | { |