… | |
… | |
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) { |
… | |
… | |
1577 | |
1578 | |
1578 | my $mod = $ev->key_mod; |
1579 | my $mod = $ev->key_mod; |
1579 | my $sym = $ev->key_sym; |
1580 | my $sym = $ev->key_sym; |
1580 | |
1581 | |
1581 | if ($sym == SDLK_KP5) { |
1582 | if ($sym == SDLK_KP5) { |
1582 | $::CONN->send ("command stay fire"); |
1583 | $::CONN->user_send ("command stay fire"); |
1583 | } elsif ($sym == SDLK_a) { |
1584 | } elsif ($sym == SDLK_a) { |
1584 | $::CONN->send ("command apply"); |
1585 | $::CONN->user_send ("command apply"); |
1585 | } elsif (exists $DIR{$sym}) { |
1586 | } elsif (exists $DIR{$sym}) { |
1586 | if ($mod & KMOD_SHIFT) { |
1587 | if ($mod & KMOD_SHIFT) { |
1587 | $self->{shft}++; |
1588 | $self->{shft}++; |
1588 | $::CONN->send ("command fire $DIR{$sym}[0]"); |
1589 | $::CONN->user_send ("command fire $DIR{$sym}[0]"); |
1589 | } elsif ($mod & KMOD_CTRL) { |
1590 | } elsif ($mod & KMOD_CTRL) { |
1590 | $self->{ctrl}++; |
1591 | $self->{ctrl}++; |
1591 | $::CONN->send ("command run $DIR{$sym}[0]"); |
1592 | $::CONN->user_send ("command run $DIR{$sym}[0]"); |
1592 | } else { |
1593 | } else { |
1593 | $::CONN->send ("command $DIR{$sym}[1]"); |
1594 | $::CONN->user_send ("command $DIR{$sym}[1]"); |
1594 | } |
1595 | } |
1595 | } |
1596 | } |
1596 | } |
1597 | } |
1597 | |
1598 | |
1598 | sub key_up { |
1599 | sub key_up { |
… | |
… | |
1600 | |
1601 | |
1601 | my $mod = $ev->key_mod; |
1602 | my $mod = $ev->key_mod; |
1602 | my $sym = $ev->key_sym; |
1603 | my $sym = $ev->key_sym; |
1603 | |
1604 | |
1604 | if (!($mod & KMOD_SHIFT) && delete $self->{shft}) { |
1605 | if (!($mod & KMOD_SHIFT) && delete $self->{shft}) { |
1605 | $::CONN->send ("command fire_stop"); |
1606 | $::CONN->user_send ("command fire_stop"); |
1606 | } |
1607 | } |
1607 | if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) { |
1608 | if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) { |
1608 | $::CONN->send ("command run_stop"); |
1609 | $::CONN->user_send ("command run_stop"); |
1609 | } |
1610 | } |
1610 | } |
1611 | } |
1611 | |
1612 | |
1612 | ############################################################################# |
1613 | ############################################################################# |
1613 | |
1614 | |