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.87 by root, Wed Apr 12 17:11:02 2006 UTC vs.
Revision 1.91 by root, Wed Apr 12 23:15:39 2006 UTC

1483 1483
1484 glEnable GL_TEXTURE_2D; 1484 glEnable GL_TEXTURE_2D;
1485 glEnable GL_BLEND; 1485 glEnable GL_BLEND;
1486 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 1486 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
1487 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; 1487 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
1488 glColor 1, 1, 1, 1;
1488 1489
1489 my $sw4 = ($sw + 3) & ~3; 1490 my $sw4 = ($sw + 3) & ~3;
1490 my $darkness = "\x00" x ($sw4 * $sh); 1491 my $darkness = "\x00" x ($sw4 * $sh);
1491 1492
1492 for my $x (0 .. $sw - 1) { 1493 for my $x (0 .. $sw - 1) {
1523# $lighting =~ s/(.)../$1/gs; 1524# $lighting =~ s/(.)../$1/gs;
1524# } 1525# }
1525 1526
1526 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 1527 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
1527 1528
1529 if ($::CFG->{fow_smooth}) { # smooth fog of war
1530 my @conv = (
1531 0.05, 0.05, 0.05,
1532 0.05, 0.60, 0.05,
1533 0.05, 0.05, 0.05,
1534 );
1535 CFClient::glConvolutionParameteri GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_REPLICATE_BORDER;
1536 CFClient::glConvolutionFilter2D GL_CONVOLUTION_2D,
1537 GL_ALPHA, 3, 3, GL_ALPHA, GL_FLOAT,
1538 pack "f*", @conv;
1539 glEnable GL_CONVOLUTION_2D;
1540 }
1541
1528 $darkness = new CFClient::Texture 1542 $darkness = new CFClient::Texture
1529 w => $sw4, 1543 w => $sw4,
1530 h => $sh, 1544 h => $sh,
1531 data => $darkness, 1545 data => $darkness,
1532 internalformat => GL_ALPHA, 1546 internalformat => GL_ALPHA,
1533 format => GL_ALPHA; 1547 format => GL_ALPHA;
1534 1548
1535 glColor 0.45, 0.45, 0.45, 1; 1549 glColor +($::CFG->{fow_intensity}) x 3, 1;
1536 $darkness->draw_quad (0, 0, $sw4 * 32, $sh * 32); 1550 $darkness->draw_quad (0, 0, $sw4 * 32, $sh * 32);
1551
1552 glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth};
1537 1553
1538 glDisable GL_TEXTURE_2D; 1554 glDisable GL_TEXTURE_2D;
1539 glDisable GL_BLEND; 1555 glDisable GL_BLEND;
1540 1556
1541 glEndList; 1557 glEndList;
1577 1593
1578 my $mod = $ev->key_mod; 1594 my $mod = $ev->key_mod;
1579 my $sym = $ev->key_sym; 1595 my $sym = $ev->key_sym;
1580 1596
1581 if ($sym == SDLK_KP5) { 1597 if ($sym == SDLK_KP5) {
1582 $::CONN->send ("command stay fire"); 1598 $::CONN->user_send ("command stay fire");
1583 } elsif ($sym == SDLK_a) { 1599 } elsif ($sym == SDLK_a) {
1584 $::CONN->send ("command apply"); 1600 $::CONN->user_send ("command apply");
1585 } elsif (exists $DIR{$sym}) { 1601 } elsif (exists $DIR{$sym}) {
1586 if ($mod & KMOD_SHIFT) { 1602 if ($mod & KMOD_SHIFT) {
1587 $self->{shft}++; 1603 $self->{shft}++;
1588 $::CONN->send ("command fire $DIR{$sym}[0]"); 1604 $::CONN->user_send ("command fire $DIR{$sym}[0]");
1589 } elsif ($mod & KMOD_CTRL) { 1605 } elsif ($mod & KMOD_CTRL) {
1590 $self->{ctrl}++; 1606 $self->{ctrl}++;
1591 $::CONN->send ("command run $DIR{$sym}[0]"); 1607 $::CONN->user_send ("command run $DIR{$sym}[0]");
1592 } else { 1608 } else {
1593 $::CONN->send ("command $DIR{$sym}[1]"); 1609 $::CONN->user_send ("command $DIR{$sym}[1]");
1594 } 1610 }
1595 } 1611 }
1596} 1612}
1597 1613
1598sub key_up { 1614sub key_up {
1600 1616
1601 my $mod = $ev->key_mod; 1617 my $mod = $ev->key_mod;
1602 my $sym = $ev->key_sym; 1618 my $sym = $ev->key_sym;
1603 1619
1604 if (!($mod & KMOD_SHIFT) && delete $self->{shft}) { 1620 if (!($mod & KMOD_SHIFT) && delete $self->{shft}) {
1605 $::CONN->send ("command fire_stop"); 1621 $::CONN->user_send ("command fire_stop");
1606 } 1622 }
1607 if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) { 1623 if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) {
1608 $::CONN->send ("command run_stop"); 1624 $::CONN->user_send ("command run_stop");
1609 } 1625 }
1610} 1626}
1611 1627
1612############################################################################# 1628#############################################################################
1613 1629

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines