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

Comparing deliantra/Deliantra-Client/DC/Protocol.pm (file contents):
Revision 1.209 by root, Sun Jan 11 22:11:23 2009 UTC vs.
Revision 1.214 by root, Tue Dec 22 00:35:44 2009 UTC

18 18
19our $TEX_DIALOGUE = new_from_resource DC::Texture 19our $TEX_DIALOGUE = new_from_resource DC::Texture
20 "dialogue.png", minify => 1, mipmap => 1; 20 "dialogue.png", minify => 1, mipmap => 1;
21 21
22our $TEX_NOFACE = new_from_resource DC::Texture 22our $TEX_NOFACE = new_from_resource DC::Texture
23 "noface.png", minify => 1, mipmap => 1; 23 "noface.png", minify => 1, mipmap => 1, wrap => 1;
24
25our $TEX_HIDDEN = new_from_resource DC::Texture
26 "hidden.png", minify => 1, mipmap => 1;
27 24
28sub MIN_TEXTURE_UNUSED() { 1 }#d# 25sub MIN_TEXTURE_UNUSED() { 1 }#d#
29 26
30sub new { 27sub new {
31 my ($class, %arg) = @_; 28 my ($class, %arg) = @_;
96 } 93 }
97 94
98 { 95 {
99 $self->{noface} = my $tex = $TEX_NOFACE; 96 $self->{noface} = my $tex = $TEX_NOFACE;
100 $self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}}); 97 $self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}});
101 }
102
103 {
104 $self->{hidden} = my $tex = $TEX_HIDDEN;
105 $self->{map}->set_texture (3, @$tex{qw(name w h s t)}, @{$tex->{minified}});
106 } 98 }
107 99
108# $self->{expire_count} = DC::DB::FIRST_TILE_ID; # minimum non-fixed tile id 100# $self->{expire_count} = DC::DB::FIRST_TILE_ID; # minimum non-fixed tile id
109# $self->{expire_w} = EV::timer 1, 1, sub { 101# $self->{expire_w} = EV::timer 1, 1, sub {
110# my $count = (int @{ $self->{texture} } / MIN_TEXTURE_UNUSED) || 1; 102# my $count = (int @{ $self->{texture} } / MIN_TEXTURE_UNUSED) || 1;
410 ? (($new & $_ ? "+" : "-") . $self->{spell_paths}{$_}) 402 ? (($new & $_ ? "+" : "-") . $self->{spell_paths}{$_})
411 : () 403 : ()
412 } 404 }
413 sort { $a <=> $b } keys %{$self->{spell_paths}}; 405 sort { $a <=> $b } keys %{$self->{spell_paths}};
414 406
415 join "", @diff 407 "\u$name: " . (join ", ", @diff)
416} 408}
417 409
418# all stats that are chacked against changes 410# all stats that are chacked against changes
419my @statchange = ( 411my @statchange = (
420 [&CS_STAT_STR => \&_stat_numdiff, "Str"], 412 [&CS_STAT_STR => \&_stat_numdiff, "Str"],
475 } 467 }
476 468
477 if ( 469 if (
478 my @diffs = map $_->[1]->($self, $_->[2], $prev->{$_->[0]}, $stats->{$_->[0]}), @statchange 470 my @diffs = map $_->[1]->($self, $_->[2], $prev->{$_->[0]}, $stats->{$_->[0]}), @statchange
479 ) { 471 ) {
480 my $msg = "<b>stat change</b>: " . (join " ", @diffs); 472 my $msg = "<b>stat change</b>: " . (join " ", map "($_)", @diffs);
481 $self->{statusbox}->add ($msg, group => "stat $msg", fg => [0.8, 1, 0.2, 1], timeout => 20); 473 $self->{statusbox}->add ($msg, group => "stat $msg", fg => [0.8, 1, 0.2, 1], timeout => 20);
482 } 474 }
483 475
484 $self->update_stats_window ($stats, $prev); 476 $self->update_stats_window ($stats, $prev);
485 477
998 990
999 my $tex = $self->{texture}[$tile] ||= 991 my $tex = $self->{texture}[$tile] ||=
1000 new DC::Texture 992 new DC::Texture
1001 tile => $tile, 993 tile => $tile,
1002 image => $data, delete_image => 1, 994 image => $data, delete_image => 1,
1003 minify => 1, mipmap => 1; 995 minify => 1;
1004 996
1005 if (my $cbs = delete $self->{tile_cb}{$tile}) { 997 if (my $cbs = delete $self->{tile_cb}{$tile}) {
1006 $_->($tex) for @$cbs; 998 $_->($tex) for @$cbs;
1007 } 999 }
1008} 1000}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines