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.379 by root, Tue Jul 17 12:04:18 2007 UTC vs.
Revision 1.381 by root, Thu Jul 19 13:45:18 2007 UTC

2381 2381
2382use CFPlus::OpenGL; 2382use CFPlus::OpenGL;
2383 2383
2384my @tex = 2384my @tex =
2385 map { new_from_file CFPlus::Texture CFPlus::find_rcfile $_, mipmap => 1 } 2385 map { new_from_file CFPlus::Texture CFPlus::find_rcfile $_, mipmap => 1 }
2386 qw(b1_button_active.png); 2386 qw(b1_button_inactive.png b1_button_active.png);
2387 2387
2388sub new { 2388sub new {
2389 my $class = shift; 2389 my $class = shift;
2390 2390
2391 $class->SUPER::new ( 2391 $class->SUPER::new (
2392 padding_x => 4, 2392 padding_x => 4,
2393 padding_y => 4, 2393 padding_y => 4,
2394 fg => [1, 1, 1], 2394 fg => [1.0, 1.0, 1.0],
2395 active_fg => [0, 0, 1], 2395 active_fg => [0.8, 0.8, 0.8],
2396 can_hover => 1, 2396 can_hover => 1,
2397 align => 0, 2397 align => 0,
2398 valign => 0, 2398 valign => 0,
2399 can_events => 1, 2399 can_events => 1,
2400 @_ 2400 @_
2418 2418
2419 glEnable GL_TEXTURE_2D; 2419 glEnable GL_TEXTURE_2D;
2420 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; 2420 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
2421 glColor 0, 0, 0, 1; 2421 glColor 0, 0, 0, 1;
2422 2422
2423 my $tex = $tex[$GRAB == $self];
2423 $tex[0]->draw_quad_alpha (0, 0, $self->{w}, $self->{h}); 2424 $tex->draw_quad_alpha (0, 0, $self->{w}, $self->{h});
2424 2425
2425 glDisable GL_TEXTURE_2D; 2426 glDisable GL_TEXTURE_2D;
2426 2427
2427 $self->SUPER::_draw; 2428 $self->SUPER::_draw;
2428} 2429}
3498 $widget->{animspeed} = List::Util::max 0.05, $widget->{animspeed}; 3499 $widget->{animspeed} = List::Util::max 0.05, $widget->{animspeed};
3499 $widget->{anim_start} = $self->{animspeed} * Event::time / $self->{animspeed}; 3500 $widget->{anim_start} = $self->{animspeed} * Event::time / $self->{animspeed};
3500 $self->{timer} = Event->timer ( 3501 $self->{timer} = Event->timer (
3501 parked => 1, 3502 parked => 1,
3502 cb => sub { 3503 cb => sub {
3503 return unless $::CONN; 3504 return unless $::CONN && $widget;
3504
3505 if (!$widget) {#d#
3506 warn "animation widget timer active but widgetd estroyed\n";#d#
3507 warn $_[0]->w->active;#d#
3508 }#d#
3509 3505
3510 ++$widget->{frame}; 3506 ++$widget->{frame};
3511 $widget->update_face; 3507 $widget->update_face;
3512 $widget->update; 3508 $widget->update;
3513 3509
4262 while ($self->{post_alloc_hook}) { 4258 while ($self->{post_alloc_hook}) {
4263 $_->() 4259 $_->()
4264 for values %{delete $self->{post_alloc_hook}}; 4260 for values %{delete $self->{post_alloc_hook}};
4265 } 4261 }
4266 4262
4267
4268 glViewport 0, 0, $::WIDTH, $::HEIGHT; 4263 glViewport 0, 0, $::WIDTH, $::HEIGHT;
4269 glClearColor +($::CFG->{fow_intensity}) x 3, 1; 4264 glClearColor +($::CFG->{fow_intensity}) x 3, 1;
4270 glClear GL_COLOR_BUFFER_BIT; 4265 glClear GL_COLOR_BUFFER_BIT;
4271 4266
4272 glMatrixMode GL_PROJECTION; 4267 glMatrixMode GL_PROJECTION;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines