… | |
… | |
1709 | my ($self) = @_; |
1709 | my ($self) = @_; |
1710 | |
1710 | |
1711 | if (delete $self->{need_update}) { |
1711 | if (delete $self->{need_update}) { |
1712 | glNewList $self->{list}, GL_COMPILE; |
1712 | glNewList $self->{list}, GL_COMPILE; |
1713 | |
1713 | |
1714 | my $sw = int $::WIDTH / 32; |
|
|
1715 | my $sh = int $::HEIGHT / 32; |
|
|
1716 | |
|
|
1717 | if ($::MAP) { |
1714 | if ($::MAP) { |
|
|
1715 | my $sw = int $::WIDTH / 32; |
|
|
1716 | my $sh = int $::HEIGHT / 32; |
|
|
1717 | |
1718 | my $sx = $::CFG->{map_shift_x}; |
1718 | my $sx = $::CFG->{map_shift_x}; |
1719 | my $sy = $::CFG->{map_shift_y}; |
1719 | my $sy = $::CFG->{map_shift_y}; |
1720 | |
1720 | |
1721 | glTranslate +($sx & 31) - 32, ($sy & 31) - 32, 0; |
1721 | glTranslate +($sx & 31) - 32, ($sy & 31) - 32, 0; |
1722 | |
1722 | |
… | |
… | |
1746 | format => GL_ALPHA; |
1746 | format => GL_ALPHA; |
1747 | |
1747 | |
1748 | glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth}; |
1748 | glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth}; |
1749 | |
1749 | |
1750 | glEnable GL_BLEND; |
1750 | glEnable GL_BLEND; |
|
|
1751 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
1751 | glEnable GL_TEXTURE_2D; |
1752 | glEnable GL_TEXTURE_2D; |
1752 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; |
1753 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; |
1753 | |
1754 | |
1754 | glColor +($::CFG->{fow_intensity}) x 3, 1; |
1755 | glColor +($::CFG->{fow_intensity}) x 3, 1; |
1755 | $tex->draw_quad (0, 0, $w * 32, $h * 32); |
1756 | $tex->draw_quad (0, 0, $w * 32, $h * 32); |
1756 | |
1757 | |
1757 | glDisable GL_TEXTURE_2D; |
1758 | glDisable GL_TEXTURE_2D; |
1758 | glDisable GL_BLEND; |
1759 | glDisable GL_BLEND; |
1759 | } |
1760 | } |
|
|
1761 | |
|
|
1762 | # HACK BEGIN |
|
|
1763 | { |
|
|
1764 | my ($w, $h) = (250, 250); |
|
|
1765 | |
|
|
1766 | glEnable GL_BLEND; |
|
|
1767 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
|
|
1768 | glEnable GL_TEXTURE_2D; |
|
|
1769 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
|
|
1770 | |
|
|
1771 | CFClient::Texture->new ( |
|
|
1772 | w => $w, |
|
|
1773 | h => $h, |
|
|
1774 | data => $::MAP->mapmap ($w, $h), |
|
|
1775 | type => GL_UNSIGNED_INT_8_8_8_8_REV |
|
|
1776 | )->draw_quad (100, 100); |
|
|
1777 | |
|
|
1778 | glDisable GL_TEXTURE_2D; |
|
|
1779 | glDisable GL_BLEND; |
|
|
1780 | } |
|
|
1781 | # HACK END |
1760 | } |
1782 | } |
1761 | |
1783 | |
1762 | glEndList; |
1784 | glEndList; |
1763 | } |
1785 | } |
1764 | |
1786 | |