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.90 by root, Wed Apr 12 21:35:11 2006 UTC vs.
Revision 1.94 by root, Thu Apr 13 23:07:57 2006 UTC

1454} 1454}
1455 1455
1456sub draw { 1456sub draw {
1457 my ($self) = @_; 1457 my ($self) = @_;
1458 1458
1459 $self->{need_update}++;#d#
1459 if (delete $self->{need_update}) { 1460 if (delete $self->{need_update}) {
1460 glNewList $self->{list}, GL_COMPILE; 1461 glNewList $self->{list}, GL_COMPILE;
1462
1463 my $sw = int $::WIDTH / 32;
1464 my $sh = int $::HEIGHT / 32;
1465
1466 $::MAP->draw (0, 0, $sw, $sh) if $::MAP;
1467
1468 if (0) {
1461 1469
1462 my $mx = $::CONN->{mapx}; 1470 my $mx = $::CONN->{mapx};
1463 my $my = $::CONN->{mapy}; 1471 my $my = $::CONN->{mapy};
1464 1472
1465 my $map = $::CONN->{map}; 1473 my $map = $::CONN->{map};
1512 $tex->draw_quad (($x + 1) * 32 - $w, ($y + 1) * 32 - $h, $w, $h); 1520 $tex->draw_quad (($x + 1) * 32 - $w, ($y + 1) * 32 - $h, $w, $h);
1513 } 1521 }
1514 } 1522 }
1515 } 1523 }
1516 1524
1517# if (1) { # higher quality darkness
1518# $lighting =~ s/(.)/$1$1$1/gs;
1519# my $pb = new_from_data Gtk2::Gdk::Pixbuf $lighting, "rgb", 0, 8, $sw4, $sh, $sw4 * 3;
1520#
1521# $pb = $pb->scale_simple ($sw4 * 0.5, $sh * 0.5, "bilinear");
1522#
1523# $lighting = $pb->get_pixels;
1524# $lighting =~ s/(.)../$1/gs;
1525# }
1526
1527 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 1525 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
1526
1527 if ($::CFG->{fow_smooth}) { # smooth fog of war
1528 my @conv = (
1529 0.1, 0.1, 0.1,
1530 0.1, 0.2, 0.1,
1531 0.1, 0.1, 0.1,
1532 );
1533 glConvolutionParameter GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER;
1534 glConvolutionFilter2D GL_CONVOLUTION_2D,
1535 GL_ALPHA, 3, 3, GL_ALPHA, GL_FLOAT,
1536 pack "f*", @conv;
1537 glEnable GL_CONVOLUTION_2D;
1538 }
1528 1539
1529 $darkness = new CFClient::Texture 1540 $darkness = new CFClient::Texture
1530 w => $sw4, 1541 w => $sw4,
1531 h => $sh, 1542 h => $sh,
1532 data => $darkness, 1543 data => $darkness,
1534 format => GL_ALPHA; 1545 format => GL_ALPHA;
1535 1546
1536 glColor +($::CFG->{fow_intensity}) x 3, 1; 1547 glColor +($::CFG->{fow_intensity}) x 3, 1;
1537 $darkness->draw_quad (0, 0, $sw4 * 32, $sh * 32); 1548 $darkness->draw_quad (0, 0, $sw4 * 32, $sh * 32);
1538 1549
1550 glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth};
1551
1539 glDisable GL_TEXTURE_2D; 1552 glDisable GL_TEXTURE_2D;
1540 glDisable GL_BLEND; 1553 glDisable GL_BLEND;
1554 }
1541 1555
1542 glEndList; 1556 glEndList;
1543 } 1557 }
1544 1558
1545 glCallList $self->{list}; 1559 glCallList $self->{list};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines