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

Comparing deliantra/Deliantra-Client/bin/deliantra (file contents):
Revision 1.15 by root, Wed Dec 26 18:20:46 2007 UTC vs.
Revision 1.16 by root, Wed Dec 26 19:11:13 2007 UTC

2275 if ($ENV{CFPLUS_DEBUG} & 4) { 2275 if ($ENV{CFPLUS_DEBUG} & 4) {
2276 $fps = $fps * 0.98 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.02; 2276 $fps = $fps * 0.98 + 1 / (($NOW - $LAST_REFRESH) || 0.1) * 0.02;
2277 debug sprintf "%3.2f", $fps; 2277 debug sprintf "%3.2f", $fps;
2278 } 2278 }
2279 2279
2280 $WANT_REFRESH->stop; 2280 undef $WANT_REFRESH;
2281 $_[0]->stop;
2281 2282
2282 $CFPlus::UI::ROOT->draw; 2283 $CFPlus::UI::ROOT->draw;
2283 CFPlus::SDL_GL_SwapBuffers; 2284 CFPlus::SDL_GL_SwapBuffers;
2284 $LAST_REFRESH = $NOW; 2285 $LAST_REFRESH = $NOW;
2285} 2286}
2286 2287
2287$WANT_REFRESH = EV::idle_ns \&force_refresh; 2288my $want_refresh = EV::idle_ns \&force_refresh;
2288 2289
2289# 0.015 is server tick time / 8 ~~ 66.6...hz
2290my $input = EV::periodic 0, 0.015, undef, sub { 2290my $input = EV::periodic 0, 1/60, undef, sub {
2291 $NOW = time; 2291 $NOW = time;
2292 2292
2293 ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_) 2293 ($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_)
2294 for CFPlus::poll_events; 2294 for CFPlus::poll_events;
2295 2295
2296 if (%animate_object) { 2296 if (%animate_object) {
2297 $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; 2297 $_->animate ($LAST_REFRESH - $NOW) for values %animate_object;
2298 $WANT_REFRESH->start; 2298 $WANT_REFRESH = 1;
2299 } 2299 }
2300
2301 $want_refresh->start
2302 if $WANT_REFRESH;
2300}; 2303};
2301 2304
2302sub animation_start { 2305sub animation_start {
2303 my ($widget) = @_; 2306 my ($widget) = @_;
2304 $animate_object{$widget} = $widget; 2307 $animate_object{$widget} = $widget;
2479 2482
2480EV::loop; 2483EV::loop;
2481 2484
2482#video_shutdown; 2485#video_shutdown;
2483#audio_shutdown; 2486#audio_shutdown;
2487CFPlus::OpenGL::quit;
2484CFPlus::SDL_Quit; 2488CFPlus::SDL_Quit;
2485CFPlus::DB::Server::stop; 2489CFPlus::DB::Server::stop;
2486 2490
2487=head1 NAME 2491=head1 NAME
2488 2492

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines