--- deliantra/Deliantra-Client/DC/UI.pm 2007/08/02 14:35:21 1.422 +++ deliantra/Deliantra-Client/DC/UI.pm 2007/08/19 10:32:49 1.427 @@ -2046,6 +2046,8 @@ $self->{oy} = int ($self->{valign} < 0 ? $self->{padding_y} : $self->{valign} > 0 ? $self->{h} - $size->[1] - $self->{padding_y} : ($self->{h} - $size->[1]) * 0.5); + + $self->{layout}->render ($self->{ox}, $self->{oy}, $self->{style}); }; # unless ($self->{list}) { @@ -2057,7 +2059,7 @@ # # CFPlus::OpenGL::glCallList $self->{list}; - $self->{layout}->render ($self->{ox}, $self->{oy}, $self->{style}); + $self->{layout}->draw; } #sub destroy { @@ -3306,6 +3308,7 @@ my $layout = $self->get_layout ($para); $layout->render ($para->{indent}, $y - $y0); + $layout->draw; if (my @w = @{ $para->{widget} }) { my @s = $layout->get_shapes; @@ -3548,13 +3551,17 @@ $self->{timer} = Event->timer ( parked => 1, cb => sub { - return unless $::CONN && $widget; + return unless $::CONN; + + my $w = $widget + or return; - ++$widget->{frame}; - $widget->update_face; - $widget->update; + ++$w->{frame}; + $w->update_face; - $widget->update_timer; + # somehow, $widget can go away + $w->update; + $w->update_timer; }, ); @@ -3591,7 +3598,11 @@ if ($anim && @$anim) { delete $self->{wait_face}; $self->{face} = $anim->[ $self->{frame} % @$anim ]; - $self->{tex} = $::CONN->{texture}[ $::CONN->{faceid}[$self->{face}] ]; + if (my $tex = $self->{tex} = $::CONN->{texture}[ $::CONN->{faceid}[$self->{face}] ]) { + unless ($tex->{name} || $tex->{loading}) { + $tex->upload (sub { $self->reconfigure }); + } + } } } } @@ -3601,12 +3612,15 @@ if ($::CONN) { if (my $faceid = $::CONN->{faceid}[$self->{face}]) { - if (my $tex = $::CONN->{texture}[$faceid]) { - $self->{tex} = $tex; - return ($self->{size_w} || $tex->{w}, $self->{size_h} || $tex->{h}); + if (my $tex = $self->{tex} = $::CONN->{texture}[$faceid]) { + if ($tex->{name}) { + return ($self->{size_w} || $tex->{w}, $self->{size_h} || $tex->{h}); + } elsif (!$tex->{loading}) { + $tex->upload (sub { $self->reconfigure }); + } } else { $self->{wait_face} ||= $::CONN->connect_face_update ($faceid, sub { - $self->realloc; + $self->reconfigure; }); } } @@ -4201,7 +4215,7 @@ sub update { my ($self) = @_; - $::WANT_REFRESH++; + $::WANT_REFRESH->start; } sub add {