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

Comparing deliantra/Deliantra-Client/DC/MapWidget.pm (file contents):
Revision 1.152 by root, Sat Nov 21 05:17:28 2009 UTC vs.
Revision 1.153 by root, Thu Nov 26 07:19:12 2009 UTC

522 #d#glTranslate -$self->{sdx}, -$self->{sdy}; # anchor fow at player 522 #d#glTranslate -$self->{sdx}, -$self->{sdy}; # anchor fow at player
523 glScale $self->{tilesize}, $self->{tilesize}; 523 glScale $self->{tilesize}, $self->{tilesize};
524 524
525 if (my $tex = $self->{fow_texture}) { 525 if (my $tex = $self->{fow_texture}) {
526 glEnable GL_TEXTURE_2D; 526 glEnable GL_TEXTURE_2D;
527 glEnable GL_BLEND;
527 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 528 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
529 glBlendEquation GL_FUNC_REVERSE_SUBTRACT;
530 glBlendFunc GL_ONE, GL_ZERO;
528 531
529 my $a1 = 0.9; 532 my $a1 = 0.9;
530 533
531 if (0 && $self->{last_fow_texture}) { 534 if (0 && $self->{last_fow_texture}) {
532 my $d1 = ($self->{sdx} ** 2 + $self->{sdy} ** 2) ** 0.5; 535 my $d1 = ($self->{sdx} ** 2 + $self->{sdy} ** 2) ** 0.5;
533 my $d2 = ($self->{ldx} ** 2 + $self->{ldy} ** 2) ** 0.5; 536 my $d2 = ($self->{ldx} ** 2 + $self->{ldy} ** 2) ** 0.5;
534 537
535 if ($d1 * $d2) { 538 if ($d1 * $d2) {
536 my $a2 = $d1 / $d2; 539 my $a2 = $d1 / $d2;
537 540
538 $a1 = (1/$a2); 541 $a1 = 1 - $a2;
539 542
540 #$a1 *= 0.9; 543 #$a1 *= 0.9;
541 #$a2 *= 0.9; 544 #$a2 *= 0.9;
542 545
543 printf "%4g %4g %4g\n", $d1, $d2, $a1+$a2;#d# 546 printf "%4g %4g %4g %4g\n", $d1, $d2, $a1, $a2;#d#
544 547
545 #$a1 = 1 - (1-$a1) * 0.707; 548 #$a1 = 1 - (1-$a1) * 0.707;
546 #$a2 = 1 - (1-$a2) * 0.707; 549 #$a2 = 1 - (1-$a2) * 0.707;
547 550
548 glColor 1,0,0,1; 551 glColor 1,0,0,1;
570 #d#glTranslate +(min 0, $sdx_t), (min 0, $sdy_t); # anchor at player 573 #d#glTranslate +(min 0, $sdx_t), (min 0, $sdy_t); # anchor at player
571 glScale 1/3, 1/3; 574 glScale 1/3, 1/3;
572 $self->{fow_texture}->draw_quad_alpha (0, 0); 575 $self->{fow_texture}->draw_quad_alpha (0, 0);
573 glPopMatrix; 576 glPopMatrix;
574 577
578 glBlendEquation GL_FUNC_ADD;
575 glDisable GL_TEXTURE_2D; 579 glDisable GL_TEXTURE_2D;
580 glDisable GL_BLEND;
576 } 581 }
577 582
578 if ($self->{magicmap}) { 583 if ($self->{magicmap}) {
579 my ($x, $y, $w, $h, $data) = @{ $self->{magicmap} }; 584 my ($x, $y, $w, $h, $data) = @{ $self->{magicmap} };
580 585

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines