From 0d831968949b1119db48530a86c2d1651c6cbfc6 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 11 Oct 2008 09:37:23 +0000 Subject: zonechange events, menu previous command --- src/client/client.cc | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'src/client/client.cc') 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 -- cgit v1.2.3