diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-11 09:37:23 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-11 09:37:23 +0000 |
commit | 0d831968949b1119db48530a86c2d1651c6cbfc6 (patch) | |
tree | 925e02481149fa8ac227017af74818176b166a41 /src/client/client.cc | |
parent | 02fcd22d8cde355aa898a8c6bb4773d9434b8e9a (diff) |
zonechange events, menu previous command
Diffstat (limited to 'src/client/client.cc')
-rw-r--r-- | src/client/client.cc | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/src/client/client.cc b/src/client/client.cc index 81aba9d..3f368a7 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -141,8 +141,9 @@ void Client::run() // default framerate 125fps, 8 milliseconds Uint32 client_frame_lenght = 8; - Uint32 client_previous_timestamp = 0; Uint32 client_current_timestamp = 0; + Uint32 client_previous_timestamp = 0; + console()->flush(); console()->clear_notify(); @@ -158,7 +159,7 @@ void Client::run() (*cl_framerate) = 1000.0f; } - if (cl_framerate->value()) { + if (cl_framerate->value()) { client_frame_lenght = (Uint32) roundf(1000.0f / cl_framerate->value()); } else { client_frame_lenght = 0; @@ -234,14 +235,28 @@ void Client::shutdown() quit(0); } -void Client::notify_sound(const char * name) +/* -- notifications from core::Application ------------------------- */ + +void Client::notify_connect() { - audio::play(name); + ui::root()->hide_window(); } -void Client::notify_remove_sound(size_t source) +void Client::notify_disconnect() { - audio::Sources::remove(source); + // FIXME unload sounds + //audio::reset(); + render::reset(); +} + +void Client::notify_zonechange() +{ + render::unload(); +} + +void Client::notify_sound(const char * name) +{ + audio::play(name); } void Client::notify_message(core::Message::Channel const channel, std::string const message) @@ -270,26 +285,18 @@ void Client::notify_message(core::Message::Channel const channel, std::string co break; } - con_print << message << std::endl; + con_print << message << std::endl; console()->notify(message); } -void Client::notify_zoneclear(core::Zone *zone) -{ - view::clear_zone(zone); -} +/* FIXME -void Client::notify_disconnect() -{ - // FIXME unload sounds - render::unload(); - view::clear_zone(0); -} + these notifications are hacks and need to be fixed +*/ -void Client::notify_connect() +void Client::notify_remove_sound(size_t source) { - ui::root()->hide_window(); - view::clear_zone(0); + audio::Sources::remove(source); } } // namespace client |