From 381c729e777b50771626703e60b422aafc791513 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 29 Sep 2008 18:01:35 +0000 Subject: adds introduction screen to the client --- src/client/client.cc | 3 --- src/client/view.cc | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 6 deletions(-) (limited to 'src/client') diff --git a/src/client/client.cc b/src/client/client.cc index a8d4ca8..ca88f88 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -246,9 +246,6 @@ void Client::notify_message(core::Message::Channel const channel, std::string co void Client::notify_zoneclear(core::Zone *zone) { - if (!zone) - return; - view::clear_zone(zone); } diff --git a/src/client/view.cc b/src/client/view.cc index bbf9088..03ce42b 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -84,6 +84,11 @@ void shutdown() void clear_zone(core::Zone *zone) { + if (!zone) { + current_zone = 0; + return; + } + for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) { core:: Entity *entity = (*it); @@ -125,6 +130,28 @@ void draw_loader() gl::end(); } +void draw_banner() +{ + using namespace render; + + render::Textures::bind("bitmaps/banner"); + + gl::begin(gl::Quads); + + glTexCoord2f(0.0f, 0.0f); + gl::vertex(0,0, 0); + + glTexCoord2f(1.0f, 0.0f); + gl::vertex(video::width,0,0); + + glTexCoord2f(1.0f, 1.0f); + gl::vertex(video::width,video::height,0); + + glTexCoord2f(0.0f, 1.0f); + gl::vertex(0,video::height,0); + + gl::end(); +} /* FIXME should be merged with the render passes @@ -349,7 +376,7 @@ void draw_status() std::stringstream status; - if (core::game()) { + if (core::game() && core::game()->interactive()) { int minutes = (int) floorf(core::game()->clientframetime() / 60.0f); int seconds = (int) floorf( core::game()->clientframetime() - (float) minutes* 60.0f); @@ -740,6 +767,16 @@ void frame(float seconds) render::Stats::clear(); + // load the intro + if (!core::application()->connected()) { + if (core::application()->load("intro")) { + current_zone = 0; + core::application()->connect(""); + if (!console()->visible()) + console()->toggle(); + } + } + if (core::application()->connected() && core::game()->serverframetime()) { if (core::localplayer()->zone() != current_zone) { @@ -754,6 +791,8 @@ void frame(float seconds) if (targets::current()) // draw target docks etc draw_entity_world_target(targets::current()); } else { + // FIXME this should be handle through a module_disconnect signal + // this should to the same as calling clear_zone(0) current_zone = 0; } @@ -765,6 +804,7 @@ void frame(float seconds) gl::matrixmode(GL_MODELVIEW); gl::loadidentity(); + gl::enable(GL_BLEND); gl::enable(GL_TEXTURE_2D); gl::color(1.0f, 1.0f, 1.0f, 1.0f); @@ -776,9 +816,11 @@ void frame(float seconds) // force console on if not connected if (!console()->visible()) console()->toggle(); - } - gl::enable(GL_BLEND); + } else if (!core::game()->interactive()) { + // draw the banner bitmap + draw_banner(); + } // draw text elements if (draw_ui->value()) { -- cgit v1.2.3