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.108 by root, Wed Apr 25 01:12:31 2007 UTC vs.
Revision 1.109 by root, Tue Jul 17 17:39:07 2007 UTC

24 can_focus => 1, 24 can_focus => 1,
25 list => glGenList, 25 list => glGenList,
26 tilesize => 32, 26 tilesize => 32,
27 27
28 smooth_matrix => [ 28 smooth_matrix => [
29 0.05, 0.13, 0.05, 29 0.30, 0.50, 0.30,
30 0.13, 0.30, 0.13,
31 0.05, 0.13, 0.05, 30 0.50, 0.50, 0.50,
31 0.30, 0.50, 0.30,
32 ], 32 ],
33 33
34 @_ 34 @_
35 ); 35 );
36 36
468 468
469 my $dx = $self->{dx} = CFPlus::ceil 0.5 * ($::MAP->w - $sw) - $sx; 469 my $dx = $self->{dx} = CFPlus::ceil 0.5 * ($::MAP->w - $sw) - $sx;
470 my $dy = $self->{dy} = CFPlus::ceil 0.5 * ($::MAP->h - $sh) - $sy; 470 my $dy = $self->{dy} = CFPlus::ceil 0.5 * ($::MAP->h - $sh) - $sy;
471 471
472 if ($::CFG->{fow_enable}) { 472 if ($::CFG->{fow_enable}) {
473 my ($w, $h, $data) = $::MAP->fow_texture ($dx, $dy, $sw, $sh); 473 my ($w, $h, $data) = $::MAP->fow_texture (
474 474 $dx, $dy, $sw, $sh,
475 if ($::CFG->{fow_smooth} && $CFPlus::OpenGL::GL_VERSION >= 1.2) { # smooth fog of war 475 $::CFG->{fow_smooth},
476 glConvolutionParameter (GL_CONVOLUTION_2D, GL_CONVOLUTION_BORDER_MODE, GL_CONSTANT_BORDER);
477 glConvolutionFilter2D (
478 GL_CONVOLUTION_2D,
479 GL_ALPHA,
480 3, 3,
481 GL_ALPHA, GL_FLOAT,
482 (pack "f*", @{ $self->{smooth_matrix} }), 476 pack "f*", @{ $self->{smooth_matrix} },
483 ); 477 );
484 glEnable GL_CONVOLUTION_2D;
485 }
486 478
487 $self->{fow_texture} = new CFPlus::Texture 479 $self->{fow_texture} = new CFPlus::Texture
488 w => $w, 480 w => $w,
489 h => $h, 481 h => $h,
490 data => $data, 482 data => $data,
491 internalformat => GL_ALPHA, 483 internalformat => GL_ALPHA,
492 format => GL_ALPHA; 484 format => GL_ALPHA;
493
494 glDisable GL_CONVOLUTION_2D if $::CFG->{fow_smooth};
495 } else { 485 } else {
496 delete $self->{fow_texture}; 486 delete $self->{fow_texture};
497 } 487 }
498 488
499 glNewList $self->{list}; 489 glNewList $self->{list};
505 $::MAP->draw ($dx, $dy, $sw, $sh, $self->{tilesize}); 495 $::MAP->draw ($dx, $dy, $sw, $sh, $self->{tilesize});
506 496
507 glScale $self->{tilesize}, $self->{tilesize}; 497 glScale $self->{tilesize}, $self->{tilesize};
508 498
509 if (my $tex = $self->{fow_texture}) { 499 if (my $tex = $self->{fow_texture}) {
500 glPushMatrix;
501 #glScale 1/3, 1/3 if $::CFG->{fow_smooth};
510 glEnable GL_TEXTURE_2D; 502 glEnable GL_TEXTURE_2D;
511 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 503 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
512 504
513 glColor +($::CFG->{fow_intensity}) x 3, 0.9; 505 glColor +($::CFG->{fow_intensity}) x 3, 0.9;
514 $self->{fow_texture}->draw_quad_alpha (0, 0); 506 $self->{fow_texture}->draw_quad_alpha (0, 0);
515 507
516 glDisable GL_TEXTURE_2D; 508 glDisable GL_TEXTURE_2D;
509 glPopMatrix;
517 } 510 }
518 511
519 if ($self->{magicmap}) { 512 if ($self->{magicmap}) {
520 my ($x, $y, $w, $h, $data) = @{ $self->{magicmap} }; 513 my ($x, $y, $w, $h, $data) = @{ $self->{magicmap} };
521 514

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines