… | |
… | |
1713 | |
1713 | |
1714 | if ($::MAP) { |
1714 | if ($::MAP) { |
1715 | my $sw = int $::WIDTH / 32; |
1715 | my $sw = int $::WIDTH / 32; |
1716 | my $sh = int $::HEIGHT / 32; |
1716 | my $sh = int $::HEIGHT / 32; |
1717 | |
1717 | |
1718 | my $sx = $::CFG->{map_shift_x}; |
1718 | my $sx = $::CFG->{map_shift_x}; my $sx0 = $sx & 31; $sx = ($sx - $sx0) / 32; |
1719 | my $sy = $::CFG->{map_shift_y}; |
1719 | my $sy = $::CFG->{map_shift_y}; my $sy0 = $sy & 31; $sy = ($sy - $sy0) / 32; |
1720 | |
1720 | |
1721 | glTranslate +($sx & 31) - 32, ($sy & 31) - 32, 0; |
1721 | glTranslate $sx0 - 32, $sy0 - 32, 0; |
1722 | |
1722 | |
1723 | my ($w, $h, $data) = $::MAP->draw ($sx >> 5, $sy >> 5, 0, 0, $sw + 1, $sh + 1); |
1723 | my ($w, $h, $data) = $::MAP->draw ($sx, $sy, 0, 0, $sw + 1, $sh + 1); |
1724 | |
1724 | |
1725 | if ($::CFG->{fow_enable}) { |
1725 | if ($::CFG->{fow_enable}) { |
1726 | if ($::CFG->{fow_smooth}) { # smooth fog of war |
1726 | if ($::CFG->{fow_smooth}) { # smooth fog of war |
1727 | glConvolutionParameter GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER; |
1727 | glConvolutionParameter GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER; |
1728 | glConvolutionFilter2D |
1728 | glConvolutionFilter2D |
… | |
… | |
1759 | glDisable GL_BLEND; |
1759 | glDisable GL_BLEND; |
1760 | } |
1760 | } |
1761 | |
1761 | |
1762 | # HACK BEGIN |
1762 | # HACK BEGIN |
1763 | { |
1763 | { |
1764 | glTranslate -(($sx & 31) - 32), -(($sy & 31) - 32), 0;#remove |
1764 | glTranslate -($sx0 - 32), -($sy0 - 32), 0;#remove |
1765 | my ($w, $h) = (250, 250); |
1765 | my ($w, $h) = (250, 250); |
1766 | |
1766 | |
1767 | glEnable GL_BLEND; |
1767 | glEnable GL_BLEND; |
1768 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1768 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1769 | glEnable GL_TEXTURE_2D; |
1769 | glEnable GL_TEXTURE_2D; |