ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.51 by root, Mon Apr 10 11:41:17 2006 UTC vs.
Revision 1.52 by root, Mon Apr 10 11:55:16 2006 UTC

806 806
807sub key_up { 807sub key_up {
808} 808}
809 809
810sub size_request { 810sub size_request {
811 811 (
812} 812 1 + int $::WIDTH / 32,
813 813 1 + int $::HEIGHT / 32,
814sub size_allocate { 814 )
815} 815}
816 816
817sub _draw { 817sub _draw {
818 my ($self) = @_; 818 my ($self) = @_;
819 819
852 my $cell = $map->[$x + $xofs][$y + $yofs] 852 my $cell = $map->[$x + $xofs][$y + $yofs]
853 or next; 853 or next;
854 854
855 my $darkness = $cell->[0] * (1 / 255); 855 my $darkness = $cell->[0] * (1 / 255);
856 if ($darkness < 0) { 856 if ($darkness < 0) {
857 $darkness = 0.15; 857 $darkness = $cell->[1] ? 0.2 : 0;
858 } 858 }
859 substr $lighting, $y * $sw4 + $x, 1, chr 255 - $darkness * 255; 859 substr $lighting, $y * $sw4 + $x, 1, chr 255 - $darkness * 255;
860 860
861 for my $num (grep $_, @$cell[1,2,3]) { 861 for my $num (grep $_, @$cell[1,2,3]) {
862 my $tex = $::CONN->{face}[$num]{texture} || next; 862 my $tex = $::CONN->{face}[$num]{texture} || next;
891 891
892 $lighting = new Crossfire::Client::Texture 892 $lighting = new Crossfire::Client::Texture
893 width => $sw4, 893 width => $sw4,
894 height => $sh, 894 height => $sh,
895 data => $lighting, 895 data => $lighting,
896 internalformat => GL_ALPHA4, 896 internalformat => GL_ALPHA,
897 format => GL_ALPHA; 897 format => GL_ALPHA;
898 898
899 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 899 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
900 glColor 0, 0, 0, 0.75; 900 glColor 1, 1, 1, 1;
901 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 901 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
902 glBindTexture GL_TEXTURE_2D, $lighting->{name}; 902 glBindTexture GL_TEXTURE_2D, $lighting->{name};
903 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR; 903 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR;
904 glBegin GL_QUADS; 904 glBegin GL_QUADS;
905 glTexCoord 0, 0; glVertex 0 , 0; 905 glTexCoord 0, 0; glVertex 0 , 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines